From 474220ce8e43773c35ad19d281293243c1d2f0ff Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Tue, 13 Dec 2022 15:00:52 +1300 Subject: [PATCH] Fresh Frontend Build --- .../{index-legacy-f27062cd.js => index-legacy-1d92538f.js} | 4 ++-- frontend/dist/assets/{index.d8f54146.js => index.4a434b56.js} | 4 ++-- frontend/dist/index.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename frontend/dist/assets/{index-legacy-f27062cd.js => index-legacy-1d92538f.js} (71%) rename frontend/dist/assets/{index.d8f54146.js => index.4a434b56.js} (89%) diff --git a/frontend/dist/assets/index-legacy-f27062cd.js b/frontend/dist/assets/index-legacy-1d92538f.js similarity index 71% rename from frontend/dist/assets/index-legacy-f27062cd.js rename to frontend/dist/assets/index-legacy-1d92538f.js index afc0964c9f..fd07b3878e 100644 --- a/frontend/dist/assets/index-legacy-f27062cd.js +++ b/frontend/dist/assets/index-legacy-1d92538f.js @@ -26,7 +26,7 @@ var q=i.exports,Z=G.exports;function Y(e){for(var t="https://reactjs.org/docs/er * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */!function(e,t){(function(){var n,o="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",s=16,l=32,c=64,u=128,d=256,h=1/0,f=9007199254740991,p=NaN,g=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",l],["partialRight",c],["rearg",d]],v="[object Arguments]",b="[object Array]",y="[object Boolean]",x="[object Date]",w="[object Error]",S="[object Function]",k="[object GeneratorFunction]",C="[object Map]",_="[object Number]",E="[object Object]",L="[object Promise]",P="[object RegExp]",M="[object Set]",A="[object String]",T="[object Symbol]",O="[object WeakMap]",I="[object ArrayBuffer]",R="[object DataView]",N="[object Float32Array]",D="[object Float64Array]",z="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",j="[object Uint8Array]",H="[object Uint8ClampedArray]",W="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,Y=RegExp(q.source),X=RegExp(Z.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(re.source),ie=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,ke="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Le="A-Z\\xc0-\\xd6\\xd8-\\xde",Pe="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="['’]",Te="["+ke+"]",Oe="["+Me+"]",Ie="["+Ce+"]",Re="\\d+",Ne="["+_e+"]",De="["+Ee+"]",ze="[^"+ke+Me+Re+_e+Ee+Le+"]",Be="\\ud83c[\\udffb-\\udfff]",Fe="[^"+ke+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Le+"]",Ue="\\u200d",Ve="(?:"+De+"|"+ze+")",Ge="(?:"+We+"|"+ze+")",$e="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ze="(?:"+Ie+"|"+Be+")"+"?",Ye="["+Pe+"]?",Xe=Ye+Ze+("(?:"+Ue+"(?:"+[Fe,je,He].join("|")+")"+Ye+Ze+")*"),Ke="(?:"+[Ne,je,He].join("|")+")"+Xe,Qe="(?:"+[Fe+Ie+"?",Ie,je,He,Te].join("|")+")",Je=RegExp(Ae,"g"),et=RegExp(Ie,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Xe,"g"),nt=RegExp([We+"?"+De+"+"+$e+"(?="+[Oe,We,"$"].join("|")+")",Ge+"+"+qe+"(?="+[Oe,We+Ve,"$"].join("|")+")",We+"?"+Ve+"+"+$e,We+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,Ke].join("|"),"g"),rt=RegExp("["+Ue+ke+Ce+Pe+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[N]=st[D]=st[z]=st[B]=st[F]=st[j]=st[H]=st[W]=st[U]=!0,st[v]=st[b]=st[I]=st[y]=st[R]=st[x]=st[w]=st[S]=st[C]=st[_]=st[E]=st[P]=st[M]=st[A]=st[O]=!1;var lt={};lt[v]=lt[b]=lt[I]=lt[R]=lt[y]=lt[x]=lt[N]=lt[D]=lt[z]=lt[B]=lt[F]=lt[C]=lt[_]=lt[E]=lt[P]=lt[M]=lt[A]=lt[T]=lt[j]=lt[H]=lt[W]=lt[U]=!0,lt[w]=lt[S]=lt[O]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,dt=parseInt,ht="object"==typeof r&&r&&r.Object===Object&&r,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||ft||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,vt=mt&&mt.exports===gt,bt=vt&&ht.process,yt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(vV){}}(),xt=yt&&yt.isArrayBuffer,wt=yt&&yt.isDate,St=yt&&yt.isMap,kt=yt&&yt.isRegExp,Ct=yt&&yt.isSet,_t=yt&&yt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Lt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o-1}function It(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function nn(e,t){for(var n=e.length;n--&&Wt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var on=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),an=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ct[e]}function ln(e){return rt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n",""":'"',"'":"'"});var bn=function e(t){var r,ae=(t=null==t?pt:bn.defaults(pt.Object(),t,bn.pick(pt,it))).Array,ke=t.Date,Ce=t.Error,_e=t.Function,Ee=t.Math,Le=t.Object,Pe=t.RegExp,Me=t.String,Ae=t.TypeError,Te=ae.prototype,Oe=_e.prototype,Ie=Le.prototype,Re=t["__core-js_shared__"],Ne=Oe.toString,De=Ie.hasOwnProperty,ze=0,Be=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Fe=Ie.toString,je=Ne.call(Le),He=pt._,We=Pe("^"+Ne.call(De).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=vt?t.Buffer:n,Ve=t.Symbol,Ge=t.Uint8Array,$e=Ue?Ue.allocUnsafe:n,qe=un(Le.getPrototypeOf,Le),Ze=Le.create,Ye=Ie.propertyIsEnumerable,Xe=Te.splice,Ke=Ve?Ve.isConcatSpreadable:n,Qe=Ve?Ve.iterator:n,tt=Ve?Ve.toStringTag:n,rt=function(){try{var e=pi(Le,"defineProperty");return e({},"",{}),e}catch(vV){}}(),ct=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=ke&&ke.now!==pt.Date.now&&ke.now,ft=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=Ee.ceil,mt=Ee.floor,bt=Le.getOwnPropertySymbols,yt=Ue?Ue.isBuffer:n,Ft=t.isFinite,qt=Te.join,yn=un(Le.keys,Le),xn=Ee.max,wn=Ee.min,Sn=ke.now,kn=t.parseInt,Cn=Ee.random,_n=Te.reverse,En=pi(t,"DataView"),Ln=pi(t,"Map"),Pn=pi(t,"Promise"),Mn=pi(t,"Set"),An=pi(t,"WeakMap"),Tn=pi(Le,"create"),On=An&&new An,In={},Rn=Hi(En),Nn=Hi(Ln),Dn=Hi(Pn),zn=Hi(Mn),Bn=Hi(An),Fn=Ve?Ve.prototype:n,jn=Fn?Fn.valueOf:n,Hn=Fn?Fn.toString:n;function Wn(e){if(os(e)&&!qa(e)&&!(e instanceof $n)){if(e instanceof Gn)return e;if(De.call(e,"__wrapped__"))return Wi(e)}return new Gn(e)}var Un=function(){function e(){}return function(t){if(!rs(t))return{};if(Ze)return Ze(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vn(){}function Gn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function $n(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,r,o,i,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=i?r(e,o,i,a):r(e)),s!==n)return s;if(!rs(e))return e;var d=qa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Oo(e,s)}else{var h=vi(e),f=h==S||h==k;if(Ka(e))return Eo(e,l);if(h==E||h==v||f&&!i){if(s=c||f?{}:yi(e),!l)return c?function(e,t){return Io(e,mi(e),t)}(e,function(e,t){return e&&Io(t,Ns(t),e)}(s,e)):function(e,t){return Io(e,gi(e),t)}(e,ar(s,e))}else{if(!lt[h])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case I:return Lo(e);case y:case x:return new r(+e);case R:return function(e,t){var n=t?Lo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case D:case z:case B:case F:case j:case H:case W:case U:return Po(e,n);case C:return new r;case _:case A:return new r(e);case P:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new r;case T:return o=e,jn?Le(jn.call(o)):{}}var o}(e,h,l)}}a||(a=new Kn);var p=a.get(e);if(p)return p;a.set(e,s),cs(e)?e.forEach((function(n){s.add(ur(n,t,r,n,e,a))})):is(e)&&e.forEach((function(n,o){s.set(o,ur(n,t,r,o,e,a))}));var g=d?n:(u?c?si:ai:c?Ns:Rs)(e);return Pt(g||e,(function(n,o){g&&(n=e[o=n]),rr(s,o,ur(n,t,r,o,e,a))})),s}function dr(e,t,r){var o=r.length;if(null==e)return!o;for(e=Le(e);o--;){var i=r[o],a=t[i],s=e[i];if(s===n&&!(i in e)||!a(s))return!1}return!0}function hr(e,t,r){if("function"!=typeof e)throw new Ae(o);return Ri((function(){e.apply(n,r)}),t)}function fr(e,t,n,r){var o=-1,i=Ot,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Rt(t,Qt(n))),r?(i=It,a=!1):t.length>=200&&(i=en,a=!1,t=new Xn(t));e:for(;++o-1},Zn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Yn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Ln||Zn),string:new qn}},Yn.prototype.delete=function(e){var t=hi(this,e).delete(e);return this.size-=t?1:0,t},Yn.prototype.get=function(e){return hi(this,e).get(e)},Yn.prototype.has=function(e){return hi(this,e).has(e)},Yn.prototype.set=function(e,t){var n=hi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,i),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new Zn,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Zn){var r=n.__data__;if(!Ln||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yn(r)}return n.set(e,t),this.size=n.size,this};var pr=Do(Sr),gr=Do(kr,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,r){for(var o=-1,i=e.length;++o0&&n(s)?t>1?yr(s,t-1,n,r,o):Nt(o,s):r||(o[o.length]=s)}return o}var xr=zo(),wr=zo(!0);function Sr(e,t){return e&&xr(e,t,Rs)}function kr(e,t){return e&&wr(e,t,Rs)}function Cr(e,t){return Tt(t,(function(t){return es(e[t])}))}function _r(e,t){for(var r=0,o=(t=So(t,e)).length;null!=e&&rt}function Mr(e,t){return null!=e&&De.call(e,t)}function Ar(e,t){return null!=e&&t in Le(e)}function Tr(e,t,r){for(var o=r?It:Ot,i=e[0].length,a=e.length,s=a,l=ae(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Rt(d,Qt(t))),c=wn(d.length,c),l[s]=!r&&(t||i>=120&&d.length>=120)?new Xn(s&&d):n}d=e[0];var h=-1,f=l[0];e:for(;++h=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,o=t.length,i={};++r-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function Yr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?Xe.call(e,o,1):po(e,o)}}return e}function Xr(e,t){return e+mt(Cn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Ni(Mi(e,t,al),e+"")}function Jr(e){return Jn(Us(e))}function eo(e,t){var n=Us(e);return Bi(n,cr(t,0,n.length))}function to(e,t,r,o){if(!rs(e))return e;for(var i=-1,a=(t=So(t,e)).length,s=a-1,l=e;null!=l&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=ae(o);++r>>1,a=e[i];null!==a&&!ds(a)&&(n?a<=t:a=200){var c=t?null:Qo(e);if(c)return hn(c);a=!1,o=en,l=new Xn}else l=t?[]:s;e:for(;++r=o?e:io(e,t,r)}var _o=ct||function(e){return pt.clearTimeout(e)};function Eo(e,t){if(t)return e.slice();var n=e.length,r=$e?$e(n):new e.constructor(n);return e.copy(r),r}function Lo(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function Po(e,t){var n=t?Lo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Mo(e,t){if(e!==t){var r=e!==n,o=null===e,i=e==e,a=ds(e),s=t!==n,l=null===t,c=t==t,u=ds(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||o&&s&&c||!r&&c||!i)return 1;if(!o&&!a&&!u&&e1?r[i-1]:n,s=i>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(i--,a):n,s&&Si(r[0],r[1],s)&&(a=i<3?n:a,i=1),t=Le(t);++o-1?i[a?t[s]:s]:n}}function Wo(e){return ii((function(t){var r=t.length,i=r,a=Gn.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Ae(o);if(a&&!l&&"wrapper"==ci(s))var l=new Gn([],!0)}for(i=l?i:r;++i1&&b.reverse(),h&&cl))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&r?new Xn:n;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Pt(m,(function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(r),n)))}function zi(e){var t=0,r=0;return function(){var o=Sn(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Bi(e,t){var r=-1,o=e.length,i=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,la(e,r)}));function ga(e){var t=Wn(e);return t.__chain__=!0,t}function ma(e,t){return t(e)}var va=ii((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,i=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&o instanceof $n&&wi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:ma,args:[i],thisArg:n}),new Gn(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(i)}));var ba=Ro((function(e,t,n){De.call(e,n)?++e[n]:sr(e,n,1)}));var ya=Ho($i),xa=Ho(qi);function wa(e,t){return(qa(e)?Pt:pr)(e,di(t,3))}function Sa(e,t){return(qa(e)?Mt:gr)(e,di(t,3))}var ka=Ro((function(e,t,n){De.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ca=Qr((function(e,t,n){var r=-1,o="function"==typeof t,i=Ya(e)?ae(e.length):[];return pr(e,(function(e){i[++r]=o?Et(t,e,n):Or(e,t,n)})),i})),_a=Ro((function(e,t,n){sr(e,n,t)}));function Ea(e,t){return(qa(e)?Rt:Hr)(e,di(t,3))}var La=Ro((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Pa=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&Si(e,t[0],t[1])?t=[]:n>2&&Si(t[0],t[1],t[2])&&(t=[t[0]]),$r(e,yr(t,1),[])})),Ma=ht||function(){return pt.Date.now()};function Aa(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,ei(e,u,n,n,n,n,t)}function Ta(e,t){var r;if("function"!=typeof t)throw new Ae(o);return e=vs(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var Oa=Qr((function(e,t,n){var r=1;if(n.length){var o=dn(n,ui(Oa));r|=l}return ei(e,r,t,n,o)})),Ia=Qr((function(e,t,n){var r=3;if(n.length){var o=dn(n,ui(Ia));r|=l}return ei(t,r,e,n,o)}));function Ra(e,t,r){var i,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ae(o);function g(t){var r=i,o=a;return i=a=n,d=t,l=e.apply(o,r)}function m(e){return d=e,c=Ri(b,t),h?g(e):l}function v(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function b(){var e=Ma();if(v(e))return y(e);c=Ri(b,function(e){var n=t-(e-u);return f?wn(n,s-(e-d)):n}(e))}function y(e){return c=n,p&&i?g(e):(i=a=n,l)}function x(){var e=Ma(),r=v(e);if(i=arguments,a=this,u=e,r){if(c===n)return m(u);if(f)return _o(c),c=Ri(b,t),g(u)}return c===n&&(c=Ri(b,t)),l}return t=ys(t)||0,rs(r)&&(h=!!r.leading,s=(f="maxWait"in r)?xn(ys(r.maxWait)||0,t):s,p="trailing"in r?!!r.trailing:p),x.cancel=function(){c!==n&&_o(c),d=0,i=u=a=c=n},x.flush=function(){return c===n?l:y(Ma())},x}var Na=Qr((function(e,t){return hr(e,1,t)})),Da=Qr((function(e,t,n){return hr(e,ys(t)||0,n)}));function za(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(o);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(za.Cache||Yn),n}function Ba(e){if("function"!=typeof e)throw new Ae(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}za.Cache=Yn;var Fa=ko((function(e,t){var n=(t=1==t.length&&qa(t[0])?Rt(t[0],Qt(di())):Rt(yr(t,1),Qt(di()))).length;return Qr((function(r){for(var o=-1,i=wn(r.length,n);++o=t})),$a=Ir(function(){return arguments}())?Ir:function(e){return os(e)&&De.call(e,"callee")&&!Ye.call(e,"callee")},qa=ae.isArray,Za=xt?Qt(xt):function(e){return os(e)&&Lr(e)==I};function Ya(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return os(e)&&Ya(e)}var Ka=yt||yl,Qa=wt?Qt(wt):function(e){return os(e)&&Lr(e)==x};function Ja(e){if(!os(e))return!1;var t=Lr(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=Lr(e);return t==S||t==k||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==vs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function os(e){return null!=e&&"object"==typeof e}var is=St?Qt(St):function(e){return os(e)&&vi(e)==C};function as(e){return"number"==typeof e||os(e)&&Lr(e)==_}function ss(e){if(!os(e)||Lr(e)!=E)return!1;var t=qe(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==je}var ls=kt?Qt(kt):function(e){return os(e)&&Lr(e)==P};var cs=Ct?Qt(Ct):function(e){return os(e)&&vi(e)==M};function us(e){return"string"==typeof e||!qa(e)&&os(e)&&Lr(e)==A}function ds(e){return"symbol"==typeof e||os(e)&&Lr(e)==T}var hs=_t?Qt(_t):function(e){return os(e)&&ns(e.length)&&!!st[Lr(e)]};var fs=Yo(jr),ps=Yo((function(e,t){return e<=t}));function gs(e){if(!e)return[];if(Ya(e))return us(e)?gn(e):Oo(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=vi(e);return(t==C?cn:t==M?hn:Us)(e)}function ms(e){return e?(e=ys(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=ms(e),n=t%1;return t==t?n?t-n:t:0}function bs(e){return e?cr(vs(e),0,g):0}function ys(e){if("number"==typeof e)return e;if(ds(e))return p;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=me.test(e);return n||be.test(e)?dt(e.slice(2),n?2:8):ge.test(e)?p:+e}function xs(e){return Io(e,Ns(e))}function ws(e){return null==e?"":ho(e)}var Ss=No((function(e,t){if(Ei(t)||Ya(t))Io(t,Rs(t),e);else for(var n in t)De.call(t,n)&&rr(e,n,t[n])})),ks=No((function(e,t){Io(t,Ns(t),e)})),Cs=No((function(e,t,n,r){Io(t,Ns(t),e,r)})),_s=No((function(e,t,n,r){Io(t,Rs(t),e,r)})),Es=ii(lr);var Ls=Qr((function(e,t){e=Le(e);var r=-1,o=t.length,i=o>2?t[2]:n;for(i&&Si(t[0],t[1],i)&&(o=1);++r1),t})),Io(e,si(e),n),r&&(n=ur(n,7,ri));for(var o=t.length;o--;)po(n,t[o]);return n}));var Fs=ii((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return As(e,n)}))}(e,t)}));function js(e,t){if(null==e)return{};var n=Rt(si(e),(function(e){return[e]}));return t=di(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Hs=Jo(Rs),Ws=Jo(Ns);function Us(e){return null==e?[]:Jt(e,Rs(e))}var Vs=Fo((function(e,t,n){return t=t.toLowerCase(),e+(n?Gs(t):t)}));function Gs(e){return Js(ws(e).toLowerCase())}function $s(e){return(e=ws(e))&&e.replace(xe,on).replace(et,"")}var qs=Fo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Zs=Fo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ys=Bo("toLowerCase");var Xs=Fo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ks=Fo((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=Fo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Bo("toUpperCase");function el(e,t,r){return e=ws(e),(t=r?n:t)===n?function(e){return ot.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Qr((function(e,t){try{return Et(e,n,t)}catch(vV){return Ja(vV)?vV:new Ce(vV)}})),nl=ii((function(e,t){return Pt(t,(function(t){t=ji(t),sr(e,t,Oa(e[t],e))})),e}));function rl(e){return function(){return e}}var ol=Wo(),il=Wo(!0);function al(e){return e}function sl(e){return zr("function"==typeof e?e:ur(e,1))}var ll=Qr((function(e,t){return function(n){return Or(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Or(e,n,t)}}));function ul(e,t,n){var r=Rs(t),o=Cr(t,r);null!=n||rs(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Cr(t,Rs(t)));var i=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return Pt(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Oo(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function dl(){}var hl=$o(Rt),fl=$o(At),pl=$o(Bt);function gl(e){return ki(e)?$t(ji(e)):function(e){return function(t){return _r(t,e)}}(e)}var ml=Zo(),vl=Zo(!0);function bl(){return[]}function yl(){return!1}var xl=Go((function(e,t){return e+t}),0),wl=Ko("ceil"),Sl=Go((function(e,t){return e/t}),1),kl=Ko("floor");var Cl,_l=Go((function(e,t){return e*t}),1),El=Ko("round"),Ll=Go((function(e,t){return e-t}),0);return Wn.after=function(e,t){if("function"!=typeof t)throw new Ae(o);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},Wn.ary=Aa,Wn.assign=Ss,Wn.assignIn=ks,Wn.assignInWith=Cs,Wn.assignWith=_s,Wn.at=Es,Wn.before=Ta,Wn.bind=Oa,Wn.bindAll=nl,Wn.bindKey=Ia,Wn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qa(e)?e:[e]},Wn.chain=ga,Wn.chunk=function(e,t,r){t=(r?Si(e,t,r):t===n)?1:xn(vs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=ae(gt(o/t));ii?0:i+r),(o=o===n||o>i?i:vs(o))<0&&(o+=i),o=r>o?0:bs(o);r>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ho(t))&&ln(e)?Co(gn(e),0,r):e.split(t,r):[]},Wn.spread=function(e,t){if("function"!=typeof e)throw new Ae(o);return t=null==t?0:xn(vs(t),0),Qr((function(n){var r=n[t],o=Co(n,0,t);return r&&Nt(o,r),Et(e,this,o)}))},Wn.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Wn.take=function(e,t,r){return e&&e.length?io(e,0,(t=r||t===n?1:vs(t))<0?0:t):[]},Wn.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?io(e,(t=o-(t=r||t===n?1:vs(t)))<0?0:t,o):[]},Wn.takeRightWhile=function(e,t){return e&&e.length?mo(e,di(t,3),!1,!0):[]},Wn.takeWhile=function(e,t){return e&&e.length?mo(e,di(t,3)):[]},Wn.tap=function(e,t){return t(e),e},Wn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ae(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ra(e,t,{leading:r,maxWait:t,trailing:i})},Wn.thru=ma,Wn.toArray=gs,Wn.toPairs=Hs,Wn.toPairsIn=Ws,Wn.toPath=function(e){return qa(e)?Rt(e,ji):ds(e)?[e]:Oo(Fi(ws(e)))},Wn.toPlainObject=xs,Wn.transform=function(e,t,n){var r=qa(e),o=r||Ka(e)||hs(e);if(t=di(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:rs(e)&&es(i)?Un(qe(e)):{}}return(o?Pt:Sr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Wn.unary=function(e){return Aa(e,1)},Wn.union=oa,Wn.unionBy=ia,Wn.unionWith=aa,Wn.uniq=function(e){return e&&e.length?fo(e):[]},Wn.uniqBy=function(e,t){return e&&e.length?fo(e,di(t,2)):[]},Wn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?fo(e,n,t):[]},Wn.unset=function(e,t){return null==e||po(e,t)},Wn.unzip=sa,Wn.unzipWith=la,Wn.update=function(e,t,n){return null==e?e:go(e,t,wo(n))},Wn.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:go(e,t,wo(r),o)},Wn.values=Us,Wn.valuesIn=function(e){return null==e?[]:Jt(e,Ns(e))},Wn.without=ca,Wn.words=el,Wn.wrap=function(e,t){return ja(wo(t),e)},Wn.xor=ua,Wn.xorBy=da,Wn.xorWith=ha,Wn.zip=fa,Wn.zipObject=function(e,t){return yo(e||[],t||[],rr)},Wn.zipObjectDeep=function(e,t){return yo(e||[],t||[],to)},Wn.zipWith=pa,Wn.entries=Hs,Wn.entriesIn=Ws,Wn.extend=ks,Wn.extendWith=Cs,ul(Wn,Wn),Wn.add=xl,Wn.attempt=tl,Wn.camelCase=Vs,Wn.capitalize=Gs,Wn.ceil=wl,Wn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=ys(r))==r?r:0),t!==n&&(t=(t=ys(t))==t?t:0),cr(ys(e),t,r)},Wn.clone=function(e){return ur(e,4)},Wn.cloneDeep=function(e){return ur(e,5)},Wn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:n)},Wn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:n)},Wn.conformsTo=function(e,t){return null==t||dr(e,t,Rs(t))},Wn.deburr=$s,Wn.defaultTo=function(e,t){return null==e||e!=e?t:e},Wn.divide=Sl,Wn.endsWith=function(e,t,r){e=ws(e),t=ho(t);var o=e.length,i=r=r===n?o:cr(vs(r),0,o);return(r-=t.length)>=0&&e.slice(r,i)==t},Wn.eq=Ua,Wn.escape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Z,an):e},Wn.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(re,"\\$&"):e},Wn.every=function(e,t,r){var o=qa(e)?At:mr;return r&&Si(e,t,r)&&(t=n),o(e,di(t,3))},Wn.find=ya,Wn.findIndex=$i,Wn.findKey=function(e,t){return jt(e,di(t,3),Sr)},Wn.findLast=xa,Wn.findLastIndex=qi,Wn.findLastKey=function(e,t){return jt(e,di(t,3),kr)},Wn.floor=kl,Wn.forEach=wa,Wn.forEachRight=Sa,Wn.forIn=function(e,t){return null==e?e:xr(e,di(t,3),Ns)},Wn.forInRight=function(e,t){return null==e?e:wr(e,di(t,3),Ns)},Wn.forOwn=function(e,t){return e&&Sr(e,di(t,3))},Wn.forOwnRight=function(e,t){return e&&kr(e,di(t,3))},Wn.get=Ms,Wn.gt=Va,Wn.gte=Ga,Wn.has=function(e,t){return null!=e&&bi(e,t,Mr)},Wn.hasIn=As,Wn.head=Yi,Wn.identity=al,Wn.includes=function(e,t,n,r){e=Ya(e)?e:Us(e),n=n&&!r?vs(n):0;var o=e.length;return n<0&&(n=xn(o+n,0)),us(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Wt(e,t,n)>-1},Wn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vs(n);return o<0&&(o=xn(r+o,0)),Wt(e,t,o)},Wn.inRange=function(e,t,r){return t=ms(t),r===n?(r=t,t=0):r=ms(r),function(e,t,n){return e>=wn(t,n)&&e=-9007199254740991&&e<=f},Wn.isSet=cs,Wn.isString=us,Wn.isSymbol=ds,Wn.isTypedArray=hs,Wn.isUndefined=function(e){return e===n},Wn.isWeakMap=function(e){return os(e)&&vi(e)==O},Wn.isWeakSet=function(e){return os(e)&&"[object WeakSet]"==Lr(e)},Wn.join=function(e,t){return null==e?"":qt.call(e,t)},Wn.kebabCase=qs,Wn.last=Ji,Wn.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==n&&(i=(i=vs(r))<0?xn(o+i,0):wn(i,o-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ht(e,Vt,i,!0)},Wn.lowerCase=Zs,Wn.lowerFirst=Ys,Wn.lt=fs,Wn.lte=ps,Wn.max=function(e){return e&&e.length?vr(e,al,Pr):n},Wn.maxBy=function(e,t){return e&&e.length?vr(e,di(t,2),Pr):n},Wn.mean=function(e){return Gt(e,al)},Wn.meanBy=function(e,t){return Gt(e,di(t,2))},Wn.min=function(e){return e&&e.length?vr(e,al,jr):n},Wn.minBy=function(e,t){return e&&e.length?vr(e,di(t,2),jr):n},Wn.stubArray=bl,Wn.stubFalse=yl,Wn.stubObject=function(){return{}},Wn.stubString=function(){return""},Wn.stubTrue=function(){return!0},Wn.multiply=_l,Wn.nth=function(e,t){return e&&e.length?Gr(e,vs(t)):n},Wn.noConflict=function(){return pt._===this&&(pt._=He),this},Wn.noop=dl,Wn.now=Ma,Wn.pad=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return qo(mt(o),n)+e+qo(gt(o),n)},Wn.padEnd=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;return t&&rt){var o=e;e=t,t=o}if(r||e%1||t%1){var i=Cn();return wn(e+i*(t-e+ut("1e-"+((i+"").length-1))),t)}return Xr(e,t)},Wn.reduce=function(e,t,n){var r=qa(e)?Dt:Zt,o=arguments.length<3;return r(e,di(t,4),n,o,pr)},Wn.reduceRight=function(e,t,n){var r=qa(e)?zt:Zt,o=arguments.length<3;return r(e,di(t,4),n,o,gr)},Wn.repeat=function(e,t,r){return t=(r?Si(e,t,r):t===n)?1:vs(t),Kr(ws(e),t)},Wn.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Wn.result=function(e,t,r){var o=-1,i=(t=So(t,e)).length;for(i||(i=1,e=n);++of)return[];var n=g,r=wn(e,g);t=di(t),e-=g;for(var o=Xt(r,t);++n=a)return e;var l=r-pn(o);if(l<1)return o;var c=s?Co(s,0,l).join(""):e.slice(0,l);if(i===n)return c+o;if(s&&(l+=c.length-l),ls(i)){if(e.slice(l).search(i)){var u,d=c;for(i.global||(i=Pe(i.source,ws(pe.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var h=u.index;c=c.slice(0,h===n?l:h)}}else if(e.indexOf(ho(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Wn.unescape=function(e){return(e=ws(e))&&Y.test(e)?e.replace(q,vn):e},Wn.uniqueId=function(e){var t=++ze;return ws(e)+t},Wn.upperCase=Qs,Wn.upperFirst=Js,Wn.each=wa,Wn.eachRight=Sa,Wn.first=Yi,ul(Wn,(Cl={},Sr(Wn,(function(e,t){De.call(Wn.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Wn.VERSION="4.17.21",Pt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Wn[e].placeholder=Wn})),Pt(["drop","take"],(function(e,t){$n.prototype[e]=function(r){r=r===n?1:xn(vs(r),0);var o=this.__filtered__&&!t?new $n(this):this.clone();return o.__filtered__?o.__takeCount__=wn(r,o.__takeCount__):o.__views__.push({size:wn(r,g),type:e+(o.__dir__<0?"Right":"")}),o},$n.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Pt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;$n.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:di(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Pt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");$n.prototype[e]=function(){return this[n](1).value()[0]}})),Pt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");$n.prototype[e]=function(){return this.__filtered__?new $n(this):this[n](1)}})),$n.prototype.compact=function(){return this.filter(al)},$n.prototype.find=function(e){return this.filter(e).head()},$n.prototype.findLast=function(e){return this.reverse().find(e)},$n.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new $n(this):this.map((function(n){return Or(n,e,t)}))})),$n.prototype.reject=function(e){return this.filter(Ba(di(e)))},$n.prototype.slice=function(e,t){e=vs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new $n(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=vs(t))<0?r.dropRight(-t):r.take(t-e)),r)},$n.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},$n.prototype.toArray=function(){return this.take(g)},Sr($n.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Wn[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Wn.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof $n,c=s[0],u=l||qa(t),d=function(e){var t=i.apply(Wn,Nt([e],s));return o&&h?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new $n(this);var m=e.apply(t,s);return m.__actions__.push({func:ma,args:[d],thisArg:n}),new Gn(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?o?m.value()[0]:m.value():m)})})),Pt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Wn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(qa(o)?o:[],e)}return this[n]((function(n){return t.apply(qa(n)?n:[],e)}))}})),Sr($n.prototype,(function(e,t){var n=Wn[t];if(n){var r=n.name+"";De.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}})),In[Uo(n,2).name]=[{name:"wrapper",func:n}],$n.prototype.clone=function(){var e=new $n(this.__wrapped__);return e.__actions__=Oo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oo(this.__views__),e},$n.prototype.reverse=function(){if(this.__filtered__){var e=new $n(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},$n.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Wn.prototype.plant=function(e){for(var t,r=this;r instanceof Vn;){var o=Wi(r);o.__index__=0,o.__values__=n,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,t},Wn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof $n){var t=e;return this.__actions__.length&&(t=new $n(this)),(t=t.reverse()).__actions__.push({func:ma,args:[ra],thisArg:n}),new Gn(t,this.__chain__)}return this.thru(ra)},Wn.prototype.toJSON=Wn.prototype.valueOf=Wn.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Wn.prototype.first=Wn.prototype.head,Qe&&(Wn.prototype[Qe]=function(){return this}),Wn}();mt?((mt.exports=bn)._=bn,gt._=bn):pt._=bn}).call(r)}(EG,EG.exports);const LG=EG.exports;var PG=Object.create,MG=Object.defineProperty,AG=Object.getOwnPropertyDescriptor,TG=Object.getOwnPropertyNames,OG=Object.getPrototypeOf,IG=Object.prototype.hasOwnProperty,RG=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),NG=(e,t,n)=>(n=null!=e?PG(OG(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of TG(t))!IG.call(e,o)&&o!==n&&MG(e,o,{get:()=>t[o],enumerable:!(r=AG(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?n:MG(n,"default",{value:e,enumerable:!0}),e)),DG=RG(((e,t)=>{t.exports=function(){this.__data__=[],this.size=0}})),zG=RG(((e,t)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}})),BG=RG(((e,t)=>{var n=zG();t.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}})),FG=RG(((e,t)=>{var n=BG(),r=Array.prototype.splice;t.exports=function(e){var t=this.__data__,o=n(t,e);return!(o<0)&&(o==t.length-1?t.pop():r.call(t,o,1),--this.size,!0)}})),jG=RG(((e,t)=>{var n=BG();t.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}})),HG=RG(((e,t)=>{var n=BG();t.exports=function(e){return n(this.__data__,e)>-1}})),WG=RG(((e,t)=>{var n=BG();t.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}})),UG=RG(((e,t)=>{var n=DG(),r=FG(),o=jG(),i=HG(),a=WG();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=UG();t.exports=function(){this.__data__=new n,this.size=0}})),GG=RG(((e,t)=>{t.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}})),$G=RG(((e,t)=>{t.exports=function(e){return this.__data__.get(e)}})),qG=RG(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),ZG=RG(((e,t)=>{var n="object"==typeof global&&global&&global.Object===Object&&global;t.exports=n})),YG=RG(((e,t)=>{var n=ZG(),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();t.exports=o})),XG=RG(((e,t)=>{var n=YG().Symbol;t.exports=n})),KG=RG(((e,t)=>{var n=XG(),r=Object.prototype,o=r.hasOwnProperty,i=r.toString,a=n?n.toStringTag:void 0;t.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch{}var s=i.call(e);return r&&(t?e[a]=n:delete e[a]),s}})),QG=RG(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}})),JG=RG(((e,t)=>{var n=XG(),r=KG(),o=QG(),i=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?r(e):o(e)}})),e$=RG(((e,t)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}})),t$=RG(((e,t)=>{var n=JG(),r=e$();t.exports=function(e){if(!r(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}})),n$=RG(((e,t)=>{var n=YG()["__core-js_shared__"];t.exports=n})),r$=RG(((e,t)=>{var n=n$(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();t.exports=function(e){return!!r&&r in e}})),o$=RG(((e,t)=>{var n=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return n.call(e)}catch{}try{return e+""}catch{}}return""}})),i$=RG(((e,t)=>{var n=t$(),r=r$(),o=e$(),i=o$(),a=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||r(e))&&(n(e)?d:a).test(i(e))}})),a$=RG(((e,t)=>{t.exports=function(e,t){return e?.[t]}})),s$=RG(((e,t)=>{var n=i$(),r=a$();t.exports=function(e,t){var o=r(e,t);return n(o)?o:void 0}})),l$=RG(((e,t)=>{var n=s$()(YG(),"Map");t.exports=n})),c$=RG(((e,t)=>{var n=s$()(Object,"create");t.exports=n})),u$=RG(((e,t)=>{var n=c$();t.exports=function(){this.__data__=n?n(null):{},this.size=0}})),d$=RG(((e,t)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}})),h$=RG(((e,t)=>{var n=c$(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(n){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return r.call(t,e)?t[e]:void 0}})),f$=RG(((e,t)=>{var n=c$(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:r.call(t,e)}})),p$=RG(((e,t)=>{var n=c$();t.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}})),g$=RG(((e,t)=>{var n=u$(),r=d$(),o=h$(),i=f$(),a=p$();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=g$(),r=UG(),o=l$();t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||r),string:new n}}})),v$=RG(((e,t)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}})),b$=RG(((e,t)=>{var n=v$();t.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}})),y$=RG(((e,t)=>{var n=b$();t.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}})),x$=RG(((e,t)=>{var n=b$();t.exports=function(e){return n(this,e).get(e)}})),w$=RG(((e,t)=>{var n=b$();t.exports=function(e){return n(this,e).has(e)}})),S$=RG(((e,t)=>{var n=b$();t.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}})),k$=RG(((e,t)=>{var n=m$(),r=y$(),o=x$(),i=w$(),a=S$();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=UG(),r=l$(),o=k$();t.exports=function(e,t){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new o(a)}return i.set(e,t),this.size=i.size,this}})),_$=RG(((e,t)=>{var n=UG(),r=VG(),o=GG(),i=$G(),a=qG(),s=C$();function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,t.exports=l})),E$=RG(((e,t)=>{t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}})),L$=RG(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),P$=RG(((e,t)=>{var n=k$(),r=E$(),o=L$();function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{t.exports=function(e,t){return e.has(t)}})),T$=RG(((e,t)=>{var n=P$(),r=M$(),o=A$();t.exports=function(e,t,i,a,s,l){var c=1&i,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var h=l.get(e),f=l.get(t);if(h&&f)return h==t&&f==e;var p=-1,g=!0,m=2&i?new n:void 0;for(l.set(e,t),l.set(t,e);++p{var n=YG().Uint8Array;t.exports=n})),I$=RG(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}})),R$=RG(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}})),N$=RG(((e,t)=>{var n=XG(),r=O$(),o=zG(),i=T$(),a=I$(),s=R$(),l=n?n.prototype:void 0,c=l?l.valueOf:void 0;t.exports=function(e,t,n,l,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&l;if(f||(f=s),e.size!=t.size&&!p)return!1;var g=h.get(e);if(g)return g==t;l|=2,h.set(e,t);var m=i(f(e),f(t),l,u,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}})),D$=RG(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n{var n=Array.isArray;t.exports=n})),B$=RG(((e,t)=>{var n=D$(),r=z$();t.exports=function(e,t,o){var i=t(e);return r(e)?i:n(i,o(e))}})),F$=RG(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n{t.exports=function(){return[]}})),H$=RG(((e,t)=>{var n=F$(),r=j$(),o=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return o.call(e,t)})))}:r;t.exports=a})),W$=RG(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=Array(e);++n{t.exports=function(e){return null!=e&&"object"==typeof e}})),V$=RG(((e,t)=>{var n=JG(),r=U$();t.exports=function(e){return r(e)&&"[object Arguments]"==n(e)}})),G$=RG(((e,t)=>{var n=V$(),r=U$(),o=Object.prototype,i=o.hasOwnProperty,a=o.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return r(e)&&i.call(e,"callee")&&!a.call(e,"callee")};t.exports=s})),$$=RG(((e,t)=>{t.exports=function(){return!1}})),q$=RG(((e,t)=>{var n=YG(),r=$$(),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;t.exports=s})),Z$=RG(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=t??9007199254740991)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}})),X$=RG(((e,t)=>{var n=JG(),r=Y$(),o=U$(),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&r(e.length)&&!!i[n(e)]}})),K$=RG(((e,t)=>{t.exports=function(e){return function(t){return e(t)}}})),Q$=RG(((e,t)=>{var n=ZG(),r="object"==typeof e&&e&&!e.nodeType&&e,o=r&&"object"==typeof t&&t&&!t.nodeType&&t,i=o&&o.exports===r&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch{}}();t.exports=a})),J$=RG(((e,t)=>{var n=X$(),r=K$(),o=Q$(),i=o&&o.isTypedArray,a=i?r(i):n;t.exports=a})),eq=RG(((e,t)=>{var n=W$(),r=G$(),o=z$(),i=q$(),a=Z$(),s=J$(),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=o(e),u=!c&&r(e),d=!c&&!u&&i(e),h=!c&&!u&&!d&&s(e),f=c||u||d||h,p=f?n(e.length,String):[],g=p.length;for(var m in e)(t||l.call(e,m))&&(!f||!("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g)))&&p.push(m);return p}})),tq=RG(((e,t)=>{var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}})),nq=RG(((e,t)=>{t.exports=function(e,t){return function(n){return e(t(n))}}})),rq=RG(((e,t)=>{var n=nq()(Object.keys,Object);t.exports=n})),oq=RG(((e,t)=>{var n=tq(),r=rq(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return r(e);var t=[];for(var i in Object(e))o.call(e,i)&&"constructor"!=i&&t.push(i);return t}})),iq=RG(((e,t)=>{var n=t$(),r=Y$();t.exports=function(e){return null!=e&&r(e.length)&&!n(e)}})),aq=RG(((e,t)=>{var n=eq(),r=oq(),o=iq();t.exports=function(e){return o(e)?n(e):r(e)}})),sq=RG(((e,t)=>{var n=B$(),r=H$(),o=aq();t.exports=function(e){return n(e,o,r)}})),lq=RG(((e,t)=>{var n=sq(),r=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,i,a,s){var l=1&o,c=n(e),u=c.length;if(u!=n(t).length&&!l)return!1;for(var d=u;d--;){var h=c[d];if(!(l?h in t:r.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++d{var n=s$()(YG(),"DataView");t.exports=n})),uq=RG(((e,t)=>{var n=s$()(YG(),"Promise");t.exports=n})),dq=RG(((e,t)=>{var n=s$()(YG(),"Set");t.exports=n})),hq=RG(((e,t)=>{var n=s$()(YG(),"WeakMap");t.exports=n})),fq=RG(((e,t)=>{var n=cq(),r=l$(),o=uq(),i=dq(),a=hq(),s=JG(),l=o$(),c="[object Map]",u="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",p=l(n),g=l(r),m=l(o),v=l(i),b=l(a),y=s;(n&&y(new n(new ArrayBuffer(1)))!=f||r&&y(new r)!=c||o&&y(o.resolve())!=u||i&&y(new i)!=d||a&&y(new a)!=h)&&(y=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case p:return f;case g:return c;case m:return u;case v:return d;case b:return h}return t}),t.exports=y})),pq=RG(((e,t)=>{var n=_$(),r=T$(),o=N$(),i=lq(),a=fq(),s=z$(),l=q$(),c=J$(),u="[object Arguments]",d="[object Array]",h="[object Object]",f=Object.prototype.hasOwnProperty;t.exports=function(e,t,p,g,m,v){var b=s(e),y=s(t),x=b?d:a(e),w=y?d:a(t),S=(x=x==u?h:x)==h,k=(w=w==u?h:w)==h,C=x==w;if(C&&l(e)){if(!l(t))return!1;b=!0,S=!1}if(C&&!S)return v||(v=new n),b||c(e)?r(e,t,p,g,m,v):o(e,t,x,p,g,m,v);if(!(1&p)){var _=S&&f.call(e,"__wrapped__"),E=k&&f.call(t,"__wrapped__");if(_||E){var L=_?e.value():e,P=E?t.value():t;return v||(v=new n),m(L,P,p,g,v)}}return!!C&&(v||(v=new n),i(e,t,p,g,m,v))}})),gq=RG(((e,t)=>{var n=pq(),r=U$();t.exports=function e(t,o,i,a,s){return t===o||(null==t||null==o||!r(t)&&!r(o)?t!=t&&o!=o:n(t,o,i,a,e,s))}})),mq=RG(((e,t)=>{var n=gq();t.exports=function(e,t){return n(e,t)}})),vq=["ctrl","shift","alt","meta","mod"],bq={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function yq(e,t=","){return"string"==typeof e?e.split(t):e}function xq(e,t="+"){let n=e.toLocaleLowerCase().split(t).map((e=>e.trim())).map((e=>bq[e]||e)),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter((e=>!vq.includes(e)));return{...r,keys:o}}function wq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some((e=>e.toLowerCase()===n.toLowerCase()))):Boolean(n&&t&&!0===t)}var Sq=i.exports.createContext(void 0),kq=i.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Cq=NG(mq());var _q=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Eq(e,t,n,r){let o=i.exports.useRef(null),{current:a}=i.exports.useRef(new Set),s=n instanceof Array?r instanceof Array?void 0:r:n,l=n instanceof Array?n:r instanceof Array?r:[],c=i.exports.useCallback(t,[...l]),u=function(e){let t=i.exports.useRef(void 0);return(0,Cq.default)(t.current,e)||(t.current=e),t.current}(s),{enabledScopes:d}=i.exports.useContext(kq),h=i.exports.useContext(Sq);return i.exports.useLayoutEffect((()=>{if(!1===u?.enabled||!function(e,t){return 0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):!t||e.some((e=>t.includes(e)))||e.includes("*")}(d,u?.scopes))return;let t=t=>{if(!function(e){return wq(e,["input","textarea","select"])}(t)||wq(t,u?.enableOnFormTags)){if(null!==o.current&&document.activeElement!==o.current&&!o.current.contains(document.activeElement))return void _q(t);t.target?.isContentEditable&&!u?.enableOnContentEditable||yq(e,u?.splitKey).forEach((e=>{let n=xq(e,u?.combinationKey);if(((e,t,n)=>{let{alt:r,ctrl:o,meta:i,mod:a,shift:s,keys:l}=t,{altKey:c,ctrlKey:u,metaKey:d,shiftKey:h,key:f,code:p}=e,g=p.toLowerCase().replace("key",""),m=f.toLowerCase();if(c!==r&&"alt"!==m||h!==s&&"shift"!==m)return!1;if(a){if(!d&&!u)return!1}else if(d!==i&&"meta"!==g||u!==o&&"ctrl"!==g)return!1;return!(!l||1!==l.length||!l.includes(m)&&!l.includes(g))||(l?l.every((e=>n.has(e))):!l)})(t,n,a)||n.keys?.includes("*")){if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(t,n,u?.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(t,n,u?.enabled))return void _q(t);c(t,n)}}))}},n=e=>{a.add(e.key.toLowerCase()),(void 0===u?.keydown&&!0!==u?.keyup||u?.keydown)&&t(e)},r=e=>{"meta"!==e.key.toLowerCase()?a.delete(e.key.toLowerCase()):a.clear(),u?.keyup&&t(e)};return(o.current||document).addEventListener("keyup",r),(o.current||document).addEventListener("keydown",n),h&&yq(e,u?.splitKey).forEach((e=>h.addHotkey(xq(e,u?.combinationKey)))),()=>{(o.current||document).removeEventListener("keyup",r),(o.current||document).removeEventListener("keydown",n),h&&yq(e,u?.splitKey).forEach((e=>h.removeHotkey(xq(e,u?.combinationKey))))}}),[e,c,u,d]),o}NG(mq());var Lq=new Set;function Pq(){return ld("div",{className:"work-in-progress nodes-work-in-progress",children:[sd("h1",{children:"Nodes"}),sd("p",{children:"A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature."})]})}window.addEventListener("DOMContentLoaded",(()=>{document.addEventListener("keydown",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>Lq.add(xq(e))))}(e.key)})),document.addEventListener("keyup",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>{let t=xq(e);for(let n of Lq)n.keys?.every((e=>t.keys?.includes(e)))&&Lq.delete(n)}))}(e.key)}))}));const Mq=()=>ld("div",{className:"work-in-progress post-processing-work-in-progress",children:[sd("h1",{children:"Post Processing"}),sd("p",{children:"Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image and Image To Image tabs. You can also process images directly, using the image action buttons above the current image display or in the viewer."}),sd("p",{children:"A dedicated UI will be released soon to facilitate more advanced post processing workflows."}),sd("p",{children:"The Invoke AI Command Line Interface offers various other features including Embiggen."})]}),Aq=SS({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:sd("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),Tq=SS({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),Oq=SS({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),Iq=SS({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:sd("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:sd("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})});var Rq=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(Rq||{});const Nq={0:{text:"This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},1:{text:"As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},2:{text:"These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},3:{text:"Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},4:{text:"Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},5:{text:"Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.",href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},6:{text:"Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},7:{text:"Image to Image allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},8:{text:"The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},9:{text:"Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},10:{text:"Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes).",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}},Dq=/^-?(0\.)?\.?$/,zq=e=>{const{label:t,labelFontSize:n="1rem",styleClass:r,isDisabled:o=!1,showStepper:a=!0,width:s,textAlign:l,isInvalid:c,value:u,onChange:d,min:h,max:f,isInteger:p=!0,formControlProps:g,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:b,tooltipProps:y,...x}=e,[w,S]=i.exports.useState(String(u));i.exports.useEffect((()=>{w.match(Dq)||u===Number(w)||S(String(u))}),[u,w]);return sd(qH,{...y,children:ld(GT,{isDisabled:o,isInvalid:c,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...g,children:[t&&sd(JT,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,...m,children:t}),ld(hF,{className:"invokeai__number-input-root",value:w,keepWithinRange:!0,clampValueOnBlur:!1,onChange:e=>{S(e),e.match(Dq)||d(p?Math.floor(Number(e)):Number(e))},onBlur:e=>{const t=LG.clamp(p?Math.floor(Number(e.target.value)):Number(e.target.value),h,f);S(String(t)),d(t)},width:s,...x,children:[sd(pF,{className:"invokeai__number-input-field",textAlign:l,...v}),a&&ld("div",{className:"invokeai__number-input-stepper",children:[sd(vF,{...b,className:"invokeai__number-input-stepper-button"}),sd(mF,{...b,className:"invokeai__number-input-stepper-button"})]})]})]})})},Bq=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:i,size:a="sm",fontSize:s="md",styleClass:l,...c}=e;return ld(GT,{isDisabled:n,className:`invokeai__select ${l}`,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.cancelBubble=!0},children:[t&&sd(JT,{className:"invokeai__select-label",fontSize:s,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t}),sd(qH,{label:o,...i,children:sd(nj,{className:"invokeai__select-picker",fontSize:s,size:a,...c,children:r.map((e=>"string"==typeof e||"number"==typeof e?sd("option",{value:e,className:"invokeai__select-option",children:e},e):sd("option",{value:e.value,className:"invokeai__select-option",children:e.key},e.value)))})})]})},Fq=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],jq=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],Hq=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],Wq=[{key:"2x",value:2},{key:"4x",value:4}],Uq=4294967295,Vq=["gfpgan","codeformer"],Gq=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],$q=cU((e=>e.options),(e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),qq=cU((e=>e.system),(e=>({isGFPGANAvailable:e.isGFPGANAvailable})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),Zq=()=>{const e=noe(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=roe($q),{isGFPGANAvailable:o}=roe(qq);return ld(kI,{direction:"column",gap:2,children:[sd(Bq,{label:"Type",validValues:Vq.concat(),value:n,onChange:t=>e(Dte(t.target.value))}),sd(zq,{isDisabled:!o,label:"Strength",step:.05,min:0,max:1,onChange:t=>e(Nte(t)),value:t,width:"90px",isInteger:!1}),"codeformer"===n&&sd(zq,{isDisabled:!o,label:"Fidelity",step:.05,min:0,max:1,onChange:t=>e(Ite(t)),value:r,width:"90px",isInteger:!1})]})},Yq=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:i,styleClass:a,...s}=e;return sd(GT,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,...o,children:ld(JT,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",...i,children:[t,sd(tH,{className:"invokeai__switch-root",...s})]})})};function Xq(){const e=roe((e=>e.system.isGFPGANAvailable)),t=roe((e=>e.options.shouldRunFacetool)),n=noe();return sd(Yq,{isDisabled:!e,isChecked:t,onChange:e=>n(une(e.target.checked))})}function Kq(){const e=noe(),t=roe((e=>e.options.shouldFitToWidthHeight));return sd(Yq,{label:"Fit Initial Image To Output Size",isChecked:t,onChange:t=>e(rne(t.target.checked))})}var Qq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Jq=j.createContext&&j.createContext(Qq),eZ=globalThis&&globalThis.__assign||function(){return eZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:o,asCheckbox:i,isChecked:a,...s}=e;return sd(qH,{label:n,hasArrow:!0,...o,...o?.placement?{placement:o.placement}:{placement:"top"},children:sd(DT,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":i,"data-selected":void 0!==a?a:void 0,...s})})}));function hZ(e){const[t,n]=i.exports.useState(!1),{label:r,value:o,min:a=1,max:s=100,step:l=1,onChange:c,width:u="100%",tooltipSuffix:d="",withSliderMarks:h=!1,sliderMarkLeftOffset:f=0,sliderMarkRightOffset:p=-7,withInput:g=!1,isInteger:m=!1,inputWidth:v="5rem",inputReadOnly:b=!0,withReset:y=!1,hideTooltip:x=!1,handleReset:w,isResetDisabled:S,isSliderDisabled:k,isInputDisabled:C,styleClass:_,sliderFormControlProps:E,sliderFormLabelProps:L,sliderMarkProps:P,sliderTrackProps:M,sliderThumbProps:A,sliderNumberInputProps:T,sliderNumberInputFieldProps:O,sliderNumberInputStepperProps:I,sliderTooltipProps:R,sliderIAIIconButtonProps:N,...D}=e,[z,B]=i.exports.useState(String(o)),F=i.exports.useMemo((()=>T?.max?T.max:s),[s,T?.max]);i.exports.useEffect((()=>{String(o)!==z&&""!==z&&B(String(o))}),[o,z,B]);const j=e=>{B(e),c(Number(e))};return ld(GT,{className:_?`invokeai__slider-component ${_}`:"invokeai__slider-component","data-markers":h,...E,children:[sd(JT,{className:"invokeai__slider-component-label",...L,children:r}),ld(jI,{w:"100%",gap:2,children:[ld(Zj,{"aria-label":r,value:o,min:a,max:s,step:l,onChange:j,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:k,width:u,...D,children:[h&&ld(ad,{children:[sd(Qj,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:f,...P,children:a}),sd(Qj,{value:s,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:p,...P,children:s})]}),sd(Xj,{className:"invokeai__slider_track",...M,children:sd(Kj,{className:"invokeai__slider_track-filled"})}),sd(qH,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${o}${d}`,hidden:x,...R,children:sd(Yj,{className:"invokeai__slider-thumb",...A})})]}),g&&ld(hF,{min:a,max:F,step:l,value:z,onChange:j,onBlur:e=>{const t=LG.clamp(m?Math.floor(Number(e.target.value)):Number(e.target.value),a,F);B(String(t)),c(t)},className:"invokeai__slider-number-field",isDisabled:C,...T,children:[sd(pF,{className:"invokeai__slider-number-input",width:v,readOnly:b,...O}),ld(fF,{...I,children:[sd(vF,{className:"invokeai__slider-number-stepper"}),sd(mF,{className:"invokeai__slider-number-stepper"})]})]}),y&&sd(dZ,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:sd(aZ,{}),onClick:()=>{w&&w()},isDisabled:S,...N})]})]})}function fZ(e){const{label:t="Strength",styleClass:n}=e,r=roe((e=>e.options.img2imgStrength)),o=noe();return sd(hZ,{label:t,step:.01,min:.01,max:.99,onChange:e=>o(Fte(e)),value:r,isInteger:!1,styleClass:n,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{o(Fte(.75))}})}const pZ=()=>{const e=noe(),t=roe((e=>e.options.hiresFix));return sd(kI,{gap:2,direction:"column",children:sd(Yq,{label:"High Res Optimization",fontSize:"md",isChecked:t,onChange:t=>e(Bte(t.target.checked))})})},gZ=()=>{const e=noe(),t=roe((e=>e.options.seamless));return sd(kI,{gap:2,direction:"column",children:sd(Yq,{label:"Seamless tiling",fontSize:"md",isChecked:t,onChange:t=>e(Kte(t.target.checked))})})},mZ=()=>ld(kI,{gap:2,direction:"column",children:[sd(gZ,{}),sd(pZ,{})]});function vZ(){const e=noe(),t=roe((e=>e.options.shouldRandomizeSeed));return sd(Yq,{label:"Randomize Seed",isChecked:t,onChange:t=>e(lne(t.target.checked))})}function bZ(){const e=roe((e=>e.options.seed)),t=roe((e=>e.options.shouldRandomizeSeed)),n=roe((e=>e.options.shouldGenerateVariations)),r=noe();return sd(zq,{label:"Seed",step:1,precision:0,flexGrow:1,min:0,max:Uq,isDisabled:t,isInvalid:e<0&&n,onChange:e=>r(tne(e)),value:e,width:"10rem"})}const yZ=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function xZ(){const e=noe(),t=roe((e=>e.options.shouldRandomizeSeed));return sd(IT,{size:"sm",isDisabled:t,onClick:()=>e(tne(yZ(0,Uq))),children:sd("p",{children:"Shuffle"})})}function wZ(){const e=noe(),t=roe((e=>e.options.threshold));return sd(zq,{label:"Noise Threshold",min:0,max:1e3,step:.1,onChange:t=>e(mne(t)),value:t,isInteger:!1})}function SZ(){const e=noe(),t=roe((e=>e.options.perlin));return sd(zq,{label:"Perlin Noise",min:0,max:1,step:.05,onChange:t=>e(qte(t)),value:t,isInteger:!1})}const kZ=()=>ld(kI,{gap:2,direction:"column",children:[sd(vZ,{}),ld(kI,{gap:2,children:[sd(bZ,{}),sd(xZ,{})]}),sd(kI,{gap:2,children:sd(wZ,{})}),sd(kI,{gap:2,children:sd(SZ,{})})]}),CZ=cU((e=>e.options),(e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),_Z=cU((e=>e.system),(e=>({isESRGANAvailable:e.isESRGANAvailable})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),EZ=()=>{const e=noe(),{upscalingLevel:t,upscalingStrength:n}=roe(CZ),{isESRGANAvailable:r}=roe(_Z);return ld("div",{className:"upscale-options",children:[sd(Bq,{isDisabled:!r,label:"Scale",value:t,onChange:t=>e(bne(Number(t.target.value))),validValues:Wq}),sd(zq,{isDisabled:!r,label:"Strength",step:.05,min:0,max:1,onChange:t=>e(yne(t)),value:n,isInteger:!1})]})};function LZ(){const e=roe((e=>e.system.isESRGANAvailable)),t=roe((e=>e.options.shouldRunESRGAN)),n=noe();return sd(Yq,{isDisabled:!e,isChecked:t,onChange:e=>n(cne(e.target.checked))})}function PZ(){const e=roe((e=>e.options.shouldGenerateVariations)),t=noe();return sd(Yq,{isChecked:e,width:"auto",onChange:e=>t(one(e.target.checked))})}function MZ(e){const{label:t,styleClass:n,isDisabled:r=!1,fontSize:o="1rem",width:i,isInvalid:a,...s}=e;return ld(GT,{className:`input ${n}`,isInvalid:a,isDisabled:r,flexGrow:1,children:[sd(JT,{fontSize:o,marginBottom:1,whiteSpace:"nowrap",className:"input-label",children:t}),sd(JO,{...s,className:"input-entry",size:"sm",width:i})]})}function AZ(){const e=roe((e=>e.options.seedWeights)),t=roe((e=>e.options.shouldGenerateVariations)),n=noe();return sd(MZ,{label:"Seed Weights",value:e,isInvalid:t&&!(CG(e)||""===e),isDisabled:!t,onChange:e=>n(nne(e.target.value))})}function TZ(){const e=roe((e=>e.options.variationAmount)),t=roe((e=>e.options.shouldGenerateVariations)),n=noe();return sd(zq,{label:"Variation Amount",value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:e=>n(xne(e)),isInteger:!1})}const OZ=()=>ld(kI,{gap:2,direction:"column",children:[sd(TZ,{}),sd(AZ,{})]});function IZ(){const e=noe(),t=roe((e=>e.options.cfgScale));return sd(zq,{label:"CFG Scale",step:.5,min:1.01,max:200,onChange:t=>e(Ote(t)),value:t,width:WZ,styleClass:"main-option-block",textAlign:"center",isInteger:!1})}const RZ=cU((e=>e.options),(e=>wte[e.activeTab]),{memoizeOptions:{equalityCheck:LG.isEqual}});cU((e=>e.options),(e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});const NZ=e=>e.options;function DZ(){const e=roe((e=>e.options.height)),t=roe(RZ),n=noe();return sd(Bq,{isDisabled:"unifiedCanvas"===t,label:"Height",value:e,flexGrow:1,onChange:e=>n(zte(Number(e.target.value))),validValues:Hq,styleClass:"main-option-block"})}const zZ=cU([e=>e.options],(e=>{const{iterations:t}=e;return{iterations:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function BZ(){const e=noe(),{iterations:t}=roe(zZ);return sd(zq,{label:"Images",step:1,min:1,max:9999,onChange:t=>e(Ute(t)),value:t,width:WZ,labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function FZ(){const e=roe((e=>e.options.sampler)),t=noe();return sd(Bq,{label:"Sampler",value:e,onChange:e=>t(Yte(e.target.value)),validValues:Fq,styleClass:"main-option-block"})}function jZ(){const e=noe(),t=roe((e=>e.options.steps));return sd(zq,{label:"Steps",min:1,max:9999,step:1,onChange:t=>e(gne(t)),value:t,width:WZ,styleClass:"main-option-block",textAlign:"center"})}function HZ(){const e=roe((e=>e.options.width)),t=roe(RZ),n=noe();return sd(Bq,{isDisabled:"unifiedCanvas"===t,label:"Width",value:e,flexGrow:1,onChange:e=>n(wne(Number(e.target.value))),validValues:jq,styleClass:"main-option-block"})}const WZ="auto";function UZ(){return sd("div",{className:"main-options",children:ld("div",{className:"main-options-list",children:[ld("div",{className:"main-options-row",children:[sd(BZ,{}),sd(jZ,{}),sd(IZ,{})]}),ld("div",{className:"main-options-row",children:[sd(HZ,{}),sd(DZ,{}),sd(FZ,{})]})]})})}const VZ=TU({name:"system",initialState:{isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[]},reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Error",e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?"Connected":"Disconnected"},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:o}=t.payload,i={timestamp:n,message:r,level:o||"info"};e.log.push(i)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Processing canceled"},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Preparing"},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus="Loading Model",e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1}}}),{setShouldDisplayInProgressType:GZ,setIsProcessing:$Z,addLogEntry:qZ,setShouldShowLogViewer:ZZ,setIsConnected:YZ,setSocketId:XZ,setShouldConfirmOnDelete:KZ,setOpenAccordions:QZ,setSystemStatus:JZ,setCurrentStatus:eY,setSystemConfig:tY,setShouldDisplayGuides:nY,processingCanceled:rY,errorOccurred:oY,errorSeen:iY,setModelList:aY,setIsCancelable:sY,modelChangeRequested:lY,setSaveIntermediatesInterval:cY,setEnableImageDebugging:uY,generationRequested:dY,addToast:hY,clearToastQueue:fY,setProcessingIndeterminateTask:pY}=VZ.actions,gY=VZ.reducer;function mY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function vY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function bY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function yY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function xY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}const wY=cU((e=>e.system),(e=>e.shouldDisplayGuides)),SY=({children:e,feature:t})=>{const n=roe(wY),{text:r}=Nq[t];return n?ld(TF,{trigger:"hover",children:[sd(HF,{children:sd(gI,{children:e})}),ld(FF,{className:"guide-popover-content",maxWidth:"400px",onClick:e=>e.preventDefault(),cursor:"initial",children:[sd(OF,{className:"guide-popover-arrow"}),sd("div",{className:"guide-popover-guide-content",children:r})]})]}):null},kY=rS((({feature:e,icon:t=mY},n)=>sd(SY,{feature:e,children:sd(gI,{ref:n,children:sd(wS,{marginBottom:"-.15rem",as:t})})})));function CY(e){const{header:t,feature:n,content:r,additionalHeaderComponents:o}=e;return ld(sT,{className:"advanced-settings-item",children:[sd(tT,{className:"advanced-settings-header",children:ld(kI,{width:"100%",gap:"0.5rem",align:"center",children:[sd(gI,{flexGrow:1,textAlign:"left",children:t}),o,n&&sd(kY,{feature:n}),sd(aT,{})]})}),sd(lT,{className:"advanced-settings-panel",children:r})]})}const _Y=e=>{const{accordionInfo:t}=e,n=roe((e=>e.system.openAccordions)),r=noe();return sd(cT,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:e=>r(QZ(e)),className:"advanced-settings",children:(()=>{const e=[];return t&&Object.keys(t).forEach((n=>{const{header:r,feature:o,content:i,additionalHeaderComponents:a}=t[n];e.push(sd(CY,{header:r,feature:o,content:i,additionalHeaderComponents:a},n))})),e})()})};function EY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function LY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function PY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function MY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function AY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function TY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function OY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function IY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function RY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function NY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function DY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function zY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function BY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function FY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function jY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function HY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function WY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function UY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function VY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function GY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function $Y(e){return rZ({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function qY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function ZY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function YY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function XY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function KY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function QY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function JY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function eX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function tX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function nX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function rX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function oX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function iX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function aX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function sX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function lX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function cX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function uX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function dX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function hX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function fX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function pX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function gX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function mX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function vX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const bX=e=>e.system,yX=e=>e.system.toastQueue,xX=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],wX=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],SX=e=>"line"===e.kind&&"mask"===e.layer,kX=e=>"image"===e.kind&&"base"===e.layer,CX=e=>"line"===e.kind,_X=e=>e.canvas,EX=cU([_X,RZ,bX],((e,t,n)=>e.layerState.stagingArea.images.length>0||"unifiedCanvas"===t&&n.isProcessing)),LX=e=>e.canvas.layerState.objects.find(kX),PX=cU([e=>e.options,e=>e.system,LX,RZ],((e,t,n,r)=>{const{prompt:o,shouldGenerateVariations:i,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:c,isConnected:u}=t;let d=!0;const h=[];return o&&!Boolean(o.match(/^[\s\r\n]+$/))||(d=!1,h.push("Missing prompt")),"img2img"!==r||s||(d=!1,h.push("No initial image selected")),c&&(d=!1,h.push("System Busy")),u||(d=!1,h.push("System Disconnected")),i&&(!CG(a)&&""!==a||-1===l)&&(d=!1,h.push("Seed-Weights badly formatted.")),{isReady:d,reasonsWhyNotReady:h}}),{memoizeOptions:{equalityCheck:LG.isEqual,resultEqualityCheck:LG.isEqual}}),MX=MU("socketio/generateImage"),AX=MU("socketio/runESRGAN"),TX=MU("socketio/runFacetool"),OX=MU("socketio/deleteImage"),IX=MU("socketio/requestImages"),RX=MU("socketio/requestNewImages"),NX=MU("socketio/cancelProcessing"),DX=MU("socketio/requestSystemConfig"),zX=MU("socketio/requestModelChange"),BX=MU("socketio/saveStagingAreaImageToGallery"),FX=MU("socketio/requestEmptyTempFolder"),jX=rS(((e,t)=>{const{children:n,tooltip:r="",tooltipProps:o,styleClass:i,...a}=e;return sd(qH,{label:r,...o,children:sd(IT,{ref:t,className:["invokeai__button",i].join(" "),...a,children:n})})}));function HX(e){const{iconButton:t=!1,...n}=e,r=noe(),{isReady:o}=roe(PX),i=roe(RZ),a=()=>{r(MX(i))};return Eq(["ctrl+enter","meta+enter"],(()=>{r(MX(i))}),{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,i]),sd("div",{style:{flexGrow:4},children:t?sd(dZ,{"aria-label":"Invoke",type:"submit",icon:sd(nX,{}),isDisabled:!o,onClick:a,className:"invoke-btn",tooltip:"Invoke",tooltipProps:{placement:"bottom"},...n}):sd(jX,{"aria-label":"Invoke",type:"submit",isDisabled:!o,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const WX=cU((e=>e.system),(e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable})),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function UX(e){const{...t}=e,n=noe(),{isProcessing:r,isConnected:o,isCancelable:i}=roe(WX),a=()=>n(NX());return Eq("shift+x",(()=>{(o||r)&&i&&a()}),[o,r,i]),sd(dZ,{icon:sd(xY,{}),tooltip:"Cancel","aria-label":"Cancel",isDisabled:!o||!r||!i,onClick:a,styleClass:"cancel-btn",...t})}const VX=cU((e=>e.options),(e=>e.shouldLoopback)),GX=()=>{const e=noe(),t=roe(VX);return sd(dZ,{"aria-label":"Toggle Loopback",tooltip:"Toggle Loopback",styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:sd(iX,{}),onClick:()=>{e(ane(!t))}})},$X=()=>{const e=roe(RZ);return ld("div",{className:"process-buttons",children:[sd(HX,{}),"img2img"===e&&sd(GX,{}),sd(UX,{})]})},qX=cU([e=>e.options,RZ],((e,t)=>({prompt:e.prompt,activeTabName:t})),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),ZX=()=>{const e=noe(),{prompt:t,activeTabName:n}=roe(qX),{isReady:r}=roe(PX),o=i.exports.useRef(null);Eq("alt+a",(()=>{o.current?.focus()}),[]);return sd("div",{className:"prompt-bar",children:sd(GT,{isInvalid:0===t.length||Boolean(t.match(/^[\s\r\n]+$/)),children:sd(CH,{id:"prompt",name:"prompt",placeholder:"Type prompt here. [negative tokens], (upweight)++, (downweight)--, swap and blend are available (see docs)",size:"lg",value:t,onChange:t=>{e(Zte(t.target.value))},onKeyDown:t=>{"Enter"===t.key&&!1===t.shiftKey&&r&&(t.preventDefault(),e(MX(n)))},resize:"vertical",height:30,ref:o,_placeholder:{color:"var(--text-color-secondary)"}})})})};function YX(e){return rZ({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function XX(e){return rZ({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function KX(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const QX=!1,JX=j.createContext(null);var eK=function(e){return e.scrollTop},tK="unmounted",nK="exited",rK="entering",oK="entered",iK="exiting",aK=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=nK,r.appearStatus=rK):o=oK:o=t.unmountOnExit||t.mountOnEnter?tK:nK,r.state={status:o},r.nextCallback=null,r}ND(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===tK?{status:nK}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==rK&&n!==oK&&(t=rK):n!==rK&&n!==oK||(t=iK)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===rK){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this);n&&eK(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===nK&&this.setState({status:tK})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[Zu.findDOMNode(this),r],i=o[0],a=o[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||QX?this.safeSetState({status:oK},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:rK},(function(){t.props.onEntering(i,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:oK},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Zu.findDOMNode(this);t&&!QX?(this.props.onExit(r),this.safeSetState({status:iK},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:nK},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:nK},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===tK)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=pD(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return sd(JX.Provider,{value:null,children:"function"==typeof n?n(e,r):j.cloneElement(j.Children.only(n),r)})},t}(j.Component);function sK(){}aK.contextType=JX,aK.propTypes={},aK.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:sK,onEntering:sK,onEntered:sK,onExit:sK,onExiting:sK,onExited:sK},aK.UNMOUNTED=tK,aK.EXITED=nK,aK.ENTERING=rK,aK.ENTERED=oK,aK.EXITING=iK;const lK=aK;var cK=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))},uK=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=KX(n.className,r):n.setAttribute("class",KX(n.className&&n.className.baseVal||"",r)));var n,r}))},dK=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oMath.floor(e/t)*t,pK=(e,t)=>Math.round(e/t)*t,gK=(e,t,n,r,o,i,a)=>({x:e/2-(n+o/2)*a,y:t/2-(r+i/2)*a}),mK=(e,t,n,r,o=.95)=>{const i=e*o/n,a=t*o/r;return Math.min(1,Math.min(i,a))},vK=.95,bK=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),yK=e=>{const{width:t,height:n}=e,r={width:t,height:n},o=t/n;let i=t*n,a=448;for(;i<262144;){if(a+=64,t===n){r.width=512,r.height=512;break}o>1?(r.width=a,r.height=pK(a/o,64)):o<1&&(r.height=a,r.width=pK(a*o,64)),i=r.width*r.height}return r},xK={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},wK=TU({name:"canvas",initialState:{boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:xK,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,"move"!==n&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;"move"!==t&&(e.tool="brush"===t?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter((e=>!SX(e))),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,o={width:fK(LG.clamp(n.width,64,512),64),height:fK(LG.clamp(n.height,64,512),64)},i={x:pK(n.width/2-o.width/2,64),y:pK(n.height/2-o.height/2,64)};if("auto"===e.boundingBoxScaleMethod){const t=yK(o);e.scaledBoundingBoxDimensions=t}e.boundingBoxDimensions=o,e.boundingBoxCoordinates=i,e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.layerState={...xK,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=mK(r.width,r.height,n.width,n.height,vK),s=gK(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=(r=t.payload,{width:pK(r.width,64),height:pK(r.height,64)});var r;if(e.boundingBoxDimensions=n,"auto"===e.boundingBoxScaleMethod){const t=yK(n);e.scaledBoundingBoxDimensions=t}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=bK(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldUseInpaintReplace:(e,t)=>{e.shouldUseInpaintReplace=t.payload},setInpaintReplace:(e,t)=>{e.inpaintReplace=t.payload},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;n&&r&&(e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...xK.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:o,brushSize:i,shouldRestrictStrokesToBox:a}=e;if("move"===n||"colorPicker"===n)return;const s=i/2,l="base"===r&&"brush"===n?{color:o}:{};e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const c={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(c.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(c),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(CX);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(LG.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.layerState=xK,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(kX),o={width:Math.floor(t),height:Math.floor(n)};if(!r){const t=mK(o.width,o.height,512,512,vK),n=gK(o.width,o.height,0,0,512,512,t),r={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.stageDimensions=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=r,"auto"===e.boundingBoxScaleMethod){const t=yK(r);e.scaledBoundingBoxDimensions=t}return}const{width:i,height:a}=r,s=mK(t,n,i,a,.95),l=gK(o.width,o.height,0,0,i,a,s);e.minimumStageScale=s,e.stageScale=s,e.stageCoordinates=bK(l),e.stageDimensions=o,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(kX)){const t=mK(r.width,r.height,512,512,vK),n=gK(r.width,r.height,0,0,512,512,t),o={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=o,"auto"===e.boundingBoxScaleMethod){const t=yK(o);e.scaledBoundingBoxDimensions=t}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:o}}=e,{x:i,y:a,width:s,height:l}=n;if(0!==s&&0!==l){const t=mK(r,o,s,l,vK),n=gK(r,o,i,a,s,l,t);e.stageScale=t,e.stageCoordinates=n}else{const t=mK(r,o,512,512,vK),n=gK(r,o,0,0,512,512,t),i={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=i,"auto"===e.boundingBoxScaleMethod){const t=yK(i);e.scaledBoundingBoxDimensions=t}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...xK.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:o}=e,i=r.width/o,a=r.height/o;if(n.x<0||n.x+t.width>i||n.y<0||n.y+t.height>a){const t={width:fK(LG.clamp(i,64,512),64),height:fK(LG.clamp(a,64,512),64)},n={x:pK(i/2-t.width/2,64),y:pK(a/2-t.height/2,64)};if(e.boundingBoxDimensions=t,e.boundingBoxCoordinates=n,"auto"===e.boundingBoxScaleMethod){const n=yK(t);e.scaledBoundingBoxDimensions=n}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,"auto"===t.payload){const t=yK(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=t}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:SK,addFillRect:kK,addImageToStagingArea:CK,addLine:_K,addPointToCurrentLine:EK,clearCanvasHistory:LK,clearMask:PK,commitColorPickerColor:MK,commitStagingAreaImage:AK,discardStagedImages:TK,fitBoundingBoxToStage:OK,mouseLeftCanvas:IK,nextStagingAreaImage:RK,prevStagingAreaImage:NK,redo:DK,resetCanvas:zK,resetCanvasInteractionState:BK,resetCanvasView:FK,resizeAndScaleCanvas:jK,resizeCanvas:HK,setBoundingBoxCoordinates:WK,setBoundingBoxDimensions:UK,setBoundingBoxPreviewFill:VK,setBoundingBoxScaleMethod:GK,setBrushColor:$K,setBrushSize:qK,setCanvasContainerDimensions:ZK,setColorPickerColor:YK,setCursorPosition:XK,setDoesCanvasNeedScaling:KK,setInitialCanvasImage:QK,setInpaintReplace:JK,setIsDrawing:eQ,setIsMaskEnabled:tQ,setIsMouseOverBoundingBox:nQ,setIsMoveBoundingBoxKeyHeld:rQ,setIsMoveStageKeyHeld:oQ,setIsMovingBoundingBox:iQ,setIsMovingStage:aQ,setIsTransformingBoundingBox:sQ,setLayer:lQ,setMaskColor:cQ,setMergedCanvas:uQ,setShouldAutoSave:dQ,setShouldCropToBoundingBoxOnSave:hQ,setShouldDarkenOutsideBoundingBox:fQ,setShouldLockBoundingBox:pQ,setShouldPreserveMaskedArea:gQ,setShouldShowBoundingBox:mQ,setShouldShowBrush:vQ,setShouldShowBrushPreview:bQ,setShouldShowCanvasDebugInfo:yQ,setShouldShowCheckboardTransparency:xQ,setShouldShowGrid:wQ,setShouldShowIntermediates:SQ,setShouldShowStagingImage:kQ,setShouldShowStagingOutline:CQ,setShouldSnapToGrid:_Q,setShouldUseInpaintReplace:EQ,setStageCoordinates:LQ,setStageScale:PQ,setTool:MQ,toggleShouldLockBoundingBox:AQ,toggleTool:TQ,undo:OQ,setScaledBoundingBoxDimensions:IQ,setShouldRestrictStrokesToBox:RQ}=wK.actions,NQ=wK.reducer,DQ=""+new URL("logo.13003d72.png",n.meta.url).href,zQ=cU((e=>e.options),(e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),BQ=e=>{const t=noe(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:o}=roe(zQ),a=i.exports.useRef(null),s=i.exports.useRef(null),l=i.exports.useRef(null),{children:c}=e;Eq("o",(()=>{t(hne(!n)),o&&setTimeout((()=>t(KK(!0))),400)}),[n,o]),Eq("esc",(()=>{t(hne(!1))}),{enabled:()=>!o,preventDefault:!0},[o]),Eq("shift+o",(()=>{h(),t(KK(!0))}),[o]);const u=i.exports.useCallback((()=>{o||(t(Gte(s.current?s.current.scrollTop:0)),t(hne(!1)),t(ine(!1)))}),[t,o]),d=()=>{l.current&&window.clearTimeout(l.current)},h=()=>{t(sne(!o)),t(KK(!0))};return i.exports.useEffect((()=>{function e(e){a.current&&!a.current.contains(e.target)&&u()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[u]),sd(hK,{nodeRef:a,in:n||r&&!o,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:sd("div",{className:"options-panel-wrapper","data-pinned":o,tabIndex:1,ref:a,onMouseEnter:o?void 0:d,onMouseOver:o?void 0:d,style:{borderRight:o?"":"0.3rem solid var(--tab-list-text-inactive)"},children:sd("div",{className:"options-panel-margin",children:ld("div",{className:"options-panel",ref:s,onMouseLeave:e=>{e.target!==s.current?d():!o&&(l.current=window.setTimeout((()=>u()),500))},children:[sd(qH,{label:"Pin Options Panel",children:sd("div",{className:"options-panel-pin-button","data-selected":o,onClick:h,children:sd(o?YX:XX,{})})}),!o&&ld("div",{className:"invoke-ai-logo-wrapper",children:[sd("img",{src:DQ,alt:"invoke-ai-logo"}),ld("h1",{children:["invoke ",sd("strong",{children:"ai"})]})]}),c]})})})})};function FQ(){const e={seed:{header:"Seed",feature:Rq.SEED,content:sd(kZ,{})},variations:{header:"Variations",feature:Rq.VARIATIONS,content:sd(OZ,{}),additionalHeaderComponents:sd(PZ,{})},face_restore:{header:"Face Restoration",feature:Rq.FACE_CORRECTION,content:sd(Zq,{}),additionalHeaderComponents:sd(Xq,{})},upscale:{header:"Upscaling",feature:Rq.UPSCALE,content:sd(EZ,{}),additionalHeaderComponents:sd(LZ,{})},other:{header:"Other Options",feature:Rq.OTHER,content:sd(mZ,{})}};return ld(BQ,{children:[sd(ZX,{}),sd($X,{}),sd(UZ,{}),sd(fZ,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),sd(Kq,{}),sd(_Y,{accordionInfo:e})]})}const jQ=i.exports.createContext(null),HQ=e=>{const{styleClass:t}=e,n=i.exports.useContext(jQ);return sd("div",{className:`image-uploader-button-outer ${t}`,onClick:()=>{n&&n()},children:ld("div",{className:"image-upload-button",children:[sd(gX,{}),sd(LI,{size:"lg",children:"Click or Drag and Drop"})]})})},WQ=cU((e=>e.system),(e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),UQ=i.exports.forwardRef((({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:a}=KO(),s=noe(),{shouldConfirmOnDelete:l,isConnected:c,isProcessing:u}=roe(WQ),d=i.exports.useRef(null),h=()=>{c&&!u&&e&&s(OX(e)),a()};Eq("delete",(()=>{l?o():h()}),[e,l]);return ld(ad,{children:[i.exports.cloneElement(t,{onClick:e?e=>{e.stopPropagation(),l?o():h()}:void 0,ref:n}),sd($B,{isOpen:r,leastDestructiveRef:d,onClose:a,children:sd(GB,{children:ld(qB,{className:"modal",children:[sd(UB,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),sd(RB,{children:ld(kI,{direction:"column",gap:5,children:[sd(WI,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),sd(GT,{children:ld(kI,{alignItems:"center",children:[sd(JT,{mb:0,children:"Don't ask me again"}),sd(tH,{checked:!l,onChange:e=>s(KZ(!e.target.checked))})]})})]})}),ld(WB,{children:[sd(IT,{ref:d,onClick:a,className:"modal-close-btn",children:"Cancel"}),sd(IT,{colorScheme:"red",onClick:h,ml:3,children:"Delete"})]})]})})})]})})),VQ=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:o=!0,...i}=e;return ld(TF,{...i,children:[sd(HF,{children:t}),ld(FF,{className:`invokeai__popover-content ${r}`,children:[o&&sd(OF,{className:"invokeai__popover-arrow"}),n]})]})},GQ=cU([e=>e.system,e=>e.options,e=>e.gallery,RZ],((e,t,n,r)=>{const{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:c,shouldShowImageDetails:u,isLightBoxOpen:d}=t,{intermediateImage:h,currentImage:f}=n;return{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:c,shouldDisableToolbarButtons:Boolean(h)||!f,currentImage:f,shouldShowImageDetails:u,activeTabName:r,isLightBoxOpen:d}}),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),$Q=()=>{const e=noe(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:o,upscalingLevel:i,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:c,isLightBoxOpen:u,activeTabName:d}=roe(GQ),h=DH(),f=()=>{c&&(u&&e(Wte(!1)),e(Hte(c)),e(Pte("img2img")))};Eq("shift+i",(()=>{c?(f(),h({title:"Sent To Image To Image",status:"success",duration:2500,isClosable:!0})):h({title:"No Image Loaded",description:"No image found to send to image to image module.",status:"error",duration:2500,isClosable:!0})}),[c]);const p=()=>{c&&(c.metadata&&e(Ate(c.metadata)),"img2img"===c.metadata?.image.type?e(Pte("img2img")):"txt2img"===c.metadata?.image.type&&e(Pte("txt2img")))};Eq("a",(()=>{["txt2img","img2img"].includes(c?.metadata?.image?.type)?(p(),h({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})):h({title:"Parameters Not Set",description:"No metadata found for this image.",status:"error",duration:2500,isClosable:!0})}),[c]);const g=()=>{c?.metadata&&e(tne(c.metadata.image.seed))};Eq("s",(()=>{c?.metadata?.image?.seed?(g(),h({title:"Seed Set",status:"success",duration:2500,isClosable:!0})):h({title:"Seed Not Set",description:"Could not find seed for this image.",status:"error",duration:2500,isClosable:!0})}),[c]);const m=()=>c?.metadata?.image?.prompt&&e(Zte(c.metadata.image.prompt));Eq("p",(()=>{c?.metadata?.image?.prompt?(m(),h({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})):h({title:"Prompt Not Set",description:"Could not find prompt for this image.",status:"error",duration:2500,isClosable:!0})}),[c]);const v=()=>{c&&e(AX(c))};Eq("u",(()=>{o&&!s&&n&&!t&&i?v():h({title:"Upscaling Failed",status:"error",duration:2500,isClosable:!0})}),[c,o,s,n,t,i]);const b=()=>{c&&e(TX(c))};Eq("r",(()=>{r&&!s&&n&&!t&&a?b():h({title:"Face Restoration Failed",status:"error",duration:2500,isClosable:!0})}),[c,r,s,n,t,a]);const y=()=>e(dne(!l));Eq("i",(()=>{c?y():h({title:"Failed to load metadata",status:"error",duration:2500,isClosable:!0})}),[c,l]);return ld("div",{className:"current-image-options",children:[ld(NT,{isAttached:!0,children:[sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{"aria-label":"Send to...",icon:sd(cX,{})}),children:ld("div",{className:"current-image-send-to-popover",children:[sd(jX,{size:"sm",onClick:f,leftIcon:sd(uX,{}),children:"Send to Image to Image"}),sd(jX,{size:"sm",onClick:()=>{c&&(u&&e(Wte(!1)),e(QK(c)),e(KK(!0)),"unifiedCanvas"!==d&&e(Pte("unifiedCanvas")),h({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0}))},leftIcon:sd(uX,{}),children:"Send to Unified Canvas"}),sd(jX,{size:"sm",onClick:()=>{navigator.clipboard.writeText(c?window.location.toString()+c.url:"").then((()=>{h({title:"Image Link Copied",status:"success",duration:2500,isClosable:!0})}))},leftIcon:sd(BY,{}),children:"Copy Link to Image"}),sd(jX,{leftIcon:sd(jY,{}),size:"sm",children:sd(MI,{download:!0,href:c?.url,children:"Download Image"})})]})}),sd(dZ,{icon:sd(UY,{}),tooltip:u?"Close Viewer (Z)":"Open In Viewer (Z)","aria-label":u?"Close Viewer (Z)":"Open In Viewer (Z)","data-selected":u,onClick:()=>{e(Wte(!u))}})]}),ld(NT,{isAttached:!0,children:[sd(dZ,{icon:sd(oX,{}),tooltip:"Use Prompt (P)","aria-label":"Use Prompt (P)",isDisabled:!c?.metadata?.image?.prompt,onClick:m}),sd(dZ,{icon:sd(lX,{}),tooltip:"Use Seed (S)","aria-label":"Use Seed (S)",isDisabled:!c?.metadata?.image?.seed,onClick:g}),sd(dZ,{icon:sd(RY,{}),tooltip:"Use All (A)","aria-label":"Use All (A)",isDisabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),onClick:p})]}),ld(NT,{isAttached:!0,children:[sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{icon:sd(ZY,{}),"aria-label":"Restore Faces"}),children:ld("div",{className:"current-image-postprocessing-popover",children:[sd(Zq,{}),sd(jX,{isDisabled:!(r&&c&&n&&!t&&a),onClick:b,children:"Restore Faces"})]})}),sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{icon:sd(WY,{}),"aria-label":"Upscale"}),children:ld("div",{className:"current-image-postprocessing-popover",children:[sd(EZ,{}),sd(jX,{isDisabled:!(o&&c&&n&&!t&&i),onClick:v,children:"Upscale Image"})]})})]}),sd(NT,{isAttached:!0,children:sd(dZ,{icon:sd(zY,{}),tooltip:"Info (I)","aria-label":"Info (I)","data-selected":l,onClick:y})}),sd(UQ,{image:c,children:sd(dZ,{icon:sd(fX,{}),tooltip:"Delete Image","aria-label":"Delete Image",isDisabled:!c||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})},qQ=TU({name:"gallery",initialState:{currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,o=e.categories[r].images,i=o.filter((e=>e.uuid!==n));if(n===e.currentImageUuid){const t=o.findIndex((e=>e.uuid===n)),r=EG.exports.clamp(t,0,i.length-1);e.currentImage=i.length?i[r]:void 0,e.currentImageUuid=i.length?i[r].uuid:""}e.categories[r].images=i},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:o,url:i,mtime:a}=n,s=e.categories[r];s.images.find((e=>e.url===i&&e.mtime===a))||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=o,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r>0){const t=n[r-1];e.currentImage=t,e.currentImageUuid=t.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:o}=t.payload,i=e.categories[o].images;if(n.length>0){const t=n.filter((e=>!i.find((t=>t.url===e.url&&t.mtime===e.mtime))));if(e.categories[o].images=i.concat(t).sort(((e,t)=>t.mtime-e.mtime)),!e.currentImage){const t=n[0];e.currentImage=t,e.currentImageUuid=t.uuid}e.categories[o].latest_mtime=n[0].mtime,e.categories[o].earliest_mtime=n[n.length-1].mtime}void 0!==r&&(e.categories[o].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:ZQ,clearIntermediateImage:YQ,removeImage:XQ,setCurrentImage:KQ,addGalleryImages:QQ,setIntermediateImage:JQ,selectNextImage:eJ,selectPrevImage:tJ,setShouldPinGallery:nJ,setShouldShowGallery:rJ,setGalleryScrollPosition:oJ,setGalleryImageMinimumWidth:iJ,setGalleryImageObjectFit:aJ,setShouldHoldGalleryOpen:sJ,setShouldAutoSwitchToNewImages:lJ,setCurrentCategory:cJ,setGalleryWidth:uJ,setShouldUseSingleGalleryColumn:dJ}=qQ.actions,hJ=qQ.reducer;SS({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"}),SS({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"}),SS({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"}),SS({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"}),SS({displayName:"SunIcon",path:ld("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[sd("circle",{cx:"12",cy:"12",r:"5"}),sd("path",{d:"M12 1v2"}),sd("path",{d:"M12 21v2"}),sd("path",{d:"M4.22 4.22l1.42 1.42"}),sd("path",{d:"M18.36 18.36l1.42 1.42"}),sd("path",{d:"M1 12h2"}),sd("path",{d:"M21 12h2"}),sd("path",{d:"M4.22 19.78l1.42-1.42"}),sd("path",{d:"M18.36 5.64l1.42-1.42"})]})}),SS({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"}),SS({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:sd("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})}),SS({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"}),SS({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}),SS({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"}),SS({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"}),SS({displayName:"ViewIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),sd("circle",{cx:"12",cy:"12",r:"2"})]})}),SS({displayName:"ViewOffIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),sd("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"})]})}),SS({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"}),SS({displayName:"DeleteIcon",path:sd("g",{fill:"currentColor",children:sd("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})}),SS({displayName:"RepeatIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),sd("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"})]})}),SS({displayName:"RepeatClockIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),sd("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"})]})}),SS({displayName:"EditIcon",path:ld("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[sd("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),sd("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),SS({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),SS({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}),SS({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),SS({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),SS({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"}),SS({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"}),SS({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"}),SS({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"}),SS({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var fJ=SS({displayName:"ExternalLinkIcon",path:ld("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[sd("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),sd("path",{d:"M15 3h6v6"}),sd("path",{d:"M10 14L21 3"})]})});function pJ(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}SS({displayName:"LinkIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),sd("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"})]})}),SS({displayName:"PlusSquareIcon",path:ld("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[sd("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),sd("path",{d:"M12 8v8"}),sd("path",{d:"M8 12h8"})]})}),SS({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"}),SS({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"}),SS({displayName:"TimeIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),sd("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"})]})}),SS({displayName:"ArrowRightIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),sd("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"})]})}),SS({displayName:"ArrowLeftIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),sd("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"})]})}),SS({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"}),SS({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"}),SS({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"}),SS({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"}),SS({displayName:"EmailIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),sd("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"})]})}),SS({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"}),SS({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"}),SS({displayName:"SpinnerIcon",path:ld(ad,{children:[sd("defs",{children:ld("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[sd("stop",{stopColor:"currentColor",offset:"0%"}),sd("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),ld("g",{transform:"translate(2)",fill:"none",children:[sd("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),sd("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),sd("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})}),SS({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),SS({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:sd("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})}),SS({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"}),SS({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"}),SS({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"}),SS({displayName:"InfoOutlineIcon",path:ld("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[sd("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),sd("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),sd("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})}),SS({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}),SS({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}),SS({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"}),SS({displayName:"QuestionOutlineIcon",path:ld("g",{stroke:"currentColor",strokeWidth:"1.5",children:[sd("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),sd("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),sd("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})}),SS({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"}),SS({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),SS({viewBox:"0 0 14 14",path:sd("g",{fill:"currentColor",children:sd("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})}),SS({displayName:"MinusIcon",path:sd("g",{fill:"currentColor",children:sd("rect",{height:"4",width:"20",x:"2",y:"10"})})}),SS({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});const gJ=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:i=!1})=>ld(kI,{gap:2,children:[n&&sd(qH,{label:`Recall ${e}`,children:sd(DT,{"aria-label":"Use this parameter",icon:sd(pJ,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),i&&sd(qH,{label:`Copy ${e}`,children:sd(DT,{"aria-label":`Copy ${e}`,icon:sd(BY,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),ld(kI,{direction:o?"column":"row",children:[ld(WI,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?ld(MI,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",sd(fJ,{mx:"2px"})]}):sd(WI,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),mJ=i.exports.memo((({image:e,styleClass:t})=>{const n=noe();Eq("esc",(()=>{n(dne(!1))}));const r=e?.metadata?.image||{},o=e?.dreamPrompt,{cfg_scale:i,fit:a,height:s,hires_fix:l,init_image_path:c,mask_image_path:u,orig_path:d,perlin:h,postprocessing:f,prompt:p,sampler:g,scale:m,seamless:v,seed:b,steps:y,strength:x,threshold:w,type:S,variations:k,width:C}=r,_=JSON.stringify(e.metadata,null,2);return sd("div",{className:`image-metadata-viewer ${t}`,children:ld(kI,{gap:1,direction:"column",width:"100%",children:[ld(kI,{gap:2,children:[sd(WI,{fontWeight:"semibold",children:"File:"}),ld(MI,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,sd(fJ,{mx:"2px"})]})]}),Object.keys(r).length>0?ld(ad,{children:[S&&sd(gJ,{label:"Generation type",value:S}),e.metadata?.model_weights&&sd(gJ,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(S)&&sd(gJ,{label:"Original image",value:d}),"gfpgan"===S&&void 0!==x&&sd(gJ,{label:"Fix faces strength",value:x,onClick:()=>n(Nte(x))}),"esrgan"===S&&void 0!==m&&sd(gJ,{label:"Upscaling scale",value:m,onClick:()=>n(bne(m))}),"esrgan"===S&&void 0!==x&&sd(gJ,{label:"Upscaling strength",value:x,onClick:()=>n(yne(x))}),p&&sd(gJ,{label:"Prompt",labelPosition:"top",value:kG(p),onClick:()=>n(Zte(p))}),void 0!==b&&sd(gJ,{label:"Seed",value:b,onClick:()=>n(tne(b))}),void 0!==w&&sd(gJ,{label:"Noise Threshold",value:w,onClick:()=>n(mne(w))}),void 0!==h&&sd(gJ,{label:"Perlin Noise",value:h,onClick:()=>n(qte(h))}),g&&sd(gJ,{label:"Sampler",value:g,onClick:()=>n(Yte(g))}),y&&sd(gJ,{label:"Steps",value:y,onClick:()=>n(gne(y))}),void 0!==i&&sd(gJ,{label:"CFG scale",value:i,onClick:()=>n(Ote(i))}),k&&k.length>0&&sd(gJ,{label:"Seed-weight pairs",value:_G(k),onClick:()=>n(nne(_G(k)))}),v&&sd(gJ,{label:"Seamless",value:v,onClick:()=>n(Kte(v))}),l&&sd(gJ,{label:"High Resolution Optimization",value:l,onClick:()=>n(Bte(l))}),C&&sd(gJ,{label:"Width",value:C,onClick:()=>n(wne(C))}),s&&sd(gJ,{label:"Height",value:s,onClick:()=>n(zte(s))}),c&&sd(gJ,{label:"Initial image",value:c,isLink:!0,onClick:()=>n(Hte(c))}),u&&sd(gJ,{label:"Mask image",value:u,isLink:!0,onClick:()=>n(Vte(u))}),"img2img"===S&&x&&sd(gJ,{label:"Image to image strength",value:x,onClick:()=>n(Fte(x))}),a&&sd(gJ,{label:"Image to image fit",value:a,onClick:()=>n(rne(a))}),f&&f.length>0&&ld(ad,{children:[sd(LI,{size:"sm",children:"Postprocessing"}),f.map(((e,t)=>{if("esrgan"===e.type){const{scale:r,strength:o}=e;return ld(kI,{pl:"2rem",gap:1,direction:"column",children:[sd(WI,{size:"md",children:`${t+1}: Upscale (ESRGAN)`}),sd(gJ,{label:"Scale",value:r,onClick:()=>n(bne(r))}),sd(gJ,{label:"Strength",value:o,onClick:()=>n(yne(o))})]},t)}if("gfpgan"===e.type){const{strength:r}=e;return ld(kI,{pl:"2rem",gap:1,direction:"column",children:[sd(WI,{size:"md",children:`${t+1}: Face restoration (GFPGAN)`}),sd(gJ,{label:"Strength",value:r,onClick:()=>{n(Nte(r)),n(Dte("gfpgan"))}})]},t)}if("codeformer"===e.type){const{strength:r,fidelity:o}=e;return ld(kI,{pl:"2rem",gap:1,direction:"column",children:[sd(WI,{size:"md",children:`${t+1}: Face restoration (Codeformer)`}),sd(gJ,{label:"Strength",value:r,onClick:()=>{n(Nte(r)),n(Dte("codeformer"))}}),o&&sd(gJ,{label:"Fidelity",value:o,onClick:()=>{n(Ite(o)),n(Dte("codeformer"))}})]},t)}}))]}),o&&sd(gJ,{withCopy:!0,label:"Dream Prompt",value:o}),ld(kI,{gap:2,direction:"column",children:[ld(kI,{gap:2,children:[sd(qH,{label:"Copy metadata JSON",children:sd(DT,{"aria-label":"Copy metadata JSON",icon:sd(BY,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(_)})}),sd(WI,{fontWeight:"semibold",children:"Metadata JSON:"})]}),sd("div",{className:"image-json-viewer",children:sd("pre",{children:_})})]})]}):sd(bI,{width:"100%",pt:10,children:sd(WI,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})}),((e,t)=>e.image.uuid===t.image.uuid)),vJ=cU([e=>e.gallery,e=>e.options],((e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex((t=>t.uuid===e?.currentImage?.uuid)),l=a.length;return{imageToDisplay:o||r,isIntermediate:Boolean(o),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:0===s,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:i,shouldShowPrevImageButton:0===s,shouldShowNextImageButton:!isNaN(s)&&s===l-1}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function bJ(){const e=noe(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:o,isIntermediate:a}=roe(vJ),[s,l]=i.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return ld("div",{className:"current-image-preview",children:[o&&sd(_T,{src:o.url,width:o.width,height:o.height,style:{imageRendering:a?"pixelated":"initial"}}),!r&&ld("div",{className:"current-image-next-prev-buttons",children:[sd("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!t&&sd(DT,{"aria-label":"Previous image",icon:sd(MY,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(tJ())}})}),sd("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!n&&sd(DT,{"aria-label":"Next image",icon:sd(AY,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(eJ())}})})]}),r&&o&&sd(mJ,{image:o,styleClass:"current-image-metadata"})]})}const yJ=cU([e=>e.gallery,e=>e.options,RZ],((e,t,n)=>{const{currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t;return{activeTabName:n,shouldShowImageDetails:i,hasAnImageToDisplay:r||o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),xJ=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=roe(yJ);return sd("div",{className:"current-image-area","data-tab-name":t,children:e?ld(ad,{children:[sd($Q,{}),sd(bJ,{})]}):sd("div",{className:"current-image-display-placeholder",children:sd(yY,{})})})},wJ=()=>{const e=i.exports.useContext(jQ);return sd(dZ,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:sd(gX,{}),onClick:e||void 0})};function SJ(){const e=roe((e=>e.options.initialImage)),t=noe(),n=DH();return ld(ad,{children:[ld("div",{className:"init-image-preview-header",children:[sd("h2",{children:"Initial Image"}),sd(wJ,{})]}),e&&sd("div",{className:"init-image-preview",children:sd(_T,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:"string"==typeof e?e:e.url,onError:()=>{n({title:"Problem loading parameters",description:"Unable to load init image.",status:"error",isClosable:!0}),t(_te())}})})]})}const kJ=()=>{const e=roe((e=>e.options.initialImage)),{currentImage:t}=roe((e=>e.gallery));return ld("div",{className:"workarea-split-view",children:[sd("div",{className:"workarea-split-view-left",children:e?sd("div",{className:"image-to-image-area",children:sd(SJ,{})}):sd(HQ,{})}),t&&sd("div",{className:"workarea-split-view-right",children:sd(xJ,{})})]})};function CJ(e){return rZ({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}var _J=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),EJ=globalThis&&globalThis.__assign||function(){return EJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const t=n.map((e=>i.exports.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return i.exports.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=i.exports.createContext(r),a=n.length;function s(t){const{scope:n,children:r,...s}=t,l=(null==n?void 0:n[e][a])||o,c=i.exports.useMemo((()=>s),Object.values(s));return i.exports.createElement(l.Provider,{value:c},r)}return n=[...n,r],s.displayName=t+"Provider",[s,function(n,s){const l=(null==s?void 0:s[e][a])||o,c=i.exports.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},qJ(r,...t)]}function qJ(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return i.exports.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function ZJ(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function YJ(...e){return i.exports.useCallback(ZJ(...e),e)}const XJ=i.exports.forwardRef(((e,t)=>{const{children:n,...r}=e,o=i.exports.Children.toArray(n),a=o.find(JJ);if(a){const e=a.props.children,n=o.map((t=>t===a?i.exports.Children.count(e)>1?i.exports.Children.only(null):i.exports.isValidElement(e)?e.props.children:null:t));return i.exports.createElement(KJ,mp({},r,{ref:t}),i.exports.isValidElement(e)?i.exports.cloneElement(e,void 0,n):null)}return i.exports.createElement(KJ,mp({},r,{ref:t}),n)}));XJ.displayName="Slot";const KJ=i.exports.forwardRef(((e,t)=>{const{children:n,...r}=e;return i.exports.isValidElement(n)?i.exports.cloneElement(n,{...e0(r,n.props),ref:ZJ(t,n.ref)}):i.exports.Children.count(n)>1?i.exports.Children.only(null):null}));KJ.displayName="SlotClone";const QJ=({children:e})=>i.exports.createElement(i.exports.Fragment,null,e);function JJ(e){return i.exports.isValidElement(e)&&e.type===QJ}function e0(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const t0=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=i.exports.forwardRef(((e,n)=>{const{asChild:r,...o}=e,a=r?XJ:t;return i.exports.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),i.exports.createElement(a,mp({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function n0(e,t){e&&U.exports.flushSync((()=>e.dispatchEvent(t)))}function r0(e){const t=e+"CollectionProvider",[n,r]=$J(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:n}=e,r=j.useRef(null),i=j.useRef(new Map).current;return j.createElement(o,{scope:t,itemMap:i,collectionRef:r},n)},Slot:j.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=YJ(t,i(a,n).collectionRef);return j.createElement(XJ,{ref:o},r)})),ItemSlot:j.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,a=j.useRef(null),c=YJ(t,a),u=i(s,n);return j.useEffect((()=>(u.itemMap.set(a,{ref:a,...o}),()=>{u.itemMap.delete(a)}))),j.createElement(XJ,{[l]:"",ref:c},r)}))},function(t){const n=i(e+"CollectionConsumer",t),r=j.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}const o0=i.exports.createContext(void 0);function i0(e){const t=i.exports.useContext(o0);return e||t||"ltr"}function a0(e){const t=i.exports.useRef(e);return i.exports.useEffect((()=>{t.current=e})),i.exports.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const s0="dismissableLayer.update",l0="dismissableLayer.pointerDownOutside",c0="dismissableLayer.focusOutside";let u0;const d0=i.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),h0=i.exports.forwardRef(((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=i.exports.useContext(d0),[h,f]=i.exports.useState(null),p=null!==(n=null==h?void 0:h.ownerDocument)&&void 0!==n?n:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,g]=i.exports.useState({}),m=YJ(t,(e=>f(e))),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(b),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,k=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=a0(e),r=i.exports.useRef(!1),o=i.exports.useRef((()=>{}));return i.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){const i={originalEvent:e};function a(){p0(l0,n,i,{discrete:!0})}"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=a0(e),r=i.exports.useRef(!1);return i.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){p0(c0,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=a0(e);i.exports.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[n,t])}((e=>{x===d.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.exports.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(u0=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),f0(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=u0)}}),[h,p,r,d]),i.exports.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),f0())}),[h,d]),i.exports.useEffect((()=>{const e=()=>g({});return document.addEventListener(s0,e),()=>document.removeEventListener(s0,e)}),[]),i.exports.createElement(t0.div,mp({},u,{ref:m,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:GJ(e.onFocusCapture,C.onFocusCapture),onBlurCapture:GJ(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:GJ(e.onPointerDownCapture,k.onPointerDownCapture)}))}));function f0(){const e=new CustomEvent(s0);document.dispatchEvent(e)}function p0(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?n0(o,i):o.dispatchEvent(i)}let g0=0;function m0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const v0="focusScope.autoFocusOnMount",b0="focusScope.autoFocusOnUnmount",y0={bubbles:!1,cancelable:!0},x0=i.exports.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[l,c]=i.exports.useState(null),u=a0(o),d=a0(a),h=i.exports.useRef(null),f=YJ(t,(e=>c(e))),p=i.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.exports.useEffect((()=>{if(r){function e(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:C0(h.current,{select:!0})}function t(e){!p.paused&&l&&(l.contains(e.relatedTarget)||C0(h.current,{select:!0}))}return document.addEventListener("focusin",e),document.addEventListener("focusout",t),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[r,l,p.paused]),i.exports.useEffect((()=>{if(l){_0.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(v0,y0);l.addEventListener(v0,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(C0(r,{select:t}),document.activeElement!==n)return}((e=w0(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&C0(l))}return()=>{l.removeEventListener(v0,u),setTimeout((()=>{const e=new CustomEvent(b0,y0);l.addEventListener(b0,d),l.dispatchEvent(e),e.defaultPrevented||C0(null!=t?t:document.body,{select:!0}),l.removeEventListener(b0,d),_0.remove(p)}),0)}}var e}),[l,u,d,p]);const g=i.exports.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=w0(e),n=S0(t,e),r=S0(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&C0(i,{select:!0})):(e.preventDefault(),n&&C0(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return i.exports.createElement(t0.div,mp({tabIndex:-1},s,{ref:f,onKeyDown:g}))}));function w0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function S0(e,t){for(const n of e)if(!k0(n,{upTo:t}))return n}function k0(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function C0(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const _0=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=E0(e,t),e.unshift(t)},remove(t){var n;e=E0(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function E0(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const L0=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?i.exports.useLayoutEffect:()=>{},P0=H["useId".toString()]||(()=>{});let M0=0;function A0(e){return e.split("-")[0]}function T0(e){return e.split("-")[1]}function O0(e){return["top","bottom"].includes(A0(e))?"x":"y"}function I0(e){return"y"===e?"height":"width"}function R0(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,s=O0(t),l=I0(s),c=r[l]/2-o[l]/2,u="x"===s;let d;switch(A0(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-o.width,y:a};break;default:d={x:r.x,y:r.y}}switch(T0(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}function N0(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function D0(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function z0(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=t,p=N0(f),g=s[h?"floating"===d?"reference":"floating":d],m=D0(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v=D0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===d?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),strategy:l}):a[d]);return{top:m.top-v.top+p.top,bottom:v.bottom-m.bottom+p.bottom,left:m.left-v.left+p.left,right:v.right-m.right+p.right}}const B0=Math.min,F0=Math.max;function j0(e,t,n){return F0(e,B0(t,n))}const H0=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:s,platform:l}=t;if(null==n)return{};const c=N0(r),u={x:o,y:i},d=O0(a),h=T0(a),f=I0(d),p=await l.getDimensions(n),g="y"===d?"top":"left",m="y"===d?"bottom":"right",v=s.reference[f]+s.reference[d]-u[d]-s.floating[f],b=u[d]-s.reference[d],y=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let x=y?"y"===d?y.clientHeight||0:y.clientWidth||0:0;0===x&&(x=s.floating[f]);const w=v/2-b/2,S=c[g],k=x-p[f]-c[m],C=x/2-p[f]/2+w,_=j0(S,C,k),E=("start"===h?c[g]:c[m])>0&&C!==_&&s.reference[f]<=s.floating[f];return{[d]:u[d]-(E?CW0[e]))}const V0={start:"end",end:"start"};function G0(e){return e.replace(/start|end/g,(e=>V0[e]))}const $0=["top","right","bottom","left"];const q0=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",flipAlignment:f=!0,...p}=e,g=A0(r),m=d||(g===a||!f?[U0(a)]:function(e){const t=U0(e);return[G0(e),t,G0(t)]}(a)),v=[a,...m],b=await z0(t,p),y=[];let x=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&y.push(b[g]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=T0(e),o=O0(e),i=I0(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=U0(a)),{main:a,cross:U0(a)}}(r,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));y.push(b[e],b[t])}if(x=[...x,{placement:r,overflows:y}],!y.every((e=>e<=0))){var w,S;const e=(null!=(w=null==(S=o.flip)?void 0:S.index)?w:0)+1,t=v[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var k;const e=null==(k=x.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:k[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};function Z0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Y0(e){return $0.some((t=>e[t]>=0))}const X0=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){const{rects:r}=e;switch(t){case"referenceHidden":{const t=Z0(await z0(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:Y0(t)}}}case"escaped":{const t=Z0(await z0(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:Y0(t)}}}default:return{}}}}};const K0=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=A0(n),s=T0(n),l="x"===O0(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function Q0(e){return"x"===e?"y":"x"}const J0=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await z0(t,l),d=O0(A0(o)),h=Q0(d);let f=c[d],p=c[h];if(i){const e="y"===d?"bottom":"right";f=j0(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===h?"bottom":"right";p=j0(p+u["y"===h?"top":"left"],p,p-u[e])}const g=s.fn({...t,[d]:f,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},e1=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:n,y:r},d=O0(o),h=Q0(d);let f=u[d],p=u[h];const g="function"==typeof s?s({...i,placement:o}):s,m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+m.mainAxis,n=i.reference[d]+i.reference[e]-m.mainAxis;fn&&(f=n)}if(c){var v,b,y,x;const e="y"===d?"width":"height",t=["top","left"].includes(A0(o)),n=i.reference[h]-i.floating[e]+(t&&null!=(v=null==(b=a.offset)?void 0:b[h])?v:0)+(t?0:m.crossAxis),r=i.reference[h]+i.reference[e]+(t?0:null!=(y=null==(x=a.offset)?void 0:x[h])?y:0)-(t?m.crossAxis:0);pr&&(p=r)}return{[d]:f,[h]:p}}}};function t1(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function n1(e){if(null==e)return window;if(!t1(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function r1(e){return n1(e).getComputedStyle(e)}function o1(e){return t1(e)?"":e?(e.nodeName||"").toLowerCase():""}function i1(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function a1(e){return e instanceof n1(e).HTMLElement}function s1(e){return e instanceof n1(e).Element}function l1(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof n1(e).ShadowRoot||e instanceof ShadowRoot}function c1(e){const{overflow:t,overflowX:n,overflowY:r}=r1(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function u1(e){return["table","td","th"].includes(o1(e))}function d1(e){const t=/firefox/i.test(i1()),n=r1(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function h1(){return!/^((?!chrome|android).)*safari/i.test(i1())}const f1=Math.min,p1=Math.max,g1=Math.round;function m1(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&a1(e)&&(l=e.offsetWidth>0&&g1(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&g1(s.height)/e.offsetHeight||1);const u=s1(e)?n1(e):window,d=!h1()&&n,h=(s.left+(d&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/l,f=(s.top+(d&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,p=s.width/l,g=s.height/c;return{width:p,height:g,top:f,right:h+p,bottom:f+g,left:h,x:h,y:f}}function v1(e){return((function(e){return e instanceof n1(e).Node}(e)?e.ownerDocument:e.document)||window.document).documentElement}function b1(e){return s1(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function y1(e){return m1(v1(e)).left+b1(e).scrollLeft}function x1(e,t,n){const r=a1(t),o=v1(t),i=m1(e,r&&function(e){const t=m1(e);return g1(t.width)!==e.offsetWidth||g1(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==o1(t)||c1(o))&&(a=b1(t)),a1(t)){const e=m1(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=y1(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function w1(e){return"html"===o1(e)?e:e.assignedSlot||e.parentNode||(l1(e)?e.host:null)||v1(e)}function S1(e){return a1(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function k1(e){const t=n1(e);let n=S1(e);for(;n&&u1(n)&&"static"===getComputedStyle(n).position;)n=S1(n);return n&&("html"===o1(n)||"body"===o1(n)&&"static"===getComputedStyle(n).position&&!d1(n))?t:n||function(e){let t=w1(e);for(l1(t)&&(t=t.host);a1(t)&&!["html","body"].includes(o1(t));){if(d1(t))return t;t=t.parentNode}return null}(e)||t}function C1(e){if(a1(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=m1(e);return{width:t.width,height:t.height}}function _1(e){const t=w1(e);return["html","body","#document"].includes(o1(t))?e.ownerDocument.body:a1(t)&&c1(t)?t:_1(t)}function E1(e,t){var n;void 0===t&&(t=[]);const r=_1(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=n1(r),a=o?[i].concat(i.visualViewport||[],c1(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(E1(a))}function L1(e,t,n){return"viewport"===t?D0(function(e,t){const n=n1(e),r=v1(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=h1();(e||!e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n)):s1(t)?function(e,t){const n=m1(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):D0(function(e){var t;const n=v1(e),r=b1(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=p1(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=p1(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-r.scrollLeft+y1(e);const l=-r.scrollTop;return"rtl"===r1(o||n).direction&&(s+=p1(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(v1(e)))}function P1(e){const t=E1(e),n=["absolute","fixed"].includes(r1(e).position)&&a1(e)?k1(e):e;return s1(n)?t.filter((e=>s1(e)&&function(e,t){const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&l1(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==o1(e))):[]}const M1={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?P1(t):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=L1(t,n,o);return e.top=p1(r.top,e.top),e.right=f1(r.right,e.right),e.bottom=f1(r.bottom,e.bottom),e.left=p1(r.left,e.left),e}),L1(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=a1(n),i=v1(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==o1(n)||c1(i))&&(a=b1(n)),a1(n))){const e=m1(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:s1,getDimensions:C1,getOffsetParent:k1,getDocumentElement:v1,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:x1(t,k1(n),r),floating:{...C1(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===r1(e).direction};function A1(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=o&&!s,c=i&&!s,u=l||c?[...s1(e)?E1(e):[],...E1(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),c&&e.addEventListener("resize",n)}));let d,h=null;if(a){let r=!0;h=new ResizeObserver((()=>{r||n(),r=!1})),s1(e)&&!s&&h.observe(e),h.observe(t)}let f=s?m1(e):null;return s&&function t(){const r=m1(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n();f=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",n),c&&e.removeEventListener("resize",n)})),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(d)}}const T1=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:u}=R0(l,r,s),d=r,h={},f=0;for(let p=0;p{t.current=e})),t}(o),c=i.exports.useRef(null),[u,d]=i.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,f]=i.exports.useState(t);I1(null==h?void 0:h.map((e=>{let{options:t}=e;return t})),null==t?void 0:t.map((e=>{let{options:t}=e;return t})))||f(t);const p=i.exports.useCallback((()=>{a.current&&s.current&&T1(a.current,s.current,{middleware:h,placement:n,strategy:r}).then((e=>{g.current&&U.exports.flushSync((()=>{d(e)}))}))}),[h,n,r]);O1((()=>{g.current&&p()}),[p]);const g=i.exports.useRef(!1);O1((()=>(g.current=!0,()=>{g.current=!1})),[]);const m=i.exports.useCallback((()=>{if("function"==typeof c.current&&(c.current(),c.current=null),a.current&&s.current)if(l.current){const e=l.current(a.current,s.current,p);c.current=e}else p()}),[p,l]),v=i.exports.useCallback((e=>{a.current=e,m()}),[m]),b=i.exports.useCallback((e=>{s.current=e,m()}),[m]),y=i.exports.useMemo((()=>({reference:a,floating:s})),[]);return i.exports.useMemo((()=>({...u,update:p,refs:y,reference:v,floating:b})),[u,p,y,v,b])}const N1=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn:e=>function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?H0({element:t.current,padding:n}).fn(e):{}:t?H0({element:t,padding:n}).fn(e):{}}};const D1="Popper",[z1,B1]=$J(D1),[F1,j1]=z1(D1),H1=i.exports.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=j1("PopperAnchor",n),s=i.exports.useRef(null),l=YJ(t,s);return i.exports.useEffect((()=>{a.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:i.exports.createElement(t0.div,mp({},o,{ref:l}))})),W1="PopperContent",[U1,V1]=z1(W1),[G1,$1]=z1(W1,{hasParent:!1,positionUpdateFns:new Set}),q1=i.exports.forwardRef(((e,t)=>{var n,r,o,a,s,l,c,u;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:p="center",alignOffset:g=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:b=0,sticky:y="partial",hideWhenDetached:x=!1,avoidCollisions:w=!0,...S}=e,k=j1(W1,d),[C,_]=i.exports.useState(null),E=YJ(t,(e=>_(e))),[L,P]=i.exports.useState(null),M=function(e){const[t,n]=i.exports.useState(void 0);return L0((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(L),A=null!==(n=null==M?void 0:M.width)&&void 0!==n?n:0,T=null!==(r=null==M?void 0:M.height)&&void 0!==r?r:0,O=h+("center"!==p?"-"+p:""),I="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},R=Array.isArray(v)?v:[v],N=R.length>0,D={padding:I,boundary:R.filter(Y1),altBoundary:N},{reference:z,floating:B,strategy:F,x:j,y:H,placement:W,middlewareData:U,update:V}=R1({strategy:"fixed",placement:O,whileElementsMounted:A1,middleware:[K0({mainAxis:f+T,alignmentAxis:g}),w?J0({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?e1():void 0,...D}):void 0,L?N1({element:L,padding:m}):void 0,w?q0({...D}):void 0,X1({arrowWidth:A,arrowHeight:T}),x?X0({strategy:"referenceHidden"}):void 0].filter(Z1)});L0((()=>{z(k.anchor)}),[z,k.anchor]);const G=null!==j&&null!==H,[$,q]=K1(W),Z=null===(o=U.arrow)||void 0===o?void 0:o.x,Y=null===(a=U.arrow)||void 0===a?void 0:a.y,X=0!==(null===(s=U.arrow)||void 0===s?void 0:s.centerOffset),[K,Q]=i.exports.useState();L0((()=>{C&&Q(window.getComputedStyle(C).zIndex)}),[C]);const{hasParent:J,positionUpdateFns:ee}=$1(W1,d),te=!J;i.exports.useLayoutEffect((()=>{if(!te)return ee.add(V),()=>{ee.delete(V)}}),[te,ee,V]),i.exports.useLayoutEffect((()=>{te&&G&&Array.from(ee).reverse().forEach((e=>requestAnimationFrame(e)))}),[te,G,ee]);const ne={"data-side":$,"data-align":q,...S,ref:E,style:{...S.style,animation:G?void 0:"none",opacity:null!==(l=U.hide)&&void 0!==l&&l.referenceHidden?0:void 0}};return i.exports.createElement("div",{ref:B,"data-radix-popper-content-wrapper":"",style:{position:F,left:0,top:0,transform:G?`translate3d(${Math.round(j)}px, ${Math.round(H)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null===(c=U.transformOrigin)||void 0===c?void 0:c.x,null===(u=U.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},i.exports.createElement(U1,{scope:d,placedSide:$,onArrowChange:P,arrowX:Z,arrowY:Y,shouldHideArrow:X},te?i.exports.createElement(G1,{scope:d,hasParent:!0,positionUpdateFns:ee},i.exports.createElement(t0.div,ne)):i.exports.createElement(t0.div,ne)))}));function Z1(e){return void 0!==e}function Y1(e){return null!==e}const X1=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset),d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[f,p]=K1(s),g={start:"0%",center:"50%",end:"100%"}[p],m=(null!==(r=null===(o=c.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+d/2,v=(null!==(i=null===(a=c.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+h/2;let b="",y="";return"bottom"===f?(b=u?g:`${m}px`,y=-h+"px"):"top"===f?(b=u?g:`${m}px`,y=`${l.floating.height+h}px`):"right"===f?(b=-h+"px",y=u?g:`${v}px`):"left"===f&&(b=`${l.floating.width+h}px`,y=u?g:`${v}px`),{data:{x:b,y:y}}}});function K1(e){const[t,n="center"]=e.split("-");return[t,n]}const Q1=e=>{const{__scopePopper:t,children:n}=e,[r,o]=i.exports.useState(null);return i.exports.createElement(F1,{scope:t,anchor:r,onAnchorChange:o},n)},J1=H1,e2=q1;const t2=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=i.exports.useState(),r=i.exports.useRef({}),o=i.exports.useRef(e),a=i.exports.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return i.exports.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.exports.useEffect((()=>{const e=n2(r.current);a.current="mounted"===l?e:"none"}),[l]),L0((()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,i=n2(t);if(e)c("MOUNT");else if("none"===i||"none"===(null==t?void 0:t.display))c("UNMOUNT");else{c(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),L0((()=>{if(t){const e=e=>{const n=n2(r.current).includes(e.animationName);e.target===t&&n&&U.exports.flushSync((()=>c("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=n2(r.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.exports.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):i.exports.Children.only(n),a=YJ(r.ref,o.ref);return"function"==typeof n||r.isPresent?i.exports.cloneElement(o,{ref:a}):null};function n2(e){return(null==e?void 0:e.animationName)||"none"}function r2({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=i.exports.useState(e),[r]=n,o=i.exports.useRef(r),a=a0(t);return i.exports.useEffect((()=>{o.current!==r&&(a(r),o.current=r)}),[r,o,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,s=a?e:r,l=a0(n),c=i.exports.useCallback((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[a,e,o,l]);return[s,c]}t2.displayName="Presence";const o2="rovingFocusGroup.onEntryFocus",i2={bubbles:!1,cancelable:!0},a2="RovingFocusGroup",[s2,l2,c2]=r0(a2),[u2,d2]=$J(a2,[c2]),[h2,f2]=u2(a2),p2=i.exports.forwardRef(((e,t)=>i.exports.createElement(s2.Provider,{scope:e.__scopeRovingFocusGroup},i.exports.createElement(s2.Slot,{scope:e.__scopeRovingFocusGroup},i.exports.createElement(g2,mp({},e,{ref:t})))))),g2=i.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,...d}=e,h=i.exports.useRef(null),f=YJ(t,h),p=i0(a),[g=null,m]=r2({prop:s,defaultProp:l,onChange:c}),[v,b]=i.exports.useState(!1),y=a0(u),x=l2(n),w=i.exports.useRef(!1),[S,k]=i.exports.useState(0);return i.exports.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(o2,y),()=>e.removeEventListener(o2,y)}),[y]),i.exports.createElement(h2,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:g,onItemFocus:i.exports.useCallback((e=>m(e)),[m]),onItemShiftTab:i.exports.useCallback((()=>b(!0)),[]),onFocusableItemAdd:i.exports.useCallback((()=>k((e=>e+1))),[]),onFocusableItemRemove:i.exports.useCallback((()=>k((e=>e-1))),[])},i.exports.createElement(t0.div,mp({tabIndex:v||0===S?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...e.style},onMouseDown:GJ(e.onMouseDown,(()=>{w.current=!0})),onFocus:GJ(e.onFocus,(e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!v){const t=new CustomEvent(o2,i2);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));b2([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)))}}w.current=!1})),onBlur:GJ(e.onBlur,(()=>b(!1)))})))})),m2=i.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,...a}=e,s=function(e){const[t,n]=i.exports.useState(P0());return L0((()=>{e||n((e=>null!=e?e:String(M0++)))}),[e]),e||(t?`radix-${t}`:"")}(),l=f2("RovingFocusGroupItem",n),c=l.currentTabStopId===s,u=l2(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return i.exports.useEffect((()=>{if(r)return d(),()=>h()}),[r,d,h]),i.exports.createElement(s2.ItemSlot,{scope:n,id:s,focusable:r,active:o},i.exports.createElement(t0.span,mp({tabIndex:c?0:-1,"data-orientation":l.orientation},a,{ref:t,onMouseDown:GJ(e.onMouseDown,(e=>{r?l.onItemFocus(s):e.preventDefault()})),onFocus:GJ(e.onFocus,(()=>l.onItemFocus(s))),onKeyDown:GJ(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void l.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:v2[r]}(e,l.orientation,l.dir);if(void 0!==t){e.preventDefault();let o=u().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=l.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>b2(o)))}var n,r}))})))})),v2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function b2(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const y2=p2,x2=m2,w2=["Enter"," "],S2=["ArrowUp","PageDown","End"],k2=["ArrowDown","PageUp","Home",...S2],C2="Menu",[_2,E2,L2]=r0(C2),[P2,M2]=$J(C2,[L2,B1,d2]),A2=B1(),T2=d2(),[O2,I2]=P2(C2),[R2,N2]=P2(C2),D2=i.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=A2(n);return i.exports.createElement(J1,mp({},o,r,{ref:t}))})),[z2,B2]=P2("MenuPortal",{forceMount:void 0}),F2="MenuContent",[j2,H2]=P2(F2),W2=i.exports.forwardRef(((e,t)=>{const n=B2(F2,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=I2(F2,e.__scopeMenu),s=N2(F2,e.__scopeMenu);return i.exports.createElement(_2.Provider,{scope:e.__scopeMenu},i.exports.createElement(t2,{present:r||a.open},i.exports.createElement(_2.Slot,{scope:e.__scopeMenu},s.modal?i.exports.createElement(U2,mp({},o,{ref:t})):i.exports.createElement(V2,mp({},o,{ref:t})))))})),U2=i.exports.forwardRef(((e,t)=>{const n=I2(F2,e.__scopeMenu),r=i.exports.useRef(null),o=YJ(t,r);return i.exports.useEffect((()=>{const e=r.current;if(e)return fD(e)}),[]),i.exports.createElement(G2,mp({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:GJ(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))})),V2=i.exports.forwardRef(((e,t)=>{const n=I2(F2,e.__scopeMenu);return i.exports.createElement(G2,mp({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))})),G2=i.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:p,...g}=e,m=I2(F2,n),v=N2(F2,n),b=A2(n),y=T2(n),x=E2(n),[w,S]=i.exports.useState(null),k=i.exports.useRef(null),C=YJ(t,k,m.onContentChange),_=i.exports.useRef(0),E=i.exports.useRef(""),L=i.exports.useRef(0),P=i.exports.useRef(null),M=i.exports.useRef("right"),A=i.exports.useRef(0),T=p?CB:i.exports.Fragment,O=p?{as:XJ,allowPinchZoom:!0}:void 0,I=e=>{var t,n;const r=E.current+e,o=x().filter((e=>!e.disabled)),i=document.activeElement,a=null===(t=o.find((e=>e.ref.current===i)))||void 0===t?void 0:t.textValue,s=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map(((e,t)=>s[(l+t)%s.length])));var s,l;1===o.length&&(a=a.filter((e=>e!==n)));const c=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,a),l=null===(n=o.find((e=>e.textValue===s)))||void 0===n?void 0:n.ref.current;!function e(t){E.current=t,window.clearTimeout(_.current),""!==t&&(_.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};i.exports.useEffect((()=>()=>window.clearTimeout(_.current)),[]),i.exports.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:m0()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:m0()),g0++,()=>{1===g0&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),g0--}}),[]);const R=i.exports.useCallback((e=>{var t,n;return M.current===(null===(t=P.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;ir!=c>r&&n<(l-e)*(r-s)/(c-s)+e&&(o=!o)}return o}(n,t)}(e,null===(n=P.current)||void 0===n?void 0:n.area)}),[]);return i.exports.createElement(j2,{scope:n,searchRef:E,onItemEnter:i.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),onItemLeave:i.exports.useCallback((e=>{var t;R(e)||(null===(t=k.current)||void 0===t||t.focus(),S(null))}),[R]),onTriggerLeave:i.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),pointerGraceTimerRef:L,onPointerGraceIntentChange:i.exports.useCallback((e=>{P.current=e}),[])},i.exports.createElement(T,O,i.exports.createElement(x0,{asChild:!0,trapped:o,onMountAutoFocus:GJ(a,(e=>{var t;e.preventDefault(),null===(t=k.current)||void 0===t||t.focus()})),onUnmountAutoFocus:s},i.exports.createElement(h0,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f},i.exports.createElement(y2,mp({asChild:!0},y,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:S,onEntryFocus:e=>{v.isUsingKeyboardRef.current||e.preventDefault()}}),i.exports.createElement(e2,mp({role:"menu","aria-orientation":"vertical","data-state":(N=m.open,N?"open":"closed"),"data-radix-menu-content":"",dir:v.dir},b,g,{ref:C,style:{outline:"none",...g.style},onKeyDown:GJ(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&I(e.key));const o=k.current;if(e.target!==o)return;if(!k2.includes(e.key))return;e.preventDefault();const i=x().filter((e=>!e.disabled)).map((e=>e.ref.current));S2.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:GJ(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(_.current),E.current="")})),onPointerMove:GJ(e.onPointerMove,X2((e=>{const t=e.target,n=A.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>A.current?"right":"left";M.current=t,A.current=e.clientX}})))})))))));var N})),$2="MenuItem",q2="menu.itemSelect",Z2=i.exports.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=i.exports.useRef(null),s=N2($2,e.__scopeMenu),l=H2($2,e.__scopeMenu),c=YJ(t,a),u=i.exports.useRef(!1);return i.exports.createElement(Y2,mp({},o,{ref:c,disabled:n,onClick:GJ(e.onClick,(()=>{const e=a.current;if(!n&&e){const t=new CustomEvent(q2,{bubbles:!0,cancelable:!0});e.addEventListener(q2,(e=>null==r?void 0:r(e)),{once:!0}),n0(e,t),t.defaultPrevented?u.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),u.current=!0},onPointerUp:GJ(e.onPointerUp,(e=>{var t;u.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:GJ(e.onKeyDown,(e=>{const t=""!==l.searchRef.current;n||t&&" "===e.key||w2.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),Y2=i.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,s=H2($2,n),l=T2(n),c=i.exports.useRef(null),u=YJ(t,c),[d,h]=i.exports.useState(!1),[f,p]=i.exports.useState("");return i.exports.useEffect((()=>{const e=c.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[a.children]),i.exports.createElement(_2.ItemSlot,{scope:n,disabled:r,textValue:null!=o?o:f},i.exports.createElement(x2,mp({asChild:!0},l,{focusable:!r}),i.exports.createElement(t0.div,mp({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},a,{ref:u,onPointerMove:GJ(e.onPointerMove,X2((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus()}}))),onPointerLeave:GJ(e.onPointerLeave,X2((e=>s.onItemLeave(e)))),onFocus:GJ(e.onFocus,(()=>h(!0))),onBlur:GJ(e.onBlur,(()=>h(!1)))}))))}));P2("MenuRadioGroup",{value:void 0,onValueChange:()=>{}});P2("MenuItemIndicator",{checked:!1});function X2(e){return t=>"mouse"===t.pointerType?e(t):void 0}P2("MenuSub");const K2=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:s=!0}=e,l=A2(t),[c,u]=i.exports.useState(null),d=i.exports.useRef(!1),h=a0(a),f=i0(o);return i.exports.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),i.exports.createElement(Q1,l,i.exports.createElement(O2,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:u},i.exports.createElement(R2,{scope:t,onClose:i.exports.useCallback((()=>h(!1)),[h]),isUsingKeyboardRef:d,dir:f,modal:s},r)))},Q2=D2,J2=W2,e5=Z2,t5="ContextMenu",[n5,r5]=$J(t5,[M2]),o5=M2(),[i5,a5]=n5(t5);function s5(e){return t=>"mouse"!==t.pointerType?e(t):void 0}const l5=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:a=!0}=e,[s,l]=i.exports.useState(!1),c=o5(t),u=a0(r),d=i.exports.useCallback((e=>{l(e),u(e)}),[u]);return i.exports.createElement(i5,{scope:t,open:s,onOpenChange:d,modal:a},i.exports.createElement(K2,mp({},c,{dir:o,open:s,onOpenChange:d,modal:a}),n))},c5=i.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=a5("ContextMenuTrigger",n),a=o5(n),s=i.exports.useRef({x:0,y:0}),l=i.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),c=i.exports.useRef(0),u=i.exports.useCallback((()=>window.clearTimeout(c.current)),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},o.onOpenChange(!0)};return i.exports.useEffect((()=>u),[u]),i.exports.createElement(i.exports.Fragment,null,i.exports.createElement(Q2,mp({},a,{virtualRef:l})),i.exports.createElement(t0.span,mp({"data-state":o.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:GJ(e.onContextMenu,(e=>{u(),d(e),e.preventDefault()})),onPointerDown:GJ(e.onPointerDown,s5((e=>{u(),c.current=window.setTimeout((()=>d(e)),700)}))),onPointerMove:GJ(e.onPointerMove,s5(u)),onPointerCancel:GJ(e.onPointerCancel,s5(u)),onPointerUp:GJ(e.onPointerUp,s5(u))})))})),u5=i.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=a5("ContextMenuContent",n),a=o5(n),s=i.exports.useRef(!1);return i.exports.createElement(J2,mp({},a,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&s.current&&t.preventDefault(),s.current=!1},onInteractOutside:t=>{var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||o.modal||(s.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)"}}))})),d5=i.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=o5(n);return i.exports.createElement(e5,mp({},o,r,{ref:t}))})),h5=cU([e=>e.gallery,e=>e.options,EX,RZ],((e,t,n,r)=>{const{categories:o,currentCategory:i,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,galleryWidth:p,shouldUseSingleGalleryColumn:g}=e,{isLightBoxOpen:m}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,galleryGridTemplateColumns:g?"auto":`repeat(auto-fill, minmax(${u}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,images:o[i].images,areMoreImagesAvailable:o[i].areMoreImagesAvailable,currentCategory:i,galleryWidth:p,isLightBoxOpen:m,isStaging:n,shouldEnableResize:!(m||"unifiedCanvas"===r&&s),shouldUseSingleGalleryColumn:g}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),f5=cU([e=>e.options,e=>e.gallery,e=>e.system,RZ],((e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen})),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),p5=i.exports.memo((e=>{const t=noe(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,mayDeleteImage:a,isLightBoxOpen:s,shouldUseSingleGalleryColumn:l}=roe(f5),{image:c,isSelected:u}=e,{url:d,thumbnail:h,uuid:f,metadata:p}=c,[g,m]=i.exports.useState(!1),v=DH();return ld(l5,{onOpenChange:e=>{t(sJ(e))},children:[sd(c5,{children:ld(gI,{position:"relative",className:"hoverable-image",onMouseOver:()=>m(!0),onMouseOut:()=>m(!1),userSelect:"none",draggable:!0,onDragStart:e=>{e.dataTransfer.setData("invokeai/imageUuid",f),e.dataTransfer.effectAllowed="move"},children:[sd(_T,{className:"hoverable-image-image",objectFit:l?"contain":r,rounded:"md",src:h||d,loading:"lazy"}),sd("div",{className:"hoverable-image-content",onClick:()=>t(KQ(c)),children:u&&sd(wS,{width:"50%",height:"50%",as:DY,className:"hoverable-image-check"})}),g&&o>=64&&sd("div",{className:"hoverable-image-delete-button",children:sd(qH,{label:"Delete image",hasArrow:!0,children:sd(UQ,{image:c,children:sd(DT,{"aria-label":"Delete image",icon:sd(hX,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!a})})})})]},f)}),ld(u5,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:e=>{e.detail.originalEvent.preventDefault()},children:[sd(d5,{onClickCapture:()=>{t(Wte(!0)),t(KQ(c))},children:"Open In Viewer"}),sd(d5,{onClickCapture:()=>{c.metadata&&t(Zte(c.metadata.image.prompt)),v({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.prompt,children:"Use Prompt"}),sd(d5,{onClickCapture:()=>{c.metadata&&t(tne(c.metadata.image.seed)),v({title:"Seed Set",status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.seed,children:"Use Seed"}),sd(d5,{onClickCapture:()=>{p&&t(Tte(p)),v({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})},disabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),children:"Use All Parameters"}),sd(qH,{label:"Load initial image used for this generation",children:sd(d5,{onClickCapture:async()=>{if(p?.image?.init_image_path){if((await fetch(p.image.init_image_path)).ok)return t(Pte("img2img")),t(Mte(p)),void v({title:"Initial Image Set",status:"success",duration:2500,isClosable:!0})}v({title:"Initial Image Not Set",description:"Could not load initial image.",status:"error",duration:2500,isClosable:!0})},disabled:"img2img"!==c?.metadata?.image?.type,children:"Use Initial Image"})}),sd(d5,{onClickCapture:()=>{s&&t(Wte(!1)),t(Hte(c)),"img2img"!==n&&t(Pte("img2img")),v({title:"Sent to Image To Image",status:"success",duration:2500,isClosable:!0})},children:"Send to Image To Image"}),sd(d5,{onClickCapture:()=>{s&&t(Wte(!1)),t(QK(c)),t(jK()),"unifiedCanvas"!==n&&t(Pte("unifiedCanvas")),v({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0})},children:"Send to Unified Canvas"}),sd(UQ,{image:c,children:sd(d5,{"data-warning":!0,children:"Delete Image"})})]})]})}),((e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected)),g5=e=>{const{label:t,styleClass:n,...r}=e;return sd(AO,{className:`invokeai__checkbox ${n}`,...r,children:t})},m5=320,v5={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500}};function b5(){const e=noe(),{images:t,currentCategory:n,currentImageUuid:r,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:c,activeTabName:u,galleryImageObjectFit:d,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,areMoreImagesAvailable:p,galleryWidth:g,isLightBoxOpen:m,isStaging:v,shouldEnableResize:b,shouldUseSingleGalleryColumn:y}=roe(h5),{galleryMinWidth:x,galleryMaxWidth:w}=m?{galleryMinWidth:400,galleryMaxWidth:400}:v5[u],[S,k]=i.exports.useState(g>=m5),[C,_]=i.exports.useState(!1),[E,L]=i.exports.useState(0),P=i.exports.useRef(null),M=i.exports.useRef(null),A=i.exports.useRef(null);i.exports.useEffect((()=>{g>=m5&&k(!1)}),[g]);const T=()=>{e(nJ(!o)),e(KK(!0))},O=()=>{e(rJ(!0)),o&&e(KK(!0))},I=i.exports.useCallback((()=>{e(rJ(!1)),e(sJ(!1)),e(oJ(M.current?M.current.scrollTop:0)),setTimeout((()=>o&&e(KK(!0))),400)}),[e,o]),R=()=>{A.current&&window.clearTimeout(A.current)};Eq("g",(()=>{a?I():O()}),[a,o]),Eq("left",(()=>{e(tJ())}),{enabled:!v||"unifiedCanvas"!==u},[v]),Eq("right",(()=>{e(eJ())}),{enabled:!v||"unifiedCanvas"!==u},[v]),Eq("shift+g",(()=>{T()}),[o]),Eq("esc",(()=>{e(rJ(!1))}),{enabled:()=>!o,preventDefault:!0},[o]);return Eq("shift+up",(()=>{if(l<256){const t=LG.clamp(l+32,32,256);e(iJ(t))}}),[l]),Eq("shift+down",(()=>{if(l>32){const t=LG.clamp(l-32,32,256);e(iJ(t))}}),[l]),i.exports.useEffect((()=>{M.current&&(M.current.scrollTop=s)}),[s,a]),i.exports.useEffect((()=>{function e(e){o||!P.current||P.current.contains(e.target)||I()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[I,o]),sd(hK,{nodeRef:P,in:a||h,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:ld("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:P,onMouseLeave:o?void 0:()=>{h||(A.current=window.setTimeout((()=>I()),500))},onMouseEnter:o?void 0:R,onMouseOver:o?void 0:R,children:[ld(VJ,{minWidth:x,maxWidth:o?w:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:b},size:{width:g,height:o?"100%":"100vh"},onResizeStart:(e,t,n)=>{L(n.clientHeight),n.style.height=`${n.clientHeight}px`,o&&(n.style.position="fixed",n.style.right="1rem",_(!0))},onResizeStop:(t,n,r,i)=>{const a=o?LG.clamp(Number(g)+i.width,x,Number(w)):Number(g)+i.width;e(uJ(a)),r.removeAttribute("data-resize-alert"),o&&(r.style.position="relative",r.style.removeProperty("right"),r.style.setProperty("height",o?"100%":"100vh"),_(!1),e(KK(!0)))},onResize:(t,n,r,i)=>{const a=LG.clamp(Number(g)+i.width,x,Number(o?w:.95*window.innerWidth));a>=m5&&!S?k(!0):aa-40&&e(iJ(a-40)),o&&(a>=w?r.setAttribute("data-resize-alert","true"):r.removeAttribute("data-resize-alert")),r.style.height=`${E}px`},children:[ld("div",{className:"image-gallery-header",children:[sd(NT,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:ld(ad,S?{children:[sd(jX,{size:"sm","data-selected":"result"===n,onClick:()=>e(cJ("result")),children:"Generations"}),sd(jX,{size:"sm","data-selected":"user"===n,onClick:()=>e(cJ("user")),children:"Uploads"})]}:{children:[sd(dZ,{"aria-label":"Show Generations",tooltip:"Show Generations","data-selected":"result"===n,icon:sd(YY,{}),onClick:()=>e(cJ("result"))}),sd(dZ,{"aria-label":"Show Uploads",tooltip:"Show Uploads","data-selected":"user"===n,icon:sd(mX,{}),onClick:()=>e(cJ("user"))})]})}),ld("div",{className:"image-gallery-header-right-icons",children:[sd(VQ,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:sd(dZ,{size:"sm","aria-label":"Gallery Settings",icon:sd(vX,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:ld("div",{className:"image-gallery-settings-popover",children:[ld("div",{children:[sd(hZ,{value:l,onChange:t=>{e(iJ(t))},min:32,max:256,hideTooltip:!0,label:"Image Size"}),sd(dZ,{size:"sm","aria-label":"Reset",tooltip:"Reset Size",onClick:()=>e(iJ(64)),icon:sd(aZ,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),sd("div",{children:sd(g5,{label:"Maintain Aspect Ratio",isChecked:"contain"===d,onChange:()=>e(aJ("contain"===d?"cover":"contain"))})}),sd("div",{children:sd(g5,{label:"Auto-Switch to New Images",isChecked:f,onChange:t=>e(lJ(t.target.checked))})}),sd("div",{children:sd(g5,{label:"Single Column Layout",isChecked:y,onChange:t=>e(dJ(t.target.checked))})})]})}),sd(dZ,{size:"sm",className:"image-gallery-icon-btn","aria-label":"Pin Gallery",tooltip:"Pin Gallery (Shift+G)",onClick:T,icon:sd(o?YX:XX,{})})]})]}),sd("div",{className:"image-gallery-container",ref:M,children:t.length||p?ld(ad,{children:[sd("div",{className:"image-gallery",style:{gridTemplateColumns:c},children:t.map((e=>{const{uuid:t}=e;return sd(p5,{image:e,isSelected:r===t},t)}))}),sd(IT,{onClick:()=>{e(IX(n))},isDisabled:!p,className:"image-gallery-load-more-btn",children:p?"Load More":"All Images Loaded"})]}):ld("div",{className:"image-gallery-container-placeholder",children:[sd(bY,{}),sd("p",{children:"No Images In Gallery"})]})})]}),C&&sd("div",{style:{width:g+"px",height:"100%"}})]})})}const y5=cU((e=>e.gallery),(e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images}))),x5=cU([e=>e.options,RZ],((e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),w5=e=>{const t=noe(),{optionsPanel:n,children:r,styleClass:o}=e,{activeTabName:i,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=roe(x5),c=(()=>{const{resultImages:e,userImages:t}=roe(y5);return n=>{const r=e.find((e=>e.uuid===n));if(r)return r;return t.find((e=>e.uuid===n))||void 0}})();return sd("div",{className:o?`workarea-wrapper ${o}`:"workarea-wrapper",children:ld("div",{className:"workarea-main",children:[n,ld("div",{className:"workarea-children-wrapper",onDrop:e=>{const n=e.dataTransfer.getData("invokeai/imageUuid"),r=c(n);r&&("img2img"===i?t(Hte(r)):"unifiedCanvas"===i&&t(QK(r)))},children:[r,l&&sd(qH,{label:"Toggle Split View",children:sd("div",{className:"workarea-split-button","data-selected":a,onClick:()=>{t(pne(!a)),t(KK(!0))},children:sd(CJ,{})})})]}),!s&&sd(b5,{})]})})};function S5(){return sd(w5,{optionsPanel:sd(FQ,{}),children:sd(kJ,{})})}function k5(){const e={seed:{header:"Seed",feature:Rq.SEED,content:sd(kZ,{})},variations:{header:"Variations",feature:Rq.VARIATIONS,content:sd(OZ,{}),additionalHeaderComponents:sd(PZ,{})},face_restore:{header:"Face Restoration",feature:Rq.FACE_CORRECTION,content:sd(Zq,{}),additionalHeaderComponents:sd(Xq,{})},upscale:{header:"Upscaling",feature:Rq.UPSCALE,content:sd(EZ,{}),additionalHeaderComponents:sd(LZ,{})},other:{header:"Other Options",feature:Rq.OTHER,content:sd(mZ,{})}};return ld(BQ,{children:[sd(ZX,{}),sd($X,{}),sd(UZ,{}),sd(_Y,{accordionInfo:e})]})}const C5=()=>sd("div",{className:"workarea-single-view",children:sd("div",{className:"text-to-image-area",children:sd(xJ,{})})});function _5(){return sd(w5,{optionsPanel:sd(k5,{}),children:sd(C5,{})})}var E5=function(e,t){return E5=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},E5(e,t)};var L5=function(){return L5=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n?(r(1),e.animation=null):e.animation&&(r(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function N5(e,t,n,r){var o=function(e){var t=e.scale,n=e.positionX,r=e.positionY;if(isNaN(t)||isNaN(n)||isNaN(r))return!1;return!0}(t);if(e.mounted&&o){var i=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=t.scale-s,d=t.positionX-l,h=t.positionY-c;0===n?i(t.scale,t.positionX,t.positionY):R5(e,r,n,(function(e){i(s+u*e,l+d*e,c+h*e)}))}}var D5=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var i=function(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:i,newDiffWidth:r-i,newContentHeight:a,newDiffHeight:o-a}}(n,r,t),a=i.wrapperWidth,s=i.wrapperHeight,l=function(e,t,n,r,o,i,a){var s=e>t?n*(a?1:.5):0,l=r>o?i*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-o-l,maxPositionY:l}}(a,i.newContentWidth,i.newDiffWidth,s,i.newContentHeight,i.newDiffHeight,Boolean(o));return l},z5=function(e,t){var n=D5(e,t);return e.bounds=n,n};function B5(e,t,n,r,o,i,a){var s=n.minPositionX,l=n.minPositionY,c=n.maxPositionX,u=n.maxPositionY,d=0,h=0;return a&&(d=o,h=i),{x:F5(e,s-d,c+d,r),y:F5(t,l-h,u+h,r)}}var F5=function(e,t,n,r){return M5(r?en?n:e:e,2)};function j5(e,t,n,r,o,i){var a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=r-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:c}):B5(l-t*u,c-n*u,o,i,0,0,null)}function H5(e,t,n,r,o){var i=t-(o?r:0);return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=i?i:e}var W5=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,a=null==o?void 0:o.contains(i);return!!(r&&i&&a)&&!g3(i,n)},U5=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!(!t||!n||r)};var V5=function(e,t){var n=e.setup,r=e.transformState.scale,o=n.minScale;return t>0&&r>=o?t:0};function G5(e,t,n,r,o,i,a,s,l,c){if(o){var u;if(t>a&&n>a)return(u=a+(e-a)*c)>l?l:ui?i:u}return r?t:F5(e,i,a,o)}function $5(e,t){var n=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale;return!(o.disabled&&!(i>1)&&r&&!t)}(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,a=e.wrapperComponent,s=i.velocityAnimation.equalToMove,l=Date.now();if(r&&o&&a){var c=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-r.x,d=t.y-r.y,h=u/c,f=d/c,p=l-o,g=u*u+d*d,m=Math.sqrt(g)/p;e.velocity={velocityX:h,velocityY:f,total:m}}e.lastMousePosition=t,e.velocityTime=l}}function q5(e,t){var n=e.transformState.scale;I5(e),z5(e,n),t.touches?function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-i}}}(e,t):function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,a=t.clientY;e.startCoords={x:i-r,y:a-o}}(e,t)}function Z5(e,t,n){var r=e.startCoords,o=e.setup.alignmentAnimation,i=o.sizeX,a=o.sizeY;if(r){var s=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,a=i.lockAxisX,s=i.lockAxisY,l=o.positionX,c=o.positionY;if(!r)return{x:l,y:c};var u=t-r.x,d=n-r.y;return{x:a?l:u,y:s?c:d}}(e,t,n),l=s.x,c=s.y,u=V5(e,i),d=V5(e,a);$5(e,{x:l,y:c}),function(e,t,n,r,o){var i=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(a&&t!==u&&n!==d&&s){var h=B5(t,n,s,i,r,o,a),f=h.x,p=h.y;e.setTransformState(c,f,p)}}(e,l,c,u,d)}}function Y5(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var i=null==r?void 0:r.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==i?void 0:i.width)||0,l=(null==i?void 0:i.height)||0,c=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s.1&&d?function(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&i&&!t||!n||!r)}(e);if(i&&t&&n&&o){var a=t.velocityX,s=t.velocityY,l=t.total,c=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,h=n.minPositionY,f=r.limitToBounds,p=r.alignmentAnimation,g=r.zoomAnimation,m=r.panning,v=m.lockAxisY,b=m.lockAxisX,y=g.animationType,x=p.sizeX,w=p.sizeY,S=p.velocityAlignmentTime,k=function(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}(e,l),C=Math.max(k,S),_=V5(e,x),E=V5(e,w),L=_*o.offsetWidth/100,P=E*o.offsetHeight/100,M=c+L,A=u-L,T=d+P,O=h-P,I=e.transformState,R=(new Date).getTime();R5(e,y,C,(function(t){var n=e.transformState,r=n.scale,o=n.positionX,i=n.positionY,l=((new Date).getTime()-R)/S,g=1-(0,T5[p.animationType])(Math.min(1,l)),m=1-t,y=o+a*m,x=i+s*m,w=G5(y,I.positionX,o,b,f,u,c,A,M,g),k=G5(x,I.positionY,i,v,f,h,d,O,T,g);o===y&&i===x||e.setTransformState(r,w,k)}))}}(e):X5(e)}}function X5(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,a=o.sizeX,s=o.sizeY,l=o.animationTime,c=o.animationType;if(!(i||td||nf||rd?c.offsetWidth:e.setup.minPositionX||0,r>f?c.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||l),b=v.x,y=v.y;return{scale:o,positionX:g?b:n,positionY:m?y:r}}}(e);u&&N5(e,u,l,c)}}function K5(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.minScale,s=i.limitToBounds,l=i.zoomAnimation,c=l.disabled,u=l.animationTime,d=l.animationType,h=c||r>=a;if((r>=1||s)&&X5(e),!h&&o&&e.mounted){var f=Q5(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);f&&N5(e,f,u,d)}}function Q5(e,t,n,r){var o=e.setup,i=o.minScale,a=o.maxScale,s=o.limitToBounds,l=H5(M5(t,2),i,a,0,!1),c=j5(e,n,r,l,z5(e,l),s);return{scale:l,positionX:c.x,positionY:c.y}}var J5={previousScale:1,scale:1,positionX:0,positionY:0},e3=L5(L5({},J5),{setComponents:function(){},contextInstance:null}),t3={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},n3=function(e){var t,n,r,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:J5.scale,scale:null!==(n=e.initialScale)&&void 0!==n?n:J5.scale,positionX:null!==(r=e.initialPositionX)&&void 0!==r?r:J5.positionX,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:J5.positionY}},r3=function(e){var t=L5({},t3);return Object.keys(e).forEach((function(n){var r=void 0!==e[n];if(void 0!==t3[n]&&r){var o=Object.prototype.toString.call(t3[n]),i="[object Object]"===o,a="[object Array]"===o;t[n]=i?L5(L5({},t3[n]),e[n]):a?P5(P5([],t3[n]),e[n]):e[n]}})),t},o3=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.maxScale,s=i.minScale,l=i.zoomAnimation.size;if(!o)throw new Error("Wrapper is not mounted");var c=r*Math.exp(t*n);return H5(M5(c,3),s,a,l,!1)};function i3(e,t,n,r,o){var i=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY;if(!i)return console.error("No WrapperComponent found");var u=(i.offsetWidth/2-l)/s,d=(i.offsetHeight/2-c)/s,h=Q5(e,o3(e,t,n),u,d);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");N5(e,h,r,o)}function a3(e,t,n){var r=e.setup,o=e.wrapperComponent,i=r.limitToBounds,a=n3(e.props),s=e.transformState,l=s.scale,c=s.positionX,u=s.positionY;if(o){var d=D5(e,a.scale),h=B5(a.positionX,a.positionY,d,i,0,0,o),f={scale:a.scale,positionX:h.x,positionY:h.y};l===a.scale&&c===a.positionX&&u===a.positionY||N5(e,f,t,n)}}var s3=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),i3(e,1,t,n,r)}},l3=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),i3(e,-1,t,n,r)}},c3=function(e){return function(t,n,r,o,i){void 0===o&&(o=300),void 0===i&&(i="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,c=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var h={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?c:r};N5(e,h,o,i)}}},u3=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),a3(e,t,n)}},d3=function(e){return function(t,n,r){void 0===n&&(n=200),void 0===r&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,a=e.contentComponent;if(i&&a){var s=b3(t||o.scale,i,a);N5(e,s,n,r)}}},h3=function(e){return function(t,n,r,o){void 0===r&&(r=600),void 0===o&&(o="easeOut"),I5(e);var i=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(i&&function(e){return e?void 0!==(null==e?void 0:e.offsetWidth)&&void 0!==(null==e?void 0:e.offsetHeight)||(console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1):(console.error("Zoom node not found"),!1)}(a)&&a&&i.contains(a)){var s=function(e,t,n){var r=e.wrapperComponent,o=e.setup,i=o.limitToBounds,a=o.minScale,s=o.maxScale;if(!r)return J5;var l=r.getBoundingClientRect(),c=function(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}(t),u=c.x,d=c.y,h=t.offsetWidth,f=t.offsetHeight,p=r.offsetWidth/h,g=r.offsetHeight/f,m=H5(n||Math.min(p,g),a,s,0,!1),v=(l.width-h*m)/2,b=(l.height-f*m)/2,y=B5((l.left-u)*m+v,(l.top-d)*m+b,D5(e,m),i,0,0,r);return{positionX:y.x,positionY:y.y,scale:m}}(e,a,n);N5(e,s,r,o)}}},f3=function(e){return{instance:e,state:e.transformState,zoomIn:s3(e),zoomOut:l3(e),setTransform:c3(e),resetTransform:u3(e),centerView:d3(e),zoomToElement:h3(e)}};function p3(){try{return{get passive(){return!0,!1}}}catch(Kie){return!1}}var g3=function(e,t){var n=e.tagName.toUpperCase();return!!t.find((function(e){return e.toUpperCase()===n}))||!!t.find((function(t){return e.classList.contains(t)}))},m3=function(e){e&&clearTimeout(e)},v3=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},b3=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-r)/2,positionY:(t.offsetHeight-o)/2}},y3=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,c=t.target;return!(!s||l||r||!c)&&(!(o&&!t.ctrlKey)&&((!i||!t.ctrlKey)&&!g3(c,a)))};function x3(e,t,n){var r=t.getBoundingClientRect(),o=0,i=0;if("clientX"in e)o=(e.clientX-r.left)/n,i=(e.clientY-r.top)/n;else{var a=e.touches[0];o=(a.clientX-r.left)/n,i=(a.clientY-r.top)/n}return(isNaN(o)||isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var w3=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,a=t.target;return!(!i||r||!a)&&!g3(a,o)},S3=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||!r)},k3=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},C3=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(I5(e),A5(f3(e),t,r),A5(f3(e),t,o))},_3=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,h=u.size,f=u.disabled,p=d.step;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var g=function(e,t){var n,r,o=e?e.deltaY<0?1:-1:0;return r=o,"number"==typeof(n=t)?n:r}(t,null),m=function(e,t,n,r,o){var i=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,c=s.minScale,u=s.zoomAnimation,d=u.size,h=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=i+t*(i-i*n)*n;if(o)return f;var p=!r&&!h;return H5(M5(f,3),c,l,d,p)}(e,g,p,!t.ctrlKey);if(s!==m){var v=z5(e,m),b=x3(t,i,s),y=l&&(f||0===h||c),x=j5(e,b.x,b.y,m,v,y),w=x.x,S=x.y;e.previousWheelEvent=t,e.setTransformState(m,w,S),A5(f3(e),t,r),A5(f3(e),t,o)}},E3=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;m3(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(K5(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var i=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,a=o.minScale;return!!n&&(ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);i&&(m3(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,A5(f3(e),t,r),A5(f3(e),t,o))}),160))},L3=function(e,t){var n=k3(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,I5(e)},P3=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,a=i.limitToBounds,s=i.centerZoomedOut,l=i.zoomAnimation,c=l.disabled,u=l.size;if(null!==r&&n){var d=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=M5(o[0].clientX-r.left,5),a=M5(o[0].clientY-r.top,5);return{x:(i+M5(o[1].clientX-r.left,5))/2/t,y:(a+M5(o[1].clientY-r.top,5))/2/t}}(t,o,n);if(isFinite(d.x)&&isFinite(d.y)){var h=k3(t),f=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,a=o.minScale,s=o.zoomAnimation,l=s.size,c=s.disabled;if(!n||null===r||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:H5(M5(t/r*n,2),a,i,l,!c)}(e,h);if(f!==o){var p=z5(e,f),g=a&&(c||0===u||s),m=j5(e,d.x,d.y,f,p,g),v=m.x,b=m.y;e.pinchMidpoint=d,e.lastDistance=h,e.setTransformState(f,v,b)}}}},M3=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,K5(e,null==t?void 0:t.x,null==t?void 0:t.y)};function A3(e,t){var n=e.setup.doubleClick,r=n.disabled,o=n.mode,i=n.step,a=n.animationTime,s=n.animationType;if(!r){if("reset"===o)return a3(e,a,s);var l=e.transformState.scale,c=e.contentComponent;if(!c)return console.error("No ContentComponent found");var u=o3(e,"zoomOut"===o?-1:1,i),d=x3(t,c,l),h=Q5(e,u,d.x,d.y);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");N5(e,h,a,s)}}var T3=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,a=i.disabled,s=i.excluded,l=t.target,c=null==o?void 0:o.contains(l),u=n&&l&&c&&!a;return!!u&&(!g3(l,s)&&!!u)},O3=j.createContext(e3),I3=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mounted=!0,t.transformState=n3(t.props),t.setup=r3(t.props),t.wrapperComponent=null,t.contentComponent=null,t.isInitialized=!1,t.bounds=null,t.previousWheelEvent=null,t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.isPanning=!1,t.startCoords=null,t.lastTouch=null,t.distance=null,t.lastDistance=null,t.pinchStartDistance=null,t.pinchStartScale=null,t.pinchMidpoint=null,t.velocity=null,t.velocityTime=null,t.lastMousePosition=null,t.animate=!1,t.animation=null,t.maxBounds=null,t.pressedKeys={},t.handleInitializeWrapperEvents=function(e){var n=p3();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},t.handleInitialize=function(){var e=t.setup.centerOnInit;t.applyTransformation(),t.forceUpdate(),e&&(setTimeout((function(){t.mounted&&t.setCenter()}),50),setTimeout((function(){t.mounted&&t.setCenter()}),100),setTimeout((function(){t.mounted&&t.setCenter()}),200))},t.onWheelZoom=function(e){t.setup.disabled||y3(t,e)&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(C3(t,e),_3(t,e),E3(t,e))},t.onPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;n||W5(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),I5(t),q5(t,e),A5(f3(t),e,r))},t.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||U5(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Z5(t,e.clientX,e.clientY),A5(f3(t),e,r))},t.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(Y5(t),A5(f3(t),e,n))},t.onPinchStart=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinchingStart,i=r.onZoomStart;n||w3(t,e)&&(L3(t,e),I5(t),A5(f3(t),e,o),A5(f3(t),e,i))},t.onPinch=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinching,i=r.onZoom;n||S3(t)&&(e.preventDefault(),e.stopPropagation(),P3(t,e),A5(f3(t),e,o),A5(f3(t),e,i))},t.onPinchStop=function(e){var n=t.props,r=n.onPinchingStop,o=n.onZoomStop;t.pinchStartScale&&(M3(t),A5(f3(t),e,r),A5(f3(t),e,o))},t.onTouchPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;if(!n&&W5(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,I5(t);var o=e.touches,i=1===o.length,a=2===o.length;i&&(I5(t),q5(t,e),A5(f3(t),e,r)),a&&t.onPinchStart(e)}},t.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!U5(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];Z5(t,o.clientX,o.clientY),A5(f3(t),e,r)}else e.touches.length>1&&t.onPinch(e)},t.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},t.onDoubleClick=function(e){t.setup.disabled||T3(t,e)&&A3(t,e)},t.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},t.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},t.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},t.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},t.setComponents=function(e,n){t.wrapperComponent=e,t.contentComponent=n,z5(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.handleRef(),t.isInitialized=!0,A5(f3(t),void 0,t.props.onInit)},t.setTransformState=function(e,n,r){isNaN(e)||isNaN(n)||isNaN(r)?console.error("Detected NaN set state values"):(e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=r,t.applyTransformation())},t.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=b3(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},t.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,r=e.positionX,o=e.positionY,i=v3(r,o,n);t.contentComponent.style.transform=i,t.handleRef()}},t.handleRef=function(){t.props.setRef(f3(t))},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}E5(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){var e=p3();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},t.prototype.componentWillUnmount=function(){var e=p3();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),I5(this)},t.prototype.componentDidUpdate=function(e){e!==this.props&&(z5(this,this.transformState.scale),this.setup=r3(this.props))},t.prototype.render=function(){var e=f3(this),t=this.props.children,n="function"==typeof t?t(e):t;return sd(O3.Provider,{value:L5(L5({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:n})},t}(i.exports.Component),R3=j.forwardRef((function(e,t){var n=i.exports.useState(null),r=n[0],o=n[1];return i.exports.useImperativeHandle(t,(function(){return r}),[r]),sd(I3,{...L5({},e,{setRef:o})})}));var N3="transform-component-module_wrapper__1_Fgj",D3="transform-component-module_content__2jYgh";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__1_Fgj {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__2jYgh {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__2jYgh img {\n pointer-events: none;\n}\n");var z3=function(e){var t=e.children,n=e.wrapperClass,r=void 0===n?"":n,o=e.contentClass,a=void 0===o?"":o,s=e.wrapperStyle,l=e.contentStyle,c=i.exports.useContext(O3).setComponents,u=i.exports.useRef(null),d=i.exports.useRef(null);return i.exports.useEffect((function(){var e=u.current,t=d.current;null!==e&&null!==t&&c&&c(e,t)}),[]),sd("div",{ref:u,className:"react-transform-wrapper "+N3+" "+r,style:s,children:sd("div",{ref:d,className:"react-transform-component "+D3+" "+a,style:l,children:t})})};function B3({image:e,alt:t,ref:n,styleClass:r}){const[o,a]=i.exports.useState(0),[s,l]=i.exports.useState(!1),c=()=>{a(-3===o?0:o-1)},u=()=>{a(3===o?0:o+1)},d=()=>{l(!s)};return sd(R3,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:i,zoomOut:h,resetTransform:f,centerView:p})=>ld(ad,{children:[ld("div",{className:"lightbox-image-options",children:[sd(dZ,{icon:sd(cZ,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>i(),fontSize:20}),sd(dZ,{icon:sd(uZ,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>h(),fontSize:20}),sd(dZ,{icon:sd(sZ,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:c,fontSize:20}),sd(dZ,{icon:sd(lZ,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),sd(dZ,{icon:sd(vY,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),sd(dZ,{icon:sd(aZ,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{f(),a(0),l(!1)},fontSize:20})]}),sd(z3,{wrapperStyle:{width:"100%",height:"100%"},children:sd("img",{style:{transform:`rotate(${90*o}deg) scaleX(${s?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>p(1,0,"easeOut")})})]})})}function F3(){const e=noe(),t=roe((e=>e.options.isLightBoxOpen)),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:o,isOnLastImage:a}=roe(vJ),[s,l]=i.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return Eq("Esc",(()=>{t&&e(Wte(!1))}),[t]),ld("div",{className:"lightbox-container",children:[sd(dZ,{icon:sd(iZ,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Wte(!1))},fontSize:20}),ld("div",{className:"lightbox-display-container",children:[ld("div",{className:"lightbox-preview-wrapper",children:[sd($Q,{}),!r&&ld("div",{className:"current-image-next-prev-buttons",children:[sd("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!o&&sd(DT,{"aria-label":"Previous image",icon:sd(MY,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(tJ())}})}),sd("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!a&&sd(DT,{"aria-label":"Next image",icon:sd(AY,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(eJ())}})})]}),n&&ld(ad,{children:[sd(B3,{image:n.url,styleClass:"lightbox-image"}),r&&sd(mJ,{image:n})]})]}),sd(b5,{})]})]})}const j3=cU([NZ],(e=>{const{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=e;return{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),H3=()=>{const e=noe(),{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=roe(j3);return ld(kI,{direction:"column",gap:"1rem",children:[sd(hZ,{sliderMarkRightOffset:-6,label:"Seam Size",min:1,max:256,sliderNumberInputProps:{max:512},value:t,onChange:t=>{e(Qte(t))},handleReset:()=>e(Qte(96)),withInput:!0,withSliderMarks:!0,withReset:!0}),sd(hZ,{sliderMarkRightOffset:-4,label:"Seam Blur",min:0,max:64,sliderNumberInputProps:{max:512},value:n,onChange:t=>{e(Xte(t))},handleReset:()=>{e(Xte(16))},withInput:!0,withSliderMarks:!0,withReset:!0}),sd(hZ,{sliderMarkRightOffset:-2,label:"Seam Strength",min:.01,max:.99,step:.01,value:r,onChange:t=>{e(ene(t))},handleReset:()=>{e(ene(.7))},withInput:!0,withSliderMarks:!0,withReset:!0}),sd(hZ,{sliderMarkRightOffset:-4,label:"Seam Steps",min:1,max:32,sliderNumberInputProps:{max:100},value:o,onChange:t=>{e(Jte(t))},handleReset:()=>{e(Jte(10))},withInput:!0,withSliderMarks:!0,withReset:!0})]})},W3=cU(_X,(e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),U3=()=>{const e=noe(),{boundingBoxDimensions:t}=roe(W3);return ld(kI,{direction:"column",gap:"1rem",children:[sd(hZ,{label:"Width",min:64,max:1024,step:64,value:t.width,onChange:n=>{e(UK({...t,width:Math.floor(n)}))},handleReset:()=>{e(UK({...t,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),sd(hZ,{label:"Height",min:64,max:1024,step:64,value:t.height,onChange:n=>{e(UK({...t,height:Math.floor(n)}))},handleReset:()=>{e(UK({...t,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0})]})},V3=cU(_X,(e=>{const{inpaintReplace:t,shouldUseInpaintReplace:n}=e;return{inpaintReplace:t,shouldUseInpaintReplace:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function G3(){const{inpaintReplace:e,shouldUseInpaintReplace:t}=roe(V3),n=noe();return ld(kI,{alignItems:"center",columnGap:"1rem",children:[sd(hZ,{label:"Inpaint Replace",value:e,onChange:e=>{n(JK(e))},min:0,max:1,step:.05,isInteger:!1,isSliderDisabled:!t,withSliderMarks:!0,sliderMarkRightOffset:-2,withReset:!0,handleReset:()=>n(JK(1)),isResetDisabled:!t}),sd(Yq,{isChecked:t,onChange:e=>n(EQ(e.target.checked))})]})}const $3=cU([NZ,bX,_X],((e,t,n)=>{const{tileSize:r,infillMethod:o}=e,{infill_methods:i}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:o,availableInfillMethods:i,isManual:"manual"===a}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),q3=()=>{const e=noe(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:o,isManual:i,scaledBoundingBoxDimensions:a}=roe($3);return ld(kI,{direction:"column",gap:"1rem",children:[sd(Bq,{label:"Scale Before Processing",validValues:wX,value:o,onChange:t=>{e(GK(t.target.value))}}),sd(hZ,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:"Scaled W",min:64,max:1024,step:64,value:a.width,onChange:t=>{e(IQ({...a,width:Math.floor(t)}))},handleReset:()=>{e(IQ({...a,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),sd(hZ,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:"Scaled H",min:64,max:1024,step:64,value:a.height,onChange:t=>{e(IQ({...a,height:Math.floor(t)}))},handleReset:()=>{e(IQ({...a,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),sd(G3,{}),sd(Bq,{label:"Infill Method",value:n,validValues:r,onChange:t=>e(jte(t.target.value))}),sd(hZ,{isInputDisabled:"tile"!==n,isResetDisabled:"tile"!==n,isSliderDisabled:"tile"!==n,sliderMarkRightOffset:-4,label:"Tile Size",min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:t=>{e(vne(t))},handleReset:()=>{e(vne(32))},withInput:!0,withSliderMarks:!0,withReset:!0})]})};function Z3(){const e={boundingBox:{header:"Bounding Box",feature:Rq.BOUNDING_BOX,content:sd(U3,{})},seamCorrection:{header:"Seam Correction",feature:Rq.SEAM_CORRECTION,content:sd(H3,{})},infillAndScaling:{header:"Infill and Scaling",feature:Rq.INFILL_AND_SCALING,content:sd(q3,{})},seed:{header:"Seed",feature:Rq.SEED,content:sd(kZ,{})},variations:{header:"Variations",feature:Rq.VARIATIONS,content:sd(OZ,{}),additionalHeaderComponents:sd(PZ,{})}};return ld(BQ,{children:[sd(ZX,{}),sd($X,{}),sd(UZ,{}),sd(fZ,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),sd(_Y,{accordionInfo:e})]})}const Y3=cU(_X,LX,RZ,((e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}})),X3=()=>{const e=noe(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=roe(Y3),a=i.exports.useRef(null);return i.exports.useLayoutEffect((()=>{window.setTimeout((()=>{if(!a.current)return;const{clientWidth:t,clientHeight:n}=a.current;e(ZK({width:t,height:n})),e(o?HK():jK()),e(KK(!1))}),0)}),[e,r,t,n,o]),sd("div",{ref:a,className:"inpainting-canvas-area",children:sd(dT,{thickness:"2px",speed:"1s",size:"xl"})})};var K3=Math.PI/180;const Q3="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},J3={_global:Q3,version:"8.3.14",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle:e=>J3.angleDeg?e*K3:e,enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>J3.DD.isDragging,isDragReady:()=>!!J3.DD.node,releaseCanvasOnDestroy:!0,document:Q3.document,_injectGlobal(e){Q3.Konva=e}},e4=e=>{J3[e.prototype.getClassName()]=e};J3._injectGlobal(J3);class t4{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new t4(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,o=this.m[1]*t+this.m[3]*n,i=this.m[0]*-n+this.m[2]*t,a=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=o,this.m[2]=i,this.m[3]=a,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,o=this.m[2]+this.m[0]*e,i=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=o,this.m[3]=i,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],a=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}getMatrix(){return this.m}decompose(){var e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],o=e*r-t*n;let i={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){var a=Math.sqrt(e*e+t*t);i.rotation=t>0?Math.acos(e/a):-Math.acos(e/a),i.scaleX=a,i.scaleY=o/a,i.skewX=(e*n+t*r)/o,i.skewY=0}else if(0!=n||0!=r){var s=Math.sqrt(n*n+r*r);i.rotation=Math.PI/2-(r>0?Math.acos(-n/s):-Math.acos(n/s)),i.scaleX=o/s,i.scaleY=s,i.skewX=0,i.skewY=(e*n+t*r)/o}return i.rotation=c4._getRotation(i.rotation),i}}var n4=Math.PI/180,r4=180/Math.PI,o4="Konva error: ",i4={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},a4=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,s4=[];const l4="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)},c4={_isElement:e=>!(!e||1!=e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector(e){if("string"!=typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:e=>0===e||e>0?1:-1,requestAnimFrame(e){s4.push(e),1===s4.length&&l4((function(){const e=s4;s4=[],e.forEach((function(e){e()}))}))},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(vV){}return e},createImageElement:()=>document.createElement("img"),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=c4.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB(e){var t;return e in i4?{r:(t=i4[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=a4.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA:e=>(e=e||"black",c4._namedColorToRBA(e)||c4._hex3ColorToRGBA(e)||c4._hex6ColorToRGBA(e)||c4._rgbColorToRGBA(e)||c4._rgbaColorToRGBA(e)||c4._hslColorToRGBA(e)),_namedColorToRBA(e){var t=i4[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,o=Number(n[1])/100,i=Number(n[2])/100;let a,s,l;if(0===o)return l=255*i,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};a=i<.5?i*(1+o):i+o-i*o;const c=2*i-a,u=[0,0,0];for(let e=0;e<3;e++)s=r+1/3*-(e-1),s<0&&s++,s>1&&s--,l=6*s<1?c+6*(a-c)*s:2*s<1?a:3*s<2?c+(a-c)*(2/3-s)*6:c,u[e]=255*l;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:(e,t)=>!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.heighte.slice(0),degToRad:e=>e*n4,radToDeg:e=>e*r4,_degToRad:e=>(c4.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),c4.degToRad(e)),_radToDeg:e=>(c4.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),c4.radToDeg(e)),_getRotation:e=>J3.angleDeg?c4.radToDeg(e):e,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw new Error(o4+e)},error(e){console.error(o4+e)},warn(e){J3.showWarnings&&console.warn("Konva warning: "+e)},each(e,t){for(var n in e)t(n,e[n])},_inRange:(e,t,n)=>t<=e&&e1?(a=n,s=r,l=(n-o)*(n-o)+(r-i)*(r-i)):l=((a=e+u*(n-e))-o)*(a-o)+((s=t+u*(r-t))-i)*(s-i)}return[a,s,l]},_getProjectionToLine(e,t,n){var r=c4.cloneObject(e),o=Number.MAX_VALUE;return t.forEach((function(i,a){if(n||a!==t.length-1){var s=t[(a+1)%t.length],l=c4._getProjectionToSegment(i.x,i.y,s.x,s.y,e.x,e.y),c=l[0],u=l[1],d=l[2];dt.length){var a=t;t=e,e=a}for(r=0;re.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...e){J3.releaseCanvasOnDestroy&&e.forEach((e=>{e.width=0,e.height=0}))}};function u4(e){return c4._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||c4._isBoolean(e)?e:Object.prototype.toString.call(e)}function d4(e){return e>255?255:e<0?0:Math.round(e)}function h4(){if(J3.isUnminified)return function(e,t){return c4._isNumber(e)||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function f4(e){if(J3.isUnminified)return function(t,n){let r=c4._isNumber(t),o=c4._isArray(t)&&t.length==e;return r||o||c4.warn(u4(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function p4(){if(J3.isUnminified)return function(e,t){return c4._isNumber(e)||"auto"===e||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function g4(){if(J3.isUnminified)return function(e,t){return c4._isString(e)||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function m4(){if(J3.isUnminified)return function(e,t){const n=c4._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function v4(){if(J3.isUnminified)return function(e,t){return!0===e||!1===e||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var b4="get",y4="set";const x4={addGetterSetter(e,t,n,r,o){x4.addGetter(e,t,n),x4.addSetter(e,t,r,o),x4.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=b4+c4._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter(e,t,n,r){var o=y4+c4._capitalize(t);e.prototype[o]||x4.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var o=y4+c4._capitalize(t);e.prototype[o]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,o){var i,a,s=n.length,l=c4._capitalize,c=b4+l(t),u=y4+l(t);e.prototype[c]=function(){var e={};for(i=0;i{this._setAttr(t+l(e),void 0)})),this._fireChangeEvent(t,a,e),o&&o.call(this),this},x4.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=c4._capitalize(t),r=y4+n,o=b4+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[o]()}},addDeprecatedGetterSetter(e,t,n,r){c4.error("Adding deprecated "+t);var o=b4+c4._capitalize(t),i=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[o]=function(){c4.error(i);var e=this.attrs[t];return void 0===e?n:e},x4.addSetter(e,t,r,(function(){c4.error(i)})),x4.addOverloadedGetterSetter(e,t)},backCompat(e,t){c4.each(t,(function(t,n){var r=e.prototype[n],o=b4+c4._capitalize(t),i=y4+c4._capitalize(t);function a(){r.apply(this,arguments),c4.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[t]=a,e.prototype[o]=a,e.prototype[i]=a}))},afterSetFilter(){this._filterUpToDate=!1}};function w4(e){var t,n,r=[],o=e.length,i=c4;for(t=0;t"number"==typeof e?Math.floor(e):e))),l+="("+i.join(",")+")")):(l+=r.property,e||(l+="="+r.val)),l+=";";return l}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),t.length>=100&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)}_applyOpacity(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)}arcTo(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)}drawImage(e,t,n,r,o,i,a,s,l){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,o):9===c.length&&u.drawImage(e,t,n,r,o,i,a,s,l)}ellipse(e,t,n,r,o,i,a,s){this._context.ellipse(e,t,n,r,o,i,a,s)}isPointInPath(e,t){return this._context.isPointInPath(e,t)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)}translate(e,t){this._context.translate(e,t)}_enableTrace(){var e,t,n=this,r=S4.length,o=this.setAttr,i=function(e){var r,o=n[e];n[e]=function(){return t=w4(Array.prototype.slice.call(arguments,0)),r=o.apply(n,arguments),n._trace({method:e,args:t}),r}};for(e=0;e{"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return A4._dragElements.forEach((t=>{e=t.node})),e},_dragElements:new Map,_drag(e){const t=[];A4._dragElements.forEach(((n,r)=>{const{node:o}=n,i=o.getStage();i.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=c4._getFirstPointerId(e));const a=i._changedPointerPositions.find((e=>e.id===n.pointerId));if(a){if("dragging"!==n.dragStatus){var s=o.dragDistance();if(Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y)){t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)}))},_endDragBefore(e){const t=[];A4._dragElements.forEach((n=>{const{node:r}=n,o=r.getStage();e&&o.setPointersPositions(e);if(!o._changedPointerPositions.find((e=>e.id===n.pointerId)))return;"dragging"!==n.dragStatus&&"stopped"!==n.dragStatus||(A4.justDragged=!0,J3._mouseListenClick=!1,J3._touchListenClick=!1,J3._pointerListenClick=!1,n.dragStatus="stopped");const i=n.node.getLayer()||n.node instanceof J3.Stage&&n.node;i&&-1===t.indexOf(i)&&t.push(i)})),t.forEach((e=>{e.draw()}))},_endDragAfter(e){A4._dragElements.forEach(((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&A4._dragElements.delete(n)}))}};J3.isBrowser&&(window.addEventListener("mouseup",A4._endDragBefore,!0),window.addEventListener("touchend",A4._endDragBefore,!0),window.addEventListener("mousemove",A4._drag),window.addEventListener("touchmove",A4._drag),window.addEventListener("mouseup",A4._endDragAfter,!1),window.addEventListener("touchend",A4._endDragAfter,!1));var T4="absoluteOpacity",O4="allEventListeners",I4="absoluteTransform",R4="absoluteScale",N4="canvas",D4="listening",z4="mouseenter",B4="mouseleave",F4="Shape",j4=" ",H4="stage",W4="transform",U4="visible",V4=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(j4);let G4=1;class $4{constructor(e){this._id=G4++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==W4&&e!==I4||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var n=this._cache.get(e);return(void 0===n||(e===W4||e===I4)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){const n=t.map((e=>e+"Change.konva")).join(j4);this.on(n,(()=>{this._clearCache(e)})),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(N4)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===I4&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(N4)){const{scene:e,filter:t,hit:n}=this._cache.get(N4);c4.releaseCanvas(e,t,n),this._cache.delete(N4)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t=e||{},n={};void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(t.width||n.width),o=Math.ceil(t.height||n.height),i=t.pixelRatio,a=void 0===t.x?Math.floor(n.x):t.x,s=void 0===t.y?Math.floor(n.y):t.y,l=t.offset||0,c=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(r&&o){a-=l,s-=l;var d=new P4({pixelRatio:i,width:r+=2*l+1,height:o+=2*l+1}),h=new P4({pixelRatio:i,width:0,height:0}),f=new M4({pixelRatio:u,width:r,height:o}),p=d.getContext(),g=f.getContext();return f.isCache=!0,d.isCache=!0,this._cache.delete(N4),this._filterUpToDate=!1,!1===t.imageSmoothingEnabled&&(d.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),p.save(),g.save(),p.translate(-a,-s),g.translate(-a,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache(T4),this._clearSelfAndDescendantCache(R4),this.drawScene(d,this),this.drawHit(f,this),this._isUnderCache=!1,p.restore(),g.restore(),c&&(p.save(),p.beginPath(),p.rect(0,0,r,o),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(N4,{scene:d,filter:h,hit:f,x:a,y:s}),this._requestDraw(),this}c4.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(N4)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,t){var n,r,o,i,a=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=this.getAbsoluteTransform(t);return a.forEach((function(e){var t=s.point(e);void 0===n&&(n=o=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),i=Math.max(i,t.y)})),{x:n,y:r,width:o-n,height:i-r}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const t=this._getCanvasCache();e.translate(t.x,t.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){var t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e,t,n,r,o=this.filters(),i=this._getCanvasCache(),a=i.scene,s=i.filter,l=s.getContext();if(o){if(!this._filterUpToDate){var c=a.pixelRatio;s.setSize(a.width/a.pixelRatio,a.height/a.pixelRatio);try{for(e=o.length,l.clear(),l.drawImage(a._canvas,0,0,a.getWidth()/c,a.getHeight()/c),t=l.getImageData(0,0,s.getWidth(),s.getHeight()),n=0;n{var t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+c4._capitalize(t),c4._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))})),this}isListening(){return this._getCache(D4,this._isListening)}_isListening(e){if(!this.listening())return!1;const t=this.getParent();return!t||t===e||this===e||t._isListening(e)}isVisible(){return this._getCache(U4,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const t=this.getParent();return!t||t===e||this===e||t._isVisible(e)}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;A4._dragElements.forEach((e=>{"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var o=!t&&!J3.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e,t,n,r,o=this.getDepth(),i=this,a=0;return"Stage"!==i.nodeType&&function s(l){for(e=[],t=l.length,n=0;n0&&e[0].getDepth()<=o&&s(e)}(i.getStage().getChildren()),a}getDepth(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(W4),this._clearSelfAndDescendantCache(I4)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges((()=>{this.x(e.x),this.y(e.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),o=new t4,i=this.offset();return o.m=r.slice(),o.translate(i.x,i.y),o.getTranslation()}setAbsolutePosition(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(W4);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(W4),this._clearSelfAndDescendantCache(I4),this}_setTransform(e){var t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){var t=e.x,n=e.y,r=this.x(),o=this.y();return void 0!==t&&(r+=t),void 0!==n&&(o+=n),this.setPosition({x:r,y:o}),this}_eachAncestorReverse(e,t){var n,r,o=[],i=this.getParent();if(!t||t._id!==this._id){for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return c4.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return c4.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&c4.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(T4,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,n,r,o={},i=this.getAttrs();for(e in o.attrs={},i)t=i[e],c4.isObject(t)&&!c4._isPlainObject(t)&&!c4._isArray(t)||(n="function"==typeof this[e]&&this[e],delete i[e],r=n?n.call(this):null,i[e]=t,r!==t&&(o.attrs[e]=t));return o.className=this.getClassName(),c4._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var o=this.parent;o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),o=r.length;for(t=0;t{try{const n=null==e?void 0:e.callback;n&&delete e.callback,c4._urlToImage(this.toDataURL(e),(function(e){t(e),null==n||n(e)}))}catch(Kie){n(Kie)}}))}toBlob(e){return new Promise(((t,n)=>{try{const n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob((e=>{t(e),null==n||n(e)}))}catch(Kie){n(Kie)}}))}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():J3.dragDistance}_off(e,t,n){var r,o,i,a=this.eventListeners[e];for(r=0;r=0)&&!this.isDragging()){var t=!1;A4._dragElements.forEach((e=>{this.isAncestorOf(e.node)&&(t=!0)})),t||this._createDragElement(e)}}))}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=A4._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&A4._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const t=this.getStage();if(!t)return!1;const n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return c4.haveIntersection(n,this.getClientRect())}static create(e,t){return c4._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var n,r,o,i=$4.prototype.getClassName.call(e),a=e.children;t&&(e.attrs.container=t),J3[i]||(c4.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");if(n=new(0,J3[i])(e.attrs),a)for(r=a.length,o=0;o0}removeChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}add(...e){if(arguments.length>1){for(var t=0;t0?t[0]:void 0}_generalFind(e,t){var n=[];return this._descendants((r=>{const o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),n}_descendants(e){let t=!1;const n=this.getChildren();for(const r of n){if(t=e(r),t)return!0;if(r.hasChildren()&&(t=r._descendants(e),t))return!0}return!1}toObject(){var e=$4.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((t=>{e.children.push(t.toObject())})),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=$4.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),o=r&&r.getContext(),i=this._getCanvasCache(),a=i&&i.scene,s=r&&r.isCache;if(!this.isVisible()&&!s)return this;if(a){o.save();var l=this.getAbsoluteTransform(t).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,t);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,o=r&&r.getContext(),i=this._getCanvasCache();if(i&&i.hit){o.save();var a=this.getAbsoluteTransform(t).getMatrix();o.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n){var r,o=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),s=this.clipFunc(),l=i&&a||s;const c=n===this;if(l){o.save();var u=this.getAbsoluteTransform(n),d=u.getMatrix();if(o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),o.beginPath(),s)s.call(this,o,this);else{var h=this.clipX(),f=this.clipY();o.rect(h,f,i,a)}o.clip(),d=u.copy().invert().getMatrix(),o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var p=!c&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;p&&(o.save(),o._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),p&&o.restore(),l&&o.restore()}getClientRect(e){var t,n,r,o,i,a=(e=e||{}).skipTransform,s=e.relativeTo,l={x:1/0,y:1/0,width:0,height:0},c=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var a=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===a.width&&0===a.height||(void 0===n?(n=a.x,r=a.y,o=a.x+a.width,i=a.y+a.height):(n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x+a.width),i=Math.max(i,a.y+a.height)))}}));for(var u=this.find("Shape"),d=!1,h=0;he.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",_6=e=>{const t=C6(e);return"pointer"===t?J3.pointerEventsEnabled&&k6.pointer:"touch"===t?k6.touch:"mouse"===t?k6.mouse:void 0};function E6(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&c4.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const L6=[];class P6 extends Z4{constructor(e){super(E6(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),L6.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{E6(this.attrs)})),this._checkVisibility()}_validateAdd(e){const t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||c4.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if("string"==typeof e){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e,t=this.children,n=t.length;for(e=0;e-1&&L6.splice(t,1),c4.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(c4.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)}_getPointerById(e){return this._pointerPositions.find((t=>t.id===e))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new P4({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}getIntersection(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){const r=n[t].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((n=>{n.setSize({width:e,height:t}),n.draw()}))}add(e,...t){if(arguments.length>1){for(var n=0;n5&&c4.warn("The stage has "+r+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),J3.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return J4(e,this)}setPointerCapture(e){e6(e,this)}releaseCapture(e){t6(e)}getLayers(){return this.children}_bindContentEvents(){J3.isBrowser&&S6.forEach((([e,t])=>{this.content.addEventListener(e,(e=>{this[t](e)}),{passive:!1})}))}_pointerenter(e){this.setPointersPositions(e);const t=_6(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const t=_6(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){const t=_6(e.type),n=C6(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),o=!A4.isDragging||J3.hitOnDragEnabled;r&&o?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):o&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const t=_6(e.type),n=C6(e.type);if(t){this.setPointersPositions(e);var r=!1;this._changedPointerPositions.forEach((o=>{var i=this.getIntersection(o);A4.justDragged=!1,J3["_"+n+"ListenClick"]=!0;if(!(i&&i.isListening()))return;J3.capturePointerEventsEnabled&&i.setPointerCapture(o.id),this[n+"ClickStartShape"]=i,i._fireAndBubble(t.pointerdown,{evt:e,pointerId:o.id}),r=!0;const a=e.type.indexOf("touch")>=0;i.preventDefault()&&e.cancelable&&a&&e.preventDefault()})),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const t=_6(e.type),n=C6(e.type);if(!t)return;if(A4.isDragging&&A4.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!(!A4.isDragging||J3.hitOnDragEnabled))return;var r={};let o=!1;var i=this._getTargetShape(n);this._changedPointerPositions.forEach((a=>{const s=K4(a.id)||this.getIntersection(a),l=a.id,c={evt:e,pointerId:l};var u=i!==s;if(u&&i&&(i._fireAndBubble(t.pointerout,Object.assign({},c),s),i._fireAndBubble(t.pointerleave,Object.assign({},c),s)),s){if(r[s._id])return;r[s._id]=!0}s&&s.isListening()?(o=!0,u&&(s._fireAndBubble(t.pointerover,Object.assign({},c),i),s._fireAndBubble(t.pointerenter,Object.assign({},c),i),this[n+"targetShape"]=s),s._fireAndBubble(t.pointermove,Object.assign({},c))):i&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:l}),this[n+"targetShape"]=null)})),o||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const t=_6(e.type),n=C6(e.type);if(!t)return;this.setPointersPositions(e);const r=this[n+"ClickStartShape"],o=this[n+"ClickEndShape"];var i={};let a=!1;this._changedPointerPositions.forEach((s=>{const l=K4(s.id)||this.getIntersection(s);if(l){if(l.releaseCapture(s.id),i[l._id])return;i[l._id]=!0}const c=s.id,u={evt:e,pointerId:c};let d=!1;J3["_"+n+"InDblClickWindow"]?(d=!0,clearTimeout(this[n+"DblTimeout"])):A4.justDragged||(J3["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout((function(){J3["_"+n+"InDblClickWindow"]=!1}),J3.dblClickWindow),l&&l.isListening()?(a=!0,this[n+"ClickEndShape"]=l,l._fireAndBubble(t.pointerup,Object.assign({},u)),J3["_"+n+"ListenClick"]&&r&&r===l&&(l._fireAndBubble(t.pointerclick,Object.assign({},u)),d&&o&&o===l&&l._fireAndBubble(t.pointerdblclick,Object.assign({},u)))):(this[n+"ClickEndShape"]=null,J3["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:c}),d&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:c}))})),a||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),J3["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(m6,{evt:e}):this._fire(m6,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(w6,{evt:e}):this._fire(w6,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const t=K4(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(u6,Q4(e)),t6(e.pointerId)}_lostpointercapture(e){t6(e.pointerId)}setPointersPositions(e){var t=this._getContentPosition(),n=null,r=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))):(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:c4._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:c4._getFirstPointerId(e)}])}_setPointerPosition(e){c4.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new P4({width:this.width(),height:this.height()}),this.bufferHitCanvas=new M4({pixelRatio:1,width:this.width(),height:this.height()}),J3.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}}cache(){return c4.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach((function(e){e.batchDraw()})),this}}P6.prototype.nodeType="Stage",e4(P6),x4.addGetterSetter(P6,"container");var M6="hasShadow",A6="shadowRGBA",T6="patternImage",O6="linearGradient",I6="radialGradient";let R6;function N6(){return R6||(R6=c4.createCanvasElement().getContext("2d"),R6)}const D6={};class z6 extends $4{constructor(e){let t;for(super(e);t=c4.getRandomColor(),!t||t in D6;);this.colorKey=t,D6[t]=this}getContext(){return c4.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return c4.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(M6,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(T6,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=N6().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const t=new t4;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(J3.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(O6,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var t=N6(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),o=t.createLinearGradient(n.x,n.y,r.x,r.y),i=0;ithis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())))}hasHitStroke(){const e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage().bufferHitCanvas;return t.getContext().clear(),this.drawHit(t,null,!0),t.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return $4.prototype.destroy.call(this),delete D6[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;const n=e||this.hasFill(),r=this.hasStroke(),o=1!==this.getAbsoluteOpacity();if(n&&r&&o)return!0;const i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(n&&r&&i&&a)}setStrokeHitEnabled(e){c4.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,i=r.width+o,a=r.height+o,s=!e.skipShadow&&this.hasShadow(),l=s?this.shadowOffsetX():0,c=s?this.shadowOffsetY():0,u=i+Math.abs(l),d=a+Math.abs(c),h=s&&this.shadowBlur()||0,f={width:u+2*h,height:d+2*h,x:-(o/2+h)+Math.min(l,0)+r.x,y:-(o/2+h)+Math.min(c,0)+r.y};return t?f:this._transformedRect(f,n)}drawScene(e,t){var n,r,o=this.getLayer(),i=e||o.getCanvas(),a=i.getContext(),s=this._getCanvasCache(),l=this.getSceneFunc(),c=this.hasShadow(),u=i.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(s){a.save();var h=this.getAbsoluteTransform(t).getMatrix();return a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!l)return this;if(a.save(),this._useBufferCanvas()&&!u){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var f=this.getAbsoluteTransform(t).getMatrix();r.transform(f[0],f[1],f[2],f[3],f[4],f[5]),l.call(this,r,this),r.restore();var p=n.pixelRatio;c&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(a._applyLineJoin(this),!d){f=this.getAbsoluteTransform(t).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}c&&a._applyShadow(this),l.call(this,a,this)}return a.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),o=e||r.hitCanvas,i=o&&o.getContext(),a=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),l=s&&s.hit;if(this.colorKey||c4.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),l){i.save();var c=this.getAbsoluteTransform(t).getMatrix();return i.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(i),i.restore(),this}if(!a)return this;i.save(),i._applyLineJoin(this);if(!(this===t)){var u=this.getAbsoluteTransform(t).getMatrix();i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}return a.call(this,i,this),i.restore(),this}drawHitFromCache(e=0){var t,n,r,o,i,a=this._getCanvasCache(),s=this._getCachedSceneCanvas(),l=a.hit,c=l.getContext(),u=l.getWidth(),d=l.getHeight();c.clear(),c.drawImage(s._canvas,0,0,u,d);try{for(r=(n=(t=c.getImageData(0,0,u,d)).data).length,o=c4._hexToRgb(this.colorKey),i=0;ie?(n[i]=o.r,n[i+1]=o.g,n[i+2]=o.b,n[i+3]=255):n[i+3]=0;c.putImageData(t,0,0)}catch(vV){c4.error("Unable to draw hit graph from cached scene canvas. "+vV.message)}return this}hasPointerCapture(e){return J4(e,this)}setPointerCapture(e){e6(e,this)}releaseCapture(e){t6(e)}}z6.prototype._fillFunc=function(e){e.fill()},z6.prototype._strokeFunc=function(e){e.stroke()},z6.prototype._fillFuncHit=function(e){e.fill()},z6.prototype._strokeFuncHit=function(e){e.stroke()},z6.prototype._centroid=!1,z6.prototype.nodeType="Shape",e4(z6),z6.prototype.eventListeners={},z6.prototype.on.call(z6.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(M6)})),z6.prototype.on.call(z6.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(A6)})),z6.prototype.on.call(z6.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(T6)})),z6.prototype.on.call(z6.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(O6)})),z6.prototype.on.call(z6.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(I6)})),x4.addGetterSetter(z6,"stroke",void 0,m4()),x4.addGetterSetter(z6,"strokeWidth",2,h4()),x4.addGetterSetter(z6,"fillAfterStrokeEnabled",!1),x4.addGetterSetter(z6,"hitStrokeWidth","auto",p4()),x4.addGetterSetter(z6,"strokeHitEnabled",!0,v4()),x4.addGetterSetter(z6,"perfectDrawEnabled",!0,v4()),x4.addGetterSetter(z6,"shadowForStrokeEnabled",!0,v4()),x4.addGetterSetter(z6,"lineJoin"),x4.addGetterSetter(z6,"lineCap"),x4.addGetterSetter(z6,"sceneFunc"),x4.addGetterSetter(z6,"hitFunc"),x4.addGetterSetter(z6,"dash"),x4.addGetterSetter(z6,"dashOffset",0,h4()),x4.addGetterSetter(z6,"shadowColor",void 0,g4()),x4.addGetterSetter(z6,"shadowBlur",0,h4()),x4.addGetterSetter(z6,"shadowOpacity",1,h4()),x4.addComponentsGetterSetter(z6,"shadowOffset",["x","y"]),x4.addGetterSetter(z6,"shadowOffsetX",0,h4()),x4.addGetterSetter(z6,"shadowOffsetY",0,h4()),x4.addGetterSetter(z6,"fillPatternImage"),x4.addGetterSetter(z6,"fill",void 0,m4()),x4.addGetterSetter(z6,"fillPatternX",0,h4()),x4.addGetterSetter(z6,"fillPatternY",0,h4()),x4.addGetterSetter(z6,"fillLinearGradientColorStops"),x4.addGetterSetter(z6,"strokeLinearGradientColorStops"),x4.addGetterSetter(z6,"fillRadialGradientStartRadius",0),x4.addGetterSetter(z6,"fillRadialGradientEndRadius",0),x4.addGetterSetter(z6,"fillRadialGradientColorStops"),x4.addGetterSetter(z6,"fillPatternRepeat","repeat"),x4.addGetterSetter(z6,"fillEnabled",!0),x4.addGetterSetter(z6,"strokeEnabled",!0),x4.addGetterSetter(z6,"shadowEnabled",!0),x4.addGetterSetter(z6,"dashEnabled",!0),x4.addGetterSetter(z6,"strokeScaleEnabled",!0),x4.addGetterSetter(z6,"fillPriority","color"),x4.addComponentsGetterSetter(z6,"fillPatternOffset",["x","y"]),x4.addGetterSetter(z6,"fillPatternOffsetX",0,h4()),x4.addGetterSetter(z6,"fillPatternOffsetY",0,h4()),x4.addComponentsGetterSetter(z6,"fillPatternScale",["x","y"]),x4.addGetterSetter(z6,"fillPatternScaleX",1,h4()),x4.addGetterSetter(z6,"fillPatternScaleY",1,h4()),x4.addComponentsGetterSetter(z6,"fillLinearGradientStartPoint",["x","y"]),x4.addComponentsGetterSetter(z6,"strokeLinearGradientStartPoint",["x","y"]),x4.addGetterSetter(z6,"fillLinearGradientStartPointX",0),x4.addGetterSetter(z6,"strokeLinearGradientStartPointX",0),x4.addGetterSetter(z6,"fillLinearGradientStartPointY",0),x4.addGetterSetter(z6,"strokeLinearGradientStartPointY",0),x4.addComponentsGetterSetter(z6,"fillLinearGradientEndPoint",["x","y"]),x4.addComponentsGetterSetter(z6,"strokeLinearGradientEndPoint",["x","y"]),x4.addGetterSetter(z6,"fillLinearGradientEndPointX",0),x4.addGetterSetter(z6,"strokeLinearGradientEndPointX",0),x4.addGetterSetter(z6,"fillLinearGradientEndPointY",0),x4.addGetterSetter(z6,"strokeLinearGradientEndPointY",0),x4.addComponentsGetterSetter(z6,"fillRadialGradientStartPoint",["x","y"]),x4.addGetterSetter(z6,"fillRadialGradientStartPointX",0),x4.addGetterSetter(z6,"fillRadialGradientStartPointY",0),x4.addComponentsGetterSetter(z6,"fillRadialGradientEndPoint",["x","y"]),x4.addGetterSetter(z6,"fillRadialGradientEndPointX",0),x4.addGetterSetter(z6,"fillRadialGradientEndPointY",0),x4.addGetterSetter(z6,"fillPatternRotation",0),x4.backCompat(z6,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var B6=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],F6=B6.length;class j6 extends Z4{constructor(e){super(e),this.canvas=new P4,this.hitCanvas=new M4({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let r=0;r0?{antialiased:!0}:{}}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),Z4.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}drawHit(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),Z4.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){c4.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return c4.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return c4.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}j6.prototype.nodeType="Layer",e4(j6),x4.addGetterSetter(j6,"imageSmoothingEnabled",!0),x4.addGetterSetter(j6,"clearBeforeDraw",!0),x4.addGetterSetter(j6,"hitGraphEnabled",!0,v4());class H6 extends j6{constructor(e){super(e),this.listening(!1),c4.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}H6.prototype.nodeType="FastLayer",e4(H6);class W6 extends Z4{_validateAdd(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&c4.throw("You may only add groups and shapes to groups.")}}W6.prototype.nodeType="Group",e4(W6);var U6=Q3.performance&&Q3.performance.now?function(){return Q3.performance.now()}:function(){return(new Date).getTime()};class V6{constructor(e,t){this.id=V6.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:U6(),frameRate:0},this.func=e,this.setLayers(t)}setLayers(e){var t=[];return t=e?e.length>0?e:[e]:[],this.layers=t,this}getLayers(){return this.layers}addLayer(e){var t,n=this.layers,r=n.length;for(t=0;tthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class Y6{constructor(e){var t,n,r=this,o=e.node,i=o._id,a=e.easing||X6.Linear,s=!!e.yoyo;t=void 0===e.duration?.3:0===e.duration?.001:e.duration,this.node=o,this._id=$6++;var l=o.getLayer()||(o instanceof J3.Stage?o.getLayers():null);for(n in l||c4.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new V6((function(){r.tween.onEnterFrame()}),l),this.tween=new Z6(n,(function(e){r._tweenFunc(e)}),a,0,1,1e3*t,s),this._addListeners(),Y6.attrs[i]||(Y6.attrs[i]={}),Y6.attrs[i][this._id]||(Y6.attrs[i][this._id]={}),Y6.tweens[i]||(Y6.tweens[i]={}),e)void 0===G6[n]&&this._addAttr(n,e[n]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){var n,r,o,i,a,s,l,c,u=this.node,d=u._id;if((o=Y6.tweens[d][e])&&delete Y6.attrs[d][o][e],n=u.getAttr(e),c4._isArray(t))if(r=[],a=Math.max(t.length,n.length),"points"===e&&t.length!==n.length&&(t.length>n.length?(l=n,n=c4._prepareArrayForTween(n,t,u.closed())):(s=t,t=c4._prepareArrayForTween(t,n,u.closed()))),0===e.indexOf("fill"))for(i=0;i{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=Y6.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=Y6.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,n=this._id,r=Y6.tweens[t];for(e in this.pause(),r)delete Y6.tweens[t][e];delete Y6.attrs[t][n]}}Y6.attrs={},Y6.tweens={},$4.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new Y6(e).play()};const X6={BackEaseIn(e,t,n,r){var o=1.70158;return n*(e/=r)*e*((o+1)*e-o)+t},BackEaseOut(e,t,n,r){var o=1.70158;return n*((e=e/r-1)*e*((o+1)*e+o)+1)+t},BackEaseInOut(e,t,n,r){var o=1.70158;return(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},ElasticEaseIn(e,t,n,r,o,i){var a=0;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),!o||o(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-X6.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>en*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t},K6=c4._assign(J3,{Util:c4,Transform:t4,Node:$4,Container:Z4,Stage:P6,stages:L6,Layer:j6,FastLayer:H6,Group:W6,DD:A4,Shape:z6,shapes:D6,Animation:V6,Tween:Y6,Easings:X6,Context:k4,Canvas:L4});class Q6 extends z6{_sceneFunc(e){var t=J3.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=J3.getAngle(n?360-this.angle():this.angle()),o=Math.cos(Math.min(r,Math.PI)),i=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),a=Math.sin(Math.min(r,Math.PI/2)),s=o*(o>0?e:t),l=i*(i>0?e:t),c=a*(a>0?t:e);return{x:s,y:n?-1*c:l,width:1*t-s,height:c-l}}}function J6(e,t,n,r,o,i,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2)),c=a*s/(s+l),u=a*l/(s+l);return[n-c*(o-e),r-c*(i-t),n+u*(o-e),r+u*(i-t)]}function e7(e,t){var n,r,o=e.length,i=[];for(n=2;n4){for(n=(t=this.getTensionPoints()).length,r=s?0:4,s||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);rc?l:c,g=l>c?1:l/c,m=l>c?c/l:1;e.translate(a,s),e.rotate(h),e.scale(g,m),e.arc(0,0,p,u,u+d,1-f),e.scale(1/g,1/m),e.rotate(-h),e.translate(-a,-s);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var n=t.points[4],r=t.points[5],o=t.points[4]+r,i=Math.PI/180;if(Math.abs(n-o)o;r-=i){const n=n7.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],r,0);e.push(n.x,n.y)}else for(let r=n+i;rthis.dataArray[n].pathLength;)e-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(t=this.dataArray[n-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[n].points.slice(0,2))[0],y:t[1]};var o=this.dataArray[n],i=o.points;switch(o.command){case"L":return n7.getPointOnLine(e,o.start.x,o.start.y,i[0],i[1]);case"C":return n7.getPointOnCubicBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3],i[4],i[5]);case"Q":return n7.getPointOnQuadraticBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3]);case"A":var a=i[0],s=i[1],l=i[2],c=i[3],u=i[4],d=i[5],h=i[6];return u+=d*e/o.pathLength,n7.getPointOnEllipticalArc(a,s,l,c,u,h)}return null}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPointOnLine(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var s=(o-n)/(r-t+1e-8),l=Math.sqrt(e*e/(1+s*s));r0&&!isNaN(f[0]);){var v,b,y,x,w,S,k,C,_,E,L=null,P=[],M=l,A=c;switch(h){case"l":l+=f.shift(),c+=f.shift(),L="L",P.push(l,c);break;case"L":l=f.shift(),c=f.shift(),P.push(l,c);break;case"m":var T=f.shift(),O=f.shift();if(l+=T,c+=O,L="M",a.length>2&&"z"===a[a.length-1].command)for(var I=a.length-2;I>=0;I--)if("M"===a[I].command){l=a[I].points[0]+T,c=a[I].points[1]+O;break}P.push(l,c),h="l";break;case"M":l=f.shift(),c=f.shift(),L="M",P.push(l,c),h="L";break;case"h":l+=f.shift(),L="L",P.push(l,c);break;case"H":l=f.shift(),L="L",P.push(l,c);break;case"v":c+=f.shift(),L="L",P.push(l,c);break;case"V":c=f.shift(),L="L",P.push(l,c);break;case"C":P.push(f.shift(),f.shift(),f.shift(),f.shift()),l=f.shift(),c=f.shift(),P.push(l,c);break;case"c":P.push(l+f.shift(),c+f.shift(),l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),L="C",P.push(l,c);break;case"S":b=l,y=c,"C"===(v=a[a.length-1]).command&&(b=l+(l-v.points[2]),y=c+(c-v.points[3])),P.push(b,y,f.shift(),f.shift()),l=f.shift(),c=f.shift(),L="C",P.push(l,c);break;case"s":b=l,y=c,"C"===(v=a[a.length-1]).command&&(b=l+(l-v.points[2]),y=c+(c-v.points[3])),P.push(b,y,l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),L="C",P.push(l,c);break;case"Q":P.push(f.shift(),f.shift()),l=f.shift(),c=f.shift(),P.push(l,c);break;case"q":P.push(l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),L="Q",P.push(l,c);break;case"T":b=l,y=c,"Q"===(v=a[a.length-1]).command&&(b=l+(l-v.points[0]),y=c+(c-v.points[1])),l=f.shift(),c=f.shift(),L="Q",P.push(b,y,l,c);break;case"t":b=l,y=c,"Q"===(v=a[a.length-1]).command&&(b=l+(l-v.points[0]),y=c+(c-v.points[1])),l+=f.shift(),c+=f.shift(),L="Q",P.push(b,y,l,c);break;case"A":x=f.shift(),w=f.shift(),S=f.shift(),k=f.shift(),C=f.shift(),_=l,E=c,l=f.shift(),c=f.shift(),L="A",P=this.convertEndpointToCenterParameterization(_,E,l,c,k,C,x,w,S);break;case"a":x=f.shift(),w=f.shift(),S=f.shift(),k=f.shift(),C=f.shift(),_=l,E=c,l+=f.shift(),c+=f.shift(),L="A",P=this.convertEndpointToCenterParameterization(_,E,l,c,k,C,x,w,S)}a.push({command:L||h,points:P,start:{x:M,y:A},pathLength:this.calcLength(M,A,L||h,P)})}"z"!==h&&"Z"!==h||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,t,n,r){var o,i,a,s,l=n7;switch(n){case"L":return l.getLineLength(e,t,r[0],r[1]);case"C":for(o=0,i=l.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)a=l.getPointOnCubicBezier(s,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"Q":for(o=0,i=l.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)a=l.getPointOnQuadraticBezier(s,e,t,r[0],r[1],r[2],r[3]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"A":o=0;var c=r[4],u=r[5],d=r[4]+u,h=Math.PI/180;if(Math.abs(c-d)d;s-=h)a=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;else for(s=c+h;s1&&(a*=Math.sqrt(h),s*=Math.sqrt(h));var f=Math.sqrt((a*a*(s*s)-a*a*(d*d)-s*s*(u*u))/(a*a*(d*d)+s*s*(u*u)));o===i&&(f*=-1),isNaN(f)&&(f=0);var p=f*a*d/s,g=f*-s*u/a,m=(e+n)/2+Math.cos(c)*p-Math.sin(c)*g,v=(t+r)/2+Math.sin(c)*p+Math.cos(c)*g,b=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},y=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(b(e)*b(t))},x=function(e,t){return(e[0]*t[1]=1&&(C=0),0===i&&C>0&&(C-=2*Math.PI),1===i&&C<0&&(C+=2*Math.PI),[m,v,a,s,w,C,c,i]}}n7.prototype.className="Path",n7.prototype._attrsAffectingSize=["data"],e4(n7),x4.addGetterSetter(n7,"data");class r7 extends t7{_sceneFunc(e){super._sceneFunc(e);var t=2*Math.PI,n=this.points(),r=n,o=0!==this.tension()&&n.length>4;o&&(r=this.getTensionPoints());var i,a,s=this.pointerLength(),l=n.length;if(o){const e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[l-2],n[l-1]],t=n7.calcLength(r[r.length-4],r[r.length-3],"C",e),o=n7.getPointOnQuadraticBezier(Math.min(1,1-s/t),e[0],e[1],e[2],e[3],e[4],e[5]);i=n[l-2]-o.x,a=n[l-1]-o.y}else i=n[l-2]-n[l-4],a=n[l-1]-n[l-3];var c=(Math.atan2(a,i)+t)%t,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[l-2],n[l-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),o?(i=(r[0]+r[2])/2-n[0],a=(r[1]+r[3])/2-n[1]):(i=n[2]-n[0],a=n[3]-n[1]),e.rotate((Math.atan2(-a,-i)+t)%t),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}r7.prototype.className="Arrow",e4(r7),x4.addGetterSetter(r7,"pointerLength",10,h4()),x4.addGetterSetter(r7,"pointerWidth",10,h4()),x4.addGetterSetter(r7,"pointerAtBeginning",!1),x4.addGetterSetter(r7,"pointerAtEnding",!0);class o7 extends z6{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}o7.prototype._centroid=!0,o7.prototype.className="Circle",o7.prototype._attrsAffectingSize=["radius"],e4(o7),x4.addGetterSetter(o7,"radius",0,h4());class i7 extends z6{_sceneFunc(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radiusX()}getHeight(){return 2*this.radiusY()}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}i7.prototype.className="Ellipse",i7.prototype._centroid=!0,i7.prototype._attrsAffectingSize=["radiusX","radiusY"],e4(i7),x4.addComponentsGetterSetter(i7,"radius",["x","y"]),x4.addGetterSetter(i7,"radiusX",0,h4()),x4.addGetterSetter(i7,"radiusY",0,h4());class a7 extends z6{constructor(e){super(e),this.on("imageChange.konva",(()=>{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&4===e.readyState||e&&e.addEventListener&&e.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const t=this.getWidth(),n=this.getHeight(),r=this.attrs.image;let o;if(r){const e=this.attrs.cropWidth,i=this.attrs.cropHeight;o=e&&i?[r,this.cropX(),this.cropY(),e,i,0,0,t,n]:[r,0,0,t,n]}(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),r&&e.drawImage.apply(e,o)}_hitFunc(e){var t=this.width(),n=this.height();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}getHeight(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}static fromURL(e,t,n=null){var r=c4.createImageElement();r.onload=function(){var e=new a7({image:r});t(e)},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}a7.prototype.className="Image",e4(a7),x4.addGetterSetter(a7,"image"),x4.addComponentsGetterSetter(a7,"crop",["x","y","width","height"]),x4.addGetterSetter(a7,"cropX",0,h4()),x4.addGetterSetter(a7,"cropY",0,h4()),x4.addGetterSetter(a7,"cropWidth",0,h4()),x4.addGetterSetter(a7,"cropHeight",0,h4());var s7=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],l7="up",c7="right",u7="down",d7="left",h7=s7.length;class f7 extends W6{constructor(e){super(e),this.on("add.konva",(function(e){this._addListeners(e.child),this._sync()}))}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var t,n=this,r=function(){n._sync()};for(t=0;t{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.y)})),{x:t,y:r,width:n-t,height:o-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}m7.prototype.className="RegularPolygon",m7.prototype._centroid=!0,m7.prototype._attrsAffectingSize=["radius"],e4(m7),x4.addGetterSetter(m7,"radius",0,h4()),x4.addGetterSetter(m7,"sides",0,h4());var v7=2*Math.PI;class b7 extends z6{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,v7,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),v7,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}b7.prototype.className="Ring",b7.prototype._centroid=!0,b7.prototype._attrsAffectingSize=["innerRadius","outerRadius"],e4(b7),x4.addGetterSetter(b7,"innerRadius",0,h4()),x4.addGetterSetter(b7,"outerRadius",0,h4());class y7 extends z6{constructor(e){super(e),this._updated=!0,this.anim=new V6((()=>{var e=this._updated;return this._updated=!1,e})),this.on("animationChange.konva",(function(){this.frameIndex(0)})),this.on("frameIndexChange.konva",(function(){this._updated=!0})),this.on("frameRateChange.konva",(function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())}))}_sceneFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+0],s=o[r+1],l=o[r+2],c=o[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,l,c),e.closePath(),e.fillStrokeShape(this)),u)if(i){var d=i[t],h=2*n;e.drawImage(u,a,s,l,c,d[h+0],d[h+1],l,c)}else e.drawImage(u,a,s,l,c,0,0,l,c)}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+2],s=o[r+3];if(e.beginPath(),i){var l=i[t],c=2*n;e.rect(l[c+0],l[c+1],a,s)}else e.rect(0,0,a,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval((function(){e._updateIndex()}),1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),t=this.animation();e1&&(m+=a)}}}_hitFunc(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){var t=c4._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}getWidth(){return this.attrs.width===k7||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}getHeight(){return this.attrs.height===k7||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return c4.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n=O7(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}_getContextFont(){return this.fontStyle()+P7+this.fontVariant()+P7+(this.fontSize()+"px ")+this.fontFamily().split(",").map((e=>{const t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e=`"${e}"`),e})).join(", ")}_addTextLine(e){this.align()===C7&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return O7().measureText(e).width+(n?t*(n-1):0)}_setTextData(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==k7&&void 0!==o,s=i!==k7&&void 0!==i,l=this.padding(),c=o-2*l,u=i-2*l,d=0,h=this.wrap(),f="char"!==h&&h!==M7,p=this.ellipsis();this.textArr=[],O7().font=this._getContextFont();for(var g=p?this._getTextWidth("…"):0,m=0,v=e.length;mc)for(;b.length>0;){for(var x=0,w=b.length,S="",k=0;x>>1,_=b.slice(0,C+1),E=this._getTextWidth(_)+g;E<=c?(x=C+1,S=_,k=E):w=C}if(!S)break;if(f){var L,P=b[S.length];(L=(P===P7||"-"===P)&&k<=c?S.length:Math.max(S.lastIndexOf(P7),S.lastIndexOf("-"))+1)>0&&(x=L,S=S.slice(0,x),k=this._getTextWidth(S))}if(S=S.trimRight(),this._addTextLine(S),n=Math.max(n,k),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((b=(b=b.slice(x)).trimLeft()).length>0&&(y=this._getTextWidth(b))<=c){this._addTextLine(b),d+=r,n=Math.max(n,y);break}}else this._addTextLine(b),d+=r,n=Math.max(n,y),this._shouldHandleEllipsis(d)&&mu)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,o=r!==k7&&void 0!==r,i=r-2*this.padding();return!(this.wrap()!==M7)||o&&e+n>i}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,t=e!==k7&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(o&&r){if(t)this._getTextWidth(o.text+"…")=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[s].pathLength);var l=0;"center"===r&&(l=Math.max(0,a/2-i/2)),"right"===r&&(l=Math.max(0,a-i));for(var c,u,d,h=w7(this.text()),f=this.text().split(" ").length-1,p=-1,g=0,m=function(){g=0;for(var t=e.dataArray,n=p+1;n0)return p=n,t[n];"M"===t[n].command&&(c={x:t[n].points[0],y:t[n].points[1]})}return{}},v=function(t){var o=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(o+=(a-i)/f);var s=0,l=0;for(u=void 0;Math.abs(o-s)/o>.01&&l<20;){l++;for(var h=s;void 0===d;)(d=m())&&h+d.pathLengtho?u=n7.getPointOnLine(o,c.x,c.y,d.points[0],d.points[1],c.x,c.y):d=void 0;break;case"A":var v=d.points[4],b=d.points[5],y=d.points[4]+b;0===g?g=v+1e-8:o>s?g+=Math.PI/180*b/Math.abs(b):g-=Math.PI/360*b/Math.abs(b),(b<0&&g=0&&g>y)&&(g=y,p=!0),u=n7.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],g,d.points[6]);break;case"C":0===g?g=o>d.pathLength?1e-8:o/d.pathLength:o>s?g+=(o-s)/d.pathLength/2:g=Math.max(g-(s-o)/d.pathLength/2,0),g>1&&(g=1,p=!0),u=n7.getPointOnCubicBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);break;case"Q":0===g?g=o/d.pathLength:o>s?g+=(o-s)/d.pathLength:g-=(s-o)/d.pathLength,g>1&&(g=1,p=!0),u=n7.getPointOnQuadraticBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3])}void 0!==u&&(s=n7.getLineLength(c.x,c.y,u.x,u.y)),p&&(p=!1,d=void 0)}},b=l/(e._getTextSize("C").width+n)-1,y=0;ye+`.${B7}`)).join(" "),j7="nodesRect",H7=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],W7={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const U7="ontouchstart"in J3._global;var V7=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function G7(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),o=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:o})}function $7(e,t){const n=function(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}(e);return G7(e,t,n)}class q7 extends W6{constructor(e){super(e),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(F7,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return c4.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return B7+this._id}setNodes(e=[]){return this._nodes&&this._nodes.length&&this.detach(),this._nodes=e,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((e=>{const t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=e._attrsAffectingSize.map((e=>e+"Change."+this._getEventNamespace())).join(" ");e.on(n,t),e.on(H7.map((e=>e+`.${this._getEventNamespace()}`)).join(" "),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)})),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,(n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)})),e.on(`dragmove.${this._getEventNamespace()}`,(n=>{if(!t)return;const r=e.getAbsolutePosition(),o=r.x-t.x,i=r.y-t.y;this.nodes().forEach((t=>{if(t===e)return;if(t.isDragging())return;const r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+o,y:r.y+i}),t.startDrag(n)})),t=null}))}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach((e=>{e.off("."+this._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(j7),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(j7,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),a=r.x*o.x-e.offsetX()*o.x,s=r.y*o.y-e.offsetY()*o.y;const l=(J3.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return G7({x:i.x+a*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+a*Math.sin(l),width:r.width*o.x,height:r.height*o.y,rotation:l},-J3.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[];this.nodes().map((t=>{const n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],o=t.getAbsoluteTransform();r.forEach((function(t){var n=o.point(t);e.push(n)}))}));const t=new t4;var n,r,o,i;t.rotate(-J3.getAngle(this.rotation())),e.forEach((function(e){var a=t.point(e);void 0===n&&(n=o=a.x,r=i=a.y),n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x),i=Math.max(i,a.y)})),t.invert();const a=t.point({x:n,y:r});return{x:a.x,y:a.y,width:o-n,height:i-r,rotation:J3.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),V7.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}_createAnchor(e){var t=new g7({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:U7?10:"auto"}),n=this;t.on("mousedown touchstart",(function(e){n._handleMouseDown(e)})),t.on("dragstart",(e=>{t.stopDrag(),e.cancelBubble=!0})),t.on("dragend",(e=>{e.cancelBubble=!0})),t.on("mouseenter",(()=>{var n=J3.getAngle(this.rotation()),r=function(e,t){if("rotater"===e)return"crosshair";t+=c4.degToRad(W7[e]||0);var n=(c4.radToDeg(t)%360+360)%360;return c4._inRange(n,337.5,360)||c4._inRange(n,0,22.5)?"ns-resize":c4._inRange(n,22.5,67.5)?"nesw-resize":c4._inRange(n,67.5,112.5)?"ew-resize":c4._inRange(n,112.5,157.5)?"nwse-resize":c4._inRange(n,157.5,202.5)?"ns-resize":c4._inRange(n,202.5,247.5)?"nesw-resize":c4._inRange(n,247.5,292.5)?"ew-resize":c4._inRange(n,292.5,337.5)?"nwse-resize":(c4.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,n);t.getStage().content&&(t.getStage().content.style.cursor=r),this._cursorChange=!0})),t.on("mouseout",(()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1})),this.add(t)}_createBack(){var e=new z6({name:"back",width:0,height:0,draggable:!0,sceneFunc(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*c4._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:(e,t)=>{if(this.shouldOverdrawWholeArea()){var n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",(e=>{e.cancelBubble=!0})),e.on("dragmove",(e=>{e.cancelBubble=!0})),e.on("dragend",(e=>{e.cancelBubble=!0})),this.on("dragmove",(e=>{this.update()}))}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,o=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/o),this.cos=Math.abs(n/o),"undefined"!=typeof window&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var i=e.target.getAbsolutePosition(),a=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-i.x,y:a.y-i.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((t=>{t._fire("transformstart",{evt:e.evt,target:t})}))}_handleMouseMove(e){var t,n,r,o=this.findOne("."+this._movingAnchorName),i=o.getStage();i.setPointersPositions(e);const a=i.getPointerPosition();let s={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const l=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,e)),o.setAbsolutePosition(s);const c=o.getAbsolutePosition();if(l.x!==c.x||l.y!==c.y)if("rotater"!==this._movingAnchorName){var u=this.keepRatio()||e.shiftKey,d=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(u){var h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(h.y-o.y(),2));var f=this.findOne(".top-left").x()>h.x?-1:1,p=this.findOne(".top-left").y()>h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-left").x(h.x-t),this.findOne(".top-left").y(h.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(o.y());else if("top-right"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(o.x()-h.x,2)+Math.pow(h.y-o.y(),2));f=this.findOne(".top-right").x()h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-right").x(h.x+t),this.findOne(".top-right").y(h.y-n)}var g=o.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(o.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(o.x());else if("bottom-left"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(o.y()-h.y,2));f=h.x{t._fire("transformend",{evt:e,target:t})})),this._movingAnchorName=null}}_fitNodesInto(e,t){var n=this._getNodeRect();if(c4._inRange(e.width,2*-this.padding()-1,1))return void this.update();if(c4._inRange(e.height,2*-this.padding()-1,1))return void this.update();const r=this.flipEnabled();var o=new t4;if(o.rotate(J3.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const t=o.point({x:2*-this.padding(),y:0});if(e.x+=t.x,e.y+=t.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,!r)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const t=o.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=2*this.padding(),!r)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const t=o.point({x:0,y:2*-this.padding()});if(e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const t=o.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}if(this.boundBoxFunc()){const t=this.boundBoxFunc()(n,e);t?e=t:c4.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const i=1e7,a=new t4;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/i,n.height/i);const s=new t4;s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.width/i,e.height/i);const l=s.multiply(a.invert());this._nodes.forEach((e=>{var n;const r=e.getParent().getAbsoluteTransform(),o=e.getTransform().copy();o.translate(e.offsetX(),e.offsetY());const i=new t4;i.multiply(r.copy().invert()).multiply(l).multiply(r).multiply(o);const a=i.decompose();e.setAttrs(a),this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(n=e.getLayer())||void 0===n||n.batchDraw()})),this.rotation(c4._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e,t=this._getNodeRect();this.rotation(c4._getRotation(t.rotation));var n=t.width,r=t.height,o=this.enabledAnchors(),i=this.resizeEnabled(),a=this.padding(),s=this.anchorSize();this.find("._anchor").forEach((e=>{e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+a,offsetY:s/2+a,visible:i&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:s/2+a,visible:i&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:s/2-a,offsetY:s/2+a,visible:i&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:s/2+a,visible:i&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:s/2-a,visible:i&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:s/2+a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:s/2-a,visible:i&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:s/2-a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*c4._sign(r)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),W6.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return $4.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}q7.prototype.className="Transformer",e4(q7),x4.addGetterSetter(q7,"enabledAnchors",V7,(function(e){return e instanceof Array||c4.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===V7.indexOf(e)&&c4.warn("Unknown anchor name: "+e+". Available names are: "+V7.join(", "))})),e||[]})),x4.addGetterSetter(q7,"flipEnabled",!0,v4()),x4.addGetterSetter(q7,"resizeEnabled",!0),x4.addGetterSetter(q7,"anchorSize",10,h4()),x4.addGetterSetter(q7,"rotateEnabled",!0),x4.addGetterSetter(q7,"rotationSnaps",[]),x4.addGetterSetter(q7,"rotateAnchorOffset",50,h4()),x4.addGetterSetter(q7,"rotationSnapTolerance",5,h4()),x4.addGetterSetter(q7,"borderEnabled",!0),x4.addGetterSetter(q7,"anchorStroke","rgb(0, 161, 255)"),x4.addGetterSetter(q7,"anchorStrokeWidth",1,h4()),x4.addGetterSetter(q7,"anchorFill","white"),x4.addGetterSetter(q7,"anchorCornerRadius",0,h4()),x4.addGetterSetter(q7,"borderStroke","rgb(0, 161, 255)"),x4.addGetterSetter(q7,"borderStrokeWidth",1,h4()),x4.addGetterSetter(q7,"borderDash"),x4.addGetterSetter(q7,"keepRatio",!0),x4.addGetterSetter(q7,"centeredScaling",!1),x4.addGetterSetter(q7,"ignoreStroke",!1),x4.addGetterSetter(q7,"padding",0,h4()),x4.addGetterSetter(q7,"node"),x4.addGetterSetter(q7,"nodes"),x4.addGetterSetter(q7,"boundBoxFunc"),x4.addGetterSetter(q7,"anchorDragBoundFunc"),x4.addGetterSetter(q7,"shouldOverdrawWholeArea",!1),x4.addGetterSetter(q7,"useSingleNodeRotation",!0),x4.backCompat(q7,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Z7 extends z6{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,J3.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}function Y7(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}Z7.prototype.className="Wedge",Z7.prototype._centroid=!0,Z7.prototype._attrsAffectingSize=["radius"],e4(Z7),x4.addGetterSetter(Z7,"radius",0,h4()),x4.addGetterSetter(Z7,"angle",0,h4()),x4.addGetterSetter(Z7,"clockwise",!1),x4.backCompat(Z7,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var X7=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],K7=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];x4.addGetterSetter($4,"blurRadius",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"brightness",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"contrast",0,h4(),x4.afterSetFilter);function Q7(e,t,n,r,o){var i=n-t,a=o-r;return 0===i?r+a/2:0===a?r:a*((e-t)/i)+r}x4.addGetterSetter($4,"embossStrength",.5,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"embossWhiteLevel",.5,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"embossDirection","top-left",null,x4.afterSetFilter),x4.addGetterSetter($4,"embossBlend",!1,null,x4.afterSetFilter);x4.addGetterSetter($4,"enhance",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"hue",0,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"saturation",0,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"luminance",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"hue",0,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"saturation",0,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"value",0,h4(),x4.afterSetFilter);function J7(e,t,n){var r=4*(n*e.width+t),o=[];return o.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),o}function e9(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}x4.addGetterSetter($4,"kaleidoscopePower",2,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"kaleidoscopeAngle",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"threshold",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"noise",.2,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"pixelSize",8,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"levels",.5,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),x4.addGetterSetter($4,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),x4.addGetterSetter($4,"blue",0,d4,x4.afterSetFilter);x4.addGetterSetter($4,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),x4.addGetterSetter($4,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),x4.addGetterSetter($4,"blue",0,d4,x4.afterSetFilter),x4.addGetterSetter($4,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}));x4.addGetterSetter($4,"threshold",.5,h4(),x4.afterSetFilter);const t9=K6.Util._assign(K6,{Arc:Q6,Arrow:r7,Circle:o7,Ellipse:i7,Image:a7,Label:f7,Tag:p7,Line:t7,Path:n7,Rect:g7,RegularPolygon:m7,Ring:b7,Sprite:y7,Star:x7,Text:I7,TextPath:z7,Transformer:q7,Wedge:Z7,Filters:{Blur:function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,o,i,a,s,l,c,u,d,h,f,p,g,m,v,b,y,x,w,S,k,C,_,E=e.data,L=e.width,P=e.height,M=t+t+1,A=L-1,T=P-1,O=t+1,I=O*(O+1)/2,R=new Y7,N=null,D=R,z=null,B=null,F=X7[t],j=K7[t];for(o=1;o>j,0!==C?(C=255/C,E[s]=(c*F>>j)*C,E[s+1]=(u*F>>j)*C,E[s+2]=(d*F>>j)*C):E[s]=E[s+1]=E[s+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=l+((i=n+t+1)>j,C>0?(C=255/C,E[i]=(c*F>>j)*C,E[i+1]=(u*F>>j)*C,E[i+2]=(d*F>>j)*C):E[i]=E[i+1]=E[i+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=n+((i=r+O)255?255:i,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r[t]=i,r[t+1]=a,r[t+2]=s},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),o=this.embossBlend(),i=0,a=0,s=e.data,l=e.width,c=e.height,u=4*l,d=c;switch(r){case"top-left":i=-1,a=-1;break;case"top":i=-1,a=0;break;case"top-right":i=-1,a=1;break;case"right":i=0,a=1;break;case"bottom-right":i=1,a=1;break;case"bottom":i=1,a=0;break;case"bottom-left":i=1,a=-1;break;case"left":i=0,a=-1;break;default:c4.error("Unknown emboss direction: "+r)}do{var h=(d-1)*u,f=i;d+f<1&&(f=0),d+f>c&&(f=0);var p=(d-1+f)*l*4,g=l;do{var m=h+4*(g-1),v=a;g+v<1&&(v=0),g+v>l&&(v=0);var b=p+4*(g-1+v),y=s[m]-s[b],x=s[m+1]-s[b+1],w=s[m+2]-s[b+2],S=y,k=S>0?S:-S;if((x>0?x:-x)>k&&(S=x),(w>0?w:-w)>k&&(S=w),S*=t,o){var C=s[m]+S,_=s[m+1]+S,E=s[m+2]+S;s[m]=C>255?255:C<0?0:C,s[m+1]=_>255?255:_<0?0:_,s[m+2]=E>255?255:E<0?0:E}else{var L=n-S;L<0?L=0:L>255&&(L=255),s[m]=s[m+1]=s[m+2]=L}}while(--g)}while(--d)},Enhance:function(e){var t,n,r,o,i=e.data,a=i.length,s=i[0],l=s,c=i[1],u=c,d=i[2],h=d,f=this.enhance();if(0!==f){for(o=0;ol&&(l=t),(n=i[o+1])u&&(u=n),(r=i[o+2])h&&(h=r);var p,g,m,v,b,y,x,w,S;for(l===s&&(l=255,s=0),u===c&&(u=255,c=0),h===d&&(h=255,d=0),f>0?(g=l+f*(255-l),m=s-f*(s-0),b=u+f*(255-u),y=c-f*(c-0),w=h+f*(255-h),S=d-f*(d-0)):(g=l+f*(l-(p=.5*(l+s))),m=s+f*(s-p),b=u+f*(u-(v=.5*(u+c))),y=c+f*(c-v),w=h+f*(h-(x=.5*(h+d))),S=d+f*(d-x)),o=0;ov?a:v;var b,y,x,w,S=u,k=c,C=360/k*Math.PI/180;for(y=0;yu&&(y=b,x=0,w=-1),n=0;ny?l:y;var x,w,S,k=h,C=d,_=n.polarRotation||0;for(o=0;o=0&&f=0&&p=0&&f=0&&p=1020?255:0}return a}(t,e.width,e.height),t=function(e,t,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],o=Math.round(Math.sqrt(r.length)),i=Math.floor(o/2),a=[],s=0;s=0&&f=0&&p=m))for(n=u;n=v||(o+=x[(r=4*(m*n+t))+0],i+=x[r+1],a+=x[r+2],s+=x[r+3],p+=1);for(o/=p,i/=p,a/=p,s/=p,t=l;t=m))for(n=u;n=v||(x[(r=4*(m*n+t))+0]=o,x[r+1]=i,x[r+2]=a,x[r+3]=s)}},Posterize:function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,o=r.length,i=255/n;for(t=0;t127&&(l=255-l),c>127&&(c=255-c),u>127&&(u=255-u),t[s]=l,t[s+1]=c,t[s+2]=u}while(--a)}while(--o)},Threshold:function(e){var t,n=255*this.threshold(),r=e.data,o=r.length;for(t=0;t--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{rt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nt(e):""}var it=Object.prototype.hasOwnProperty,at=[],st=-1;function lt(e){return{current:e}}function ct(e){0>st||(e.current=at[st],at[st]=null,st--)}function ut(e,t){st++,at[st]=e.current,e.current=t}var dt={},ht=lt(dt),ft=lt(!1),pt=dt;function gt(e,t){var n=e.type.contextTypes;if(!n)return dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function mt(e){return null!=(e=e.childContextTypes)}function vt(){ct(ft),ct(ht)}function bt(e,t,n){if(ht.current!==dt)throw Error(a(168));ut(ht,t),ut(ft,n)}function yt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(a(108,C(e)||"Unknown",i));return o({},n,r)}function xt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dt,pt=ht.current,ut(ht,e),ut(ft,ft.current),!0}function wt(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=yt(e,t,pt),r.__reactInternalMemoizedMergedChildContext=e,ct(ft),ct(ht),ut(ht,e)):ct(ft),ut(ft,n)}var St=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(kt(e)/Ct|0)|0},kt=Math.log,Ct=Math.LN2;var _t=64,Et=4194304;function Lt(e){switch(e&-e){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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=Lt(s):0!==(i&=a)&&(r=Lt(i))}else 0!==(a=n&~o)?r=Lt(a):0!==i&&(r=Lt(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function It(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-St(t)]=n}function Rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-St(n),o=1<>=a,o-=a,cn=1<<32-St(t)+o|n<h?(f=d,d=null):f=d.sibling;var p=m(o,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(o,d),a=i(p,a,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(o,d),vn&&dn(o,h),c;if(null===d){for(;hf?(p=h,h=null):p=h.sibling;var y=m(o,h,b.value,c);if(null===y){null===h&&(h=p);break}e&&h&&null===y.alternate&&t(o,h),s=i(y,s,f),null===d?u=y:d.sibling=y,d=y,h=p}if(b.done)return n(o,h),vn&&dn(o,f),u;if(null===h){for(;!b.done;f++,b=l.next())null!==(b=g(o,b.value,c))&&(s=i(b,s,f),null===d?u=b:d.sibling=b,d=b);return vn&&dn(o,f),u}for(h=r(o,h);!b.done;f++,b=l.next())null!==(b=v(h,o,f,b.value,c))&&(e&&null!==b.alternate&&h.delete(null===b.key?f:b.key),s=i(b,s,f),null===d?u=b:d.sibling=b,d=b);return e&&h.forEach((function(e){return t(o,e)})),vn&&dn(o,f),u}return function e(r,i,a,d){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:e:{for(var h=a.key,f=i;null!==f;){if(f.key===h){if((h=a.type)===u){if(7===f.tag){n(r,f.sibling),(i=o(f,a.props.children)).return=r,r=i;break e}}else if(f.elementType===h||"object"==typeof h&&null!==h&&h.$$typeof===y&&dr(h)===f.type){n(r,f.sibling),(i=o(f,a.props)).ref=cr(r,f,a),i.return=r,r=i;break e}n(r,f);break}t(r,f),f=f.sibling}a.type===u?((i=fs(a.props.children,r.mode,d,a.key)).return=r,r=i):((d=hs(a.type,a.key,a.props,null,r.mode,d)).ref=cr(r,i,a),d.return=r,r=d)}return s(r);case c:e:{for(f=a.key;null!==i;){if(i.key===f){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=ms(a,r.mode,d)).return=r,r=i}return s(r);case y:return e(r,i,(f=a._init)(a._payload),d)}if(O(a))return b(r,i,a,d);if(S(a))return x(r,i,a,d);ur(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=gs(a,r.mode,d)).return=r,r=i),s(r)):n(r,i)}}var fr=hr(!0),pr=hr(!1),gr={},mr=lt(gr),vr=lt(gr),br=lt(gr);function yr(e){if(e===gr)throw Error(a(174));return e}function xr(e,t){ut(br,t),ut(vr,e),ut(mr,gr),e=R(t),ct(mr),ut(mr,e)}function wr(){ct(mr),ct(vr),ct(br)}function Sr(e){var t=yr(br.current),n=yr(mr.current);n!==(t=N(n,e.type,t))&&(ut(vr,e),ut(mr,t))}function kr(e){vr.current===e&&(ct(mr),ct(vr))}var Cr=lt(0);function _r(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ze(n)||Be(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Er=[];function Lr(){for(var e=0;en?n:4,e(!0);var r=Mr.transition;Mr.transition={};try{e(!1),t()}finally{Nt=n,Mr.transition=r}}function vo(){return Ur().memoizedState}function bo(e,t,n){var r=Ra(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xo(e))wo(t,n);else if(null!==(n=Gn(e,t,n,r))){Na(n,e,r,Ia()),So(n,t,r)}}function yo(e,t,n){var r=Ra(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xo(e))wo(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Zt(s,a)){var l=t.interleaved;return null===l?(o.next=o,Vn(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(SV){}null!==(n=Gn(e,t,o,r))&&(Na(n,e,r,o=Ia()),So(n,t,r))}}function xo(e){var t=e.alternate;return e===Tr||null!==t&&t===Tr}function wo(e,t){Nr=Rr=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function So(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Rt(e,n)}}var ko={readContext:Wn,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},Co={readContext:Wn,useCallback:function(e,t){return Wr().memoizedState=[e,void 0===t?null:t],e},useContext:Wn,useEffect:io,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ro(4194308,4,co.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=Wr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wr();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=bo.bind(null,Tr,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Wr().memoizedState=e},useState:eo,useDebugValue:ho,useDeferredValue:function(e){return Wr().memoizedState=e},useTransition:function(){var e=eo(!1),t=e[0];return e=mo.bind(null,e[1]),Wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Tr,o=Wr();if(vn){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===aa)throw Error(a(349));0!=(30&Ar)||Yr(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,io(Kr.bind(null,r,i,e),[e]),r.flags|=2048,to(9,Xr.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Wr(),t=aa.identifierPrefix;if(vn){var n=un;t=":"+t+"R"+(n=(cn&~(1<<32-St(cn)-1)).toString(32)+n),0<(n=Dr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=zr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_o={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Gr,useRef:no,useState:function(){return Gr(Vr)},useDebugValue:ho,useDeferredValue:function(e){return go(Ur(),Or.memoizedState,e)},useTransition:function(){return[Gr(Vr)[0],Ur().memoizedState]},useMutableSource:qr,useSyncExternalStore:Zr,useId:vo,unstable_isNewReconciler:!1},Eo={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:$r,useRef:no,useState:function(){return $r(Vr)},useDebugValue:ho,useDeferredValue:function(e){var t=Ur();return null===Or?t.memoizedState=e:go(t,Or.memoizedState,e)},useTransition:function(){return[$r(Vr)[0],Ur().memoizedState]},useMutableSource:qr,useSyncExternalStore:Zr,useId:vo,unstable_isNewReconciler:!1};function Lo(e,t){try{var n="",r=t;do{n+=Tn(r),r=r.return}while(r);var o=n}catch(X8){o="\nError generating stack: "+X8.message+"\n"+X8.stack}return{value:e,source:t,stack:o,digest:null}}function Po(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Mo(e,t){try{console.error(t.value)}catch(q8){setTimeout((function(){throw q8}))}}var Ao="function"==typeof WeakMap?WeakMap:Map;function To(e,t,n){(n=Xn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ka||(ka=!0,Ca=r),Mo(0,t)},n}function Oo(e,t,n){(n=Xn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Mo(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){Mo(0,t),"function"!=typeof r&&(null===_a?_a=new Set([this]):_a.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Io(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Ao;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=rs.bind(null,e,t,n),t.then(e,e))}function Ro(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function No(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Xn(-1,1)).tag=2,Kn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Do=s.ReactCurrentOwner,zo=!1;function Bo(e,t,n,r){t.child=null===e?pr(t,null,n,r):fr(t,e.child,n,r)}function Fo(e,t,n,r,o){n=n.render;var i=t.ref;return Hn(t,o),r=jr(e,t,n,r,i,o),n=Hr(),null===e||zo?(vn&&n&&fn(t),t.flags|=1,Bo(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function jo(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||us(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=hs(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Ho(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:An)(a,r)&&e.ref===t.ref)return li(e,t,o)}return t.flags|=1,(e=ds(i,r)).ref=t.ref,e.return=t,t.child=e}function Ho(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(An(i,r)&&e.ref===t.ref){if(zo=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,li(e,t,o);0!=(131072&e.flags)&&(zo=!0)}}return Vo(e,t,n,r,o)}function Wo(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(ua,ca),ca|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(ua,ca),ca|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,ut(ua,ca),ca|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,ut(ua,ca),ca|=r;return Bo(e,t,o,n),t.child}function Uo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vo(e,t,n,r,o){var i=mt(n)?pt:ht.current;return i=gt(t,i),Hn(t,o),n=jr(e,t,n,r,i,o),r=Hr(),null===e||zo?(vn&&r&&fn(t),t.flags|=1,Bo(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Go(e,t,n,r,o){if(mt(n)){var i=!0;xt(t)}else i=!1;if(Hn(t,o),null===t.stateNode)si(e,t),ar(t,n,r),lr(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Wn(c):c=gt(t,c=mt(n)?pt:ht.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&sr(t,a,r,c),qn=!1;var h=t.memoizedState;a.state=h,er(t,r,a,o),l=t.memoizedState,s!==r||h!==l||ft.current||qn?("function"==typeof u&&(rr(t,n,u,r),l=t.memoizedState),(s=qn||ir(t,n,s,r,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Yn(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:On(t.type,s),a.props=c,d=t.pendingProps,h=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=Wn(l):l=gt(t,l=mt(n)?pt:ht.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||h!==l)&&sr(t,a,r,l),qn=!1,h=t.memoizedState,a.state=h,er(t,r,a,o);var p=t.memoizedState;s!==d||h!==p||ft.current||qn?("function"==typeof f&&(rr(t,n,f,r),p=t.memoizedState),(c=qn||ir(t,n,c,r,h,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return $o(e,t,n,r,i,o)}function $o(e,t,n,r,o,i){Uo(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&wt(t,n,!1),li(e,t,i);r=t.stateNode,Do.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=fr(t,e.child,null,i),t.child=fr(t,null,s,i)):Bo(e,t,s,i),t.memoizedState=r.state,o&&wt(t,n,!0),t.child}function qo(e){var t=e.stateNode;t.pendingContext?bt(0,t.pendingContext,t.pendingContext!==t.context):t.context&&bt(0,t.context,!1),xr(e,t.containerInfo)}function Zo(e,t,n,r,o){return Ln(),Pn(o),t.flags|=256,Bo(e,t,n,r),t.child}var Yo,Xo,Ko,Qo,Jo={dehydrated:null,treeContext:null,retryLane:0};function ei(e){return{baseLanes:e,cachePool:null,transitions:null}}function ti(e,t,n){var r,o=t.pendingProps,i=Cr.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&i)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),ut(Cr,1&i),null===e)return kn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:Be(e)?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0==(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=ps(l,o,0,null),e=fs(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=ei(n),t.memoizedState=Jo,e):ni(t,l));if(null!==(i=e.memoizedState)&&null!==(r=i.dehydrated))return function(e,t,n,r,o,i,s){if(n)return 256&t.flags?(t.flags&=-257,ri(e,t,s,r=Po(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=ps({mode:"visible",children:r.children},o,0,null),(i=fs(i,o,s,null)).flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,0!=(1&t.mode)&&fr(t,e.child,null,s),t.child.memoizedState=ei(s),t.memoizedState=Jo,i);if(0==(1&t.mode))return ri(e,t,s,null);if(Be(o))return r=Fe(o).digest,i=Error(a(419)),r=Po(i,r,void 0),ri(e,t,s,r);if(n=0!=(s&e.childLanes),zo||n){if(null!==(r=aa)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(r.suspendedLanes|s))?0:o)&&o!==i.retryLane&&(i.retryLane=o,$n(e,o),Na(r,e,o,-1))}return qa(),ri(e,t,s,r=Po(Error(a(421))))}return ze(o)?(t.flags|=128,t.child=e.child,t=is.bind(null,e),je(o,t),null):(e=i.treeContext,K&&(mn=Ve(o),gn=t,vn=!0,yn=null,bn=!1,null!==e&&(an[sn++]=cn,an[sn++]=un,an[sn++]=ln,cn=e.id,un=e.overflow,ln=t)),t=ni(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,i,n);if(s){s=o.fallback,l=t.mode,r=(i=e.child).sibling;var c={mode:"hidden",children:o.children};return 0==(1&l)&&t.child!==i?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=ds(i,c)).subtreeFlags=14680064&i.subtreeFlags,null!==r?s=ds(r,s):(s=fs(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?ei(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Jo,o}return e=(s=e.child).sibling,o=ds(s,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function ni(e,t){return(t=ps({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ri(e,t,n,r){return null!==r&&Pn(r),fr(t,e.child,null,n),(e=ni(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function oi(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),jn(e.return,t,n)}function ii(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ai(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Bo(e,t,r.children,n),0!=(2&(r=Cr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&oi(e,n,t);else if(19===e.tag)oi(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ut(Cr,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===_r(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ii(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===_r(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ii(t,!0,n,null,i);break;case"together":ii(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function si(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function li(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),fa|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=ds(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ds(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ci(e){e.flags|=4}function ui(e,t){if(null!==e&&e.child===t.child)return!0;if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Y)Yo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)F(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xo=function(){},Ko=function(e,t,n,r,o){if((e=e.memoizedProps)!==r){var i=t.stateNode,a=yr(mr.current);n=H(i,n,e,r,o,a),(t.updateQueue=n)&&ci(t)}},Qo=function(e,t,n,r){n!==r&&ci(t)};else if(X){Yo=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Oe(i,o.type,o.memoizedProps,o)),F(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),F(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),Yo(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};var di=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Oe(i,o.type,o.memoizedProps,o)),Me(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),Me(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),di(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};Xo=function(e,t){var n=t.stateNode;if(!ui(e,t)){e=n.containerInfo;var r=Pe(e);di(r,t,!1,!1),n.pendingChildren=r,ci(t),Ae(e,r)}},Ko=function(e,t,n,r,o){var i=e.stateNode,a=e.memoizedProps;if((e=ui(e,t))&&a===r)t.stateNode=i;else{var s=t.stateNode,l=yr(mr.current),c=null;a!==r&&(c=H(s,n,a,r,o,l)),e&&null===c?t.stateNode=i:(i=Le(i,c,n,a,r,t,e,s),j(i,n,r,o,l)&&ci(t),t.stateNode=i,e?ci(t):Yo(i,t,!1,!1))}},Qo=function(e,t,n,r){n!==r?(e=yr(br.current),n=yr(mr.current),t.stateNode=U(r,e,n,t),ci(t)):t.stateNode=e.stateNode}}else Xo=function(){},Ko=function(){},Qo=function(){};function hi(e,t){if(!vn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fi(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pi(e,t,n){var r=t.pendingProps;switch(pn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fi(t),null;case 1:case 17:return mt(t.type)&&vt(),fi(t),null;case 3:return n=t.stateNode,wr(),ct(ft),ct(ht),Lr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(_n(t)?ci(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==yn&&(Fa(yn),yn=null))),Xo(e,t),fi(t),null;case 5:kr(t),n=yr(br.current);var o=t.type;if(null!==e&&null!=t.stateNode)Ko(e,t,o,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(a(166));return fi(t),null}if(e=yr(mr.current),_n(t)){if(!K)throw Error(a(175));e=Ge(t.stateNode,t.type,t.memoizedProps,n,e,t,!bn),t.updateQueue=e,null!==e&&ci(t)}else{var i=B(o,r,n,e,t);Yo(i,t,!1,!1),t.stateNode=i,j(i,o,r,n,e)&&ci(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return fi(t),null;case 6:if(e&&null!=t.stateNode)Qo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(a(166));if(e=yr(br.current),n=yr(mr.current),_n(t)){if(!K)throw Error(a(176));if(e=t.stateNode,n=t.memoizedProps,(r=$e(e,n,t,!bn))&&null!==(o=gn))switch(o.tag){case 3:et(o.stateNode.containerInfo,e,n,0!=(1&o.mode));break;case 5:tt(o.type,o.memoizedProps,o.stateNode,e,n,0!=(1&o.mode))}r&&ci(t)}else t.stateNode=U(r,e,n,t)}return fi(t),null;case 13:if(ct(Cr),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(vn&&null!==mn&&0!=(1&t.mode)&&0==(128&t.flags))En(),Ln(),t.flags|=98560,o=!1;else if(o=_n(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(a(318));if(!K)throw Error(a(344));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(a(317));qe(o,t)}else Ln(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;fi(t),o=!1}else null!==yn&&(Fa(yn),yn=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((n=null!==r)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&Cr.current)?0===da&&(da=3):qa())),null!==t.updateQueue&&(t.flags|=4),fi(t),null);case 4:return wr(),Xo(e,t),null===e&&J(t.stateNode.containerInfo),fi(t),null;case 10:return Fn(t.type._context),fi(t),null;case 19:if(ct(Cr),null===(o=t.memoizedState))return fi(t),null;if(r=0!=(128&t.flags),null===(i=o.rendering))if(r)hi(o,!1);else{if(0!==da||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(i=_r(e))){for(t.flags|=128,hi(o,!1),null!==(e=i.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;null!==n;)o=e,(r=n).flags&=14680066,null===(i=r.alternate)?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=i.childLanes,r.lanes=i.lanes,r.child=i.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=i.memoizedProps,r.memoizedState=i.memoizedState,r.updateQueue=i.updateQueue,r.type=i.type,o=i.dependencies,r.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),n=n.sibling;return ut(Cr,1&Cr.current|2),t.child}e=e.sibling}null!==o.tail&&Ht()>ya&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=_r(i))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),hi(o,!0),null===o.tail&&"hidden"===o.tailMode&&!i.alternate&&!vn)return fi(t),null}else 2*Ht()-o.renderingStartTime>ya&&1073741824!==n&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(null!==(e=o.last)?e.sibling=i:t.child=i,o.last=i)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ht(),t.sibling=null,e=Cr.current,ut(Cr,r?1&e|2:1&e),t):(fi(t),null);case 22:case 23:return Ua(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&ca)&&(fi(t),Y&&6&t.subtreeFlags&&(t.flags|=8192)):fi(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function gi(e,t){switch(pn(t),t.tag){case 1:return mt(t.type)&&vt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return wr(),ct(ft),ct(ht),Lr(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return kr(t),null;case 13:if(ct(Cr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));Ln()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ct(Cr),null;case 4:return wr(),null;case 10:return Fn(t.type._context),null;case 22:case 23:return Ua(),null;default:return null}}var mi=!1,vi=!1,bi="function"==typeof WeakSet?WeakSet:Set,yi=null;function xi(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(Q8){ns(e,t,Q8)}else n.current=null}function wi(e,t,n){try{n()}catch(Q8){ns(e,t,Q8)}}var Si=!1;function ki(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&wi(t,n,i)}o=o.next}while(o!==r)}}function Ci(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function _i(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=I(n);else e=n;"function"==typeof t?t(e):t.current=e}}function Ei(e){var t=e.alternate;null!==t&&(e.alternate=null,Ei(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&te(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Li(e){return 5===e.tag||3===e.tag||4===e.tag}function Pi(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Li(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Mi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?be(n,e,t):fe(n,e);else if(4!==r&&null!==(e=e.child))for(Mi(e,t,n),e=e.sibling;null!==e;)Mi(e,t,n),e=e.sibling}function Ai(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):he(n,e);else if(4!==r&&null!==(e=e.child))for(Ai(e,t,n),e=e.sibling;null!==e;)Ai(e,t,n),e=e.sibling}var Ti=null,Oi=!1;function Ii(e,t,n){for(n=n.child;null!==n;)Ri(e,t,n),n=n.sibling}function Ri(e,t,n){if(qt&&"function"==typeof qt.onCommitFiberUnmount)try{qt.onCommitFiberUnmount($t,n)}catch(J8){}switch(n.tag){case 5:vi||xi(n,t);case 6:if(Y){var r=Ti,o=Oi;Ti=null,Ii(e,t,n),Oi=o,null!==(Ti=r)&&(Oi?xe(Ti,n.stateNode):ye(Ti,n.stateNode))}else Ii(e,t,n);break;case 18:Y&&null!==Ti&&(Oi?Qe(Ti,n.stateNode):Ke(Ti,n.stateNode));break;case 4:Y?(r=Ti,o=Oi,Ti=n.stateNode.containerInfo,Oi=!0,Ii(e,t,n),Ti=r,Oi=o):(X&&(r=n.stateNode.containerInfo,o=Pe(r),Te(r,o)),Ii(e,t,n));break;case 0:case 11:case 14:case 15:if(!vi&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&wi(n,t,a),o=o.next}while(o!==r)}Ii(e,t,n);break;case 1:if(!vi&&(xi(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(J8){ns(n,t,J8)}Ii(e,t,n);break;case 21:Ii(e,t,n);break;case 22:1&n.mode?(vi=(r=vi)||null!==n.memoizedState,Ii(e,t,n),vi=r):Ii(e,t,n);break;default:Ii(e,t,n)}}function Ni(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new bi),t.forEach((function(t){var r=as.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Di(e,t){var n=t.deletions;if(null!==n)for(var r=0;r";case Gi:return":has("+(Qi(e)||"")+")";case $i:return'[role="'+e.value+'"]';case Zi:return'"'+e.value+'"';case qi:return'[data-testname="'+e.value+'"]';default:throw Error(a(365))}}function Ji(e,t){var n=[];e=[e,0];for(var r=0;ro&&(o=s),r&=~i}if(r=o,10<(r=(120>(r=Ht()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ta(r/1960))-r)){e.timeoutHandle=V(Ja.bind(null,e,va,xa),r);break}Ja(e,va,xa);break;default:throw Error(a(329))}}}return Da(e,Ht()),e.callbackNode===n?za.bind(null,e):null}function Ba(e,t){var n=ma;return e.current.memoizedState.isDehydrated&&(Va(e,t).flags|=256),2!==(e=Za(e,t))&&(t=va,va=n,null!==t&&Fa(t)),e}function Fa(e){null===va?va=e:va.push.apply(va,e)}function ja(e,t){for(t&=~ga,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===La)var r=!1;else{if(e=La,La=null,Pa=0,0!=(6&ia))throw Error(a(331));var o=ia;for(ia|=4,yi=e.current;null!==yi;){var i=yi,s=i.child;if(0!=(16&yi.flags)){var l=i.deletions;if(null!==l){for(var c=0;cHt()-ba?Va(e,0):ga|=n),Da(e,t)}function os(e,t){0===t&&(0==(1&e.mode)?t=1:(t=Et,0==(130023424&(Et<<=1))&&(Et=4194304)));var n=Ia();null!==(e=$n(e,t))&&(It(e,t,n),Da(e,n))}function is(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),os(e,n)}function as(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}null!==r&&r.delete(t),os(e,n)}function ss(e,t){return zt(e,t)}function ls(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cs(e,t,n,r){return new ls(e,t,n,r)}function us(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ds(e,t){var n=e.alternate;return null===n?((n=cs(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hs(e,t,n,r,o,i){var s=2;if(r=e,"function"==typeof e)us(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case u:return fs(n.children,o,i,t);case d:s=8,o|=8;break;case h:return(e=cs(12,n,t,2|o)).elementType=h,e.lanes=i,e;case m:return(e=cs(13,n,t,o)).elementType=m,e.lanes=i,e;case v:return(e=cs(19,n,t,o)).elementType=v,e.lanes=i,e;case x:return ps(n,o,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case f:s=10;break e;case p:s=9;break e;case g:s=11;break e;case b:s=14;break e;case y:s=16,r=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=cs(s,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function fs(e,t,n,r){return(e=cs(7,e,r,t)).lanes=n,e}function ps(e,t,n,r){return(e=cs(22,e,r,t)).elementType=x,e.lanes=n,e.stateNode={isHidden:!1},e}function gs(e,t,n){return(e=cs(6,e,null,t)).lanes=n,e}function ms(e,t,n){return(t=cs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vs(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ot(0),this.expirationTimes=Ot(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ot(0),this.identifierPrefix=r,this.onRecoverableError=o,K&&(this.mutableSourceEagerHydrationData=null)}function bs(e,t,n,r,o,i,a,s,l){return e=new vs(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=cs(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zn(i),e}function ys(e){if(!e)return dt;e:{if(_(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(mt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var n=e.type;if(mt(n))return yt(e,n,t)}return t}function xs(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return null===(e=P(t))?null:e.stateNode}function ws(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=u&&i>=h&&o<=d&&s<=f){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||fs)){h>i&&(c.height+=h-i,c.y=i),fo)){u>r&&(c.width+=u-r,c.x=r),dn&&(n=s)),s ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?I(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:ks,findFiberByHostInstance:e.findFiberByHostInstance||Cs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{$t=t.inject(e),qt=t}catch(q8){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!oe)throw Error(a(363));e=ea(e,t);var o=de(e,n,r).disconnect;return{disconnect:function(){o()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Nt;try{return Nt=e,t()}finally{Nt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var o=t.current,i=Ia(),a=Ra(o);return n=ys(n),null===t.context?t.context=n:t.pendingContext=n,(t=Xn(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Kn(o,t,a))&&(Na(e,o,a,i),Qn(e,o,a)),a},t}; + */!function(e,t){(function(){var n,o="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",s=16,l=32,c=64,u=128,d=256,h=1/0,f=9007199254740991,p=NaN,g=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",l],["partialRight",c],["rearg",d]],v="[object Arguments]",b="[object Array]",y="[object Boolean]",x="[object Date]",w="[object Error]",S="[object Function]",k="[object GeneratorFunction]",C="[object Map]",_="[object Number]",E="[object Object]",L="[object Promise]",P="[object RegExp]",M="[object Set]",A="[object String]",T="[object Symbol]",O="[object WeakMap]",I="[object ArrayBuffer]",R="[object DataView]",N="[object Float32Array]",D="[object Float64Array]",z="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",j="[object Uint8Array]",H="[object Uint8ClampedArray]",W="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,Y=RegExp(q.source),X=RegExp(Z.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(re.source),ie=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,ke="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Le="A-Z\\xc0-\\xd6\\xd8-\\xde",Pe="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="['’]",Te="["+ke+"]",Oe="["+Me+"]",Ie="["+Ce+"]",Re="\\d+",Ne="["+_e+"]",De="["+Ee+"]",ze="[^"+ke+Me+Re+_e+Ee+Le+"]",Be="\\ud83c[\\udffb-\\udfff]",Fe="[^"+ke+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Le+"]",Ue="\\u200d",Ve="(?:"+De+"|"+ze+")",Ge="(?:"+We+"|"+ze+")",$e="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ze="(?:"+Ie+"|"+Be+")"+"?",Ye="["+Pe+"]?",Xe=Ye+Ze+("(?:"+Ue+"(?:"+[Fe,je,He].join("|")+")"+Ye+Ze+")*"),Ke="(?:"+[Ne,je,He].join("|")+")"+Xe,Qe="(?:"+[Fe+Ie+"?",Ie,je,He,Te].join("|")+")",Je=RegExp(Ae,"g"),et=RegExp(Ie,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Xe,"g"),nt=RegExp([We+"?"+De+"+"+$e+"(?="+[Oe,We,"$"].join("|")+")",Ge+"+"+qe+"(?="+[Oe,We+Ve,"$"].join("|")+")",We+"?"+Ve+"+"+$e,We+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,Ke].join("|"),"g"),rt=RegExp("["+Ue+ke+Ce+Pe+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[N]=st[D]=st[z]=st[B]=st[F]=st[j]=st[H]=st[W]=st[U]=!0,st[v]=st[b]=st[I]=st[y]=st[R]=st[x]=st[w]=st[S]=st[C]=st[_]=st[E]=st[P]=st[M]=st[A]=st[O]=!1;var lt={};lt[v]=lt[b]=lt[I]=lt[R]=lt[y]=lt[x]=lt[N]=lt[D]=lt[z]=lt[B]=lt[F]=lt[C]=lt[_]=lt[E]=lt[P]=lt[M]=lt[A]=lt[T]=lt[j]=lt[H]=lt[W]=lt[U]=!0,lt[w]=lt[S]=lt[O]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,dt=parseInt,ht="object"==typeof r&&r&&r.Object===Object&&r,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||ft||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,vt=mt&&mt.exports===gt,bt=vt&&ht.process,yt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(vV){}}(),xt=yt&&yt.isArrayBuffer,wt=yt&&yt.isDate,St=yt&&yt.isMap,kt=yt&&yt.isRegExp,Ct=yt&&yt.isSet,_t=yt&&yt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Lt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o-1}function It(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function nn(e,t){for(var n=e.length;n--&&Wt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var on=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),an=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ct[e]}function ln(e){return rt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n",""":'"',"'":"'"});var bn=function e(t){var r,ae=(t=null==t?pt:bn.defaults(pt.Object(),t,bn.pick(pt,it))).Array,ke=t.Date,Ce=t.Error,_e=t.Function,Ee=t.Math,Le=t.Object,Pe=t.RegExp,Me=t.String,Ae=t.TypeError,Te=ae.prototype,Oe=_e.prototype,Ie=Le.prototype,Re=t["__core-js_shared__"],Ne=Oe.toString,De=Ie.hasOwnProperty,ze=0,Be=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Fe=Ie.toString,je=Ne.call(Le),He=pt._,We=Pe("^"+Ne.call(De).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=vt?t.Buffer:n,Ve=t.Symbol,Ge=t.Uint8Array,$e=Ue?Ue.allocUnsafe:n,qe=un(Le.getPrototypeOf,Le),Ze=Le.create,Ye=Ie.propertyIsEnumerable,Xe=Te.splice,Ke=Ve?Ve.isConcatSpreadable:n,Qe=Ve?Ve.iterator:n,tt=Ve?Ve.toStringTag:n,rt=function(){try{var e=pi(Le,"defineProperty");return e({},"",{}),e}catch(vV){}}(),ct=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=ke&&ke.now!==pt.Date.now&&ke.now,ft=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=Ee.ceil,mt=Ee.floor,bt=Le.getOwnPropertySymbols,yt=Ue?Ue.isBuffer:n,Ft=t.isFinite,qt=Te.join,yn=un(Le.keys,Le),xn=Ee.max,wn=Ee.min,Sn=ke.now,kn=t.parseInt,Cn=Ee.random,_n=Te.reverse,En=pi(t,"DataView"),Ln=pi(t,"Map"),Pn=pi(t,"Promise"),Mn=pi(t,"Set"),An=pi(t,"WeakMap"),Tn=pi(Le,"create"),On=An&&new An,In={},Rn=Hi(En),Nn=Hi(Ln),Dn=Hi(Pn),zn=Hi(Mn),Bn=Hi(An),Fn=Ve?Ve.prototype:n,jn=Fn?Fn.valueOf:n,Hn=Fn?Fn.toString:n;function Wn(e){if(os(e)&&!qa(e)&&!(e instanceof $n)){if(e instanceof Gn)return e;if(De.call(e,"__wrapped__"))return Wi(e)}return new Gn(e)}var Un=function(){function e(){}return function(t){if(!rs(t))return{};if(Ze)return Ze(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vn(){}function Gn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function $n(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,r,o,i,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=i?r(e,o,i,a):r(e)),s!==n)return s;if(!rs(e))return e;var d=qa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Oo(e,s)}else{var h=vi(e),f=h==S||h==k;if(Ka(e))return Eo(e,l);if(h==E||h==v||f&&!i){if(s=c||f?{}:yi(e),!l)return c?function(e,t){return Io(e,mi(e),t)}(e,function(e,t){return e&&Io(t,Ns(t),e)}(s,e)):function(e,t){return Io(e,gi(e),t)}(e,ar(s,e))}else{if(!lt[h])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case I:return Lo(e);case y:case x:return new r(+e);case R:return function(e,t){var n=t?Lo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case D:case z:case B:case F:case j:case H:case W:case U:return Po(e,n);case C:return new r;case _:case A:return new r(e);case P:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new r;case T:return o=e,jn?Le(jn.call(o)):{}}var o}(e,h,l)}}a||(a=new Kn);var p=a.get(e);if(p)return p;a.set(e,s),cs(e)?e.forEach((function(n){s.add(ur(n,t,r,n,e,a))})):is(e)&&e.forEach((function(n,o){s.set(o,ur(n,t,r,o,e,a))}));var g=d?n:(u?c?si:ai:c?Ns:Rs)(e);return Pt(g||e,(function(n,o){g&&(n=e[o=n]),rr(s,o,ur(n,t,r,o,e,a))})),s}function dr(e,t,r){var o=r.length;if(null==e)return!o;for(e=Le(e);o--;){var i=r[o],a=t[i],s=e[i];if(s===n&&!(i in e)||!a(s))return!1}return!0}function hr(e,t,r){if("function"!=typeof e)throw new Ae(o);return Ri((function(){e.apply(n,r)}),t)}function fr(e,t,n,r){var o=-1,i=Ot,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Rt(t,Qt(n))),r?(i=It,a=!1):t.length>=200&&(i=en,a=!1,t=new Xn(t));e:for(;++o-1},Zn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Yn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Ln||Zn),string:new qn}},Yn.prototype.delete=function(e){var t=hi(this,e).delete(e);return this.size-=t?1:0,t},Yn.prototype.get=function(e){return hi(this,e).get(e)},Yn.prototype.has=function(e){return hi(this,e).has(e)},Yn.prototype.set=function(e,t){var n=hi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,i),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new Zn,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Zn){var r=n.__data__;if(!Ln||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yn(r)}return n.set(e,t),this.size=n.size,this};var pr=Do(Sr),gr=Do(kr,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,r){for(var o=-1,i=e.length;++o0&&n(s)?t>1?yr(s,t-1,n,r,o):Nt(o,s):r||(o[o.length]=s)}return o}var xr=zo(),wr=zo(!0);function Sr(e,t){return e&&xr(e,t,Rs)}function kr(e,t){return e&&wr(e,t,Rs)}function Cr(e,t){return Tt(t,(function(t){return es(e[t])}))}function _r(e,t){for(var r=0,o=(t=So(t,e)).length;null!=e&&rt}function Mr(e,t){return null!=e&&De.call(e,t)}function Ar(e,t){return null!=e&&t in Le(e)}function Tr(e,t,r){for(var o=r?It:Ot,i=e[0].length,a=e.length,s=a,l=ae(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Rt(d,Qt(t))),c=wn(d.length,c),l[s]=!r&&(t||i>=120&&d.length>=120)?new Xn(s&&d):n}d=e[0];var h=-1,f=l[0];e:for(;++h=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,o=t.length,i={};++r-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function Yr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?Xe.call(e,o,1):po(e,o)}}return e}function Xr(e,t){return e+mt(Cn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Ni(Mi(e,t,al),e+"")}function Jr(e){return Jn(Us(e))}function eo(e,t){var n=Us(e);return Bi(n,cr(t,0,n.length))}function to(e,t,r,o){if(!rs(e))return e;for(var i=-1,a=(t=So(t,e)).length,s=a-1,l=e;null!=l&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=ae(o);++r>>1,a=e[i];null!==a&&!ds(a)&&(n?a<=t:a=200){var c=t?null:Qo(e);if(c)return hn(c);a=!1,o=en,l=new Xn}else l=t?[]:s;e:for(;++r=o?e:io(e,t,r)}var _o=ct||function(e){return pt.clearTimeout(e)};function Eo(e,t){if(t)return e.slice();var n=e.length,r=$e?$e(n):new e.constructor(n);return e.copy(r),r}function Lo(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function Po(e,t){var n=t?Lo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Mo(e,t){if(e!==t){var r=e!==n,o=null===e,i=e==e,a=ds(e),s=t!==n,l=null===t,c=t==t,u=ds(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||o&&s&&c||!r&&c||!i)return 1;if(!o&&!a&&!u&&e1?r[i-1]:n,s=i>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(i--,a):n,s&&Si(r[0],r[1],s)&&(a=i<3?n:a,i=1),t=Le(t);++o-1?i[a?t[s]:s]:n}}function Wo(e){return ii((function(t){var r=t.length,i=r,a=Gn.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Ae(o);if(a&&!l&&"wrapper"==ci(s))var l=new Gn([],!0)}for(i=l?i:r;++i1&&b.reverse(),h&&cl))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&r?new Xn:n;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Pt(m,(function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(r),n)))}function zi(e){var t=0,r=0;return function(){var o=Sn(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Bi(e,t){var r=-1,o=e.length,i=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,la(e,r)}));function ga(e){var t=Wn(e);return t.__chain__=!0,t}function ma(e,t){return t(e)}var va=ii((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,i=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&o instanceof $n&&wi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:ma,args:[i],thisArg:n}),new Gn(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(i)}));var ba=Ro((function(e,t,n){De.call(e,n)?++e[n]:sr(e,n,1)}));var ya=Ho($i),xa=Ho(qi);function wa(e,t){return(qa(e)?Pt:pr)(e,di(t,3))}function Sa(e,t){return(qa(e)?Mt:gr)(e,di(t,3))}var ka=Ro((function(e,t,n){De.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ca=Qr((function(e,t,n){var r=-1,o="function"==typeof t,i=Ya(e)?ae(e.length):[];return pr(e,(function(e){i[++r]=o?Et(t,e,n):Or(e,t,n)})),i})),_a=Ro((function(e,t,n){sr(e,n,t)}));function Ea(e,t){return(qa(e)?Rt:Hr)(e,di(t,3))}var La=Ro((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Pa=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&Si(e,t[0],t[1])?t=[]:n>2&&Si(t[0],t[1],t[2])&&(t=[t[0]]),$r(e,yr(t,1),[])})),Ma=ht||function(){return pt.Date.now()};function Aa(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,ei(e,u,n,n,n,n,t)}function Ta(e,t){var r;if("function"!=typeof t)throw new Ae(o);return e=vs(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var Oa=Qr((function(e,t,n){var r=1;if(n.length){var o=dn(n,ui(Oa));r|=l}return ei(e,r,t,n,o)})),Ia=Qr((function(e,t,n){var r=3;if(n.length){var o=dn(n,ui(Ia));r|=l}return ei(t,r,e,n,o)}));function Ra(e,t,r){var i,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ae(o);function g(t){var r=i,o=a;return i=a=n,d=t,l=e.apply(o,r)}function m(e){return d=e,c=Ri(b,t),h?g(e):l}function v(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function b(){var e=Ma();if(v(e))return y(e);c=Ri(b,function(e){var n=t-(e-u);return f?wn(n,s-(e-d)):n}(e))}function y(e){return c=n,p&&i?g(e):(i=a=n,l)}function x(){var e=Ma(),r=v(e);if(i=arguments,a=this,u=e,r){if(c===n)return m(u);if(f)return _o(c),c=Ri(b,t),g(u)}return c===n&&(c=Ri(b,t)),l}return t=ys(t)||0,rs(r)&&(h=!!r.leading,s=(f="maxWait"in r)?xn(ys(r.maxWait)||0,t):s,p="trailing"in r?!!r.trailing:p),x.cancel=function(){c!==n&&_o(c),d=0,i=u=a=c=n},x.flush=function(){return c===n?l:y(Ma())},x}var Na=Qr((function(e,t){return hr(e,1,t)})),Da=Qr((function(e,t,n){return hr(e,ys(t)||0,n)}));function za(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(o);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(za.Cache||Yn),n}function Ba(e){if("function"!=typeof e)throw new Ae(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}za.Cache=Yn;var Fa=ko((function(e,t){var n=(t=1==t.length&&qa(t[0])?Rt(t[0],Qt(di())):Rt(yr(t,1),Qt(di()))).length;return Qr((function(r){for(var o=-1,i=wn(r.length,n);++o=t})),$a=Ir(function(){return arguments}())?Ir:function(e){return os(e)&&De.call(e,"callee")&&!Ye.call(e,"callee")},qa=ae.isArray,Za=xt?Qt(xt):function(e){return os(e)&&Lr(e)==I};function Ya(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return os(e)&&Ya(e)}var Ka=yt||yl,Qa=wt?Qt(wt):function(e){return os(e)&&Lr(e)==x};function Ja(e){if(!os(e))return!1;var t=Lr(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=Lr(e);return t==S||t==k||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==vs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function os(e){return null!=e&&"object"==typeof e}var is=St?Qt(St):function(e){return os(e)&&vi(e)==C};function as(e){return"number"==typeof e||os(e)&&Lr(e)==_}function ss(e){if(!os(e)||Lr(e)!=E)return!1;var t=qe(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==je}var ls=kt?Qt(kt):function(e){return os(e)&&Lr(e)==P};var cs=Ct?Qt(Ct):function(e){return os(e)&&vi(e)==M};function us(e){return"string"==typeof e||!qa(e)&&os(e)&&Lr(e)==A}function ds(e){return"symbol"==typeof e||os(e)&&Lr(e)==T}var hs=_t?Qt(_t):function(e){return os(e)&&ns(e.length)&&!!st[Lr(e)]};var fs=Yo(jr),ps=Yo((function(e,t){return e<=t}));function gs(e){if(!e)return[];if(Ya(e))return us(e)?gn(e):Oo(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=vi(e);return(t==C?cn:t==M?hn:Us)(e)}function ms(e){return e?(e=ys(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=ms(e),n=t%1;return t==t?n?t-n:t:0}function bs(e){return e?cr(vs(e),0,g):0}function ys(e){if("number"==typeof e)return e;if(ds(e))return p;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=me.test(e);return n||be.test(e)?dt(e.slice(2),n?2:8):ge.test(e)?p:+e}function xs(e){return Io(e,Ns(e))}function ws(e){return null==e?"":ho(e)}var Ss=No((function(e,t){if(Ei(t)||Ya(t))Io(t,Rs(t),e);else for(var n in t)De.call(t,n)&&rr(e,n,t[n])})),ks=No((function(e,t){Io(t,Ns(t),e)})),Cs=No((function(e,t,n,r){Io(t,Ns(t),e,r)})),_s=No((function(e,t,n,r){Io(t,Rs(t),e,r)})),Es=ii(lr);var Ls=Qr((function(e,t){e=Le(e);var r=-1,o=t.length,i=o>2?t[2]:n;for(i&&Si(t[0],t[1],i)&&(o=1);++r1),t})),Io(e,si(e),n),r&&(n=ur(n,7,ri));for(var o=t.length;o--;)po(n,t[o]);return n}));var Fs=ii((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return As(e,n)}))}(e,t)}));function js(e,t){if(null==e)return{};var n=Rt(si(e),(function(e){return[e]}));return t=di(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Hs=Jo(Rs),Ws=Jo(Ns);function Us(e){return null==e?[]:Jt(e,Rs(e))}var Vs=Fo((function(e,t,n){return t=t.toLowerCase(),e+(n?Gs(t):t)}));function Gs(e){return Js(ws(e).toLowerCase())}function $s(e){return(e=ws(e))&&e.replace(xe,on).replace(et,"")}var qs=Fo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Zs=Fo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ys=Bo("toLowerCase");var Xs=Fo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ks=Fo((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=Fo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Bo("toUpperCase");function el(e,t,r){return e=ws(e),(t=r?n:t)===n?function(e){return ot.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Qr((function(e,t){try{return Et(e,n,t)}catch(vV){return Ja(vV)?vV:new Ce(vV)}})),nl=ii((function(e,t){return Pt(t,(function(t){t=ji(t),sr(e,t,Oa(e[t],e))})),e}));function rl(e){return function(){return e}}var ol=Wo(),il=Wo(!0);function al(e){return e}function sl(e){return zr("function"==typeof e?e:ur(e,1))}var ll=Qr((function(e,t){return function(n){return Or(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Or(e,n,t)}}));function ul(e,t,n){var r=Rs(t),o=Cr(t,r);null!=n||rs(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Cr(t,Rs(t)));var i=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return Pt(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Oo(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function dl(){}var hl=$o(Rt),fl=$o(At),pl=$o(Bt);function gl(e){return ki(e)?$t(ji(e)):function(e){return function(t){return _r(t,e)}}(e)}var ml=Zo(),vl=Zo(!0);function bl(){return[]}function yl(){return!1}var xl=Go((function(e,t){return e+t}),0),wl=Ko("ceil"),Sl=Go((function(e,t){return e/t}),1),kl=Ko("floor");var Cl,_l=Go((function(e,t){return e*t}),1),El=Ko("round"),Ll=Go((function(e,t){return e-t}),0);return Wn.after=function(e,t){if("function"!=typeof t)throw new Ae(o);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},Wn.ary=Aa,Wn.assign=Ss,Wn.assignIn=ks,Wn.assignInWith=Cs,Wn.assignWith=_s,Wn.at=Es,Wn.before=Ta,Wn.bind=Oa,Wn.bindAll=nl,Wn.bindKey=Ia,Wn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qa(e)?e:[e]},Wn.chain=ga,Wn.chunk=function(e,t,r){t=(r?Si(e,t,r):t===n)?1:xn(vs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=ae(gt(o/t));ii?0:i+r),(o=o===n||o>i?i:vs(o))<0&&(o+=i),o=r>o?0:bs(o);r>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ho(t))&&ln(e)?Co(gn(e),0,r):e.split(t,r):[]},Wn.spread=function(e,t){if("function"!=typeof e)throw new Ae(o);return t=null==t?0:xn(vs(t),0),Qr((function(n){var r=n[t],o=Co(n,0,t);return r&&Nt(o,r),Et(e,this,o)}))},Wn.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Wn.take=function(e,t,r){return e&&e.length?io(e,0,(t=r||t===n?1:vs(t))<0?0:t):[]},Wn.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?io(e,(t=o-(t=r||t===n?1:vs(t)))<0?0:t,o):[]},Wn.takeRightWhile=function(e,t){return e&&e.length?mo(e,di(t,3),!1,!0):[]},Wn.takeWhile=function(e,t){return e&&e.length?mo(e,di(t,3)):[]},Wn.tap=function(e,t){return t(e),e},Wn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ae(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ra(e,t,{leading:r,maxWait:t,trailing:i})},Wn.thru=ma,Wn.toArray=gs,Wn.toPairs=Hs,Wn.toPairsIn=Ws,Wn.toPath=function(e){return qa(e)?Rt(e,ji):ds(e)?[e]:Oo(Fi(ws(e)))},Wn.toPlainObject=xs,Wn.transform=function(e,t,n){var r=qa(e),o=r||Ka(e)||hs(e);if(t=di(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:rs(e)&&es(i)?Un(qe(e)):{}}return(o?Pt:Sr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Wn.unary=function(e){return Aa(e,1)},Wn.union=oa,Wn.unionBy=ia,Wn.unionWith=aa,Wn.uniq=function(e){return e&&e.length?fo(e):[]},Wn.uniqBy=function(e,t){return e&&e.length?fo(e,di(t,2)):[]},Wn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?fo(e,n,t):[]},Wn.unset=function(e,t){return null==e||po(e,t)},Wn.unzip=sa,Wn.unzipWith=la,Wn.update=function(e,t,n){return null==e?e:go(e,t,wo(n))},Wn.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:go(e,t,wo(r),o)},Wn.values=Us,Wn.valuesIn=function(e){return null==e?[]:Jt(e,Ns(e))},Wn.without=ca,Wn.words=el,Wn.wrap=function(e,t){return ja(wo(t),e)},Wn.xor=ua,Wn.xorBy=da,Wn.xorWith=ha,Wn.zip=fa,Wn.zipObject=function(e,t){return yo(e||[],t||[],rr)},Wn.zipObjectDeep=function(e,t){return yo(e||[],t||[],to)},Wn.zipWith=pa,Wn.entries=Hs,Wn.entriesIn=Ws,Wn.extend=ks,Wn.extendWith=Cs,ul(Wn,Wn),Wn.add=xl,Wn.attempt=tl,Wn.camelCase=Vs,Wn.capitalize=Gs,Wn.ceil=wl,Wn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=ys(r))==r?r:0),t!==n&&(t=(t=ys(t))==t?t:0),cr(ys(e),t,r)},Wn.clone=function(e){return ur(e,4)},Wn.cloneDeep=function(e){return ur(e,5)},Wn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:n)},Wn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:n)},Wn.conformsTo=function(e,t){return null==t||dr(e,t,Rs(t))},Wn.deburr=$s,Wn.defaultTo=function(e,t){return null==e||e!=e?t:e},Wn.divide=Sl,Wn.endsWith=function(e,t,r){e=ws(e),t=ho(t);var o=e.length,i=r=r===n?o:cr(vs(r),0,o);return(r-=t.length)>=0&&e.slice(r,i)==t},Wn.eq=Ua,Wn.escape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Z,an):e},Wn.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(re,"\\$&"):e},Wn.every=function(e,t,r){var o=qa(e)?At:mr;return r&&Si(e,t,r)&&(t=n),o(e,di(t,3))},Wn.find=ya,Wn.findIndex=$i,Wn.findKey=function(e,t){return jt(e,di(t,3),Sr)},Wn.findLast=xa,Wn.findLastIndex=qi,Wn.findLastKey=function(e,t){return jt(e,di(t,3),kr)},Wn.floor=kl,Wn.forEach=wa,Wn.forEachRight=Sa,Wn.forIn=function(e,t){return null==e?e:xr(e,di(t,3),Ns)},Wn.forInRight=function(e,t){return null==e?e:wr(e,di(t,3),Ns)},Wn.forOwn=function(e,t){return e&&Sr(e,di(t,3))},Wn.forOwnRight=function(e,t){return e&&kr(e,di(t,3))},Wn.get=Ms,Wn.gt=Va,Wn.gte=Ga,Wn.has=function(e,t){return null!=e&&bi(e,t,Mr)},Wn.hasIn=As,Wn.head=Yi,Wn.identity=al,Wn.includes=function(e,t,n,r){e=Ya(e)?e:Us(e),n=n&&!r?vs(n):0;var o=e.length;return n<0&&(n=xn(o+n,0)),us(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Wt(e,t,n)>-1},Wn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vs(n);return o<0&&(o=xn(r+o,0)),Wt(e,t,o)},Wn.inRange=function(e,t,r){return t=ms(t),r===n?(r=t,t=0):r=ms(r),function(e,t,n){return e>=wn(t,n)&&e=-9007199254740991&&e<=f},Wn.isSet=cs,Wn.isString=us,Wn.isSymbol=ds,Wn.isTypedArray=hs,Wn.isUndefined=function(e){return e===n},Wn.isWeakMap=function(e){return os(e)&&vi(e)==O},Wn.isWeakSet=function(e){return os(e)&&"[object WeakSet]"==Lr(e)},Wn.join=function(e,t){return null==e?"":qt.call(e,t)},Wn.kebabCase=qs,Wn.last=Ji,Wn.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==n&&(i=(i=vs(r))<0?xn(o+i,0):wn(i,o-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ht(e,Vt,i,!0)},Wn.lowerCase=Zs,Wn.lowerFirst=Ys,Wn.lt=fs,Wn.lte=ps,Wn.max=function(e){return e&&e.length?vr(e,al,Pr):n},Wn.maxBy=function(e,t){return e&&e.length?vr(e,di(t,2),Pr):n},Wn.mean=function(e){return Gt(e,al)},Wn.meanBy=function(e,t){return Gt(e,di(t,2))},Wn.min=function(e){return e&&e.length?vr(e,al,jr):n},Wn.minBy=function(e,t){return e&&e.length?vr(e,di(t,2),jr):n},Wn.stubArray=bl,Wn.stubFalse=yl,Wn.stubObject=function(){return{}},Wn.stubString=function(){return""},Wn.stubTrue=function(){return!0},Wn.multiply=_l,Wn.nth=function(e,t){return e&&e.length?Gr(e,vs(t)):n},Wn.noConflict=function(){return pt._===this&&(pt._=He),this},Wn.noop=dl,Wn.now=Ma,Wn.pad=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return qo(mt(o),n)+e+qo(gt(o),n)},Wn.padEnd=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;return t&&rt){var o=e;e=t,t=o}if(r||e%1||t%1){var i=Cn();return wn(e+i*(t-e+ut("1e-"+((i+"").length-1))),t)}return Xr(e,t)},Wn.reduce=function(e,t,n){var r=qa(e)?Dt:Zt,o=arguments.length<3;return r(e,di(t,4),n,o,pr)},Wn.reduceRight=function(e,t,n){var r=qa(e)?zt:Zt,o=arguments.length<3;return r(e,di(t,4),n,o,gr)},Wn.repeat=function(e,t,r){return t=(r?Si(e,t,r):t===n)?1:vs(t),Kr(ws(e),t)},Wn.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Wn.result=function(e,t,r){var o=-1,i=(t=So(t,e)).length;for(i||(i=1,e=n);++of)return[];var n=g,r=wn(e,g);t=di(t),e-=g;for(var o=Xt(r,t);++n=a)return e;var l=r-pn(o);if(l<1)return o;var c=s?Co(s,0,l).join(""):e.slice(0,l);if(i===n)return c+o;if(s&&(l+=c.length-l),ls(i)){if(e.slice(l).search(i)){var u,d=c;for(i.global||(i=Pe(i.source,ws(pe.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var h=u.index;c=c.slice(0,h===n?l:h)}}else if(e.indexOf(ho(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Wn.unescape=function(e){return(e=ws(e))&&Y.test(e)?e.replace(q,vn):e},Wn.uniqueId=function(e){var t=++ze;return ws(e)+t},Wn.upperCase=Qs,Wn.upperFirst=Js,Wn.each=wa,Wn.eachRight=Sa,Wn.first=Yi,ul(Wn,(Cl={},Sr(Wn,(function(e,t){De.call(Wn.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Wn.VERSION="4.17.21",Pt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Wn[e].placeholder=Wn})),Pt(["drop","take"],(function(e,t){$n.prototype[e]=function(r){r=r===n?1:xn(vs(r),0);var o=this.__filtered__&&!t?new $n(this):this.clone();return o.__filtered__?o.__takeCount__=wn(r,o.__takeCount__):o.__views__.push({size:wn(r,g),type:e+(o.__dir__<0?"Right":"")}),o},$n.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Pt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;$n.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:di(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Pt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");$n.prototype[e]=function(){return this[n](1).value()[0]}})),Pt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");$n.prototype[e]=function(){return this.__filtered__?new $n(this):this[n](1)}})),$n.prototype.compact=function(){return this.filter(al)},$n.prototype.find=function(e){return this.filter(e).head()},$n.prototype.findLast=function(e){return this.reverse().find(e)},$n.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new $n(this):this.map((function(n){return Or(n,e,t)}))})),$n.prototype.reject=function(e){return this.filter(Ba(di(e)))},$n.prototype.slice=function(e,t){e=vs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new $n(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=vs(t))<0?r.dropRight(-t):r.take(t-e)),r)},$n.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},$n.prototype.toArray=function(){return this.take(g)},Sr($n.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Wn[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Wn.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof $n,c=s[0],u=l||qa(t),d=function(e){var t=i.apply(Wn,Nt([e],s));return o&&h?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new $n(this);var m=e.apply(t,s);return m.__actions__.push({func:ma,args:[d],thisArg:n}),new Gn(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?o?m.value()[0]:m.value():m)})})),Pt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Wn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(qa(o)?o:[],e)}return this[n]((function(n){return t.apply(qa(n)?n:[],e)}))}})),Sr($n.prototype,(function(e,t){var n=Wn[t];if(n){var r=n.name+"";De.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}})),In[Uo(n,2).name]=[{name:"wrapper",func:n}],$n.prototype.clone=function(){var e=new $n(this.__wrapped__);return e.__actions__=Oo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oo(this.__views__),e},$n.prototype.reverse=function(){if(this.__filtered__){var e=new $n(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},$n.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Wn.prototype.plant=function(e){for(var t,r=this;r instanceof Vn;){var o=Wi(r);o.__index__=0,o.__values__=n,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,t},Wn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof $n){var t=e;return this.__actions__.length&&(t=new $n(this)),(t=t.reverse()).__actions__.push({func:ma,args:[ra],thisArg:n}),new Gn(t,this.__chain__)}return this.thru(ra)},Wn.prototype.toJSON=Wn.prototype.valueOf=Wn.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Wn.prototype.first=Wn.prototype.head,Qe&&(Wn.prototype[Qe]=function(){return this}),Wn}();mt?((mt.exports=bn)._=bn,gt._=bn):pt._=bn}).call(r)}(EG,EG.exports);const LG=EG.exports;var PG=Object.create,MG=Object.defineProperty,AG=Object.getOwnPropertyDescriptor,TG=Object.getOwnPropertyNames,OG=Object.getPrototypeOf,IG=Object.prototype.hasOwnProperty,RG=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),NG=(e,t,n)=>(n=null!=e?PG(OG(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of TG(t))!IG.call(e,o)&&o!==n&&MG(e,o,{get:()=>t[o],enumerable:!(r=AG(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?n:MG(n,"default",{value:e,enumerable:!0}),e)),DG=RG(((e,t)=>{t.exports=function(){this.__data__=[],this.size=0}})),zG=RG(((e,t)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}})),BG=RG(((e,t)=>{var n=zG();t.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}})),FG=RG(((e,t)=>{var n=BG(),r=Array.prototype.splice;t.exports=function(e){var t=this.__data__,o=n(t,e);return!(o<0)&&(o==t.length-1?t.pop():r.call(t,o,1),--this.size,!0)}})),jG=RG(((e,t)=>{var n=BG();t.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}})),HG=RG(((e,t)=>{var n=BG();t.exports=function(e){return n(this.__data__,e)>-1}})),WG=RG(((e,t)=>{var n=BG();t.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}})),UG=RG(((e,t)=>{var n=DG(),r=FG(),o=jG(),i=HG(),a=WG();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=UG();t.exports=function(){this.__data__=new n,this.size=0}})),GG=RG(((e,t)=>{t.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}})),$G=RG(((e,t)=>{t.exports=function(e){return this.__data__.get(e)}})),qG=RG(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),ZG=RG(((e,t)=>{var n="object"==typeof global&&global&&global.Object===Object&&global;t.exports=n})),YG=RG(((e,t)=>{var n=ZG(),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();t.exports=o})),XG=RG(((e,t)=>{var n=YG().Symbol;t.exports=n})),KG=RG(((e,t)=>{var n=XG(),r=Object.prototype,o=r.hasOwnProperty,i=r.toString,a=n?n.toStringTag:void 0;t.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch{}var s=i.call(e);return r&&(t?e[a]=n:delete e[a]),s}})),QG=RG(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}})),JG=RG(((e,t)=>{var n=XG(),r=KG(),o=QG(),i=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?r(e):o(e)}})),e$=RG(((e,t)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}})),t$=RG(((e,t)=>{var n=JG(),r=e$();t.exports=function(e){if(!r(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}})),n$=RG(((e,t)=>{var n=YG()["__core-js_shared__"];t.exports=n})),r$=RG(((e,t)=>{var n=n$(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();t.exports=function(e){return!!r&&r in e}})),o$=RG(((e,t)=>{var n=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return n.call(e)}catch{}try{return e+""}catch{}}return""}})),i$=RG(((e,t)=>{var n=t$(),r=r$(),o=e$(),i=o$(),a=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||r(e))&&(n(e)?d:a).test(i(e))}})),a$=RG(((e,t)=>{t.exports=function(e,t){return e?.[t]}})),s$=RG(((e,t)=>{var n=i$(),r=a$();t.exports=function(e,t){var o=r(e,t);return n(o)?o:void 0}})),l$=RG(((e,t)=>{var n=s$()(YG(),"Map");t.exports=n})),c$=RG(((e,t)=>{var n=s$()(Object,"create");t.exports=n})),u$=RG(((e,t)=>{var n=c$();t.exports=function(){this.__data__=n?n(null):{},this.size=0}})),d$=RG(((e,t)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}})),h$=RG(((e,t)=>{var n=c$(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(n){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return r.call(t,e)?t[e]:void 0}})),f$=RG(((e,t)=>{var n=c$(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:r.call(t,e)}})),p$=RG(((e,t)=>{var n=c$();t.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}})),g$=RG(((e,t)=>{var n=u$(),r=d$(),o=h$(),i=f$(),a=p$();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=g$(),r=UG(),o=l$();t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||r),string:new n}}})),v$=RG(((e,t)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}})),b$=RG(((e,t)=>{var n=v$();t.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}})),y$=RG(((e,t)=>{var n=b$();t.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}})),x$=RG(((e,t)=>{var n=b$();t.exports=function(e){return n(this,e).get(e)}})),w$=RG(((e,t)=>{var n=b$();t.exports=function(e){return n(this,e).has(e)}})),S$=RG(((e,t)=>{var n=b$();t.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}})),k$=RG(((e,t)=>{var n=m$(),r=y$(),o=x$(),i=w$(),a=S$();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=UG(),r=l$(),o=k$();t.exports=function(e,t){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new o(a)}return i.set(e,t),this.size=i.size,this}})),_$=RG(((e,t)=>{var n=UG(),r=VG(),o=GG(),i=$G(),a=qG(),s=C$();function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,t.exports=l})),E$=RG(((e,t)=>{t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}})),L$=RG(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),P$=RG(((e,t)=>{var n=k$(),r=E$(),o=L$();function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{t.exports=function(e,t){return e.has(t)}})),T$=RG(((e,t)=>{var n=P$(),r=M$(),o=A$();t.exports=function(e,t,i,a,s,l){var c=1&i,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var h=l.get(e),f=l.get(t);if(h&&f)return h==t&&f==e;var p=-1,g=!0,m=2&i?new n:void 0;for(l.set(e,t),l.set(t,e);++p{var n=YG().Uint8Array;t.exports=n})),I$=RG(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}})),R$=RG(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}})),N$=RG(((e,t)=>{var n=XG(),r=O$(),o=zG(),i=T$(),a=I$(),s=R$(),l=n?n.prototype:void 0,c=l?l.valueOf:void 0;t.exports=function(e,t,n,l,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&l;if(f||(f=s),e.size!=t.size&&!p)return!1;var g=h.get(e);if(g)return g==t;l|=2,h.set(e,t);var m=i(f(e),f(t),l,u,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}})),D$=RG(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n{var n=Array.isArray;t.exports=n})),B$=RG(((e,t)=>{var n=D$(),r=z$();t.exports=function(e,t,o){var i=t(e);return r(e)?i:n(i,o(e))}})),F$=RG(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n{t.exports=function(){return[]}})),H$=RG(((e,t)=>{var n=F$(),r=j$(),o=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return o.call(e,t)})))}:r;t.exports=a})),W$=RG(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=Array(e);++n{t.exports=function(e){return null!=e&&"object"==typeof e}})),V$=RG(((e,t)=>{var n=JG(),r=U$();t.exports=function(e){return r(e)&&"[object Arguments]"==n(e)}})),G$=RG(((e,t)=>{var n=V$(),r=U$(),o=Object.prototype,i=o.hasOwnProperty,a=o.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return r(e)&&i.call(e,"callee")&&!a.call(e,"callee")};t.exports=s})),$$=RG(((e,t)=>{t.exports=function(){return!1}})),q$=RG(((e,t)=>{var n=YG(),r=$$(),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;t.exports=s})),Z$=RG(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=t??9007199254740991)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}})),X$=RG(((e,t)=>{var n=JG(),r=Y$(),o=U$(),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&r(e.length)&&!!i[n(e)]}})),K$=RG(((e,t)=>{t.exports=function(e){return function(t){return e(t)}}})),Q$=RG(((e,t)=>{var n=ZG(),r="object"==typeof e&&e&&!e.nodeType&&e,o=r&&"object"==typeof t&&t&&!t.nodeType&&t,i=o&&o.exports===r&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch{}}();t.exports=a})),J$=RG(((e,t)=>{var n=X$(),r=K$(),o=Q$(),i=o&&o.isTypedArray,a=i?r(i):n;t.exports=a})),eq=RG(((e,t)=>{var n=W$(),r=G$(),o=z$(),i=q$(),a=Z$(),s=J$(),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=o(e),u=!c&&r(e),d=!c&&!u&&i(e),h=!c&&!u&&!d&&s(e),f=c||u||d||h,p=f?n(e.length,String):[],g=p.length;for(var m in e)(t||l.call(e,m))&&(!f||!("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g)))&&p.push(m);return p}})),tq=RG(((e,t)=>{var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}})),nq=RG(((e,t)=>{t.exports=function(e,t){return function(n){return e(t(n))}}})),rq=RG(((e,t)=>{var n=nq()(Object.keys,Object);t.exports=n})),oq=RG(((e,t)=>{var n=tq(),r=rq(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return r(e);var t=[];for(var i in Object(e))o.call(e,i)&&"constructor"!=i&&t.push(i);return t}})),iq=RG(((e,t)=>{var n=t$(),r=Y$();t.exports=function(e){return null!=e&&r(e.length)&&!n(e)}})),aq=RG(((e,t)=>{var n=eq(),r=oq(),o=iq();t.exports=function(e){return o(e)?n(e):r(e)}})),sq=RG(((e,t)=>{var n=B$(),r=H$(),o=aq();t.exports=function(e){return n(e,o,r)}})),lq=RG(((e,t)=>{var n=sq(),r=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,i,a,s){var l=1&o,c=n(e),u=c.length;if(u!=n(t).length&&!l)return!1;for(var d=u;d--;){var h=c[d];if(!(l?h in t:r.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++d{var n=s$()(YG(),"DataView");t.exports=n})),uq=RG(((e,t)=>{var n=s$()(YG(),"Promise");t.exports=n})),dq=RG(((e,t)=>{var n=s$()(YG(),"Set");t.exports=n})),hq=RG(((e,t)=>{var n=s$()(YG(),"WeakMap");t.exports=n})),fq=RG(((e,t)=>{var n=cq(),r=l$(),o=uq(),i=dq(),a=hq(),s=JG(),l=o$(),c="[object Map]",u="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",p=l(n),g=l(r),m=l(o),v=l(i),b=l(a),y=s;(n&&y(new n(new ArrayBuffer(1)))!=f||r&&y(new r)!=c||o&&y(o.resolve())!=u||i&&y(new i)!=d||a&&y(new a)!=h)&&(y=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case p:return f;case g:return c;case m:return u;case v:return d;case b:return h}return t}),t.exports=y})),pq=RG(((e,t)=>{var n=_$(),r=T$(),o=N$(),i=lq(),a=fq(),s=z$(),l=q$(),c=J$(),u="[object Arguments]",d="[object Array]",h="[object Object]",f=Object.prototype.hasOwnProperty;t.exports=function(e,t,p,g,m,v){var b=s(e),y=s(t),x=b?d:a(e),w=y?d:a(t),S=(x=x==u?h:x)==h,k=(w=w==u?h:w)==h,C=x==w;if(C&&l(e)){if(!l(t))return!1;b=!0,S=!1}if(C&&!S)return v||(v=new n),b||c(e)?r(e,t,p,g,m,v):o(e,t,x,p,g,m,v);if(!(1&p)){var _=S&&f.call(e,"__wrapped__"),E=k&&f.call(t,"__wrapped__");if(_||E){var L=_?e.value():e,P=E?t.value():t;return v||(v=new n),m(L,P,p,g,v)}}return!!C&&(v||(v=new n),i(e,t,p,g,m,v))}})),gq=RG(((e,t)=>{var n=pq(),r=U$();t.exports=function e(t,o,i,a,s){return t===o||(null==t||null==o||!r(t)&&!r(o)?t!=t&&o!=o:n(t,o,i,a,e,s))}})),mq=RG(((e,t)=>{var n=gq();t.exports=function(e,t){return n(e,t)}})),vq=["ctrl","shift","alt","meta","mod"],bq={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function yq(e,t=","){return"string"==typeof e?e.split(t):e}function xq(e,t="+"){let n=e.toLocaleLowerCase().split(t).map((e=>e.trim())).map((e=>bq[e]||e)),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter((e=>!vq.includes(e)));return{...r,keys:o}}function wq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some((e=>e.toLowerCase()===n.toLowerCase()))):Boolean(n&&t&&!0===t)}var Sq=i.exports.createContext(void 0),kq=i.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Cq=NG(mq());var _q=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Eq(e,t,n,r){let o=i.exports.useRef(null),{current:a}=i.exports.useRef(new Set),s=n instanceof Array?r instanceof Array?void 0:r:n,l=n instanceof Array?n:r instanceof Array?r:[],c=i.exports.useCallback(t,[...l]),u=function(e){let t=i.exports.useRef(void 0);return(0,Cq.default)(t.current,e)||(t.current=e),t.current}(s),{enabledScopes:d}=i.exports.useContext(kq),h=i.exports.useContext(Sq);return i.exports.useLayoutEffect((()=>{if(!1===u?.enabled||!function(e,t){return 0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):!t||e.some((e=>t.includes(e)))||e.includes("*")}(d,u?.scopes))return;let t=t=>{if(!function(e){return wq(e,["input","textarea","select"])}(t)||wq(t,u?.enableOnFormTags)){if(null!==o.current&&document.activeElement!==o.current&&!o.current.contains(document.activeElement))return void _q(t);t.target?.isContentEditable&&!u?.enableOnContentEditable||yq(e,u?.splitKey).forEach((e=>{let n=xq(e,u?.combinationKey);if(((e,t,n)=>{let{alt:r,ctrl:o,meta:i,mod:a,shift:s,keys:l}=t,{altKey:c,ctrlKey:u,metaKey:d,shiftKey:h,key:f,code:p}=e,g=p.toLowerCase().replace("key",""),m=f.toLowerCase();if(c!==r&&"alt"!==m||h!==s&&"shift"!==m)return!1;if(a){if(!d&&!u)return!1}else if(d!==i&&"meta"!==g||u!==o&&"ctrl"!==g)return!1;return!(!l||1!==l.length||!l.includes(m)&&!l.includes(g))||(l?l.every((e=>n.has(e))):!l)})(t,n,a)||n.keys?.includes("*")){if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(t,n,u?.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(t,n,u?.enabled))return void _q(t);c(t,n)}}))}},n=e=>{a.add(e.key.toLowerCase()),(void 0===u?.keydown&&!0!==u?.keyup||u?.keydown)&&t(e)},r=e=>{"meta"!==e.key.toLowerCase()?a.delete(e.key.toLowerCase()):a.clear(),u?.keyup&&t(e)};return(o.current||document).addEventListener("keyup",r),(o.current||document).addEventListener("keydown",n),h&&yq(e,u?.splitKey).forEach((e=>h.addHotkey(xq(e,u?.combinationKey)))),()=>{(o.current||document).removeEventListener("keyup",r),(o.current||document).removeEventListener("keydown",n),h&&yq(e,u?.splitKey).forEach((e=>h.removeHotkey(xq(e,u?.combinationKey))))}}),[e,c,u,d]),o}NG(mq());var Lq=new Set;function Pq(){return ld("div",{className:"work-in-progress nodes-work-in-progress",children:[sd("h1",{children:"Nodes"}),sd("p",{children:"A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature."})]})}window.addEventListener("DOMContentLoaded",(()=>{document.addEventListener("keydown",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>Lq.add(xq(e))))}(e.key)})),document.addEventListener("keyup",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>{let t=xq(e);for(let n of Lq)n.keys?.every((e=>t.keys?.includes(e)))&&Lq.delete(n)}))}(e.key)}))}));const Mq=()=>ld("div",{className:"work-in-progress post-processing-work-in-progress",children:[sd("h1",{children:"Post Processing"}),sd("p",{children:"Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image and Image To Image tabs. You can also process images directly, using the image action buttons above the current image display or in the viewer."}),sd("p",{children:"A dedicated UI will be released soon to facilitate more advanced post processing workflows."}),sd("p",{children:"The Invoke AI Command Line Interface offers various other features including Embiggen."})]}),Aq=SS({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:sd("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),Tq=SS({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),Oq=SS({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),Iq=SS({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:sd("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:sd("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})});var Rq=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(Rq||{});const Nq={0:{text:"This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},1:{text:"As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},2:{text:"These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},3:{text:"Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},4:{text:"Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},5:{text:"Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.",href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},6:{text:"Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},7:{text:"Image to Image allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},8:{text:"The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},9:{text:"Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},10:{text:"Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes).",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}},Dq=/^-?(0\.)?\.?$/,zq=e=>{const{label:t,labelFontSize:n="1rem",styleClass:r,isDisabled:o=!1,showStepper:a=!0,width:s,textAlign:l,isInvalid:c,value:u,onChange:d,min:h,max:f,isInteger:p=!0,formControlProps:g,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:b,tooltipProps:y,...x}=e,[w,S]=i.exports.useState(String(u));i.exports.useEffect((()=>{w.match(Dq)||u===Number(w)||S(String(u))}),[u,w]);return sd(qH,{...y,children:ld(GT,{isDisabled:o,isInvalid:c,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...g,children:[t&&sd(JT,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,...m,children:t}),ld(hF,{className:"invokeai__number-input-root",value:w,keepWithinRange:!0,clampValueOnBlur:!1,onChange:e=>{S(e),e.match(Dq)||d(p?Math.floor(Number(e)):Number(e))},onBlur:e=>{const t=LG.clamp(p?Math.floor(Number(e.target.value)):Number(e.target.value),h,f);S(String(t)),d(t)},width:s,...x,children:[sd(pF,{className:"invokeai__number-input-field",textAlign:l,...v}),a&&ld("div",{className:"invokeai__number-input-stepper",children:[sd(vF,{...b,className:"invokeai__number-input-stepper-button"}),sd(mF,{...b,className:"invokeai__number-input-stepper-button"})]})]})]})})},Bq=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:i,size:a="sm",fontSize:s="md",styleClass:l,...c}=e;return ld(GT,{isDisabled:n,className:`invokeai__select ${l}`,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.cancelBubble=!0},children:[t&&sd(JT,{className:"invokeai__select-label",fontSize:s,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t}),sd(qH,{label:o,...i,children:sd(nj,{className:"invokeai__select-picker",fontSize:s,size:a,...c,children:r.map((e=>"string"==typeof e||"number"==typeof e?sd("option",{value:e,className:"invokeai__select-option",children:e},e):sd("option",{value:e.value,className:"invokeai__select-option",children:e.key},e.value)))})})]})},Fq=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],jq=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],Hq=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],Wq=[{key:"2x",value:2},{key:"4x",value:4}],Uq=4294967295,Vq=["gfpgan","codeformer"],Gq=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],$q=cU((e=>e.options),(e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),qq=cU((e=>e.system),(e=>({isGFPGANAvailable:e.isGFPGANAvailable})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),Zq=()=>{const e=noe(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=roe($q),{isGFPGANAvailable:o}=roe(qq);return ld(kI,{direction:"column",gap:2,children:[sd(Bq,{label:"Type",validValues:Vq.concat(),value:n,onChange:t=>e(Dte(t.target.value))}),sd(zq,{isDisabled:!o,label:"Strength",step:.05,min:0,max:1,onChange:t=>e(Nte(t)),value:t,width:"90px",isInteger:!1}),"codeformer"===n&&sd(zq,{isDisabled:!o,label:"Fidelity",step:.05,min:0,max:1,onChange:t=>e(Ite(t)),value:r,width:"90px",isInteger:!1})]})},Yq=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:i,styleClass:a,...s}=e;return sd(GT,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,...o,children:ld(JT,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",...i,children:[t,sd(tH,{className:"invokeai__switch-root",...s})]})})};function Xq(){const e=roe((e=>e.system.isGFPGANAvailable)),t=roe((e=>e.options.shouldRunFacetool)),n=noe();return sd(Yq,{isDisabled:!e,isChecked:t,onChange:e=>n(une(e.target.checked))})}function Kq(){const e=noe(),t=roe((e=>e.options.shouldFitToWidthHeight));return sd(Yq,{label:"Fit Initial Image To Output Size",isChecked:t,onChange:t=>e(rne(t.target.checked))})}var Qq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Jq=j.createContext&&j.createContext(Qq),eZ=globalThis&&globalThis.__assign||function(){return eZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:o,asCheckbox:i,isChecked:a,...s}=e;return sd(qH,{label:n,hasArrow:!0,...o,...o?.placement?{placement:o.placement}:{placement:"top"},children:sd(DT,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":i,"data-selected":void 0!==a?a:void 0,...s})})}));function hZ(e){const[t,n]=i.exports.useState(!1),{label:r,value:o,min:a=1,max:s=100,step:l=1,onChange:c,width:u="100%",tooltipSuffix:d="",withSliderMarks:h=!1,sliderMarkLeftOffset:f=0,sliderMarkRightOffset:p=-7,withInput:g=!1,isInteger:m=!1,inputWidth:v="5rem",inputReadOnly:b=!0,withReset:y=!1,hideTooltip:x=!1,handleReset:w,isResetDisabled:S,isSliderDisabled:k,isInputDisabled:C,styleClass:_,sliderFormControlProps:E,sliderFormLabelProps:L,sliderMarkProps:P,sliderTrackProps:M,sliderThumbProps:A,sliderNumberInputProps:T,sliderNumberInputFieldProps:O,sliderNumberInputStepperProps:I,sliderTooltipProps:R,sliderIAIIconButtonProps:N,...D}=e,[z,B]=i.exports.useState(String(o)),F=i.exports.useMemo((()=>T?.max?T.max:s),[s,T?.max]);i.exports.useEffect((()=>{String(o)!==z&&""!==z&&B(String(o))}),[o,z,B]);const j=e=>{B(e),c(Number(e))};return ld(GT,{className:_?`invokeai__slider-component ${_}`:"invokeai__slider-component","data-markers":h,...E,children:[sd(JT,{className:"invokeai__slider-component-label",...L,children:r}),ld(jI,{w:"100%",gap:2,children:[ld(Zj,{"aria-label":r,value:o,min:a,max:s,step:l,onChange:j,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:k,width:u,...D,children:[h&&ld(ad,{children:[sd(Qj,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:f,...P,children:a}),sd(Qj,{value:s,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:p,...P,children:s})]}),sd(Xj,{className:"invokeai__slider_track",...M,children:sd(Kj,{className:"invokeai__slider_track-filled"})}),sd(qH,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${o}${d}`,hidden:x,...R,children:sd(Yj,{className:"invokeai__slider-thumb",...A})})]}),g&&ld(hF,{min:a,max:F,step:l,value:z,onChange:j,onBlur:e=>{const t=LG.clamp(m?Math.floor(Number(e.target.value)):Number(e.target.value),a,F);B(String(t)),c(t)},className:"invokeai__slider-number-field",isDisabled:C,...T,children:[sd(pF,{className:"invokeai__slider-number-input",width:v,readOnly:b,...O}),ld(fF,{...I,children:[sd(vF,{className:"invokeai__slider-number-stepper"}),sd(mF,{className:"invokeai__slider-number-stepper"})]})]}),y&&sd(dZ,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:sd(aZ,{}),onClick:()=>{w&&w()},isDisabled:S,...N})]})]})}function fZ(e){const{label:t="Strength",styleClass:n}=e,r=roe((e=>e.options.img2imgStrength)),o=noe();return sd(hZ,{label:t,step:.01,min:.01,max:.99,onChange:e=>o(Fte(e)),value:r,isInteger:!1,styleClass:n,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{o(Fte(.75))}})}const pZ=()=>{const e=noe(),t=roe((e=>e.options.hiresFix));return sd(kI,{gap:2,direction:"column",children:sd(Yq,{label:"High Res Optimization",fontSize:"md",isChecked:t,onChange:t=>e(Bte(t.target.checked))})})},gZ=()=>{const e=noe(),t=roe((e=>e.options.seamless));return sd(kI,{gap:2,direction:"column",children:sd(Yq,{label:"Seamless tiling",fontSize:"md",isChecked:t,onChange:t=>e(Kte(t.target.checked))})})},mZ=()=>ld(kI,{gap:2,direction:"column",children:[sd(gZ,{}),sd(pZ,{})]});function vZ(){const e=noe(),t=roe((e=>e.options.shouldRandomizeSeed));return sd(Yq,{label:"Randomize Seed",isChecked:t,onChange:t=>e(lne(t.target.checked))})}function bZ(){const e=roe((e=>e.options.seed)),t=roe((e=>e.options.shouldRandomizeSeed)),n=roe((e=>e.options.shouldGenerateVariations)),r=noe();return sd(zq,{label:"Seed",step:1,precision:0,flexGrow:1,min:0,max:Uq,isDisabled:t,isInvalid:e<0&&n,onChange:e=>r(tne(e)),value:e,width:"10rem"})}const yZ=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function xZ(){const e=noe(),t=roe((e=>e.options.shouldRandomizeSeed));return sd(IT,{size:"sm",isDisabled:t,onClick:()=>e(tne(yZ(0,Uq))),children:sd("p",{children:"Shuffle"})})}function wZ(){const e=noe(),t=roe((e=>e.options.threshold));return sd(zq,{label:"Noise Threshold",min:0,max:1e3,step:.1,onChange:t=>e(mne(t)),value:t,isInteger:!1})}function SZ(){const e=noe(),t=roe((e=>e.options.perlin));return sd(zq,{label:"Perlin Noise",min:0,max:1,step:.05,onChange:t=>e(qte(t)),value:t,isInteger:!1})}const kZ=()=>ld(kI,{gap:2,direction:"column",children:[sd(vZ,{}),ld(kI,{gap:2,children:[sd(bZ,{}),sd(xZ,{})]}),sd(kI,{gap:2,children:sd(wZ,{})}),sd(kI,{gap:2,children:sd(SZ,{})})]}),CZ=cU((e=>e.options),(e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),_Z=cU((e=>e.system),(e=>({isESRGANAvailable:e.isESRGANAvailable})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),EZ=()=>{const e=noe(),{upscalingLevel:t,upscalingStrength:n}=roe(CZ),{isESRGANAvailable:r}=roe(_Z);return ld("div",{className:"upscale-options",children:[sd(Bq,{isDisabled:!r,label:"Scale",value:t,onChange:t=>e(bne(Number(t.target.value))),validValues:Wq}),sd(zq,{isDisabled:!r,label:"Strength",step:.05,min:0,max:1,onChange:t=>e(yne(t)),value:n,isInteger:!1})]})};function LZ(){const e=roe((e=>e.system.isESRGANAvailable)),t=roe((e=>e.options.shouldRunESRGAN)),n=noe();return sd(Yq,{isDisabled:!e,isChecked:t,onChange:e=>n(cne(e.target.checked))})}function PZ(){const e=roe((e=>e.options.shouldGenerateVariations)),t=noe();return sd(Yq,{isChecked:e,width:"auto",onChange:e=>t(one(e.target.checked))})}function MZ(e){const{label:t,styleClass:n,isDisabled:r=!1,fontSize:o="1rem",width:i,isInvalid:a,...s}=e;return ld(GT,{className:`input ${n}`,isInvalid:a,isDisabled:r,flexGrow:1,children:[sd(JT,{fontSize:o,marginBottom:1,whiteSpace:"nowrap",className:"input-label",children:t}),sd(JO,{...s,className:"input-entry",size:"sm",width:i})]})}function AZ(){const e=roe((e=>e.options.seedWeights)),t=roe((e=>e.options.shouldGenerateVariations)),n=noe();return sd(MZ,{label:"Seed Weights",value:e,isInvalid:t&&!(CG(e)||""===e),isDisabled:!t,onChange:e=>n(nne(e.target.value))})}function TZ(){const e=roe((e=>e.options.variationAmount)),t=roe((e=>e.options.shouldGenerateVariations)),n=noe();return sd(zq,{label:"Variation Amount",value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:e=>n(xne(e)),isInteger:!1})}const OZ=()=>ld(kI,{gap:2,direction:"column",children:[sd(TZ,{}),sd(AZ,{})]});function IZ(){const e=noe(),t=roe((e=>e.options.cfgScale));return sd(zq,{label:"CFG Scale",step:.5,min:1.01,max:200,onChange:t=>e(Ote(t)),value:t,width:WZ,styleClass:"main-option-block",textAlign:"center",isInteger:!1})}const RZ=cU((e=>e.options),(e=>wte[e.activeTab]),{memoizeOptions:{equalityCheck:LG.isEqual}});cU((e=>e.options),(e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});const NZ=e=>e.options;function DZ(){const e=roe((e=>e.options.height)),t=roe(RZ),n=noe();return sd(Bq,{isDisabled:"unifiedCanvas"===t,label:"Height",value:e,flexGrow:1,onChange:e=>n(zte(Number(e.target.value))),validValues:Hq,styleClass:"main-option-block"})}const zZ=cU([e=>e.options],(e=>{const{iterations:t}=e;return{iterations:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function BZ(){const e=noe(),{iterations:t}=roe(zZ);return sd(zq,{label:"Images",step:1,min:1,max:9999,onChange:t=>e(Ute(t)),value:t,width:WZ,labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function FZ(){const e=roe((e=>e.options.sampler)),t=noe();return sd(Bq,{label:"Sampler",value:e,onChange:e=>t(Yte(e.target.value)),validValues:Fq,styleClass:"main-option-block"})}function jZ(){const e=noe(),t=roe((e=>e.options.steps));return sd(zq,{label:"Steps",min:1,max:9999,step:1,onChange:t=>e(gne(t)),value:t,width:WZ,styleClass:"main-option-block",textAlign:"center"})}function HZ(){const e=roe((e=>e.options.width)),t=roe(RZ),n=noe();return sd(Bq,{isDisabled:"unifiedCanvas"===t,label:"Width",value:e,flexGrow:1,onChange:e=>n(wne(Number(e.target.value))),validValues:jq,styleClass:"main-option-block"})}const WZ="auto";function UZ(){return sd("div",{className:"main-options",children:ld("div",{className:"main-options-list",children:[ld("div",{className:"main-options-row",children:[sd(BZ,{}),sd(jZ,{}),sd(IZ,{})]}),ld("div",{className:"main-options-row",children:[sd(HZ,{}),sd(DZ,{}),sd(FZ,{})]})]})})}const VZ=TU({name:"system",initialState:{isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[]},reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Error",e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?"Connected":"Disconnected"},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:o}=t.payload,i={timestamp:n,message:r,level:o||"info"};e.log.push(i)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Processing canceled"},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Preparing"},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus="Loading Model",e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1}}}),{setShouldDisplayInProgressType:GZ,setIsProcessing:$Z,addLogEntry:qZ,setShouldShowLogViewer:ZZ,setIsConnected:YZ,setSocketId:XZ,setShouldConfirmOnDelete:KZ,setOpenAccordions:QZ,setSystemStatus:JZ,setCurrentStatus:eY,setSystemConfig:tY,setShouldDisplayGuides:nY,processingCanceled:rY,errorOccurred:oY,errorSeen:iY,setModelList:aY,setIsCancelable:sY,modelChangeRequested:lY,setSaveIntermediatesInterval:cY,setEnableImageDebugging:uY,generationRequested:dY,addToast:hY,clearToastQueue:fY,setProcessingIndeterminateTask:pY}=VZ.actions,gY=VZ.reducer;function mY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function vY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function bY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function yY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function xY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}const wY=cU((e=>e.system),(e=>e.shouldDisplayGuides)),SY=({children:e,feature:t})=>{const n=roe(wY),{text:r}=Nq[t];return n?ld(TF,{trigger:"hover",children:[sd(HF,{children:sd(gI,{children:e})}),ld(FF,{className:"guide-popover-content",maxWidth:"400px",onClick:e=>e.preventDefault(),cursor:"initial",children:[sd(OF,{className:"guide-popover-arrow"}),sd("div",{className:"guide-popover-guide-content",children:r})]})]}):null},kY=rS((({feature:e,icon:t=mY},n)=>sd(SY,{feature:e,children:sd(gI,{ref:n,children:sd(wS,{marginBottom:"-.15rem",as:t})})})));function CY(e){const{header:t,feature:n,content:r,additionalHeaderComponents:o}=e;return ld(sT,{className:"advanced-settings-item",children:[sd(tT,{className:"advanced-settings-header",children:ld(kI,{width:"100%",gap:"0.5rem",align:"center",children:[sd(gI,{flexGrow:1,textAlign:"left",children:t}),o,n&&sd(kY,{feature:n}),sd(aT,{})]})}),sd(lT,{className:"advanced-settings-panel",children:r})]})}const _Y=e=>{const{accordionInfo:t}=e,n=roe((e=>e.system.openAccordions)),r=noe();return sd(cT,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:e=>r(QZ(e)),className:"advanced-settings",children:(()=>{const e=[];return t&&Object.keys(t).forEach((n=>{const{header:r,feature:o,content:i,additionalHeaderComponents:a}=t[n];e.push(sd(CY,{header:r,feature:o,content:i,additionalHeaderComponents:a},n))})),e})()})};function EY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function LY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function PY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function MY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function AY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function TY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function OY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function IY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function RY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function NY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function DY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function zY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function BY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function FY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function jY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function HY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function WY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function UY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function VY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function GY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function $Y(e){return rZ({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function qY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function ZY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function YY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function XY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function KY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function QY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function JY(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function eX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function tX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function nX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function rX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function oX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function iX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function aX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function sX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function lX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function cX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function uX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function dX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function hX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function fX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function pX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function gX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function mX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function vX(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const bX=e=>e.system,yX=e=>e.system.toastQueue,xX=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],wX=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],SX=e=>"line"===e.kind&&"mask"===e.layer,kX=e=>"image"===e.kind&&"base"===e.layer,CX=e=>"line"===e.kind,_X=e=>e.canvas,EX=cU([_X,RZ,bX],((e,t,n)=>e.layerState.stagingArea.images.length>0||"unifiedCanvas"===t&&n.isProcessing)),LX=e=>e.canvas.layerState.objects.find(kX),PX=cU([e=>e.options,e=>e.system,LX,RZ],((e,t,n,r)=>{const{prompt:o,shouldGenerateVariations:i,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:c,isConnected:u}=t;let d=!0;const h=[];return o&&!Boolean(o.match(/^[\s\r\n]+$/))||(d=!1,h.push("Missing prompt")),"img2img"!==r||s||(d=!1,h.push("No initial image selected")),c&&(d=!1,h.push("System Busy")),u||(d=!1,h.push("System Disconnected")),i&&(!CG(a)&&""!==a||-1===l)&&(d=!1,h.push("Seed-Weights badly formatted.")),{isReady:d,reasonsWhyNotReady:h}}),{memoizeOptions:{equalityCheck:LG.isEqual,resultEqualityCheck:LG.isEqual}}),MX=MU("socketio/generateImage"),AX=MU("socketio/runESRGAN"),TX=MU("socketio/runFacetool"),OX=MU("socketio/deleteImage"),IX=MU("socketio/requestImages"),RX=MU("socketio/requestNewImages"),NX=MU("socketio/cancelProcessing"),DX=MU("socketio/requestSystemConfig"),zX=MU("socketio/requestModelChange"),BX=MU("socketio/saveStagingAreaImageToGallery"),FX=MU("socketio/requestEmptyTempFolder"),jX=rS(((e,t)=>{const{children:n,tooltip:r="",tooltipProps:o,styleClass:i,...a}=e;return sd(qH,{label:r,...o,children:sd(IT,{ref:t,className:["invokeai__button",i].join(" "),...a,children:n})})}));function HX(e){const{iconButton:t=!1,...n}=e,r=noe(),{isReady:o}=roe(PX),i=roe(RZ),a=()=>{r(MX(i))};return Eq(["ctrl+enter","meta+enter"],(()=>{r(MX(i))}),{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,i]),sd("div",{style:{flexGrow:4},children:t?sd(dZ,{"aria-label":"Invoke",type:"submit",icon:sd(nX,{}),isDisabled:!o,onClick:a,className:"invoke-btn",tooltip:"Invoke",tooltipProps:{placement:"bottom"},...n}):sd(jX,{"aria-label":"Invoke",type:"submit",isDisabled:!o,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const WX=cU((e=>e.system),(e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable})),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function UX(e){const{...t}=e,n=noe(),{isProcessing:r,isConnected:o,isCancelable:i}=roe(WX),a=()=>n(NX());return Eq("shift+x",(()=>{(o||r)&&i&&a()}),[o,r,i]),sd(dZ,{icon:sd(xY,{}),tooltip:"Cancel","aria-label":"Cancel",isDisabled:!o||!r||!i,onClick:a,styleClass:"cancel-btn",...t})}const VX=cU((e=>e.options),(e=>e.shouldLoopback)),GX=()=>{const e=noe(),t=roe(VX);return sd(dZ,{"aria-label":"Toggle Loopback",tooltip:"Toggle Loopback",styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:sd(iX,{}),onClick:()=>{e(ane(!t))}})},$X=()=>{const e=roe(RZ);return ld("div",{className:"process-buttons",children:[sd(HX,{}),"img2img"===e&&sd(GX,{}),sd(UX,{})]})},qX=cU([e=>e.options,RZ],((e,t)=>({prompt:e.prompt,activeTabName:t})),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),ZX=()=>{const e=noe(),{prompt:t,activeTabName:n}=roe(qX),{isReady:r}=roe(PX),o=i.exports.useRef(null);Eq("alt+a",(()=>{o.current?.focus()}),[]);return sd("div",{className:"prompt-bar",children:sd(GT,{isInvalid:0===t.length||Boolean(t.match(/^[\s\r\n]+$/)),children:sd(CH,{id:"prompt",name:"prompt",placeholder:"Type prompt here. [negative tokens], (upweight)++, (downweight)--, swap and blend are available (see docs)",size:"lg",value:t,onChange:t=>{e(Zte(t.target.value))},onKeyDown:t=>{"Enter"===t.key&&!1===t.shiftKey&&r&&(t.preventDefault(),e(MX(n)))},resize:"vertical",height:30,ref:o,_placeholder:{color:"var(--text-color-secondary)"}})})})};function YX(e){return rZ({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function XX(e){return rZ({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function KX(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const QX=!1,JX=j.createContext(null);var eK=function(e){return e.scrollTop},tK="unmounted",nK="exited",rK="entering",oK="entered",iK="exiting",aK=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=nK,r.appearStatus=rK):o=oK:o=t.unmountOnExit||t.mountOnEnter?tK:nK,r.state={status:o},r.nextCallback=null,r}ND(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===tK?{status:nK}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==rK&&n!==oK&&(t=rK):n!==rK&&n!==oK||(t=iK)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===rK){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this);n&&eK(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===nK&&this.setState({status:tK})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[Zu.findDOMNode(this),r],i=o[0],a=o[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||QX?this.safeSetState({status:oK},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:rK},(function(){t.props.onEntering(i,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:oK},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Zu.findDOMNode(this);t&&!QX?(this.props.onExit(r),this.safeSetState({status:iK},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:nK},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:nK},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===tK)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=pD(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return sd(JX.Provider,{value:null,children:"function"==typeof n?n(e,r):j.cloneElement(j.Children.only(n),r)})},t}(j.Component);function sK(){}aK.contextType=JX,aK.propTypes={},aK.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:sK,onEntering:sK,onEntered:sK,onExit:sK,onExiting:sK,onExited:sK},aK.UNMOUNTED=tK,aK.EXITED=nK,aK.ENTERING=rK,aK.ENTERED=oK,aK.EXITING=iK;const lK=aK;var cK=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))},uK=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=KX(n.className,r):n.setAttribute("class",KX(n.className&&n.className.baseVal||"",r)));var n,r}))},dK=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oMath.floor(e/t)*t,pK=(e,t)=>Math.round(e/t)*t,gK=(e,t,n,r,o,i,a)=>({x:e/2-(n+o/2)*a,y:t/2-(r+i/2)*a}),mK=(e,t,n,r,o=.95)=>{const i=e*o/n,a=t*o/r;return Math.min(1,Math.min(i,a))},vK=.95,bK=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),yK=e=>{const{width:t,height:n}=e,r={width:t,height:n},o=t/n;let i=t*n,a=448;for(;i<262144;){if(a+=64,t===n){r.width=512,r.height=512;break}o>1?(r.width=a,r.height=pK(a/o,64)):o<1&&(r.height=a,r.width=pK(a*o,64)),i=r.width*r.height}return r},xK={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},wK=TU({name:"canvas",initialState:{boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:xK,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,"move"!==n&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;"move"!==t&&(e.tool="brush"===t?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter((e=>!SX(e))),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,o={width:fK(LG.clamp(n.width,64,512),64),height:fK(LG.clamp(n.height,64,512),64)},i={x:pK(n.width/2-o.width/2,64),y:pK(n.height/2-o.height/2,64)};if("auto"===e.boundingBoxScaleMethod){const t=yK(o);e.scaledBoundingBoxDimensions=t}e.boundingBoxDimensions=o,e.boundingBoxCoordinates=i,e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.layerState={...xK,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=mK(r.width,r.height,n.width,n.height,vK),s=gK(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=(r=t.payload,{width:pK(r.width,64),height:pK(r.height,64)});var r;if(e.boundingBoxDimensions=n,"auto"===e.boundingBoxScaleMethod){const t=yK(n);e.scaledBoundingBoxDimensions=t}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=bK(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldUseInpaintReplace:(e,t)=>{e.shouldUseInpaintReplace=t.payload},setInpaintReplace:(e,t)=>{e.inpaintReplace=t.payload},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;n&&r&&(e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...xK.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:o,brushSize:i,shouldRestrictStrokesToBox:a}=e;if("move"===n||"colorPicker"===n)return;const s=i/2,l="base"===r&&"brush"===n?{color:o}:{};e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const c={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(c.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(c),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(CX);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(LG.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.layerState=xK,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(kX),o={width:Math.floor(t),height:Math.floor(n)};if(!r){const t=mK(o.width,o.height,512,512,vK),n=gK(o.width,o.height,0,0,512,512,t),r={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.stageDimensions=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=r,"auto"===e.boundingBoxScaleMethod){const t=yK(r);e.scaledBoundingBoxDimensions=t}return}const{width:i,height:a}=r,s=mK(t,n,i,a,.95),l=gK(o.width,o.height,0,0,i,a,s);e.minimumStageScale=s,e.stageScale=s,e.stageCoordinates=bK(l),e.stageDimensions=o,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(kX)){const t=mK(r.width,r.height,512,512,vK),n=gK(r.width,r.height,0,0,512,512,t),o={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=o,"auto"===e.boundingBoxScaleMethod){const t=yK(o);e.scaledBoundingBoxDimensions=t}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:o}}=e,{x:i,y:a,width:s,height:l}=n;if(0!==s&&0!==l){const t=mK(r,o,s,l,vK),n=gK(r,o,i,a,s,l,t);e.stageScale=t,e.stageCoordinates=n}else{const t=mK(r,o,512,512,vK),n=gK(r,o,0,0,512,512,t),i={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=i,"auto"===e.boundingBoxScaleMethod){const t=yK(i);e.scaledBoundingBoxDimensions=t}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...xK.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:o}=e,i=r.width/o,a=r.height/o;if(n.x<0||n.x+t.width>i||n.y<0||n.y+t.height>a){const t={width:fK(LG.clamp(i,64,512),64),height:fK(LG.clamp(a,64,512),64)},n={x:pK(i/2-t.width/2,64),y:pK(a/2-t.height/2,64)};if(e.boundingBoxDimensions=t,e.boundingBoxCoordinates=n,"auto"===e.boundingBoxScaleMethod){const n=yK(t);e.scaledBoundingBoxDimensions=n}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,"auto"===t.payload){const t=yK(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=t}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(LG.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:SK,addFillRect:kK,addImageToStagingArea:CK,addLine:_K,addPointToCurrentLine:EK,clearCanvasHistory:LK,clearMask:PK,commitColorPickerColor:MK,commitStagingAreaImage:AK,discardStagedImages:TK,fitBoundingBoxToStage:OK,mouseLeftCanvas:IK,nextStagingAreaImage:RK,prevStagingAreaImage:NK,redo:DK,resetCanvas:zK,resetCanvasInteractionState:BK,resetCanvasView:FK,resizeAndScaleCanvas:jK,resizeCanvas:HK,setBoundingBoxCoordinates:WK,setBoundingBoxDimensions:UK,setBoundingBoxPreviewFill:VK,setBoundingBoxScaleMethod:GK,setBrushColor:$K,setBrushSize:qK,setCanvasContainerDimensions:ZK,setColorPickerColor:YK,setCursorPosition:XK,setDoesCanvasNeedScaling:KK,setInitialCanvasImage:QK,setInpaintReplace:JK,setIsDrawing:eQ,setIsMaskEnabled:tQ,setIsMouseOverBoundingBox:nQ,setIsMoveBoundingBoxKeyHeld:rQ,setIsMoveStageKeyHeld:oQ,setIsMovingBoundingBox:iQ,setIsMovingStage:aQ,setIsTransformingBoundingBox:sQ,setLayer:lQ,setMaskColor:cQ,setMergedCanvas:uQ,setShouldAutoSave:dQ,setShouldCropToBoundingBoxOnSave:hQ,setShouldDarkenOutsideBoundingBox:fQ,setShouldLockBoundingBox:pQ,setShouldPreserveMaskedArea:gQ,setShouldShowBoundingBox:mQ,setShouldShowBrush:vQ,setShouldShowBrushPreview:bQ,setShouldShowCanvasDebugInfo:yQ,setShouldShowCheckboardTransparency:xQ,setShouldShowGrid:wQ,setShouldShowIntermediates:SQ,setShouldShowStagingImage:kQ,setShouldShowStagingOutline:CQ,setShouldSnapToGrid:_Q,setShouldUseInpaintReplace:EQ,setStageCoordinates:LQ,setStageScale:PQ,setTool:MQ,toggleShouldLockBoundingBox:AQ,toggleTool:TQ,undo:OQ,setScaledBoundingBoxDimensions:IQ,setShouldRestrictStrokesToBox:RQ}=wK.actions,NQ=wK.reducer,DQ=""+new URL("logo.13003d72.png",n.meta.url).href,zQ=cU((e=>e.options),(e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),BQ=e=>{const t=noe(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:o}=roe(zQ),a=i.exports.useRef(null),s=i.exports.useRef(null),l=i.exports.useRef(null),{children:c}=e;Eq("o",(()=>{t(hne(!n)),o&&setTimeout((()=>t(KK(!0))),400)}),[n,o]),Eq("esc",(()=>{t(hne(!1))}),{enabled:()=>!o,preventDefault:!0},[o]),Eq("shift+o",(()=>{h(),t(KK(!0))}),[o]);const u=i.exports.useCallback((()=>{o||(t(Gte(s.current?s.current.scrollTop:0)),t(hne(!1)),t(ine(!1)))}),[t,o]),d=()=>{l.current&&window.clearTimeout(l.current)},h=()=>{t(sne(!o)),t(KK(!0))};return i.exports.useEffect((()=>{function e(e){a.current&&!a.current.contains(e.target)&&u()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[u]),sd(hK,{nodeRef:a,in:n||r&&!o,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:sd("div",{className:"options-panel-wrapper","data-pinned":o,tabIndex:1,ref:a,onMouseEnter:o?void 0:d,onMouseOver:o?void 0:d,style:{borderRight:o?"":"0.3rem solid var(--tab-list-text-inactive)"},children:sd("div",{className:"options-panel-margin",children:ld("div",{className:"options-panel",ref:s,onMouseLeave:e=>{e.target!==s.current?d():!o&&(l.current=window.setTimeout((()=>u()),500))},children:[sd(qH,{label:"Pin Options Panel",children:sd("div",{className:"options-panel-pin-button","data-selected":o,onClick:h,children:sd(o?YX:XX,{})})}),!o&&ld("div",{className:"invoke-ai-logo-wrapper",children:[sd("img",{src:DQ,alt:"invoke-ai-logo"}),ld("h1",{children:["invoke ",sd("strong",{children:"ai"})]})]}),c]})})})})};function FQ(){const e={seed:{header:"Seed",feature:Rq.SEED,content:sd(kZ,{})},variations:{header:"Variations",feature:Rq.VARIATIONS,content:sd(OZ,{}),additionalHeaderComponents:sd(PZ,{})},face_restore:{header:"Face Restoration",feature:Rq.FACE_CORRECTION,content:sd(Zq,{}),additionalHeaderComponents:sd(Xq,{})},upscale:{header:"Upscaling",feature:Rq.UPSCALE,content:sd(EZ,{}),additionalHeaderComponents:sd(LZ,{})},other:{header:"Other Options",feature:Rq.OTHER,content:sd(mZ,{})}};return ld(BQ,{children:[sd(ZX,{}),sd($X,{}),sd(UZ,{}),sd(fZ,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),sd(Kq,{}),sd(_Y,{accordionInfo:e})]})}const jQ=i.exports.createContext(null),HQ=e=>{const{styleClass:t}=e,n=i.exports.useContext(jQ);return sd("div",{className:`image-uploader-button-outer ${t}`,onClick:()=>{n&&n()},children:ld("div",{className:"image-upload-button",children:[sd(gX,{}),sd(LI,{size:"lg",children:"Click or Drag and Drop"})]})})},WQ=cU((e=>e.system),(e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),UQ=i.exports.forwardRef((({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:a}=KO(),s=noe(),{shouldConfirmOnDelete:l,isConnected:c,isProcessing:u}=roe(WQ),d=i.exports.useRef(null),h=()=>{c&&!u&&e&&s(OX(e)),a()};Eq("delete",(()=>{l?o():h()}),[e,l]);return ld(ad,{children:[i.exports.cloneElement(t,{onClick:e?e=>{e.stopPropagation(),l?o():h()}:void 0,ref:n}),sd($B,{isOpen:r,leastDestructiveRef:d,onClose:a,children:sd(GB,{children:ld(qB,{className:"modal",children:[sd(UB,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),sd(RB,{children:ld(kI,{direction:"column",gap:5,children:[sd(WI,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),sd(GT,{children:ld(kI,{alignItems:"center",children:[sd(JT,{mb:0,children:"Don't ask me again"}),sd(tH,{checked:!l,onChange:e=>s(KZ(!e.target.checked))})]})})]})}),ld(WB,{children:[sd(IT,{ref:d,onClick:a,className:"modal-close-btn",children:"Cancel"}),sd(IT,{colorScheme:"red",onClick:h,ml:3,children:"Delete"})]})]})})})]})})),VQ=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:o=!0,...i}=e;return ld(TF,{...i,children:[sd(HF,{children:t}),ld(FF,{className:`invokeai__popover-content ${r}`,children:[o&&sd(OF,{className:"invokeai__popover-arrow"}),n]})]})},GQ=cU([e=>e.system,e=>e.options,e=>e.gallery,RZ],((e,t,n,r)=>{const{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:c,shouldShowImageDetails:u,isLightBoxOpen:d}=t,{intermediateImage:h,currentImage:f}=n;return{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:c,shouldDisableToolbarButtons:Boolean(h)||!f,currentImage:f,shouldShowImageDetails:u,activeTabName:r,isLightBoxOpen:d}}),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),$Q=()=>{const e=noe(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:o,upscalingLevel:i,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:c,isLightBoxOpen:u,activeTabName:d}=roe(GQ),h=DH(),f=()=>{c&&(u&&e(Wte(!1)),e(Hte(c)),e(Pte("img2img")))};Eq("shift+i",(()=>{c?(f(),h({title:"Sent To Image To Image",status:"success",duration:2500,isClosable:!0})):h({title:"No Image Loaded",description:"No image found to send to image to image module.",status:"error",duration:2500,isClosable:!0})}),[c]);const p=()=>{c&&(c.metadata&&e(Ate(c.metadata)),"img2img"===c.metadata?.image.type?e(Pte("img2img")):"txt2img"===c.metadata?.image.type&&e(Pte("txt2img")))};Eq("a",(()=>{["txt2img","img2img"].includes(c?.metadata?.image?.type)?(p(),h({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})):h({title:"Parameters Not Set",description:"No metadata found for this image.",status:"error",duration:2500,isClosable:!0})}),[c]);const g=()=>{c?.metadata&&e(tne(c.metadata.image.seed))};Eq("s",(()=>{c?.metadata?.image?.seed?(g(),h({title:"Seed Set",status:"success",duration:2500,isClosable:!0})):h({title:"Seed Not Set",description:"Could not find seed for this image.",status:"error",duration:2500,isClosable:!0})}),[c]);const m=()=>c?.metadata?.image?.prompt&&e(Zte(c.metadata.image.prompt));Eq("p",(()=>{c?.metadata?.image?.prompt?(m(),h({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})):h({title:"Prompt Not Set",description:"Could not find prompt for this image.",status:"error",duration:2500,isClosable:!0})}),[c]);const v=()=>{c&&e(AX(c))};Eq("Shift+U",(()=>{o&&!s&&n&&!t&&i?v():h({title:"Upscaling Failed",status:"error",duration:2500,isClosable:!0})}),[c,o,s,n,t,i]);const b=()=>{c&&e(TX(c))};Eq("Shift+R",(()=>{r&&!s&&n&&!t&&a?b():h({title:"Face Restoration Failed",status:"error",duration:2500,isClosable:!0})}),[c,r,s,n,t,a]);const y=()=>e(dne(!l));Eq("i",(()=>{c?y():h({title:"Failed to load metadata",status:"error",duration:2500,isClosable:!0})}),[c,l]);return ld("div",{className:"current-image-options",children:[ld(NT,{isAttached:!0,children:[sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{"aria-label":"Send to...",icon:sd(cX,{})}),children:ld("div",{className:"current-image-send-to-popover",children:[sd(jX,{size:"sm",onClick:f,leftIcon:sd(uX,{}),children:"Send to Image to Image"}),sd(jX,{size:"sm",onClick:()=>{c&&(u&&e(Wte(!1)),e(QK(c)),e(KK(!0)),"unifiedCanvas"!==d&&e(Pte("unifiedCanvas")),h({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0}))},leftIcon:sd(uX,{}),children:"Send to Unified Canvas"}),sd(jX,{size:"sm",onClick:()=>{navigator.clipboard.writeText(c?window.location.toString()+c.url:"").then((()=>{h({title:"Image Link Copied",status:"success",duration:2500,isClosable:!0})}))},leftIcon:sd(BY,{}),children:"Copy Link to Image"}),sd(jX,{leftIcon:sd(jY,{}),size:"sm",children:sd(MI,{download:!0,href:c?.url,children:"Download Image"})})]})}),sd(dZ,{icon:sd(UY,{}),tooltip:u?"Close Viewer (Z)":"Open In Viewer (Z)","aria-label":u?"Close Viewer (Z)":"Open In Viewer (Z)","data-selected":u,onClick:()=>{e(Wte(!u))}})]}),ld(NT,{isAttached:!0,children:[sd(dZ,{icon:sd(oX,{}),tooltip:"Use Prompt (P)","aria-label":"Use Prompt (P)",isDisabled:!c?.metadata?.image?.prompt,onClick:m}),sd(dZ,{icon:sd(lX,{}),tooltip:"Use Seed (S)","aria-label":"Use Seed (S)",isDisabled:!c?.metadata?.image?.seed,onClick:g}),sd(dZ,{icon:sd(RY,{}),tooltip:"Use All (A)","aria-label":"Use All (A)",isDisabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),onClick:p})]}),ld(NT,{isAttached:!0,children:[sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{icon:sd(ZY,{}),"aria-label":"Restore Faces"}),children:ld("div",{className:"current-image-postprocessing-popover",children:[sd(Zq,{}),sd(jX,{isDisabled:!(r&&c&&n&&!t&&a),onClick:b,children:"Restore Faces"})]})}),sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{icon:sd(WY,{}),"aria-label":"Upscale"}),children:ld("div",{className:"current-image-postprocessing-popover",children:[sd(EZ,{}),sd(jX,{isDisabled:!(o&&c&&n&&!t&&i),onClick:v,children:"Upscale Image"})]})})]}),sd(NT,{isAttached:!0,children:sd(dZ,{icon:sd(zY,{}),tooltip:"Info (I)","aria-label":"Info (I)","data-selected":l,onClick:y})}),sd(UQ,{image:c,children:sd(dZ,{icon:sd(fX,{}),tooltip:"Delete Image","aria-label":"Delete Image",isDisabled:!c||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})},qQ=TU({name:"gallery",initialState:{currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,o=e.categories[r].images,i=o.filter((e=>e.uuid!==n));if(n===e.currentImageUuid){const t=o.findIndex((e=>e.uuid===n)),r=EG.exports.clamp(t,0,i.length-1);e.currentImage=i.length?i[r]:void 0,e.currentImageUuid=i.length?i[r].uuid:""}e.categories[r].images=i},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:o,url:i,mtime:a}=n,s=e.categories[r];s.images.find((e=>e.url===i&&e.mtime===a))||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=o,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r>0){const t=n[r-1];e.currentImage=t,e.currentImageUuid=t.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:o}=t.payload,i=e.categories[o].images;if(n.length>0){const t=n.filter((e=>!i.find((t=>t.url===e.url&&t.mtime===e.mtime))));if(e.categories[o].images=i.concat(t).sort(((e,t)=>t.mtime-e.mtime)),!e.currentImage){const t=n[0];e.currentImage=t,e.currentImageUuid=t.uuid}e.categories[o].latest_mtime=n[0].mtime,e.categories[o].earliest_mtime=n[n.length-1].mtime}void 0!==r&&(e.categories[o].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:ZQ,clearIntermediateImage:YQ,removeImage:XQ,setCurrentImage:KQ,addGalleryImages:QQ,setIntermediateImage:JQ,selectNextImage:eJ,selectPrevImage:tJ,setShouldPinGallery:nJ,setShouldShowGallery:rJ,setGalleryScrollPosition:oJ,setGalleryImageMinimumWidth:iJ,setGalleryImageObjectFit:aJ,setShouldHoldGalleryOpen:sJ,setShouldAutoSwitchToNewImages:lJ,setCurrentCategory:cJ,setGalleryWidth:uJ,setShouldUseSingleGalleryColumn:dJ}=qQ.actions,hJ=qQ.reducer;SS({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"}),SS({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"}),SS({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"}),SS({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"}),SS({displayName:"SunIcon",path:ld("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[sd("circle",{cx:"12",cy:"12",r:"5"}),sd("path",{d:"M12 1v2"}),sd("path",{d:"M12 21v2"}),sd("path",{d:"M4.22 4.22l1.42 1.42"}),sd("path",{d:"M18.36 18.36l1.42 1.42"}),sd("path",{d:"M1 12h2"}),sd("path",{d:"M21 12h2"}),sd("path",{d:"M4.22 19.78l1.42-1.42"}),sd("path",{d:"M18.36 5.64l1.42-1.42"})]})}),SS({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"}),SS({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:sd("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})}),SS({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"}),SS({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}),SS({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"}),SS({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"}),SS({displayName:"ViewIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),sd("circle",{cx:"12",cy:"12",r:"2"})]})}),SS({displayName:"ViewOffIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),sd("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"})]})}),SS({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"}),SS({displayName:"DeleteIcon",path:sd("g",{fill:"currentColor",children:sd("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})}),SS({displayName:"RepeatIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),sd("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"})]})}),SS({displayName:"RepeatClockIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),sd("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"})]})}),SS({displayName:"EditIcon",path:ld("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[sd("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),sd("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),SS({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),SS({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}),SS({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),SS({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),SS({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"}),SS({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"}),SS({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"}),SS({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"}),SS({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var fJ=SS({displayName:"ExternalLinkIcon",path:ld("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[sd("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),sd("path",{d:"M15 3h6v6"}),sd("path",{d:"M10 14L21 3"})]})});function pJ(e){return rZ({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}SS({displayName:"LinkIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),sd("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"})]})}),SS({displayName:"PlusSquareIcon",path:ld("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[sd("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),sd("path",{d:"M12 8v8"}),sd("path",{d:"M8 12h8"})]})}),SS({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"}),SS({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"}),SS({displayName:"TimeIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),sd("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"})]})}),SS({displayName:"ArrowRightIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),sd("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"})]})}),SS({displayName:"ArrowLeftIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),sd("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"})]})}),SS({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"}),SS({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"}),SS({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"}),SS({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"}),SS({displayName:"EmailIcon",path:ld("g",{fill:"currentColor",children:[sd("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),sd("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"})]})}),SS({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"}),SS({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"}),SS({displayName:"SpinnerIcon",path:ld(ad,{children:[sd("defs",{children:ld("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[sd("stop",{stopColor:"currentColor",offset:"0%"}),sd("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),ld("g",{transform:"translate(2)",fill:"none",children:[sd("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),sd("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),sd("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})}),SS({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),SS({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:sd("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})}),SS({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"}),SS({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"}),SS({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"}),SS({displayName:"InfoOutlineIcon",path:ld("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[sd("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),sd("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),sd("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})}),SS({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}),SS({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}),SS({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"}),SS({displayName:"QuestionOutlineIcon",path:ld("g",{stroke:"currentColor",strokeWidth:"1.5",children:[sd("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),sd("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),sd("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})}),SS({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"}),SS({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),SS({viewBox:"0 0 14 14",path:sd("g",{fill:"currentColor",children:sd("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})}),SS({displayName:"MinusIcon",path:sd("g",{fill:"currentColor",children:sd("rect",{height:"4",width:"20",x:"2",y:"10"})})}),SS({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});const gJ=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:i=!1})=>ld(kI,{gap:2,children:[n&&sd(qH,{label:`Recall ${e}`,children:sd(DT,{"aria-label":"Use this parameter",icon:sd(pJ,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),i&&sd(qH,{label:`Copy ${e}`,children:sd(DT,{"aria-label":`Copy ${e}`,icon:sd(BY,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),ld(kI,{direction:o?"column":"row",children:[ld(WI,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?ld(MI,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",sd(fJ,{mx:"2px"})]}):sd(WI,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),mJ=i.exports.memo((({image:e,styleClass:t})=>{const n=noe();Eq("esc",(()=>{n(dne(!1))}));const r=e?.metadata?.image||{},o=e?.dreamPrompt,{cfg_scale:i,fit:a,height:s,hires_fix:l,init_image_path:c,mask_image_path:u,orig_path:d,perlin:h,postprocessing:f,prompt:p,sampler:g,scale:m,seamless:v,seed:b,steps:y,strength:x,threshold:w,type:S,variations:k,width:C}=r,_=JSON.stringify(e.metadata,null,2);return sd("div",{className:`image-metadata-viewer ${t}`,children:ld(kI,{gap:1,direction:"column",width:"100%",children:[ld(kI,{gap:2,children:[sd(WI,{fontWeight:"semibold",children:"File:"}),ld(MI,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,sd(fJ,{mx:"2px"})]})]}),Object.keys(r).length>0?ld(ad,{children:[S&&sd(gJ,{label:"Generation type",value:S}),e.metadata?.model_weights&&sd(gJ,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(S)&&sd(gJ,{label:"Original image",value:d}),"gfpgan"===S&&void 0!==x&&sd(gJ,{label:"Fix faces strength",value:x,onClick:()=>n(Nte(x))}),"esrgan"===S&&void 0!==m&&sd(gJ,{label:"Upscaling scale",value:m,onClick:()=>n(bne(m))}),"esrgan"===S&&void 0!==x&&sd(gJ,{label:"Upscaling strength",value:x,onClick:()=>n(yne(x))}),p&&sd(gJ,{label:"Prompt",labelPosition:"top",value:kG(p),onClick:()=>n(Zte(p))}),void 0!==b&&sd(gJ,{label:"Seed",value:b,onClick:()=>n(tne(b))}),void 0!==w&&sd(gJ,{label:"Noise Threshold",value:w,onClick:()=>n(mne(w))}),void 0!==h&&sd(gJ,{label:"Perlin Noise",value:h,onClick:()=>n(qte(h))}),g&&sd(gJ,{label:"Sampler",value:g,onClick:()=>n(Yte(g))}),y&&sd(gJ,{label:"Steps",value:y,onClick:()=>n(gne(y))}),void 0!==i&&sd(gJ,{label:"CFG scale",value:i,onClick:()=>n(Ote(i))}),k&&k.length>0&&sd(gJ,{label:"Seed-weight pairs",value:_G(k),onClick:()=>n(nne(_G(k)))}),v&&sd(gJ,{label:"Seamless",value:v,onClick:()=>n(Kte(v))}),l&&sd(gJ,{label:"High Resolution Optimization",value:l,onClick:()=>n(Bte(l))}),C&&sd(gJ,{label:"Width",value:C,onClick:()=>n(wne(C))}),s&&sd(gJ,{label:"Height",value:s,onClick:()=>n(zte(s))}),c&&sd(gJ,{label:"Initial image",value:c,isLink:!0,onClick:()=>n(Hte(c))}),u&&sd(gJ,{label:"Mask image",value:u,isLink:!0,onClick:()=>n(Vte(u))}),"img2img"===S&&x&&sd(gJ,{label:"Image to image strength",value:x,onClick:()=>n(Fte(x))}),a&&sd(gJ,{label:"Image to image fit",value:a,onClick:()=>n(rne(a))}),f&&f.length>0&&ld(ad,{children:[sd(LI,{size:"sm",children:"Postprocessing"}),f.map(((e,t)=>{if("esrgan"===e.type){const{scale:r,strength:o}=e;return ld(kI,{pl:"2rem",gap:1,direction:"column",children:[sd(WI,{size:"md",children:`${t+1}: Upscale (ESRGAN)`}),sd(gJ,{label:"Scale",value:r,onClick:()=>n(bne(r))}),sd(gJ,{label:"Strength",value:o,onClick:()=>n(yne(o))})]},t)}if("gfpgan"===e.type){const{strength:r}=e;return ld(kI,{pl:"2rem",gap:1,direction:"column",children:[sd(WI,{size:"md",children:`${t+1}: Face restoration (GFPGAN)`}),sd(gJ,{label:"Strength",value:r,onClick:()=>{n(Nte(r)),n(Dte("gfpgan"))}})]},t)}if("codeformer"===e.type){const{strength:r,fidelity:o}=e;return ld(kI,{pl:"2rem",gap:1,direction:"column",children:[sd(WI,{size:"md",children:`${t+1}: Face restoration (Codeformer)`}),sd(gJ,{label:"Strength",value:r,onClick:()=>{n(Nte(r)),n(Dte("codeformer"))}}),o&&sd(gJ,{label:"Fidelity",value:o,onClick:()=>{n(Ite(o)),n(Dte("codeformer"))}})]},t)}}))]}),o&&sd(gJ,{withCopy:!0,label:"Dream Prompt",value:o}),ld(kI,{gap:2,direction:"column",children:[ld(kI,{gap:2,children:[sd(qH,{label:"Copy metadata JSON",children:sd(DT,{"aria-label":"Copy metadata JSON",icon:sd(BY,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(_)})}),sd(WI,{fontWeight:"semibold",children:"Metadata JSON:"})]}),sd("div",{className:"image-json-viewer",children:sd("pre",{children:_})})]})]}):sd(bI,{width:"100%",pt:10,children:sd(WI,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})}),((e,t)=>e.image.uuid===t.image.uuid)),vJ=cU([e=>e.gallery,e=>e.options],((e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex((t=>t.uuid===e?.currentImage?.uuid)),l=a.length;return{imageToDisplay:o||r,isIntermediate:Boolean(o),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:0===s,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:i,shouldShowPrevImageButton:0===s,shouldShowNextImageButton:!isNaN(s)&&s===l-1}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function bJ(){const e=noe(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:o,isIntermediate:a}=roe(vJ),[s,l]=i.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return ld("div",{className:"current-image-preview",children:[o&&sd(_T,{src:o.url,width:o.width,height:o.height,style:{imageRendering:a?"pixelated":"initial"}}),!r&&ld("div",{className:"current-image-next-prev-buttons",children:[sd("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!t&&sd(DT,{"aria-label":"Previous image",icon:sd(MY,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(tJ())}})}),sd("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!n&&sd(DT,{"aria-label":"Next image",icon:sd(AY,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(eJ())}})})]}),r&&o&&sd(mJ,{image:o,styleClass:"current-image-metadata"})]})}const yJ=cU([e=>e.gallery,e=>e.options,RZ],((e,t,n)=>{const{currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t;return{activeTabName:n,shouldShowImageDetails:i,hasAnImageToDisplay:r||o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),xJ=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=roe(yJ);return sd("div",{className:"current-image-area","data-tab-name":t,children:e?ld(ad,{children:[sd($Q,{}),sd(bJ,{})]}):sd("div",{className:"current-image-display-placeholder",children:sd(yY,{})})})},wJ=()=>{const e=i.exports.useContext(jQ);return sd(dZ,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:sd(gX,{}),onClick:e||void 0})};function SJ(){const e=roe((e=>e.options.initialImage)),t=noe(),n=DH();return ld(ad,{children:[ld("div",{className:"init-image-preview-header",children:[sd("h2",{children:"Initial Image"}),sd(wJ,{})]}),e&&sd("div",{className:"init-image-preview",children:sd(_T,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:"string"==typeof e?e:e.url,onError:()=>{n({title:"Problem loading parameters",description:"Unable to load init image.",status:"error",isClosable:!0}),t(_te())}})})]})}const kJ=()=>{const e=roe((e=>e.options.initialImage)),{currentImage:t}=roe((e=>e.gallery));return ld("div",{className:"workarea-split-view",children:[sd("div",{className:"workarea-split-view-left",children:e?sd("div",{className:"image-to-image-area",children:sd(SJ,{})}):sd(HQ,{})}),t&&sd("div",{className:"workarea-split-view-right",children:sd(xJ,{})})]})};function CJ(e){return rZ({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}var _J=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),EJ=globalThis&&globalThis.__assign||function(){return EJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const t=n.map((e=>i.exports.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return i.exports.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=i.exports.createContext(r),a=n.length;function s(t){const{scope:n,children:r,...s}=t,l=(null==n?void 0:n[e][a])||o,c=i.exports.useMemo((()=>s),Object.values(s));return i.exports.createElement(l.Provider,{value:c},r)}return n=[...n,r],s.displayName=t+"Provider",[s,function(n,s){const l=(null==s?void 0:s[e][a])||o,c=i.exports.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},qJ(r,...t)]}function qJ(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return i.exports.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function ZJ(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function YJ(...e){return i.exports.useCallback(ZJ(...e),e)}const XJ=i.exports.forwardRef(((e,t)=>{const{children:n,...r}=e,o=i.exports.Children.toArray(n),a=o.find(JJ);if(a){const e=a.props.children,n=o.map((t=>t===a?i.exports.Children.count(e)>1?i.exports.Children.only(null):i.exports.isValidElement(e)?e.props.children:null:t));return i.exports.createElement(KJ,mp({},r,{ref:t}),i.exports.isValidElement(e)?i.exports.cloneElement(e,void 0,n):null)}return i.exports.createElement(KJ,mp({},r,{ref:t}),n)}));XJ.displayName="Slot";const KJ=i.exports.forwardRef(((e,t)=>{const{children:n,...r}=e;return i.exports.isValidElement(n)?i.exports.cloneElement(n,{...e0(r,n.props),ref:ZJ(t,n.ref)}):i.exports.Children.count(n)>1?i.exports.Children.only(null):null}));KJ.displayName="SlotClone";const QJ=({children:e})=>i.exports.createElement(i.exports.Fragment,null,e);function JJ(e){return i.exports.isValidElement(e)&&e.type===QJ}function e0(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const t0=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=i.exports.forwardRef(((e,n)=>{const{asChild:r,...o}=e,a=r?XJ:t;return i.exports.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),i.exports.createElement(a,mp({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function n0(e,t){e&&U.exports.flushSync((()=>e.dispatchEvent(t)))}function r0(e){const t=e+"CollectionProvider",[n,r]=$J(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:n}=e,r=j.useRef(null),i=j.useRef(new Map).current;return j.createElement(o,{scope:t,itemMap:i,collectionRef:r},n)},Slot:j.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=YJ(t,i(a,n).collectionRef);return j.createElement(XJ,{ref:o},r)})),ItemSlot:j.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,a=j.useRef(null),c=YJ(t,a),u=i(s,n);return j.useEffect((()=>(u.itemMap.set(a,{ref:a,...o}),()=>{u.itemMap.delete(a)}))),j.createElement(XJ,{[l]:"",ref:c},r)}))},function(t){const n=i(e+"CollectionConsumer",t),r=j.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}const o0=i.exports.createContext(void 0);function i0(e){const t=i.exports.useContext(o0);return e||t||"ltr"}function a0(e){const t=i.exports.useRef(e);return i.exports.useEffect((()=>{t.current=e})),i.exports.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const s0="dismissableLayer.update",l0="dismissableLayer.pointerDownOutside",c0="dismissableLayer.focusOutside";let u0;const d0=i.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),h0=i.exports.forwardRef(((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=i.exports.useContext(d0),[h,f]=i.exports.useState(null),p=null!==(n=null==h?void 0:h.ownerDocument)&&void 0!==n?n:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,g]=i.exports.useState({}),m=YJ(t,(e=>f(e))),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(b),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,k=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=a0(e),r=i.exports.useRef(!1),o=i.exports.useRef((()=>{}));return i.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){const i={originalEvent:e};function a(){p0(l0,n,i,{discrete:!0})}"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=a0(e),r=i.exports.useRef(!1);return i.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){p0(c0,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=a0(e);i.exports.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[n,t])}((e=>{x===d.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.exports.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(u0=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),f0(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=u0)}}),[h,p,r,d]),i.exports.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),f0())}),[h,d]),i.exports.useEffect((()=>{const e=()=>g({});return document.addEventListener(s0,e),()=>document.removeEventListener(s0,e)}),[]),i.exports.createElement(t0.div,mp({},u,{ref:m,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:GJ(e.onFocusCapture,C.onFocusCapture),onBlurCapture:GJ(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:GJ(e.onPointerDownCapture,k.onPointerDownCapture)}))}));function f0(){const e=new CustomEvent(s0);document.dispatchEvent(e)}function p0(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?n0(o,i):o.dispatchEvent(i)}let g0=0;function m0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const v0="focusScope.autoFocusOnMount",b0="focusScope.autoFocusOnUnmount",y0={bubbles:!1,cancelable:!0},x0=i.exports.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[l,c]=i.exports.useState(null),u=a0(o),d=a0(a),h=i.exports.useRef(null),f=YJ(t,(e=>c(e))),p=i.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.exports.useEffect((()=>{if(r){function e(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:C0(h.current,{select:!0})}function t(e){!p.paused&&l&&(l.contains(e.relatedTarget)||C0(h.current,{select:!0}))}return document.addEventListener("focusin",e),document.addEventListener("focusout",t),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[r,l,p.paused]),i.exports.useEffect((()=>{if(l){_0.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(v0,y0);l.addEventListener(v0,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(C0(r,{select:t}),document.activeElement!==n)return}((e=w0(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&C0(l))}return()=>{l.removeEventListener(v0,u),setTimeout((()=>{const e=new CustomEvent(b0,y0);l.addEventListener(b0,d),l.dispatchEvent(e),e.defaultPrevented||C0(null!=t?t:document.body,{select:!0}),l.removeEventListener(b0,d),_0.remove(p)}),0)}}var e}),[l,u,d,p]);const g=i.exports.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=w0(e),n=S0(t,e),r=S0(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&C0(i,{select:!0})):(e.preventDefault(),n&&C0(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return i.exports.createElement(t0.div,mp({tabIndex:-1},s,{ref:f,onKeyDown:g}))}));function w0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function S0(e,t){for(const n of e)if(!k0(n,{upTo:t}))return n}function k0(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function C0(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const _0=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=E0(e,t),e.unshift(t)},remove(t){var n;e=E0(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function E0(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const L0=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?i.exports.useLayoutEffect:()=>{},P0=H["useId".toString()]||(()=>{});let M0=0;function A0(e){return e.split("-")[0]}function T0(e){return e.split("-")[1]}function O0(e){return["top","bottom"].includes(A0(e))?"x":"y"}function I0(e){return"y"===e?"height":"width"}function R0(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,s=O0(t),l=I0(s),c=r[l]/2-o[l]/2,u="x"===s;let d;switch(A0(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-o.width,y:a};break;default:d={x:r.x,y:r.y}}switch(T0(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}function N0(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function D0(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function z0(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=t,p=N0(f),g=s[h?"floating"===d?"reference":"floating":d],m=D0(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v=D0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===d?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),strategy:l}):a[d]);return{top:m.top-v.top+p.top,bottom:v.bottom-m.bottom+p.bottom,left:m.left-v.left+p.left,right:v.right-m.right+p.right}}const B0=Math.min,F0=Math.max;function j0(e,t,n){return F0(e,B0(t,n))}const H0=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:s,platform:l}=t;if(null==n)return{};const c=N0(r),u={x:o,y:i},d=O0(a),h=T0(a),f=I0(d),p=await l.getDimensions(n),g="y"===d?"top":"left",m="y"===d?"bottom":"right",v=s.reference[f]+s.reference[d]-u[d]-s.floating[f],b=u[d]-s.reference[d],y=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let x=y?"y"===d?y.clientHeight||0:y.clientWidth||0:0;0===x&&(x=s.floating[f]);const w=v/2-b/2,S=c[g],k=x-p[f]-c[m],C=x/2-p[f]/2+w,_=j0(S,C,k),E=("start"===h?c[g]:c[m])>0&&C!==_&&s.reference[f]<=s.floating[f];return{[d]:u[d]-(E?CW0[e]))}const V0={start:"end",end:"start"};function G0(e){return e.replace(/start|end/g,(e=>V0[e]))}const $0=["top","right","bottom","left"];const q0=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",flipAlignment:f=!0,...p}=e,g=A0(r),m=d||(g===a||!f?[U0(a)]:function(e){const t=U0(e);return[G0(e),t,G0(t)]}(a)),v=[a,...m],b=await z0(t,p),y=[];let x=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&y.push(b[g]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=T0(e),o=O0(e),i=I0(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=U0(a)),{main:a,cross:U0(a)}}(r,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));y.push(b[e],b[t])}if(x=[...x,{placement:r,overflows:y}],!y.every((e=>e<=0))){var w,S;const e=(null!=(w=null==(S=o.flip)?void 0:S.index)?w:0)+1,t=v[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var k;const e=null==(k=x.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:k[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};function Z0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Y0(e){return $0.some((t=>e[t]>=0))}const X0=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){const{rects:r}=e;switch(t){case"referenceHidden":{const t=Z0(await z0(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:Y0(t)}}}case"escaped":{const t=Z0(await z0(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:Y0(t)}}}default:return{}}}}};const K0=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=A0(n),s=T0(n),l="x"===O0(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function Q0(e){return"x"===e?"y":"x"}const J0=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await z0(t,l),d=O0(A0(o)),h=Q0(d);let f=c[d],p=c[h];if(i){const e="y"===d?"bottom":"right";f=j0(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===h?"bottom":"right";p=j0(p+u["y"===h?"top":"left"],p,p-u[e])}const g=s.fn({...t,[d]:f,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},e1=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:n,y:r},d=O0(o),h=Q0(d);let f=u[d],p=u[h];const g="function"==typeof s?s({...i,placement:o}):s,m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+m.mainAxis,n=i.reference[d]+i.reference[e]-m.mainAxis;fn&&(f=n)}if(c){var v,b,y,x;const e="y"===d?"width":"height",t=["top","left"].includes(A0(o)),n=i.reference[h]-i.floating[e]+(t&&null!=(v=null==(b=a.offset)?void 0:b[h])?v:0)+(t?0:m.crossAxis),r=i.reference[h]+i.reference[e]+(t?0:null!=(y=null==(x=a.offset)?void 0:x[h])?y:0)-(t?m.crossAxis:0);pr&&(p=r)}return{[d]:f,[h]:p}}}};function t1(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function n1(e){if(null==e)return window;if(!t1(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function r1(e){return n1(e).getComputedStyle(e)}function o1(e){return t1(e)?"":e?(e.nodeName||"").toLowerCase():""}function i1(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function a1(e){return e instanceof n1(e).HTMLElement}function s1(e){return e instanceof n1(e).Element}function l1(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof n1(e).ShadowRoot||e instanceof ShadowRoot}function c1(e){const{overflow:t,overflowX:n,overflowY:r}=r1(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function u1(e){return["table","td","th"].includes(o1(e))}function d1(e){const t=/firefox/i.test(i1()),n=r1(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function h1(){return!/^((?!chrome|android).)*safari/i.test(i1())}const f1=Math.min,p1=Math.max,g1=Math.round;function m1(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&a1(e)&&(l=e.offsetWidth>0&&g1(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&g1(s.height)/e.offsetHeight||1);const u=s1(e)?n1(e):window,d=!h1()&&n,h=(s.left+(d&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/l,f=(s.top+(d&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,p=s.width/l,g=s.height/c;return{width:p,height:g,top:f,right:h+p,bottom:f+g,left:h,x:h,y:f}}function v1(e){return((function(e){return e instanceof n1(e).Node}(e)?e.ownerDocument:e.document)||window.document).documentElement}function b1(e){return s1(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function y1(e){return m1(v1(e)).left+b1(e).scrollLeft}function x1(e,t,n){const r=a1(t),o=v1(t),i=m1(e,r&&function(e){const t=m1(e);return g1(t.width)!==e.offsetWidth||g1(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==o1(t)||c1(o))&&(a=b1(t)),a1(t)){const e=m1(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=y1(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function w1(e){return"html"===o1(e)?e:e.assignedSlot||e.parentNode||(l1(e)?e.host:null)||v1(e)}function S1(e){return a1(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function k1(e){const t=n1(e);let n=S1(e);for(;n&&u1(n)&&"static"===getComputedStyle(n).position;)n=S1(n);return n&&("html"===o1(n)||"body"===o1(n)&&"static"===getComputedStyle(n).position&&!d1(n))?t:n||function(e){let t=w1(e);for(l1(t)&&(t=t.host);a1(t)&&!["html","body"].includes(o1(t));){if(d1(t))return t;t=t.parentNode}return null}(e)||t}function C1(e){if(a1(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=m1(e);return{width:t.width,height:t.height}}function _1(e){const t=w1(e);return["html","body","#document"].includes(o1(t))?e.ownerDocument.body:a1(t)&&c1(t)?t:_1(t)}function E1(e,t){var n;void 0===t&&(t=[]);const r=_1(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=n1(r),a=o?[i].concat(i.visualViewport||[],c1(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(E1(a))}function L1(e,t,n){return"viewport"===t?D0(function(e,t){const n=n1(e),r=v1(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=h1();(e||!e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n)):s1(t)?function(e,t){const n=m1(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):D0(function(e){var t;const n=v1(e),r=b1(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=p1(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=p1(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-r.scrollLeft+y1(e);const l=-r.scrollTop;return"rtl"===r1(o||n).direction&&(s+=p1(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(v1(e)))}function P1(e){const t=E1(e),n=["absolute","fixed"].includes(r1(e).position)&&a1(e)?k1(e):e;return s1(n)?t.filter((e=>s1(e)&&function(e,t){const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&l1(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==o1(e))):[]}const M1={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?P1(t):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=L1(t,n,o);return e.top=p1(r.top,e.top),e.right=f1(r.right,e.right),e.bottom=f1(r.bottom,e.bottom),e.left=p1(r.left,e.left),e}),L1(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=a1(n),i=v1(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==o1(n)||c1(i))&&(a=b1(n)),a1(n))){const e=m1(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:s1,getDimensions:C1,getOffsetParent:k1,getDocumentElement:v1,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:x1(t,k1(n),r),floating:{...C1(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===r1(e).direction};function A1(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=o&&!s,c=i&&!s,u=l||c?[...s1(e)?E1(e):[],...E1(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),c&&e.addEventListener("resize",n)}));let d,h=null;if(a){let r=!0;h=new ResizeObserver((()=>{r||n(),r=!1})),s1(e)&&!s&&h.observe(e),h.observe(t)}let f=s?m1(e):null;return s&&function t(){const r=m1(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n();f=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",n),c&&e.removeEventListener("resize",n)})),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(d)}}const T1=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:u}=R0(l,r,s),d=r,h={},f=0;for(let p=0;p{t.current=e})),t}(o),c=i.exports.useRef(null),[u,d]=i.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,f]=i.exports.useState(t);I1(null==h?void 0:h.map((e=>{let{options:t}=e;return t})),null==t?void 0:t.map((e=>{let{options:t}=e;return t})))||f(t);const p=i.exports.useCallback((()=>{a.current&&s.current&&T1(a.current,s.current,{middleware:h,placement:n,strategy:r}).then((e=>{g.current&&U.exports.flushSync((()=>{d(e)}))}))}),[h,n,r]);O1((()=>{g.current&&p()}),[p]);const g=i.exports.useRef(!1);O1((()=>(g.current=!0,()=>{g.current=!1})),[]);const m=i.exports.useCallback((()=>{if("function"==typeof c.current&&(c.current(),c.current=null),a.current&&s.current)if(l.current){const e=l.current(a.current,s.current,p);c.current=e}else p()}),[p,l]),v=i.exports.useCallback((e=>{a.current=e,m()}),[m]),b=i.exports.useCallback((e=>{s.current=e,m()}),[m]),y=i.exports.useMemo((()=>({reference:a,floating:s})),[]);return i.exports.useMemo((()=>({...u,update:p,refs:y,reference:v,floating:b})),[u,p,y,v,b])}const N1=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn:e=>function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?H0({element:t.current,padding:n}).fn(e):{}:t?H0({element:t,padding:n}).fn(e):{}}};const D1="Popper",[z1,B1]=$J(D1),[F1,j1]=z1(D1),H1=i.exports.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=j1("PopperAnchor",n),s=i.exports.useRef(null),l=YJ(t,s);return i.exports.useEffect((()=>{a.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:i.exports.createElement(t0.div,mp({},o,{ref:l}))})),W1="PopperContent",[U1,V1]=z1(W1),[G1,$1]=z1(W1,{hasParent:!1,positionUpdateFns:new Set}),q1=i.exports.forwardRef(((e,t)=>{var n,r,o,a,s,l,c,u;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:p="center",alignOffset:g=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:b=0,sticky:y="partial",hideWhenDetached:x=!1,avoidCollisions:w=!0,...S}=e,k=j1(W1,d),[C,_]=i.exports.useState(null),E=YJ(t,(e=>_(e))),[L,P]=i.exports.useState(null),M=function(e){const[t,n]=i.exports.useState(void 0);return L0((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(L),A=null!==(n=null==M?void 0:M.width)&&void 0!==n?n:0,T=null!==(r=null==M?void 0:M.height)&&void 0!==r?r:0,O=h+("center"!==p?"-"+p:""),I="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},R=Array.isArray(v)?v:[v],N=R.length>0,D={padding:I,boundary:R.filter(Y1),altBoundary:N},{reference:z,floating:B,strategy:F,x:j,y:H,placement:W,middlewareData:U,update:V}=R1({strategy:"fixed",placement:O,whileElementsMounted:A1,middleware:[K0({mainAxis:f+T,alignmentAxis:g}),w?J0({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?e1():void 0,...D}):void 0,L?N1({element:L,padding:m}):void 0,w?q0({...D}):void 0,X1({arrowWidth:A,arrowHeight:T}),x?X0({strategy:"referenceHidden"}):void 0].filter(Z1)});L0((()=>{z(k.anchor)}),[z,k.anchor]);const G=null!==j&&null!==H,[$,q]=K1(W),Z=null===(o=U.arrow)||void 0===o?void 0:o.x,Y=null===(a=U.arrow)||void 0===a?void 0:a.y,X=0!==(null===(s=U.arrow)||void 0===s?void 0:s.centerOffset),[K,Q]=i.exports.useState();L0((()=>{C&&Q(window.getComputedStyle(C).zIndex)}),[C]);const{hasParent:J,positionUpdateFns:ee}=$1(W1,d),te=!J;i.exports.useLayoutEffect((()=>{if(!te)return ee.add(V),()=>{ee.delete(V)}}),[te,ee,V]),i.exports.useLayoutEffect((()=>{te&&G&&Array.from(ee).reverse().forEach((e=>requestAnimationFrame(e)))}),[te,G,ee]);const ne={"data-side":$,"data-align":q,...S,ref:E,style:{...S.style,animation:G?void 0:"none",opacity:null!==(l=U.hide)&&void 0!==l&&l.referenceHidden?0:void 0}};return i.exports.createElement("div",{ref:B,"data-radix-popper-content-wrapper":"",style:{position:F,left:0,top:0,transform:G?`translate3d(${Math.round(j)}px, ${Math.round(H)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null===(c=U.transformOrigin)||void 0===c?void 0:c.x,null===(u=U.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},i.exports.createElement(U1,{scope:d,placedSide:$,onArrowChange:P,arrowX:Z,arrowY:Y,shouldHideArrow:X},te?i.exports.createElement(G1,{scope:d,hasParent:!0,positionUpdateFns:ee},i.exports.createElement(t0.div,ne)):i.exports.createElement(t0.div,ne)))}));function Z1(e){return void 0!==e}function Y1(e){return null!==e}const X1=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset),d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[f,p]=K1(s),g={start:"0%",center:"50%",end:"100%"}[p],m=(null!==(r=null===(o=c.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+d/2,v=(null!==(i=null===(a=c.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+h/2;let b="",y="";return"bottom"===f?(b=u?g:`${m}px`,y=-h+"px"):"top"===f?(b=u?g:`${m}px`,y=`${l.floating.height+h}px`):"right"===f?(b=-h+"px",y=u?g:`${v}px`):"left"===f&&(b=`${l.floating.width+h}px`,y=u?g:`${v}px`),{data:{x:b,y:y}}}});function K1(e){const[t,n="center"]=e.split("-");return[t,n]}const Q1=e=>{const{__scopePopper:t,children:n}=e,[r,o]=i.exports.useState(null);return i.exports.createElement(F1,{scope:t,anchor:r,onAnchorChange:o},n)},J1=H1,e2=q1;const t2=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=i.exports.useState(),r=i.exports.useRef({}),o=i.exports.useRef(e),a=i.exports.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return i.exports.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.exports.useEffect((()=>{const e=n2(r.current);a.current="mounted"===l?e:"none"}),[l]),L0((()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,i=n2(t);if(e)c("MOUNT");else if("none"===i||"none"===(null==t?void 0:t.display))c("UNMOUNT");else{c(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),L0((()=>{if(t){const e=e=>{const n=n2(r.current).includes(e.animationName);e.target===t&&n&&U.exports.flushSync((()=>c("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=n2(r.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.exports.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):i.exports.Children.only(n),a=YJ(r.ref,o.ref);return"function"==typeof n||r.isPresent?i.exports.cloneElement(o,{ref:a}):null};function n2(e){return(null==e?void 0:e.animationName)||"none"}function r2({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=i.exports.useState(e),[r]=n,o=i.exports.useRef(r),a=a0(t);return i.exports.useEffect((()=>{o.current!==r&&(a(r),o.current=r)}),[r,o,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,s=a?e:r,l=a0(n),c=i.exports.useCallback((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[a,e,o,l]);return[s,c]}t2.displayName="Presence";const o2="rovingFocusGroup.onEntryFocus",i2={bubbles:!1,cancelable:!0},a2="RovingFocusGroup",[s2,l2,c2]=r0(a2),[u2,d2]=$J(a2,[c2]),[h2,f2]=u2(a2),p2=i.exports.forwardRef(((e,t)=>i.exports.createElement(s2.Provider,{scope:e.__scopeRovingFocusGroup},i.exports.createElement(s2.Slot,{scope:e.__scopeRovingFocusGroup},i.exports.createElement(g2,mp({},e,{ref:t})))))),g2=i.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,...d}=e,h=i.exports.useRef(null),f=YJ(t,h),p=i0(a),[g=null,m]=r2({prop:s,defaultProp:l,onChange:c}),[v,b]=i.exports.useState(!1),y=a0(u),x=l2(n),w=i.exports.useRef(!1),[S,k]=i.exports.useState(0);return i.exports.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(o2,y),()=>e.removeEventListener(o2,y)}),[y]),i.exports.createElement(h2,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:g,onItemFocus:i.exports.useCallback((e=>m(e)),[m]),onItemShiftTab:i.exports.useCallback((()=>b(!0)),[]),onFocusableItemAdd:i.exports.useCallback((()=>k((e=>e+1))),[]),onFocusableItemRemove:i.exports.useCallback((()=>k((e=>e-1))),[])},i.exports.createElement(t0.div,mp({tabIndex:v||0===S?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...e.style},onMouseDown:GJ(e.onMouseDown,(()=>{w.current=!0})),onFocus:GJ(e.onFocus,(e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!v){const t=new CustomEvent(o2,i2);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));b2([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)))}}w.current=!1})),onBlur:GJ(e.onBlur,(()=>b(!1)))})))})),m2=i.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,...a}=e,s=function(e){const[t,n]=i.exports.useState(P0());return L0((()=>{e||n((e=>null!=e?e:String(M0++)))}),[e]),e||(t?`radix-${t}`:"")}(),l=f2("RovingFocusGroupItem",n),c=l.currentTabStopId===s,u=l2(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return i.exports.useEffect((()=>{if(r)return d(),()=>h()}),[r,d,h]),i.exports.createElement(s2.ItemSlot,{scope:n,id:s,focusable:r,active:o},i.exports.createElement(t0.span,mp({tabIndex:c?0:-1,"data-orientation":l.orientation},a,{ref:t,onMouseDown:GJ(e.onMouseDown,(e=>{r?l.onItemFocus(s):e.preventDefault()})),onFocus:GJ(e.onFocus,(()=>l.onItemFocus(s))),onKeyDown:GJ(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void l.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:v2[r]}(e,l.orientation,l.dir);if(void 0!==t){e.preventDefault();let o=u().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=l.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>b2(o)))}var n,r}))})))})),v2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function b2(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const y2=p2,x2=m2,w2=["Enter"," "],S2=["ArrowUp","PageDown","End"],k2=["ArrowDown","PageUp","Home",...S2],C2="Menu",[_2,E2,L2]=r0(C2),[P2,M2]=$J(C2,[L2,B1,d2]),A2=B1(),T2=d2(),[O2,I2]=P2(C2),[R2,N2]=P2(C2),D2=i.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=A2(n);return i.exports.createElement(J1,mp({},o,r,{ref:t}))})),[z2,B2]=P2("MenuPortal",{forceMount:void 0}),F2="MenuContent",[j2,H2]=P2(F2),W2=i.exports.forwardRef(((e,t)=>{const n=B2(F2,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=I2(F2,e.__scopeMenu),s=N2(F2,e.__scopeMenu);return i.exports.createElement(_2.Provider,{scope:e.__scopeMenu},i.exports.createElement(t2,{present:r||a.open},i.exports.createElement(_2.Slot,{scope:e.__scopeMenu},s.modal?i.exports.createElement(U2,mp({},o,{ref:t})):i.exports.createElement(V2,mp({},o,{ref:t})))))})),U2=i.exports.forwardRef(((e,t)=>{const n=I2(F2,e.__scopeMenu),r=i.exports.useRef(null),o=YJ(t,r);return i.exports.useEffect((()=>{const e=r.current;if(e)return fD(e)}),[]),i.exports.createElement(G2,mp({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:GJ(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))})),V2=i.exports.forwardRef(((e,t)=>{const n=I2(F2,e.__scopeMenu);return i.exports.createElement(G2,mp({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))})),G2=i.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:p,...g}=e,m=I2(F2,n),v=N2(F2,n),b=A2(n),y=T2(n),x=E2(n),[w,S]=i.exports.useState(null),k=i.exports.useRef(null),C=YJ(t,k,m.onContentChange),_=i.exports.useRef(0),E=i.exports.useRef(""),L=i.exports.useRef(0),P=i.exports.useRef(null),M=i.exports.useRef("right"),A=i.exports.useRef(0),T=p?CB:i.exports.Fragment,O=p?{as:XJ,allowPinchZoom:!0}:void 0,I=e=>{var t,n;const r=E.current+e,o=x().filter((e=>!e.disabled)),i=document.activeElement,a=null===(t=o.find((e=>e.ref.current===i)))||void 0===t?void 0:t.textValue,s=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map(((e,t)=>s[(l+t)%s.length])));var s,l;1===o.length&&(a=a.filter((e=>e!==n)));const c=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,a),l=null===(n=o.find((e=>e.textValue===s)))||void 0===n?void 0:n.ref.current;!function e(t){E.current=t,window.clearTimeout(_.current),""!==t&&(_.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};i.exports.useEffect((()=>()=>window.clearTimeout(_.current)),[]),i.exports.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:m0()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:m0()),g0++,()=>{1===g0&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),g0--}}),[]);const R=i.exports.useCallback((e=>{var t,n;return M.current===(null===(t=P.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;ir!=c>r&&n<(l-e)*(r-s)/(c-s)+e&&(o=!o)}return o}(n,t)}(e,null===(n=P.current)||void 0===n?void 0:n.area)}),[]);return i.exports.createElement(j2,{scope:n,searchRef:E,onItemEnter:i.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),onItemLeave:i.exports.useCallback((e=>{var t;R(e)||(null===(t=k.current)||void 0===t||t.focus(),S(null))}),[R]),onTriggerLeave:i.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),pointerGraceTimerRef:L,onPointerGraceIntentChange:i.exports.useCallback((e=>{P.current=e}),[])},i.exports.createElement(T,O,i.exports.createElement(x0,{asChild:!0,trapped:o,onMountAutoFocus:GJ(a,(e=>{var t;e.preventDefault(),null===(t=k.current)||void 0===t||t.focus()})),onUnmountAutoFocus:s},i.exports.createElement(h0,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f},i.exports.createElement(y2,mp({asChild:!0},y,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:S,onEntryFocus:e=>{v.isUsingKeyboardRef.current||e.preventDefault()}}),i.exports.createElement(e2,mp({role:"menu","aria-orientation":"vertical","data-state":(N=m.open,N?"open":"closed"),"data-radix-menu-content":"",dir:v.dir},b,g,{ref:C,style:{outline:"none",...g.style},onKeyDown:GJ(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&I(e.key));const o=k.current;if(e.target!==o)return;if(!k2.includes(e.key))return;e.preventDefault();const i=x().filter((e=>!e.disabled)).map((e=>e.ref.current));S2.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:GJ(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(_.current),E.current="")})),onPointerMove:GJ(e.onPointerMove,X2((e=>{const t=e.target,n=A.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>A.current?"right":"left";M.current=t,A.current=e.clientX}})))})))))));var N})),$2="MenuItem",q2="menu.itemSelect",Z2=i.exports.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=i.exports.useRef(null),s=N2($2,e.__scopeMenu),l=H2($2,e.__scopeMenu),c=YJ(t,a),u=i.exports.useRef(!1);return i.exports.createElement(Y2,mp({},o,{ref:c,disabled:n,onClick:GJ(e.onClick,(()=>{const e=a.current;if(!n&&e){const t=new CustomEvent(q2,{bubbles:!0,cancelable:!0});e.addEventListener(q2,(e=>null==r?void 0:r(e)),{once:!0}),n0(e,t),t.defaultPrevented?u.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),u.current=!0},onPointerUp:GJ(e.onPointerUp,(e=>{var t;u.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:GJ(e.onKeyDown,(e=>{const t=""!==l.searchRef.current;n||t&&" "===e.key||w2.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),Y2=i.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,s=H2($2,n),l=T2(n),c=i.exports.useRef(null),u=YJ(t,c),[d,h]=i.exports.useState(!1),[f,p]=i.exports.useState("");return i.exports.useEffect((()=>{const e=c.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[a.children]),i.exports.createElement(_2.ItemSlot,{scope:n,disabled:r,textValue:null!=o?o:f},i.exports.createElement(x2,mp({asChild:!0},l,{focusable:!r}),i.exports.createElement(t0.div,mp({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},a,{ref:u,onPointerMove:GJ(e.onPointerMove,X2((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus()}}))),onPointerLeave:GJ(e.onPointerLeave,X2((e=>s.onItemLeave(e)))),onFocus:GJ(e.onFocus,(()=>h(!0))),onBlur:GJ(e.onBlur,(()=>h(!1)))}))))}));P2("MenuRadioGroup",{value:void 0,onValueChange:()=>{}});P2("MenuItemIndicator",{checked:!1});function X2(e){return t=>"mouse"===t.pointerType?e(t):void 0}P2("MenuSub");const K2=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:s=!0}=e,l=A2(t),[c,u]=i.exports.useState(null),d=i.exports.useRef(!1),h=a0(a),f=i0(o);return i.exports.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),i.exports.createElement(Q1,l,i.exports.createElement(O2,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:u},i.exports.createElement(R2,{scope:t,onClose:i.exports.useCallback((()=>h(!1)),[h]),isUsingKeyboardRef:d,dir:f,modal:s},r)))},Q2=D2,J2=W2,e5=Z2,t5="ContextMenu",[n5,r5]=$J(t5,[M2]),o5=M2(),[i5,a5]=n5(t5);function s5(e){return t=>"mouse"!==t.pointerType?e(t):void 0}const l5=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:a=!0}=e,[s,l]=i.exports.useState(!1),c=o5(t),u=a0(r),d=i.exports.useCallback((e=>{l(e),u(e)}),[u]);return i.exports.createElement(i5,{scope:t,open:s,onOpenChange:d,modal:a},i.exports.createElement(K2,mp({},c,{dir:o,open:s,onOpenChange:d,modal:a}),n))},c5=i.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=a5("ContextMenuTrigger",n),a=o5(n),s=i.exports.useRef({x:0,y:0}),l=i.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),c=i.exports.useRef(0),u=i.exports.useCallback((()=>window.clearTimeout(c.current)),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},o.onOpenChange(!0)};return i.exports.useEffect((()=>u),[u]),i.exports.createElement(i.exports.Fragment,null,i.exports.createElement(Q2,mp({},a,{virtualRef:l})),i.exports.createElement(t0.span,mp({"data-state":o.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:GJ(e.onContextMenu,(e=>{u(),d(e),e.preventDefault()})),onPointerDown:GJ(e.onPointerDown,s5((e=>{u(),c.current=window.setTimeout((()=>d(e)),700)}))),onPointerMove:GJ(e.onPointerMove,s5(u)),onPointerCancel:GJ(e.onPointerCancel,s5(u)),onPointerUp:GJ(e.onPointerUp,s5(u))})))})),u5=i.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=a5("ContextMenuContent",n),a=o5(n),s=i.exports.useRef(!1);return i.exports.createElement(J2,mp({},a,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&s.current&&t.preventDefault(),s.current=!1},onInteractOutside:t=>{var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||o.modal||(s.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)"}}))})),d5=i.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=o5(n);return i.exports.createElement(e5,mp({},o,r,{ref:t}))})),h5=cU([e=>e.gallery,e=>e.options,EX,RZ],((e,t,n,r)=>{const{categories:o,currentCategory:i,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,galleryWidth:p,shouldUseSingleGalleryColumn:g}=e,{isLightBoxOpen:m}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,galleryGridTemplateColumns:g?"auto":`repeat(auto-fill, minmax(${u}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,images:o[i].images,areMoreImagesAvailable:o[i].areMoreImagesAvailable,currentCategory:i,galleryWidth:p,isLightBoxOpen:m,isStaging:n,shouldEnableResize:!(m||"unifiedCanvas"===r&&s),shouldUseSingleGalleryColumn:g}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),f5=cU([e=>e.options,e=>e.gallery,e=>e.system,RZ],((e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen})),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),p5=i.exports.memo((e=>{const t=noe(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,mayDeleteImage:a,isLightBoxOpen:s,shouldUseSingleGalleryColumn:l}=roe(f5),{image:c,isSelected:u}=e,{url:d,thumbnail:h,uuid:f,metadata:p}=c,[g,m]=i.exports.useState(!1),v=DH();return ld(l5,{onOpenChange:e=>{t(sJ(e))},children:[sd(c5,{children:ld(gI,{position:"relative",className:"hoverable-image",onMouseOver:()=>m(!0),onMouseOut:()=>m(!1),userSelect:"none",draggable:!0,onDragStart:e=>{e.dataTransfer.setData("invokeai/imageUuid",f),e.dataTransfer.effectAllowed="move"},children:[sd(_T,{className:"hoverable-image-image",objectFit:l?"contain":r,rounded:"md",src:h||d,loading:"lazy"}),sd("div",{className:"hoverable-image-content",onClick:()=>t(KQ(c)),children:u&&sd(wS,{width:"50%",height:"50%",as:DY,className:"hoverable-image-check"})}),g&&o>=64&&sd("div",{className:"hoverable-image-delete-button",children:sd(qH,{label:"Delete image",hasArrow:!0,children:sd(UQ,{image:c,children:sd(DT,{"aria-label":"Delete image",icon:sd(hX,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!a})})})})]},f)}),ld(u5,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:e=>{e.detail.originalEvent.preventDefault()},children:[sd(d5,{onClickCapture:()=>{t(Wte(!0)),t(KQ(c))},children:"Open In Viewer"}),sd(d5,{onClickCapture:()=>{c.metadata&&t(Zte(c.metadata.image.prompt)),v({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.prompt,children:"Use Prompt"}),sd(d5,{onClickCapture:()=>{c.metadata&&t(tne(c.metadata.image.seed)),v({title:"Seed Set",status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.seed,children:"Use Seed"}),sd(d5,{onClickCapture:()=>{p&&t(Tte(p)),v({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})},disabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),children:"Use All Parameters"}),sd(qH,{label:"Load initial image used for this generation",children:sd(d5,{onClickCapture:async()=>{if(p?.image?.init_image_path){if((await fetch(p.image.init_image_path)).ok)return t(Pte("img2img")),t(Mte(p)),void v({title:"Initial Image Set",status:"success",duration:2500,isClosable:!0})}v({title:"Initial Image Not Set",description:"Could not load initial image.",status:"error",duration:2500,isClosable:!0})},disabled:"img2img"!==c?.metadata?.image?.type,children:"Use Initial Image"})}),sd(d5,{onClickCapture:()=>{s&&t(Wte(!1)),t(Hte(c)),"img2img"!==n&&t(Pte("img2img")),v({title:"Sent to Image To Image",status:"success",duration:2500,isClosable:!0})},children:"Send to Image To Image"}),sd(d5,{onClickCapture:()=>{s&&t(Wte(!1)),t(QK(c)),t(jK()),"unifiedCanvas"!==n&&t(Pte("unifiedCanvas")),v({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0})},children:"Send to Unified Canvas"}),sd(UQ,{image:c,children:sd(d5,{"data-warning":!0,children:"Delete Image"})})]})]})}),((e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected)),g5=e=>{const{label:t,styleClass:n,...r}=e;return sd(AO,{className:`invokeai__checkbox ${n}`,...r,children:t})},m5=320,v5={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500}};function b5(){const e=noe(),{images:t,currentCategory:n,currentImageUuid:r,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:c,activeTabName:u,galleryImageObjectFit:d,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,areMoreImagesAvailable:p,galleryWidth:g,isLightBoxOpen:m,isStaging:v,shouldEnableResize:b,shouldUseSingleGalleryColumn:y}=roe(h5),{galleryMinWidth:x,galleryMaxWidth:w}=m?{galleryMinWidth:400,galleryMaxWidth:400}:v5[u],[S,k]=i.exports.useState(g>=m5),[C,_]=i.exports.useState(!1),[E,L]=i.exports.useState(0),P=i.exports.useRef(null),M=i.exports.useRef(null),A=i.exports.useRef(null);i.exports.useEffect((()=>{g>=m5&&k(!1)}),[g]);const T=()=>{e(nJ(!o)),e(KK(!0))},O=()=>{e(rJ(!0)),o&&e(KK(!0))},I=i.exports.useCallback((()=>{e(rJ(!1)),e(sJ(!1)),e(oJ(M.current?M.current.scrollTop:0)),setTimeout((()=>o&&e(KK(!0))),400)}),[e,o]),R=()=>{A.current&&window.clearTimeout(A.current)};Eq("g",(()=>{a?I():O()}),[a,o]),Eq("left",(()=>{e(tJ())}),{enabled:!v||"unifiedCanvas"!==u},[v]),Eq("right",(()=>{e(eJ())}),{enabled:!v||"unifiedCanvas"!==u},[v]),Eq("shift+g",(()=>{T()}),[o]),Eq("esc",(()=>{e(rJ(!1))}),{enabled:()=>!o,preventDefault:!0},[o]);return Eq("shift+up",(()=>{if(l<256){const t=LG.clamp(l+32,32,256);e(iJ(t))}}),[l]),Eq("shift+down",(()=>{if(l>32){const t=LG.clamp(l-32,32,256);e(iJ(t))}}),[l]),i.exports.useEffect((()=>{M.current&&(M.current.scrollTop=s)}),[s,a]),i.exports.useEffect((()=>{function e(e){o||!P.current||P.current.contains(e.target)||I()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[I,o]),sd(hK,{nodeRef:P,in:a||h,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:ld("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:P,onMouseLeave:o?void 0:()=>{h||(A.current=window.setTimeout((()=>I()),500))},onMouseEnter:o?void 0:R,onMouseOver:o?void 0:R,children:[ld(VJ,{minWidth:x,maxWidth:o?w:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:b},size:{width:g,height:o?"100%":"100vh"},onResizeStart:(e,t,n)=>{L(n.clientHeight),n.style.height=`${n.clientHeight}px`,o&&(n.style.position="fixed",n.style.right="1rem",_(!0))},onResizeStop:(t,n,r,i)=>{const a=o?LG.clamp(Number(g)+i.width,x,Number(w)):Number(g)+i.width;e(uJ(a)),r.removeAttribute("data-resize-alert"),o&&(r.style.position="relative",r.style.removeProperty("right"),r.style.setProperty("height",o?"100%":"100vh"),_(!1),e(KK(!0)))},onResize:(t,n,r,i)=>{const a=LG.clamp(Number(g)+i.width,x,Number(o?w:.95*window.innerWidth));a>=m5&&!S?k(!0):aa-40&&e(iJ(a-40)),o&&(a>=w?r.setAttribute("data-resize-alert","true"):r.removeAttribute("data-resize-alert")),r.style.height=`${E}px`},children:[ld("div",{className:"image-gallery-header",children:[sd(NT,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:ld(ad,S?{children:[sd(jX,{size:"sm","data-selected":"result"===n,onClick:()=>e(cJ("result")),children:"Generations"}),sd(jX,{size:"sm","data-selected":"user"===n,onClick:()=>e(cJ("user")),children:"Uploads"})]}:{children:[sd(dZ,{"aria-label":"Show Generations",tooltip:"Show Generations","data-selected":"result"===n,icon:sd(YY,{}),onClick:()=>e(cJ("result"))}),sd(dZ,{"aria-label":"Show Uploads",tooltip:"Show Uploads","data-selected":"user"===n,icon:sd(mX,{}),onClick:()=>e(cJ("user"))})]})}),ld("div",{className:"image-gallery-header-right-icons",children:[sd(VQ,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:sd(dZ,{size:"sm","aria-label":"Gallery Settings",icon:sd(vX,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:ld("div",{className:"image-gallery-settings-popover",children:[ld("div",{children:[sd(hZ,{value:l,onChange:t=>{e(iJ(t))},min:32,max:256,hideTooltip:!0,label:"Image Size"}),sd(dZ,{size:"sm","aria-label":"Reset",tooltip:"Reset Size",onClick:()=>e(iJ(64)),icon:sd(aZ,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),sd("div",{children:sd(g5,{label:"Maintain Aspect Ratio",isChecked:"contain"===d,onChange:()=>e(aJ("contain"===d?"cover":"contain"))})}),sd("div",{children:sd(g5,{label:"Auto-Switch to New Images",isChecked:f,onChange:t=>e(lJ(t.target.checked))})}),sd("div",{children:sd(g5,{label:"Single Column Layout",isChecked:y,onChange:t=>e(dJ(t.target.checked))})})]})}),sd(dZ,{size:"sm",className:"image-gallery-icon-btn","aria-label":"Pin Gallery",tooltip:"Pin Gallery (Shift+G)",onClick:T,icon:sd(o?YX:XX,{})})]})]}),sd("div",{className:"image-gallery-container",ref:M,children:t.length||p?ld(ad,{children:[sd("div",{className:"image-gallery",style:{gridTemplateColumns:c},children:t.map((e=>{const{uuid:t}=e;return sd(p5,{image:e,isSelected:r===t},t)}))}),sd(IT,{onClick:()=>{e(IX(n))},isDisabled:!p,className:"image-gallery-load-more-btn",children:p?"Load More":"All Images Loaded"})]}):ld("div",{className:"image-gallery-container-placeholder",children:[sd(bY,{}),sd("p",{children:"No Images In Gallery"})]})})]}),C&&sd("div",{style:{width:g+"px",height:"100%"}})]})})}const y5=cU((e=>e.gallery),(e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images}))),x5=cU([e=>e.options,RZ],((e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),w5=e=>{const t=noe(),{optionsPanel:n,children:r,styleClass:o}=e,{activeTabName:i,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=roe(x5),c=(()=>{const{resultImages:e,userImages:t}=roe(y5);return n=>{const r=e.find((e=>e.uuid===n));if(r)return r;return t.find((e=>e.uuid===n))||void 0}})();return sd("div",{className:o?`workarea-wrapper ${o}`:"workarea-wrapper",children:ld("div",{className:"workarea-main",children:[n,ld("div",{className:"workarea-children-wrapper",onDrop:e=>{const n=e.dataTransfer.getData("invokeai/imageUuid"),r=c(n);r&&("img2img"===i?t(Hte(r)):"unifiedCanvas"===i&&t(QK(r)))},children:[r,l&&sd(qH,{label:"Toggle Split View",children:sd("div",{className:"workarea-split-button","data-selected":a,onClick:()=>{t(pne(!a)),t(KK(!0))},children:sd(CJ,{})})})]}),!s&&sd(b5,{})]})})};function S5(){return sd(w5,{optionsPanel:sd(FQ,{}),children:sd(kJ,{})})}function k5(){const e={seed:{header:"Seed",feature:Rq.SEED,content:sd(kZ,{})},variations:{header:"Variations",feature:Rq.VARIATIONS,content:sd(OZ,{}),additionalHeaderComponents:sd(PZ,{})},face_restore:{header:"Face Restoration",feature:Rq.FACE_CORRECTION,content:sd(Zq,{}),additionalHeaderComponents:sd(Xq,{})},upscale:{header:"Upscaling",feature:Rq.UPSCALE,content:sd(EZ,{}),additionalHeaderComponents:sd(LZ,{})},other:{header:"Other Options",feature:Rq.OTHER,content:sd(mZ,{})}};return ld(BQ,{children:[sd(ZX,{}),sd($X,{}),sd(UZ,{}),sd(_Y,{accordionInfo:e})]})}const C5=()=>sd("div",{className:"workarea-single-view",children:sd("div",{className:"text-to-image-area",children:sd(xJ,{})})});function _5(){return sd(w5,{optionsPanel:sd(k5,{}),children:sd(C5,{})})}var E5=function(e,t){return E5=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},E5(e,t)};var L5=function(){return L5=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n?(r(1),e.animation=null):e.animation&&(r(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function N5(e,t,n,r){var o=function(e){var t=e.scale,n=e.positionX,r=e.positionY;if(isNaN(t)||isNaN(n)||isNaN(r))return!1;return!0}(t);if(e.mounted&&o){var i=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=t.scale-s,d=t.positionX-l,h=t.positionY-c;0===n?i(t.scale,t.positionX,t.positionY):R5(e,r,n,(function(e){i(s+u*e,l+d*e,c+h*e)}))}}var D5=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var i=function(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:i,newDiffWidth:r-i,newContentHeight:a,newDiffHeight:o-a}}(n,r,t),a=i.wrapperWidth,s=i.wrapperHeight,l=function(e,t,n,r,o,i,a){var s=e>t?n*(a?1:.5):0,l=r>o?i*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-o-l,maxPositionY:l}}(a,i.newContentWidth,i.newDiffWidth,s,i.newContentHeight,i.newDiffHeight,Boolean(o));return l},z5=function(e,t){var n=D5(e,t);return e.bounds=n,n};function B5(e,t,n,r,o,i,a){var s=n.minPositionX,l=n.minPositionY,c=n.maxPositionX,u=n.maxPositionY,d=0,h=0;return a&&(d=o,h=i),{x:F5(e,s-d,c+d,r),y:F5(t,l-h,u+h,r)}}var F5=function(e,t,n,r){return M5(r?en?n:e:e,2)};function j5(e,t,n,r,o,i){var a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=r-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:c}):B5(l-t*u,c-n*u,o,i,0,0,null)}function H5(e,t,n,r,o){var i=t-(o?r:0);return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=i?i:e}var W5=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,a=null==o?void 0:o.contains(i);return!!(r&&i&&a)&&!g3(i,n)},U5=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!(!t||!n||r)};var V5=function(e,t){var n=e.setup,r=e.transformState.scale,o=n.minScale;return t>0&&r>=o?t:0};function G5(e,t,n,r,o,i,a,s,l,c){if(o){var u;if(t>a&&n>a)return(u=a+(e-a)*c)>l?l:ui?i:u}return r?t:F5(e,i,a,o)}function $5(e,t){var n=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale;return!(o.disabled&&!(i>1)&&r&&!t)}(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,a=e.wrapperComponent,s=i.velocityAnimation.equalToMove,l=Date.now();if(r&&o&&a){var c=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-r.x,d=t.y-r.y,h=u/c,f=d/c,p=l-o,g=u*u+d*d,m=Math.sqrt(g)/p;e.velocity={velocityX:h,velocityY:f,total:m}}e.lastMousePosition=t,e.velocityTime=l}}function q5(e,t){var n=e.transformState.scale;I5(e),z5(e,n),t.touches?function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-i}}}(e,t):function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,a=t.clientY;e.startCoords={x:i-r,y:a-o}}(e,t)}function Z5(e,t,n){var r=e.startCoords,o=e.setup.alignmentAnimation,i=o.sizeX,a=o.sizeY;if(r){var s=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,a=i.lockAxisX,s=i.lockAxisY,l=o.positionX,c=o.positionY;if(!r)return{x:l,y:c};var u=t-r.x,d=n-r.y;return{x:a?l:u,y:s?c:d}}(e,t,n),l=s.x,c=s.y,u=V5(e,i),d=V5(e,a);$5(e,{x:l,y:c}),function(e,t,n,r,o){var i=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(a&&t!==u&&n!==d&&s){var h=B5(t,n,s,i,r,o,a),f=h.x,p=h.y;e.setTransformState(c,f,p)}}(e,l,c,u,d)}}function Y5(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var i=null==r?void 0:r.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==i?void 0:i.width)||0,l=(null==i?void 0:i.height)||0,c=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s.1&&d?function(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&i&&!t||!n||!r)}(e);if(i&&t&&n&&o){var a=t.velocityX,s=t.velocityY,l=t.total,c=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,h=n.minPositionY,f=r.limitToBounds,p=r.alignmentAnimation,g=r.zoomAnimation,m=r.panning,v=m.lockAxisY,b=m.lockAxisX,y=g.animationType,x=p.sizeX,w=p.sizeY,S=p.velocityAlignmentTime,k=function(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}(e,l),C=Math.max(k,S),_=V5(e,x),E=V5(e,w),L=_*o.offsetWidth/100,P=E*o.offsetHeight/100,M=c+L,A=u-L,T=d+P,O=h-P,I=e.transformState,R=(new Date).getTime();R5(e,y,C,(function(t){var n=e.transformState,r=n.scale,o=n.positionX,i=n.positionY,l=((new Date).getTime()-R)/S,g=1-(0,T5[p.animationType])(Math.min(1,l)),m=1-t,y=o+a*m,x=i+s*m,w=G5(y,I.positionX,o,b,f,u,c,A,M,g),k=G5(x,I.positionY,i,v,f,h,d,O,T,g);o===y&&i===x||e.setTransformState(r,w,k)}))}}(e):X5(e)}}function X5(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,a=o.sizeX,s=o.sizeY,l=o.animationTime,c=o.animationType;if(!(i||td||nf||rd?c.offsetWidth:e.setup.minPositionX||0,r>f?c.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||l),b=v.x,y=v.y;return{scale:o,positionX:g?b:n,positionY:m?y:r}}}(e);u&&N5(e,u,l,c)}}function K5(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.minScale,s=i.limitToBounds,l=i.zoomAnimation,c=l.disabled,u=l.animationTime,d=l.animationType,h=c||r>=a;if((r>=1||s)&&X5(e),!h&&o&&e.mounted){var f=Q5(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);f&&N5(e,f,u,d)}}function Q5(e,t,n,r){var o=e.setup,i=o.minScale,a=o.maxScale,s=o.limitToBounds,l=H5(M5(t,2),i,a,0,!1),c=j5(e,n,r,l,z5(e,l),s);return{scale:l,positionX:c.x,positionY:c.y}}var J5={previousScale:1,scale:1,positionX:0,positionY:0},e3=L5(L5({},J5),{setComponents:function(){},contextInstance:null}),t3={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},n3=function(e){var t,n,r,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:J5.scale,scale:null!==(n=e.initialScale)&&void 0!==n?n:J5.scale,positionX:null!==(r=e.initialPositionX)&&void 0!==r?r:J5.positionX,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:J5.positionY}},r3=function(e){var t=L5({},t3);return Object.keys(e).forEach((function(n){var r=void 0!==e[n];if(void 0!==t3[n]&&r){var o=Object.prototype.toString.call(t3[n]),i="[object Object]"===o,a="[object Array]"===o;t[n]=i?L5(L5({},t3[n]),e[n]):a?P5(P5([],t3[n]),e[n]):e[n]}})),t},o3=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.maxScale,s=i.minScale,l=i.zoomAnimation.size;if(!o)throw new Error("Wrapper is not mounted");var c=r*Math.exp(t*n);return H5(M5(c,3),s,a,l,!1)};function i3(e,t,n,r,o){var i=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY;if(!i)return console.error("No WrapperComponent found");var u=(i.offsetWidth/2-l)/s,d=(i.offsetHeight/2-c)/s,h=Q5(e,o3(e,t,n),u,d);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");N5(e,h,r,o)}function a3(e,t,n){var r=e.setup,o=e.wrapperComponent,i=r.limitToBounds,a=n3(e.props),s=e.transformState,l=s.scale,c=s.positionX,u=s.positionY;if(o){var d=D5(e,a.scale),h=B5(a.positionX,a.positionY,d,i,0,0,o),f={scale:a.scale,positionX:h.x,positionY:h.y};l===a.scale&&c===a.positionX&&u===a.positionY||N5(e,f,t,n)}}var s3=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),i3(e,1,t,n,r)}},l3=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),i3(e,-1,t,n,r)}},c3=function(e){return function(t,n,r,o,i){void 0===o&&(o=300),void 0===i&&(i="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,c=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var h={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?c:r};N5(e,h,o,i)}}},u3=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),a3(e,t,n)}},d3=function(e){return function(t,n,r){void 0===n&&(n=200),void 0===r&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,a=e.contentComponent;if(i&&a){var s=b3(t||o.scale,i,a);N5(e,s,n,r)}}},h3=function(e){return function(t,n,r,o){void 0===r&&(r=600),void 0===o&&(o="easeOut"),I5(e);var i=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(i&&function(e){return e?void 0!==(null==e?void 0:e.offsetWidth)&&void 0!==(null==e?void 0:e.offsetHeight)||(console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1):(console.error("Zoom node not found"),!1)}(a)&&a&&i.contains(a)){var s=function(e,t,n){var r=e.wrapperComponent,o=e.setup,i=o.limitToBounds,a=o.minScale,s=o.maxScale;if(!r)return J5;var l=r.getBoundingClientRect(),c=function(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}(t),u=c.x,d=c.y,h=t.offsetWidth,f=t.offsetHeight,p=r.offsetWidth/h,g=r.offsetHeight/f,m=H5(n||Math.min(p,g),a,s,0,!1),v=(l.width-h*m)/2,b=(l.height-f*m)/2,y=B5((l.left-u)*m+v,(l.top-d)*m+b,D5(e,m),i,0,0,r);return{positionX:y.x,positionY:y.y,scale:m}}(e,a,n);N5(e,s,r,o)}}},f3=function(e){return{instance:e,state:e.transformState,zoomIn:s3(e),zoomOut:l3(e),setTransform:c3(e),resetTransform:u3(e),centerView:d3(e),zoomToElement:h3(e)}};function p3(){try{return{get passive(){return!0,!1}}}catch(Kie){return!1}}var g3=function(e,t){var n=e.tagName.toUpperCase();return!!t.find((function(e){return e.toUpperCase()===n}))||!!t.find((function(t){return e.classList.contains(t)}))},m3=function(e){e&&clearTimeout(e)},v3=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},b3=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-r)/2,positionY:(t.offsetHeight-o)/2}},y3=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,c=t.target;return!(!s||l||r||!c)&&(!(o&&!t.ctrlKey)&&((!i||!t.ctrlKey)&&!g3(c,a)))};function x3(e,t,n){var r=t.getBoundingClientRect(),o=0,i=0;if("clientX"in e)o=(e.clientX-r.left)/n,i=(e.clientY-r.top)/n;else{var a=e.touches[0];o=(a.clientX-r.left)/n,i=(a.clientY-r.top)/n}return(isNaN(o)||isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var w3=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,a=t.target;return!(!i||r||!a)&&!g3(a,o)},S3=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||!r)},k3=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},C3=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(I5(e),A5(f3(e),t,r),A5(f3(e),t,o))},_3=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,h=u.size,f=u.disabled,p=d.step;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var g=function(e,t){var n,r,o=e?e.deltaY<0?1:-1:0;return r=o,"number"==typeof(n=t)?n:r}(t,null),m=function(e,t,n,r,o){var i=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,c=s.minScale,u=s.zoomAnimation,d=u.size,h=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=i+t*(i-i*n)*n;if(o)return f;var p=!r&&!h;return H5(M5(f,3),c,l,d,p)}(e,g,p,!t.ctrlKey);if(s!==m){var v=z5(e,m),b=x3(t,i,s),y=l&&(f||0===h||c),x=j5(e,b.x,b.y,m,v,y),w=x.x,S=x.y;e.previousWheelEvent=t,e.setTransformState(m,w,S),A5(f3(e),t,r),A5(f3(e),t,o)}},E3=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;m3(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(K5(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var i=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,a=o.minScale;return!!n&&(ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);i&&(m3(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,A5(f3(e),t,r),A5(f3(e),t,o))}),160))},L3=function(e,t){var n=k3(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,I5(e)},P3=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,a=i.limitToBounds,s=i.centerZoomedOut,l=i.zoomAnimation,c=l.disabled,u=l.size;if(null!==r&&n){var d=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=M5(o[0].clientX-r.left,5),a=M5(o[0].clientY-r.top,5);return{x:(i+M5(o[1].clientX-r.left,5))/2/t,y:(a+M5(o[1].clientY-r.top,5))/2/t}}(t,o,n);if(isFinite(d.x)&&isFinite(d.y)){var h=k3(t),f=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,a=o.minScale,s=o.zoomAnimation,l=s.size,c=s.disabled;if(!n||null===r||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:H5(M5(t/r*n,2),a,i,l,!c)}(e,h);if(f!==o){var p=z5(e,f),g=a&&(c||0===u||s),m=j5(e,d.x,d.y,f,p,g),v=m.x,b=m.y;e.pinchMidpoint=d,e.lastDistance=h,e.setTransformState(f,v,b)}}}},M3=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,K5(e,null==t?void 0:t.x,null==t?void 0:t.y)};function A3(e,t){var n=e.setup.doubleClick,r=n.disabled,o=n.mode,i=n.step,a=n.animationTime,s=n.animationType;if(!r){if("reset"===o)return a3(e,a,s);var l=e.transformState.scale,c=e.contentComponent;if(!c)return console.error("No ContentComponent found");var u=o3(e,"zoomOut"===o?-1:1,i),d=x3(t,c,l),h=Q5(e,u,d.x,d.y);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");N5(e,h,a,s)}}var T3=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,a=i.disabled,s=i.excluded,l=t.target,c=null==o?void 0:o.contains(l),u=n&&l&&c&&!a;return!!u&&(!g3(l,s)&&!!u)},O3=j.createContext(e3),I3=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mounted=!0,t.transformState=n3(t.props),t.setup=r3(t.props),t.wrapperComponent=null,t.contentComponent=null,t.isInitialized=!1,t.bounds=null,t.previousWheelEvent=null,t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.isPanning=!1,t.startCoords=null,t.lastTouch=null,t.distance=null,t.lastDistance=null,t.pinchStartDistance=null,t.pinchStartScale=null,t.pinchMidpoint=null,t.velocity=null,t.velocityTime=null,t.lastMousePosition=null,t.animate=!1,t.animation=null,t.maxBounds=null,t.pressedKeys={},t.handleInitializeWrapperEvents=function(e){var n=p3();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},t.handleInitialize=function(){var e=t.setup.centerOnInit;t.applyTransformation(),t.forceUpdate(),e&&(setTimeout((function(){t.mounted&&t.setCenter()}),50),setTimeout((function(){t.mounted&&t.setCenter()}),100),setTimeout((function(){t.mounted&&t.setCenter()}),200))},t.onWheelZoom=function(e){t.setup.disabled||y3(t,e)&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(C3(t,e),_3(t,e),E3(t,e))},t.onPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;n||W5(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),I5(t),q5(t,e),A5(f3(t),e,r))},t.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||U5(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Z5(t,e.clientX,e.clientY),A5(f3(t),e,r))},t.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(Y5(t),A5(f3(t),e,n))},t.onPinchStart=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinchingStart,i=r.onZoomStart;n||w3(t,e)&&(L3(t,e),I5(t),A5(f3(t),e,o),A5(f3(t),e,i))},t.onPinch=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinching,i=r.onZoom;n||S3(t)&&(e.preventDefault(),e.stopPropagation(),P3(t,e),A5(f3(t),e,o),A5(f3(t),e,i))},t.onPinchStop=function(e){var n=t.props,r=n.onPinchingStop,o=n.onZoomStop;t.pinchStartScale&&(M3(t),A5(f3(t),e,r),A5(f3(t),e,o))},t.onTouchPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;if(!n&&W5(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,I5(t);var o=e.touches,i=1===o.length,a=2===o.length;i&&(I5(t),q5(t,e),A5(f3(t),e,r)),a&&t.onPinchStart(e)}},t.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!U5(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];Z5(t,o.clientX,o.clientY),A5(f3(t),e,r)}else e.touches.length>1&&t.onPinch(e)},t.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},t.onDoubleClick=function(e){t.setup.disabled||T3(t,e)&&A3(t,e)},t.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},t.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},t.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},t.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},t.setComponents=function(e,n){t.wrapperComponent=e,t.contentComponent=n,z5(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.handleRef(),t.isInitialized=!0,A5(f3(t),void 0,t.props.onInit)},t.setTransformState=function(e,n,r){isNaN(e)||isNaN(n)||isNaN(r)?console.error("Detected NaN set state values"):(e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=r,t.applyTransformation())},t.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=b3(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},t.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,r=e.positionX,o=e.positionY,i=v3(r,o,n);t.contentComponent.style.transform=i,t.handleRef()}},t.handleRef=function(){t.props.setRef(f3(t))},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}E5(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){var e=p3();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},t.prototype.componentWillUnmount=function(){var e=p3();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),I5(this)},t.prototype.componentDidUpdate=function(e){e!==this.props&&(z5(this,this.transformState.scale),this.setup=r3(this.props))},t.prototype.render=function(){var e=f3(this),t=this.props.children,n="function"==typeof t?t(e):t;return sd(O3.Provider,{value:L5(L5({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:n})},t}(i.exports.Component),R3=j.forwardRef((function(e,t){var n=i.exports.useState(null),r=n[0],o=n[1];return i.exports.useImperativeHandle(t,(function(){return r}),[r]),sd(I3,{...L5({},e,{setRef:o})})}));var N3="transform-component-module_wrapper__1_Fgj",D3="transform-component-module_content__2jYgh";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__1_Fgj {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__2jYgh {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__2jYgh img {\n pointer-events: none;\n}\n");var z3=function(e){var t=e.children,n=e.wrapperClass,r=void 0===n?"":n,o=e.contentClass,a=void 0===o?"":o,s=e.wrapperStyle,l=e.contentStyle,c=i.exports.useContext(O3).setComponents,u=i.exports.useRef(null),d=i.exports.useRef(null);return i.exports.useEffect((function(){var e=u.current,t=d.current;null!==e&&null!==t&&c&&c(e,t)}),[]),sd("div",{ref:u,className:"react-transform-wrapper "+N3+" "+r,style:s,children:sd("div",{ref:d,className:"react-transform-component "+D3+" "+a,style:l,children:t})})};function B3({image:e,alt:t,ref:n,styleClass:r}){const[o,a]=i.exports.useState(0),[s,l]=i.exports.useState(!1),c=()=>{a(-3===o?0:o-1)},u=()=>{a(3===o?0:o+1)},d=()=>{l(!s)};return sd(R3,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:i,zoomOut:h,resetTransform:f,centerView:p})=>ld(ad,{children:[ld("div",{className:"lightbox-image-options",children:[sd(dZ,{icon:sd(cZ,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>i(),fontSize:20}),sd(dZ,{icon:sd(uZ,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>h(),fontSize:20}),sd(dZ,{icon:sd(sZ,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:c,fontSize:20}),sd(dZ,{icon:sd(lZ,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),sd(dZ,{icon:sd(vY,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),sd(dZ,{icon:sd(aZ,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{f(),a(0),l(!1)},fontSize:20})]}),sd(z3,{wrapperStyle:{width:"100%",height:"100%"},children:sd("img",{style:{transform:`rotate(${90*o}deg) scaleX(${s?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>p(1,0,"easeOut")})})]})})}function F3(){const e=noe(),t=roe((e=>e.options.isLightBoxOpen)),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:o,isOnLastImage:a}=roe(vJ),[s,l]=i.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return Eq("Esc",(()=>{t&&e(Wte(!1))}),[t]),ld("div",{className:"lightbox-container",children:[sd(dZ,{icon:sd(iZ,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Wte(!1))},fontSize:20}),ld("div",{className:"lightbox-display-container",children:[ld("div",{className:"lightbox-preview-wrapper",children:[sd($Q,{}),!r&&ld("div",{className:"current-image-next-prev-buttons",children:[sd("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!o&&sd(DT,{"aria-label":"Previous image",icon:sd(MY,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(tJ())}})}),sd("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!a&&sd(DT,{"aria-label":"Next image",icon:sd(AY,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(eJ())}})})]}),n&&ld(ad,{children:[sd(B3,{image:n.url,styleClass:"lightbox-image"}),r&&sd(mJ,{image:n})]})]}),sd(b5,{})]})]})}const j3=cU([NZ],(e=>{const{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=e;return{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),H3=()=>{const e=noe(),{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=roe(j3);return ld(kI,{direction:"column",gap:"1rem",children:[sd(hZ,{sliderMarkRightOffset:-6,label:"Seam Size",min:1,max:256,sliderNumberInputProps:{max:512},value:t,onChange:t=>{e(Qte(t))},handleReset:()=>e(Qte(96)),withInput:!0,withSliderMarks:!0,withReset:!0}),sd(hZ,{sliderMarkRightOffset:-4,label:"Seam Blur",min:0,max:64,sliderNumberInputProps:{max:512},value:n,onChange:t=>{e(Xte(t))},handleReset:()=>{e(Xte(16))},withInput:!0,withSliderMarks:!0,withReset:!0}),sd(hZ,{sliderMarkRightOffset:-2,label:"Seam Strength",min:.01,max:.99,step:.01,value:r,onChange:t=>{e(ene(t))},handleReset:()=>{e(ene(.7))},withInput:!0,withSliderMarks:!0,withReset:!0}),sd(hZ,{sliderMarkRightOffset:-4,label:"Seam Steps",min:1,max:32,sliderNumberInputProps:{max:100},value:o,onChange:t=>{e(Jte(t))},handleReset:()=>{e(Jte(10))},withInput:!0,withSliderMarks:!0,withReset:!0})]})},W3=cU(_X,(e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),U3=()=>{const e=noe(),{boundingBoxDimensions:t}=roe(W3);return ld(kI,{direction:"column",gap:"1rem",children:[sd(hZ,{label:"Width",min:64,max:1024,step:64,value:t.width,onChange:n=>{e(UK({...t,width:Math.floor(n)}))},handleReset:()=>{e(UK({...t,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),sd(hZ,{label:"Height",min:64,max:1024,step:64,value:t.height,onChange:n=>{e(UK({...t,height:Math.floor(n)}))},handleReset:()=>{e(UK({...t,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0})]})},V3=cU(_X,(e=>{const{inpaintReplace:t,shouldUseInpaintReplace:n}=e;return{inpaintReplace:t,shouldUseInpaintReplace:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function G3(){const{inpaintReplace:e,shouldUseInpaintReplace:t}=roe(V3),n=noe();return ld(kI,{alignItems:"center",columnGap:"1rem",children:[sd(hZ,{label:"Inpaint Replace",value:e,onChange:e=>{n(JK(e))},min:0,max:1,step:.05,isInteger:!1,isSliderDisabled:!t,withSliderMarks:!0,sliderMarkRightOffset:-2,withReset:!0,handleReset:()=>n(JK(1)),isResetDisabled:!t}),sd(Yq,{isChecked:t,onChange:e=>n(EQ(e.target.checked))})]})}const $3=cU([NZ,bX,_X],((e,t,n)=>{const{tileSize:r,infillMethod:o}=e,{infill_methods:i}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:o,availableInfillMethods:i,isManual:"manual"===a}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),q3=()=>{const e=noe(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:o,isManual:i,scaledBoundingBoxDimensions:a}=roe($3);return ld(kI,{direction:"column",gap:"1rem",children:[sd(Bq,{label:"Scale Before Processing",validValues:wX,value:o,onChange:t=>{e(GK(t.target.value))}}),sd(hZ,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:"Scaled W",min:64,max:1024,step:64,value:a.width,onChange:t=>{e(IQ({...a,width:Math.floor(t)}))},handleReset:()=>{e(IQ({...a,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),sd(hZ,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:"Scaled H",min:64,max:1024,step:64,value:a.height,onChange:t=>{e(IQ({...a,height:Math.floor(t)}))},handleReset:()=>{e(IQ({...a,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),sd(G3,{}),sd(Bq,{label:"Infill Method",value:n,validValues:r,onChange:t=>e(jte(t.target.value))}),sd(hZ,{isInputDisabled:"tile"!==n,isResetDisabled:"tile"!==n,isSliderDisabled:"tile"!==n,sliderMarkRightOffset:-4,label:"Tile Size",min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:t=>{e(vne(t))},handleReset:()=>{e(vne(32))},withInput:!0,withSliderMarks:!0,withReset:!0})]})};function Z3(){const e={boundingBox:{header:"Bounding Box",feature:Rq.BOUNDING_BOX,content:sd(U3,{})},seamCorrection:{header:"Seam Correction",feature:Rq.SEAM_CORRECTION,content:sd(H3,{})},infillAndScaling:{header:"Infill and Scaling",feature:Rq.INFILL_AND_SCALING,content:sd(q3,{})},seed:{header:"Seed",feature:Rq.SEED,content:sd(kZ,{})},variations:{header:"Variations",feature:Rq.VARIATIONS,content:sd(OZ,{}),additionalHeaderComponents:sd(PZ,{})}};return ld(BQ,{children:[sd(ZX,{}),sd($X,{}),sd(UZ,{}),sd(fZ,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),sd(_Y,{accordionInfo:e})]})}const Y3=cU(_X,LX,RZ,((e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}})),X3=()=>{const e=noe(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=roe(Y3),a=i.exports.useRef(null);return i.exports.useLayoutEffect((()=>{window.setTimeout((()=>{if(!a.current)return;const{clientWidth:t,clientHeight:n}=a.current;e(ZK({width:t,height:n})),e(o?HK():jK()),e(KK(!1))}),0)}),[e,r,t,n,o]),sd("div",{ref:a,className:"inpainting-canvas-area",children:sd(dT,{thickness:"2px",speed:"1s",size:"xl"})})};var K3=Math.PI/180;const Q3="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},J3={_global:Q3,version:"8.3.14",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle:e=>J3.angleDeg?e*K3:e,enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>J3.DD.isDragging,isDragReady:()=>!!J3.DD.node,releaseCanvasOnDestroy:!0,document:Q3.document,_injectGlobal(e){Q3.Konva=e}},e4=e=>{J3[e.prototype.getClassName()]=e};J3._injectGlobal(J3);class t4{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new t4(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,o=this.m[1]*t+this.m[3]*n,i=this.m[0]*-n+this.m[2]*t,a=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=o,this.m[2]=i,this.m[3]=a,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,o=this.m[2]+this.m[0]*e,i=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=o,this.m[3]=i,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],a=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}getMatrix(){return this.m}decompose(){var e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],o=e*r-t*n;let i={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){var a=Math.sqrt(e*e+t*t);i.rotation=t>0?Math.acos(e/a):-Math.acos(e/a),i.scaleX=a,i.scaleY=o/a,i.skewX=(e*n+t*r)/o,i.skewY=0}else if(0!=n||0!=r){var s=Math.sqrt(n*n+r*r);i.rotation=Math.PI/2-(r>0?Math.acos(-n/s):-Math.acos(n/s)),i.scaleX=o/s,i.scaleY=s,i.skewX=0,i.skewY=(e*n+t*r)/o}return i.rotation=c4._getRotation(i.rotation),i}}var n4=Math.PI/180,r4=180/Math.PI,o4="Konva error: ",i4={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},a4=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,s4=[];const l4="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)},c4={_isElement:e=>!(!e||1!=e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector(e){if("string"!=typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:e=>0===e||e>0?1:-1,requestAnimFrame(e){s4.push(e),1===s4.length&&l4((function(){const e=s4;s4=[],e.forEach((function(e){e()}))}))},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(vV){}return e},createImageElement:()=>document.createElement("img"),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=c4.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB(e){var t;return e in i4?{r:(t=i4[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=a4.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA:e=>(e=e||"black",c4._namedColorToRBA(e)||c4._hex3ColorToRGBA(e)||c4._hex6ColorToRGBA(e)||c4._rgbColorToRGBA(e)||c4._rgbaColorToRGBA(e)||c4._hslColorToRGBA(e)),_namedColorToRBA(e){var t=i4[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,o=Number(n[1])/100,i=Number(n[2])/100;let a,s,l;if(0===o)return l=255*i,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};a=i<.5?i*(1+o):i+o-i*o;const c=2*i-a,u=[0,0,0];for(let e=0;e<3;e++)s=r+1/3*-(e-1),s<0&&s++,s>1&&s--,l=6*s<1?c+6*(a-c)*s:2*s<1?a:3*s<2?c+(a-c)*(2/3-s)*6:c,u[e]=255*l;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:(e,t)=>!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.heighte.slice(0),degToRad:e=>e*n4,radToDeg:e=>e*r4,_degToRad:e=>(c4.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),c4.degToRad(e)),_radToDeg:e=>(c4.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),c4.radToDeg(e)),_getRotation:e=>J3.angleDeg?c4.radToDeg(e):e,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw new Error(o4+e)},error(e){console.error(o4+e)},warn(e){J3.showWarnings&&console.warn("Konva warning: "+e)},each(e,t){for(var n in e)t(n,e[n])},_inRange:(e,t,n)=>t<=e&&e1?(a=n,s=r,l=(n-o)*(n-o)+(r-i)*(r-i)):l=((a=e+u*(n-e))-o)*(a-o)+((s=t+u*(r-t))-i)*(s-i)}return[a,s,l]},_getProjectionToLine(e,t,n){var r=c4.cloneObject(e),o=Number.MAX_VALUE;return t.forEach((function(i,a){if(n||a!==t.length-1){var s=t[(a+1)%t.length],l=c4._getProjectionToSegment(i.x,i.y,s.x,s.y,e.x,e.y),c=l[0],u=l[1],d=l[2];dt.length){var a=t;t=e,e=a}for(r=0;re.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...e){J3.releaseCanvasOnDestroy&&e.forEach((e=>{e.width=0,e.height=0}))}};function u4(e){return c4._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||c4._isBoolean(e)?e:Object.prototype.toString.call(e)}function d4(e){return e>255?255:e<0?0:Math.round(e)}function h4(){if(J3.isUnminified)return function(e,t){return c4._isNumber(e)||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function f4(e){if(J3.isUnminified)return function(t,n){let r=c4._isNumber(t),o=c4._isArray(t)&&t.length==e;return r||o||c4.warn(u4(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function p4(){if(J3.isUnminified)return function(e,t){return c4._isNumber(e)||"auto"===e||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function g4(){if(J3.isUnminified)return function(e,t){return c4._isString(e)||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function m4(){if(J3.isUnminified)return function(e,t){const n=c4._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function v4(){if(J3.isUnminified)return function(e,t){return!0===e||!1===e||c4.warn(u4(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var b4="get",y4="set";const x4={addGetterSetter(e,t,n,r,o){x4.addGetter(e,t,n),x4.addSetter(e,t,r,o),x4.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=b4+c4._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter(e,t,n,r){var o=y4+c4._capitalize(t);e.prototype[o]||x4.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var o=y4+c4._capitalize(t);e.prototype[o]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,o){var i,a,s=n.length,l=c4._capitalize,c=b4+l(t),u=y4+l(t);e.prototype[c]=function(){var e={};for(i=0;i{this._setAttr(t+l(e),void 0)})),this._fireChangeEvent(t,a,e),o&&o.call(this),this},x4.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=c4._capitalize(t),r=y4+n,o=b4+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[o]()}},addDeprecatedGetterSetter(e,t,n,r){c4.error("Adding deprecated "+t);var o=b4+c4._capitalize(t),i=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[o]=function(){c4.error(i);var e=this.attrs[t];return void 0===e?n:e},x4.addSetter(e,t,r,(function(){c4.error(i)})),x4.addOverloadedGetterSetter(e,t)},backCompat(e,t){c4.each(t,(function(t,n){var r=e.prototype[n],o=b4+c4._capitalize(t),i=y4+c4._capitalize(t);function a(){r.apply(this,arguments),c4.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[t]=a,e.prototype[o]=a,e.prototype[i]=a}))},afterSetFilter(){this._filterUpToDate=!1}};function w4(e){var t,n,r=[],o=e.length,i=c4;for(t=0;t"number"==typeof e?Math.floor(e):e))),l+="("+i.join(",")+")")):(l+=r.property,e||(l+="="+r.val)),l+=";";return l}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),t.length>=100&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)}_applyOpacity(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)}arcTo(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)}drawImage(e,t,n,r,o,i,a,s,l){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,o):9===c.length&&u.drawImage(e,t,n,r,o,i,a,s,l)}ellipse(e,t,n,r,o,i,a,s){this._context.ellipse(e,t,n,r,o,i,a,s)}isPointInPath(e,t){return this._context.isPointInPath(e,t)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)}translate(e,t){this._context.translate(e,t)}_enableTrace(){var e,t,n=this,r=S4.length,o=this.setAttr,i=function(e){var r,o=n[e];n[e]=function(){return t=w4(Array.prototype.slice.call(arguments,0)),r=o.apply(n,arguments),n._trace({method:e,args:t}),r}};for(e=0;e{"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return A4._dragElements.forEach((t=>{e=t.node})),e},_dragElements:new Map,_drag(e){const t=[];A4._dragElements.forEach(((n,r)=>{const{node:o}=n,i=o.getStage();i.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=c4._getFirstPointerId(e));const a=i._changedPointerPositions.find((e=>e.id===n.pointerId));if(a){if("dragging"!==n.dragStatus){var s=o.dragDistance();if(Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y)){t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)}))},_endDragBefore(e){const t=[];A4._dragElements.forEach((n=>{const{node:r}=n,o=r.getStage();e&&o.setPointersPositions(e);if(!o._changedPointerPositions.find((e=>e.id===n.pointerId)))return;"dragging"!==n.dragStatus&&"stopped"!==n.dragStatus||(A4.justDragged=!0,J3._mouseListenClick=!1,J3._touchListenClick=!1,J3._pointerListenClick=!1,n.dragStatus="stopped");const i=n.node.getLayer()||n.node instanceof J3.Stage&&n.node;i&&-1===t.indexOf(i)&&t.push(i)})),t.forEach((e=>{e.draw()}))},_endDragAfter(e){A4._dragElements.forEach(((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&A4._dragElements.delete(n)}))}};J3.isBrowser&&(window.addEventListener("mouseup",A4._endDragBefore,!0),window.addEventListener("touchend",A4._endDragBefore,!0),window.addEventListener("mousemove",A4._drag),window.addEventListener("touchmove",A4._drag),window.addEventListener("mouseup",A4._endDragAfter,!1),window.addEventListener("touchend",A4._endDragAfter,!1));var T4="absoluteOpacity",O4="allEventListeners",I4="absoluteTransform",R4="absoluteScale",N4="canvas",D4="listening",z4="mouseenter",B4="mouseleave",F4="Shape",j4=" ",H4="stage",W4="transform",U4="visible",V4=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(j4);let G4=1;class $4{constructor(e){this._id=G4++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==W4&&e!==I4||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var n=this._cache.get(e);return(void 0===n||(e===W4||e===I4)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){const n=t.map((e=>e+"Change.konva")).join(j4);this.on(n,(()=>{this._clearCache(e)})),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(N4)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===I4&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(N4)){const{scene:e,filter:t,hit:n}=this._cache.get(N4);c4.releaseCanvas(e,t,n),this._cache.delete(N4)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t=e||{},n={};void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(t.width||n.width),o=Math.ceil(t.height||n.height),i=t.pixelRatio,a=void 0===t.x?Math.floor(n.x):t.x,s=void 0===t.y?Math.floor(n.y):t.y,l=t.offset||0,c=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(r&&o){a-=l,s-=l;var d=new P4({pixelRatio:i,width:r+=2*l+1,height:o+=2*l+1}),h=new P4({pixelRatio:i,width:0,height:0}),f=new M4({pixelRatio:u,width:r,height:o}),p=d.getContext(),g=f.getContext();return f.isCache=!0,d.isCache=!0,this._cache.delete(N4),this._filterUpToDate=!1,!1===t.imageSmoothingEnabled&&(d.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),p.save(),g.save(),p.translate(-a,-s),g.translate(-a,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache(T4),this._clearSelfAndDescendantCache(R4),this.drawScene(d,this),this.drawHit(f,this),this._isUnderCache=!1,p.restore(),g.restore(),c&&(p.save(),p.beginPath(),p.rect(0,0,r,o),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(N4,{scene:d,filter:h,hit:f,x:a,y:s}),this._requestDraw(),this}c4.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(N4)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,t){var n,r,o,i,a=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=this.getAbsoluteTransform(t);return a.forEach((function(e){var t=s.point(e);void 0===n&&(n=o=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),i=Math.max(i,t.y)})),{x:n,y:r,width:o-n,height:i-r}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const t=this._getCanvasCache();e.translate(t.x,t.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){var t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e,t,n,r,o=this.filters(),i=this._getCanvasCache(),a=i.scene,s=i.filter,l=s.getContext();if(o){if(!this._filterUpToDate){var c=a.pixelRatio;s.setSize(a.width/a.pixelRatio,a.height/a.pixelRatio);try{for(e=o.length,l.clear(),l.drawImage(a._canvas,0,0,a.getWidth()/c,a.getHeight()/c),t=l.getImageData(0,0,s.getWidth(),s.getHeight()),n=0;n{var t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+c4._capitalize(t),c4._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))})),this}isListening(){return this._getCache(D4,this._isListening)}_isListening(e){if(!this.listening())return!1;const t=this.getParent();return!t||t===e||this===e||t._isListening(e)}isVisible(){return this._getCache(U4,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const t=this.getParent();return!t||t===e||this===e||t._isVisible(e)}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;A4._dragElements.forEach((e=>{"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var o=!t&&!J3.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e,t,n,r,o=this.getDepth(),i=this,a=0;return"Stage"!==i.nodeType&&function s(l){for(e=[],t=l.length,n=0;n0&&e[0].getDepth()<=o&&s(e)}(i.getStage().getChildren()),a}getDepth(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(W4),this._clearSelfAndDescendantCache(I4)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges((()=>{this.x(e.x),this.y(e.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),o=new t4,i=this.offset();return o.m=r.slice(),o.translate(i.x,i.y),o.getTranslation()}setAbsolutePosition(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(W4);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(W4),this._clearSelfAndDescendantCache(I4),this}_setTransform(e){var t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){var t=e.x,n=e.y,r=this.x(),o=this.y();return void 0!==t&&(r+=t),void 0!==n&&(o+=n),this.setPosition({x:r,y:o}),this}_eachAncestorReverse(e,t){var n,r,o=[],i=this.getParent();if(!t||t._id!==this._id){for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return c4.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return c4.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&c4.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(T4,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,n,r,o={},i=this.getAttrs();for(e in o.attrs={},i)t=i[e],c4.isObject(t)&&!c4._isPlainObject(t)&&!c4._isArray(t)||(n="function"==typeof this[e]&&this[e],delete i[e],r=n?n.call(this):null,i[e]=t,r!==t&&(o.attrs[e]=t));return o.className=this.getClassName(),c4._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var o=this.parent;o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),o=r.length;for(t=0;t{try{const n=null==e?void 0:e.callback;n&&delete e.callback,c4._urlToImage(this.toDataURL(e),(function(e){t(e),null==n||n(e)}))}catch(Kie){n(Kie)}}))}toBlob(e){return new Promise(((t,n)=>{try{const n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob((e=>{t(e),null==n||n(e)}))}catch(Kie){n(Kie)}}))}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():J3.dragDistance}_off(e,t,n){var r,o,i,a=this.eventListeners[e];for(r=0;r=0)&&!this.isDragging()){var t=!1;A4._dragElements.forEach((e=>{this.isAncestorOf(e.node)&&(t=!0)})),t||this._createDragElement(e)}}))}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=A4._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&A4._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const t=this.getStage();if(!t)return!1;const n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return c4.haveIntersection(n,this.getClientRect())}static create(e,t){return c4._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var n,r,o,i=$4.prototype.getClassName.call(e),a=e.children;t&&(e.attrs.container=t),J3[i]||(c4.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");if(n=new(0,J3[i])(e.attrs),a)for(r=a.length,o=0;o0}removeChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}add(...e){if(arguments.length>1){for(var t=0;t0?t[0]:void 0}_generalFind(e,t){var n=[];return this._descendants((r=>{const o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),n}_descendants(e){let t=!1;const n=this.getChildren();for(const r of n){if(t=e(r),t)return!0;if(r.hasChildren()&&(t=r._descendants(e),t))return!0}return!1}toObject(){var e=$4.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((t=>{e.children.push(t.toObject())})),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=$4.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),o=r&&r.getContext(),i=this._getCanvasCache(),a=i&&i.scene,s=r&&r.isCache;if(!this.isVisible()&&!s)return this;if(a){o.save();var l=this.getAbsoluteTransform(t).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,t);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,o=r&&r.getContext(),i=this._getCanvasCache();if(i&&i.hit){o.save();var a=this.getAbsoluteTransform(t).getMatrix();o.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n){var r,o=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),s=this.clipFunc(),l=i&&a||s;const c=n===this;if(l){o.save();var u=this.getAbsoluteTransform(n),d=u.getMatrix();if(o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),o.beginPath(),s)s.call(this,o,this);else{var h=this.clipX(),f=this.clipY();o.rect(h,f,i,a)}o.clip(),d=u.copy().invert().getMatrix(),o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var p=!c&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;p&&(o.save(),o._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),p&&o.restore(),l&&o.restore()}getClientRect(e){var t,n,r,o,i,a=(e=e||{}).skipTransform,s=e.relativeTo,l={x:1/0,y:1/0,width:0,height:0},c=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var a=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===a.width&&0===a.height||(void 0===n?(n=a.x,r=a.y,o=a.x+a.width,i=a.y+a.height):(n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x+a.width),i=Math.max(i,a.y+a.height)))}}));for(var u=this.find("Shape"),d=!1,h=0;he.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",_6=e=>{const t=C6(e);return"pointer"===t?J3.pointerEventsEnabled&&k6.pointer:"touch"===t?k6.touch:"mouse"===t?k6.mouse:void 0};function E6(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&c4.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const L6=[];class P6 extends Z4{constructor(e){super(E6(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),L6.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{E6(this.attrs)})),this._checkVisibility()}_validateAdd(e){const t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||c4.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if("string"==typeof e){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e,t=this.children,n=t.length;for(e=0;e-1&&L6.splice(t,1),c4.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(c4.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)}_getPointerById(e){return this._pointerPositions.find((t=>t.id===e))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new P4({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}getIntersection(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){const r=n[t].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((n=>{n.setSize({width:e,height:t}),n.draw()}))}add(e,...t){if(arguments.length>1){for(var n=0;n5&&c4.warn("The stage has "+r+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),J3.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return J4(e,this)}setPointerCapture(e){e6(e,this)}releaseCapture(e){t6(e)}getLayers(){return this.children}_bindContentEvents(){J3.isBrowser&&S6.forEach((([e,t])=>{this.content.addEventListener(e,(e=>{this[t](e)}),{passive:!1})}))}_pointerenter(e){this.setPointersPositions(e);const t=_6(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const t=_6(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){const t=_6(e.type),n=C6(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),o=!A4.isDragging||J3.hitOnDragEnabled;r&&o?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):o&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const t=_6(e.type),n=C6(e.type);if(t){this.setPointersPositions(e);var r=!1;this._changedPointerPositions.forEach((o=>{var i=this.getIntersection(o);A4.justDragged=!1,J3["_"+n+"ListenClick"]=!0;if(!(i&&i.isListening()))return;J3.capturePointerEventsEnabled&&i.setPointerCapture(o.id),this[n+"ClickStartShape"]=i,i._fireAndBubble(t.pointerdown,{evt:e,pointerId:o.id}),r=!0;const a=e.type.indexOf("touch")>=0;i.preventDefault()&&e.cancelable&&a&&e.preventDefault()})),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const t=_6(e.type),n=C6(e.type);if(!t)return;if(A4.isDragging&&A4.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!(!A4.isDragging||J3.hitOnDragEnabled))return;var r={};let o=!1;var i=this._getTargetShape(n);this._changedPointerPositions.forEach((a=>{const s=K4(a.id)||this.getIntersection(a),l=a.id,c={evt:e,pointerId:l};var u=i!==s;if(u&&i&&(i._fireAndBubble(t.pointerout,Object.assign({},c),s),i._fireAndBubble(t.pointerleave,Object.assign({},c),s)),s){if(r[s._id])return;r[s._id]=!0}s&&s.isListening()?(o=!0,u&&(s._fireAndBubble(t.pointerover,Object.assign({},c),i),s._fireAndBubble(t.pointerenter,Object.assign({},c),i),this[n+"targetShape"]=s),s._fireAndBubble(t.pointermove,Object.assign({},c))):i&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:l}),this[n+"targetShape"]=null)})),o||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const t=_6(e.type),n=C6(e.type);if(!t)return;this.setPointersPositions(e);const r=this[n+"ClickStartShape"],o=this[n+"ClickEndShape"];var i={};let a=!1;this._changedPointerPositions.forEach((s=>{const l=K4(s.id)||this.getIntersection(s);if(l){if(l.releaseCapture(s.id),i[l._id])return;i[l._id]=!0}const c=s.id,u={evt:e,pointerId:c};let d=!1;J3["_"+n+"InDblClickWindow"]?(d=!0,clearTimeout(this[n+"DblTimeout"])):A4.justDragged||(J3["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout((function(){J3["_"+n+"InDblClickWindow"]=!1}),J3.dblClickWindow),l&&l.isListening()?(a=!0,this[n+"ClickEndShape"]=l,l._fireAndBubble(t.pointerup,Object.assign({},u)),J3["_"+n+"ListenClick"]&&r&&r===l&&(l._fireAndBubble(t.pointerclick,Object.assign({},u)),d&&o&&o===l&&l._fireAndBubble(t.pointerdblclick,Object.assign({},u)))):(this[n+"ClickEndShape"]=null,J3["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:c}),d&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:c}))})),a||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),J3["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(m6,{evt:e}):this._fire(m6,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(w6,{evt:e}):this._fire(w6,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const t=K4(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(u6,Q4(e)),t6(e.pointerId)}_lostpointercapture(e){t6(e.pointerId)}setPointersPositions(e){var t=this._getContentPosition(),n=null,r=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))):(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:c4._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:c4._getFirstPointerId(e)}])}_setPointerPosition(e){c4.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new P4({width:this.width(),height:this.height()}),this.bufferHitCanvas=new M4({pixelRatio:1,width:this.width(),height:this.height()}),J3.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}}cache(){return c4.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach((function(e){e.batchDraw()})),this}}P6.prototype.nodeType="Stage",e4(P6),x4.addGetterSetter(P6,"container");var M6="hasShadow",A6="shadowRGBA",T6="patternImage",O6="linearGradient",I6="radialGradient";let R6;function N6(){return R6||(R6=c4.createCanvasElement().getContext("2d"),R6)}const D6={};class z6 extends $4{constructor(e){let t;for(super(e);t=c4.getRandomColor(),!t||t in D6;);this.colorKey=t,D6[t]=this}getContext(){return c4.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return c4.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(M6,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(T6,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=N6().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const t=new t4;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(J3.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(O6,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var t=N6(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),o=t.createLinearGradient(n.x,n.y,r.x,r.y),i=0;ithis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())))}hasHitStroke(){const e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage().bufferHitCanvas;return t.getContext().clear(),this.drawHit(t,null,!0),t.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return $4.prototype.destroy.call(this),delete D6[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;const n=e||this.hasFill(),r=this.hasStroke(),o=1!==this.getAbsoluteOpacity();if(n&&r&&o)return!0;const i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(n&&r&&i&&a)}setStrokeHitEnabled(e){c4.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,i=r.width+o,a=r.height+o,s=!e.skipShadow&&this.hasShadow(),l=s?this.shadowOffsetX():0,c=s?this.shadowOffsetY():0,u=i+Math.abs(l),d=a+Math.abs(c),h=s&&this.shadowBlur()||0,f={width:u+2*h,height:d+2*h,x:-(o/2+h)+Math.min(l,0)+r.x,y:-(o/2+h)+Math.min(c,0)+r.y};return t?f:this._transformedRect(f,n)}drawScene(e,t){var n,r,o=this.getLayer(),i=e||o.getCanvas(),a=i.getContext(),s=this._getCanvasCache(),l=this.getSceneFunc(),c=this.hasShadow(),u=i.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(s){a.save();var h=this.getAbsoluteTransform(t).getMatrix();return a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!l)return this;if(a.save(),this._useBufferCanvas()&&!u){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var f=this.getAbsoluteTransform(t).getMatrix();r.transform(f[0],f[1],f[2],f[3],f[4],f[5]),l.call(this,r,this),r.restore();var p=n.pixelRatio;c&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(a._applyLineJoin(this),!d){f=this.getAbsoluteTransform(t).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}c&&a._applyShadow(this),l.call(this,a,this)}return a.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),o=e||r.hitCanvas,i=o&&o.getContext(),a=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),l=s&&s.hit;if(this.colorKey||c4.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),l){i.save();var c=this.getAbsoluteTransform(t).getMatrix();return i.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(i),i.restore(),this}if(!a)return this;i.save(),i._applyLineJoin(this);if(!(this===t)){var u=this.getAbsoluteTransform(t).getMatrix();i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}return a.call(this,i,this),i.restore(),this}drawHitFromCache(e=0){var t,n,r,o,i,a=this._getCanvasCache(),s=this._getCachedSceneCanvas(),l=a.hit,c=l.getContext(),u=l.getWidth(),d=l.getHeight();c.clear(),c.drawImage(s._canvas,0,0,u,d);try{for(r=(n=(t=c.getImageData(0,0,u,d)).data).length,o=c4._hexToRgb(this.colorKey),i=0;ie?(n[i]=o.r,n[i+1]=o.g,n[i+2]=o.b,n[i+3]=255):n[i+3]=0;c.putImageData(t,0,0)}catch(vV){c4.error("Unable to draw hit graph from cached scene canvas. "+vV.message)}return this}hasPointerCapture(e){return J4(e,this)}setPointerCapture(e){e6(e,this)}releaseCapture(e){t6(e)}}z6.prototype._fillFunc=function(e){e.fill()},z6.prototype._strokeFunc=function(e){e.stroke()},z6.prototype._fillFuncHit=function(e){e.fill()},z6.prototype._strokeFuncHit=function(e){e.stroke()},z6.prototype._centroid=!1,z6.prototype.nodeType="Shape",e4(z6),z6.prototype.eventListeners={},z6.prototype.on.call(z6.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(M6)})),z6.prototype.on.call(z6.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(A6)})),z6.prototype.on.call(z6.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(T6)})),z6.prototype.on.call(z6.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(O6)})),z6.prototype.on.call(z6.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(I6)})),x4.addGetterSetter(z6,"stroke",void 0,m4()),x4.addGetterSetter(z6,"strokeWidth",2,h4()),x4.addGetterSetter(z6,"fillAfterStrokeEnabled",!1),x4.addGetterSetter(z6,"hitStrokeWidth","auto",p4()),x4.addGetterSetter(z6,"strokeHitEnabled",!0,v4()),x4.addGetterSetter(z6,"perfectDrawEnabled",!0,v4()),x4.addGetterSetter(z6,"shadowForStrokeEnabled",!0,v4()),x4.addGetterSetter(z6,"lineJoin"),x4.addGetterSetter(z6,"lineCap"),x4.addGetterSetter(z6,"sceneFunc"),x4.addGetterSetter(z6,"hitFunc"),x4.addGetterSetter(z6,"dash"),x4.addGetterSetter(z6,"dashOffset",0,h4()),x4.addGetterSetter(z6,"shadowColor",void 0,g4()),x4.addGetterSetter(z6,"shadowBlur",0,h4()),x4.addGetterSetter(z6,"shadowOpacity",1,h4()),x4.addComponentsGetterSetter(z6,"shadowOffset",["x","y"]),x4.addGetterSetter(z6,"shadowOffsetX",0,h4()),x4.addGetterSetter(z6,"shadowOffsetY",0,h4()),x4.addGetterSetter(z6,"fillPatternImage"),x4.addGetterSetter(z6,"fill",void 0,m4()),x4.addGetterSetter(z6,"fillPatternX",0,h4()),x4.addGetterSetter(z6,"fillPatternY",0,h4()),x4.addGetterSetter(z6,"fillLinearGradientColorStops"),x4.addGetterSetter(z6,"strokeLinearGradientColorStops"),x4.addGetterSetter(z6,"fillRadialGradientStartRadius",0),x4.addGetterSetter(z6,"fillRadialGradientEndRadius",0),x4.addGetterSetter(z6,"fillRadialGradientColorStops"),x4.addGetterSetter(z6,"fillPatternRepeat","repeat"),x4.addGetterSetter(z6,"fillEnabled",!0),x4.addGetterSetter(z6,"strokeEnabled",!0),x4.addGetterSetter(z6,"shadowEnabled",!0),x4.addGetterSetter(z6,"dashEnabled",!0),x4.addGetterSetter(z6,"strokeScaleEnabled",!0),x4.addGetterSetter(z6,"fillPriority","color"),x4.addComponentsGetterSetter(z6,"fillPatternOffset",["x","y"]),x4.addGetterSetter(z6,"fillPatternOffsetX",0,h4()),x4.addGetterSetter(z6,"fillPatternOffsetY",0,h4()),x4.addComponentsGetterSetter(z6,"fillPatternScale",["x","y"]),x4.addGetterSetter(z6,"fillPatternScaleX",1,h4()),x4.addGetterSetter(z6,"fillPatternScaleY",1,h4()),x4.addComponentsGetterSetter(z6,"fillLinearGradientStartPoint",["x","y"]),x4.addComponentsGetterSetter(z6,"strokeLinearGradientStartPoint",["x","y"]),x4.addGetterSetter(z6,"fillLinearGradientStartPointX",0),x4.addGetterSetter(z6,"strokeLinearGradientStartPointX",0),x4.addGetterSetter(z6,"fillLinearGradientStartPointY",0),x4.addGetterSetter(z6,"strokeLinearGradientStartPointY",0),x4.addComponentsGetterSetter(z6,"fillLinearGradientEndPoint",["x","y"]),x4.addComponentsGetterSetter(z6,"strokeLinearGradientEndPoint",["x","y"]),x4.addGetterSetter(z6,"fillLinearGradientEndPointX",0),x4.addGetterSetter(z6,"strokeLinearGradientEndPointX",0),x4.addGetterSetter(z6,"fillLinearGradientEndPointY",0),x4.addGetterSetter(z6,"strokeLinearGradientEndPointY",0),x4.addComponentsGetterSetter(z6,"fillRadialGradientStartPoint",["x","y"]),x4.addGetterSetter(z6,"fillRadialGradientStartPointX",0),x4.addGetterSetter(z6,"fillRadialGradientStartPointY",0),x4.addComponentsGetterSetter(z6,"fillRadialGradientEndPoint",["x","y"]),x4.addGetterSetter(z6,"fillRadialGradientEndPointX",0),x4.addGetterSetter(z6,"fillRadialGradientEndPointY",0),x4.addGetterSetter(z6,"fillPatternRotation",0),x4.backCompat(z6,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var B6=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],F6=B6.length;class j6 extends Z4{constructor(e){super(e),this.canvas=new P4,this.hitCanvas=new M4({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let r=0;r0?{antialiased:!0}:{}}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),Z4.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}drawHit(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),Z4.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){c4.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return c4.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return c4.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}j6.prototype.nodeType="Layer",e4(j6),x4.addGetterSetter(j6,"imageSmoothingEnabled",!0),x4.addGetterSetter(j6,"clearBeforeDraw",!0),x4.addGetterSetter(j6,"hitGraphEnabled",!0,v4());class H6 extends j6{constructor(e){super(e),this.listening(!1),c4.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}H6.prototype.nodeType="FastLayer",e4(H6);class W6 extends Z4{_validateAdd(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&c4.throw("You may only add groups and shapes to groups.")}}W6.prototype.nodeType="Group",e4(W6);var U6=Q3.performance&&Q3.performance.now?function(){return Q3.performance.now()}:function(){return(new Date).getTime()};class V6{constructor(e,t){this.id=V6.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:U6(),frameRate:0},this.func=e,this.setLayers(t)}setLayers(e){var t=[];return t=e?e.length>0?e:[e]:[],this.layers=t,this}getLayers(){return this.layers}addLayer(e){var t,n=this.layers,r=n.length;for(t=0;tthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class Y6{constructor(e){var t,n,r=this,o=e.node,i=o._id,a=e.easing||X6.Linear,s=!!e.yoyo;t=void 0===e.duration?.3:0===e.duration?.001:e.duration,this.node=o,this._id=$6++;var l=o.getLayer()||(o instanceof J3.Stage?o.getLayers():null);for(n in l||c4.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new V6((function(){r.tween.onEnterFrame()}),l),this.tween=new Z6(n,(function(e){r._tweenFunc(e)}),a,0,1,1e3*t,s),this._addListeners(),Y6.attrs[i]||(Y6.attrs[i]={}),Y6.attrs[i][this._id]||(Y6.attrs[i][this._id]={}),Y6.tweens[i]||(Y6.tweens[i]={}),e)void 0===G6[n]&&this._addAttr(n,e[n]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){var n,r,o,i,a,s,l,c,u=this.node,d=u._id;if((o=Y6.tweens[d][e])&&delete Y6.attrs[d][o][e],n=u.getAttr(e),c4._isArray(t))if(r=[],a=Math.max(t.length,n.length),"points"===e&&t.length!==n.length&&(t.length>n.length?(l=n,n=c4._prepareArrayForTween(n,t,u.closed())):(s=t,t=c4._prepareArrayForTween(t,n,u.closed()))),0===e.indexOf("fill"))for(i=0;i{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=Y6.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=Y6.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,n=this._id,r=Y6.tweens[t];for(e in this.pause(),r)delete Y6.tweens[t][e];delete Y6.attrs[t][n]}}Y6.attrs={},Y6.tweens={},$4.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new Y6(e).play()};const X6={BackEaseIn(e,t,n,r){var o=1.70158;return n*(e/=r)*e*((o+1)*e-o)+t},BackEaseOut(e,t,n,r){var o=1.70158;return n*((e=e/r-1)*e*((o+1)*e+o)+1)+t},BackEaseInOut(e,t,n,r){var o=1.70158;return(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},ElasticEaseIn(e,t,n,r,o,i){var a=0;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),!o||o(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-X6.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>en*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t},K6=c4._assign(J3,{Util:c4,Transform:t4,Node:$4,Container:Z4,Stage:P6,stages:L6,Layer:j6,FastLayer:H6,Group:W6,DD:A4,Shape:z6,shapes:D6,Animation:V6,Tween:Y6,Easings:X6,Context:k4,Canvas:L4});class Q6 extends z6{_sceneFunc(e){var t=J3.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=J3.getAngle(n?360-this.angle():this.angle()),o=Math.cos(Math.min(r,Math.PI)),i=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),a=Math.sin(Math.min(r,Math.PI/2)),s=o*(o>0?e:t),l=i*(i>0?e:t),c=a*(a>0?t:e);return{x:s,y:n?-1*c:l,width:1*t-s,height:c-l}}}function J6(e,t,n,r,o,i,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2)),c=a*s/(s+l),u=a*l/(s+l);return[n-c*(o-e),r-c*(i-t),n+u*(o-e),r+u*(i-t)]}function e7(e,t){var n,r,o=e.length,i=[];for(n=2;n4){for(n=(t=this.getTensionPoints()).length,r=s?0:4,s||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);rc?l:c,g=l>c?1:l/c,m=l>c?c/l:1;e.translate(a,s),e.rotate(h),e.scale(g,m),e.arc(0,0,p,u,u+d,1-f),e.scale(1/g,1/m),e.rotate(-h),e.translate(-a,-s);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var n=t.points[4],r=t.points[5],o=t.points[4]+r,i=Math.PI/180;if(Math.abs(n-o)o;r-=i){const n=n7.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],r,0);e.push(n.x,n.y)}else for(let r=n+i;rthis.dataArray[n].pathLength;)e-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(t=this.dataArray[n-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[n].points.slice(0,2))[0],y:t[1]};var o=this.dataArray[n],i=o.points;switch(o.command){case"L":return n7.getPointOnLine(e,o.start.x,o.start.y,i[0],i[1]);case"C":return n7.getPointOnCubicBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3],i[4],i[5]);case"Q":return n7.getPointOnQuadraticBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3]);case"A":var a=i[0],s=i[1],l=i[2],c=i[3],u=i[4],d=i[5],h=i[6];return u+=d*e/o.pathLength,n7.getPointOnEllipticalArc(a,s,l,c,u,h)}return null}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPointOnLine(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var s=(o-n)/(r-t+1e-8),l=Math.sqrt(e*e/(1+s*s));r0&&!isNaN(f[0]);){var v,b,y,x,w,S,k,C,_,E,L=null,P=[],M=l,A=c;switch(h){case"l":l+=f.shift(),c+=f.shift(),L="L",P.push(l,c);break;case"L":l=f.shift(),c=f.shift(),P.push(l,c);break;case"m":var T=f.shift(),O=f.shift();if(l+=T,c+=O,L="M",a.length>2&&"z"===a[a.length-1].command)for(var I=a.length-2;I>=0;I--)if("M"===a[I].command){l=a[I].points[0]+T,c=a[I].points[1]+O;break}P.push(l,c),h="l";break;case"M":l=f.shift(),c=f.shift(),L="M",P.push(l,c),h="L";break;case"h":l+=f.shift(),L="L",P.push(l,c);break;case"H":l=f.shift(),L="L",P.push(l,c);break;case"v":c+=f.shift(),L="L",P.push(l,c);break;case"V":c=f.shift(),L="L",P.push(l,c);break;case"C":P.push(f.shift(),f.shift(),f.shift(),f.shift()),l=f.shift(),c=f.shift(),P.push(l,c);break;case"c":P.push(l+f.shift(),c+f.shift(),l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),L="C",P.push(l,c);break;case"S":b=l,y=c,"C"===(v=a[a.length-1]).command&&(b=l+(l-v.points[2]),y=c+(c-v.points[3])),P.push(b,y,f.shift(),f.shift()),l=f.shift(),c=f.shift(),L="C",P.push(l,c);break;case"s":b=l,y=c,"C"===(v=a[a.length-1]).command&&(b=l+(l-v.points[2]),y=c+(c-v.points[3])),P.push(b,y,l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),L="C",P.push(l,c);break;case"Q":P.push(f.shift(),f.shift()),l=f.shift(),c=f.shift(),P.push(l,c);break;case"q":P.push(l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),L="Q",P.push(l,c);break;case"T":b=l,y=c,"Q"===(v=a[a.length-1]).command&&(b=l+(l-v.points[0]),y=c+(c-v.points[1])),l=f.shift(),c=f.shift(),L="Q",P.push(b,y,l,c);break;case"t":b=l,y=c,"Q"===(v=a[a.length-1]).command&&(b=l+(l-v.points[0]),y=c+(c-v.points[1])),l+=f.shift(),c+=f.shift(),L="Q",P.push(b,y,l,c);break;case"A":x=f.shift(),w=f.shift(),S=f.shift(),k=f.shift(),C=f.shift(),_=l,E=c,l=f.shift(),c=f.shift(),L="A",P=this.convertEndpointToCenterParameterization(_,E,l,c,k,C,x,w,S);break;case"a":x=f.shift(),w=f.shift(),S=f.shift(),k=f.shift(),C=f.shift(),_=l,E=c,l+=f.shift(),c+=f.shift(),L="A",P=this.convertEndpointToCenterParameterization(_,E,l,c,k,C,x,w,S)}a.push({command:L||h,points:P,start:{x:M,y:A},pathLength:this.calcLength(M,A,L||h,P)})}"z"!==h&&"Z"!==h||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,t,n,r){var o,i,a,s,l=n7;switch(n){case"L":return l.getLineLength(e,t,r[0],r[1]);case"C":for(o=0,i=l.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)a=l.getPointOnCubicBezier(s,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"Q":for(o=0,i=l.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)a=l.getPointOnQuadraticBezier(s,e,t,r[0],r[1],r[2],r[3]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"A":o=0;var c=r[4],u=r[5],d=r[4]+u,h=Math.PI/180;if(Math.abs(c-d)d;s-=h)a=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;else for(s=c+h;s1&&(a*=Math.sqrt(h),s*=Math.sqrt(h));var f=Math.sqrt((a*a*(s*s)-a*a*(d*d)-s*s*(u*u))/(a*a*(d*d)+s*s*(u*u)));o===i&&(f*=-1),isNaN(f)&&(f=0);var p=f*a*d/s,g=f*-s*u/a,m=(e+n)/2+Math.cos(c)*p-Math.sin(c)*g,v=(t+r)/2+Math.sin(c)*p+Math.cos(c)*g,b=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},y=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(b(e)*b(t))},x=function(e,t){return(e[0]*t[1]=1&&(C=0),0===i&&C>0&&(C-=2*Math.PI),1===i&&C<0&&(C+=2*Math.PI),[m,v,a,s,w,C,c,i]}}n7.prototype.className="Path",n7.prototype._attrsAffectingSize=["data"],e4(n7),x4.addGetterSetter(n7,"data");class r7 extends t7{_sceneFunc(e){super._sceneFunc(e);var t=2*Math.PI,n=this.points(),r=n,o=0!==this.tension()&&n.length>4;o&&(r=this.getTensionPoints());var i,a,s=this.pointerLength(),l=n.length;if(o){const e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[l-2],n[l-1]],t=n7.calcLength(r[r.length-4],r[r.length-3],"C",e),o=n7.getPointOnQuadraticBezier(Math.min(1,1-s/t),e[0],e[1],e[2],e[3],e[4],e[5]);i=n[l-2]-o.x,a=n[l-1]-o.y}else i=n[l-2]-n[l-4],a=n[l-1]-n[l-3];var c=(Math.atan2(a,i)+t)%t,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[l-2],n[l-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),o?(i=(r[0]+r[2])/2-n[0],a=(r[1]+r[3])/2-n[1]):(i=n[2]-n[0],a=n[3]-n[1]),e.rotate((Math.atan2(-a,-i)+t)%t),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}r7.prototype.className="Arrow",e4(r7),x4.addGetterSetter(r7,"pointerLength",10,h4()),x4.addGetterSetter(r7,"pointerWidth",10,h4()),x4.addGetterSetter(r7,"pointerAtBeginning",!1),x4.addGetterSetter(r7,"pointerAtEnding",!0);class o7 extends z6{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}o7.prototype._centroid=!0,o7.prototype.className="Circle",o7.prototype._attrsAffectingSize=["radius"],e4(o7),x4.addGetterSetter(o7,"radius",0,h4());class i7 extends z6{_sceneFunc(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radiusX()}getHeight(){return 2*this.radiusY()}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}i7.prototype.className="Ellipse",i7.prototype._centroid=!0,i7.prototype._attrsAffectingSize=["radiusX","radiusY"],e4(i7),x4.addComponentsGetterSetter(i7,"radius",["x","y"]),x4.addGetterSetter(i7,"radiusX",0,h4()),x4.addGetterSetter(i7,"radiusY",0,h4());class a7 extends z6{constructor(e){super(e),this.on("imageChange.konva",(()=>{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&4===e.readyState||e&&e.addEventListener&&e.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const t=this.getWidth(),n=this.getHeight(),r=this.attrs.image;let o;if(r){const e=this.attrs.cropWidth,i=this.attrs.cropHeight;o=e&&i?[r,this.cropX(),this.cropY(),e,i,0,0,t,n]:[r,0,0,t,n]}(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),r&&e.drawImage.apply(e,o)}_hitFunc(e){var t=this.width(),n=this.height();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}getHeight(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}static fromURL(e,t,n=null){var r=c4.createImageElement();r.onload=function(){var e=new a7({image:r});t(e)},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}a7.prototype.className="Image",e4(a7),x4.addGetterSetter(a7,"image"),x4.addComponentsGetterSetter(a7,"crop",["x","y","width","height"]),x4.addGetterSetter(a7,"cropX",0,h4()),x4.addGetterSetter(a7,"cropY",0,h4()),x4.addGetterSetter(a7,"cropWidth",0,h4()),x4.addGetterSetter(a7,"cropHeight",0,h4());var s7=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],l7="up",c7="right",u7="down",d7="left",h7=s7.length;class f7 extends W6{constructor(e){super(e),this.on("add.konva",(function(e){this._addListeners(e.child),this._sync()}))}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var t,n=this,r=function(){n._sync()};for(t=0;t{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.y)})),{x:t,y:r,width:n-t,height:o-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}m7.prototype.className="RegularPolygon",m7.prototype._centroid=!0,m7.prototype._attrsAffectingSize=["radius"],e4(m7),x4.addGetterSetter(m7,"radius",0,h4()),x4.addGetterSetter(m7,"sides",0,h4());var v7=2*Math.PI;class b7 extends z6{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,v7,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),v7,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}b7.prototype.className="Ring",b7.prototype._centroid=!0,b7.prototype._attrsAffectingSize=["innerRadius","outerRadius"],e4(b7),x4.addGetterSetter(b7,"innerRadius",0,h4()),x4.addGetterSetter(b7,"outerRadius",0,h4());class y7 extends z6{constructor(e){super(e),this._updated=!0,this.anim=new V6((()=>{var e=this._updated;return this._updated=!1,e})),this.on("animationChange.konva",(function(){this.frameIndex(0)})),this.on("frameIndexChange.konva",(function(){this._updated=!0})),this.on("frameRateChange.konva",(function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())}))}_sceneFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+0],s=o[r+1],l=o[r+2],c=o[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,l,c),e.closePath(),e.fillStrokeShape(this)),u)if(i){var d=i[t],h=2*n;e.drawImage(u,a,s,l,c,d[h+0],d[h+1],l,c)}else e.drawImage(u,a,s,l,c,0,0,l,c)}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+2],s=o[r+3];if(e.beginPath(),i){var l=i[t],c=2*n;e.rect(l[c+0],l[c+1],a,s)}else e.rect(0,0,a,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval((function(){e._updateIndex()}),1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),t=this.animation();e1&&(m+=a)}}}_hitFunc(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){var t=c4._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}getWidth(){return this.attrs.width===k7||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}getHeight(){return this.attrs.height===k7||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return c4.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n=O7(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}_getContextFont(){return this.fontStyle()+P7+this.fontVariant()+P7+(this.fontSize()+"px ")+this.fontFamily().split(",").map((e=>{const t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e=`"${e}"`),e})).join(", ")}_addTextLine(e){this.align()===C7&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return O7().measureText(e).width+(n?t*(n-1):0)}_setTextData(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==k7&&void 0!==o,s=i!==k7&&void 0!==i,l=this.padding(),c=o-2*l,u=i-2*l,d=0,h=this.wrap(),f="char"!==h&&h!==M7,p=this.ellipsis();this.textArr=[],O7().font=this._getContextFont();for(var g=p?this._getTextWidth("…"):0,m=0,v=e.length;mc)for(;b.length>0;){for(var x=0,w=b.length,S="",k=0;x>>1,_=b.slice(0,C+1),E=this._getTextWidth(_)+g;E<=c?(x=C+1,S=_,k=E):w=C}if(!S)break;if(f){var L,P=b[S.length];(L=(P===P7||"-"===P)&&k<=c?S.length:Math.max(S.lastIndexOf(P7),S.lastIndexOf("-"))+1)>0&&(x=L,S=S.slice(0,x),k=this._getTextWidth(S))}if(S=S.trimRight(),this._addTextLine(S),n=Math.max(n,k),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((b=(b=b.slice(x)).trimLeft()).length>0&&(y=this._getTextWidth(b))<=c){this._addTextLine(b),d+=r,n=Math.max(n,y);break}}else this._addTextLine(b),d+=r,n=Math.max(n,y),this._shouldHandleEllipsis(d)&&mu)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,o=r!==k7&&void 0!==r,i=r-2*this.padding();return!(this.wrap()!==M7)||o&&e+n>i}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,t=e!==k7&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(o&&r){if(t)this._getTextWidth(o.text+"…")=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[s].pathLength);var l=0;"center"===r&&(l=Math.max(0,a/2-i/2)),"right"===r&&(l=Math.max(0,a-i));for(var c,u,d,h=w7(this.text()),f=this.text().split(" ").length-1,p=-1,g=0,m=function(){g=0;for(var t=e.dataArray,n=p+1;n0)return p=n,t[n];"M"===t[n].command&&(c={x:t[n].points[0],y:t[n].points[1]})}return{}},v=function(t){var o=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(o+=(a-i)/f);var s=0,l=0;for(u=void 0;Math.abs(o-s)/o>.01&&l<20;){l++;for(var h=s;void 0===d;)(d=m())&&h+d.pathLengtho?u=n7.getPointOnLine(o,c.x,c.y,d.points[0],d.points[1],c.x,c.y):d=void 0;break;case"A":var v=d.points[4],b=d.points[5],y=d.points[4]+b;0===g?g=v+1e-8:o>s?g+=Math.PI/180*b/Math.abs(b):g-=Math.PI/360*b/Math.abs(b),(b<0&&g=0&&g>y)&&(g=y,p=!0),u=n7.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],g,d.points[6]);break;case"C":0===g?g=o>d.pathLength?1e-8:o/d.pathLength:o>s?g+=(o-s)/d.pathLength/2:g=Math.max(g-(s-o)/d.pathLength/2,0),g>1&&(g=1,p=!0),u=n7.getPointOnCubicBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);break;case"Q":0===g?g=o/d.pathLength:o>s?g+=(o-s)/d.pathLength:g-=(s-o)/d.pathLength,g>1&&(g=1,p=!0),u=n7.getPointOnQuadraticBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3])}void 0!==u&&(s=n7.getLineLength(c.x,c.y,u.x,u.y)),p&&(p=!1,d=void 0)}},b=l/(e._getTextSize("C").width+n)-1,y=0;ye+`.${B7}`)).join(" "),j7="nodesRect",H7=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],W7={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const U7="ontouchstart"in J3._global;var V7=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function G7(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),o=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:o})}function $7(e,t){const n=function(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}(e);return G7(e,t,n)}class q7 extends W6{constructor(e){super(e),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(F7,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return c4.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return B7+this._id}setNodes(e=[]){return this._nodes&&this._nodes.length&&this.detach(),this._nodes=e,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((e=>{const t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=e._attrsAffectingSize.map((e=>e+"Change."+this._getEventNamespace())).join(" ");e.on(n,t),e.on(H7.map((e=>e+`.${this._getEventNamespace()}`)).join(" "),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)})),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,(n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)})),e.on(`dragmove.${this._getEventNamespace()}`,(n=>{if(!t)return;const r=e.getAbsolutePosition(),o=r.x-t.x,i=r.y-t.y;this.nodes().forEach((t=>{if(t===e)return;if(t.isDragging())return;const r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+o,y:r.y+i}),t.startDrag(n)})),t=null}))}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach((e=>{e.off("."+this._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(j7),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(j7,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),a=r.x*o.x-e.offsetX()*o.x,s=r.y*o.y-e.offsetY()*o.y;const l=(J3.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return G7({x:i.x+a*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+a*Math.sin(l),width:r.width*o.x,height:r.height*o.y,rotation:l},-J3.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[];this.nodes().map((t=>{const n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],o=t.getAbsoluteTransform();r.forEach((function(t){var n=o.point(t);e.push(n)}))}));const t=new t4;var n,r,o,i;t.rotate(-J3.getAngle(this.rotation())),e.forEach((function(e){var a=t.point(e);void 0===n&&(n=o=a.x,r=i=a.y),n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x),i=Math.max(i,a.y)})),t.invert();const a=t.point({x:n,y:r});return{x:a.x,y:a.y,width:o-n,height:i-r,rotation:J3.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),V7.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}_createAnchor(e){var t=new g7({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:U7?10:"auto"}),n=this;t.on("mousedown touchstart",(function(e){n._handleMouseDown(e)})),t.on("dragstart",(e=>{t.stopDrag(),e.cancelBubble=!0})),t.on("dragend",(e=>{e.cancelBubble=!0})),t.on("mouseenter",(()=>{var n=J3.getAngle(this.rotation()),r=function(e,t){if("rotater"===e)return"crosshair";t+=c4.degToRad(W7[e]||0);var n=(c4.radToDeg(t)%360+360)%360;return c4._inRange(n,337.5,360)||c4._inRange(n,0,22.5)?"ns-resize":c4._inRange(n,22.5,67.5)?"nesw-resize":c4._inRange(n,67.5,112.5)?"ew-resize":c4._inRange(n,112.5,157.5)?"nwse-resize":c4._inRange(n,157.5,202.5)?"ns-resize":c4._inRange(n,202.5,247.5)?"nesw-resize":c4._inRange(n,247.5,292.5)?"ew-resize":c4._inRange(n,292.5,337.5)?"nwse-resize":(c4.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,n);t.getStage().content&&(t.getStage().content.style.cursor=r),this._cursorChange=!0})),t.on("mouseout",(()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1})),this.add(t)}_createBack(){var e=new z6({name:"back",width:0,height:0,draggable:!0,sceneFunc(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*c4._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:(e,t)=>{if(this.shouldOverdrawWholeArea()){var n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",(e=>{e.cancelBubble=!0})),e.on("dragmove",(e=>{e.cancelBubble=!0})),e.on("dragend",(e=>{e.cancelBubble=!0})),this.on("dragmove",(e=>{this.update()}))}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,o=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/o),this.cos=Math.abs(n/o),"undefined"!=typeof window&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var i=e.target.getAbsolutePosition(),a=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-i.x,y:a.y-i.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((t=>{t._fire("transformstart",{evt:e.evt,target:t})}))}_handleMouseMove(e){var t,n,r,o=this.findOne("."+this._movingAnchorName),i=o.getStage();i.setPointersPositions(e);const a=i.getPointerPosition();let s={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const l=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,e)),o.setAbsolutePosition(s);const c=o.getAbsolutePosition();if(l.x!==c.x||l.y!==c.y)if("rotater"!==this._movingAnchorName){var u=this.keepRatio()||e.shiftKey,d=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(u){var h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(h.y-o.y(),2));var f=this.findOne(".top-left").x()>h.x?-1:1,p=this.findOne(".top-left").y()>h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-left").x(h.x-t),this.findOne(".top-left").y(h.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(o.y());else if("top-right"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(o.x()-h.x,2)+Math.pow(h.y-o.y(),2));f=this.findOne(".top-right").x()h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-right").x(h.x+t),this.findOne(".top-right").y(h.y-n)}var g=o.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(o.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(o.x());else if("bottom-left"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(o.y()-h.y,2));f=h.x{t._fire("transformend",{evt:e,target:t})})),this._movingAnchorName=null}}_fitNodesInto(e,t){var n=this._getNodeRect();if(c4._inRange(e.width,2*-this.padding()-1,1))return void this.update();if(c4._inRange(e.height,2*-this.padding()-1,1))return void this.update();const r=this.flipEnabled();var o=new t4;if(o.rotate(J3.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const t=o.point({x:2*-this.padding(),y:0});if(e.x+=t.x,e.y+=t.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,!r)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const t=o.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=2*this.padding(),!r)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const t=o.point({x:0,y:2*-this.padding()});if(e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const t=o.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}if(this.boundBoxFunc()){const t=this.boundBoxFunc()(n,e);t?e=t:c4.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const i=1e7,a=new t4;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/i,n.height/i);const s=new t4;s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.width/i,e.height/i);const l=s.multiply(a.invert());this._nodes.forEach((e=>{var n;const r=e.getParent().getAbsoluteTransform(),o=e.getTransform().copy();o.translate(e.offsetX(),e.offsetY());const i=new t4;i.multiply(r.copy().invert()).multiply(l).multiply(r).multiply(o);const a=i.decompose();e.setAttrs(a),this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(n=e.getLayer())||void 0===n||n.batchDraw()})),this.rotation(c4._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e,t=this._getNodeRect();this.rotation(c4._getRotation(t.rotation));var n=t.width,r=t.height,o=this.enabledAnchors(),i=this.resizeEnabled(),a=this.padding(),s=this.anchorSize();this.find("._anchor").forEach((e=>{e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+a,offsetY:s/2+a,visible:i&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:s/2+a,visible:i&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:s/2-a,offsetY:s/2+a,visible:i&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:s/2+a,visible:i&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:s/2-a,visible:i&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:s/2+a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:s/2-a,visible:i&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:s/2-a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*c4._sign(r)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),W6.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return $4.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}q7.prototype.className="Transformer",e4(q7),x4.addGetterSetter(q7,"enabledAnchors",V7,(function(e){return e instanceof Array||c4.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===V7.indexOf(e)&&c4.warn("Unknown anchor name: "+e+". Available names are: "+V7.join(", "))})),e||[]})),x4.addGetterSetter(q7,"flipEnabled",!0,v4()),x4.addGetterSetter(q7,"resizeEnabled",!0),x4.addGetterSetter(q7,"anchorSize",10,h4()),x4.addGetterSetter(q7,"rotateEnabled",!0),x4.addGetterSetter(q7,"rotationSnaps",[]),x4.addGetterSetter(q7,"rotateAnchorOffset",50,h4()),x4.addGetterSetter(q7,"rotationSnapTolerance",5,h4()),x4.addGetterSetter(q7,"borderEnabled",!0),x4.addGetterSetter(q7,"anchorStroke","rgb(0, 161, 255)"),x4.addGetterSetter(q7,"anchorStrokeWidth",1,h4()),x4.addGetterSetter(q7,"anchorFill","white"),x4.addGetterSetter(q7,"anchorCornerRadius",0,h4()),x4.addGetterSetter(q7,"borderStroke","rgb(0, 161, 255)"),x4.addGetterSetter(q7,"borderStrokeWidth",1,h4()),x4.addGetterSetter(q7,"borderDash"),x4.addGetterSetter(q7,"keepRatio",!0),x4.addGetterSetter(q7,"centeredScaling",!1),x4.addGetterSetter(q7,"ignoreStroke",!1),x4.addGetterSetter(q7,"padding",0,h4()),x4.addGetterSetter(q7,"node"),x4.addGetterSetter(q7,"nodes"),x4.addGetterSetter(q7,"boundBoxFunc"),x4.addGetterSetter(q7,"anchorDragBoundFunc"),x4.addGetterSetter(q7,"shouldOverdrawWholeArea",!1),x4.addGetterSetter(q7,"useSingleNodeRotation",!0),x4.backCompat(q7,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Z7 extends z6{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,J3.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}function Y7(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}Z7.prototype.className="Wedge",Z7.prototype._centroid=!0,Z7.prototype._attrsAffectingSize=["radius"],e4(Z7),x4.addGetterSetter(Z7,"radius",0,h4()),x4.addGetterSetter(Z7,"angle",0,h4()),x4.addGetterSetter(Z7,"clockwise",!1),x4.backCompat(Z7,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var X7=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],K7=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];x4.addGetterSetter($4,"blurRadius",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"brightness",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"contrast",0,h4(),x4.afterSetFilter);function Q7(e,t,n,r,o){var i=n-t,a=o-r;return 0===i?r+a/2:0===a?r:a*((e-t)/i)+r}x4.addGetterSetter($4,"embossStrength",.5,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"embossWhiteLevel",.5,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"embossDirection","top-left",null,x4.afterSetFilter),x4.addGetterSetter($4,"embossBlend",!1,null,x4.afterSetFilter);x4.addGetterSetter($4,"enhance",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"hue",0,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"saturation",0,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"luminance",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"hue",0,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"saturation",0,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"value",0,h4(),x4.afterSetFilter);function J7(e,t,n){var r=4*(n*e.width+t),o=[];return o.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),o}function e9(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}x4.addGetterSetter($4,"kaleidoscopePower",2,h4(),x4.afterSetFilter),x4.addGetterSetter($4,"kaleidoscopeAngle",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"threshold",0,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"noise",.2,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"pixelSize",8,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"levels",.5,h4(),x4.afterSetFilter);x4.addGetterSetter($4,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),x4.addGetterSetter($4,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),x4.addGetterSetter($4,"blue",0,d4,x4.afterSetFilter);x4.addGetterSetter($4,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),x4.addGetterSetter($4,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),x4.addGetterSetter($4,"blue",0,d4,x4.afterSetFilter),x4.addGetterSetter($4,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}));x4.addGetterSetter($4,"threshold",.5,h4(),x4.afterSetFilter);const t9=K6.Util._assign(K6,{Arc:Q6,Arrow:r7,Circle:o7,Ellipse:i7,Image:a7,Label:f7,Tag:p7,Line:t7,Path:n7,Rect:g7,RegularPolygon:m7,Ring:b7,Sprite:y7,Star:x7,Text:I7,TextPath:z7,Transformer:q7,Wedge:Z7,Filters:{Blur:function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,o,i,a,s,l,c,u,d,h,f,p,g,m,v,b,y,x,w,S,k,C,_,E=e.data,L=e.width,P=e.height,M=t+t+1,A=L-1,T=P-1,O=t+1,I=O*(O+1)/2,R=new Y7,N=null,D=R,z=null,B=null,F=X7[t],j=K7[t];for(o=1;o>j,0!==C?(C=255/C,E[s]=(c*F>>j)*C,E[s+1]=(u*F>>j)*C,E[s+2]=(d*F>>j)*C):E[s]=E[s+1]=E[s+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=l+((i=n+t+1)>j,C>0?(C=255/C,E[i]=(c*F>>j)*C,E[i+1]=(u*F>>j)*C,E[i+2]=(d*F>>j)*C):E[i]=E[i+1]=E[i+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=n+((i=r+O)255?255:i,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r[t]=i,r[t+1]=a,r[t+2]=s},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),o=this.embossBlend(),i=0,a=0,s=e.data,l=e.width,c=e.height,u=4*l,d=c;switch(r){case"top-left":i=-1,a=-1;break;case"top":i=-1,a=0;break;case"top-right":i=-1,a=1;break;case"right":i=0,a=1;break;case"bottom-right":i=1,a=1;break;case"bottom":i=1,a=0;break;case"bottom-left":i=1,a=-1;break;case"left":i=0,a=-1;break;default:c4.error("Unknown emboss direction: "+r)}do{var h=(d-1)*u,f=i;d+f<1&&(f=0),d+f>c&&(f=0);var p=(d-1+f)*l*4,g=l;do{var m=h+4*(g-1),v=a;g+v<1&&(v=0),g+v>l&&(v=0);var b=p+4*(g-1+v),y=s[m]-s[b],x=s[m+1]-s[b+1],w=s[m+2]-s[b+2],S=y,k=S>0?S:-S;if((x>0?x:-x)>k&&(S=x),(w>0?w:-w)>k&&(S=w),S*=t,o){var C=s[m]+S,_=s[m+1]+S,E=s[m+2]+S;s[m]=C>255?255:C<0?0:C,s[m+1]=_>255?255:_<0?0:_,s[m+2]=E>255?255:E<0?0:E}else{var L=n-S;L<0?L=0:L>255&&(L=255),s[m]=s[m+1]=s[m+2]=L}}while(--g)}while(--d)},Enhance:function(e){var t,n,r,o,i=e.data,a=i.length,s=i[0],l=s,c=i[1],u=c,d=i[2],h=d,f=this.enhance();if(0!==f){for(o=0;ol&&(l=t),(n=i[o+1])u&&(u=n),(r=i[o+2])h&&(h=r);var p,g,m,v,b,y,x,w,S;for(l===s&&(l=255,s=0),u===c&&(u=255,c=0),h===d&&(h=255,d=0),f>0?(g=l+f*(255-l),m=s-f*(s-0),b=u+f*(255-u),y=c-f*(c-0),w=h+f*(255-h),S=d-f*(d-0)):(g=l+f*(l-(p=.5*(l+s))),m=s+f*(s-p),b=u+f*(u-(v=.5*(u+c))),y=c+f*(c-v),w=h+f*(h-(x=.5*(h+d))),S=d+f*(d-x)),o=0;ov?a:v;var b,y,x,w,S=u,k=c,C=360/k*Math.PI/180;for(y=0;yu&&(y=b,x=0,w=-1),n=0;ny?l:y;var x,w,S,k=h,C=d,_=n.polarRotation||0;for(o=0;o=0&&f=0&&p=0&&f=0&&p=1020?255:0}return a}(t,e.width,e.height),t=function(e,t,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],o=Math.round(Math.sqrt(r.length)),i=Math.floor(o/2),a=[],s=0;s=0&&f=0&&p=m))for(n=u;n=v||(o+=x[(r=4*(m*n+t))+0],i+=x[r+1],a+=x[r+2],s+=x[r+3],p+=1);for(o/=p,i/=p,a/=p,s/=p,t=l;t=m))for(n=u;n=v||(x[(r=4*(m*n+t))+0]=o,x[r+1]=i,x[r+2]=a,x[r+3]=s)}},Posterize:function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,o=r.length,i=255/n;for(t=0;t127&&(l=255-l),c>127&&(c=255-c),u>127&&(u=255-u),t[s]=l,t[s+1]=c,t[s+2]=u}while(--a)}while(--o)},Threshold:function(e){var t,n=255*this.threshold(),r=e.data,o=r.length;for(t=0;t--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{rt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nt(e):""}var it=Object.prototype.hasOwnProperty,at=[],st=-1;function lt(e){return{current:e}}function ct(e){0>st||(e.current=at[st],at[st]=null,st--)}function ut(e,t){st++,at[st]=e.current,e.current=t}var dt={},ht=lt(dt),ft=lt(!1),pt=dt;function gt(e,t){var n=e.type.contextTypes;if(!n)return dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function mt(e){return null!=(e=e.childContextTypes)}function vt(){ct(ft),ct(ht)}function bt(e,t,n){if(ht.current!==dt)throw Error(a(168));ut(ht,t),ut(ft,n)}function yt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(a(108,C(e)||"Unknown",i));return o({},n,r)}function xt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dt,pt=ht.current,ut(ht,e),ut(ft,ft.current),!0}function wt(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=yt(e,t,pt),r.__reactInternalMemoizedMergedChildContext=e,ct(ft),ct(ht),ut(ht,e)):ct(ft),ut(ft,n)}var St=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(kt(e)/Ct|0)|0},kt=Math.log,Ct=Math.LN2;var _t=64,Et=4194304;function Lt(e){switch(e&-e){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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=Lt(s):0!==(i&=a)&&(r=Lt(i))}else 0!==(a=n&~o)?r=Lt(a):0!==i&&(r=Lt(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function It(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-St(t)]=n}function Rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-St(n),o=1<>=a,o-=a,cn=1<<32-St(t)+o|n<h?(f=d,d=null):f=d.sibling;var p=m(o,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(o,d),a=i(p,a,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(o,d),vn&&dn(o,h),c;if(null===d){for(;hf?(p=h,h=null):p=h.sibling;var y=m(o,h,b.value,c);if(null===y){null===h&&(h=p);break}e&&h&&null===y.alternate&&t(o,h),s=i(y,s,f),null===d?u=y:d.sibling=y,d=y,h=p}if(b.done)return n(o,h),vn&&dn(o,f),u;if(null===h){for(;!b.done;f++,b=l.next())null!==(b=g(o,b.value,c))&&(s=i(b,s,f),null===d?u=b:d.sibling=b,d=b);return vn&&dn(o,f),u}for(h=r(o,h);!b.done;f++,b=l.next())null!==(b=v(h,o,f,b.value,c))&&(e&&null!==b.alternate&&h.delete(null===b.key?f:b.key),s=i(b,s,f),null===d?u=b:d.sibling=b,d=b);return e&&h.forEach((function(e){return t(o,e)})),vn&&dn(o,f),u}return function e(r,i,a,d){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:e:{for(var h=a.key,f=i;null!==f;){if(f.key===h){if((h=a.type)===u){if(7===f.tag){n(r,f.sibling),(i=o(f,a.props.children)).return=r,r=i;break e}}else if(f.elementType===h||"object"==typeof h&&null!==h&&h.$$typeof===y&&dr(h)===f.type){n(r,f.sibling),(i=o(f,a.props)).ref=cr(r,f,a),i.return=r,r=i;break e}n(r,f);break}t(r,f),f=f.sibling}a.type===u?((i=fs(a.props.children,r.mode,d,a.key)).return=r,r=i):((d=hs(a.type,a.key,a.props,null,r.mode,d)).ref=cr(r,i,a),d.return=r,r=d)}return s(r);case c:e:{for(f=a.key;null!==i;){if(i.key===f){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=ms(a,r.mode,d)).return=r,r=i}return s(r);case y:return e(r,i,(f=a._init)(a._payload),d)}if(O(a))return b(r,i,a,d);if(S(a))return x(r,i,a,d);ur(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=gs(a,r.mode,d)).return=r,r=i),s(r)):n(r,i)}}var fr=hr(!0),pr=hr(!1),gr={},mr=lt(gr),vr=lt(gr),br=lt(gr);function yr(e){if(e===gr)throw Error(a(174));return e}function xr(e,t){ut(br,t),ut(vr,e),ut(mr,gr),e=R(t),ct(mr),ut(mr,e)}function wr(){ct(mr),ct(vr),ct(br)}function Sr(e){var t=yr(br.current),n=yr(mr.current);n!==(t=N(n,e.type,t))&&(ut(vr,e),ut(mr,t))}function kr(e){vr.current===e&&(ct(mr),ct(vr))}var Cr=lt(0);function _r(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ze(n)||Be(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Er=[];function Lr(){for(var e=0;en?n:4,e(!0);var r=Mr.transition;Mr.transition={};try{e(!1),t()}finally{Nt=n,Mr.transition=r}}function vo(){return Ur().memoizedState}function bo(e,t,n){var r=Ra(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xo(e))wo(t,n);else if(null!==(n=Gn(e,t,n,r))){Na(n,e,r,Ia()),So(n,t,r)}}function yo(e,t,n){var r=Ra(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xo(e))wo(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Zt(s,a)){var l=t.interleaved;return null===l?(o.next=o,Vn(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(SV){}null!==(n=Gn(e,t,o,r))&&(Na(n,e,r,o=Ia()),So(n,t,r))}}function xo(e){var t=e.alternate;return e===Tr||null!==t&&t===Tr}function wo(e,t){Nr=Rr=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function So(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Rt(e,n)}}var ko={readContext:Wn,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},Co={readContext:Wn,useCallback:function(e,t){return Wr().memoizedState=[e,void 0===t?null:t],e},useContext:Wn,useEffect:io,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ro(4194308,4,co.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=Wr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wr();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=bo.bind(null,Tr,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Wr().memoizedState=e},useState:eo,useDebugValue:ho,useDeferredValue:function(e){return Wr().memoizedState=e},useTransition:function(){var e=eo(!1),t=e[0];return e=mo.bind(null,e[1]),Wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Tr,o=Wr();if(vn){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===aa)throw Error(a(349));0!=(30&Ar)||Yr(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,io(Kr.bind(null,r,i,e),[e]),r.flags|=2048,to(9,Xr.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Wr(),t=aa.identifierPrefix;if(vn){var n=un;t=":"+t+"R"+(n=(cn&~(1<<32-St(cn)-1)).toString(32)+n),0<(n=Dr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=zr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_o={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Gr,useRef:no,useState:function(){return Gr(Vr)},useDebugValue:ho,useDeferredValue:function(e){return go(Ur(),Or.memoizedState,e)},useTransition:function(){return[Gr(Vr)[0],Ur().memoizedState]},useMutableSource:qr,useSyncExternalStore:Zr,useId:vo,unstable_isNewReconciler:!1},Eo={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:$r,useRef:no,useState:function(){return $r(Vr)},useDebugValue:ho,useDeferredValue:function(e){var t=Ur();return null===Or?t.memoizedState=e:go(t,Or.memoizedState,e)},useTransition:function(){return[$r(Vr)[0],Ur().memoizedState]},useMutableSource:qr,useSyncExternalStore:Zr,useId:vo,unstable_isNewReconciler:!1};function Lo(e,t){try{var n="",r=t;do{n+=Tn(r),r=r.return}while(r);var o=n}catch(X8){o="\nError generating stack: "+X8.message+"\n"+X8.stack}return{value:e,source:t,stack:o,digest:null}}function Po(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Mo(e,t){try{console.error(t.value)}catch(q8){setTimeout((function(){throw q8}))}}var Ao="function"==typeof WeakMap?WeakMap:Map;function To(e,t,n){(n=Xn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ka||(ka=!0,Ca=r),Mo(0,t)},n}function Oo(e,t,n){(n=Xn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Mo(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){Mo(0,t),"function"!=typeof r&&(null===_a?_a=new Set([this]):_a.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Io(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Ao;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=rs.bind(null,e,t,n),t.then(e,e))}function Ro(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function No(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Xn(-1,1)).tag=2,Kn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Do=s.ReactCurrentOwner,zo=!1;function Bo(e,t,n,r){t.child=null===e?pr(t,null,n,r):fr(t,e.child,n,r)}function Fo(e,t,n,r,o){n=n.render;var i=t.ref;return Hn(t,o),r=jr(e,t,n,r,i,o),n=Hr(),null===e||zo?(vn&&n&&fn(t),t.flags|=1,Bo(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function jo(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||us(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=hs(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Ho(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:An)(a,r)&&e.ref===t.ref)return li(e,t,o)}return t.flags|=1,(e=ds(i,r)).ref=t.ref,e.return=t,t.child=e}function Ho(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(An(i,r)&&e.ref===t.ref){if(zo=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,li(e,t,o);0!=(131072&e.flags)&&(zo=!0)}}return Vo(e,t,n,r,o)}function Wo(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(ua,ca),ca|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(ua,ca),ca|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,ut(ua,ca),ca|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,ut(ua,ca),ca|=r;return Bo(e,t,o,n),t.child}function Uo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vo(e,t,n,r,o){var i=mt(n)?pt:ht.current;return i=gt(t,i),Hn(t,o),n=jr(e,t,n,r,i,o),r=Hr(),null===e||zo?(vn&&r&&fn(t),t.flags|=1,Bo(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Go(e,t,n,r,o){if(mt(n)){var i=!0;xt(t)}else i=!1;if(Hn(t,o),null===t.stateNode)si(e,t),ar(t,n,r),lr(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Wn(c):c=gt(t,c=mt(n)?pt:ht.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&sr(t,a,r,c),qn=!1;var h=t.memoizedState;a.state=h,er(t,r,a,o),l=t.memoizedState,s!==r||h!==l||ft.current||qn?("function"==typeof u&&(rr(t,n,u,r),l=t.memoizedState),(s=qn||ir(t,n,s,r,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Yn(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:On(t.type,s),a.props=c,d=t.pendingProps,h=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=Wn(l):l=gt(t,l=mt(n)?pt:ht.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||h!==l)&&sr(t,a,r,l),qn=!1,h=t.memoizedState,a.state=h,er(t,r,a,o);var p=t.memoizedState;s!==d||h!==p||ft.current||qn?("function"==typeof f&&(rr(t,n,f,r),p=t.memoizedState),(c=qn||ir(t,n,c,r,h,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return $o(e,t,n,r,i,o)}function $o(e,t,n,r,o,i){Uo(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&wt(t,n,!1),li(e,t,i);r=t.stateNode,Do.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=fr(t,e.child,null,i),t.child=fr(t,null,s,i)):Bo(e,t,s,i),t.memoizedState=r.state,o&&wt(t,n,!0),t.child}function qo(e){var t=e.stateNode;t.pendingContext?bt(0,t.pendingContext,t.pendingContext!==t.context):t.context&&bt(0,t.context,!1),xr(e,t.containerInfo)}function Zo(e,t,n,r,o){return Ln(),Pn(o),t.flags|=256,Bo(e,t,n,r),t.child}var Yo,Xo,Ko,Qo,Jo={dehydrated:null,treeContext:null,retryLane:0};function ei(e){return{baseLanes:e,cachePool:null,transitions:null}}function ti(e,t,n){var r,o=t.pendingProps,i=Cr.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&i)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),ut(Cr,1&i),null===e)return kn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:Be(e)?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0==(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=ps(l,o,0,null),e=fs(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=ei(n),t.memoizedState=Jo,e):ni(t,l));if(null!==(i=e.memoizedState)&&null!==(r=i.dehydrated))return function(e,t,n,r,o,i,s){if(n)return 256&t.flags?(t.flags&=-257,ri(e,t,s,r=Po(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=ps({mode:"visible",children:r.children},o,0,null),(i=fs(i,o,s,null)).flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,0!=(1&t.mode)&&fr(t,e.child,null,s),t.child.memoizedState=ei(s),t.memoizedState=Jo,i);if(0==(1&t.mode))return ri(e,t,s,null);if(Be(o))return r=Fe(o).digest,i=Error(a(419)),r=Po(i,r,void 0),ri(e,t,s,r);if(n=0!=(s&e.childLanes),zo||n){if(null!==(r=aa)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(r.suspendedLanes|s))?0:o)&&o!==i.retryLane&&(i.retryLane=o,$n(e,o),Na(r,e,o,-1))}return qa(),ri(e,t,s,r=Po(Error(a(421))))}return ze(o)?(t.flags|=128,t.child=e.child,t=is.bind(null,e),je(o,t),null):(e=i.treeContext,K&&(mn=Ve(o),gn=t,vn=!0,yn=null,bn=!1,null!==e&&(an[sn++]=cn,an[sn++]=un,an[sn++]=ln,cn=e.id,un=e.overflow,ln=t)),t=ni(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,i,n);if(s){s=o.fallback,l=t.mode,r=(i=e.child).sibling;var c={mode:"hidden",children:o.children};return 0==(1&l)&&t.child!==i?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=ds(i,c)).subtreeFlags=14680064&i.subtreeFlags,null!==r?s=ds(r,s):(s=fs(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?ei(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Jo,o}return e=(s=e.child).sibling,o=ds(s,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function ni(e,t){return(t=ps({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ri(e,t,n,r){return null!==r&&Pn(r),fr(t,e.child,null,n),(e=ni(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function oi(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),jn(e.return,t,n)}function ii(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ai(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Bo(e,t,r.children,n),0!=(2&(r=Cr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&oi(e,n,t);else if(19===e.tag)oi(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ut(Cr,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===_r(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ii(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===_r(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ii(t,!0,n,null,i);break;case"together":ii(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function si(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function li(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),fa|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=ds(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ds(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ci(e){e.flags|=4}function ui(e,t){if(null!==e&&e.child===t.child)return!0;if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Y)Yo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)F(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xo=function(){},Ko=function(e,t,n,r,o){if((e=e.memoizedProps)!==r){var i=t.stateNode,a=yr(mr.current);n=H(i,n,e,r,o,a),(t.updateQueue=n)&&ci(t)}},Qo=function(e,t,n,r){n!==r&&ci(t)};else if(X){Yo=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Oe(i,o.type,o.memoizedProps,o)),F(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),F(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),Yo(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};var di=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Oe(i,o.type,o.memoizedProps,o)),Me(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),Me(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),di(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};Xo=function(e,t){var n=t.stateNode;if(!ui(e,t)){e=n.containerInfo;var r=Pe(e);di(r,t,!1,!1),n.pendingChildren=r,ci(t),Ae(e,r)}},Ko=function(e,t,n,r,o){var i=e.stateNode,a=e.memoizedProps;if((e=ui(e,t))&&a===r)t.stateNode=i;else{var s=t.stateNode,l=yr(mr.current),c=null;a!==r&&(c=H(s,n,a,r,o,l)),e&&null===c?t.stateNode=i:(i=Le(i,c,n,a,r,t,e,s),j(i,n,r,o,l)&&ci(t),t.stateNode=i,e?ci(t):Yo(i,t,!1,!1))}},Qo=function(e,t,n,r){n!==r?(e=yr(br.current),n=yr(mr.current),t.stateNode=U(r,e,n,t),ci(t)):t.stateNode=e.stateNode}}else Xo=function(){},Ko=function(){},Qo=function(){};function hi(e,t){if(!vn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fi(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pi(e,t,n){var r=t.pendingProps;switch(pn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fi(t),null;case 1:case 17:return mt(t.type)&&vt(),fi(t),null;case 3:return n=t.stateNode,wr(),ct(ft),ct(ht),Lr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(_n(t)?ci(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==yn&&(Fa(yn),yn=null))),Xo(e,t),fi(t),null;case 5:kr(t),n=yr(br.current);var o=t.type;if(null!==e&&null!=t.stateNode)Ko(e,t,o,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(a(166));return fi(t),null}if(e=yr(mr.current),_n(t)){if(!K)throw Error(a(175));e=Ge(t.stateNode,t.type,t.memoizedProps,n,e,t,!bn),t.updateQueue=e,null!==e&&ci(t)}else{var i=B(o,r,n,e,t);Yo(i,t,!1,!1),t.stateNode=i,j(i,o,r,n,e)&&ci(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return fi(t),null;case 6:if(e&&null!=t.stateNode)Qo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(a(166));if(e=yr(br.current),n=yr(mr.current),_n(t)){if(!K)throw Error(a(176));if(e=t.stateNode,n=t.memoizedProps,(r=$e(e,n,t,!bn))&&null!==(o=gn))switch(o.tag){case 3:et(o.stateNode.containerInfo,e,n,0!=(1&o.mode));break;case 5:tt(o.type,o.memoizedProps,o.stateNode,e,n,0!=(1&o.mode))}r&&ci(t)}else t.stateNode=U(r,e,n,t)}return fi(t),null;case 13:if(ct(Cr),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(vn&&null!==mn&&0!=(1&t.mode)&&0==(128&t.flags))En(),Ln(),t.flags|=98560,o=!1;else if(o=_n(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(a(318));if(!K)throw Error(a(344));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(a(317));qe(o,t)}else Ln(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;fi(t),o=!1}else null!==yn&&(Fa(yn),yn=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((n=null!==r)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&Cr.current)?0===da&&(da=3):qa())),null!==t.updateQueue&&(t.flags|=4),fi(t),null);case 4:return wr(),Xo(e,t),null===e&&J(t.stateNode.containerInfo),fi(t),null;case 10:return Fn(t.type._context),fi(t),null;case 19:if(ct(Cr),null===(o=t.memoizedState))return fi(t),null;if(r=0!=(128&t.flags),null===(i=o.rendering))if(r)hi(o,!1);else{if(0!==da||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(i=_r(e))){for(t.flags|=128,hi(o,!1),null!==(e=i.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;null!==n;)o=e,(r=n).flags&=14680066,null===(i=r.alternate)?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=i.childLanes,r.lanes=i.lanes,r.child=i.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=i.memoizedProps,r.memoizedState=i.memoizedState,r.updateQueue=i.updateQueue,r.type=i.type,o=i.dependencies,r.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),n=n.sibling;return ut(Cr,1&Cr.current|2),t.child}e=e.sibling}null!==o.tail&&Ht()>ya&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=_r(i))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),hi(o,!0),null===o.tail&&"hidden"===o.tailMode&&!i.alternate&&!vn)return fi(t),null}else 2*Ht()-o.renderingStartTime>ya&&1073741824!==n&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(null!==(e=o.last)?e.sibling=i:t.child=i,o.last=i)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ht(),t.sibling=null,e=Cr.current,ut(Cr,r?1&e|2:1&e),t):(fi(t),null);case 22:case 23:return Ua(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&ca)&&(fi(t),Y&&6&t.subtreeFlags&&(t.flags|=8192)):fi(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function gi(e,t){switch(pn(t),t.tag){case 1:return mt(t.type)&&vt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return wr(),ct(ft),ct(ht),Lr(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return kr(t),null;case 13:if(ct(Cr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));Ln()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ct(Cr),null;case 4:return wr(),null;case 10:return Fn(t.type._context),null;case 22:case 23:return Ua(),null;default:return null}}var mi=!1,vi=!1,bi="function"==typeof WeakSet?WeakSet:Set,yi=null;function xi(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(Q8){ns(e,t,Q8)}else n.current=null}function wi(e,t,n){try{n()}catch(Q8){ns(e,t,Q8)}}var Si=!1;function ki(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&wi(t,n,i)}o=o.next}while(o!==r)}}function Ci(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function _i(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=I(n);else e=n;"function"==typeof t?t(e):t.current=e}}function Ei(e){var t=e.alternate;null!==t&&(e.alternate=null,Ei(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&te(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Li(e){return 5===e.tag||3===e.tag||4===e.tag}function Pi(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Li(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Mi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?be(n,e,t):fe(n,e);else if(4!==r&&null!==(e=e.child))for(Mi(e,t,n),e=e.sibling;null!==e;)Mi(e,t,n),e=e.sibling}function Ai(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):he(n,e);else if(4!==r&&null!==(e=e.child))for(Ai(e,t,n),e=e.sibling;null!==e;)Ai(e,t,n),e=e.sibling}var Ti=null,Oi=!1;function Ii(e,t,n){for(n=n.child;null!==n;)Ri(e,t,n),n=n.sibling}function Ri(e,t,n){if(qt&&"function"==typeof qt.onCommitFiberUnmount)try{qt.onCommitFiberUnmount($t,n)}catch(J8){}switch(n.tag){case 5:vi||xi(n,t);case 6:if(Y){var r=Ti,o=Oi;Ti=null,Ii(e,t,n),Oi=o,null!==(Ti=r)&&(Oi?xe(Ti,n.stateNode):ye(Ti,n.stateNode))}else Ii(e,t,n);break;case 18:Y&&null!==Ti&&(Oi?Qe(Ti,n.stateNode):Ke(Ti,n.stateNode));break;case 4:Y?(r=Ti,o=Oi,Ti=n.stateNode.containerInfo,Oi=!0,Ii(e,t,n),Ti=r,Oi=o):(X&&(r=n.stateNode.containerInfo,o=Pe(r),Te(r,o)),Ii(e,t,n));break;case 0:case 11:case 14:case 15:if(!vi&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&wi(n,t,a),o=o.next}while(o!==r)}Ii(e,t,n);break;case 1:if(!vi&&(xi(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(J8){ns(n,t,J8)}Ii(e,t,n);break;case 21:Ii(e,t,n);break;case 22:1&n.mode?(vi=(r=vi)||null!==n.memoizedState,Ii(e,t,n),vi=r):Ii(e,t,n);break;default:Ii(e,t,n)}}function Ni(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new bi),t.forEach((function(t){var r=as.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Di(e,t){var n=t.deletions;if(null!==n)for(var r=0;r";case Gi:return":has("+(Qi(e)||"")+")";case $i:return'[role="'+e.value+'"]';case Zi:return'"'+e.value+'"';case qi:return'[data-testname="'+e.value+'"]';default:throw Error(a(365))}}function Ji(e,t){var n=[];e=[e,0];for(var r=0;ro&&(o=s),r&=~i}if(r=o,10<(r=(120>(r=Ht()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ta(r/1960))-r)){e.timeoutHandle=V(Ja.bind(null,e,va,xa),r);break}Ja(e,va,xa);break;default:throw Error(a(329))}}}return Da(e,Ht()),e.callbackNode===n?za.bind(null,e):null}function Ba(e,t){var n=ma;return e.current.memoizedState.isDehydrated&&(Va(e,t).flags|=256),2!==(e=Za(e,t))&&(t=va,va=n,null!==t&&Fa(t)),e}function Fa(e){null===va?va=e:va.push.apply(va,e)}function ja(e,t){for(t&=~ga,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===La)var r=!1;else{if(e=La,La=null,Pa=0,0!=(6&ia))throw Error(a(331));var o=ia;for(ia|=4,yi=e.current;null!==yi;){var i=yi,s=i.child;if(0!=(16&yi.flags)){var l=i.deletions;if(null!==l){for(var c=0;cHt()-ba?Va(e,0):ga|=n),Da(e,t)}function os(e,t){0===t&&(0==(1&e.mode)?t=1:(t=Et,0==(130023424&(Et<<=1))&&(Et=4194304)));var n=Ia();null!==(e=$n(e,t))&&(It(e,t,n),Da(e,n))}function is(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),os(e,n)}function as(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}null!==r&&r.delete(t),os(e,n)}function ss(e,t){return zt(e,t)}function ls(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cs(e,t,n,r){return new ls(e,t,n,r)}function us(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ds(e,t){var n=e.alternate;return null===n?((n=cs(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hs(e,t,n,r,o,i){var s=2;if(r=e,"function"==typeof e)us(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case u:return fs(n.children,o,i,t);case d:s=8,o|=8;break;case h:return(e=cs(12,n,t,2|o)).elementType=h,e.lanes=i,e;case m:return(e=cs(13,n,t,o)).elementType=m,e.lanes=i,e;case v:return(e=cs(19,n,t,o)).elementType=v,e.lanes=i,e;case x:return ps(n,o,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case f:s=10;break e;case p:s=9;break e;case g:s=11;break e;case b:s=14;break e;case y:s=16,r=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=cs(s,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function fs(e,t,n,r){return(e=cs(7,e,r,t)).lanes=n,e}function ps(e,t,n,r){return(e=cs(22,e,r,t)).elementType=x,e.lanes=n,e.stateNode={isHidden:!1},e}function gs(e,t,n){return(e=cs(6,e,null,t)).lanes=n,e}function ms(e,t,n){return(t=cs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vs(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ot(0),this.expirationTimes=Ot(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ot(0),this.identifierPrefix=r,this.onRecoverableError=o,K&&(this.mutableSourceEagerHydrationData=null)}function bs(e,t,n,r,o,i,a,s,l){return e=new vs(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=cs(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zn(i),e}function ys(e){if(!e)return dt;e:{if(_(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(mt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var n=e.type;if(mt(n))return yt(e,n,t)}return t}function xs(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return null===(e=P(t))?null:e.stateNode}function ws(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=u&&i>=h&&o<=d&&s<=f){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||fs)){h>i&&(c.height+=h-i,c.y=i),fo)){u>r&&(c.width+=u-r,c.x=r),dn&&(n=s)),s ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?I(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:ks,findFiberByHostInstance:e.findFiberByHostInstance||Cs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{$t=t.inject(e),qt=t}catch(q8){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!oe)throw Error(a(363));e=ea(e,t);var o=de(e,n,r).disconnect;return{disconnect:function(){o()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Nt;try{return Nt=e,t()}finally{Nt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var o=t.current,i=Ia(),a=Ra(o);return n=ys(n),null===t.context?t.context=n:t.pendingContext=n,(t=Xn(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Kn(o,t,a))&&(Na(e,o,a,i),Qn(e,o,a)),a},t}; /** * @license React * react-reconciler.production.min.js @@ -45,4 +45,4 @@ var q=i.exports,Z=G.exports;function Y(e){for(var t="https://reactjs.org/docs/er * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -ConcurrentRoot:1,ContinuousEventPriority:4,DefaultEventPriority:16,DiscreteEventPriority:1,IdleEventPriority:536870912,LegacyRoot:0};!function(e){e.exports=a9}(i9);const s9={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let l9=!1,c9=!1;const u9=".react-konva-event",d9={};function h9(e,t,n=d9){if(!l9&&"zIndex"in t&&(console.warn('ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n'),l9=!0),!c9&&t.draggable){var r=void 0!==t.x||void 0!==t.y,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn("ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n"),c9=!0)}for(var i in n)if(!s9[i]){var a="on"===i.slice(0,2),s=n[i]!==t[i];if(a&&s)"content"===(f=i.substr(2).toLowerCase()).substr(0,7)&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[i]);!t.hasOwnProperty(i)&&e.setAttr(i,void 0)}var l=t._useStrictMode,c={},u=!1;const d={};for(var i in t)if(!s9[i]){a="on"===i.slice(0,2);var h=n[i]!==t[i];if(a&&h)"content"===(f=i.substr(2).toLowerCase()).substr(0,7)&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[i]&&(d[f]=t[i]);!a&&(t[i]!==n[i]||l&&t[i]!==e.getAttr(i))&&(u=!0,c[i]=t[i])}for(var f in u&&(e.setAttrs(c),f9(e)),d)e.on(f+u9,d[f])}function f9(e){if(!J3.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const p9={},g9={};K6.Node.prototype._applyProps=h9;const m9=setTimeout,v9=clearTimeout;function b9(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),f9(e)}const y9=Object.freeze(Object.defineProperty({__proto__:null,appendInitialChild:function(e,t){"string"!=typeof t?(e.add(t),f9(e)):console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`)},createInstance:function(e,t,n){let r=K6[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=K6.Group);const o={},i={};for(var a in t){"on"===a.slice(0,2)?i[a]=t[a]:o[a]=t[a]}const s=new r(o);return h9(s,i),s},createTextInstance:function(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)},finalizeInitialChildren:function(e,t,n){return!1},getPublicInstance:function(e){return e},prepareForCommit:function(){return null},preparePortalMount:function(){return null},prepareUpdate:function(e,t,n,r){return g9},resetAfterCommit:function(){},resetTextContent:function(e){},shouldDeprioritizeSubtree:function(e,t){return!1},getRootHostContext:function(){return p9},getChildHostContext:function(){return p9},scheduleTimeout:m9,cancelTimeout:v9,noTimeout:-1,shouldSetTextContent:function(e,t){return!1},isPrimaryRenderer:!1,warnsIfNotActing:!0,supportsMutation:!0,appendChild:function(e,t){t.parent===e?t.moveToTop():e.add(t),f9(e)},appendChildToContainer:function(e,t){t.parent===e?t.moveToTop():e.add(t),f9(e)},insertBefore:b9,insertInContainerBefore:function(e,t,n){b9(e,t,n)},removeChild:function(e,t){t.destroy(),t.off(u9),f9(e)},removeChildFromContainer:function(e,t){t.destroy(),t.off(u9),f9(e)},commitTextUpdate:function(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)},commitMount:function(e,t,n){},commitUpdate:function(e,t,n,r,o){h9(e,o,r)},hideInstance:function(e){e.hide(),f9(e)},hideTextInstance:function(e){},unhideInstance:function(e,t){(null==t.visible||t.visible)&&e.show()},unhideTextInstance:function(e,t){},clearContainer:function(e){},detachDeletedInstance:function(){},getCurrentEventPriority:()=>i9.exports.DefaultEventPriority,now:G.exports.unstable_now,idlePriority:G.exports.unstable_IdlePriority,run:G.exports.unstable_runWithPriority},Symbol.toStringTag,{value:"Module"}));var x9=Object.defineProperty,w9=Object.defineProperties,S9=Object.getOwnPropertyDescriptors,k9=Object.getOwnPropertySymbols,C9=Object.prototype.hasOwnProperty,_9=Object.prototype.propertyIsEnumerable,E9=(e,t,n)=>t in e?x9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L9=(e,t)=>{for(var n in t||(t={}))C9.call(t,n)&&E9(e,n,t[n]);if(k9)for(var n of k9(t))_9.call(t,n)&&E9(e,n,t[n]);return e};function P9(e,t,n){if(!e)return;if(!0===n(e))return e;let r=t?e.return:e.child;for(;r;){const e=P9(r,t,n);if(e)return e;r=t?null:r.sibling}}function M9(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(xq){return e}}const A9=M9(i.exports.createContext(null));class T9 extends i.exports.Component{render(){return sd(A9.Provider,{value:this._reactInternals,children:this.props.children})}}const{ReactCurrentOwner:O9,ReactCurrentDispatcher:I9}=i.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;const R9=[],N9=new WeakMap;function D9(){var e;const t=function(){const e=i.exports.useContext(A9);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=i.exports.useId(),n=i.exports.useMemo((()=>{var n;return null!=(n=O9.current)?n:P9(e,!1,(e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}}))}),[e,t]);return n}();R9.splice(0,R9.length),P9(t,!0,(e=>{var t;const n=null==(t=e.type)?void 0:t._context;n&&n!==A9&&R9.push(M9(n))}));for(const n of R9){const t=null==(e=I9.current)?void 0:e.readContext(n);N9.set(n,t)}return i.exports.useMemo((()=>R9.reduce(((e,t)=>n=>i.exports.createElement(e,null,i.exports.createElement(t.Provider,((e,t)=>w9(e,S9(t)))(L9({},n),{value:N9.get(t)})))),(e=>sd(T9,{...L9({},e)})))),[])}const z9=e=>{const t=j.useRef(),n=j.useRef(),r=j.useRef(),o=function(e){const t=j.useRef();return j.useLayoutEffect((()=>{t.current=e})),t.current}(e),i=D9(),a=t=>{const{forwardedRef:n}=e;n&&("function"==typeof n?n(t):n.current=t)};return j.useLayoutEffect((()=>(n.current=new K6.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=V9.createContainer(n.current,i9.exports.LegacyRoot,!1,null),V9.updateContainer(sd(i,{children:e.children}),r.current),()=>{K6.isBrowser&&(a(null),V9.updateContainer(null,r.current,null),n.current.destroy())})),[]),j.useLayoutEffect((()=>{a(n.current),h9(n.current,e,o),V9.updateContainer(sd(i,{children:e.children}),r.current,null)})),sd("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},B9="Layer",F9="Group",j9="Rect",H9="Circle",W9="Line",U9="Image",V9=o9(y9);V9.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:j.version,rendererPackageName:"react-konva"});const G9=j.forwardRef(((e,t)=>sd(T9,{children:sd(z9,{...e,forwardedRef:t})}))),$9=cU([_X],(e=>({objects:e.layerState.objects})),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),q9=e=>{const{...t}=e,{objects:n}=roe($9);return sd(F9,{listening:!1,...t,children:n.filter(SX).map(((e,t)=>sd(W9,{points:e.points,stroke:"rgb(0,0,0)",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"},t)))})},Z9=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},Y9=cU(_X,(e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:i,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:c,isTransformingBoundingBox:u,stageScale:d,stageDimensions:h,boundingBoxCoordinates:f,boundingBoxDimensions:p,shouldRestrictStrokesToBox:g}=e,m=g?{clipX:f.x,clipY:f.y,clipWidth:p.width,clipHeight:p.height}:{};return{cursorPosition:t,brushX:t?t.x:h.width/2,brushY:t?t.y:h.height/2,radius:n/2,colorPickerOuterRadius:30/d,colorPickerInnerRadius:21/d,maskColorString:Z9({...o,a:.5}),brushColorString:Z9(i),colorPickerColorString:Z9(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(c||u||!t)&&l,strokeWidth:1.5/d,dotRadius:1.5/d,clip:m}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),X9=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:i,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:c,strokeWidth:u,brushColorString:d,colorPickerColorString:h,colorPickerInnerRadius:f,colorPickerOuterRadius:p,clip:g}=roe(Y9);return l?ld(F9,{listening:!1,...g,...t,children:[ld(ad,"colorPicker"===a?{children:[sd(H9,{x:n,y:r,radius:p,stroke:d,strokeWidth:10,strokeScaleEnabled:!1}),sd(H9,{x:n,y:r,radius:f,stroke:h,strokeWidth:10,strokeScaleEnabled:!1})]}:{children:[sd(H9,{x:n,y:r,radius:o,fill:"mask"===s?i:d,globalCompositeOperation:"eraser"===a?"destination-out":"source-out"}),sd(H9,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:2*u,strokeEnabled:!0,listening:!1}),sd(H9,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:u,strokeEnabled:!0,listening:!1})]}),sd(H9,{x:n,y:r,radius:2*c,fill:"rgba(255,255,255,0.4)",listening:!1}),sd(H9,{x:n,y:r,radius:c,fill:"rgba(0,0,0,1)",listening:!1})]}):null},K9=cU(_X,(e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:o,isTransformingBoundingBox:i,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:i,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Q9=e=>{const{...t}=e,n=noe(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:a,isMovingBoundingBox:s,isTransformingBoundingBox:l,stageScale:c,shouldSnapToGrid:u,tool:d,hitStrokeWidth:h}=roe(K9),f=i.exports.useRef(null),p=i.exports.useRef(null),[g,m]=i.exports.useState(!1);i.exports.useEffect((()=>{f.current&&p.current&&(f.current.nodes([p.current]),f.current.getLayer()?.batchDraw())}),[]);const v=64*c,b=i.exports.useCallback((e=>{if(!u)return void n(WK({x:Math.floor(e.target.x()),y:Math.floor(e.target.y())}));const t=e.target.x(),r=e.target.y(),o=pK(t,64),i=pK(r,64);e.target.x(o),e.target.y(i),n(WK({x:o,y:i}))}),[n,u]),y=i.exports.useCallback((()=>{if(!p.current)return;const e=p.current,t=e.scaleX(),r=e.scaleY(),o=Math.round(e.width()*t),i=Math.round(e.height()*r),a=Math.round(e.x()),s=Math.round(e.y());n(UK({width:o,height:i})),n(WK({x:u?fK(a,64):a,y:u?fK(s,64):s})),e.scaleX(1),e.scaleY(1)}),[n,u]),x=i.exports.useCallback(((e,t,n)=>{const r=e.x%v,o=e.y%v;return{x:fK(t.x,v)+r,y:fK(t.y,v)+o}}),[v]),w=()=>{n(sQ(!1)),n(iQ(!1)),n(nQ(!1)),m(!1)},S=()=>{n(iQ(!0))},k=()=>{n(sQ(!1)),n(iQ(!1)),n(nQ(!1)),m(!1)},C=()=>{m(!0)},_=()=>{n(nQ(!0))},E=()=>{n(nQ(!1))};return ld(F9,{...t,children:[sd(j9,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:_,onMouseOver:_,onMouseLeave:E,onMouseOut:E}),sd(j9,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:h,listening:!a&&"move"===d,onDragStart:S,onDragEnd:k,onDragMove:b,onMouseDown:S,onMouseOut:()=>{!l&&!s&&m(!1)},onMouseOver:C,onMouseEnter:C,onMouseUp:k,onTransform:y,onTransformEnd:w,ref:p,stroke:g?"rgba(255,255,255,0.7)":"white",strokeWidth:(g?8:1)/c,width:o.width,x:r.x,y:r.y}),sd("Transformer",{anchorCornerRadius:3,anchorDragBoundFunc:x,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:"move"===d?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!a&&"move"===d,onDragStart:S,onDragEnd:k,onMouseDown:()=>{n(sQ(!0))},onMouseUp:w,onTransformEnd:w,ref:f,rotateEnabled:!1})]})};let J9=null,e8=null;const t8=()=>J9,n8=()=>e8,r8=cU([_X,RZ,EX],((e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:i,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:o,shouldShowBoundingBox:i,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),o8=()=>{const e=noe(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:a,shouldSnapToGrid:s}=roe(r8),l=i.exports.useRef(null),c=n8();Eq(["shift+c"],(()=>{e(PK())}),{enabled:()=>!o,preventDefault:!0},[]);Eq(["h"],(()=>{e(tQ(!a))}),{enabled:()=>!o,preventDefault:!0},[a]),Eq(["n"],(()=>{e(_Q(!s))}),{enabled:!0,preventDefault:!0},[s]),Eq("esc",(()=>{e(BK())}),{enabled:()=>!0,preventDefault:!0}),Eq("shift+h",(()=>{e(mQ(!n))}),{enabled:()=>!o,preventDefault:!0},[t,n]),Eq(["space"],(t=>{t.repeat||(c?.container().focus(),"move"!==r&&(l.current=r,e(MQ("move"))),"move"===r&&l.current&&"move"!==l.current&&(e(MQ(l.current)),l.current="move"))}),{keyup:!0,keydown:!0,preventDefault:!0},[r,l])},i8=cU(_X,(e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Z9(t)}})),a8=e=>'data:image/svg+xml;utf8,\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'.replaceAll("black",e),s8=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:a}=roe(i8),[s,l]=i.exports.useState(null),[c,u]=i.exports.useState(0),d=i.exports.useRef(null),h=i.exports.useCallback((()=>{u(c+1),setTimeout(h,500)}),[c]);return i.exports.useEffect((()=>{if(s)return;const e=new Image;e.onload=()=>{l(e)},e.src=a8(n)}),[s,n]),i.exports.useEffect((()=>{s&&(s.src=a8(n))}),[s,n]),i.exports.useEffect((()=>{const e=setInterval((()=>u((e=>(e+1)%5))),50);return()=>clearInterval(e)}),[]),s&&EG.exports.isNumber(r.x)&&EG.exports.isNumber(r.y)&&EG.exports.isNumber(a)&&EG.exports.isNumber(o.width)&&EG.exports.isNumber(o.height)?sd(j9,{ref:d,offsetX:r.x/a,offsetY:r.y/a,height:o.height/a,width:o.width/a,fillPatternImage:s,fillPatternOffsetY:EG.exports.isNumber(c)?c:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/a,y:1/a},listening:!0,globalCompositeOperation:"source-in",...t}):null},l8=cU([_X],(e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),c8=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},u8=()=>{const e=noe(),t=t8(),n=n8();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=t9.pixelRatio,[i,a,s,l]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;e(YK({r:i,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(MK())}}},d8=cU([RZ,_X,EX],((e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),h8=cU([RZ,_X,EX],((e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),f8=cU([RZ,_X,EX],((e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),p8=cU([_X,EX],((e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});var g8=i.exports;const m8=e=>{const{url:t,x:n,y:r}=e,[o]=function(e,t,n){const r=g8.useRef("loading"),o=g8.useRef(),[i,a]=g8.useState(0),s=g8.useRef(),l=g8.useRef(),c=g8.useRef();return s.current===e&&l.current===t&&c.current===n||(r.current="loading",o.current=void 0,s.current=e,l.current=t,c.current=n),g8.useLayoutEffect((function(){if(e){var i=document.createElement("img");return i.addEventListener("load",s),i.addEventListener("error",l),t&&(i.crossOrigin=t),n&&(i.referrerpolicy=n),i.src=e,function(){i.removeEventListener("load",s),i.removeEventListener("error",l)}}function s(){r.current="loaded",o.current=i,a(Math.random())}function l(){r.current="failed",o.current=void 0,a(Math.random())}}),[e,t,n]),[o.current,r.current]}(t);return sd(U9,{x:n,y:r,image:o,listening:!1})},v8=cU([_X],(e=>{const{layerState:{objects:t}}=e;return{objects:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),b8=()=>{const{objects:e}=roe(v8);return e?sd(F9,{name:"outpainting-objects",listening:!1,children:e.map(((e,t)=>{if(kX(e))return sd(m8,{x:e.x,y:e.y,url:e.image.url},t);if((e=>"line"===e.kind&&"base"===e.layer)(e)){const n=sd(W9,{points:e.points,stroke:e.color?Z9(e.color):"rgb(0,0,0)",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"},t);return e.clip?sd(F9,{clipX:e.clip.x,clipY:e.clip.y,clipWidth:e.clip.width,clipHeight:e.clip.height,children:n},t):n}return(e=>"fillRect"===e.kind&&"base"===e.layer)(e)?sd(j9,{x:e.x,y:e.y,width:e.width,height:e.height,fill:Z9(e.color)},t):(e=>"eraseRect"===e.kind&&"base"===e.layer)(e)?sd(j9,{x:e.x,y:e.y,width:e.width,height:e.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},t):void 0}))}):null},y8=cU([_X],(e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),x8={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},w8=()=>{const{colorMode:e}=ud(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=roe(y8),[o,a]=i.exports.useState([]),s=i.exports.useCallback((e=>e/t),[t]);return i.exports.useLayoutEffect((()=>{const t=x8[e],{width:o,height:i}=r,{x:l,y:c}=n,u={x1:0,y1:0,x2:o,y2:i,offset:{x:s(l),y:s(c)}},d=64*Math.ceil(s(l)/64),h=64*Math.ceil(s(c)/64),f={x1:-d,y1:-h,x2:s(o)-d+64,y2:s(i)-h+64},p={x1:Math.min(u.x1,f.x1),y1:Math.min(u.y1,f.y1),x2:Math.max(u.x2,f.x2),y2:Math.max(u.y2,f.y2)},g=p.x2-p.x1,m=p.y2-p.y1,v=Math.round(g/64)+1,b=Math.round(m/64)+1,y=LG.range(0,v).map((e=>sd(W9,{x:p.x1+64*e,y:p.y1,points:[0,0,0,m],stroke:t,strokeWidth:1},`x_${e}`))),x=LG.range(0,b).map((e=>sd(W9,{x:p.x1,y:p.y1+64*e,points:[0,0,g,0],stroke:t,strokeWidth:1},`y_${e}`)));a(y.concat(x))}),[t,n,r,e,s]),sd(F9,{children:o})},S8=cU([e=>e.gallery],(e=>e.intermediateImage?e.intermediateImage:null),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),k8=e=>{const{...t}=e,n=roe(S8),[r,o]=i.exports.useState(null);if(i.exports.useEffect((()=>{if(!n)return;const e=new Image;e.onload=()=>{o(e)},e.src=n.url}),[n]),!n?.boundingBox)return null;const{boundingBox:{x:a,y:s,width:l,height:c}}=n;return r?sd(U9,{x:a,y:s,width:l,height:c,image:r,listening:!1,...t}):null},C8=e=>Math.round(100*e)/100,_8=cU([_X],(e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${C8(n)}, ${C8(r)})`}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function E8(){const{cursorCoordinatesString:e}=roe(_8);return sd("div",{children:`Cursor Position: ${e}`})}const L8=cU([_X],(e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:i,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:c,y:u},stageScale:d,shouldShowCanvasDebugInfo:h,layer:f,boundingBoxScaleMethod:p}=e;let g="inherit";("none"===p&&(i<512||a<512)||"manual"===p&&s*l<262144)&&(g="var(--status-working-color)");return{activeLayerColor:"mask"===f?"var(--status-working-color)":"inherit",activeLayerString:f.charAt(0).toUpperCase()+f.slice(1),boundingBoxColor:g,boundingBoxCoordinatesString:`(${C8(c)}, ${C8(u)})`,boundingBoxDimensionsString:`${i}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${C8(r)}×${C8(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(100*d),shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:"auto"!==p,shouldShowScaledBoundingBox:"none"!==p}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),P8=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:i,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:c,shouldShowCanvasDebugInfo:u,shouldShowBoundingBox:d}=roe(L8);return ld("div",{className:"canvas-status-text",children:[sd("div",{style:{color:e},children:`Active Layer: ${t}`}),sd("div",{children:`Canvas Scale: ${c}%`}),d&&sd("div",{style:{color:n},children:`Bounding Box: ${o}`}),a&&sd("div",{style:{color:n},children:`Scaled Bounding Box: ${i}`}),u&&ld(ad,{children:[sd("div",{children:`Bounding Box Position: ${r}`}),sd("div",{children:`Canvas Dimensions: ${l}`}),sd("div",{children:`Canvas Position: ${s}`}),sd(E8,{})]})]})},M8=cU([_X],(e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:o,boundingBoxCoordinates:{x:i,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:0===n,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:i,y:a,width:s,height:l}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),A8=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:i,y:a,width:s,height:l}=roe(M8);return ld(F9,{...t,children:[r&&n&&sd(m8,{url:n.image.url,x:i,y:a}),o&&ld(F9,{children:[sd(j9,{x:i,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),sd(j9,{x:i,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},T8=cU([_X],(e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:0===n,isOnLastImage:n===t.length-1,shouldShowStagingImage:o,shouldShowStagingOutline:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),O8=()=>{const e=noe(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o}=roe(T8),a=i.exports.useCallback((()=>{e(CQ(!0))}),[e]),s=i.exports.useCallback((()=>{e(CQ(!1))}),[e]);Eq(["left"],(()=>{l()}),{enabled:()=>!0,preventDefault:!0}),Eq(["right"],(()=>{c()}),{enabled:()=>!0,preventDefault:!0}),Eq(["enter"],(()=>{u()}),{enabled:()=>!0,preventDefault:!0});const l=()=>e(NK()),c=()=>e(RK()),u=()=>e(AK());return r?sd(kI,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:ld(NT,{isAttached:!0,children:[sd(dZ,{tooltip:"Previous (Left)","aria-label":"Previous (Left)",icon:sd(TY,{}),onClick:l,"data-selected":!0,isDisabled:t}),sd(dZ,{tooltip:"Next (Right)","aria-label":"Next (Right)",icon:sd(OY,{}),onClick:c,"data-selected":!0,isDisabled:n}),sd(dZ,{tooltip:"Accept (Enter)","aria-label":"Accept (Enter)",icon:sd(DY,{}),onClick:u,"data-selected":!0}),sd(dZ,{tooltip:"Show/Hide","aria-label":"Show/Hide","data-alert":!o,icon:sd(o?$Y:GY,{}),onClick:()=>e(kQ(!o)),"data-selected":!0}),sd(dZ,{tooltip:"Save to Gallery","aria-label":"Save to Gallery",icon:sd(sX,{}),onClick:()=>e(BX(r.image.url)),"data-selected":!0}),sd(dZ,{tooltip:"Discard All","aria-label":"Discard All",icon:sd(rX,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(TK()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},I8=cU(_X,(e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:i,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:i,stageCoordinates:a,stageDimensions:r,stageScale:o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),R8=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:i}=roe(I8);return ld(F9,{children:[sd(j9,{offsetX:r.x/i,offsetY:r.y/i,height:o.height/i,width:o.width/i,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),sd(j9,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},N8=cU([_X,EX],((e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:i,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:c,tool:u,isMovingStage:d,shouldShowIntermediates:h,shouldShowGrid:f,shouldRestrictStrokesToBox:p}=e;let g="none";return"move"===u||t?g=d?"grabbing":"grab":i?g=void 0:p&&!a&&(g="default"),{isMaskEnabled:n,isModifyingBoundingBox:i||s,shouldShowBoundingBox:o,shouldShowGrid:f,stageCoordinates:c,stageCursor:g,stageDimensions:l,stageScale:r,tool:u,isStaging:t,shouldShowIntermediates:h}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),D8=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:a,stageDimensions:s,stageScale:l,tool:c,isStaging:u,shouldShowIntermediates:d}=roe(N8);o8();const h=i.exports.useRef(null),f=i.exports.useRef(null),p=i.exports.useCallback((e=>{e8=e,h.current=e}),[]),g=i.exports.useCallback((e=>{J9=e,f.current=e}),[]),m=i.exports.useRef({x:0,y:0}),v=i.exports.useRef(!1),b=(e=>{const t=noe(),{isMoveStageKeyHeld:n,stageScale:r}=roe(l8);return i.exports.useCallback((o=>{if(!e.current||n)return;o.evt.preventDefault();const i=e.current.getPointerPosition();if(!i)return;const a=(i.x-e.current.x())/r,s=(i.y-e.current.y())/r;let l=o.evt.deltaY;o.evt.ctrlKey&&(l=-l);const c=LG.clamp(r*.999**l,.1,20),u={x:i.x-a*c,y:i.y-s*c};t(PQ(c)),t(LQ(u))}),[e,n,r,t])})(h),y=(e=>{const t=noe(),{tool:n,isStaging:r}=roe(d8),{commitColorUnderCursor:o}=u8();return i.exports.useCallback((i=>{if(!e.current)return;if(e.current.container().focus(),"move"===n||r)return void t(aQ(!0));if("colorPicker"===n)return void o();const a=c8(e.current);a&&(i.evt.preventDefault(),t(eQ(!0)),t(_K([a.x,a.y])))}),[e,n,r,t,o])})(h),x=((e,t)=>{const n=noe(),{tool:r,isDrawing:o,isStaging:a}=roe(h8);return i.exports.useCallback((()=>{if("move"===r||a)n(aQ(!1));else{if(!t.current&&o&&e.current){const t=c8(e.current);if(!t)return;n(EK([t.x,t.y]))}else t.current=!1;n(eQ(!1))}}),[t,n,o,a,e,r])})(h,v),w=((e,t,n)=>{const r=noe(),{isDrawing:o,tool:a,isStaging:s}=roe(f8),{updateColorUnderCursor:l}=u8();return i.exports.useCallback((()=>{if(!e.current)return;const i=c8(e.current);i&&(r(XK(i)),n.current=i,"colorPicker"!==a?o&&"move"!==a&&!s&&(t.current=!0,r(EK([i.x,i.y]))):l())}),[t,r,o,s,n,e,a,l])})(h,v,m),S=(()=>{const e=noe();return i.exports.useCallback((()=>{e(IK())}),[e])})(),{handleDragStart:k,handleDragMove:C,handleDragEnd:_}=(()=>{const e=noe(),{tool:t,isStaging:n,isMovingBoundingBox:r}=roe(p8);return{handleDragStart:i.exports.useCallback((()=>{"move"!==t&&!n||r||e(aQ(!0))}),[e,r,n,t]),handleDragMove:i.exports.useCallback((o=>{if("move"!==t&&!n||r)return;const i={x:o.target.x(),y:o.target.y()};e(LQ(i))}),[e,r,n,t]),handleDragEnd:i.exports.useCallback((()=>{"move"!==t&&!n||r||e(aQ(!1))}),[e,r,n,t])}})();return sd("div",{className:"inpainting-canvas-container",children:ld("div",{className:"inpainting-canvas-wrapper",children:[ld(G9,{tabIndex:-1,ref:p,className:"inpainting-canvas-stage",style:{...a?{cursor:a}:{}},x:o.x,y:o.y,width:s.width,height:s.height,scale:{x:l,y:l},onTouchStart:y,onTouchMove:w,onTouchEnd:x,onMouseDown:y,onMouseLeave:S,onMouseMove:w,onMouseUp:x,onDragStart:k,onDragMove:C,onDragEnd:_,onContextMenu:e=>e.evt.preventDefault(),onWheel:b,draggable:("move"===c||u)&&!t,children:[sd(B9,{id:"grid",visible:r,children:sd(w8,{})}),sd(B9,{id:"base",ref:g,listening:!1,imageSmoothingEnabled:!1,children:sd(b8,{})}),ld(B9,{id:"mask",visible:e,listening:!1,children:[sd(q9,{visible:!0,listening:!1}),sd(s8,{listening:!1})]}),sd(B9,{children:sd(R8,{})}),ld(B9,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&sd(X9,{visible:"move"!==c,listening:!1}),sd(A8,{visible:u}),d&&sd(k8,{}),sd(Q9,{visible:n&&!u})]})]}),sd(P8,{}),sd(O8,{})]})})},z8=cU([_X,RZ,bX],((e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function B8(){const e=noe(),{canUndo:t,activeTabName:n}=roe(z8),r=()=>{e(OQ())};return Eq(["meta+z","ctrl+z"],(()=>{r()}),{enabled:()=>t,preventDefault:!0},[n,t]),sd(dZ,{"aria-label":"Undo (Ctrl+Z)",tooltip:"Undo (Ctrl+Z)",icon:sd(pX,{}),onClick:r,isDisabled:!t})}const F8=cU([_X,RZ,bX],((e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function j8(){const e=noe(),{canRedo:t,activeTabName:n}=roe(F8),r=()=>{e(DK())};return Eq(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],(()=>{r()}),{enabled:()=>t,preventDefault:!0},[n,t]),sd(dZ,{"aria-label":"Redo (Ctrl+Shift+Z)",tooltip:"Redo (Ctrl+Shift+Z)",icon:sd(aX,{}),onClick:r,isDisabled:!t})}const H8=rS(((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:o="Cancel",cancelCallback:a,children:s,title:l,triggerComponent:c}=e,{isOpen:u,onOpen:d,onClose:h}=KO(),f=i.exports.useRef(null);return ld(ad,{children:[i.exports.cloneElement(c,{onClick:d,ref:t}),sd($B,{isOpen:u,leastDestructiveRef:f,onClose:h,children:sd(GB,{children:ld(qB,{className:"modal",children:[sd(UB,{fontSize:"lg",fontWeight:"bold",children:l}),sd(RB,{children:s}),ld(WB,{children:[sd(IT,{ref:f,onClick:()=>{a&&a(),h()},className:"modal-close-btn",children:o}),sd(IT,{colorScheme:"red",onClick:()=>{r(),h()},ml:3,children:n})]})]})})})]})})),W8=()=>{const e=roe(EX),t=noe();return ld(H8,{title:"Empty Temp Image Folder",acceptCallback:()=>{t(FX()),t(zK()),t(LK())},acceptButtonText:"Empty Folder",triggerComponent:sd(jX,{leftIcon:sd(fX,{}),size:"sm",isDisabled:e,children:"Empty Temp Image Folder"}),children:[sd("p",{children:"Emptying the temp image folder also fully resets the Unified Canvas. This includes all undo/redo history, images in the staging area, and the canvas base layer."}),sd("br",{}),sd("p",{children:"Are you sure you want to empty the temp folder?"})]})},U8=()=>{const e=roe(EX),t=noe();return ld(H8,{title:"Clear Canvas History",acceptCallback:()=>t(LK()),acceptButtonText:"Clear History",triggerComponent:sd(jX,{size:"sm",leftIcon:sd(fX,{}),isDisabled:e,children:"Clear Canvas History"}),children:[sd("p",{children:"Clearing the canvas history leaves your current canvas intact, but irreversibly clears the undo and redo history."}),sd("br",{}),sd("p",{children:"Are you sure you want to clear the canvas history?"})]})},V8=cU([_X],(e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:i,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:i,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),G8=()=>{const e=noe(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:i,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=roe(V8);Eq(["n"],(()=>{e(_Q(!s))}),{enabled:!0,preventDefault:!0},[s]);return sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{tooltip:"Canvas Settings","aria-label":"Canvas Settings",icon:sd(vX,{})}),children:ld(kI,{direction:"column",gap:"0.5rem",children:[sd(g5,{label:"Show Intermediates",isChecked:a,onChange:t=>e(SQ(t.target.checked))}),sd(g5,{label:"Show Grid",isChecked:i,onChange:t=>e(wQ(t.target.checked))}),sd(g5,{label:"Snap to Grid",isChecked:s,onChange:t=>e(_Q(t.target.checked))}),sd(g5,{label:"Darken Outside Selection",isChecked:r,onChange:t=>e(fQ(t.target.checked))}),sd(g5,{label:"Auto Save to Gallery",isChecked:t,onChange:t=>e(dQ(t.target.checked))}),sd(g5,{label:"Save Box Region Only",isChecked:n,onChange:t=>e(hQ(t.target.checked))}),sd(g5,{label:"Limit Strokes to Box",isChecked:l,onChange:t=>e(RQ(t.target.checked))}),sd(g5,{label:"Show Canvas Debug Info",isChecked:o,onChange:t=>e(yQ(t.target.checked))}),sd(U8,{}),sd(W8,{})]})})};function $8(){return($8=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function Z8(e){var t=i.exports.useRef(e),n=i.exports.useRef((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var Y8=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?a(Q8(o.current,e,l.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=c.current,i=K8(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(J8(t),!function(e,t){return t&&!X8(e)}(t,c.current)&&r)){if(X8(t)){c.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),a(Q8(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,a]),d=u[0],h=u[1],f=u[2];return i.exports.useEffect((function(){return f}),[f]),sd("div",{...$8({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"})})})),tee=function(e){return e.filter(Boolean).join(" ")},nee=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=tee(["react-colorful__pointer",e.className]);return sd("div",{className:i,style:{top:100*o+"%",left:100*n+"%"},children:sd("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}})})},ree=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},oee=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:ree(e.h),s:ree(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:ree(o/2),a:ree(r,2)}},iee=function(e){var t=oee(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},aee=function(e){var t=oee(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},see=j.memo((function(e){var t=e.hue,n=e.onChange,r=tee(["react-colorful__hue",e.className]);return j.createElement("div",{className:r},j.createElement(eee,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Y8(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":ree(t),"aria-valuemax":"360","aria-valuemin":"0"},j.createElement(nee,{className:"react-colorful__hue-pointer",left:t/360,color:iee({h:t,s:100,v:100,a:1})})))})),lee=j.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:iee({h:t.h,s:100,v:100,a:1})};return j.createElement("div",{className:"react-colorful__saturation",style:r},j.createElement(eee,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Y8(t.s+100*e.left,0,100),v:Y8(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ree(t.s)+"%, Brightness "+ree(t.v)+"%"},j.createElement(nee,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:iee(t)})))})),cee=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};var uee="undefined"!=typeof window?i.exports.useLayoutEffect:i.exports.useEffect,dee=new Map,hee=function(e){uee((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!dee.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',dee.set(t,n);var r="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0;r&&n.setAttribute("nonce",r),t.head.appendChild(n)}}),[])},fee=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+aee(Object.assign({},n,{a:0}))+", "+aee(Object.assign({},n,{a:1}))+")"},i=tee(["react-colorful__alpha",t]),a=ree(100*n.a);return j.createElement("div",{className:i},sd("div",{className:"react-colorful__alpha-gradient",style:o}),j.createElement(eee,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:Y8(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},j.createElement(nee,{className:"react-colorful__alpha-pointer",left:n.a,color:aee(n)})))},pee=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,a=e.onChange,s=q8(e,["className","colorModel","color","onChange"]),l=i.exports.useRef(null);hee(l);var c=function(e,t,n){var r=Z8(n),o=i.exports.useState((function(){return e.toHsva(t)})),a=o[0],s=o[1],l=i.exports.useRef({color:t,hsva:a});i.exports.useEffect((function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},s(n)}}),[t,e]),i.exports.useEffect((function(){var t;cee(a,l.current.hsva)||e.equal(t=e.fromHsva(a),l.current.color)||(l.current={hsva:a,color:t},r(t))}),[a,e,r]);var c=i.exports.useCallback((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[a,c]}(n,o,a),u=c[0],d=c[1],h=tee(["react-colorful",t]);return j.createElement("div",$8({},s,{ref:l,className:h}),sd(lee,{hsva:u,onChange:d}),sd(see,{hue:u.h,onChange:d}),j.createElement(fee,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},gee={defaultColor:{r:0,g:0,b:0,a:1},toHsva:function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:ree(60*(s<0?s+6:s)),s:ree(i?a/i*100:0),v:ree(i/255*100),a:o}},fromHsva:function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:ree(255*[r,s,a,a,l,r][c]),g:ree(255*[l,r,r,s,a,a][c]),b:ree(255*[a,a,l,r,r,s][c]),a:ree(o,2)}},equal:cee},mee=function(e){return j.createElement(pee,$8({},e,{colorModel:gee}))};const vee=e=>{const{styleClass:t,...n}=e;return sd(mee,{className:`invokeai__color-picker ${t}`,...n})},bee=cU([_X,EX],((e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:i}=e;return{layer:r,maskColor:n,maskColorString:Z9(n),isMaskEnabled:o,shouldPreserveMaskedArea:i,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),yee=()=>{const e=noe(),{layer:t,maskColor:n,isMaskEnabled:r,shouldPreserveMaskedArea:o,isStaging:i}=roe(bee);Eq(["q"],(()=>{a()}),{enabled:()=>!i,preventDefault:!0},[t]),Eq(["shift+c"],(()=>{s()}),{enabled:()=>!i,preventDefault:!0},[]),Eq(["h"],(()=>{l()}),{enabled:()=>!i,preventDefault:!0},[r]);const a=()=>{e(lQ("mask"===t?"base":"mask"))},s=()=>e(PK()),l=()=>e(tQ(!r));return sd(VQ,{trigger:"hover",triggerComponent:sd(NT,{children:sd(dZ,{"aria-label":"Masking Options",tooltip:"Masking Options",icon:sd(QY,{}),style:"mask"===t?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:i})}),children:ld(kI,{direction:"column",gap:"0.5rem",children:[sd(g5,{label:"Enable Mask (H)",isChecked:r,onChange:l}),sd(g5,{label:"Preserve Masked Area",isChecked:o,onChange:t=>e(gQ(t.target.checked))}),sd(vee,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:t=>e(cQ(t))}),sd(jX,{size:"sm",leftIcon:sd(fX,{}),onClick:s,children:"Clear Mask (Shift+C)"})]})})};let xee;const wee=new Uint8Array(16);function See(){if(!xee&&(xee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xee))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xee(wee)}const kee=[];for(let e=0;e<256;++e)kee.push((e+256).toString(16).slice(1));const Cee={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function _ee(e,t,n){if(Cee.randomUUID&&!t&&!e)return Cee.randomUUID();const r=(e=e||{}).random||(e.rng||See)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(kee[e[t+0]]+kee[e[t+1]]+kee[e[t+2]]+kee[e[t+3]]+"-"+kee[e[t+4]]+kee[e[t+5]]+"-"+kee[e[t+6]]+kee[e[t+7]]+"-"+kee[e[t+8]]+kee[e[t+9]]+"-"+kee[e[t+10]]+kee[e[t+11]]+kee[e[t+12]]+kee[e[t+13]]+kee[e[t+14]]+kee[e[t+15]]).toLowerCase()}(r)}const Eee={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Lee=(e=Eee)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:o,shouldSaveToGallery:i,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(pY("Exporting Image")),t(sY(!1));const c=n(),{stageScale:u,boundingBoxCoordinates:d,boundingBoxDimensions:h,stageCoordinates:f}=c.canvas,p=t8();if(!p)return t($Z(!1)),void t(sY(!0));const{dataURL:g,boundingBox:m}=((e,t,n,r)=>{const o=e.scale(),i=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:c}=e.getClientRect(),u=r?{x:Math.round(r.x+n.x),y:Math.round(r.y+n.y),width:Math.round(r.width),height:Math.round(r.height)}:{x:Math.round(a),y:Math.round(s),width:Math.round(l),height:Math.round(c)},d=e.toDataURL(u);return e.scale(o),{dataURL:d,boundingBox:{x:Math.round(i.x),y:Math.round(i.y),width:Math.round(l),height:Math.round(c)}}})(p,u,f,o?{...d,...h}:void 0);if(!g)return t($Z(!1)),void t(sY(!0));const v=new FormData;v.append("data",JSON.stringify({dataURL:g,filename:"merged_canvas.png",kind:i?"result":"temp",cropVisible:r}));const b=await fetch(window.location.origin+"/upload",{method:"POST",body:v}),y=await b.json(),{url:x,width:w,height:S}=y,k={uuid:_ee(),category:i?"result":"user",...y};a&&((e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()})(x),t(hY({title:"Image Download Started",status:"success",duration:2500,isClosable:!0}))),s&&(((e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",(()=>{const e=document.createElement("canvas");e.width=t,e.height=n;const o=e.getContext("2d");o&&(o.drawImage(r,0,0),e.toBlob((e=>{e&&navigator.clipboard.write([new ClipboardItem({[e.type]:e})])})),e.remove(),r.remove())})),r.src=e})(x,w,S),t(hY({title:"Image Copied",status:"success",duration:2500,isClosable:!0}))),i&&(t(ZQ({image:k,category:"result"})),t(hY({title:"Image Saved to Gallery",status:"success",duration:2500,isClosable:!0}))),l&&(t(uQ({kind:"image",layer:"base",...m,image:k})),t(hY({title:"Canvas Merged",status:"success",duration:2500,isClosable:!0}))),t($Z(!1)),t(eY("Connected")),t(sY(!0))},Pee=cU([_X,EX,bX],((e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:i,brushSize:a}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:i,brushSize:a}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Mee=()=>{const e=noe(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=roe(Pee);Eq(["b"],(()=>{i()}),{enabled:()=>!o,preventDefault:!0},[]),Eq(["e"],(()=>{a()}),{enabled:()=>!o,preventDefault:!0},[t]),Eq(["c"],(()=>{s()}),{enabled:()=>!o,preventDefault:!0},[t]),Eq(["shift+f"],(()=>{l()}),{enabled:()=>!o,preventDefault:!0}),Eq(["delete","backspace"],(()=>{c()}),{enabled:()=>!o,preventDefault:!0}),Eq(["BracketLeft"],(()=>{e(qK(Math.max(r-5,5)))}),{enabled:()=>!o,preventDefault:!0},[r]),Eq(["BracketRight"],(()=>{e(qK(Math.min(r+5,500)))}),{enabled:()=>!o,preventDefault:!0},[r]),Eq(["shift+BracketLeft"],(()=>{e($K({...n,a:LG.clamp(n.a-.05,.05,1)}))}),{enabled:()=>!o,preventDefault:!0},[n]),Eq(["shift+BracketRight"],(()=>{e($K({...n,a:LG.clamp(n.a+.05,.05,1)}))}),{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(MQ("brush")),a=()=>e(MQ("eraser")),s=()=>e(MQ("colorPicker")),l=()=>e(kK()),c=()=>e(SK());return ld(NT,{isAttached:!0,children:[sd(dZ,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:sd(eX,{}),"data-selected":"brush"===t&&!o,onClick:i,isDisabled:o}),sd(dZ,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:sd(HY,{}),"data-selected":"eraser"===t&&!o,isDisabled:o,onClick:a}),sd(dZ,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:sd(qY,{}),isDisabled:o,onClick:l}),sd(dZ,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:sd(rX,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:c}),sd(dZ,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:sd(VY,{}),"data-selected":"colorPicker"===t&&!o,isDisabled:o,onClick:s}),sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{"aria-label":"Brush Options",tooltip:"Brush Options",icon:sd(dX,{})}),children:ld(kI,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[sd(kI,{gap:"1rem",justifyContent:"space-between",children:sd(hZ,{label:"Size",value:r,withInput:!0,onChange:t=>e(qK(t)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),sd(vee,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:t=>e($K(t))})]})})]})};let Aee;const Tee=()=>({setOpenUploader:e=>{e&&(Aee=e)},openUploader:Aee}),Oee=cU([bX,_X,EX],((e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:i,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:o,layer:a,shouldCropToBoundingBoxOnSave:i}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Iee=()=>{const e=noe(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:i,shouldCropToBoundingBoxOnSave:a}=roe(Oee),s=t8(),{openUploader:l}=Tee();Eq(["v"],(()=>{c()}),{enabled:()=>!n,preventDefault:!0},[]),Eq(["r"],(()=>{u()}),{enabled:()=>!0,preventDefault:!0},[s]),Eq(["shift+m"],(()=>{d()}),{enabled:()=>!n,preventDefault:!0},[s,t]),Eq(["shift+s"],(()=>{h()}),{enabled:()=>!n,preventDefault:!0},[s,t]),Eq(["meta+c","ctrl+c"],(()=>{f()}),{enabled:()=>!n,preventDefault:!0},[s,t]),Eq(["shift+d"],(()=>{p()}),{enabled:()=>!n,preventDefault:!0},[s,t]);const c=()=>e(MQ("move")),u=()=>{const t=t8();if(!t)return;const n=t.getClientRect({skipTransform:!0});e(FK({contentRect:n}))},d=()=>{e(Lee({cropVisible:!1,shouldSetAsInitialImage:!0}))},h=()=>{e(Lee({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},f=()=>{e(Lee({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},p=()=>{e(Lee({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))};return ld("div",{className:"inpainting-settings",children:[sd(Bq,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:o,validValues:xX,onChange:t=>{const n=t.target.value;e(lQ(n)),"mask"!==n||r||e(tQ(!0))},isDisabled:n}),sd(yee,{}),sd(Mee,{}),ld(NT,{isAttached:!0,children:[sd(dZ,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:sd(IY,{}),"data-selected":"move"===i||n,onClick:c}),sd(dZ,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:sd(FY,{}),onClick:u})]}),ld(NT,{isAttached:!0,children:[sd(dZ,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:sd(KY,{}),onClick:d,isDisabled:n}),sd(dZ,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:sd(sX,{}),onClick:h,isDisabled:n}),sd(dZ,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:sd(BY,{}),onClick:f,isDisabled:n}),sd(dZ,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:sd(jY,{}),onClick:p,isDisabled:n})]}),ld(NT,{isAttached:!0,children:[sd(B8,{}),sd(j8,{})]}),ld(NT,{isAttached:!0,children:[sd(dZ,{"aria-label":"Upload",tooltip:"Upload",icon:sd(gX,{}),onClick:l,isDisabled:n}),sd(dZ,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:sd(fX,{}),onClick:()=>{e(zK()),e(jK())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),sd(NT,{isAttached:!0,children:sd(G8,{})})]})},Ree=cU([_X],(e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Nee=()=>{const e=noe(),{doesCanvasNeedScaling:t}=roe(Ree);return i.exports.useLayoutEffect((()=>{e(KK(!0));const t=LG.debounce((()=>{e(KK(!0))}),250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[e]),sd("div",{className:"workarea-single-view",children:sd("div",{className:"workarea-split-view-left",children:ld("div",{className:"inpainting-main-area",children:[sd(Iee,{}),sd("div",{className:"inpainting-canvas-area",children:sd(t?X3:D8,{})})]})})})},Dee=cU([_X,EX],((e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function zee(){const e=noe(),{layer:t,isMaskEnabled:n,isStaging:r}=roe(Dee);Eq(["q"],(()=>{e(lQ("mask"===t?"base":"mask"))}),{enabled:()=>!r,preventDefault:!0},[t]);return sd(Bq,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:t,validValues:xX,onChange:t=>{const r=t.target.value;e(lQ(r)),"mask"!==r||n||e(tQ(!0))},isDisabled:r})}const Bee=cU([_X,EX,bX],((e,t,n)=>{const{isProcessing:r}=n,{tool:o}=e;return{tool:o,isStaging:t,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Fee=()=>{const e=noe(),{tool:t,isStaging:n}=roe(Bee);Eq(["b"],(()=>{r()}),{enabled:()=>!n,preventDefault:!0},[]),Eq(["e"],(()=>{o()}),{enabled:()=>!n,preventDefault:!0},[t]),Eq(["c"],(()=>{i()}),{enabled:()=>!n,preventDefault:!0},[t]),Eq(["shift+f"],(()=>{a()}),{enabled:()=>!n,preventDefault:!0}),Eq(["delete","backspace"],(()=>{s()}),{enabled:()=>!n,preventDefault:!0});const r=()=>e(MQ("brush")),o=()=>e(MQ("eraser")),i=()=>e(MQ("colorPicker")),a=()=>e(kK()),s=()=>e(SK());return ld(kI,{flexDirection:"column",gap:"0.5rem",children:[ld(NT,{children:[sd(dZ,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:sd(eX,{}),"data-selected":"brush"===t&&!n,onClick:r,isDisabled:n}),sd(dZ,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:sd(HY,{}),"data-selected":"eraser"===t&&!n,isDisabled:n,onClick:o})]}),ld(NT,{children:[sd(dZ,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:sd(qY,{}),isDisabled:n,onClick:a}),sd(dZ,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:sd(rX,{style:{transform:"rotate(45deg)"}}),isDisabled:n,onClick:s})]}),sd(dZ,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:sd(VY,{}),"data-selected":"colorPicker"===t&&!n,isDisabled:n,onClick:i,width:"max-content"})]})},jee=cU([_X],(e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Hee=()=>{const e=noe(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}=roe(jee);return sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{tooltip:"Canvas Settings",tooltipProps:{placement:"bottom"},"aria-label":"Canvas Settings",icon:sd(vX,{})}),children:ld(kI,{direction:"column",gap:"0.5rem",children:[sd(g5,{label:"Show Intermediates",isChecked:o,onChange:t=>e(SQ(t.target.checked))}),sd(g5,{label:"Auto Save to Gallery",isChecked:t,onChange:t=>e(dQ(t.target.checked))}),sd(g5,{label:"Save Box Region Only",isChecked:n,onChange:t=>e(hQ(t.target.checked))}),sd(g5,{label:"Show Canvas Debug Info",isChecked:r,onChange:t=>e(yQ(t.target.checked))}),sd(U8,{}),sd(W8,{})]})})};function Wee(){const e=roe((e=>e.canvas.tool)),t=roe(EX),n=noe();Eq(["v"],(()=>{r()}),{enabled:()=>!t,preventDefault:!0},[]);const r=()=>n(MQ("move"));return sd(dZ,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:sd(IY,{}),"data-selected":"move"===e||t,onClick:r})}function Uee(){const e=t8(),t=noe();Eq(["r"],(()=>{n()}),{enabled:()=>!0,preventDefault:!0},[e]);const n=()=>{const e=t8();if(!e)return;const n=e.getClientRect({skipTransform:!0});t(FK({contentRect:n}))};return sd(dZ,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:sd(FY,{}),onClick:n})}function Vee(){const e=noe(),t=t8(),n=roe(EX),r=roe((e=>e.system.isProcessing));Eq(["shift+m"],(()=>{o()}),{enabled:()=>!n,preventDefault:!0},[t,r]);const o=()=>{e(Lee({cropVisible:!1,shouldSetAsInitialImage:!0}))};return sd(dZ,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:sd(KY,{}),onClick:o,isDisabled:n})}function Gee(){const e=roe(EX),t=t8(),n=roe((e=>e.system.isProcessing)),r=roe((e=>e.canvas.shouldCropToBoundingBoxOnSave)),o=noe();Eq(["shift+s"],(()=>{i()}),{enabled:()=>!e,preventDefault:!0},[t,n]);const i=()=>{o(Lee({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return sd(dZ,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:sd(sX,{}),onClick:i,isDisabled:e})}function $ee(){const e=roe(EX),t=t8(),n=roe((e=>e.system.isProcessing)),r=roe((e=>e.canvas.shouldCropToBoundingBoxOnSave)),o=noe();Eq(["meta+c","ctrl+c"],(()=>{i()}),{enabled:()=>!e,preventDefault:!0},[t,n]);const i=()=>{o(Lee({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return sd(dZ,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:sd(BY,{}),onClick:i,isDisabled:e})}function qee(){const e=noe(),t=t8(),n=roe(EX),r=roe((e=>e.system.isProcessing)),o=roe((e=>e.canvas.shouldCropToBoundingBoxOnSave));Eq(["shift+d"],(()=>{i()}),{enabled:()=>!n,preventDefault:!0},[t,r]);const i=()=>{e(Lee({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return sd(dZ,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:sd(jY,{}),onClick:i,isDisabled:n})}function Zee(){const e=roe(EX),{openUploader:t}=Tee();return sd(dZ,{"aria-label":"Upload",tooltip:"Upload",icon:sd(gX,{}),onClick:t,isDisabled:e})}function Yee(){const e=noe(),t=roe(EX);return sd(dZ,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:sd(fX,{}),onClick:()=>{e(zK()),e(jK())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:t})}function Xee(){const e=roe((e=>e.options.shouldPinOptionsPanel)),t=noe();return ld(kI,{flexDirection:"column",gap:"0.5rem",children:[sd(dZ,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:()=>{t(hne(!0)),e&&setTimeout((()=>t(KK(!0))),400)},children:sd(dX,{})}),sd(kI,{children:sd(HX,{iconButton:!0})}),sd(kI,{children:sd(UX,{width:"100%",height:"40px"})})]})}const Kee=()=>{const e=roe((e=>e.options.shouldShowOptionsPanel));return ld(kI,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[sd(zee,{}),sd(Fee,{}),ld(kI,{gap:"0.5rem",children:[sd(Wee,{}),sd(Uee,{})]}),ld(kI,{columnGap:"0.5rem",children:[sd(Vee,{}),sd(Gee,{})]}),ld(kI,{columnGap:"0.5rem",children:[sd($ee,{}),sd(qee,{})]}),ld(kI,{gap:"0.5rem",children:[sd(B8,{}),sd(j8,{})]}),ld(kI,{gap:"0.5rem",children:[sd(Zee,{}),sd(Yee,{})]}),sd(Hee,{}),!e&&sd(Xee,{})]})};function Qee(){const e=noe(),t=roe((e=>e.canvas.brushSize)),n=roe(EX);return Eq(["BracketLeft"],(()=>{e(qK(Math.max(t-5,5)))}),{enabled:()=>!n,preventDefault:!0},[t]),Eq(["BracketRight"],(()=>{e(qK(Math.min(t+5,500)))}),{enabled:()=>!n,preventDefault:!0},[t]),sd(hZ,{label:"Size",value:t,withInput:!0,onChange:t=>e(qK(t)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px"})}const Jee=cU([_X,EX],((e,t)=>{const{brushColor:n,maskColor:r,layer:o}=e;return{brushColor:n,maskColor:r,layer:o,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function ete(){const e=noe(),{brushColor:t,maskColor:n,layer:r,isStaging:o}=roe(Jee);return Eq(["shift+BracketLeft"],(()=>{e($K({...t,a:LG.clamp(t.a-.05,.05,1)}))}),{enabled:()=>!o,preventDefault:!0},[t]),Eq(["shift+BracketRight"],(()=>{e($K({...t,a:LG.clamp(t.a+.05,.05,1)}))}),{enabled:()=>!o,preventDefault:!0},[t]),sd(VQ,{trigger:"hover",triggerComponent:sd(gI,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:"base"===r?`rgba(${t.r},${t.g},${t.b},${t.a})`:"mask"===r?`rgba(${n.r},${n.g},${n.b},${n.a})`:void 0,cursor:"pointer"}}),children:ld(kI,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:["base"===r&&sd(vee,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:t=>e($K(t))}),"mask"===r&&sd(vee,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:t=>e(cQ(t))})]})})}function tte(){return ld(kI,{columnGap:"1rem",alignItems:"center",children:[sd(Qee,{}),sd(ete,{})]})}function nte(){const e=noe(),t=roe((e=>e.canvas.shouldRestrictStrokesToBox));return sd(g5,{label:"Limit To Box",isChecked:t,onChange:t=>e(RQ(t.target.checked))})}function rte(){return ld(kI,{gap:"1rem",alignItems:"center",children:[sd(tte,{}),sd(nte,{})]})}function ote(){const e=noe();return sd(jX,{size:"sm",leftIcon:sd(fX,{}),onClick:()=>e(PK()),tooltip:"Clear Mask (Shift+C)",children:"Clear"})}function ite(){const e=roe((e=>e.canvas.isMaskEnabled)),t=noe();return sd(g5,{label:"Enable Mask (H)",isChecked:e,onChange:()=>t(tQ(!e))})}function ate(){const e=noe(),t=roe((e=>e.canvas.shouldPreserveMaskedArea));return sd(g5,{label:"Preserve Masked",isChecked:t,onChange:t=>e(gQ(t.target.checked))})}function ste(){return ld(kI,{gap:"1rem",alignItems:"center",children:[sd(tte,{}),sd(ite,{}),sd(ate,{}),sd(ote,{})]})}function lte(){const e=roe((e=>e.canvas.shouldDarkenOutsideBoundingBox)),t=noe();return sd(g5,{label:"Darken Outside",isChecked:e,onChange:e=>t(fQ(e.target.checked))})}function cte(){const e=roe((e=>e.canvas.shouldShowGrid)),t=noe();return sd(g5,{label:"Show Grid",isChecked:e,onChange:e=>t(wQ(e.target.checked))})}function ute(){const e=roe((e=>e.canvas.shouldSnapToGrid)),t=noe();return sd(g5,{label:"Snap to Grid (N)",isChecked:e,onChange:e=>t(_Q(e.target.checked))})}function dte(){return ld(kI,{alignItems:"center",gap:"1rem",children:[sd(cte,{}),sd(ute,{}),sd(lte,{})]})}const hte=cU([_X],(e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function fte(){const{tool:e,layer:t}=roe(hte);return ld(kI,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:["base"==t&&["brush","eraser","colorPicker"].includes(e)&&sd(rte,{}),"mask"==t&&["brush","eraser","colorPicker"].includes(e)&&sd(ste,{}),"move"==e&&sd(dte,{})]})}const pte=cU([_X],(e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),gte=()=>{const e=noe(),{doesCanvasNeedScaling:t}=roe(pte);return i.exports.useLayoutEffect((()=>{e(KK(!0));const t=LG.debounce((()=>{e(KK(!0))}),250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[e]),sd("div",{className:"workarea-single-view",children:ld(kI,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[sd(Kee,{}),ld(kI,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[sd(fte,{}),sd(t?X3:D8,{})]})]})})};function mte(){const e=roe((e=>e.options.shouldUseCanvasBetaLayout));return sd(w5,{optionsPanel:sd(Z3,{}),styleClass:"inpainting-workarea-overrides",children:sd(e?gte:Nee,{})})}const vte=SS({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})});function bte(){return ld("div",{className:"work-in-progress nodes-work-in-progress",children:[sd("h1",{children:"Training"}),ld("p",{children:["A dedicated workflow for training your own embeddings and checkpoints using Textual Inversion and Dreambooth from the web interface. ",sd("br",{}),sd("br",{}),"InvokeAI already supports training custom embeddings using Textual Inversion using the main script."]})]})}const yte=SS({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),xte={txt2img:{title:sd(Iq,{fill:"black",boxSize:"2.5rem"}),workarea:sd(_5,{}),tooltip:"Text To Image"},img2img:{title:sd(Aq,{fill:"black",boxSize:"2.5rem"}),workarea:sd(S5,{}),tooltip:"Image To Image"},unifiedCanvas:{title:sd(vte,{fill:"black",boxSize:"2.5rem"}),workarea:sd(mte,{}),tooltip:"Unified Canvas"},nodes:{title:sd(Tq,{fill:"black",boxSize:"2.5rem"}),workarea:sd(Pq,{}),tooltip:"Nodes"},postprocess:{title:sd(Oq,{fill:"black",boxSize:"2.5rem"}),workarea:sd(Mq,{}),tooltip:"Post Processing"},training:{title:sd(yte,{fill:"black",boxSize:"2.5rem"}),workarea:sd(bte,{}),tooltip:"Training"}},wte=LG.map(xte,((e,t)=>t));function Ste(){const e=roe((e=>e.options.activeTab)),t=roe((e=>e.options.isLightBoxOpen)),n=noe();Eq("1",(()=>{n(Pte(0))})),Eq("2",(()=>{n(Pte(1))})),Eq("3",(()=>{n(Pte(2))})),Eq("4",(()=>{n(Pte(3))})),Eq("5",(()=>{n(Pte(4))})),Eq("6",(()=>{n(Pte(5))})),Eq("z",(()=>{n(Wte(!t))}),[t]);return ld(mH,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:e=>{n(Pte(e))},children:[sd("div",{className:"app-tabs-list",children:(()=>{const e=[];return Object.keys(xte).forEach((t=>{e.push(sd(qH,{hasArrow:!0,label:xte[t].tooltip,placement:"right",children:sd(wH,{children:xte[t].title})},t))})),e})()}),sd(xH,{className:"app-tabs-panels",children:t?sd(F3,{}):(()=>{const e=[];return Object.keys(xte).forEach((t=>{e.push(sd(yH,{className:"app-tabs-panel",children:xte[t].workarea},t))})),e})()})]})}const kte={activeTab:0,cfgScale:7.5,codeformerFidelity:.75,currentTheme:"dark",facetoolStrength:.8,facetoolType:"gfpgan",height:512,hiresFix:!1,img2imgStrength:.75,infillMethod:"patchmatch",isLightBoxOpen:!1,iterations:1,maskPath:"",optionsPanelScrollPosition:0,perlin:0,prompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:10,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldHoldOptionsPanelOpen:!1,shouldLoopback:!1,shouldPinOptionsPanel:!0,shouldRandomizeSeed:!0,shouldRunESRGAN:!1,shouldRunFacetool:!1,shouldShowImageDetails:!1,shouldShowOptionsPanel:!0,showAdvancedOptions:!0,showDualDisplay:!0,steps:50,threshold:0,tileSize:32,upscalingLevel:4,upscalingStrength:.75,variationAmount:.1,width:512,shouldUseCanvasBetaLayout:!1},Cte=TU({name:"options",initialState:kte,reducers:{setPrompt:(e,t)=>{const n=t.payload;e.prompt="string"==typeof n?n:kG(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,o={...e,[n]:r};return"seed"===n&&(o.shouldRandomizeSeed=!1),o},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:o,variations:i,steps:a,cfg_scale:s,threshold:l,perlin:c,seamless:u,hires_fix:d,width:h,height:f}=t.payload.image;i&&i.length>0?(e.seedWeights=_G(i),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),r&&(e.prompt=kG(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),l&&(e.threshold=l),void 0===l&&(e.threshold=0),c&&(e.perlin=c),void 0===c&&(e.perlin=0),"boolean"==typeof u&&(e.seamless=u),"boolean"==typeof d&&(e.hiresFix=d),h&&(e.width=h),f&&(e.height=f)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:o,init_image_path:i,mask_image_path:a}=t.payload.image;"img2img"===n&&(i&&(e.initialImage=i),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),"boolean"==typeof o&&(e.shouldFitToWidthHeight=o))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:o,seed:i,variations:a,steps:s,cfg_scale:l,threshold:c,perlin:u,seamless:d,hires_fix:h,width:f,height:p,strength:g,fit:m,init_image_path:v,mask_image_path:b}=t.payload.image;"img2img"===n&&(v&&(e.initialImage=v),b&&(e.maskPath=b),g&&(e.img2imgStrength=g),"boolean"==typeof m&&(e.shouldFitToWidthHeight=m)),a&&a.length>0?(e.seedWeights=_G(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),o&&(e.prompt=kG(o)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),c&&(e.threshold=c),void 0===c&&(e.threshold=0),u&&(e.perlin=u),void 0===u&&(e.perlin=0),"boolean"==typeof d&&(e.seamless=d),"boolean"==typeof h&&(e.hiresFix=h),f&&(e.width=f),p&&(e.height=p),e.shouldRunESRGAN=!1,e.shouldRunFacetool=!1},resetOptionsState:e=>({...e,...kte}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setShowAdvancedOptions:(e,t)=>{e.showAdvancedOptions=t.payload},setActiveTab:(e,t)=>{"number"==typeof t.payload?e.activeTab=t.payload:e.activeTab=wte.indexOf(t.payload)},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShowDualDisplay:(e,t)=>{e.showDualDisplay=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setShouldPinOptionsPanel:(e,t)=>{e.shouldPinOptionsPanel=t.payload},setShouldShowOptionsPanel:(e,t)=>{e.shouldShowOptionsPanel=t.payload},setOptionsPanelScrollPosition:(e,t)=>{e.optionsPanelScrollPosition=t.payload},setShouldHoldOptionsPanelOpen:(e,t)=>{e.shouldHoldOptionsPanelOpen=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setIsLightBoxOpen:(e,t)=>{e.isLightBoxOpen=t.payload},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload}}}),{clearInitialImage:_te,resetOptionsState:Ete,resetSeed:Lte,setActiveTab:Pte,setAllImageToImageParameters:Mte,setAllParameters:Ate,setAllTextToImageParameters:Tte,setCfgScale:Ote,setCodeformerFidelity:Ite,setCurrentTheme:Rte,setFacetoolStrength:Nte,setFacetoolType:Dte,setHeight:zte,setHiresFix:Bte,setImg2imgStrength:Fte,setInfillMethod:jte,setInitialImage:Hte,setIsLightBoxOpen:Wte,setIterations:Ute,setMaskPath:Vte,setOptionsPanelScrollPosition:Gte,setParameter:$te,setPerlin:qte,setPrompt:Zte,setSampler:Yte,setSeamBlur:Xte,setSeamless:Kte,setSeamSize:Qte,setSeamSteps:Jte,setSeamStrength:ene,setSeed:tne,setSeedWeights:nne,setShouldFitToWidthHeight:rne,setShouldGenerateVariations:one,setShouldHoldOptionsPanelOpen:ine,setShouldLoopback:ane,setShouldPinOptionsPanel:sne,setShouldRandomizeSeed:lne,setShouldRunESRGAN:cne,setShouldRunFacetool:une,setShouldShowImageDetails:dne,setShouldShowOptionsPanel:hne,setShowAdvancedOptions:fne,setShowDualDisplay:pne,setSteps:gne,setThreshold:mne,setTileSize:vne,setUpscalingLevel:bne,setUpscalingStrength:yne,setVariationAmount:xne,setWidth:wne,setShouldUseCanvasBetaLayout:Sne}=Cte.actions,kne=Cte.reducer,Cne=Object.create(null);Cne.open="0",Cne.close="1",Cne.ping="2",Cne.pong="3",Cne.message="4",Cne.upgrade="5",Cne.noop="6";const _ne=Object.create(null);Object.keys(Cne).forEach((e=>{_ne[Cne[e]]=e}));const Ene={type:"error",data:"parser error"},Lne="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),Pne="function"==typeof ArrayBuffer,Mne=({type:e,data:t},n,r)=>Lne&&t instanceof Blob?n?r(t):Ane(t,r):Pne&&(t instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer)(t))?n?r(t):Ane(new Blob([t]),r):r(Cne[e]+(t||"")),Ane=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+e)},n.readAsDataURL(e)},Tne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",One="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e{if("string"!=typeof e)return{type:"message",data:Dne(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:Nne(e.substring(1),t)};return _ne[n]?e.length>1?{type:_ne[n],data:e.substring(1)}:{type:_ne[n]}:Ene},Nne=(e,t)=>{if(Ine){const n=(e=>{let t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return Dne(n,t)}return{base64:!0,data:e}},Dne=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,zne=String.fromCharCode(30);function Bne(e){if(e)return function(e){for(var t in Bne.prototype)e[t]=Bne.prototype[t];return e}(e)}Bne.prototype.on=Bne.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Bne.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Bne.prototype.off=Bne.prototype.removeListener=Bne.prototype.removeAllListeners=Bne.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const Hne=setTimeout,Wne=clearTimeout;function Une(e,t){t.useNativeTimers?(e.setTimeoutFn=Hne.bind(Fne),e.clearTimeoutFn=Wne.bind(Fne)):(e.setTimeoutFn=setTimeout.bind(Fne),e.clearTimeoutFn=clearTimeout.bind(Fne))}function Vne(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}class Gne extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class $ne extends Bne{constructor(e){super(),this.writable=!1,Une(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new Gne(e,t,n)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Rne(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const qne="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Zne={};let Yne,Xne=0,Kne=0;function Qne(e){let t="";do{t=qne[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function Jne(){const e=Qne(+new Date);return e!==Yne?(Xne=0,Yne=e):e+"."+Qne(Xne++)}for(;Kne<64;Kne++)Zne[qne[Kne]]=Kne;function ere(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let tre=!1;try{tre="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Kie){}const nre=tre;function rre(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||nre))return new XMLHttpRequest}catch(vV){}if(!t)try{return new(Fne[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(vV){}}function ore(){}const ire=null!=new rre({xdomain:!1}).responseType;class are extends Bne{constructor(e,t){super(),Une(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=jne(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new rre(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(vV){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(vV){}try{t.setRequestHeader("Accept","*/*")}catch(vV){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(vV){return void this.setTimeoutFn((()=>{this.onError(vV)}),0)}"undefined"!=typeof document&&(this.index=are.requestsCount++,are.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=ore,e)try{this.xhr.abort()}catch(vV){}"undefined"!=typeof document&&delete are.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(are.requestsCount=0,are.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",sre);else if("function"==typeof addEventListener){addEventListener("onpagehide"in Fne?"pagehide":"unload",sre,!1)}function sre(){for(let e in are.requests)are.requests.hasOwnProperty(e)&&are.requests[e].abort()}const lre="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),cre=Fne.WebSocket||Fne.MozWebSocket,ure="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const dre={websocket:class extends $ne{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=ure?{}:jne(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=ure?new cre(e,t,n):t?new cre(e,t):new cre(e)}catch(Kie){return this.emitReserved("error",Kie)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.ws.send(e)}catch(vV){}r&&lre((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=Jne()),this.supportsBinary||(e.b64=1);const r=ere(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!cre}},polling:class extends $ne{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=ire&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(zne),r=[];for(let o=0;o{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{Mne(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(zne))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=Jne()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=ere(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new are(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},hre=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,fre=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function pre(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=hre.exec(e||""),i={},a=14;for(;a--;)i[fre[a]]=o[a]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,i.query),i}class gre extends Bne{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=pre(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=pre(t.host).host),Une(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new dre[e](n)}open(){let e;if(this.opts.rememberUpgrade&&gre.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(vV){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;gre.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;gre.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function a(){i("transport closed")}function s(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",a),this.off("close",s),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",a),this.once("close",s),this.once("upgrading",l),t.open()}onOpen(){if(this.readyState="open",gre.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let e=0;const t=this.upgrades.length;for(;e{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){gre.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||bre&&e instanceof Blob||yre&&e instanceof File}function wre(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t=0&&e.num0;case Ere.ACK:case Ere.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Pre{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=Cre(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Mre=Object.freeze(Object.defineProperty({__proto__:null,protocol:5,get PacketType(){return Ere},Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==Ere.EVENT&&e.type!==Ere.ACK||!wre(e)?[this.encodeAsString(e)]:(e.type=e.type===Ere.EVENT?Ere.BINARY_EVENT:Ere.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==Ere.BINARY_EVENT&&e.type!==Ere.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Sre(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Decoder:Lre},Symbol.toStringTag,{value:"Module"}));function Are(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Tre=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ore extends Bne{constructor(e,t,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Are(e,"open",this.onopen.bind(this)),Are(e,"packet",this.onpacket.bind(this)),Are(e,"error",this.onerror.bind(this)),Are(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(Tre.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const n={type:Ere.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){const n=this.flags.timeout;if(void 0===n)return void(this.acks[e]=t);const r=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this.packet({type:Ere.CONNECT,data:e})})):this.packet({type:Ere.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Ere.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ere.EVENT:case Ere.BINARY_EVENT:this.onevent(e);break;case Ere.ACK:case Ere.BINARY_ACK:this.onack(e);break;case Ere.DISCONNECT:this.ondisconnect();break;case Ere.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:Ere.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ere.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ire.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},Ire.prototype.reset=function(){this.attempts=0},Ire.prototype.setMin=function(e){this.ms=e},Ire.prototype.setMax=function(e){this.max=e},Ire.prototype.setJitter=function(e){this.jitter=e};class Rre extends Bne{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,Une(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Ire({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||Mre;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new gre(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Are(t,"open",(function(){n.onopen(),e&&e()})),o=Are(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Are(e,"ping",this.onping.bind(this)),Are(e,"data",this.ondata.bind(this)),Are(e,"error",this.onerror.bind(this)),Are(e,"close",this.onclose.bind(this)),Are(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(vV){this.onclose("parse error",vV)}}ondecoded(e){lre((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n||(n=new Ore(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;ne())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Nre={};function Dre(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=pre(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,a=Nre[o]&&i in Nre[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?s=new Rre(r,t):(Nre[o]||(Nre[o]=new Rre(r,t)),s=Nre[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}Object.assign(Dre,{Manager:Rre,Socket:Ore,io:Dre,connect:Dre});var zre=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Bre=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Fre=/[^-+\dA-Z]/g;function jre(e,t,n,r){if(1!==arguments.length||"string"!=typeof e||/\d/.test(e)||(t=e,e=void 0),(e=e||0===e?e:new Date)instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");var o=(t=String(Hre[t]||t||Hre.default)).slice(0,4);"UTC:"!==o&&"GMT:"!==o||(t=t.slice(4),n=!0,"GMT:"===o&&(r=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},s=function(){return e[i()+"Day"]()},l=function(){return e[i()+"Month"]()},c=function(){return e[i()+"FullYear"]()},u=function(){return e[i()+"Hours"]()},d=function(){return e[i()+"Minutes"]()},h=function(){return e[i()+"Seconds"]()},f=function(){return e[i()+"Milliseconds"]()},p=function(){return n?0:e.getTimezoneOffset()},g=function(){return Gre(e)},m=function(){return $re(e)},v={d:function(){return a()},dd:function(){return Ure(a())},ddd:function(){return Wre.dayNames[s()]},DDD:function(){return Vre({y:c(),m:l(),d:a(),_:i(),dayName:Wre.dayNames[s()],short:!0})},dddd:function(){return Wre.dayNames[s()+7]},DDDD:function(){return Vre({y:c(),m:l(),d:a(),_:i(),dayName:Wre.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Ure(l()+1)},mmm:function(){return Wre.monthNames[l()]},mmmm:function(){return Wre.monthNames[l()+12]},yy:function(){return String(c()).slice(2)},yyyy:function(){return Ure(c(),4)},h:function(){return u()%12||12},hh:function(){return Ure(u()%12||12)},H:function(){return u()},HH:function(){return Ure(u())},M:function(){return d()},MM:function(){return Ure(d())},s:function(){return h()},ss:function(){return Ure(h())},l:function(){return Ure(f(),3)},L:function(){return Ure(Math.floor(f()/10))},t:function(){return u()<12?Wre.timeNames[0]:Wre.timeNames[1]},tt:function(){return u()<12?Wre.timeNames[2]:Wre.timeNames[3]},T:function(){return u()<12?Wre.timeNames[4]:Wre.timeNames[5]},TT:function(){return u()<12?Wre.timeNames[6]:Wre.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":qre(e)},o:function(){return(p()>0?"-":"+")+Ure(100*Math.floor(Math.abs(p())/60)+Math.abs(p())%60,4)},p:function(){return(p()>0?"-":"+")+Ure(Math.floor(Math.abs(p())/60),2)+":"+Ure(Math.floor(Math.abs(p())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return g()},WW:function(){return Ure(g())},N:function(){return m()}};return t.replace(zre,(function(e){return e in v?v[e]():e.slice(1,e.length-1)}))}var Hre={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Wre={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Ure=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")},Vre=function(e){var t=e.y,n=e.m,r=e.d,o=e._,i=e.dayName,a=e.short,s=void 0!==a&&a,l=new Date,c=new Date;c.setDate(c[o+"Date"]()-1);var u=new Date;u.setDate(u[o+"Date"]()+1);return l[o+"FullYear"]()===t&&l[o+"Month"]()===n&&l[o+"Date"]()===r?s?"Tdy":"Today":c[o+"FullYear"]()===t&&c[o+"Month"]()===n&&c[o+"Date"]()===r?s?"Ysd":"Yesterday":u[o+"FullYear"]()===t&&u[o+"Month"]()===n&&u[o+"Date"]()===r?s?"Tmw":"Tomorrow":i},Gre=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var o=(t-n)/6048e5;return 1+Math.floor(o)},$re=function(e){var t=e.getDay();return 0===t&&(t=7),t},qre=function(e){return(String(e).match(Bre)||[""]).pop().replace(Fre,"").replace(/GMT\+0000/g,"UTC")};const Zre=e=>{const t=t8(),{generationMode:n,optionsState:r,canvasState:o,systemState:i}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:c,height:u,hiresFix:d,img2imgStrength:h,infillMethod:f,initialImage:p,iterations:g,perlin:m,prompt:v,sampler:b,seamBlur:y,seamless:x,seamSize:w,seamSteps:S,seamStrength:k,seed:C,seedWeights:_,shouldFitToWidthHeight:E,shouldGenerateVariations:L,shouldRandomizeSeed:P,shouldRunESRGAN:M,shouldRunFacetool:A,steps:T,threshold:O,tileSize:I,upscalingLevel:R,upscalingStrength:N,variationAmount:D,width:z}=r,{shouldDisplayInProgressType:B,saveIntermediatesInterval:F,enableImageDebugging:j}=i,H={prompt:v,iterations:g,steps:T,cfg_scale:a,threshold:O,perlin:m,height:u,width:z,sampler_name:b,seed:C,progress_images:"full-res"===B,progress_latents:"latents"===B,save_intermediates:F,generation_mode:n,init_mask:""};let W=!1,U=!1;if(H.seed=P?yZ(0,Uq):C,["txt2img","img2img"].includes(n)&&(H.seamless=x,H.hires_fix=d,M&&(W={level:R,strength:N}),A&&(U={type:c,strength:l},"codeformer"===c&&(U.codeformer_fidelity=s))),"img2img"===n&&p&&(H.init_img="string"==typeof p?p:p.url,H.strength=h,H.fit=E),"unifiedCanvas"===n&&t){const{layerState:{objects:e},boundingBoxCoordinates:n,boundingBoxDimensions:r,inpaintReplace:i,shouldUseInpaintReplace:a,stageScale:s,isMaskEnabled:l,shouldPreserveMaskedArea:c,boundingBoxScaleMethod:u,scaledBoundingBoxDimensions:d}=o,p={...n,...r},g=((e,t)=>{const{width:n,height:r}=t,o=document.createElement("div"),i=new t9.Stage({container:o,width:n,height:r}),a=new t9.Layer,s=new t9.Layer;a.add(new t9.Rect({...t,fill:"white"})),e.forEach((e=>s.add(new t9.Line({points:e.points,stroke:"black",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"})))),i.add(a),i.add(s);const l=i.toDataURL({...t});return o.remove(),l})(l?e.filter(SX):[],p);H.init_mask=g,H.fit=!1,H.strength=h,H.invert_mask=c,a&&(H.inpaint_replace=i),H.bounding_box=p;const m=t.scale();t.scale({x:1/s,y:1/s});const v=t.getAbsolutePosition(),b=t.toDataURL({x:p.x+v.x,y:p.y+v.y,width:p.width,height:p.height});j&&(e=>{const t=window.open("");t&&e.forEach((e=>{const n=new Image;n.src=e.base64,t.document.write(e.caption),t.document.write("
"),t.document.write(n.outerHTML),t.document.write("

")}))})([{base64:g,caption:"mask sent as init_mask"},{base64:b,caption:"image sent as init_img"}]),t.scale(m),H.init_img=b,H.progress_images=!1,"none"!==u&&(H.inpaint_width=d.width,H.inpaint_height=d.height),H.seam_size=w,H.seam_blur=y,H.seam_strength=k,H.seam_steps=S,H.tile_size=I,H.infill_method=f,H.force_outpaint=!1}return L?(H.variation_amount=D,_&&(H.with_variations=(e=>{const t=e.split(",").map((e=>e.split(":")));return t.map((e=>[parseInt(e[0]),parseFloat(e[1])]))})(_))):H.variation_amount=0,j&&(H.enable_image_debugging=j),{generationParameters:H,esrganParameters:W,facetoolParameters:U}},Yre=()=>{const{origin:e}=new URL(window.location.href),t=Dre(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return e=>r=>o=>{const{onConnect:i,onDisconnect:a,onError:s,onPostprocessingResult:l,onGenerationResult:c,onIntermediateResult:u,onProgressUpdate:d,onGalleryImages:h,onProcessingCanceled:f,onImageDeleted:p,onSystemConfig:g,onModelChanged:m,onModelChangeFailed:v,onTempFolderEmptied:b}=(e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(YZ(!0)),t(eY("Connected")),t(DX());const e=n().gallery;e.categories.result.latest_mtime?t(RX("result")):t(IX("result")),e.categories.user.latest_mtime?t(RX("user")):t(IX("user"))}catch(vV){console.error(vV)}},onDisconnect:()=>{try{t(YZ(!1)),t(eY("Disconnected")),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(vV){console.error(vV)}},onGenerationResult:e=>{try{const r=n(),{shouldLoopback:o,activeTab:i}=r.options,{boundingBox:a,generationMode:s,...l}=e,c={uuid:_ee(),...l};if(["txt2img","img2img"].includes(s)&&t(ZQ({category:"result",image:{...c,category:"result"}})),"unifiedCanvas"===s&&e.boundingBox){const{boundingBox:n}=e;t(CK({image:{...c,category:"temp"},boundingBox:n})),r.canvas.shouldAutoSave&&t(ZQ({image:{...c,category:"result"},category:"result"}))}o&&"img2img"===wte[i]&&t(Hte(c)),t(YQ()),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Image generated: ${e.url}`}))}catch(vV){console.error(vV)}},onIntermediateResult:e=>{try{t(JQ({uuid:_ee(),...e,category:"result"})),e.isBase64||t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Intermediate image generated: ${e.url}`}))}catch(vV){console.error(vV)}},onPostprocessingResult:e=>{try{t(ZQ({category:"result",image:{uuid:_ee(),...e,category:"result"}})),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Postprocessed: ${e.url}`}))}catch(vV){console.error(vV)}},onProgressUpdate:e=>{try{t($Z(!0)),t(JZ(e))}catch(vV){console.error(vV)}},onError:e=>{const{message:n,additionalData:r}=e;try{t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Server error: ${n}`,level:"error"})),t(oY()),t(YQ())}catch(vV){console.error(vV)}},onGalleryImages:e=>{const{images:n,areMoreImagesAvailable:r,category:o}=e,i=n.map((e=>({uuid:_ee(),...e})));t(QQ({images:i,areMoreImagesAvailable:r,category:o})),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Loaded ${n.length} images`}))},onProcessingCanceled:()=>{t(rY());const{intermediateImage:e}=n().gallery;e&&(e.isBase64||(t(ZQ({category:"result",image:e})),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Intermediate image saved: ${e.url}`}))),t(YQ())),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:e=>{const{url:r}=e;t(XQ(e));const{initialImage:o,maskPath:i}=n().options;o?.url!==r&&o!==r||t(_te()),i===r&&t(Vte("")),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Image deleted: ${r}`}))},onSystemConfig:e=>{t(tY(e)),e.infill_methods.includes("patchmatch")||t(jte(e.infill_methods[0]))},onModelChanged:e=>{const{model_name:n,model_list:r}=e;t(aY(r)),t(eY("Model Changed")),t($Z(!1)),t(sY(!0)),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Model changed: ${n}`,level:"info"}))},onModelChangeFailed:e=>{const{model_name:n,model_list:r}=e;t(aY(r)),t($Z(!1)),t(sY(!0)),t(oY()),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Model change failed: ${n}`,level:"error"}))},onTempFolderEmptied:()=>{t(hY({title:"Temp Folder Emptied",status:"success",duration:2500,isClosable:!0}))}}})(e),{emitGenerateImage:y,emitRunESRGAN:x,emitRunFacetool:w,emitDeleteImage:S,emitRequestImages:k,emitRequestNewImages:C,emitCancelProcessing:_,emitRequestSystemConfig:E,emitRequestModelChange:L,emitSaveStagingAreaImageToGallery:P,emitRequestEmptyTempFolder:M}=((e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:e=>{n($Z(!0));const o=r(),{options:i,system:a,canvas:s}=o,l={generationMode:e,optionsState:i,canvasState:s,systemState:a};n(dY());const{generationParameters:c,esrganParameters:u,facetoolParameters:d}=Zre(l);t.emit("generateImage",c,u,d),c.init_mask&&(c.init_mask=c.init_mask.substr(0,64).concat("...")),c.init_img&&(c.init_img=c.init_img.substr(0,64).concat("...")),n(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...c,...u,...d})}`}))},emitRunESRGAN:e=>{n($Z(!0));const o=r().options,{upscalingLevel:i,upscalingStrength:a}=o,s={upscale:[i,a]};t.emit("runPostprocessing",e,{type:"esrgan",...s}),n(qZ({timestamp:jre(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:e.url,...s})}`}))},emitRunFacetool:e=>{n($Z(!0));const o=r().options,{facetoolType:i,facetoolStrength:a,codeformerFidelity:s}=o,l={facetool_strength:a};"codeformer"===i&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",e,{type:i,...l}),n(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Face restoration (${i}) requested: ${JSON.stringify({file:e.url,...l})}`}))},emitDeleteImage:e=>{const{url:r,uuid:o,category:i,thumbnail:a}=e;n(XQ(e)),t.emit("deleteImage",r,a,o,i)},emitRequestImages:e=>{const n=r().gallery,{earliest_mtime:o}=n.categories[e];t.emit("requestImages",e,o)},emitRequestNewImages:e=>{const n=r().gallery,{latest_mtime:o}=n.categories[e];t.emit("requestLatestImages",e,o)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitRequestModelChange:e=>{n(lY()),t.emit("requestModelChange",e)},emitSaveStagingAreaImageToGallery:e=>{t.emit("requestSaveStagingAreaImageToGallery",e)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}})(e,t);switch(n||(t.on("connect",(()=>i())),t.on("disconnect",(()=>a())),t.on("error",(e=>s(e))),t.on("generationResult",(e=>c(e))),t.on("postprocessingResult",(e=>l(e))),t.on("intermediateResult",(e=>u(e))),t.on("progressUpdate",(e=>d(e))),t.on("galleryImages",(e=>h(e))),t.on("processingCanceled",(()=>{f()})),t.on("imageDeleted",(e=>{p(e)})),t.on("systemConfig",(e=>{g(e)})),t.on("modelChanged",(e=>{m(e)})),t.on("modelChangeFailed",(e=>{v(e)})),t.on("tempFolderEmptied",(()=>{b()})),n=!0),o.type){case"socketio/generateImage":y(o.payload);break;case"socketio/runESRGAN":x(o.payload);break;case"socketio/runFacetool":w(o.payload);break;case"socketio/deleteImage":S(o.payload);break;case"socketio/requestImages":k(o.payload);break;case"socketio/requestNewImages":C(o.payload);break;case"socketio/cancelProcessing":_();break;case"socketio/requestSystemConfig":E();break;case"socketio/requestModelChange":L(o.payload);break;case"socketio/saveStagingAreaImageToGallery":P(o.payload);break;case"socketio/requestEmptyTempFolder":M()}r(o)}},Xre=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map((e=>`canvas.${e}`)),Kre=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps"].map((e=>`system.${e}`)),Qre=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map((e=>`gallery.${e}`)),Jre=tU({options:kne,gallery:hJ,system:gY,canvas:NQ}),eoe=function(e,t){var n=void 0!==e.version?e.version:-1;e.debug;var r=void 0===e.stateReconciler?ZV:e.stateReconciler,o=e.getStoredState||KV,i=void 0!==e.timeout?e.timeout:5e3,a=null,s=!1,l=!0,c=function(e){return e._persist.rehydrated&&a&&!l&&a.update(e),e};return function(u,d){var h=u||{},f=h._persist,p=rG(h,["_persist"]);if(d.type===WV){var g=!1,m=function(t,n){g||(d.rehydrate(e.key,t,n),g=!0)};if(i&&setTimeout((function(){!g&&m(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))}),i),l=!1,a||(a=YV(e)),f)return tG({},t(p,d),{_persist:f});if("function"!=typeof d.rehydrate||"function"!=typeof d.register)throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return d.register(e.key),o(e).then((function(t){var r=e.migrate||function(e,t){return Promise.resolve(e)};r(t,n).then((function(e){m(e)}),(function(e){m(void 0,e)}))}),(function(e){m(void 0,e)})),tG({},t(p,d),{_persist:{version:n,rehydrated:!1}})}if(d.type===UV)return s=!0,d.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:BV).concat(e.key);return t.removeItem(n,JV)}(e)),tG({},t(p,d),{_persist:f});if(d.type===FV)return d.result(a&&a.flush()),tG({},t(p,d),{_persist:f});if(d.type===HV)l=!0;else if(d.type===jV){if(s)return tG({},p,{_persist:tG({},f,{rehydrated:!0})});if(d.key===e.key){var v=t(p,d),b=d.payload,y=tG({},!1!==r&&void 0!==b?r(b,u,v,e):v,{_persist:tG({},f,{rehydrated:!0})});return c(y)}}if(!f)return t(u,d);var x=t(p,d);return x===p?u:c(tG({},x,{_persist:f}))}}(yG.getPersistConfig({key:"root",storage:vG,rootReducer:Jre,blacklist:[...Xre,...Kre,...Qre],debounce:300}),Jre),toe=function(e){var t,n=PU(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,l=r.devTools,c=void 0===l||l,u=r.preloadedState,d=void 0===u?void 0:u,h=r.enhancers,f=void 0===h?void 0:h;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=tU(i)}var p=s;"function"==typeof p&&(p=p(n));var g=rU.apply(void 0,p),m=nU;c&&(m=_U(kU({trace:!1},"object"==typeof c&&c)));var v=[g];return Array.isArray(f)?v=gU([g],f):"function"==typeof f&&(v=f(v)),eU(t,d,m.apply(void 0,v))}({reducer:eoe,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(Yre()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),noe=DV,roe=dV;function ooe(e){return ooe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ooe(e)}function ioe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aoe(e,t){for(var n=0;nsd(kI,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:sd(dT,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),poe=cU((e=>e.system),(e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),goe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=roe(poe),o=t?Math.round(100*t/n):0;return sd(JF,{value:o,isIndeterminate:e&&!r,className:"progress-bar"})};function moe(e){const{title:t,hotkey:n,description:r}=e;return ld("div",{className:"hotkey-modal-item",children:[ld("div",{className:"hotkey-info",children:[sd("p",{className:"hotkey-title",children:t}),r&&sd("p",{className:"hotkey-description",children:r})]}),sd("div",{className:"hotkey-key",children:n})]})}function voe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=KO(),o=e=>{const t=[];return e.forEach(((e,n)=>{t.push(sd(moe,{title:e.title,description:e.desc,hotkey:e.hotkey},n))})),sd("div",{className:"hotkey-modal-category",children:t})};return ld(ad,{children:[i.exports.cloneElement(e,{onClick:n}),ld(IB,{isOpen:t,onClose:r,children:[sd(GB,{}),ld(HB,{className:" modal hotkeys-modal",children:[sd(NB,{className:"modal-close-btn"}),sd("h1",{children:"Keyboard Shorcuts"}),sd("div",{className:"hotkeys-modal-items",children:ld(cT,{allowMultiple:!0,children:[ld(sT,{children:[ld(tT,{className:"hotkeys-modal-button",children:[sd("h2",{children:"App Hotkeys"}),sd(aT,{})]}),sd(lT,{children:o([{title:"Invoke",desc:"Generate an image",hotkey:"Ctrl+Enter"},{title:"Cancel",desc:"Cancel image generation",hotkey:"Shift+X"},{title:"Focus Prompt",desc:"Focus the prompt input area",hotkey:"Alt+A"},{title:"Toggle Options",desc:"Open and close the options panel",hotkey:"O"},{title:"Pin Options",desc:"Pin the options panel",hotkey:"Shift+O"},{title:"Toggle Viewer",desc:"Open and close Image Viewer",hotkey:"Z"},{title:"Toggle Gallery",desc:"Open and close the gallery drawer",hotkey:"G"},{title:"Maximize Workspace",desc:"Close panels and maximize work area",hotkey:"F"},{title:"Change Tabs",desc:"Switch to another workspace",hotkey:"1-5"},{title:"Console Toggle",desc:"Open and close console",hotkey:"`"}])})]}),ld(sT,{children:[ld(tT,{className:"hotkeys-modal-button",children:[sd("h2",{children:"General Hotkeys"}),sd(aT,{})]}),sd(lT,{children:o([{title:"Set Prompt",desc:"Use the prompt of the current image",hotkey:"P"},{title:"Set Seed",desc:"Use the seed of the current image",hotkey:"S"},{title:"Set Parameters",desc:"Use all parameters of the current image",hotkey:"A"},{title:"Restore Faces",desc:"Restore the current image",hotkey:"R"},{title:"Upscale",desc:"Upscale the current image",hotkey:"U"},{title:"Show Info",desc:"Show metadata info of the current image",hotkey:"I"},{title:"Send To Image To Image",desc:"Send current image to Image to Image",hotkey:"Shift+I"},{title:"Delete Image",desc:"Delete the current image",hotkey:"Del"},{title:"Close Panels",desc:"Closes open panels",hotkey:"Esc"}])})]}),ld(sT,{children:[ld(tT,{className:"hotkeys-modal-button",children:[sd("h2",{children:"Gallery Hotkeys"}),sd(aT,{})]}),sd(lT,{children:o([{title:"Previous Image",desc:"Display the previous image in gallery",hotkey:"Arrow Left"},{title:"Next Image",desc:"Display the next image in gallery",hotkey:"Arrow Right"},{title:"Toggle Gallery Pin",desc:"Pins and unpins the gallery to the UI",hotkey:"Shift+G"},{title:"Increase Gallery Image Size",desc:"Increases gallery thumbnails size",hotkey:"Shift+Up"},{title:"Decrease Gallery Image Size",desc:"Decreases gallery thumbnails size",hotkey:"Shift+Down"}])})]}),ld(sT,{children:[ld(tT,{className:"hotkeys-modal-button",children:[sd("h2",{children:"Unified Canvas Hotkeys"}),sd(aT,{})]}),sd(lT,{children:o([{title:"Select Brush",desc:"Selects the canvas brush",hotkey:"B"},{title:"Select Eraser",desc:"Selects the canvas eraser",hotkey:"E"},{title:"Decrease Brush Size",desc:"Decreases the size of the canvas brush/eraser",hotkey:"["},{title:"Increase Brush Size",desc:"Increases the size of the canvas brush/eraser",hotkey:"]"},{title:"Decrease Brush Opacity",desc:"Decreases the opacity of the canvas brush",hotkey:"Shift + ["},{title:"Increase Brush Opacity",desc:"Increases the opacity of the canvas brush",hotkey:"Shift + ]"},{title:"Move Tool",desc:"Allows canvas navigation",hotkey:"V"},{title:"Fill Bounding Box",desc:"Fills the bounding box with brush color",hotkey:"Shift + F"},{title:"Erase Bounding Box",desc:"Erases the bounding box area",hotkey:"Delete / Backspace"},{title:"Select Color Picker",desc:"Selects the canvas color picker",hotkey:"C"},{title:"Toggle Snap",desc:"Toggles Snap to Grid",hotkey:"N"},{title:"Quick Toggle Move",desc:"Temporarily toggles Move mode",hotkey:"Hold Space"},{title:"Toggle Layer",desc:"Toggles mask/base layer selection",hotkey:"Q"},{title:"Clear Mask",desc:"Clear the entire mask",hotkey:"Shift+C"},{title:"Hide Mask",desc:"Hide and unhide mask",hotkey:"H"},{title:"Show/Hide Bounding Box",desc:"Toggle visibility of bounding box",hotkey:"Shift+H"},{title:"Merge Visible",desc:"Merge all visible layers of canvas",hotkey:"Shift+M"},{title:"Save To Gallery",desc:"Save current canvas to gallery",hotkey:"Shift+S"},{title:"Copy to Clipboard",desc:"Copy current canvas to clipboard",hotkey:"Ctrl+C"},{title:"Download Image",desc:"Download current canvas",hotkey:"Shift+D"},{title:"Undo Stroke",desc:"Undo a brush stroke",hotkey:"Ctrl+Z"},{title:"Redo Stroke",desc:"Redo a brush stroke",hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:"Reset View",desc:"Reset Canvas View",hotkey:"R"},{title:"Previous Image",desc:"Previous Staging Area Image",hotkey:"Arrow Left"},{title:"Next Image",desc:"Next Staging Area Image",hotkey:"Arrow Right"},{title:"Accept Image",desc:"Accept Current Staging Area Image",hotkey:"Enter"}])})]})]})})]})]})]})}const boe=e=>{const{isProcessing:t,isConnected:n}=roe((e=>e.system)),r=noe(),{name:o,status:i,description:a}=e;return ld("div",{className:"model-list-item",children:[sd(qH,{label:a,hasArrow:!0,placement:"bottom",children:sd("div",{className:"model-list-item-name",children:o})}),sd(DI,{}),sd("div",{className:`model-list-item-status ${i.split(" ").join("-")}`,children:i}),sd("div",{className:"model-list-item-load-btn",children:sd(IT,{size:"sm",onClick:()=>{r(zX(o))},isDisabled:"active"===i||t||!n,children:"Load"})})]})},yoe=cU((e=>e.system),(e=>{const t=LG.map(e.model_list,((e,t)=>({name:t,...e}))),n=t.find((e=>"active"===e.status));return{models:t,activeModel:n}})),xoe=()=>{const{models:e}=roe(yoe);return sd(cT,{allowToggle:!0,className:"model-list-accordion",variant:"unstyled",children:ld(sT,{children:[sd(tT,{children:ld("div",{className:"model-list-button",children:[sd("h2",{children:"Models"}),sd(aT,{})]})}),sd(lT,{children:sd("div",{className:"model-list-list",children:e.map(((e,t)=>sd(boe,{name:e.name,status:e.status,description:e.description},t)))})})]})})},woe=cU([bX,NZ],((e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,model_list:i,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:LG.map(i,((e,t)=>t)),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}}),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),Soe=({children:e})=>{const t=noe(),n=roe((e=>e.options.steps)),{isOpen:r,onOpen:o,onClose:a}=KO(),{isOpen:s,onOpen:l,onClose:c}=KO(),{shouldDisplayInProgressType:u,shouldConfirmOnDelete:d,shouldDisplayGuides:h,saveIntermediatesInterval:f,enableImageDebugging:p,shouldUseCanvasBetaLayout:g}=roe(woe);return ld(ad,{children:[i.exports.cloneElement(e,{onClick:o}),ld(IB,{isOpen:r,onClose:a,children:[sd(GB,{}),ld(HB,{className:"modal settings-modal",children:[sd(UB,{className:"settings-modal-header",children:"Settings"}),sd(NB,{className:"modal-close-btn"}),ld(RB,{className:"settings-modal-content",children:[ld("div",{className:"settings-modal-items",children:[sd("div",{className:"settings-modal-item",children:sd(xoe,{})}),ld("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[sd(Bq,{label:"Display In-Progress Images",validValues:Gq,value:u,onChange:e=>t(GZ(e.target.value))}),"full-res"===u&&sd(zq,{label:"Save images every n steps",min:1,max:n,step:1,onChange:e=>{e>n&&(e=n),e<1&&(e=1),t(cY(e))},value:f,width:"auto",textAlign:"center"})]}),sd(Yq,{styleClass:"settings-modal-item",label:"Confirm on Delete",isChecked:d,onChange:e=>t(KZ(e.target.checked))}),sd(Yq,{styleClass:"settings-modal-item",label:"Display Help Icons",isChecked:h,onChange:e=>t(nY(e.target.checked))}),sd(Yq,{styleClass:"settings-modal-item",label:"Use Canvas Beta Layout",isChecked:g,onChange:e=>t(Sne(e.target.checked))})]}),ld("div",{className:"settings-modal-items",children:[sd("h2",{style:{fontWeight:"bold"},children:"Developer"}),sd(Yq,{styleClass:"settings-modal-item",label:"Enable Image Debugging",isChecked:p,onChange:e=>t(uY(e.target.checked))})]}),ld("div",{className:"settings-modal-reset",children:[sd(LI,{size:"md",children:"Reset Web UI"}),sd(IT,{colorScheme:"red",onClick:()=>{Zie.purge().then((()=>{a(),l()}))},children:"Reset Web UI"}),sd(WI,{children:"Resetting the web UI only resets the browser's local cache of your images and remembered settings. It does not delete any images from disk."}),sd(WI,{children:"If images aren't showing up in the gallery or something else isn't working, please try resetting before submitting an issue on GitHub."})]})]}),sd(WB,{children:sd(IT,{onClick:a,className:"modal-close-btn",children:"Close"})})]})]}),ld(IB,{closeOnOverlayClick:!1,isOpen:s,onClose:c,isCentered:!0,children:[sd(GB,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),sd(HB,{children:sd(RB,{pb:6,pt:6,children:sd(kI,{justifyContent:"center",children:sd(WI,{fontSize:"lg",children:"Web UI has been reset. Refresh the page to reload."})})})})]})]})},koe=cU((e=>e.system),(e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),Coe=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:i,wasErrorSeen:a}=roe(koe),s=noe();let l;l=e&&!i?"status-good":"status-bad";let c=o;["generating","preparing","saving image","restoring faces","upscaling"].includes(c.toLowerCase())&&(l="status-working"),c&&t&&r>1&&(c+=` (${n}/${r})`);return sd(qH,{label:i&&!a?"Click to clear, check logs for details":void 0,children:sd(WI,{cursor:i&&!a?"pointer":"initial",onClick:()=>{!i&&a||s(iY())},className:`status ${l}`,children:c})})},_oe=["dark","light","green"];function Eoe(){const{setColorMode:e}=ud(),t=noe(),n=roe((e=>e.options.currentTheme));return sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{"aria-label":"Theme",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:sd(tX,{})}),children:sd(HI,{align:"stretch",children:_oe.map((r=>sd(jX,{style:{width:"6rem"},leftIcon:n===r?sd(DY,{}):void 0,size:"sm",onClick:()=>(n=>{e(n),t(Rte(n))})(r),children:r.charAt(0).toUpperCase()+r.slice(1)},r)))})})}const Loe=cU([bX],(e=>{const{isProcessing:t,model_list:n}=e,r=LG.map(n,((e,t)=>t)),o=LG.reduce(n,((e,t,n)=>("active"===t.status&&(e=n),e)),"");return{models:r,activeModel:o,isProcessing:t,activeDesc:n[o].description}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Poe=()=>{const e=noe(),{models:t,activeModel:n,isProcessing:r,activeDesc:o}=roe(Loe);return sd(kI,{style:{paddingLeft:"0.3rem"},children:sd(Bq,{style:{fontSize:"0.8rem"},tooltip:o,isDisabled:r,value:n,validValues:t,onChange:t=>{e(zX(t.target.value))}})})},Moe=()=>ld("div",{className:"site-header",children:[ld("div",{className:"site-header-left-side",children:[sd("img",{src:DQ,alt:"invoke-ai-logo"}),ld("h1",{children:["invoke ",sd("strong",{children:"ai"})]})]}),ld("div",{className:"site-header-right-side",children:[sd(Coe,{}),sd(Poe,{}),sd(voe,{children:sd(dZ,{"aria-label":"Hotkeys",tooltip:"Hotkeys",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:sd(XY,{})})}),sd(Eoe,{}),sd(dZ,{"aria-label":"Report Bug",tooltip:"Report Bug",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:sd(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:sd(NY,{})})}),sd(dZ,{"aria-label":"Link to Github Repo",tooltip:"Github",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:sd(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:sd(LY,{})})}),sd(dZ,{"aria-label":"Link to Discord Server",tooltip:"Discord",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:sd(MI,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:sd(EY,{})})}),sd(Soe,{children:sd(dZ,{"aria-label":"Settings",tooltip:"Settings",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:sd(vX,{})})})]})]}),Aoe=cU((e=>e.system),(e=>e.log),{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),Toe=cU((e=>e.system),(e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),Ooe=()=>{const e=noe(),t=roe(Aoe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:o}=roe(Toe),[a,s]=i.exports.useState(!0),l=i.exports.useRef(null);i.exports.useLayoutEffect((()=>{null!==l.current&&a&&(l.current.scrollTop=l.current.scrollHeight)}),[a,t,n]);Eq("`",(()=>{e(ZZ(!n))}),[n]),Eq("esc",(()=>{e(ZZ(!1))}));return ld(ad,{children:[n&&sd(VJ,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:sd("div",{className:"console",ref:l,onScroll:()=>{l.current&&a&&l.current.scrollTop{const{timestamp:n,message:r,level:o}=e;return ld("div",{className:`console-entry console-${o}-color`,children:[ld("p",{className:"console-timestamp",children:[n,":"]}),sd("p",{className:"console-message",children:r})]},t)}))})}),n&&sd(qH,{hasArrow:!0,label:a?"Autoscroll On":"Autoscroll Off",children:sd(DT,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":a,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:sd(PY,{}),onClick:()=>s(!a)})}),sd(qH,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:sd(DT,{className:"console-toggle-icon-button","data-error-seen":r||!o,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:sd(n?JY:zY,{}),onClick:()=>{e(iY()),e(ZZ(!n))}})})]})};var Ioe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Roe(e,t){var n=function(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=Ioe.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!=typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"==typeof t?t:"string"==typeof r&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var Noe=[".DS_Store","Thumbs.db"];function Doe(e){return"object"==typeof e&&null!==e}function zoe(e){return Hoe(e.target.files).map((function(e){return Roe(e)}))}function Boe(e){return pA(this,void 0,void 0,(function(){return gA(this,(function(t){switch(t.label){case 0:return[4,Promise.all(e.map((function(e){return e.getFile()})))];case 1:return[2,t.sent().map((function(e){return Roe(e)}))]}}))}))}function Foe(e,t){return pA(this,void 0,void 0,(function(){var n;return gA(this,(function(r){switch(r.label){case 0:return e.items?(n=Hoe(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(Woe))]):[3,2];case 1:return[2,joe(Uoe(r.sent()))];case 2:return[2,joe(Hoe(e.files).map((function(e){return Roe(e)})))]}}))}))}function joe(e){return e.filter((function(e){return-1===Noe.indexOf(e.name)}))}function Hoe(e){if(null===e)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,nie(n)];if(e.sizen)return[!1,nie(n)]}return[!0,null]}function sie(e){return null!=e}function lie(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,s=e.validator;return!(!i&&t.length>1||i&&a>=1&&t.length>a)&&t.every((function(e){var t=Qoe(iie(e,n),1)[0],i=Qoe(aie(e,r,o),1)[0],a=s?s(e):null;return t&&i&&!a}))}function cie(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function uie(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,(function(e){return"Files"===e||"application/x-moz-file"===e})):!!e.target&&!!e.target.files}function die(e){e.preventDefault()}function hie(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function fie(e){return-1!==e.indexOf("Edge/")}function pie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return hie(e)||fie(e)}function gie(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Nie=i.exports.forwardRef((function(e,t){var n=e.children,r=Bie(Rie(e,kie)),o=r.open,a=Rie(r,Cie);return i.exports.useImperativeHandle(t,(function(){return{open:o}}),[o]),sd(i.exports.Fragment,{children:n(Oie(Oie({},a),{},{open:o}))})}));Nie.displayName="Dropzone";var Die={disabled:!1,getFilesFromEvent:function(e){return pA(this,void 0,void 0,(function(){return gA(this,(function(t){return Doe(e)&&function(e){return Doe(e)}(e.dataTransfer)?[2,Foe(e.dataTransfer,e.type)]:function(e){return Doe(e)&&Doe(e.target)}(e)?[2,zoe(e)]:Array.isArray(e)&&e.every((function(e){return"getFile"in e&&"function"==typeof e.getFile}))?[2,Boe(e)]:[2,[]]}))}))},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};Nie.defaultProps=Die,Nie.propTypes={children:gD.exports.func,accept:gD.exports.objectOf(gD.exports.arrayOf(gD.exports.string)),multiple:gD.exports.bool,preventDropOnDocument:gD.exports.bool,noClick:gD.exports.bool,noKeyboard:gD.exports.bool,noDrag:gD.exports.bool,noDragEventsBubbling:gD.exports.bool,minSize:gD.exports.number,maxSize:gD.exports.number,maxFiles:gD.exports.number,disabled:gD.exports.bool,getFilesFromEvent:gD.exports.func,onFileDialogCancel:gD.exports.func,onFileDialogOpen:gD.exports.func,useFsAccessApi:gD.exports.bool,autoFocus:gD.exports.bool,onDragEnter:gD.exports.func,onDragLeave:gD.exports.func,onDragOver:gD.exports.func,onDrop:gD.exports.func,onDropAccepted:gD.exports.func,onDropRejected:gD.exports.func,onError:gD.exports.func,validator:gD.exports.func};var zie={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Bie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Oie(Oie({},Die),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,a=t.maxSize,s=t.minSize,l=t.multiple,c=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,f=t.onDrop,p=t.onDropAccepted,g=t.onDropRejected,m=t.onFileDialogCancel,v=t.onFileDialogOpen,b=t.useFsAccessApi,y=t.autoFocus,x=t.preventDropOnDocument,w=t.noClick,S=t.noKeyboard,k=t.noDrag,C=t.noDragEventsBubbling,_=t.onError,E=t.validator,L=i.exports.useMemo((function(){return bie(n)}),[n]),P=i.exports.useMemo((function(){return vie(n)}),[n]),M=i.exports.useMemo((function(){return"function"==typeof v?v:jie}),[v]),A=i.exports.useMemo((function(){return"function"==typeof m?m:jie}),[m]),T=i.exports.useRef(null),O=i.exports.useRef(null),I=i.exports.useReducer(Fie,zie),R=Pie(I,2),N=R[0],D=R[1],z=N.isFocused,B=N.isFileDialogActive,F=i.exports.useRef("undefined"!=typeof window&&window.isSecureContext&&b&&mie()),j=function(){!F.current&&B&&setTimeout((function(){O.current&&(O.current.files.length||(D({type:"closeDialog"}),A()))}),300)};i.exports.useEffect((function(){return window.addEventListener("focus",j,!1),function(){window.removeEventListener("focus",j,!1)}}),[O,B,A,F]);var H=i.exports.useRef([]),W=function(e){T.current&&T.current.contains(e.target)||(e.preventDefault(),H.current=[])};i.exports.useEffect((function(){return x&&(document.addEventListener("dragover",die,!1),document.addEventListener("drop",W,!1)),function(){x&&(document.removeEventListener("dragover",die),document.removeEventListener("drop",W))}}),[T,x]),i.exports.useEffect((function(){return!r&&y&&T.current&&T.current.focus(),function(){}}),[T,y,r]);var U=i.exports.useCallback((function(e){_?_(e):console.error(e)}),[_]),V=i.exports.useCallback((function(e){e.preventDefault(),e.persist(),re(e),H.current=[].concat(Lie(H.current),[e.target]),uie(e)&&Promise.resolve(o(e)).then((function(t){if(!cie(e)||C){var n=t.length,r=n>0&&lie({files:t,accept:L,minSize:s,maxSize:a,multiple:l,maxFiles:c,validator:E});D({isDragAccept:r,isDragReject:n>0&&!r,isDragActive:!0,type:"setDraggedFiles"}),u&&u(e)}})).catch((function(e){return U(e)}))}),[o,u,U,C,L,s,a,l,c,E]),G=i.exports.useCallback((function(e){e.preventDefault(),e.persist(),re(e);var t=uie(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(n){}return t&&h&&h(e),!1}),[h,C]),$=i.exports.useCallback((function(e){e.preventDefault(),e.persist(),re(e);var t=H.current.filter((function(e){return T.current&&T.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),H.current=t,t.length>0||(D({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uie(e)&&d&&d(e))}),[T,d,C]),q=i.exports.useCallback((function(e,t){var n=[],r=[];e.forEach((function(e){var t=Pie(iie(e,L),2),o=t[0],i=t[1],l=Pie(aie(e,s,a),2),c=l[0],u=l[1],d=E?E(e):null;if(o&&c&&!d)n.push(e);else{var h=[i,u];d&&(h=h.concat(d)),r.push({file:e,errors:h.filter((function(e){return e}))})}})),(!l&&n.length>1||l&&c>=1&&n.length>c)&&(n.forEach((function(e){r.push({file:e,errors:[oie]})})),n.splice(0)),D({acceptedFiles:n,fileRejections:r,type:"setFiles"}),f&&f(n,r,t),r.length>0&&g&&g(r,t),n.length>0&&p&&p(n,t)}),[D,l,L,s,a,c,f,p,g,E]),Z=i.exports.useCallback((function(e){e.preventDefault(),e.persist(),re(e),H.current=[],uie(e)&&Promise.resolve(o(e)).then((function(t){cie(e)&&!C||q(t,e)})).catch((function(e){return U(e)})),D({type:"reset"})}),[o,q,U,C]),Y=i.exports.useCallback((function(){if(F.current){D({type:"openDialog"}),M();var e={multiple:l,types:P};window.showOpenFilePicker(e).then((function(e){return o(e)})).then((function(e){q(e,null),D({type:"closeDialog"})})).catch((function(e){yie(e)?(A(e),D({type:"closeDialog"})):xie(e)?(F.current=!1,O.current?(O.current.value=null,O.current.click()):U(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):U(e)}))}else O.current&&(D({type:"openDialog"}),M(),O.current.value=null,O.current.click())}),[D,M,A,b,q,U,P,l]),X=i.exports.useCallback((function(e){T.current&&T.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),Y()))}),[T,Y]),K=i.exports.useCallback((function(){D({type:"focus"})}),[]),Q=i.exports.useCallback((function(){D({type:"blur"})}),[]),J=i.exports.useCallback((function(){w||(pie()?setTimeout(Y,0):Y())}),[w,Y]),ee=function(e){return r?null:e},te=function(e){return S?null:ee(e)},ne=function(e){return k?null:ee(e)},re=function(e){C&&e.stopPropagation()},oe=i.exports.useMemo((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,o=e.role,i=e.onKeyDown,a=e.onFocus,s=e.onBlur,l=e.onClick,c=e.onDragEnter,u=e.onDragOver,d=e.onDragLeave,h=e.onDrop,f=Rie(e,_ie);return Oie(Oie(Iie({onKeyDown:te(gie(i,X)),onFocus:te(gie(a,K)),onBlur:te(gie(s,Q)),onClick:ee(gie(l,J)),onDragEnter:ne(gie(c,V)),onDragOver:ne(gie(u,G)),onDragLeave:ne(gie(d,$)),onDrop:ne(gie(h,Z)),role:"string"==typeof o&&""!==o?o:"presentation"},n,T),r||S?{}:{tabIndex:0}),f)}}),[T,X,K,Q,J,V,G,$,Z,S,k,r]),ie=i.exports.useCallback((function(e){e.stopPropagation()}),[]),ae=i.exports.useMemo((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.onChange,o=e.onClick,i=Rie(e,Eie),a=Iie({accept:L,multiple:l,type:"file",style:{display:"none"},onChange:ee(gie(r,Z)),onClick:ee(gie(o,ie)),tabIndex:-1},n,O);return Oie(Oie({},a),i)}}),[O,n,l,Z,r]);return Oie(Oie({},N),{},{isFocused:z&&!r,getRootProps:oe,getInputProps:ae,rootRef:T,inputRef:O,open:ee(Y)})}function Fie(e,t){switch(t.type){case"focus":return Oie(Oie({},e),{},{isFocused:!0});case"blur":return Oie(Oie({},e),{},{isFocused:!1});case"openDialog":return Oie(Oie({},zie),{},{isFileDialogActive:!0});case"closeDialog":return Oie(Oie({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Oie(Oie({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Oie(Oie({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Oie({},zie);default:return e}}function jie(){}const Hie=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:o}=e;return Eq("esc",(()=>{o(!1)})),ld("div",{className:"dropzone-container",children:[t&&sd("div",{className:"dropzone-overlay is-drag-accept",children:ld(LI,{size:"lg",children:["Upload Image",r]})}),n&&ld("div",{className:"dropzone-overlay is-drag-reject",children:[sd(LI,{size:"lg",children:"Invalid Upload"}),sd(LI,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},Wie=e=>async(t,n)=>{const{imageFile:r}=e,o=n(),i=RZ(o),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const s=await fetch(window.location.origin+"/upload",{method:"POST",body:a}),l=await s.json();console.log(l);const c={uuid:_ee(),category:"user",...l};t(ZQ({image:c,category:"user"})),"unifiedCanvas"===i?t(QK(c)):"img2img"===i&&t(Hte(c))},Uie=e=>{const{children:t}=e,n=noe(),r=roe(RZ),o=DH({}),[a,s]=i.exports.useState(!1),{setOpenUploader:l}=Tee(),c=i.exports.useCallback((e=>{s(!0);const t=e.errors.reduce(((e,t)=>e+"\n"+t.message),"");o({title:"Upload failed",description:t,status:"error",isClosable:!0})}),[o]),u=i.exports.useCallback((async e=>{n(Wie({imageFile:e}))}),[n]),d=i.exports.useCallback(((e,t)=>{t.forEach((e=>{c(e)})),e.forEach((e=>{u(e)}))}),[u,c]),{getRootProps:h,getInputProps:f,isDragAccept:p,isDragReject:g,isDragActive:m,open:v}=Bie({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:d,onDragOver:()=>s(!0),maxFiles:1});l(v),i.exports.useEffect((()=>{const e=e=>{const t=e.clipboardData?.items;if(!t)return;const r=[];for(const n of t)"file"===n.kind&&["image/png","image/jpg"].includes(n.type)&&r.push(n);if(!r.length)return;if(e.stopImmediatePropagation(),r.length>1)return void o({description:"Multiple images pasted, may only upload one image at a time",status:"error",isClosable:!0});const i=r[0].getAsFile();i?n(Wie({imageFile:i})):o({description:"Unable to load file",status:"error",isClosable:!0})};return document.addEventListener("paste",e),()=>{document.removeEventListener("paste",e)}}),[n,o,r]);const b=["img2img","unifiedCanvas"].includes(r)?` to ${xte[r].tooltip}`:"";return sd(jQ.Provider,{value:v,children:ld("div",{...h({style:{}}),onKeyDown:e=>{e.key},children:[sd("input",{...f()}),t,m&&a&&sd(Hie,{isDragAccept:p,isDragReject:g,overlaySecondaryText:b,setIsHandlingUpload:s})]})})},Vie=cU([e=>e.options,e=>e.gallery,RZ],((e,t,n)=>{const{shouldPinOptionsPanel:r,shouldShowOptionsPanel:o,shouldHoldOptionsPanelOpen:i,shouldUseCanvasBetaLayout:a}=e,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:c}=t,u=a&&"unifiedCanvas"===n;return{shouldPinOptionsPanel:r,shouldShowProcessButtons:!(u||r&&o),shouldShowOptionsPanelButton:!u&&!(o||i&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),shouldShowOptionsPanel:o,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:!(s||c&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n)}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Gie=()=>{const e=noe(),{shouldShowOptionsPanel:t,shouldShowOptionsPanelButton:n,shouldShowProcessButtons:r,shouldPinOptionsPanel:o,shouldShowGallery:i,shouldPinGallery:a}=roe(Vie);return Eq("f",(()=>{i||t?(e(hne(!1)),e(rJ(!1))):(e(hne(!0)),e(rJ(!0))),(a||o)&&setTimeout((()=>e(KK(!0))),400)}),[i,t]),n?ld("div",{className:"show-hide-button-options",children:[sd(dZ,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:()=>{e(hne(!0)),o&&setTimeout((()=>e(KK(!0))),400)},children:sd(dX,{})}),r&&ld(ad,{children:[sd(HX,{iconButton:!0}),sd(UX,{})]})]}):null},$ie=()=>{const e=noe(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowOptionsPanel:o,shouldPinOptionsPanel:i}=roe(Vie);return Eq("f",(()=>{t||o?(e(hne(!1)),e(rJ(!1))):(e(hne(!0)),e(rJ(!0))),(r||i)&&setTimeout((()=>e(KK(!0))),400)}),[t,o]),n?sd(dZ,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:()=>{e(rJ(!0)),r&&e(KK(!0))},children:sd(bY,{})}):null};!function(){const e=()=>{(async function(e=""){return await fetch(e,{method:"GET",cache:"no-cache"})})(document.location+"/flaskwebgui-keep-server-alive").then((e=>e))};({BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}).NODE_ENV&&"production"!=={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV||document.addEventListener("DOMContentLoaded",(()=>{e(),setInterval(e,3e3)}))}();const qie=()=>((()=>{const e=noe(),t=roe(yX),n=DH();i.exports.useEffect((()=>{t.forEach((e=>{n(e)})),t.length>0&&e(fY())}),[e,n,t])})(),ld("div",{className:"App",children:[ld(Uie,{children:[sd(goe,{}),ld("div",{className:"app-content",children:[sd(Moe,{}),sd(Ste,{})]}),sd("div",{className:"app-console",children:sd(Ooe,{})})]}),sd(Gie,{}),sd($ie,{})]})),Zie=function(e,t,n){var r=n||!1,o=eU(cG,lG,t&&t.enhancer?t.enhancer:void 0),i=function(e){o.dispatch({type:VV,key:e})},a=function(t,n,i){var a={type:jV,payload:n,err:i,key:t};e.dispatch(a),o.dispatch(a),r&&s.getState().bootstrapped&&(r(),r=!1)},s=aG({},o,{purge:function(){var t=[];return e.dispatch({type:UV,result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:FV,result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:HV})},persist:function(){e.dispatch({type:WV,register:i,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}(toe),Yie=gp({key:"invokeai-style-cache",prepend:!0});W.createRoot(document.getElementById("root")).render(sd(j.StrictMode,{children:sd(OV,{store:toe,children:sd(hoe,{loading:sd(foe,{}),persistor:Zie,children:sd(ag,{value:Yie,children:sd(YH,{children:sd(qie,{})})})})})}))}}}))}(); +ConcurrentRoot:1,ContinuousEventPriority:4,DefaultEventPriority:16,DiscreteEventPriority:1,IdleEventPriority:536870912,LegacyRoot:0};!function(e){e.exports=a9}(i9);const s9={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let l9=!1,c9=!1;const u9=".react-konva-event",d9={};function h9(e,t,n=d9){if(!l9&&"zIndex"in t&&(console.warn('ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n'),l9=!0),!c9&&t.draggable){var r=void 0!==t.x||void 0!==t.y,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn("ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n"),c9=!0)}for(var i in n)if(!s9[i]){var a="on"===i.slice(0,2),s=n[i]!==t[i];if(a&&s)"content"===(f=i.substr(2).toLowerCase()).substr(0,7)&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[i]);!t.hasOwnProperty(i)&&e.setAttr(i,void 0)}var l=t._useStrictMode,c={},u=!1;const d={};for(var i in t)if(!s9[i]){a="on"===i.slice(0,2);var h=n[i]!==t[i];if(a&&h)"content"===(f=i.substr(2).toLowerCase()).substr(0,7)&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[i]&&(d[f]=t[i]);!a&&(t[i]!==n[i]||l&&t[i]!==e.getAttr(i))&&(u=!0,c[i]=t[i])}for(var f in u&&(e.setAttrs(c),f9(e)),d)e.on(f+u9,d[f])}function f9(e){if(!J3.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const p9={},g9={};K6.Node.prototype._applyProps=h9;const m9=setTimeout,v9=clearTimeout;function b9(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),f9(e)}const y9=Object.freeze(Object.defineProperty({__proto__:null,appendInitialChild:function(e,t){"string"!=typeof t?(e.add(t),f9(e)):console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`)},createInstance:function(e,t,n){let r=K6[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=K6.Group);const o={},i={};for(var a in t){"on"===a.slice(0,2)?i[a]=t[a]:o[a]=t[a]}const s=new r(o);return h9(s,i),s},createTextInstance:function(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)},finalizeInitialChildren:function(e,t,n){return!1},getPublicInstance:function(e){return e},prepareForCommit:function(){return null},preparePortalMount:function(){return null},prepareUpdate:function(e,t,n,r){return g9},resetAfterCommit:function(){},resetTextContent:function(e){},shouldDeprioritizeSubtree:function(e,t){return!1},getRootHostContext:function(){return p9},getChildHostContext:function(){return p9},scheduleTimeout:m9,cancelTimeout:v9,noTimeout:-1,shouldSetTextContent:function(e,t){return!1},isPrimaryRenderer:!1,warnsIfNotActing:!0,supportsMutation:!0,appendChild:function(e,t){t.parent===e?t.moveToTop():e.add(t),f9(e)},appendChildToContainer:function(e,t){t.parent===e?t.moveToTop():e.add(t),f9(e)},insertBefore:b9,insertInContainerBefore:function(e,t,n){b9(e,t,n)},removeChild:function(e,t){t.destroy(),t.off(u9),f9(e)},removeChildFromContainer:function(e,t){t.destroy(),t.off(u9),f9(e)},commitTextUpdate:function(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)},commitMount:function(e,t,n){},commitUpdate:function(e,t,n,r,o){h9(e,o,r)},hideInstance:function(e){e.hide(),f9(e)},hideTextInstance:function(e){},unhideInstance:function(e,t){(null==t.visible||t.visible)&&e.show()},unhideTextInstance:function(e,t){},clearContainer:function(e){},detachDeletedInstance:function(){},getCurrentEventPriority:()=>i9.exports.DefaultEventPriority,now:G.exports.unstable_now,idlePriority:G.exports.unstable_IdlePriority,run:G.exports.unstable_runWithPriority},Symbol.toStringTag,{value:"Module"}));var x9=Object.defineProperty,w9=Object.defineProperties,S9=Object.getOwnPropertyDescriptors,k9=Object.getOwnPropertySymbols,C9=Object.prototype.hasOwnProperty,_9=Object.prototype.propertyIsEnumerable,E9=(e,t,n)=>t in e?x9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L9=(e,t)=>{for(var n in t||(t={}))C9.call(t,n)&&E9(e,n,t[n]);if(k9)for(var n of k9(t))_9.call(t,n)&&E9(e,n,t[n]);return e};function P9(e,t,n){if(!e)return;if(!0===n(e))return e;let r=t?e.return:e.child;for(;r;){const e=P9(r,t,n);if(e)return e;r=t?null:r.sibling}}function M9(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(xq){return e}}const A9=M9(i.exports.createContext(null));class T9 extends i.exports.Component{render(){return sd(A9.Provider,{value:this._reactInternals,children:this.props.children})}}const{ReactCurrentOwner:O9,ReactCurrentDispatcher:I9}=i.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;const R9=[],N9=new WeakMap;function D9(){var e;const t=function(){const e=i.exports.useContext(A9);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=i.exports.useId(),n=i.exports.useMemo((()=>{var n;return null!=(n=O9.current)?n:P9(e,!1,(e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}}))}),[e,t]);return n}();R9.splice(0,R9.length),P9(t,!0,(e=>{var t;const n=null==(t=e.type)?void 0:t._context;n&&n!==A9&&R9.push(M9(n))}));for(const n of R9){const t=null==(e=I9.current)?void 0:e.readContext(n);N9.set(n,t)}return i.exports.useMemo((()=>R9.reduce(((e,t)=>n=>i.exports.createElement(e,null,i.exports.createElement(t.Provider,((e,t)=>w9(e,S9(t)))(L9({},n),{value:N9.get(t)})))),(e=>sd(T9,{...L9({},e)})))),[])}const z9=e=>{const t=j.useRef(),n=j.useRef(),r=j.useRef(),o=function(e){const t=j.useRef();return j.useLayoutEffect((()=>{t.current=e})),t.current}(e),i=D9(),a=t=>{const{forwardedRef:n}=e;n&&("function"==typeof n?n(t):n.current=t)};return j.useLayoutEffect((()=>(n.current=new K6.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=V9.createContainer(n.current,i9.exports.LegacyRoot,!1,null),V9.updateContainer(sd(i,{children:e.children}),r.current),()=>{K6.isBrowser&&(a(null),V9.updateContainer(null,r.current,null),n.current.destroy())})),[]),j.useLayoutEffect((()=>{a(n.current),h9(n.current,e,o),V9.updateContainer(sd(i,{children:e.children}),r.current,null)})),sd("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},B9="Layer",F9="Group",j9="Rect",H9="Circle",W9="Line",U9="Image",V9=o9(y9);V9.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:j.version,rendererPackageName:"react-konva"});const G9=j.forwardRef(((e,t)=>sd(T9,{children:sd(z9,{...e,forwardedRef:t})}))),$9=cU([_X],(e=>({objects:e.layerState.objects})),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),q9=e=>{const{...t}=e,{objects:n}=roe($9);return sd(F9,{listening:!1,...t,children:n.filter(SX).map(((e,t)=>sd(W9,{points:e.points,stroke:"rgb(0,0,0)",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"},t)))})},Z9=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},Y9=cU(_X,(e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:i,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:c,isTransformingBoundingBox:u,stageScale:d,stageDimensions:h,boundingBoxCoordinates:f,boundingBoxDimensions:p,shouldRestrictStrokesToBox:g}=e,m=g?{clipX:f.x,clipY:f.y,clipWidth:p.width,clipHeight:p.height}:{};return{cursorPosition:t,brushX:t?t.x:h.width/2,brushY:t?t.y:h.height/2,radius:n/2,colorPickerOuterRadius:30/d,colorPickerInnerRadius:21/d,maskColorString:Z9({...o,a:.5}),brushColorString:Z9(i),colorPickerColorString:Z9(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(c||u||!t)&&l,strokeWidth:1.5/d,dotRadius:1.5/d,clip:m}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),X9=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:i,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:c,strokeWidth:u,brushColorString:d,colorPickerColorString:h,colorPickerInnerRadius:f,colorPickerOuterRadius:p,clip:g}=roe(Y9);return l?ld(F9,{listening:!1,...g,...t,children:[ld(ad,"colorPicker"===a?{children:[sd(H9,{x:n,y:r,radius:p,stroke:d,strokeWidth:10,strokeScaleEnabled:!1}),sd(H9,{x:n,y:r,radius:f,stroke:h,strokeWidth:10,strokeScaleEnabled:!1})]}:{children:[sd(H9,{x:n,y:r,radius:o,fill:"mask"===s?i:d,globalCompositeOperation:"eraser"===a?"destination-out":"source-out"}),sd(H9,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:2*u,strokeEnabled:!0,listening:!1}),sd(H9,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:u,strokeEnabled:!0,listening:!1})]}),sd(H9,{x:n,y:r,radius:2*c,fill:"rgba(255,255,255,0.4)",listening:!1}),sd(H9,{x:n,y:r,radius:c,fill:"rgba(0,0,0,1)",listening:!1})]}):null},K9=cU(_X,(e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:o,isTransformingBoundingBox:i,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:i,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Q9=e=>{const{...t}=e,n=noe(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:a,isMovingBoundingBox:s,isTransformingBoundingBox:l,stageScale:c,shouldSnapToGrid:u,tool:d,hitStrokeWidth:h}=roe(K9),f=i.exports.useRef(null),p=i.exports.useRef(null),[g,m]=i.exports.useState(!1);i.exports.useEffect((()=>{f.current&&p.current&&(f.current.nodes([p.current]),f.current.getLayer()?.batchDraw())}),[]);const v=64*c,b=i.exports.useCallback((e=>{if(!u)return void n(WK({x:Math.floor(e.target.x()),y:Math.floor(e.target.y())}));const t=e.target.x(),r=e.target.y(),o=pK(t,64),i=pK(r,64);e.target.x(o),e.target.y(i),n(WK({x:o,y:i}))}),[n,u]),y=i.exports.useCallback((()=>{if(!p.current)return;const e=p.current,t=e.scaleX(),r=e.scaleY(),o=Math.round(e.width()*t),i=Math.round(e.height()*r),a=Math.round(e.x()),s=Math.round(e.y());n(UK({width:o,height:i})),n(WK({x:u?fK(a,64):a,y:u?fK(s,64):s})),e.scaleX(1),e.scaleY(1)}),[n,u]),x=i.exports.useCallback(((e,t,n)=>{const r=e.x%v,o=e.y%v;return{x:fK(t.x,v)+r,y:fK(t.y,v)+o}}),[v]),w=()=>{n(sQ(!1)),n(iQ(!1)),n(nQ(!1)),m(!1)},S=()=>{n(iQ(!0))},k=()=>{n(sQ(!1)),n(iQ(!1)),n(nQ(!1)),m(!1)},C=()=>{m(!0)},_=()=>{n(nQ(!0))},E=()=>{n(nQ(!1))};return ld(F9,{...t,children:[sd(j9,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:_,onMouseOver:_,onMouseLeave:E,onMouseOut:E}),sd(j9,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:h,listening:!a&&"move"===d,onDragStart:S,onDragEnd:k,onDragMove:b,onMouseDown:S,onMouseOut:()=>{!l&&!s&&m(!1)},onMouseOver:C,onMouseEnter:C,onMouseUp:k,onTransform:y,onTransformEnd:w,ref:p,stroke:g?"rgba(255,255,255,0.7)":"white",strokeWidth:(g?8:1)/c,width:o.width,x:r.x,y:r.y}),sd("Transformer",{anchorCornerRadius:3,anchorDragBoundFunc:x,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:"move"===d?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!a&&"move"===d,onDragStart:S,onDragEnd:k,onMouseDown:()=>{n(sQ(!0))},onMouseUp:w,onTransformEnd:w,ref:f,rotateEnabled:!1})]})};let J9=null,e8=null;const t8=()=>J9,n8=()=>e8,r8=cU([_X,RZ,EX],((e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:i,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:o,shouldShowBoundingBox:i,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),o8=()=>{const e=noe(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:a,shouldSnapToGrid:s}=roe(r8),l=i.exports.useRef(null),c=n8();Eq(["shift+c"],(()=>{e(PK())}),{enabled:()=>!o,preventDefault:!0},[]);Eq(["h"],(()=>{e(tQ(!a))}),{enabled:()=>!o,preventDefault:!0},[a]),Eq(["n"],(()=>{e(_Q(!s))}),{enabled:!0,preventDefault:!0},[s]),Eq("esc",(()=>{e(BK())}),{enabled:()=>!0,preventDefault:!0}),Eq("shift+h",(()=>{e(mQ(!n))}),{enabled:()=>!o,preventDefault:!0},[t,n]),Eq(["space"],(t=>{t.repeat||(c?.container().focus(),"move"!==r&&(l.current=r,e(MQ("move"))),"move"===r&&l.current&&"move"!==l.current&&(e(MQ(l.current)),l.current="move"))}),{keyup:!0,keydown:!0,preventDefault:!0},[r,l])},i8=cU(_X,(e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Z9(t)}})),a8=e=>'data:image/svg+xml;utf8,\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'.replaceAll("black",e),s8=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:a}=roe(i8),[s,l]=i.exports.useState(null),[c,u]=i.exports.useState(0),d=i.exports.useRef(null),h=i.exports.useCallback((()=>{u(c+1),setTimeout(h,500)}),[c]);return i.exports.useEffect((()=>{if(s)return;const e=new Image;e.onload=()=>{l(e)},e.src=a8(n)}),[s,n]),i.exports.useEffect((()=>{s&&(s.src=a8(n))}),[s,n]),i.exports.useEffect((()=>{const e=setInterval((()=>u((e=>(e+1)%5))),50);return()=>clearInterval(e)}),[]),s&&EG.exports.isNumber(r.x)&&EG.exports.isNumber(r.y)&&EG.exports.isNumber(a)&&EG.exports.isNumber(o.width)&&EG.exports.isNumber(o.height)?sd(j9,{ref:d,offsetX:r.x/a,offsetY:r.y/a,height:o.height/a,width:o.width/a,fillPatternImage:s,fillPatternOffsetY:EG.exports.isNumber(c)?c:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/a,y:1/a},listening:!0,globalCompositeOperation:"source-in",...t}):null},l8=cU([_X],(e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),c8=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},u8=()=>{const e=noe(),t=t8(),n=n8();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=t9.pixelRatio,[i,a,s,l]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;e(YK({r:i,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(MK())}}},d8=cU([RZ,_X,EX],((e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),h8=cU([RZ,_X,EX],((e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),f8=cU([RZ,_X,EX],((e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),p8=cU([_X,EX],((e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});var g8=i.exports;const m8=e=>{const{url:t,x:n,y:r}=e,[o]=function(e,t,n){const r=g8.useRef("loading"),o=g8.useRef(),[i,a]=g8.useState(0),s=g8.useRef(),l=g8.useRef(),c=g8.useRef();return s.current===e&&l.current===t&&c.current===n||(r.current="loading",o.current=void 0,s.current=e,l.current=t,c.current=n),g8.useLayoutEffect((function(){if(e){var i=document.createElement("img");return i.addEventListener("load",s),i.addEventListener("error",l),t&&(i.crossOrigin=t),n&&(i.referrerpolicy=n),i.src=e,function(){i.removeEventListener("load",s),i.removeEventListener("error",l)}}function s(){r.current="loaded",o.current=i,a(Math.random())}function l(){r.current="failed",o.current=void 0,a(Math.random())}}),[e,t,n]),[o.current,r.current]}(t);return sd(U9,{x:n,y:r,image:o,listening:!1})},v8=cU([_X],(e=>{const{layerState:{objects:t}}=e;return{objects:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),b8=()=>{const{objects:e}=roe(v8);return e?sd(F9,{name:"outpainting-objects",listening:!1,children:e.map(((e,t)=>{if(kX(e))return sd(m8,{x:e.x,y:e.y,url:e.image.url},t);if((e=>"line"===e.kind&&"base"===e.layer)(e)){const n=sd(W9,{points:e.points,stroke:e.color?Z9(e.color):"rgb(0,0,0)",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"},t);return e.clip?sd(F9,{clipX:e.clip.x,clipY:e.clip.y,clipWidth:e.clip.width,clipHeight:e.clip.height,children:n},t):n}return(e=>"fillRect"===e.kind&&"base"===e.layer)(e)?sd(j9,{x:e.x,y:e.y,width:e.width,height:e.height,fill:Z9(e.color)},t):(e=>"eraseRect"===e.kind&&"base"===e.layer)(e)?sd(j9,{x:e.x,y:e.y,width:e.width,height:e.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},t):void 0}))}):null},y8=cU([_X],(e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),x8={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},w8=()=>{const{colorMode:e}=ud(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=roe(y8),[o,a]=i.exports.useState([]),s=i.exports.useCallback((e=>e/t),[t]);return i.exports.useLayoutEffect((()=>{const t=x8[e],{width:o,height:i}=r,{x:l,y:c}=n,u={x1:0,y1:0,x2:o,y2:i,offset:{x:s(l),y:s(c)}},d=64*Math.ceil(s(l)/64),h=64*Math.ceil(s(c)/64),f={x1:-d,y1:-h,x2:s(o)-d+64,y2:s(i)-h+64},p={x1:Math.min(u.x1,f.x1),y1:Math.min(u.y1,f.y1),x2:Math.max(u.x2,f.x2),y2:Math.max(u.y2,f.y2)},g=p.x2-p.x1,m=p.y2-p.y1,v=Math.round(g/64)+1,b=Math.round(m/64)+1,y=LG.range(0,v).map((e=>sd(W9,{x:p.x1+64*e,y:p.y1,points:[0,0,0,m],stroke:t,strokeWidth:1},`x_${e}`))),x=LG.range(0,b).map((e=>sd(W9,{x:p.x1,y:p.y1+64*e,points:[0,0,g,0],stroke:t,strokeWidth:1},`y_${e}`)));a(y.concat(x))}),[t,n,r,e,s]),sd(F9,{children:o})},S8=cU([e=>e.gallery],(e=>e.intermediateImage?e.intermediateImage:null),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),k8=e=>{const{...t}=e,n=roe(S8),[r,o]=i.exports.useState(null);if(i.exports.useEffect((()=>{if(!n)return;const e=new Image;e.onload=()=>{o(e)},e.src=n.url}),[n]),!n?.boundingBox)return null;const{boundingBox:{x:a,y:s,width:l,height:c}}=n;return r?sd(U9,{x:a,y:s,width:l,height:c,image:r,listening:!1,...t}):null},C8=e=>Math.round(100*e)/100,_8=cU([_X],(e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${C8(n)}, ${C8(r)})`}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function E8(){const{cursorCoordinatesString:e}=roe(_8);return sd("div",{children:`Cursor Position: ${e}`})}const L8=cU([_X],(e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:i,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:c,y:u},stageScale:d,shouldShowCanvasDebugInfo:h,layer:f,boundingBoxScaleMethod:p}=e;let g="inherit";("none"===p&&(i<512||a<512)||"manual"===p&&s*l<262144)&&(g="var(--status-working-color)");return{activeLayerColor:"mask"===f?"var(--status-working-color)":"inherit",activeLayerString:f.charAt(0).toUpperCase()+f.slice(1),boundingBoxColor:g,boundingBoxCoordinatesString:`(${C8(c)}, ${C8(u)})`,boundingBoxDimensionsString:`${i}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${C8(r)}×${C8(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(100*d),shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:"auto"!==p,shouldShowScaledBoundingBox:"none"!==p}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),P8=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:i,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:c,shouldShowCanvasDebugInfo:u,shouldShowBoundingBox:d}=roe(L8);return ld("div",{className:"canvas-status-text",children:[sd("div",{style:{color:e},children:`Active Layer: ${t}`}),sd("div",{children:`Canvas Scale: ${c}%`}),d&&sd("div",{style:{color:n},children:`Bounding Box: ${o}`}),a&&sd("div",{style:{color:n},children:`Scaled Bounding Box: ${i}`}),u&&ld(ad,{children:[sd("div",{children:`Bounding Box Position: ${r}`}),sd("div",{children:`Canvas Dimensions: ${l}`}),sd("div",{children:`Canvas Position: ${s}`}),sd(E8,{})]})]})},M8=cU([_X],(e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:o,boundingBoxCoordinates:{x:i,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:0===n,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:i,y:a,width:s,height:l}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),A8=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:i,y:a,width:s,height:l}=roe(M8);return ld(F9,{...t,children:[r&&n&&sd(m8,{url:n.image.url,x:i,y:a}),o&&ld(F9,{children:[sd(j9,{x:i,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),sd(j9,{x:i,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},T8=cU([_X],(e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:0===n,isOnLastImage:n===t.length-1,shouldShowStagingImage:o,shouldShowStagingOutline:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),O8=()=>{const e=noe(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o}=roe(T8),a=i.exports.useCallback((()=>{e(CQ(!0))}),[e]),s=i.exports.useCallback((()=>{e(CQ(!1))}),[e]);Eq(["left"],(()=>{l()}),{enabled:()=>!0,preventDefault:!0}),Eq(["right"],(()=>{c()}),{enabled:()=>!0,preventDefault:!0}),Eq(["enter"],(()=>{u()}),{enabled:()=>!0,preventDefault:!0});const l=()=>e(NK()),c=()=>e(RK()),u=()=>e(AK());return r?sd(kI,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:ld(NT,{isAttached:!0,children:[sd(dZ,{tooltip:"Previous (Left)","aria-label":"Previous (Left)",icon:sd(TY,{}),onClick:l,"data-selected":!0,isDisabled:t}),sd(dZ,{tooltip:"Next (Right)","aria-label":"Next (Right)",icon:sd(OY,{}),onClick:c,"data-selected":!0,isDisabled:n}),sd(dZ,{tooltip:"Accept (Enter)","aria-label":"Accept (Enter)",icon:sd(DY,{}),onClick:u,"data-selected":!0}),sd(dZ,{tooltip:"Show/Hide","aria-label":"Show/Hide","data-alert":!o,icon:sd(o?$Y:GY,{}),onClick:()=>e(kQ(!o)),"data-selected":!0}),sd(dZ,{tooltip:"Save to Gallery","aria-label":"Save to Gallery",icon:sd(sX,{}),onClick:()=>e(BX(r.image.url)),"data-selected":!0}),sd(dZ,{tooltip:"Discard All","aria-label":"Discard All",icon:sd(rX,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(TK()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},I8=cU(_X,(e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:i,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:i,stageCoordinates:a,stageDimensions:r,stageScale:o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),R8=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:i}=roe(I8);return ld(F9,{children:[sd(j9,{offsetX:r.x/i,offsetY:r.y/i,height:o.height/i,width:o.width/i,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),sd(j9,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},N8=cU([_X,EX],((e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:i,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:c,tool:u,isMovingStage:d,shouldShowIntermediates:h,shouldShowGrid:f,shouldRestrictStrokesToBox:p}=e;let g="none";return"move"===u||t?g=d?"grabbing":"grab":i?g=void 0:p&&!a&&(g="default"),{isMaskEnabled:n,isModifyingBoundingBox:i||s,shouldShowBoundingBox:o,shouldShowGrid:f,stageCoordinates:c,stageCursor:g,stageDimensions:l,stageScale:r,tool:u,isStaging:t,shouldShowIntermediates:h}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),D8=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:a,stageDimensions:s,stageScale:l,tool:c,isStaging:u,shouldShowIntermediates:d}=roe(N8);o8();const h=i.exports.useRef(null),f=i.exports.useRef(null),p=i.exports.useCallback((e=>{e8=e,h.current=e}),[]),g=i.exports.useCallback((e=>{J9=e,f.current=e}),[]),m=i.exports.useRef({x:0,y:0}),v=i.exports.useRef(!1),b=(e=>{const t=noe(),{isMoveStageKeyHeld:n,stageScale:r}=roe(l8);return i.exports.useCallback((o=>{if(!e.current||n)return;o.evt.preventDefault();const i=e.current.getPointerPosition();if(!i)return;const a=(i.x-e.current.x())/r,s=(i.y-e.current.y())/r;let l=o.evt.deltaY;o.evt.ctrlKey&&(l=-l);const c=LG.clamp(r*.999**l,.1,20),u={x:i.x-a*c,y:i.y-s*c};t(PQ(c)),t(LQ(u))}),[e,n,r,t])})(h),y=(e=>{const t=noe(),{tool:n,isStaging:r}=roe(d8),{commitColorUnderCursor:o}=u8();return i.exports.useCallback((i=>{if(!e.current)return;if(e.current.container().focus(),"move"===n||r)return void t(aQ(!0));if("colorPicker"===n)return void o();const a=c8(e.current);a&&(i.evt.preventDefault(),t(eQ(!0)),t(_K([a.x,a.y])))}),[e,n,r,t,o])})(h),x=((e,t)=>{const n=noe(),{tool:r,isDrawing:o,isStaging:a}=roe(h8);return i.exports.useCallback((()=>{if("move"===r||a)n(aQ(!1));else{if(!t.current&&o&&e.current){const t=c8(e.current);if(!t)return;n(EK([t.x,t.y]))}else t.current=!1;n(eQ(!1))}}),[t,n,o,a,e,r])})(h,v),w=((e,t,n)=>{const r=noe(),{isDrawing:o,tool:a,isStaging:s}=roe(f8),{updateColorUnderCursor:l}=u8();return i.exports.useCallback((()=>{if(!e.current)return;const i=c8(e.current);i&&(r(XK(i)),n.current=i,"colorPicker"!==a?o&&"move"!==a&&!s&&(t.current=!0,r(EK([i.x,i.y]))):l())}),[t,r,o,s,n,e,a,l])})(h,v,m),S=(()=>{const e=noe();return i.exports.useCallback((()=>{e(IK())}),[e])})(),{handleDragStart:k,handleDragMove:C,handleDragEnd:_}=(()=>{const e=noe(),{tool:t,isStaging:n,isMovingBoundingBox:r}=roe(p8);return{handleDragStart:i.exports.useCallback((()=>{"move"!==t&&!n||r||e(aQ(!0))}),[e,r,n,t]),handleDragMove:i.exports.useCallback((o=>{if("move"!==t&&!n||r)return;const i={x:o.target.x(),y:o.target.y()};e(LQ(i))}),[e,r,n,t]),handleDragEnd:i.exports.useCallback((()=>{"move"!==t&&!n||r||e(aQ(!1))}),[e,r,n,t])}})();return sd("div",{className:"inpainting-canvas-container",children:ld("div",{className:"inpainting-canvas-wrapper",children:[ld(G9,{tabIndex:-1,ref:p,className:"inpainting-canvas-stage",style:{...a?{cursor:a}:{}},x:o.x,y:o.y,width:s.width,height:s.height,scale:{x:l,y:l},onTouchStart:y,onTouchMove:w,onTouchEnd:x,onMouseDown:y,onMouseLeave:S,onMouseMove:w,onMouseUp:x,onDragStart:k,onDragMove:C,onDragEnd:_,onContextMenu:e=>e.evt.preventDefault(),onWheel:b,draggable:("move"===c||u)&&!t,children:[sd(B9,{id:"grid",visible:r,children:sd(w8,{})}),sd(B9,{id:"base",ref:g,listening:!1,imageSmoothingEnabled:!1,children:sd(b8,{})}),ld(B9,{id:"mask",visible:e,listening:!1,children:[sd(q9,{visible:!0,listening:!1}),sd(s8,{listening:!1})]}),sd(B9,{children:sd(R8,{})}),ld(B9,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&sd(X9,{visible:"move"!==c,listening:!1}),sd(A8,{visible:u}),d&&sd(k8,{}),sd(Q9,{visible:n&&!u})]})]}),sd(P8,{}),sd(O8,{})]})})},z8=cU([_X,RZ,bX],((e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function B8(){const e=noe(),{canUndo:t,activeTabName:n}=roe(z8),r=()=>{e(OQ())};return Eq(["meta+z","ctrl+z"],(()=>{r()}),{enabled:()=>t,preventDefault:!0},[n,t]),sd(dZ,{"aria-label":"Undo (Ctrl+Z)",tooltip:"Undo (Ctrl+Z)",icon:sd(pX,{}),onClick:r,isDisabled:!t})}const F8=cU([_X,RZ,bX],((e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function j8(){const e=noe(),{canRedo:t,activeTabName:n}=roe(F8),r=()=>{e(DK())};return Eq(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],(()=>{r()}),{enabled:()=>t,preventDefault:!0},[n,t]),sd(dZ,{"aria-label":"Redo (Ctrl+Shift+Z)",tooltip:"Redo (Ctrl+Shift+Z)",icon:sd(aX,{}),onClick:r,isDisabled:!t})}const H8=rS(((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:o="Cancel",cancelCallback:a,children:s,title:l,triggerComponent:c}=e,{isOpen:u,onOpen:d,onClose:h}=KO(),f=i.exports.useRef(null);return ld(ad,{children:[i.exports.cloneElement(c,{onClick:d,ref:t}),sd($B,{isOpen:u,leastDestructiveRef:f,onClose:h,children:sd(GB,{children:ld(qB,{className:"modal",children:[sd(UB,{fontSize:"lg",fontWeight:"bold",children:l}),sd(RB,{children:s}),ld(WB,{children:[sd(IT,{ref:f,onClick:()=>{a&&a(),h()},className:"modal-close-btn",children:o}),sd(IT,{colorScheme:"red",onClick:()=>{r(),h()},ml:3,children:n})]})]})})})]})})),W8=()=>{const e=roe(EX),t=noe();return ld(H8,{title:"Empty Temp Image Folder",acceptCallback:()=>{t(FX()),t(zK()),t(LK())},acceptButtonText:"Empty Folder",triggerComponent:sd(jX,{leftIcon:sd(fX,{}),size:"sm",isDisabled:e,children:"Empty Temp Image Folder"}),children:[sd("p",{children:"Emptying the temp image folder also fully resets the Unified Canvas. This includes all undo/redo history, images in the staging area, and the canvas base layer."}),sd("br",{}),sd("p",{children:"Are you sure you want to empty the temp folder?"})]})},U8=()=>{const e=roe(EX),t=noe();return ld(H8,{title:"Clear Canvas History",acceptCallback:()=>t(LK()),acceptButtonText:"Clear History",triggerComponent:sd(jX,{size:"sm",leftIcon:sd(fX,{}),isDisabled:e,children:"Clear Canvas History"}),children:[sd("p",{children:"Clearing the canvas history leaves your current canvas intact, but irreversibly clears the undo and redo history."}),sd("br",{}),sd("p",{children:"Are you sure you want to clear the canvas history?"})]})},V8=cU([_X],(e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:i,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:i,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),G8=()=>{const e=noe(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:i,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=roe(V8);Eq(["n"],(()=>{e(_Q(!s))}),{enabled:!0,preventDefault:!0},[s]);return sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{tooltip:"Canvas Settings","aria-label":"Canvas Settings",icon:sd(vX,{})}),children:ld(kI,{direction:"column",gap:"0.5rem",children:[sd(g5,{label:"Show Intermediates",isChecked:a,onChange:t=>e(SQ(t.target.checked))}),sd(g5,{label:"Show Grid",isChecked:i,onChange:t=>e(wQ(t.target.checked))}),sd(g5,{label:"Snap to Grid",isChecked:s,onChange:t=>e(_Q(t.target.checked))}),sd(g5,{label:"Darken Outside Selection",isChecked:r,onChange:t=>e(fQ(t.target.checked))}),sd(g5,{label:"Auto Save to Gallery",isChecked:t,onChange:t=>e(dQ(t.target.checked))}),sd(g5,{label:"Save Box Region Only",isChecked:n,onChange:t=>e(hQ(t.target.checked))}),sd(g5,{label:"Limit Strokes to Box",isChecked:l,onChange:t=>e(RQ(t.target.checked))}),sd(g5,{label:"Show Canvas Debug Info",isChecked:o,onChange:t=>e(yQ(t.target.checked))}),sd(U8,{}),sd(W8,{})]})})};function $8(){return($8=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function Z8(e){var t=i.exports.useRef(e),n=i.exports.useRef((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var Y8=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?a(Q8(o.current,e,l.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=c.current,i=K8(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(J8(t),!function(e,t){return t&&!X8(e)}(t,c.current)&&r)){if(X8(t)){c.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),a(Q8(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,a]),d=u[0],h=u[1],f=u[2];return i.exports.useEffect((function(){return f}),[f]),sd("div",{...$8({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"})})})),tee=function(e){return e.filter(Boolean).join(" ")},nee=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=tee(["react-colorful__pointer",e.className]);return sd("div",{className:i,style:{top:100*o+"%",left:100*n+"%"},children:sd("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}})})},ree=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},oee=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:ree(e.h),s:ree(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:ree(o/2),a:ree(r,2)}},iee=function(e){var t=oee(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},aee=function(e){var t=oee(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},see=j.memo((function(e){var t=e.hue,n=e.onChange,r=tee(["react-colorful__hue",e.className]);return j.createElement("div",{className:r},j.createElement(eee,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Y8(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":ree(t),"aria-valuemax":"360","aria-valuemin":"0"},j.createElement(nee,{className:"react-colorful__hue-pointer",left:t/360,color:iee({h:t,s:100,v:100,a:1})})))})),lee=j.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:iee({h:t.h,s:100,v:100,a:1})};return j.createElement("div",{className:"react-colorful__saturation",style:r},j.createElement(eee,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Y8(t.s+100*e.left,0,100),v:Y8(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ree(t.s)+"%, Brightness "+ree(t.v)+"%"},j.createElement(nee,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:iee(t)})))})),cee=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};var uee="undefined"!=typeof window?i.exports.useLayoutEffect:i.exports.useEffect,dee=new Map,hee=function(e){uee((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!dee.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',dee.set(t,n);var r="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0;r&&n.setAttribute("nonce",r),t.head.appendChild(n)}}),[])},fee=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+aee(Object.assign({},n,{a:0}))+", "+aee(Object.assign({},n,{a:1}))+")"},i=tee(["react-colorful__alpha",t]),a=ree(100*n.a);return j.createElement("div",{className:i},sd("div",{className:"react-colorful__alpha-gradient",style:o}),j.createElement(eee,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:Y8(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},j.createElement(nee,{className:"react-colorful__alpha-pointer",left:n.a,color:aee(n)})))},pee=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,a=e.onChange,s=q8(e,["className","colorModel","color","onChange"]),l=i.exports.useRef(null);hee(l);var c=function(e,t,n){var r=Z8(n),o=i.exports.useState((function(){return e.toHsva(t)})),a=o[0],s=o[1],l=i.exports.useRef({color:t,hsva:a});i.exports.useEffect((function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},s(n)}}),[t,e]),i.exports.useEffect((function(){var t;cee(a,l.current.hsva)||e.equal(t=e.fromHsva(a),l.current.color)||(l.current={hsva:a,color:t},r(t))}),[a,e,r]);var c=i.exports.useCallback((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[a,c]}(n,o,a),u=c[0],d=c[1],h=tee(["react-colorful",t]);return j.createElement("div",$8({},s,{ref:l,className:h}),sd(lee,{hsva:u,onChange:d}),sd(see,{hue:u.h,onChange:d}),j.createElement(fee,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},gee={defaultColor:{r:0,g:0,b:0,a:1},toHsva:function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:ree(60*(s<0?s+6:s)),s:ree(i?a/i*100:0),v:ree(i/255*100),a:o}},fromHsva:function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:ree(255*[r,s,a,a,l,r][c]),g:ree(255*[l,r,r,s,a,a][c]),b:ree(255*[a,a,l,r,r,s][c]),a:ree(o,2)}},equal:cee},mee=function(e){return j.createElement(pee,$8({},e,{colorModel:gee}))};const vee=e=>{const{styleClass:t,...n}=e;return sd(mee,{className:`invokeai__color-picker ${t}`,...n})},bee=cU([_X,EX],((e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:i}=e;return{layer:r,maskColor:n,maskColorString:Z9(n),isMaskEnabled:o,shouldPreserveMaskedArea:i,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),yee=()=>{const e=noe(),{layer:t,maskColor:n,isMaskEnabled:r,shouldPreserveMaskedArea:o,isStaging:i}=roe(bee);Eq(["q"],(()=>{a()}),{enabled:()=>!i,preventDefault:!0},[t]),Eq(["shift+c"],(()=>{s()}),{enabled:()=>!i,preventDefault:!0},[]),Eq(["h"],(()=>{l()}),{enabled:()=>!i,preventDefault:!0},[r]);const a=()=>{e(lQ("mask"===t?"base":"mask"))},s=()=>e(PK()),l=()=>e(tQ(!r));return sd(VQ,{trigger:"hover",triggerComponent:sd(NT,{children:sd(dZ,{"aria-label":"Masking Options",tooltip:"Masking Options",icon:sd(QY,{}),style:"mask"===t?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:i})}),children:ld(kI,{direction:"column",gap:"0.5rem",children:[sd(g5,{label:"Enable Mask (H)",isChecked:r,onChange:l}),sd(g5,{label:"Preserve Masked Area",isChecked:o,onChange:t=>e(gQ(t.target.checked))}),sd(vee,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:t=>e(cQ(t))}),sd(jX,{size:"sm",leftIcon:sd(fX,{}),onClick:s,children:"Clear Mask (Shift+C)"})]})})};let xee;const wee=new Uint8Array(16);function See(){if(!xee&&(xee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xee))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xee(wee)}const kee=[];for(let e=0;e<256;++e)kee.push((e+256).toString(16).slice(1));const Cee={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function _ee(e,t,n){if(Cee.randomUUID&&!t&&!e)return Cee.randomUUID();const r=(e=e||{}).random||(e.rng||See)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(kee[e[t+0]]+kee[e[t+1]]+kee[e[t+2]]+kee[e[t+3]]+"-"+kee[e[t+4]]+kee[e[t+5]]+"-"+kee[e[t+6]]+kee[e[t+7]]+"-"+kee[e[t+8]]+kee[e[t+9]]+"-"+kee[e[t+10]]+kee[e[t+11]]+kee[e[t+12]]+kee[e[t+13]]+kee[e[t+14]]+kee[e[t+15]]).toLowerCase()}(r)}const Eee={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Lee=(e=Eee)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:o,shouldSaveToGallery:i,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(pY("Exporting Image")),t(sY(!1));const c=n(),{stageScale:u,boundingBoxCoordinates:d,boundingBoxDimensions:h,stageCoordinates:f}=c.canvas,p=t8();if(!p)return t($Z(!1)),void t(sY(!0));const{dataURL:g,boundingBox:m}=((e,t,n,r)=>{const o=e.scale(),i=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:c}=e.getClientRect(),u=r?{x:Math.round(r.x+n.x),y:Math.round(r.y+n.y),width:Math.round(r.width),height:Math.round(r.height)}:{x:Math.round(a),y:Math.round(s),width:Math.round(l),height:Math.round(c)},d=e.toDataURL(u);return e.scale(o),{dataURL:d,boundingBox:{x:Math.round(i.x),y:Math.round(i.y),width:Math.round(l),height:Math.round(c)}}})(p,u,f,o?{...d,...h}:void 0);if(!g)return t($Z(!1)),void t(sY(!0));const v=new FormData;v.append("data",JSON.stringify({dataURL:g,filename:"merged_canvas.png",kind:i?"result":"temp",cropVisible:r}));const b=await fetch(window.location.origin+"/upload",{method:"POST",body:v}),y=await b.json(),{url:x,width:w,height:S}=y,k={uuid:_ee(),category:i?"result":"user",...y};a&&((e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()})(x),t(hY({title:"Image Download Started",status:"success",duration:2500,isClosable:!0}))),s&&(((e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",(()=>{const e=document.createElement("canvas");e.width=t,e.height=n;const o=e.getContext("2d");o&&(o.drawImage(r,0,0),e.toBlob((e=>{e&&navigator.clipboard.write([new ClipboardItem({[e.type]:e})])})),e.remove(),r.remove())})),r.src=e})(x,w,S),t(hY({title:"Image Copied",status:"success",duration:2500,isClosable:!0}))),i&&(t(ZQ({image:k,category:"result"})),t(hY({title:"Image Saved to Gallery",status:"success",duration:2500,isClosable:!0}))),l&&(t(uQ({kind:"image",layer:"base",...m,image:k})),t(hY({title:"Canvas Merged",status:"success",duration:2500,isClosable:!0}))),t($Z(!1)),t(eY("Connected")),t(sY(!0))},Pee=cU([_X,EX,bX],((e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:i,brushSize:a}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:i,brushSize:a}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Mee=()=>{const e=noe(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=roe(Pee);Eq(["b"],(()=>{i()}),{enabled:()=>!o,preventDefault:!0},[]),Eq(["e"],(()=>{a()}),{enabled:()=>!o,preventDefault:!0},[t]),Eq(["c"],(()=>{s()}),{enabled:()=>!o,preventDefault:!0},[t]),Eq(["shift+f"],(()=>{l()}),{enabled:()=>!o,preventDefault:!0}),Eq(["delete","backspace"],(()=>{c()}),{enabled:()=>!o,preventDefault:!0}),Eq(["BracketLeft"],(()=>{e(qK(Math.max(r-5,5)))}),{enabled:()=>!o,preventDefault:!0},[r]),Eq(["BracketRight"],(()=>{e(qK(Math.min(r+5,500)))}),{enabled:()=>!o,preventDefault:!0},[r]),Eq(["shift+BracketLeft"],(()=>{e($K({...n,a:LG.clamp(n.a-.05,.05,1)}))}),{enabled:()=>!o,preventDefault:!0},[n]),Eq(["shift+BracketRight"],(()=>{e($K({...n,a:LG.clamp(n.a+.05,.05,1)}))}),{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(MQ("brush")),a=()=>e(MQ("eraser")),s=()=>e(MQ("colorPicker")),l=()=>e(kK()),c=()=>e(SK());return ld(NT,{isAttached:!0,children:[sd(dZ,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:sd(eX,{}),"data-selected":"brush"===t&&!o,onClick:i,isDisabled:o}),sd(dZ,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:sd(HY,{}),"data-selected":"eraser"===t&&!o,isDisabled:o,onClick:a}),sd(dZ,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:sd(qY,{}),isDisabled:o,onClick:l}),sd(dZ,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:sd(rX,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:c}),sd(dZ,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:sd(VY,{}),"data-selected":"colorPicker"===t&&!o,isDisabled:o,onClick:s}),sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{"aria-label":"Brush Options",tooltip:"Brush Options",icon:sd(dX,{})}),children:ld(kI,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[sd(kI,{gap:"1rem",justifyContent:"space-between",children:sd(hZ,{label:"Size",value:r,withInput:!0,onChange:t=>e(qK(t)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),sd(vee,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:t=>e($K(t))})]})})]})};let Aee;const Tee=()=>({setOpenUploader:e=>{e&&(Aee=e)},openUploader:Aee}),Oee=cU([bX,_X,EX],((e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:i,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:o,layer:a,shouldCropToBoundingBoxOnSave:i}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Iee=()=>{const e=noe(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:i,shouldCropToBoundingBoxOnSave:a}=roe(Oee),s=t8(),{openUploader:l}=Tee();Eq(["v"],(()=>{c()}),{enabled:()=>!n,preventDefault:!0},[]),Eq(["r"],(()=>{u()}),{enabled:()=>!0,preventDefault:!0},[s]),Eq(["shift+m"],(()=>{d()}),{enabled:()=>!n,preventDefault:!0},[s,t]),Eq(["shift+s"],(()=>{h()}),{enabled:()=>!n,preventDefault:!0},[s,t]),Eq(["meta+c","ctrl+c"],(()=>{f()}),{enabled:()=>!n,preventDefault:!0},[s,t]),Eq(["shift+d"],(()=>{p()}),{enabled:()=>!n,preventDefault:!0},[s,t]);const c=()=>e(MQ("move")),u=()=>{const t=t8();if(!t)return;const n=t.getClientRect({skipTransform:!0});e(FK({contentRect:n}))},d=()=>{e(Lee({cropVisible:!1,shouldSetAsInitialImage:!0}))},h=()=>{e(Lee({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},f=()=>{e(Lee({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},p=()=>{e(Lee({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))};return ld("div",{className:"inpainting-settings",children:[sd(Bq,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:o,validValues:xX,onChange:t=>{const n=t.target.value;e(lQ(n)),"mask"!==n||r||e(tQ(!0))},isDisabled:n}),sd(yee,{}),sd(Mee,{}),ld(NT,{isAttached:!0,children:[sd(dZ,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:sd(IY,{}),"data-selected":"move"===i||n,onClick:c}),sd(dZ,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:sd(FY,{}),onClick:u})]}),ld(NT,{isAttached:!0,children:[sd(dZ,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:sd(KY,{}),onClick:d,isDisabled:n}),sd(dZ,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:sd(sX,{}),onClick:h,isDisabled:n}),sd(dZ,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:sd(BY,{}),onClick:f,isDisabled:n}),sd(dZ,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:sd(jY,{}),onClick:p,isDisabled:n})]}),ld(NT,{isAttached:!0,children:[sd(B8,{}),sd(j8,{})]}),ld(NT,{isAttached:!0,children:[sd(dZ,{"aria-label":"Upload",tooltip:"Upload",icon:sd(gX,{}),onClick:l,isDisabled:n}),sd(dZ,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:sd(fX,{}),onClick:()=>{e(zK()),e(jK())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),sd(NT,{isAttached:!0,children:sd(G8,{})})]})},Ree=cU([_X],(e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Nee=()=>{const e=noe(),{doesCanvasNeedScaling:t}=roe(Ree);return i.exports.useLayoutEffect((()=>{e(KK(!0));const t=LG.debounce((()=>{e(KK(!0))}),250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[e]),sd("div",{className:"workarea-single-view",children:sd("div",{className:"workarea-split-view-left",children:ld("div",{className:"inpainting-main-area",children:[sd(Iee,{}),sd("div",{className:"inpainting-canvas-area",children:sd(t?X3:D8,{})})]})})})},Dee=cU([_X,EX],((e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function zee(){const e=noe(),{layer:t,isMaskEnabled:n,isStaging:r}=roe(Dee);Eq(["q"],(()=>{e(lQ("mask"===t?"base":"mask"))}),{enabled:()=>!r,preventDefault:!0},[t]);return sd(Bq,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:t,validValues:xX,onChange:t=>{const r=t.target.value;e(lQ(r)),"mask"!==r||n||e(tQ(!0))},isDisabled:r})}const Bee=cU([_X,EX,bX],((e,t,n)=>{const{isProcessing:r}=n,{tool:o}=e;return{tool:o,isStaging:t,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Fee=()=>{const e=noe(),{tool:t,isStaging:n}=roe(Bee);Eq(["b"],(()=>{r()}),{enabled:()=>!n,preventDefault:!0},[]),Eq(["e"],(()=>{o()}),{enabled:()=>!n,preventDefault:!0},[t]),Eq(["c"],(()=>{i()}),{enabled:()=>!n,preventDefault:!0},[t]),Eq(["shift+f"],(()=>{a()}),{enabled:()=>!n,preventDefault:!0}),Eq(["delete","backspace"],(()=>{s()}),{enabled:()=>!n,preventDefault:!0});const r=()=>e(MQ("brush")),o=()=>e(MQ("eraser")),i=()=>e(MQ("colorPicker")),a=()=>e(kK()),s=()=>e(SK());return ld(kI,{flexDirection:"column",gap:"0.5rem",children:[ld(NT,{children:[sd(dZ,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:sd(eX,{}),"data-selected":"brush"===t&&!n,onClick:r,isDisabled:n}),sd(dZ,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:sd(HY,{}),"data-selected":"eraser"===t&&!n,isDisabled:n,onClick:o})]}),ld(NT,{children:[sd(dZ,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:sd(qY,{}),isDisabled:n,onClick:a}),sd(dZ,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:sd(rX,{style:{transform:"rotate(45deg)"}}),isDisabled:n,onClick:s})]}),sd(dZ,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:sd(VY,{}),"data-selected":"colorPicker"===t&&!n,isDisabled:n,onClick:i,width:"max-content"})]})},jee=cU([_X],(e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Hee=()=>{const e=noe(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}=roe(jee);return sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{tooltip:"Canvas Settings",tooltipProps:{placement:"bottom"},"aria-label":"Canvas Settings",icon:sd(vX,{})}),children:ld(kI,{direction:"column",gap:"0.5rem",children:[sd(g5,{label:"Show Intermediates",isChecked:o,onChange:t=>e(SQ(t.target.checked))}),sd(g5,{label:"Auto Save to Gallery",isChecked:t,onChange:t=>e(dQ(t.target.checked))}),sd(g5,{label:"Save Box Region Only",isChecked:n,onChange:t=>e(hQ(t.target.checked))}),sd(g5,{label:"Show Canvas Debug Info",isChecked:r,onChange:t=>e(yQ(t.target.checked))}),sd(U8,{}),sd(W8,{})]})})};function Wee(){const e=roe((e=>e.canvas.tool)),t=roe(EX),n=noe();Eq(["v"],(()=>{r()}),{enabled:()=>!t,preventDefault:!0},[]);const r=()=>n(MQ("move"));return sd(dZ,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:sd(IY,{}),"data-selected":"move"===e||t,onClick:r})}function Uee(){const e=t8(),t=noe();Eq(["r"],(()=>{n()}),{enabled:()=>!0,preventDefault:!0},[e]);const n=()=>{const e=t8();if(!e)return;const n=e.getClientRect({skipTransform:!0});t(FK({contentRect:n}))};return sd(dZ,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:sd(FY,{}),onClick:n})}function Vee(){const e=noe(),t=t8(),n=roe(EX),r=roe((e=>e.system.isProcessing));Eq(["shift+m"],(()=>{o()}),{enabled:()=>!n,preventDefault:!0},[t,r]);const o=()=>{e(Lee({cropVisible:!1,shouldSetAsInitialImage:!0}))};return sd(dZ,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:sd(KY,{}),onClick:o,isDisabled:n})}function Gee(){const e=roe(EX),t=t8(),n=roe((e=>e.system.isProcessing)),r=roe((e=>e.canvas.shouldCropToBoundingBoxOnSave)),o=noe();Eq(["shift+s"],(()=>{i()}),{enabled:()=>!e,preventDefault:!0},[t,n]);const i=()=>{o(Lee({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return sd(dZ,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:sd(sX,{}),onClick:i,isDisabled:e})}function $ee(){const e=roe(EX),t=t8(),n=roe((e=>e.system.isProcessing)),r=roe((e=>e.canvas.shouldCropToBoundingBoxOnSave)),o=noe();Eq(["meta+c","ctrl+c"],(()=>{i()}),{enabled:()=>!e,preventDefault:!0},[t,n]);const i=()=>{o(Lee({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return sd(dZ,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:sd(BY,{}),onClick:i,isDisabled:e})}function qee(){const e=noe(),t=t8(),n=roe(EX),r=roe((e=>e.system.isProcessing)),o=roe((e=>e.canvas.shouldCropToBoundingBoxOnSave));Eq(["shift+d"],(()=>{i()}),{enabled:()=>!n,preventDefault:!0},[t,r]);const i=()=>{e(Lee({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return sd(dZ,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:sd(jY,{}),onClick:i,isDisabled:n})}function Zee(){const e=roe(EX),{openUploader:t}=Tee();return sd(dZ,{"aria-label":"Upload",tooltip:"Upload",icon:sd(gX,{}),onClick:t,isDisabled:e})}function Yee(){const e=noe(),t=roe(EX);return sd(dZ,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:sd(fX,{}),onClick:()=>{e(zK()),e(jK())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:t})}function Xee(){const e=roe((e=>e.options.shouldPinOptionsPanel)),t=noe();return ld(kI,{flexDirection:"column",gap:"0.5rem",children:[sd(dZ,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:()=>{t(hne(!0)),e&&setTimeout((()=>t(KK(!0))),400)},children:sd(dX,{})}),sd(kI,{children:sd(HX,{iconButton:!0})}),sd(kI,{children:sd(UX,{width:"100%",height:"40px"})})]})}const Kee=()=>{const e=roe((e=>e.options.shouldShowOptionsPanel));return ld(kI,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[sd(zee,{}),sd(Fee,{}),ld(kI,{gap:"0.5rem",children:[sd(Wee,{}),sd(Uee,{})]}),ld(kI,{columnGap:"0.5rem",children:[sd(Vee,{}),sd(Gee,{})]}),ld(kI,{columnGap:"0.5rem",children:[sd($ee,{}),sd(qee,{})]}),ld(kI,{gap:"0.5rem",children:[sd(B8,{}),sd(j8,{})]}),ld(kI,{gap:"0.5rem",children:[sd(Zee,{}),sd(Yee,{})]}),sd(Hee,{}),!e&&sd(Xee,{})]})};function Qee(){const e=noe(),t=roe((e=>e.canvas.brushSize)),n=roe(EX);return Eq(["BracketLeft"],(()=>{e(qK(Math.max(t-5,5)))}),{enabled:()=>!n,preventDefault:!0},[t]),Eq(["BracketRight"],(()=>{e(qK(Math.min(t+5,500)))}),{enabled:()=>!n,preventDefault:!0},[t]),sd(hZ,{label:"Size",value:t,withInput:!0,onChange:t=>e(qK(t)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px"})}const Jee=cU([_X,EX],((e,t)=>{const{brushColor:n,maskColor:r,layer:o}=e;return{brushColor:n,maskColor:r,layer:o,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function ete(){const e=noe(),{brushColor:t,maskColor:n,layer:r,isStaging:o}=roe(Jee);return Eq(["shift+BracketLeft"],(()=>{e($K({...t,a:LG.clamp(t.a-.05,.05,1)}))}),{enabled:()=>!o,preventDefault:!0},[t]),Eq(["shift+BracketRight"],(()=>{e($K({...t,a:LG.clamp(t.a+.05,.05,1)}))}),{enabled:()=>!o,preventDefault:!0},[t]),sd(VQ,{trigger:"hover",triggerComponent:sd(gI,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:"base"===r?`rgba(${t.r},${t.g},${t.b},${t.a})`:"mask"===r?`rgba(${n.r},${n.g},${n.b},${n.a})`:void 0,cursor:"pointer"}}),children:ld(kI,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:["base"===r&&sd(vee,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:t=>e($K(t))}),"mask"===r&&sd(vee,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:t=>e(cQ(t))})]})})}function tte(){return ld(kI,{columnGap:"1rem",alignItems:"center",children:[sd(Qee,{}),sd(ete,{})]})}function nte(){const e=noe(),t=roe((e=>e.canvas.shouldRestrictStrokesToBox));return sd(g5,{label:"Limit To Box",isChecked:t,onChange:t=>e(RQ(t.target.checked))})}function rte(){return ld(kI,{gap:"1rem",alignItems:"center",children:[sd(tte,{}),sd(nte,{})]})}function ote(){const e=noe();return sd(jX,{size:"sm",leftIcon:sd(fX,{}),onClick:()=>e(PK()),tooltip:"Clear Mask (Shift+C)",children:"Clear"})}function ite(){const e=roe((e=>e.canvas.isMaskEnabled)),t=noe();return sd(g5,{label:"Enable Mask (H)",isChecked:e,onChange:()=>t(tQ(!e))})}function ate(){const e=noe(),t=roe((e=>e.canvas.shouldPreserveMaskedArea));return sd(g5,{label:"Preserve Masked",isChecked:t,onChange:t=>e(gQ(t.target.checked))})}function ste(){return ld(kI,{gap:"1rem",alignItems:"center",children:[sd(tte,{}),sd(ite,{}),sd(ate,{}),sd(ote,{})]})}function lte(){const e=roe((e=>e.canvas.shouldDarkenOutsideBoundingBox)),t=noe();return sd(g5,{label:"Darken Outside",isChecked:e,onChange:e=>t(fQ(e.target.checked))})}function cte(){const e=roe((e=>e.canvas.shouldShowGrid)),t=noe();return sd(g5,{label:"Show Grid",isChecked:e,onChange:e=>t(wQ(e.target.checked))})}function ute(){const e=roe((e=>e.canvas.shouldSnapToGrid)),t=noe();return sd(g5,{label:"Snap to Grid (N)",isChecked:e,onChange:e=>t(_Q(e.target.checked))})}function dte(){return ld(kI,{alignItems:"center",gap:"1rem",children:[sd(cte,{}),sd(ute,{}),sd(lte,{})]})}const hte=cU([_X],(e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}});function fte(){const{tool:e,layer:t}=roe(hte);return ld(kI,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:["base"==t&&["brush","eraser","colorPicker"].includes(e)&&sd(rte,{}),"mask"==t&&["brush","eraser","colorPicker"].includes(e)&&sd(ste,{}),"move"==e&&sd(dte,{})]})}const pte=cU([_X],(e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),gte=()=>{const e=noe(),{doesCanvasNeedScaling:t}=roe(pte);return i.exports.useLayoutEffect((()=>{e(KK(!0));const t=LG.debounce((()=>{e(KK(!0))}),250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[e]),sd("div",{className:"workarea-single-view",children:ld(kI,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[sd(Kee,{}),ld(kI,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[sd(fte,{}),sd(t?X3:D8,{})]})]})})};function mte(){const e=roe((e=>e.options.shouldUseCanvasBetaLayout));return sd(w5,{optionsPanel:sd(Z3,{}),styleClass:"inpainting-workarea-overrides",children:sd(e?gte:Nee,{})})}const vte=SS({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})});function bte(){return ld("div",{className:"work-in-progress nodes-work-in-progress",children:[sd("h1",{children:"Training"}),ld("p",{children:["A dedicated workflow for training your own embeddings and checkpoints using Textual Inversion and Dreambooth from the web interface. ",sd("br",{}),sd("br",{}),"InvokeAI already supports training custom embeddings using Textual Inversion using the main script."]})]})}const yte=SS({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:sd("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),xte={txt2img:{title:sd(Iq,{fill:"black",boxSize:"2.5rem"}),workarea:sd(_5,{}),tooltip:"Text To Image"},img2img:{title:sd(Aq,{fill:"black",boxSize:"2.5rem"}),workarea:sd(S5,{}),tooltip:"Image To Image"},unifiedCanvas:{title:sd(vte,{fill:"black",boxSize:"2.5rem"}),workarea:sd(mte,{}),tooltip:"Unified Canvas"},nodes:{title:sd(Tq,{fill:"black",boxSize:"2.5rem"}),workarea:sd(Pq,{}),tooltip:"Nodes"},postprocess:{title:sd(Oq,{fill:"black",boxSize:"2.5rem"}),workarea:sd(Mq,{}),tooltip:"Post Processing"},training:{title:sd(yte,{fill:"black",boxSize:"2.5rem"}),workarea:sd(bte,{}),tooltip:"Training"}},wte=LG.map(xte,((e,t)=>t));function Ste(){const e=roe((e=>e.options.activeTab)),t=roe((e=>e.options.isLightBoxOpen)),n=noe();Eq("1",(()=>{n(Pte(0))})),Eq("2",(()=>{n(Pte(1))})),Eq("3",(()=>{n(Pte(2))})),Eq("4",(()=>{n(Pte(3))})),Eq("5",(()=>{n(Pte(4))})),Eq("6",(()=>{n(Pte(5))})),Eq("z",(()=>{n(Wte(!t))}),[t]);return ld(mH,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:e=>{n(Pte(e))},children:[sd("div",{className:"app-tabs-list",children:(()=>{const e=[];return Object.keys(xte).forEach((t=>{e.push(sd(qH,{hasArrow:!0,label:xte[t].tooltip,placement:"right",children:sd(wH,{children:xte[t].title})},t))})),e})()}),sd(xH,{className:"app-tabs-panels",children:t?sd(F3,{}):(()=>{const e=[];return Object.keys(xte).forEach((t=>{e.push(sd(yH,{className:"app-tabs-panel",children:xte[t].workarea},t))})),e})()})]})}const kte={activeTab:0,cfgScale:7.5,codeformerFidelity:.75,currentTheme:"dark",facetoolStrength:.8,facetoolType:"gfpgan",height:512,hiresFix:!1,img2imgStrength:.75,infillMethod:"patchmatch",isLightBoxOpen:!1,iterations:1,maskPath:"",optionsPanelScrollPosition:0,perlin:0,prompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:10,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldHoldOptionsPanelOpen:!1,shouldLoopback:!1,shouldPinOptionsPanel:!0,shouldRandomizeSeed:!0,shouldRunESRGAN:!1,shouldRunFacetool:!1,shouldShowImageDetails:!1,shouldShowOptionsPanel:!0,showAdvancedOptions:!0,showDualDisplay:!0,steps:50,threshold:0,tileSize:32,upscalingLevel:4,upscalingStrength:.75,variationAmount:.1,width:512,shouldUseCanvasBetaLayout:!1},Cte=TU({name:"options",initialState:kte,reducers:{setPrompt:(e,t)=>{const n=t.payload;e.prompt="string"==typeof n?n:kG(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,o={...e,[n]:r};return"seed"===n&&(o.shouldRandomizeSeed=!1),o},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:o,variations:i,steps:a,cfg_scale:s,threshold:l,perlin:c,seamless:u,hires_fix:d,width:h,height:f}=t.payload.image;i&&i.length>0?(e.seedWeights=_G(i),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),r&&(e.prompt=kG(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),l&&(e.threshold=l),void 0===l&&(e.threshold=0),c&&(e.perlin=c),void 0===c&&(e.perlin=0),"boolean"==typeof u&&(e.seamless=u),"boolean"==typeof d&&(e.hiresFix=d),h&&(e.width=h),f&&(e.height=f)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:o,init_image_path:i,mask_image_path:a}=t.payload.image;"img2img"===n&&(i&&(e.initialImage=i),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),"boolean"==typeof o&&(e.shouldFitToWidthHeight=o))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:o,seed:i,variations:a,steps:s,cfg_scale:l,threshold:c,perlin:u,seamless:d,hires_fix:h,width:f,height:p,strength:g,fit:m,init_image_path:v,mask_image_path:b}=t.payload.image;"img2img"===n&&(v&&(e.initialImage=v),b&&(e.maskPath=b),g&&(e.img2imgStrength=g),"boolean"==typeof m&&(e.shouldFitToWidthHeight=m)),a&&a.length>0?(e.seedWeights=_G(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),o&&(e.prompt=kG(o)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),c&&(e.threshold=c),void 0===c&&(e.threshold=0),u&&(e.perlin=u),void 0===u&&(e.perlin=0),"boolean"==typeof d&&(e.seamless=d),"boolean"==typeof h&&(e.hiresFix=h),f&&(e.width=f),p&&(e.height=p),e.shouldRunESRGAN=!1,e.shouldRunFacetool=!1},resetOptionsState:e=>({...e,...kte}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setShowAdvancedOptions:(e,t)=>{e.showAdvancedOptions=t.payload},setActiveTab:(e,t)=>{"number"==typeof t.payload?e.activeTab=t.payload:e.activeTab=wte.indexOf(t.payload)},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShowDualDisplay:(e,t)=>{e.showDualDisplay=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setShouldPinOptionsPanel:(e,t)=>{e.shouldPinOptionsPanel=t.payload},setShouldShowOptionsPanel:(e,t)=>{e.shouldShowOptionsPanel=t.payload},setOptionsPanelScrollPosition:(e,t)=>{e.optionsPanelScrollPosition=t.payload},setShouldHoldOptionsPanelOpen:(e,t)=>{e.shouldHoldOptionsPanelOpen=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setIsLightBoxOpen:(e,t)=>{e.isLightBoxOpen=t.payload},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload}}}),{clearInitialImage:_te,resetOptionsState:Ete,resetSeed:Lte,setActiveTab:Pte,setAllImageToImageParameters:Mte,setAllParameters:Ate,setAllTextToImageParameters:Tte,setCfgScale:Ote,setCodeformerFidelity:Ite,setCurrentTheme:Rte,setFacetoolStrength:Nte,setFacetoolType:Dte,setHeight:zte,setHiresFix:Bte,setImg2imgStrength:Fte,setInfillMethod:jte,setInitialImage:Hte,setIsLightBoxOpen:Wte,setIterations:Ute,setMaskPath:Vte,setOptionsPanelScrollPosition:Gte,setParameter:$te,setPerlin:qte,setPrompt:Zte,setSampler:Yte,setSeamBlur:Xte,setSeamless:Kte,setSeamSize:Qte,setSeamSteps:Jte,setSeamStrength:ene,setSeed:tne,setSeedWeights:nne,setShouldFitToWidthHeight:rne,setShouldGenerateVariations:one,setShouldHoldOptionsPanelOpen:ine,setShouldLoopback:ane,setShouldPinOptionsPanel:sne,setShouldRandomizeSeed:lne,setShouldRunESRGAN:cne,setShouldRunFacetool:une,setShouldShowImageDetails:dne,setShouldShowOptionsPanel:hne,setShowAdvancedOptions:fne,setShowDualDisplay:pne,setSteps:gne,setThreshold:mne,setTileSize:vne,setUpscalingLevel:bne,setUpscalingStrength:yne,setVariationAmount:xne,setWidth:wne,setShouldUseCanvasBetaLayout:Sne}=Cte.actions,kne=Cte.reducer,Cne=Object.create(null);Cne.open="0",Cne.close="1",Cne.ping="2",Cne.pong="3",Cne.message="4",Cne.upgrade="5",Cne.noop="6";const _ne=Object.create(null);Object.keys(Cne).forEach((e=>{_ne[Cne[e]]=e}));const Ene={type:"error",data:"parser error"},Lne="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),Pne="function"==typeof ArrayBuffer,Mne=({type:e,data:t},n,r)=>Lne&&t instanceof Blob?n?r(t):Ane(t,r):Pne&&(t instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer)(t))?n?r(t):Ane(new Blob([t]),r):r(Cne[e]+(t||"")),Ane=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+e)},n.readAsDataURL(e)},Tne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",One="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e{if("string"!=typeof e)return{type:"message",data:Dne(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:Nne(e.substring(1),t)};return _ne[n]?e.length>1?{type:_ne[n],data:e.substring(1)}:{type:_ne[n]}:Ene},Nne=(e,t)=>{if(Ine){const n=(e=>{let t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return Dne(n,t)}return{base64:!0,data:e}},Dne=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,zne=String.fromCharCode(30);function Bne(e){if(e)return function(e){for(var t in Bne.prototype)e[t]=Bne.prototype[t];return e}(e)}Bne.prototype.on=Bne.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Bne.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Bne.prototype.off=Bne.prototype.removeListener=Bne.prototype.removeAllListeners=Bne.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const Hne=setTimeout,Wne=clearTimeout;function Une(e,t){t.useNativeTimers?(e.setTimeoutFn=Hne.bind(Fne),e.clearTimeoutFn=Wne.bind(Fne)):(e.setTimeoutFn=setTimeout.bind(Fne),e.clearTimeoutFn=clearTimeout.bind(Fne))}function Vne(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}class Gne extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class $ne extends Bne{constructor(e){super(),this.writable=!1,Une(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new Gne(e,t,n)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Rne(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const qne="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Zne={};let Yne,Xne=0,Kne=0;function Qne(e){let t="";do{t=qne[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function Jne(){const e=Qne(+new Date);return e!==Yne?(Xne=0,Yne=e):e+"."+Qne(Xne++)}for(;Kne<64;Kne++)Zne[qne[Kne]]=Kne;function ere(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let tre=!1;try{tre="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Kie){}const nre=tre;function rre(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||nre))return new XMLHttpRequest}catch(vV){}if(!t)try{return new(Fne[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(vV){}}function ore(){}const ire=null!=new rre({xdomain:!1}).responseType;class are extends Bne{constructor(e,t){super(),Une(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=jne(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new rre(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(vV){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(vV){}try{t.setRequestHeader("Accept","*/*")}catch(vV){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(vV){return void this.setTimeoutFn((()=>{this.onError(vV)}),0)}"undefined"!=typeof document&&(this.index=are.requestsCount++,are.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=ore,e)try{this.xhr.abort()}catch(vV){}"undefined"!=typeof document&&delete are.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(are.requestsCount=0,are.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",sre);else if("function"==typeof addEventListener){addEventListener("onpagehide"in Fne?"pagehide":"unload",sre,!1)}function sre(){for(let e in are.requests)are.requests.hasOwnProperty(e)&&are.requests[e].abort()}const lre="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),cre=Fne.WebSocket||Fne.MozWebSocket,ure="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const dre={websocket:class extends $ne{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=ure?{}:jne(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=ure?new cre(e,t,n):t?new cre(e,t):new cre(e)}catch(Kie){return this.emitReserved("error",Kie)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.ws.send(e)}catch(vV){}r&&lre((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=Jne()),this.supportsBinary||(e.b64=1);const r=ere(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!cre}},polling:class extends $ne{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=ire&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(zne),r=[];for(let o=0;o{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{Mne(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(zne))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=Jne()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=ere(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new are(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},hre=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,fre=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function pre(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=hre.exec(e||""),i={},a=14;for(;a--;)i[fre[a]]=o[a]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,i.query),i}class gre extends Bne{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=pre(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=pre(t.host).host),Une(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new dre[e](n)}open(){let e;if(this.opts.rememberUpgrade&&gre.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(vV){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;gre.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;gre.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function a(){i("transport closed")}function s(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",a),this.off("close",s),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",a),this.once("close",s),this.once("upgrading",l),t.open()}onOpen(){if(this.readyState="open",gre.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let e=0;const t=this.upgrades.length;for(;e{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){gre.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||bre&&e instanceof Blob||yre&&e instanceof File}function wre(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t=0&&e.num0;case Ere.ACK:case Ere.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Pre{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=Cre(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Mre=Object.freeze(Object.defineProperty({__proto__:null,protocol:5,get PacketType(){return Ere},Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==Ere.EVENT&&e.type!==Ere.ACK||!wre(e)?[this.encodeAsString(e)]:(e.type=e.type===Ere.EVENT?Ere.BINARY_EVENT:Ere.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==Ere.BINARY_EVENT&&e.type!==Ere.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Sre(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Decoder:Lre},Symbol.toStringTag,{value:"Module"}));function Are(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Tre=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ore extends Bne{constructor(e,t,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Are(e,"open",this.onopen.bind(this)),Are(e,"packet",this.onpacket.bind(this)),Are(e,"error",this.onerror.bind(this)),Are(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(Tre.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const n={type:Ere.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){const n=this.flags.timeout;if(void 0===n)return void(this.acks[e]=t);const r=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this.packet({type:Ere.CONNECT,data:e})})):this.packet({type:Ere.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Ere.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ere.EVENT:case Ere.BINARY_EVENT:this.onevent(e);break;case Ere.ACK:case Ere.BINARY_ACK:this.onack(e);break;case Ere.DISCONNECT:this.ondisconnect();break;case Ere.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:Ere.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ere.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ire.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},Ire.prototype.reset=function(){this.attempts=0},Ire.prototype.setMin=function(e){this.ms=e},Ire.prototype.setMax=function(e){this.max=e},Ire.prototype.setJitter=function(e){this.jitter=e};class Rre extends Bne{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,Une(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Ire({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||Mre;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new gre(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Are(t,"open",(function(){n.onopen(),e&&e()})),o=Are(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Are(e,"ping",this.onping.bind(this)),Are(e,"data",this.ondata.bind(this)),Are(e,"error",this.onerror.bind(this)),Are(e,"close",this.onclose.bind(this)),Are(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(vV){this.onclose("parse error",vV)}}ondecoded(e){lre((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n||(n=new Ore(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;ne())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Nre={};function Dre(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=pre(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,a=Nre[o]&&i in Nre[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?s=new Rre(r,t):(Nre[o]||(Nre[o]=new Rre(r,t)),s=Nre[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}Object.assign(Dre,{Manager:Rre,Socket:Ore,io:Dre,connect:Dre});var zre=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Bre=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Fre=/[^-+\dA-Z]/g;function jre(e,t,n,r){if(1!==arguments.length||"string"!=typeof e||/\d/.test(e)||(t=e,e=void 0),(e=e||0===e?e:new Date)instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");var o=(t=String(Hre[t]||t||Hre.default)).slice(0,4);"UTC:"!==o&&"GMT:"!==o||(t=t.slice(4),n=!0,"GMT:"===o&&(r=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},s=function(){return e[i()+"Day"]()},l=function(){return e[i()+"Month"]()},c=function(){return e[i()+"FullYear"]()},u=function(){return e[i()+"Hours"]()},d=function(){return e[i()+"Minutes"]()},h=function(){return e[i()+"Seconds"]()},f=function(){return e[i()+"Milliseconds"]()},p=function(){return n?0:e.getTimezoneOffset()},g=function(){return Gre(e)},m=function(){return $re(e)},v={d:function(){return a()},dd:function(){return Ure(a())},ddd:function(){return Wre.dayNames[s()]},DDD:function(){return Vre({y:c(),m:l(),d:a(),_:i(),dayName:Wre.dayNames[s()],short:!0})},dddd:function(){return Wre.dayNames[s()+7]},DDDD:function(){return Vre({y:c(),m:l(),d:a(),_:i(),dayName:Wre.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Ure(l()+1)},mmm:function(){return Wre.monthNames[l()]},mmmm:function(){return Wre.monthNames[l()+12]},yy:function(){return String(c()).slice(2)},yyyy:function(){return Ure(c(),4)},h:function(){return u()%12||12},hh:function(){return Ure(u()%12||12)},H:function(){return u()},HH:function(){return Ure(u())},M:function(){return d()},MM:function(){return Ure(d())},s:function(){return h()},ss:function(){return Ure(h())},l:function(){return Ure(f(),3)},L:function(){return Ure(Math.floor(f()/10))},t:function(){return u()<12?Wre.timeNames[0]:Wre.timeNames[1]},tt:function(){return u()<12?Wre.timeNames[2]:Wre.timeNames[3]},T:function(){return u()<12?Wre.timeNames[4]:Wre.timeNames[5]},TT:function(){return u()<12?Wre.timeNames[6]:Wre.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":qre(e)},o:function(){return(p()>0?"-":"+")+Ure(100*Math.floor(Math.abs(p())/60)+Math.abs(p())%60,4)},p:function(){return(p()>0?"-":"+")+Ure(Math.floor(Math.abs(p())/60),2)+":"+Ure(Math.floor(Math.abs(p())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return g()},WW:function(){return Ure(g())},N:function(){return m()}};return t.replace(zre,(function(e){return e in v?v[e]():e.slice(1,e.length-1)}))}var Hre={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Wre={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Ure=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")},Vre=function(e){var t=e.y,n=e.m,r=e.d,o=e._,i=e.dayName,a=e.short,s=void 0!==a&&a,l=new Date,c=new Date;c.setDate(c[o+"Date"]()-1);var u=new Date;u.setDate(u[o+"Date"]()+1);return l[o+"FullYear"]()===t&&l[o+"Month"]()===n&&l[o+"Date"]()===r?s?"Tdy":"Today":c[o+"FullYear"]()===t&&c[o+"Month"]()===n&&c[o+"Date"]()===r?s?"Ysd":"Yesterday":u[o+"FullYear"]()===t&&u[o+"Month"]()===n&&u[o+"Date"]()===r?s?"Tmw":"Tomorrow":i},Gre=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var o=(t-n)/6048e5;return 1+Math.floor(o)},$re=function(e){var t=e.getDay();return 0===t&&(t=7),t},qre=function(e){return(String(e).match(Bre)||[""]).pop().replace(Fre,"").replace(/GMT\+0000/g,"UTC")};const Zre=e=>{const t=t8(),{generationMode:n,optionsState:r,canvasState:o,systemState:i}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:c,height:u,hiresFix:d,img2imgStrength:h,infillMethod:f,initialImage:p,iterations:g,perlin:m,prompt:v,sampler:b,seamBlur:y,seamless:x,seamSize:w,seamSteps:S,seamStrength:k,seed:C,seedWeights:_,shouldFitToWidthHeight:E,shouldGenerateVariations:L,shouldRandomizeSeed:P,shouldRunESRGAN:M,shouldRunFacetool:A,steps:T,threshold:O,tileSize:I,upscalingLevel:R,upscalingStrength:N,variationAmount:D,width:z}=r,{shouldDisplayInProgressType:B,saveIntermediatesInterval:F,enableImageDebugging:j}=i,H={prompt:v,iterations:g,steps:T,cfg_scale:a,threshold:O,perlin:m,height:u,width:z,sampler_name:b,seed:C,progress_images:"full-res"===B,progress_latents:"latents"===B,save_intermediates:F,generation_mode:n,init_mask:""};let W=!1,U=!1;if(H.seed=P?yZ(0,Uq):C,["txt2img","img2img"].includes(n)&&(H.seamless=x,H.hires_fix=d,M&&(W={level:R,strength:N}),A&&(U={type:c,strength:l},"codeformer"===c&&(U.codeformer_fidelity=s))),"img2img"===n&&p&&(H.init_img="string"==typeof p?p:p.url,H.strength=h,H.fit=E),"unifiedCanvas"===n&&t){const{layerState:{objects:e},boundingBoxCoordinates:n,boundingBoxDimensions:r,inpaintReplace:i,shouldUseInpaintReplace:a,stageScale:s,isMaskEnabled:l,shouldPreserveMaskedArea:c,boundingBoxScaleMethod:u,scaledBoundingBoxDimensions:d}=o,p={...n,...r},g=((e,t)=>{const{width:n,height:r}=t,o=document.createElement("div"),i=new t9.Stage({container:o,width:n,height:r}),a=new t9.Layer,s=new t9.Layer;a.add(new t9.Rect({...t,fill:"white"})),e.forEach((e=>s.add(new t9.Line({points:e.points,stroke:"black",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"})))),i.add(a),i.add(s);const l=i.toDataURL({...t});return o.remove(),l})(l?e.filter(SX):[],p);H.init_mask=g,H.fit=!1,H.strength=h,H.invert_mask=c,a&&(H.inpaint_replace=i),H.bounding_box=p;const m=t.scale();t.scale({x:1/s,y:1/s});const v=t.getAbsolutePosition(),b=t.toDataURL({x:p.x+v.x,y:p.y+v.y,width:p.width,height:p.height});j&&(e=>{const t=window.open("");t&&e.forEach((e=>{const n=new Image;n.src=e.base64,t.document.write(e.caption),t.document.write("
"),t.document.write(n.outerHTML),t.document.write("

")}))})([{base64:g,caption:"mask sent as init_mask"},{base64:b,caption:"image sent as init_img"}]),t.scale(m),H.init_img=b,H.progress_images=!1,"none"!==u&&(H.inpaint_width=d.width,H.inpaint_height=d.height),H.seam_size=w,H.seam_blur=y,H.seam_strength=k,H.seam_steps=S,H.tile_size=I,H.infill_method=f,H.force_outpaint=!1}return L?(H.variation_amount=D,_&&(H.with_variations=(e=>{const t=e.split(",").map((e=>e.split(":")));return t.map((e=>[parseInt(e[0]),parseFloat(e[1])]))})(_))):H.variation_amount=0,j&&(H.enable_image_debugging=j),{generationParameters:H,esrganParameters:W,facetoolParameters:U}},Yre=()=>{const{origin:e}=new URL(window.location.href),t=Dre(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return e=>r=>o=>{const{onConnect:i,onDisconnect:a,onError:s,onPostprocessingResult:l,onGenerationResult:c,onIntermediateResult:u,onProgressUpdate:d,onGalleryImages:h,onProcessingCanceled:f,onImageDeleted:p,onSystemConfig:g,onModelChanged:m,onModelChangeFailed:v,onTempFolderEmptied:b}=(e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(YZ(!0)),t(eY("Connected")),t(DX());const e=n().gallery;e.categories.result.latest_mtime?t(RX("result")):t(IX("result")),e.categories.user.latest_mtime?t(RX("user")):t(IX("user"))}catch(vV){console.error(vV)}},onDisconnect:()=>{try{t(YZ(!1)),t(eY("Disconnected")),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(vV){console.error(vV)}},onGenerationResult:e=>{try{const r=n(),{shouldLoopback:o,activeTab:i}=r.options,{boundingBox:a,generationMode:s,...l}=e,c={uuid:_ee(),...l};if(["txt2img","img2img"].includes(s)&&t(ZQ({category:"result",image:{...c,category:"result"}})),"unifiedCanvas"===s&&e.boundingBox){const{boundingBox:n}=e;t(CK({image:{...c,category:"temp"},boundingBox:n})),r.canvas.shouldAutoSave&&t(ZQ({image:{...c,category:"result"},category:"result"}))}o&&"img2img"===wte[i]&&t(Hte(c)),t(YQ()),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Image generated: ${e.url}`}))}catch(vV){console.error(vV)}},onIntermediateResult:e=>{try{t(JQ({uuid:_ee(),...e,category:"result"})),e.isBase64||t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Intermediate image generated: ${e.url}`}))}catch(vV){console.error(vV)}},onPostprocessingResult:e=>{try{t(ZQ({category:"result",image:{uuid:_ee(),...e,category:"result"}})),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Postprocessed: ${e.url}`}))}catch(vV){console.error(vV)}},onProgressUpdate:e=>{try{t($Z(!0)),t(JZ(e))}catch(vV){console.error(vV)}},onError:e=>{const{message:n,additionalData:r}=e;try{t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Server error: ${n}`,level:"error"})),t(oY()),t(YQ())}catch(vV){console.error(vV)}},onGalleryImages:e=>{const{images:n,areMoreImagesAvailable:r,category:o}=e,i=n.map((e=>({uuid:_ee(),...e})));t(QQ({images:i,areMoreImagesAvailable:r,category:o})),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Loaded ${n.length} images`}))},onProcessingCanceled:()=>{t(rY());const{intermediateImage:e}=n().gallery;e&&(e.isBase64||(t(ZQ({category:"result",image:e})),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Intermediate image saved: ${e.url}`}))),t(YQ())),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:e=>{const{url:r}=e;t(XQ(e));const{initialImage:o,maskPath:i}=n().options;o?.url!==r&&o!==r||t(_te()),i===r&&t(Vte("")),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Image deleted: ${r}`}))},onSystemConfig:e=>{t(tY(e)),e.infill_methods.includes("patchmatch")||t(jte(e.infill_methods[0]))},onModelChanged:e=>{const{model_name:n,model_list:r}=e;t(aY(r)),t(eY("Model Changed")),t($Z(!1)),t(sY(!0)),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Model changed: ${n}`,level:"info"}))},onModelChangeFailed:e=>{const{model_name:n,model_list:r}=e;t(aY(r)),t($Z(!1)),t(sY(!0)),t(oY()),t(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Model change failed: ${n}`,level:"error"}))},onTempFolderEmptied:()=>{t(hY({title:"Temp Folder Emptied",status:"success",duration:2500,isClosable:!0}))}}})(e),{emitGenerateImage:y,emitRunESRGAN:x,emitRunFacetool:w,emitDeleteImage:S,emitRequestImages:k,emitRequestNewImages:C,emitCancelProcessing:_,emitRequestSystemConfig:E,emitRequestModelChange:L,emitSaveStagingAreaImageToGallery:P,emitRequestEmptyTempFolder:M}=((e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:e=>{n($Z(!0));const o=r(),{options:i,system:a,canvas:s}=o,l={generationMode:e,optionsState:i,canvasState:s,systemState:a};n(dY());const{generationParameters:c,esrganParameters:u,facetoolParameters:d}=Zre(l);t.emit("generateImage",c,u,d),c.init_mask&&(c.init_mask=c.init_mask.substr(0,64).concat("...")),c.init_img&&(c.init_img=c.init_img.substr(0,64).concat("...")),n(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...c,...u,...d})}`}))},emitRunESRGAN:e=>{n($Z(!0));const o=r().options,{upscalingLevel:i,upscalingStrength:a}=o,s={upscale:[i,a]};t.emit("runPostprocessing",e,{type:"esrgan",...s}),n(qZ({timestamp:jre(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:e.url,...s})}`}))},emitRunFacetool:e=>{n($Z(!0));const o=r().options,{facetoolType:i,facetoolStrength:a,codeformerFidelity:s}=o,l={facetool_strength:a};"codeformer"===i&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",e,{type:i,...l}),n(qZ({timestamp:jre(new Date,"isoDateTime"),message:`Face restoration (${i}) requested: ${JSON.stringify({file:e.url,...l})}`}))},emitDeleteImage:e=>{const{url:r,uuid:o,category:i,thumbnail:a}=e;n(XQ(e)),t.emit("deleteImage",r,a,o,i)},emitRequestImages:e=>{const n=r().gallery,{earliest_mtime:o}=n.categories[e];t.emit("requestImages",e,o)},emitRequestNewImages:e=>{const n=r().gallery,{latest_mtime:o}=n.categories[e];t.emit("requestLatestImages",e,o)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitRequestModelChange:e=>{n(lY()),t.emit("requestModelChange",e)},emitSaveStagingAreaImageToGallery:e=>{t.emit("requestSaveStagingAreaImageToGallery",e)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}})(e,t);switch(n||(t.on("connect",(()=>i())),t.on("disconnect",(()=>a())),t.on("error",(e=>s(e))),t.on("generationResult",(e=>c(e))),t.on("postprocessingResult",(e=>l(e))),t.on("intermediateResult",(e=>u(e))),t.on("progressUpdate",(e=>d(e))),t.on("galleryImages",(e=>h(e))),t.on("processingCanceled",(()=>{f()})),t.on("imageDeleted",(e=>{p(e)})),t.on("systemConfig",(e=>{g(e)})),t.on("modelChanged",(e=>{m(e)})),t.on("modelChangeFailed",(e=>{v(e)})),t.on("tempFolderEmptied",(()=>{b()})),n=!0),o.type){case"socketio/generateImage":y(o.payload);break;case"socketio/runESRGAN":x(o.payload);break;case"socketio/runFacetool":w(o.payload);break;case"socketio/deleteImage":S(o.payload);break;case"socketio/requestImages":k(o.payload);break;case"socketio/requestNewImages":C(o.payload);break;case"socketio/cancelProcessing":_();break;case"socketio/requestSystemConfig":E();break;case"socketio/requestModelChange":L(o.payload);break;case"socketio/saveStagingAreaImageToGallery":P(o.payload);break;case"socketio/requestEmptyTempFolder":M()}r(o)}},Xre=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map((e=>`canvas.${e}`)),Kre=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps"].map((e=>`system.${e}`)),Qre=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map((e=>`gallery.${e}`)),Jre=tU({options:kne,gallery:hJ,system:gY,canvas:NQ}),eoe=function(e,t){var n=void 0!==e.version?e.version:-1;e.debug;var r=void 0===e.stateReconciler?ZV:e.stateReconciler,o=e.getStoredState||KV,i=void 0!==e.timeout?e.timeout:5e3,a=null,s=!1,l=!0,c=function(e){return e._persist.rehydrated&&a&&!l&&a.update(e),e};return function(u,d){var h=u||{},f=h._persist,p=rG(h,["_persist"]);if(d.type===WV){var g=!1,m=function(t,n){g||(d.rehydrate(e.key,t,n),g=!0)};if(i&&setTimeout((function(){!g&&m(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))}),i),l=!1,a||(a=YV(e)),f)return tG({},t(p,d),{_persist:f});if("function"!=typeof d.rehydrate||"function"!=typeof d.register)throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return d.register(e.key),o(e).then((function(t){var r=e.migrate||function(e,t){return Promise.resolve(e)};r(t,n).then((function(e){m(e)}),(function(e){m(void 0,e)}))}),(function(e){m(void 0,e)})),tG({},t(p,d),{_persist:{version:n,rehydrated:!1}})}if(d.type===UV)return s=!0,d.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:BV).concat(e.key);return t.removeItem(n,JV)}(e)),tG({},t(p,d),{_persist:f});if(d.type===FV)return d.result(a&&a.flush()),tG({},t(p,d),{_persist:f});if(d.type===HV)l=!0;else if(d.type===jV){if(s)return tG({},p,{_persist:tG({},f,{rehydrated:!0})});if(d.key===e.key){var v=t(p,d),b=d.payload,y=tG({},!1!==r&&void 0!==b?r(b,u,v,e):v,{_persist:tG({},f,{rehydrated:!0})});return c(y)}}if(!f)return t(u,d);var x=t(p,d);return x===p?u:c(tG({},x,{_persist:f}))}}(yG.getPersistConfig({key:"root",storage:vG,rootReducer:Jre,blacklist:[...Xre,...Kre,...Qre],debounce:300}),Jre),toe=function(e){var t,n=PU(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,l=r.devTools,c=void 0===l||l,u=r.preloadedState,d=void 0===u?void 0:u,h=r.enhancers,f=void 0===h?void 0:h;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=tU(i)}var p=s;"function"==typeof p&&(p=p(n));var g=rU.apply(void 0,p),m=nU;c&&(m=_U(kU({trace:!1},"object"==typeof c&&c)));var v=[g];return Array.isArray(f)?v=gU([g],f):"function"==typeof f&&(v=f(v)),eU(t,d,m.apply(void 0,v))}({reducer:eoe,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(Yre()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),noe=DV,roe=dV;function ooe(e){return ooe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ooe(e)}function ioe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aoe(e,t){for(var n=0;nsd(kI,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:sd(dT,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),poe=cU((e=>e.system),(e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),goe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=roe(poe),o=t?Math.round(100*t/n):0;return sd(JF,{value:o,isIndeterminate:e&&!r,className:"progress-bar"})};function moe(e){const{title:t,hotkey:n,description:r}=e;return ld("div",{className:"hotkey-modal-item",children:[ld("div",{className:"hotkey-info",children:[sd("p",{className:"hotkey-title",children:t}),r&&sd("p",{className:"hotkey-description",children:r})]}),sd("div",{className:"hotkey-key",children:n})]})}function voe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=KO(),o=e=>{const t=[];return e.forEach(((e,n)=>{t.push(sd(moe,{title:e.title,description:e.desc,hotkey:e.hotkey},n))})),sd("div",{className:"hotkey-modal-category",children:t})};return ld(ad,{children:[i.exports.cloneElement(e,{onClick:n}),ld(IB,{isOpen:t,onClose:r,children:[sd(GB,{}),ld(HB,{className:" modal hotkeys-modal",children:[sd(NB,{className:"modal-close-btn"}),sd("h1",{children:"Keyboard Shorcuts"}),sd("div",{className:"hotkeys-modal-items",children:ld(cT,{allowMultiple:!0,children:[ld(sT,{children:[ld(tT,{className:"hotkeys-modal-button",children:[sd("h2",{children:"App Hotkeys"}),sd(aT,{})]}),sd(lT,{children:o([{title:"Invoke",desc:"Generate an image",hotkey:"Ctrl+Enter"},{title:"Cancel",desc:"Cancel image generation",hotkey:"Shift+X"},{title:"Focus Prompt",desc:"Focus the prompt input area",hotkey:"Alt+A"},{title:"Toggle Options",desc:"Open and close the options panel",hotkey:"O"},{title:"Pin Options",desc:"Pin the options panel",hotkey:"Shift+O"},{title:"Toggle Viewer",desc:"Open and close Image Viewer",hotkey:"Z"},{title:"Toggle Gallery",desc:"Open and close the gallery drawer",hotkey:"G"},{title:"Maximize Workspace",desc:"Close panels and maximize work area",hotkey:"F"},{title:"Change Tabs",desc:"Switch to another workspace",hotkey:"1-5"},{title:"Console Toggle",desc:"Open and close console",hotkey:"`"}])})]}),ld(sT,{children:[ld(tT,{className:"hotkeys-modal-button",children:[sd("h2",{children:"General Hotkeys"}),sd(aT,{})]}),sd(lT,{children:o([{title:"Set Prompt",desc:"Use the prompt of the current image",hotkey:"P"},{title:"Set Seed",desc:"Use the seed of the current image",hotkey:"S"},{title:"Set Parameters",desc:"Use all parameters of the current image",hotkey:"A"},{title:"Restore Faces",desc:"Restore the current image",hotkey:"Shift+R"},{title:"Upscale",desc:"Upscale the current image",hotkey:"Shift+U"},{title:"Show Info",desc:"Show metadata info of the current image",hotkey:"I"},{title:"Send To Image To Image",desc:"Send current image to Image to Image",hotkey:"Shift+I"},{title:"Delete Image",desc:"Delete the current image",hotkey:"Del"},{title:"Close Panels",desc:"Closes open panels",hotkey:"Esc"}])})]}),ld(sT,{children:[ld(tT,{className:"hotkeys-modal-button",children:[sd("h2",{children:"Gallery Hotkeys"}),sd(aT,{})]}),sd(lT,{children:o([{title:"Previous Image",desc:"Display the previous image in gallery",hotkey:"Arrow Left"},{title:"Next Image",desc:"Display the next image in gallery",hotkey:"Arrow Right"},{title:"Toggle Gallery Pin",desc:"Pins and unpins the gallery to the UI",hotkey:"Shift+G"},{title:"Increase Gallery Image Size",desc:"Increases gallery thumbnails size",hotkey:"Shift+Up"},{title:"Decrease Gallery Image Size",desc:"Decreases gallery thumbnails size",hotkey:"Shift+Down"}])})]}),ld(sT,{children:[ld(tT,{className:"hotkeys-modal-button",children:[sd("h2",{children:"Unified Canvas Hotkeys"}),sd(aT,{})]}),sd(lT,{children:o([{title:"Select Brush",desc:"Selects the canvas brush",hotkey:"B"},{title:"Select Eraser",desc:"Selects the canvas eraser",hotkey:"E"},{title:"Decrease Brush Size",desc:"Decreases the size of the canvas brush/eraser",hotkey:"["},{title:"Increase Brush Size",desc:"Increases the size of the canvas brush/eraser",hotkey:"]"},{title:"Decrease Brush Opacity",desc:"Decreases the opacity of the canvas brush",hotkey:"Shift + ["},{title:"Increase Brush Opacity",desc:"Increases the opacity of the canvas brush",hotkey:"Shift + ]"},{title:"Move Tool",desc:"Allows canvas navigation",hotkey:"V"},{title:"Fill Bounding Box",desc:"Fills the bounding box with brush color",hotkey:"Shift + F"},{title:"Erase Bounding Box",desc:"Erases the bounding box area",hotkey:"Delete / Backspace"},{title:"Select Color Picker",desc:"Selects the canvas color picker",hotkey:"C"},{title:"Toggle Snap",desc:"Toggles Snap to Grid",hotkey:"N"},{title:"Quick Toggle Move",desc:"Temporarily toggles Move mode",hotkey:"Hold Space"},{title:"Toggle Layer",desc:"Toggles mask/base layer selection",hotkey:"Q"},{title:"Clear Mask",desc:"Clear the entire mask",hotkey:"Shift+C"},{title:"Hide Mask",desc:"Hide and unhide mask",hotkey:"H"},{title:"Show/Hide Bounding Box",desc:"Toggle visibility of bounding box",hotkey:"Shift+H"},{title:"Merge Visible",desc:"Merge all visible layers of canvas",hotkey:"Shift+M"},{title:"Save To Gallery",desc:"Save current canvas to gallery",hotkey:"Shift+S"},{title:"Copy to Clipboard",desc:"Copy current canvas to clipboard",hotkey:"Ctrl+C"},{title:"Download Image",desc:"Download current canvas",hotkey:"Shift+D"},{title:"Undo Stroke",desc:"Undo a brush stroke",hotkey:"Ctrl+Z"},{title:"Redo Stroke",desc:"Redo a brush stroke",hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:"Reset View",desc:"Reset Canvas View",hotkey:"R"},{title:"Previous Staging Image",desc:"Previous Staging Area Image",hotkey:"Arrow Left"},{title:"Next Staging Image",desc:"Next Staging Area Image",hotkey:"Arrow Right"},{title:"Accept Staging Image",desc:"Accept Current Staging Area Image",hotkey:"Enter"}])})]})]})})]})]})]})}const boe=e=>{const{isProcessing:t,isConnected:n}=roe((e=>e.system)),r=noe(),{name:o,status:i,description:a}=e;return ld("div",{className:"model-list-item",children:[sd(qH,{label:a,hasArrow:!0,placement:"bottom",children:sd("div",{className:"model-list-item-name",children:o})}),sd(DI,{}),sd("div",{className:`model-list-item-status ${i.split(" ").join("-")}`,children:i}),sd("div",{className:"model-list-item-load-btn",children:sd(IT,{size:"sm",onClick:()=>{r(zX(o))},isDisabled:"active"===i||t||!n,children:"Load"})})]})},yoe=cU((e=>e.system),(e=>{const t=LG.map(e.model_list,((e,t)=>({name:t,...e}))),n=t.find((e=>"active"===e.status));return{models:t,activeModel:n}})),xoe=()=>{const{models:e}=roe(yoe);return sd(cT,{allowToggle:!0,className:"model-list-accordion",variant:"unstyled",children:ld(sT,{children:[sd(tT,{children:ld("div",{className:"model-list-button",children:[sd("h2",{children:"Models"}),sd(aT,{})]})}),sd(lT,{children:sd("div",{className:"model-list-list",children:e.map(((e,t)=>sd(boe,{name:e.name,status:e.status,description:e.description},t)))})})]})})},woe=cU([bX,NZ],((e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,model_list:i,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:LG.map(i,((e,t)=>t)),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}}),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),Soe=({children:e})=>{const t=noe(),n=roe((e=>e.options.steps)),{isOpen:r,onOpen:o,onClose:a}=KO(),{isOpen:s,onOpen:l,onClose:c}=KO(),{shouldDisplayInProgressType:u,shouldConfirmOnDelete:d,shouldDisplayGuides:h,saveIntermediatesInterval:f,enableImageDebugging:p,shouldUseCanvasBetaLayout:g}=roe(woe);return ld(ad,{children:[i.exports.cloneElement(e,{onClick:o}),ld(IB,{isOpen:r,onClose:a,children:[sd(GB,{}),ld(HB,{className:"modal settings-modal",children:[sd(UB,{className:"settings-modal-header",children:"Settings"}),sd(NB,{className:"modal-close-btn"}),ld(RB,{className:"settings-modal-content",children:[ld("div",{className:"settings-modal-items",children:[sd("div",{className:"settings-modal-item",children:sd(xoe,{})}),ld("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[sd(Bq,{label:"Display In-Progress Images",validValues:Gq,value:u,onChange:e=>t(GZ(e.target.value))}),"full-res"===u&&sd(zq,{label:"Save images every n steps",min:1,max:n,step:1,onChange:e=>{e>n&&(e=n),e<1&&(e=1),t(cY(e))},value:f,width:"auto",textAlign:"center"})]}),sd(Yq,{styleClass:"settings-modal-item",label:"Confirm on Delete",isChecked:d,onChange:e=>t(KZ(e.target.checked))}),sd(Yq,{styleClass:"settings-modal-item",label:"Display Help Icons",isChecked:h,onChange:e=>t(nY(e.target.checked))}),sd(Yq,{styleClass:"settings-modal-item",label:"Use Canvas Beta Layout",isChecked:g,onChange:e=>t(Sne(e.target.checked))})]}),ld("div",{className:"settings-modal-items",children:[sd("h2",{style:{fontWeight:"bold"},children:"Developer"}),sd(Yq,{styleClass:"settings-modal-item",label:"Enable Image Debugging",isChecked:p,onChange:e=>t(uY(e.target.checked))})]}),ld("div",{className:"settings-modal-reset",children:[sd(LI,{size:"md",children:"Reset Web UI"}),sd(IT,{colorScheme:"red",onClick:()=>{Zie.purge().then((()=>{a(),l()}))},children:"Reset Web UI"}),sd(WI,{children:"Resetting the web UI only resets the browser's local cache of your images and remembered settings. It does not delete any images from disk."}),sd(WI,{children:"If images aren't showing up in the gallery or something else isn't working, please try resetting before submitting an issue on GitHub."})]})]}),sd(WB,{children:sd(IT,{onClick:a,className:"modal-close-btn",children:"Close"})})]})]}),ld(IB,{closeOnOverlayClick:!1,isOpen:s,onClose:c,isCentered:!0,children:[sd(GB,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),sd(HB,{children:sd(RB,{pb:6,pt:6,children:sd(kI,{justifyContent:"center",children:sd(WI,{fontSize:"lg",children:"Web UI has been reset. Refresh the page to reload."})})})})]})]})},koe=cU((e=>e.system),(e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),Coe=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:i,wasErrorSeen:a}=roe(koe),s=noe();let l;l=e&&!i?"status-good":"status-bad";let c=o;["generating","preparing","saving image","restoring faces","upscaling"].includes(c.toLowerCase())&&(l="status-working"),c&&t&&r>1&&(c+=` (${n}/${r})`);return sd(qH,{label:i&&!a?"Click to clear, check logs for details":void 0,children:sd(WI,{cursor:i&&!a?"pointer":"initial",onClick:()=>{!i&&a||s(iY())},className:`status ${l}`,children:c})})},_oe=["dark","light","green"];function Eoe(){const{setColorMode:e}=ud(),t=noe(),n=roe((e=>e.options.currentTheme));return sd(VQ,{trigger:"hover",triggerComponent:sd(dZ,{"aria-label":"Theme",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:sd(tX,{})}),children:sd(HI,{align:"stretch",children:_oe.map((r=>sd(jX,{style:{width:"6rem"},leftIcon:n===r?sd(DY,{}):void 0,size:"sm",onClick:()=>(n=>{e(n),t(Rte(n))})(r),children:r.charAt(0).toUpperCase()+r.slice(1)},r)))})})}const Loe=cU([bX],(e=>{const{isProcessing:t,model_list:n}=e,r=LG.map(n,((e,t)=>t)),o=LG.reduce(n,((e,t,n)=>("active"===t.status&&(e=n),e)),"");return{models:r,activeModel:o,isProcessing:t,activeDesc:n[o].description}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Poe=()=>{const e=noe(),{models:t,activeModel:n,isProcessing:r,activeDesc:o}=roe(Loe);return sd(kI,{style:{paddingLeft:"0.3rem"},children:sd(Bq,{style:{fontSize:"0.8rem"},tooltip:o,isDisabled:r,value:n,validValues:t,onChange:t=>{e(zX(t.target.value))}})})},Moe=()=>ld("div",{className:"site-header",children:[ld("div",{className:"site-header-left-side",children:[sd("img",{src:DQ,alt:"invoke-ai-logo"}),ld("h1",{children:["invoke ",sd("strong",{children:"ai"})]})]}),ld("div",{className:"site-header-right-side",children:[sd(Coe,{}),sd(Poe,{}),sd(voe,{children:sd(dZ,{"aria-label":"Hotkeys",tooltip:"Hotkeys",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:sd(XY,{})})}),sd(Eoe,{}),sd(dZ,{"aria-label":"Report Bug",tooltip:"Report Bug",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:sd(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:sd(NY,{})})}),sd(dZ,{"aria-label":"Link to Github Repo",tooltip:"Github",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:sd(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:sd(LY,{})})}),sd(dZ,{"aria-label":"Link to Discord Server",tooltip:"Discord",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:sd(MI,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:sd(EY,{})})}),sd(Soe,{children:sd(dZ,{"aria-label":"Settings",tooltip:"Settings",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:sd(vX,{})})})]})]}),Aoe=cU((e=>e.system),(e=>e.log),{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),Toe=cU((e=>e.system),(e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen})),{memoizeOptions:{resultEqualityCheck:EG.exports.isEqual}}),Ooe=()=>{const e=noe(),t=roe(Aoe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:o}=roe(Toe),[a,s]=i.exports.useState(!0),l=i.exports.useRef(null);i.exports.useLayoutEffect((()=>{null!==l.current&&a&&(l.current.scrollTop=l.current.scrollHeight)}),[a,t,n]);Eq("`",(()=>{e(ZZ(!n))}),[n]),Eq("esc",(()=>{e(ZZ(!1))}));return ld(ad,{children:[n&&sd(VJ,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:sd("div",{className:"console",ref:l,onScroll:()=>{l.current&&a&&l.current.scrollTop{const{timestamp:n,message:r,level:o}=e;return ld("div",{className:`console-entry console-${o}-color`,children:[ld("p",{className:"console-timestamp",children:[n,":"]}),sd("p",{className:"console-message",children:r})]},t)}))})}),n&&sd(qH,{hasArrow:!0,label:a?"Autoscroll On":"Autoscroll Off",children:sd(DT,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":a,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:sd(PY,{}),onClick:()=>s(!a)})}),sd(qH,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:sd(DT,{className:"console-toggle-icon-button","data-error-seen":r||!o,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:sd(n?JY:zY,{}),onClick:()=>{e(iY()),e(ZZ(!n))}})})]})};var Ioe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Roe(e,t){var n=function(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=Ioe.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!=typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"==typeof t?t:"string"==typeof r&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var Noe=[".DS_Store","Thumbs.db"];function Doe(e){return"object"==typeof e&&null!==e}function zoe(e){return Hoe(e.target.files).map((function(e){return Roe(e)}))}function Boe(e){return pA(this,void 0,void 0,(function(){return gA(this,(function(t){switch(t.label){case 0:return[4,Promise.all(e.map((function(e){return e.getFile()})))];case 1:return[2,t.sent().map((function(e){return Roe(e)}))]}}))}))}function Foe(e,t){return pA(this,void 0,void 0,(function(){var n;return gA(this,(function(r){switch(r.label){case 0:return e.items?(n=Hoe(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(Woe))]):[3,2];case 1:return[2,joe(Uoe(r.sent()))];case 2:return[2,joe(Hoe(e.files).map((function(e){return Roe(e)})))]}}))}))}function joe(e){return e.filter((function(e){return-1===Noe.indexOf(e.name)}))}function Hoe(e){if(null===e)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,nie(n)];if(e.sizen)return[!1,nie(n)]}return[!0,null]}function sie(e){return null!=e}function lie(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,s=e.validator;return!(!i&&t.length>1||i&&a>=1&&t.length>a)&&t.every((function(e){var t=Qoe(iie(e,n),1)[0],i=Qoe(aie(e,r,o),1)[0],a=s?s(e):null;return t&&i&&!a}))}function cie(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function uie(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,(function(e){return"Files"===e||"application/x-moz-file"===e})):!!e.target&&!!e.target.files}function die(e){e.preventDefault()}function hie(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function fie(e){return-1!==e.indexOf("Edge/")}function pie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return hie(e)||fie(e)}function gie(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Nie=i.exports.forwardRef((function(e,t){var n=e.children,r=Bie(Rie(e,kie)),o=r.open,a=Rie(r,Cie);return i.exports.useImperativeHandle(t,(function(){return{open:o}}),[o]),sd(i.exports.Fragment,{children:n(Oie(Oie({},a),{},{open:o}))})}));Nie.displayName="Dropzone";var Die={disabled:!1,getFilesFromEvent:function(e){return pA(this,void 0,void 0,(function(){return gA(this,(function(t){return Doe(e)&&function(e){return Doe(e)}(e.dataTransfer)?[2,Foe(e.dataTransfer,e.type)]:function(e){return Doe(e)&&Doe(e.target)}(e)?[2,zoe(e)]:Array.isArray(e)&&e.every((function(e){return"getFile"in e&&"function"==typeof e.getFile}))?[2,Boe(e)]:[2,[]]}))}))},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};Nie.defaultProps=Die,Nie.propTypes={children:gD.exports.func,accept:gD.exports.objectOf(gD.exports.arrayOf(gD.exports.string)),multiple:gD.exports.bool,preventDropOnDocument:gD.exports.bool,noClick:gD.exports.bool,noKeyboard:gD.exports.bool,noDrag:gD.exports.bool,noDragEventsBubbling:gD.exports.bool,minSize:gD.exports.number,maxSize:gD.exports.number,maxFiles:gD.exports.number,disabled:gD.exports.bool,getFilesFromEvent:gD.exports.func,onFileDialogCancel:gD.exports.func,onFileDialogOpen:gD.exports.func,useFsAccessApi:gD.exports.bool,autoFocus:gD.exports.bool,onDragEnter:gD.exports.func,onDragLeave:gD.exports.func,onDragOver:gD.exports.func,onDrop:gD.exports.func,onDropAccepted:gD.exports.func,onDropRejected:gD.exports.func,onError:gD.exports.func,validator:gD.exports.func};var zie={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Bie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Oie(Oie({},Die),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,a=t.maxSize,s=t.minSize,l=t.multiple,c=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,f=t.onDrop,p=t.onDropAccepted,g=t.onDropRejected,m=t.onFileDialogCancel,v=t.onFileDialogOpen,b=t.useFsAccessApi,y=t.autoFocus,x=t.preventDropOnDocument,w=t.noClick,S=t.noKeyboard,k=t.noDrag,C=t.noDragEventsBubbling,_=t.onError,E=t.validator,L=i.exports.useMemo((function(){return bie(n)}),[n]),P=i.exports.useMemo((function(){return vie(n)}),[n]),M=i.exports.useMemo((function(){return"function"==typeof v?v:jie}),[v]),A=i.exports.useMemo((function(){return"function"==typeof m?m:jie}),[m]),T=i.exports.useRef(null),O=i.exports.useRef(null),I=i.exports.useReducer(Fie,zie),R=Pie(I,2),N=R[0],D=R[1],z=N.isFocused,B=N.isFileDialogActive,F=i.exports.useRef("undefined"!=typeof window&&window.isSecureContext&&b&&mie()),j=function(){!F.current&&B&&setTimeout((function(){O.current&&(O.current.files.length||(D({type:"closeDialog"}),A()))}),300)};i.exports.useEffect((function(){return window.addEventListener("focus",j,!1),function(){window.removeEventListener("focus",j,!1)}}),[O,B,A,F]);var H=i.exports.useRef([]),W=function(e){T.current&&T.current.contains(e.target)||(e.preventDefault(),H.current=[])};i.exports.useEffect((function(){return x&&(document.addEventListener("dragover",die,!1),document.addEventListener("drop",W,!1)),function(){x&&(document.removeEventListener("dragover",die),document.removeEventListener("drop",W))}}),[T,x]),i.exports.useEffect((function(){return!r&&y&&T.current&&T.current.focus(),function(){}}),[T,y,r]);var U=i.exports.useCallback((function(e){_?_(e):console.error(e)}),[_]),V=i.exports.useCallback((function(e){e.preventDefault(),e.persist(),re(e),H.current=[].concat(Lie(H.current),[e.target]),uie(e)&&Promise.resolve(o(e)).then((function(t){if(!cie(e)||C){var n=t.length,r=n>0&&lie({files:t,accept:L,minSize:s,maxSize:a,multiple:l,maxFiles:c,validator:E});D({isDragAccept:r,isDragReject:n>0&&!r,isDragActive:!0,type:"setDraggedFiles"}),u&&u(e)}})).catch((function(e){return U(e)}))}),[o,u,U,C,L,s,a,l,c,E]),G=i.exports.useCallback((function(e){e.preventDefault(),e.persist(),re(e);var t=uie(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(n){}return t&&h&&h(e),!1}),[h,C]),$=i.exports.useCallback((function(e){e.preventDefault(),e.persist(),re(e);var t=H.current.filter((function(e){return T.current&&T.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),H.current=t,t.length>0||(D({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uie(e)&&d&&d(e))}),[T,d,C]),q=i.exports.useCallback((function(e,t){var n=[],r=[];e.forEach((function(e){var t=Pie(iie(e,L),2),o=t[0],i=t[1],l=Pie(aie(e,s,a),2),c=l[0],u=l[1],d=E?E(e):null;if(o&&c&&!d)n.push(e);else{var h=[i,u];d&&(h=h.concat(d)),r.push({file:e,errors:h.filter((function(e){return e}))})}})),(!l&&n.length>1||l&&c>=1&&n.length>c)&&(n.forEach((function(e){r.push({file:e,errors:[oie]})})),n.splice(0)),D({acceptedFiles:n,fileRejections:r,type:"setFiles"}),f&&f(n,r,t),r.length>0&&g&&g(r,t),n.length>0&&p&&p(n,t)}),[D,l,L,s,a,c,f,p,g,E]),Z=i.exports.useCallback((function(e){e.preventDefault(),e.persist(),re(e),H.current=[],uie(e)&&Promise.resolve(o(e)).then((function(t){cie(e)&&!C||q(t,e)})).catch((function(e){return U(e)})),D({type:"reset"})}),[o,q,U,C]),Y=i.exports.useCallback((function(){if(F.current){D({type:"openDialog"}),M();var e={multiple:l,types:P};window.showOpenFilePicker(e).then((function(e){return o(e)})).then((function(e){q(e,null),D({type:"closeDialog"})})).catch((function(e){yie(e)?(A(e),D({type:"closeDialog"})):xie(e)?(F.current=!1,O.current?(O.current.value=null,O.current.click()):U(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):U(e)}))}else O.current&&(D({type:"openDialog"}),M(),O.current.value=null,O.current.click())}),[D,M,A,b,q,U,P,l]),X=i.exports.useCallback((function(e){T.current&&T.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),Y()))}),[T,Y]),K=i.exports.useCallback((function(){D({type:"focus"})}),[]),Q=i.exports.useCallback((function(){D({type:"blur"})}),[]),J=i.exports.useCallback((function(){w||(pie()?setTimeout(Y,0):Y())}),[w,Y]),ee=function(e){return r?null:e},te=function(e){return S?null:ee(e)},ne=function(e){return k?null:ee(e)},re=function(e){C&&e.stopPropagation()},oe=i.exports.useMemo((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,o=e.role,i=e.onKeyDown,a=e.onFocus,s=e.onBlur,l=e.onClick,c=e.onDragEnter,u=e.onDragOver,d=e.onDragLeave,h=e.onDrop,f=Rie(e,_ie);return Oie(Oie(Iie({onKeyDown:te(gie(i,X)),onFocus:te(gie(a,K)),onBlur:te(gie(s,Q)),onClick:ee(gie(l,J)),onDragEnter:ne(gie(c,V)),onDragOver:ne(gie(u,G)),onDragLeave:ne(gie(d,$)),onDrop:ne(gie(h,Z)),role:"string"==typeof o&&""!==o?o:"presentation"},n,T),r||S?{}:{tabIndex:0}),f)}}),[T,X,K,Q,J,V,G,$,Z,S,k,r]),ie=i.exports.useCallback((function(e){e.stopPropagation()}),[]),ae=i.exports.useMemo((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.onChange,o=e.onClick,i=Rie(e,Eie),a=Iie({accept:L,multiple:l,type:"file",style:{display:"none"},onChange:ee(gie(r,Z)),onClick:ee(gie(o,ie)),tabIndex:-1},n,O);return Oie(Oie({},a),i)}}),[O,n,l,Z,r]);return Oie(Oie({},N),{},{isFocused:z&&!r,getRootProps:oe,getInputProps:ae,rootRef:T,inputRef:O,open:ee(Y)})}function Fie(e,t){switch(t.type){case"focus":return Oie(Oie({},e),{},{isFocused:!0});case"blur":return Oie(Oie({},e),{},{isFocused:!1});case"openDialog":return Oie(Oie({},zie),{},{isFileDialogActive:!0});case"closeDialog":return Oie(Oie({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Oie(Oie({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Oie(Oie({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Oie({},zie);default:return e}}function jie(){}const Hie=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:o}=e;return Eq("esc",(()=>{o(!1)})),ld("div",{className:"dropzone-container",children:[t&&sd("div",{className:"dropzone-overlay is-drag-accept",children:ld(LI,{size:"lg",children:["Upload Image",r]})}),n&&ld("div",{className:"dropzone-overlay is-drag-reject",children:[sd(LI,{size:"lg",children:"Invalid Upload"}),sd(LI,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},Wie=e=>async(t,n)=>{const{imageFile:r}=e,o=n(),i=RZ(o),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const s=await fetch(window.location.origin+"/upload",{method:"POST",body:a}),l=await s.json();console.log(l);const c={uuid:_ee(),category:"user",...l};t(ZQ({image:c,category:"user"})),"unifiedCanvas"===i?t(QK(c)):"img2img"===i&&t(Hte(c))},Uie=e=>{const{children:t}=e,n=noe(),r=roe(RZ),o=DH({}),[a,s]=i.exports.useState(!1),{setOpenUploader:l}=Tee(),c=i.exports.useCallback((e=>{s(!0);const t=e.errors.reduce(((e,t)=>e+"\n"+t.message),"");o({title:"Upload failed",description:t,status:"error",isClosable:!0})}),[o]),u=i.exports.useCallback((async e=>{n(Wie({imageFile:e}))}),[n]),d=i.exports.useCallback(((e,t)=>{t.forEach((e=>{c(e)})),e.forEach((e=>{u(e)}))}),[u,c]),{getRootProps:h,getInputProps:f,isDragAccept:p,isDragReject:g,isDragActive:m,open:v}=Bie({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:d,onDragOver:()=>s(!0),maxFiles:1});l(v),i.exports.useEffect((()=>{const e=e=>{const t=e.clipboardData?.items;if(!t)return;const r=[];for(const n of t)"file"===n.kind&&["image/png","image/jpg"].includes(n.type)&&r.push(n);if(!r.length)return;if(e.stopImmediatePropagation(),r.length>1)return void o({description:"Multiple images pasted, may only upload one image at a time",status:"error",isClosable:!0});const i=r[0].getAsFile();i?n(Wie({imageFile:i})):o({description:"Unable to load file",status:"error",isClosable:!0})};return document.addEventListener("paste",e),()=>{document.removeEventListener("paste",e)}}),[n,o,r]);const b=["img2img","unifiedCanvas"].includes(r)?` to ${xte[r].tooltip}`:"";return sd(jQ.Provider,{value:v,children:ld("div",{...h({style:{}}),onKeyDown:e=>{e.key},children:[sd("input",{...f()}),t,m&&a&&sd(Hie,{isDragAccept:p,isDragReject:g,overlaySecondaryText:b,setIsHandlingUpload:s})]})})},Vie=cU([e=>e.options,e=>e.gallery,RZ],((e,t,n)=>{const{shouldPinOptionsPanel:r,shouldShowOptionsPanel:o,shouldHoldOptionsPanelOpen:i,shouldUseCanvasBetaLayout:a}=e,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:c}=t,u=a&&"unifiedCanvas"===n;return{shouldPinOptionsPanel:r,shouldShowProcessButtons:!(u||r&&o),shouldShowOptionsPanelButton:!u&&!(o||i&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),shouldShowOptionsPanel:o,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:!(s||c&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n)}}),{memoizeOptions:{resultEqualityCheck:LG.isEqual}}),Gie=()=>{const e=noe(),{shouldShowOptionsPanel:t,shouldShowOptionsPanelButton:n,shouldShowProcessButtons:r,shouldPinOptionsPanel:o,shouldShowGallery:i,shouldPinGallery:a}=roe(Vie);return Eq("f",(()=>{i||t?(e(hne(!1)),e(rJ(!1))):(e(hne(!0)),e(rJ(!0))),(a||o)&&setTimeout((()=>e(KK(!0))),400)}),[i,t]),n?ld("div",{className:"show-hide-button-options",children:[sd(dZ,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:()=>{e(hne(!0)),o&&setTimeout((()=>e(KK(!0))),400)},children:sd(dX,{})}),r&&ld(ad,{children:[sd(HX,{iconButton:!0}),sd(UX,{})]})]}):null},$ie=()=>{const e=noe(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowOptionsPanel:o,shouldPinOptionsPanel:i}=roe(Vie);return Eq("f",(()=>{t||o?(e(hne(!1)),e(rJ(!1))):(e(hne(!0)),e(rJ(!0))),(r||i)&&setTimeout((()=>e(KK(!0))),400)}),[t,o]),n?sd(dZ,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:()=>{e(rJ(!0)),r&&e(KK(!0))},children:sd(bY,{})}):null};!function(){const e=()=>{(async function(e=""){return await fetch(e,{method:"GET",cache:"no-cache"})})(document.location+"/flaskwebgui-keep-server-alive").then((e=>e))};({BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}).NODE_ENV&&"production"!=={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV||document.addEventListener("DOMContentLoaded",(()=>{e(),setInterval(e,3e3)}))}();const qie=()=>((()=>{const e=noe(),t=roe(yX),n=DH();i.exports.useEffect((()=>{t.forEach((e=>{n(e)})),t.length>0&&e(fY())}),[e,n,t])})(),ld("div",{className:"App",children:[ld(Uie,{children:[sd(goe,{}),ld("div",{className:"app-content",children:[sd(Moe,{}),sd(Ste,{})]}),sd("div",{className:"app-console",children:sd(Ooe,{})})]}),sd(Gie,{}),sd($ie,{})]})),Zie=function(e,t,n){var r=n||!1,o=eU(cG,lG,t&&t.enhancer?t.enhancer:void 0),i=function(e){o.dispatch({type:VV,key:e})},a=function(t,n,i){var a={type:jV,payload:n,err:i,key:t};e.dispatch(a),o.dispatch(a),r&&s.getState().bootstrapped&&(r(),r=!1)},s=aG({},o,{purge:function(){var t=[];return e.dispatch({type:UV,result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:FV,result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:HV})},persist:function(){e.dispatch({type:WV,register:i,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}(toe),Yie=gp({key:"invokeai-style-cache",prepend:!0});W.createRoot(document.getElementById("root")).render(sd(j.StrictMode,{children:sd(OV,{store:toe,children:sd(hoe,{loading:sd(foe,{}),persistor:Zie,children:sd(ag,{value:Yie,children:sd(YH,{children:sd(qie,{})})})})})}))}}}))}(); diff --git a/frontend/dist/assets/index.d8f54146.js b/frontend/dist/assets/index.4a434b56.js similarity index 89% rename from frontend/dist/assets/index.d8f54146.js rename to frontend/dist/assets/index.4a434b56.js index 464fa974c4..e121cff6b4 100644 --- a/frontend/dist/assets/index.d8f54146.js +++ b/frontend/dist/assets/index.4a434b56.js @@ -473,7 +473,7 @@ __p += '`),tn&&(Ae+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Ae+`return __p -}`;var Ht=HE(function(){return en(F,ft+"return "+Ae).apply(n,Y)});if(Ht.source=Ae,Jb(Ht))throw Ht;return Ht}function zq(c){return _n(c).toLowerCase()}function Fq(c){return _n(c).toUpperCase()}function $q(c,p,x){if(c=_n(c),c&&(x||p===n))return Xi(c);if(!c||!(p=Ji(p)))return c;var A=Fi(c),N=Fi(p),F=Ko(A,N),Y=rs(A,N)+1;return cs(A,F,Y).join("")}function Hq(c,p,x){if(c=_n(c),c&&(x||p===n))return c.slice(0,rg(c)+1);if(!c||!(p=Ji(p)))return c;var A=Fi(c),N=rs(A,Fi(p))+1;return cs(A,0,N).join("")}function Wq(c,p,x){if(c=_n(c),c&&(x||p===n))return c.replace(qu,"");if(!c||!(p=Ji(p)))return c;var A=Fi(c),N=Ko(A,Fi(p));return cs(A,N).join("")}function Vq(c,p){var x=H,A=j;if(ur(p)){var N="separator"in p?p.separator:N;x="length"in p?Bt(p.length):x,A="omission"in p?Ji(p.omission):A}c=_n(c);var F=c.length;if(Jl(c)){var Y=Fi(c);F=Y.length}if(x>=F)return c;var Q=x-Pa(A);if(Q<1)return A;var ce=Y?cs(Y,0,Q).join(""):c.slice(0,Q);if(N===n)return ce+A;if(Y&&(Q+=ce.length-Q),ex(N)){if(c.slice(Q).search(N)){var _e,ke=ce;for(N.global||(N=rf(N.source,_n(Ja.exec(N))+"g")),N.lastIndex=0;_e=N.exec(ke);)var Ae=_e.index;ce=ce.slice(0,Ae===n?Q:Ae)}}else if(c.indexOf(Ji(N),Q)!=Q){var je=ce.lastIndexOf(N);je>-1&&(ce=ce.slice(0,je))}return ce+A}function Uq(c){return c=_n(c),c&&D1.test(c)?c.replace($r,z2):c}var Gq=al(function(c,p,x){return c+(x?" ":"")+p.toUpperCase()}),rx=Ap("toUpperCase");function $E(c,p,x){return c=_n(c),p=x?n:p,p===n?Qh(c)?nf(c):eg(c):c.match(p)||[]}var HE=Pt(function(c,p){try{return Ci(c,n,p)}catch(x){return Jb(x)?x:new Tt(x)}}),jq=nr(function(c,p){return jn(p,function(x){x=sl(x),Jo(c,x,Zb(c[x],c))}),c});function Yq(c){var p=c==null?0:c.length,x=Le();return c=p?Hn(c,function(A){if(typeof A[1]!="function")throw new _i(a);return[x(A[0]),A[1]]}):[],Pt(function(A){for(var N=-1;++NG)return[];var x=me,A=ei(c,me);p=Le(p),c-=me;for(var N=Jd(A,p);++x0||p<0)?new Yt(x):(c<0?x=x.takeRight(-c):c&&(x=x.drop(c)),p!==n&&(p=Bt(p),x=p<0?x.dropRight(-p):x.take(p-c)),x)},Yt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Yt.prototype.toArray=function(){return this.take(me)},na(Yt.prototype,function(c,p){var x=/^(?:filter|find|map|reject)|While$/.test(p),A=/^(?:head|last)$/.test(p),N=z[A?"take"+(p=="last"?"Right":""):p],F=A||/^find/.test(p);!N||(z.prototype[p]=function(){var Y=this.__wrapped__,Q=A?[1]:arguments,ce=Y instanceof Yt,_e=Q[0],ke=ce||Dt(Y),Ae=function(qt){var tn=N.apply(z,Ea([qt],Q));return A&&je?tn[0]:tn};ke&&x&&typeof _e=="function"&&_e.length!=1&&(ce=ke=!1);var je=this.__chain__,ft=!!this.__actions__.length,wt=F&&!je,Ht=ce&&!ft;if(!F&&ke){Y=Ht?Y:new Yt(this);var Ct=c.apply(Y,Q);return Ct.__actions__.push({func:uy,args:[Ae],thisArg:n}),new Zi(Ct,je)}return wt&&Ht?c.apply(this,Q):(Ct=this.thru(Ae),wt?A?Ct.value()[0]:Ct.value():Ct)})}),jn(["pop","push","shift","sort","splice","unshift"],function(c){var p=lc[c],x=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",A=/^(?:pop|shift)$/.test(c);z.prototype[c]=function(){var N=arguments;if(A&&!this.__chain__){var F=this.value();return p.apply(Dt(F)?F:[],N)}return this[x](function(Y){return p.apply(Dt(Y)?Y:[],N)})}}),na(Yt.prototype,function(c,p){var x=z[p];if(x){var A=x.name+"";rn.call(os,A)||(os[A]=[]),os[A].push({name:p,func:x})}}),os[wf(n,E).name]=[{name:"wrapper",func:n}],Yt.prototype.clone=$i,Yt.prototype.reverse=Ei,Yt.prototype.value=Y2,z.prototype.at=xj,z.prototype.chain=wj,z.prototype.commit=Cj,z.prototype.next=_j,z.prototype.plant=Ej,z.prototype.reverse=Pj,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=Tj,z.prototype.first=z.prototype.head,hc&&(z.prototype[hc]=kj),z},Ta=yo();Gt?((Gt.exports=Ta)._=Ta,At._=Ta):yt._=Ta}).call(Cs)})(ii,ii.exports);const He=ii.exports;var m3e=Object.create,nH=Object.defineProperty,v3e=Object.getOwnPropertyDescriptor,y3e=Object.getOwnPropertyNames,S3e=Object.getPrototypeOf,b3e=Object.prototype.hasOwnProperty,Fe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),x3e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of y3e(t))!b3e.call(e,i)&&i!==n&&nH(e,i,{get:()=>t[i],enumerable:!(r=v3e(t,i))||r.enumerable});return e},rH=(e,t,n)=>(n=e!=null?m3e(S3e(e)):{},x3e(t||!e||!e.__esModule?nH(n,"default",{value:e,enumerable:!0}):n,e)),w3e=Fe((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),iH=Fe((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),sb=Fe((e,t)=>{var n=iH();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),C3e=Fe((e,t)=>{var n=sb(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),_3e=Fe((e,t)=>{var n=sb();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),k3e=Fe((e,t)=>{var n=sb();function r(i){return n(this.__data__,i)>-1}t.exports=r}),E3e=Fe((e,t)=>{var n=sb();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),lb=Fe((e,t)=>{var n=w3e(),r=C3e(),i=_3e(),o=k3e(),a=E3e();function s(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u{var n=lb();function r(){this.__data__=new n,this.size=0}t.exports=r}),T3e=Fe((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),L3e=Fe((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),A3e=Fe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),oH=Fe((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),$u=Fe((e,t)=>{var n=oH(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),X_=Fe((e,t)=>{var n=$u(),r=n.Symbol;t.exports=r}),M3e=Fe((e,t)=>{var n=X_(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),h=l[a];try{l[a]=void 0;var g=!0}catch(v){}var m=o.call(l);return g&&(u?l[a]=h:delete l[a]),m}t.exports=s}),R3e=Fe((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),ub=Fe((e,t)=>{var n=X_(),r=M3e(),i=R3e(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),aH=Fe((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),sH=Fe((e,t)=>{var n=ub(),r=aH(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var h=n(u);return h==o||h==a||h==i||h==s}t.exports=l}),O3e=Fe((e,t)=>{var n=$u(),r=n["__core-js_shared__"];t.exports=r}),I3e=Fe((e,t)=>{var n=O3e(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),lH=Fe((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch(a){}try{return o+""}catch(a){}}return""}t.exports=i}),D3e=Fe((e,t)=>{var n=sH(),r=I3e(),i=aH(),o=lH(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,h=l.toString,g=u.hasOwnProperty,m=RegExp("^"+h.call(g).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var w=n(b)?m:s;return w.test(o(b))}t.exports=v}),N3e=Fe((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),T1=Fe((e,t)=>{var n=D3e(),r=N3e();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),Z_=Fe((e,t)=>{var n=T1(),r=$u(),i=n(r,"Map");t.exports=i}),cb=Fe((e,t)=>{var n=T1(),r=n(Object,"create");t.exports=r}),B3e=Fe((e,t)=>{var n=cb();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),z3e=Fe((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),F3e=Fe((e,t)=>{var n=cb(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),$3e=Fe((e,t)=>{var n=cb(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),H3e=Fe((e,t)=>{var n=cb(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),W3e=Fe((e,t)=>{var n=B3e(),r=z3e(),i=F3e(),o=$3e(),a=H3e();function s(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u{var n=W3e(),r=lb(),i=Z_();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),U3e=Fe((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),db=Fe((e,t)=>{var n=U3e();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),G3e=Fe((e,t)=>{var n=db();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),j3e=Fe((e,t)=>{var n=db();function r(i){return n(this,i).get(i)}t.exports=r}),Y3e=Fe((e,t)=>{var n=db();function r(i){return n(this,i).has(i)}t.exports=r}),q3e=Fe((e,t)=>{var n=db();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),uH=Fe((e,t)=>{var n=V3e(),r=G3e(),i=j3e(),o=Y3e(),a=q3e();function s(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u{var n=lb(),r=Z_(),i=uH(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var h=u.__data__;if(!r||h.length{var n=lb(),r=P3e(),i=T3e(),o=L3e(),a=A3e(),s=K3e();function l(u){var h=this.__data__=new n(u);this.size=h.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),Z3e=Fe((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),Q3e=Fe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),J3e=Fe((e,t)=>{var n=uH(),r=Z3e(),i=Q3e();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),cH=Fe((e,t)=>{var n=J3e(),r=e5e(),i=t5e(),o=1,a=2;function s(l,u,h,g,m,v){var b=h&o,w=l.length,P=u.length;if(w!=P&&!(b&&P>w))return!1;var E=v.get(l),_=v.get(u);if(E&&_)return E==u&&_==l;var T=-1,M=!0,O=h&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=$u(),r=n.Uint8Array;t.exports=r}),r5e=Fe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),i5e=Fe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),o5e=Fe((e,t)=>{var n=X_(),r=n5e(),i=iH(),o=cH(),a=r5e(),s=i5e(),l=1,u=2,h="[object Boolean]",g="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",w="[object RegExp]",P="[object Set]",E="[object String]",_="[object Symbol]",T="[object ArrayBuffer]",M="[object DataView]",O=n?n.prototype:void 0,I=O?O.valueOf:void 0;function D(B,$,H,j,ne,V,q){switch(H){case M:if(B.byteLength!=$.byteLength||B.byteOffset!=$.byteOffset)return!1;B=B.buffer,$=$.buffer;case T:return!(B.byteLength!=$.byteLength||!V(new r(B),new r($)));case h:case g:case b:return i(+B,+$);case m:return B.name==$.name&&B.message==$.message;case w:case E:return B==$+"";case v:var te=a;case P:var J=j&l;if(te||(te=s),B.size!=$.size&&!J)return!1;var Z=q.get(B);if(Z)return Z==$;j|=u,q.set(B,$);var G=o(te(B),te($),j,ne,V,q);return q.delete(B),G;case _:if(I)return I.call(B)==I.call($)}return!1}t.exports=D}),a5e=Fe((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),s5e=Fe((e,t)=>{var n=a5e(),r=Q_();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),l5e=Fe((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),c5e=Fe((e,t)=>{var n=l5e(),r=u5e(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),d5e=Fe((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),f5e=Fe((e,t)=>{var n=ub(),r=fb(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),h5e=Fe((e,t)=>{var n=f5e(),r=fb(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),p5e=Fe((e,t)=>{function n(){return!1}t.exports=n}),dH=Fe((e,t)=>{var n=$u(),r=p5e(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),g5e=Fe((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a!=null?a:n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),m5e=Fe((e,t)=>{var n=ub(),r=fH(),i=fb(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",h="[object Function]",g="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",w="[object Set]",P="[object String]",E="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",M="[object Float32Array]",O="[object Float64Array]",I="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",$="[object Uint8Array]",H="[object Uint8ClampedArray]",j="[object Uint16Array]",ne="[object Uint32Array]",V={};V[M]=V[O]=V[I]=V[D]=V[B]=V[$]=V[H]=V[j]=V[ne]=!0,V[o]=V[a]=V[_]=V[s]=V[T]=V[l]=V[u]=V[h]=V[g]=V[m]=V[v]=V[b]=V[w]=V[P]=V[E]=!1;function q(te){return i(te)&&r(te.length)&&!!V[n(te)]}t.exports=q}),v5e=Fe((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),y5e=Fe((e,t)=>{var n=oH(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch(u){}}();t.exports=s}),hH=Fe((e,t)=>{var n=m5e(),r=v5e(),i=y5e(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),S5e=Fe((e,t)=>{var n=d5e(),r=h5e(),i=Q_(),o=dH(),a=g5e(),s=hH(),l=Object.prototype,u=l.hasOwnProperty;function h(g,m){var v=i(g),b=!v&&r(g),w=!v&&!b&&o(g),P=!v&&!b&&!w&&s(g),E=v||b||w||P,_=E?n(g.length,String):[],T=_.length;for(var M in g)(m||u.call(g,M))&&!(E&&(M=="length"||w&&(M=="offset"||M=="parent")||P&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||a(M,T)))&&_.push(M);return _}t.exports=h}),b5e=Fe((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),x5e=Fe((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),w5e=Fe((e,t)=>{var n=x5e(),r=n(Object.keys,Object);t.exports=r}),C5e=Fe((e,t)=>{var n=b5e(),r=w5e(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),_5e=Fe((e,t)=>{var n=sH(),r=fH();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),k5e=Fe((e,t)=>{var n=S5e(),r=C5e(),i=_5e();function o(a){return i(a)?n(a):r(a)}t.exports=o}),E5e=Fe((e,t)=>{var n=s5e(),r=c5e(),i=k5e();function o(a){return n(a,i,r)}t.exports=o}),P5e=Fe((e,t)=>{var n=E5e(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,h,g,m){var v=u&r,b=n(s),w=b.length,P=n(l),E=P.length;if(w!=E&&!v)return!1;for(var _=w;_--;){var T=b[_];if(!(v?T in l:o.call(l,T)))return!1}var M=m.get(s),O=m.get(l);if(M&&O)return M==l&&O==s;var I=!0;m.set(s,l),m.set(l,s);for(var D=v;++_{var n=T1(),r=$u(),i=n(r,"DataView");t.exports=i}),L5e=Fe((e,t)=>{var n=T1(),r=$u(),i=n(r,"Promise");t.exports=i}),A5e=Fe((e,t)=>{var n=T1(),r=$u(),i=n(r,"Set");t.exports=i}),M5e=Fe((e,t)=>{var n=T1(),r=$u(),i=n(r,"WeakMap");t.exports=i}),R5e=Fe((e,t)=>{var n=T5e(),r=Z_(),i=L5e(),o=A5e(),a=M5e(),s=ub(),l=lH(),u="[object Map]",h="[object Object]",g="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",w=l(n),P=l(r),E=l(i),_=l(o),T=l(a),M=s;(n&&M(new n(new ArrayBuffer(1)))!=b||r&&M(new r)!=u||i&&M(i.resolve())!=g||o&&M(new o)!=m||a&&M(new a)!=v)&&(M=function(O){var I=s(O),D=I==h?O.constructor:void 0,B=D?l(D):"";if(B)switch(B){case w:return b;case P:return u;case E:return g;case _:return m;case T:return v}return I}),t.exports=M}),O5e=Fe((e,t)=>{var n=X3e(),r=cH(),i=o5e(),o=P5e(),a=R5e(),s=Q_(),l=dH(),u=hH(),h=1,g="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,w=b.hasOwnProperty;function P(E,_,T,M,O,I){var D=s(E),B=s(_),$=D?m:a(E),H=B?m:a(_);$=$==g?v:$,H=H==g?v:H;var j=$==v,ne=H==v,V=$==H;if(V&&l(E)){if(!l(_))return!1;D=!0,j=!1}if(V&&!j)return I||(I=new n),D||u(E)?r(E,_,T,M,O,I):i(E,_,$,T,M,O,I);if(!(T&h)){var q=j&&w.call(E,"__wrapped__"),te=ne&&w.call(_,"__wrapped__");if(q||te){var J=q?E.value():E,Z=te?_.value():_;return I||(I=new n),O(J,Z,T,M,I)}}return V?(I||(I=new n),o(E,_,T,M,O,I)):!1}t.exports=P}),I5e=Fe((e,t)=>{var n=O5e(),r=fb();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),pH=Fe((e,t)=>{var n=I5e();function r(i,o){return n(i,o)}t.exports=r}),D5e=["ctrl","shift","alt","meta","mod"],N5e={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function Bw(e,t=","){return typeof e=="string"?e.split(t):e}function rv(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>N5e[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!D5e.includes(o));return{...r,keys:i}}function B5e(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function z5e(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function F5e(e){return gH(e,["input","textarea","select"])}function gH({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function $5e(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var H5e=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:h,metaKey:g,shiftKey:m,key:v,code:b}=e,w=b.toLowerCase().replace("key",""),P=v.toLowerCase();if(u!==r&&P!=="alt"||m!==s&&P!=="shift")return!1;if(a){if(!g&&!h)return!1}else if(g!==o&&w!=="meta"||h!==i&&w!=="ctrl")return!1;return l&&l.length===1&&(l.includes(P)||l.includes(w))?!0:l?l.every(E=>n.has(E)):!l},W5e=C.exports.createContext(void 0),V5e=()=>C.exports.useContext(W5e),U5e=C.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),G5e=()=>C.exports.useContext(U5e),j5e=rH(pH());function Y5e(e){let t=C.exports.useRef(void 0);return(0,j5e.default)(t.current,e)||(t.current=e),t.current}var fM=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Ue(e,t,n,r){let i=C.exports.useRef(null),{current:o}=C.exports.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=C.exports.useCallback(t,[...s]),u=Y5e(a),{enabledScopes:h}=G5e(),g=V5e();return C.exports.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!$5e(h,u==null?void 0:u.scopes))return;let m=w=>{var P;if(!(F5e(w)&&!gH(w,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){fM(w);return}((P=w.target)==null?void 0:P.isContentEditable)&&!(u!=null&&u.enableOnContentEditable)||Bw(e,u==null?void 0:u.splitKey).forEach(E=>{var T;let _=rv(E,u==null?void 0:u.combinationKey);if(H5e(w,_,o)||((T=_.keys)==null?void 0:T.includes("*"))){if(B5e(w,_,u==null?void 0:u.preventDefault),!z5e(w,_,u==null?void 0:u.enabled)){fM(w);return}l(w,_)}})}},v=w=>{o.add(w.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||(u==null?void 0:u.keydown))&&m(w)},b=w=>{w.key.toLowerCase()!=="meta"?o.delete(w.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(w)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),g&&Bw(e,u==null?void 0:u.splitKey).forEach(w=>g.addHotkey(rv(w,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),g&&Bw(e,u==null?void 0:u.splitKey).forEach(w=>g.removeHotkey(rv(w,u==null?void 0:u.combinationKey)))}},[e,l,u,h]),i}rH(pH());var g7=new Set;function q5e(e){(Array.isArray(e)?e:[e]).forEach(t=>g7.add(rv(t)))}function K5e(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=rv(t);for(let i of g7)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&g7.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{q5e(e.key)}),document.addEventListener("keyup",e=>{K5e(e.key)})});function X5e(){return X("div",{className:"work-in-progress nodes-work-in-progress",children:[S("h1",{children:"Nodes"}),S("p",{children:"A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature."})]})}const Z5e=()=>X("div",{className:"work-in-progress post-processing-work-in-progress",children:[S("h1",{children:"Post Processing"}),S("p",{children:"Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image and Image To Image tabs. You can also process images directly, using the image action buttons above the current image display or in the viewer."}),S("p",{children:"A dedicated UI will be released soon to facilitate more advanced post processing workflows."}),S("p",{children:"The Invoke AI Command Line Interface offers various other features including Embiggen."})]}),Q5e=ut({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:S("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),J5e=ut({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),e4e=ut({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),t4e=ut({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:S("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:S("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})});var Yi=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(Yi||{});const n4e={[0]:{text:"This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:"As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:"These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:"Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:"Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:"Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.",href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:"Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:"Image to Image allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:"The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:"Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:"Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes).",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}},hM=/^-?(0\.)?\.?$/,Os=e=>{const{label:t,labelFontSize:n="1rem",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:h,min:g,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:w,numberInputFieldProps:P,numberInputStepperProps:E,tooltipProps:_,...T}=e,[M,O]=C.exports.useState(String(u));C.exports.useEffect(()=>{!M.match(hM)&&u!==Number(M)&&O(String(u))},[u,M]);const I=B=>{O(B),B.match(hM)||h(v?Math.floor(Number(B)):Number(B))},D=B=>{const $=He.clamp(v?Math.floor(Number(B.target.value)):Number(B.target.value),g,m);O(String($)),h($)};return S(bi,{..._,children:X(Td,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&S(kh,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,...w,children:t}),X(C_,{className:"invokeai__number-input-root",value:M,keepWithinRange:!0,clampValueOnBlur:!1,onChange:I,onBlur:D,width:a,...T,children:[S(__,{className:"invokeai__number-input-field",textAlign:s,...P}),o&&X("div",{className:"invokeai__number-input-stepper",children:[S(E_,{...E,className:"invokeai__number-input-stepper-button"}),S(k_,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},Is=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="md",styleClass:l,...u}=e;return X(Td,{isDisabled:n,className:`invokeai__select ${l}`,onClick:h=>{h.stopPropagation(),h.nativeEvent.stopImmediatePropagation(),h.nativeEvent.stopPropagation(),h.nativeEvent.cancelBubble=!0},children:[t&&S(kh,{className:"invokeai__select-label",fontSize:s,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t}),S(bi,{label:i,...o,children:S(o$,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(h=>typeof h=="string"||typeof h=="number"?S("option",{value:h,className:"invokeai__select-option",children:h},h):S("option",{value:h.value,className:"invokeai__select-option",children:h.key},h.value))})})]})},r4e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],i4e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],o4e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],a4e=[{key:"2x",value:2},{key:"4x",value:4}],J_=0,ek=4294967295,s4e=["gfpgan","codeformer"],l4e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],u4e=rt(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),c4e=rt(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),tk=()=>{const e=De(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=ye(u4e),{isGFPGANAvailable:i}=ye(c4e),o=l=>e(c5(l)),a=l=>e(hU(l)),s=l=>e(d5(l.target.value));return X(bt,{direction:"column",gap:2,children:[S(Is,{label:"Type",validValues:s4e.concat(),value:n,onChange:s}),S(Os,{isDisabled:!i,label:"Strength",step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&S(Os,{isDisabled:!i,label:"Fidelity",step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})},$a=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return S(Td,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,...i,children:X(kh,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",...o,children:[t,S(O_,{className:"invokeai__switch-root",...s})]})})};function mH(){const e=ye(i=>i.system.isGFPGANAvailable),t=ye(i=>i.options.shouldRunFacetool),n=De();return S($a,{isDisabled:!e,isChecked:t,onChange:i=>n($Ee(i.target.checked))})}function d4e(){const e=De(),t=ye(r=>r.options.shouldFitToWidthHeight);return S($a,{label:"Fit Initial Image To Output Size",isChecked:t,onChange:r=>e(wU(r.target.checked))})}var vH={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pM=se.createContext&&se.createContext(vH),fd=globalThis&&globalThis.__assign||function(){return fd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return S(bi,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:S(Ya,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})});function Do(e){const[t,n]=C.exports.useState(!1),{label:r,value:i,min:o=1,max:a=100,step:s=1,onChange:l,width:u="100%",tooltipSuffix:h="",withSliderMarks:g=!1,sliderMarkLeftOffset:m=0,sliderMarkRightOffset:v=-7,withInput:b=!1,isInteger:w=!1,inputWidth:P="5rem",inputReadOnly:E=!0,withReset:_=!1,hideTooltip:T=!1,handleReset:M,isResetDisabled:O,isSliderDisabled:I,isInputDisabled:D,styleClass:B,sliderFormControlProps:$,sliderFormLabelProps:H,sliderMarkProps:j,sliderTrackProps:ne,sliderThumbProps:V,sliderNumberInputProps:q,sliderNumberInputFieldProps:te,sliderNumberInputStepperProps:J,sliderTooltipProps:Z,sliderIAIIconButtonProps:G,...ee}=e,[le,me]=C.exports.useState(String(i)),Me=C.exports.useMemo(()=>q!=null&&q.max?q.max:a,[a,q==null?void 0:q.max]);C.exports.useEffect(()=>{String(i)!==le&&le!==""&&me(String(i))},[i,le,me]);const Ce=Ve=>{const Ze=He.clamp(w?Math.floor(Number(Ve.target.value)):Number(Ve.target.value),o,Me);me(String(Ze)),l(Ze)},be=Ve=>{me(Ve),l(Number(Ve))},we=()=>{!M||M()};return X(Td,{className:B?`invokeai__slider-component ${B}`:"invokeai__slider-component","data-markers":g,...$,children:[S(kh,{className:"invokeai__slider-component-label",...H,children:r}),X(Mz,{w:"100%",gap:2,children:[X(R_,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:be,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:I,width:u,...ee,children:[g&&X(Rn,{children:[S(o7,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...j,children:o}),S(o7,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...j,children:a})]}),S(m$,{className:"invokeai__slider_track",...ne,children:S(v$,{className:"invokeai__slider_track-filled"})}),S(bi,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${h}`,hidden:T,...Z,children:S(g$,{className:"invokeai__slider-thumb",...V})})]}),b&&X(C_,{min:o,max:Me,step:s,value:le,onChange:be,onBlur:Ce,className:"invokeai__slider-number-field",isDisabled:D,...q,children:[S(__,{className:"invokeai__slider-number-input",width:P,readOnly:E,...te}),X(QF,{...J,children:[S(E_,{className:"invokeai__slider-number-stepper"}),S(k_,{className:"invokeai__slider-number-stepper"})]})]}),_&&S(Xe,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:S(nk,{}),onClick:we,isDisabled:O,...G})]})]})}function SH(e){const{label:t="Strength",styleClass:n}=e,r=ye(s=>s.options.img2imgStrength),i=De();return S(Do,{label:t,step:.01,min:.01,max:.99,onChange:s=>i(G7(s)),value:r,isInteger:!1,styleClass:n,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{i(G7(.75))}})}const S4e=()=>{const e=De(),t=ye(r=>r.options.hiresFix);return S(bt,{gap:2,direction:"column",children:S($a,{label:"High Res Optimization",fontSize:"md",isChecked:t,onChange:r=>e(gU(r.target.checked))})})},b4e=()=>{const e=De(),t=ye(r=>r.options.seamless);return S(bt,{gap:2,direction:"column",children:S($a,{label:"Seamless tiling",fontSize:"md",isChecked:t,onChange:r=>e(bU(r.target.checked))})})},bH=()=>X(bt,{gap:2,direction:"column",children:[S(b4e,{}),S(S4e,{})]});function x4e(){const e=De(),t=ye(r=>r.options.shouldRandomizeSeed);return S($a,{label:"Randomize Seed",isChecked:t,onChange:r=>e(zEe(r.target.checked))})}function w4e(){const e=ye(o=>o.options.seed),t=ye(o=>o.options.shouldRandomizeSeed),n=ye(o=>o.options.shouldGenerateVariations),r=De(),i=o=>r(T2(o));return S(Os,{label:"Seed",step:1,precision:0,flexGrow:1,min:J_,max:ek,isDisabled:t,isInvalid:e<0&&n,onChange:i,value:e,width:"10rem"})}const xH=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function C4e(){const e=De(),t=ye(r=>r.options.shouldRandomizeSeed);return S(ja,{size:"sm",isDisabled:t,onClick:()=>e(T2(xH(J_,ek))),children:S("p",{children:"Shuffle"})})}function _4e(){const e=De(),t=ye(r=>r.options.threshold);return S(Os,{label:"Noise Threshold",min:0,max:1e3,step:.1,onChange:r=>e(kU(r)),value:t,isInteger:!1})}function k4e(){const e=De(),t=ye(r=>r.options.perlin);return S(Os,{label:"Perlin Noise",min:0,max:1,step:.05,onChange:r=>e(yU(r)),value:t,isInteger:!1})}const rk=()=>X(bt,{gap:2,direction:"column",children:[S(x4e,{}),X(bt,{gap:2,children:[S(w4e,{}),S(C4e,{})]}),S(bt,{gap:2,children:S(_4e,{})}),S(bt,{gap:2,children:S(k4e,{})})]}),E4e=rt(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),P4e=rt(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),ik=()=>{const e=De(),{upscalingLevel:t,upscalingStrength:n}=ye(E4e),{isESRGANAvailable:r}=ye(P4e);return X("div",{className:"upscale-options",children:[S(Is,{isDisabled:!r,label:"Scale",value:t,onChange:a=>e(j7(Number(a.target.value))),validValues:a4e}),S(Os,{isDisabled:!r,label:"Strength",step:.05,min:0,max:1,onChange:a=>e(Y7(a)),value:n,isInteger:!1})]})};function wH(){const e=ye(i=>i.system.isESRGANAvailable),t=ye(i=>i.options.shouldRunESRGAN),n=De();return S($a,{isDisabled:!e,isChecked:t,onChange:i=>n(FEe(i.target.checked))})}function ok(){const e=ye(r=>r.options.shouldGenerateVariations),t=De();return S($a,{isChecked:e,width:"auto",onChange:r=>t(IEe(r.target.checked))})}function T4e(e){const{label:t,styleClass:n,isDisabled:r=!1,fontSize:i="1rem",width:o,isInvalid:a,...s}=e;return X(Td,{className:`input ${n}`,isInvalid:a,isDisabled:r,flexGrow:1,children:[S(kh,{fontSize:i,marginBottom:1,whiteSpace:"nowrap",className:"input-label",children:t}),S(Z8,{...s,className:"input-entry",size:"sm",width:o})]})}function L4e(){const e=ye(i=>i.options.seedWeights),t=ye(i=>i.options.shouldGenerateVariations),n=De(),r=i=>n(xU(i.target.value));return S(T4e,{label:"Seed Weights",value:e,isInvalid:t&&!(K_(e)||e===""),isDisabled:!t,onChange:r})}function A4e(){const e=ye(i=>i.options.variationAmount),t=ye(i=>i.options.shouldGenerateVariations),n=De();return S(Os,{label:"Variation Amount",value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i=>n(WEe(i)),isInteger:!1})}const ak=()=>X(bt,{gap:2,direction:"column",children:[S(A4e,{}),S(L4e,{})]});function M4e(){const e=De(),t=ye(r=>r.options.cfgScale);return S(Os,{label:"CFG Scale",step:.5,min:1.01,max:200,onChange:r=>e(fU(r)),value:t,width:lk,styleClass:"main-option-block",textAlign:"center",isInteger:!1})}const Tr=rt(e=>e.options,e=>Rb[e.activeTab],{memoizeOptions:{equalityCheck:He.isEqual}});rt(e=>e.options,e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n},{memoizeOptions:{resultEqualityCheck:He.isEqual}});const sk=e=>e.options;function R4e(){const e=ye(i=>i.options.height),t=ye(Tr),n=De();return S(Is,{isDisabled:t==="unifiedCanvas",label:"Height",value:e,flexGrow:1,onChange:i=>n(pU(Number(i.target.value))),validValues:o4e,styleClass:"main-option-block"})}const O4e=rt([e=>e.options],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function I4e(){const e=De(),{iterations:t}=ye(O4e);return S(Os,{label:"Images",step:1,min:1,max:9999,onChange:r=>e(REe(r)),value:t,width:lk,labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function D4e(){const e=ye(r=>r.options.sampler),t=De();return S(Is,{label:"Sampler",value:e,onChange:r=>t(SU(r.target.value)),validValues:r4e,styleClass:"main-option-block"})}function N4e(){const e=De(),t=ye(r=>r.options.steps);return S(Os,{label:"Steps",min:1,max:9999,step:1,onChange:r=>e(_U(r)),value:t,width:lk,styleClass:"main-option-block",textAlign:"center"})}function B4e(){const e=ye(i=>i.options.width),t=ye(Tr),n=De();return S(Is,{isDisabled:t==="unifiedCanvas",label:"Width",value:e,flexGrow:1,onChange:i=>n(EU(Number(i.target.value))),validValues:i4e,styleClass:"main-option-block"})}const lk="auto";function uk(){return S("div",{className:"main-options",children:X("div",{className:"main-options-list",children:[X("div",{className:"main-options-row",children:[S(I4e,{}),S(N4e,{}),S(M4e,{})]}),X("div",{className:"main-options-row",children:[S(B4e,{}),S(R4e,{}),S(D4e,{})]})]})})}const z4e={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[]},CH=KS({name:"system",initialState:z4e,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Error",e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?"Connected":"Disconnected"},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Processing canceled"},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Preparing"},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus="Loading Model",e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1}}}),{setShouldDisplayInProgressType:F4e,setIsProcessing:Cu,addLogEntry:Po,setShouldShowLogViewer:zw,setIsConnected:gM,setSocketId:ELe,setShouldConfirmOnDelete:_H,setOpenAccordions:$4e,setSystemStatus:H4e,setCurrentStatus:a5,setSystemConfig:W4e,setShouldDisplayGuides:V4e,processingCanceled:U4e,errorOccurred:mM,errorSeen:kH,setModelList:vM,setIsCancelable:h0,modelChangeRequested:G4e,setSaveIntermediatesInterval:j4e,setEnableImageDebugging:Y4e,generationRequested:q4e,addToast:Cm,clearToastQueue:K4e,setProcessingIndeterminateTask:X4e}=CH.actions,Z4e=CH.reducer;function Q4e(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function J4e(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function EH(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function eSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function tSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}const nSe=rt(e=>e.system,e=>e.shouldDisplayGuides),rSe=({children:e,feature:t})=>{const n=ye(nSe),{text:r}=n4e[t];return n?X(P_,{trigger:"hover",children:[S(A_,{children:S(Ld,{children:e})}),X(L_,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[S(T_,{className:"guide-popover-arrow"}),S("div",{className:"guide-popover-guide-content",children:r})]})]}):null},iSe=Pe(({feature:e,icon:t=Q4e},n)=>S(rSe,{feature:e,children:S(Ld,{ref:n,children:S(wa,{marginBottom:"-.15rem",as:t})})}));function oSe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return X(Qf,{className:"advanced-settings-item",children:[S(Xf,{className:"advanced-settings-header",children:X(bt,{width:"100%",gap:"0.5rem",align:"center",children:[S(Ld,{flexGrow:1,textAlign:"left",children:t}),i,n&&S(iSe,{feature:n}),S(Zf,{})]})}),S(Jf,{className:"advanced-settings-panel",children:r})]})}const ck=e=>{const{accordionInfo:t}=e,n=ye(a=>a.system.openAccordions),r=De();return S(OS,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r($4e(a)),className:"advanced-settings",children:(()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:h,additionalHeaderComponents:g}=t[s];a.push(S(oSe,{header:l,feature:u,content:h,additionalHeaderComponents:g},s))}),a})()})};function aSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function sSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function lSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function PH(e){return dt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function TH(e){return dt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function uSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function cSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function LH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function dSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function fSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function dk(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function AH(e){return dt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function w2(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function MH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function fk(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function RH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function hSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function pSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function OH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function gSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function mSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function IH(e){return dt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function vSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function ySe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function SSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function DH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function bSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function xSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function NH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function wSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function CSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function hk(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function _Se(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function kSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function ESe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function pk(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function PSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function TSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function yM(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function gk(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function LSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function Ah(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function ASe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function hb(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function MSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function pb(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const Hu=e=>e.system,RSe=e=>e.system.toastQueue,BH=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],OSe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],mk=e=>e.kind==="line"&&e.layer==="mask",ISe=e=>e.kind==="line"&&e.layer==="base",x4=e=>e.kind==="image"&&e.layer==="base",DSe=e=>e.kind==="fillRect"&&e.layer==="base",NSe=e=>e.kind==="eraseRect"&&e.layer==="base",BSe=e=>e.kind==="line",Qt=e=>e.canvas,vr=rt([Qt,Tr,Hu],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),zH=e=>e.canvas.layerState.objects.find(x4),FH=rt([e=>e.options,e=>e.system,zH,Tr],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:h}=t;let g=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(g=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(g=!1,m.push("No initial image selected")),u&&(g=!1,m.push("System Busy")),h||(g=!1,m.push("System Disconnected")),o&&(!(K_(a)||a==="")||l===-1)&&(g=!1,m.push("Seed-Weights badly formatted.")),{isReady:g,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:He.isEqual,resultEqualityCheck:He.isEqual}}),m7=si("socketio/generateImage"),zSe=si("socketio/runESRGAN"),FSe=si("socketio/runFacetool"),$Se=si("socketio/deleteImage"),v7=si("socketio/requestImages"),SM=si("socketio/requestNewImages"),HSe=si("socketio/cancelProcessing"),WSe=si("socketio/requestSystemConfig"),$H=si("socketio/requestModelChange"),VSe=si("socketio/saveStagingAreaImageToGallery"),USe=si("socketio/requestEmptyTempFolder"),Ro=Pe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return S(bi,{label:r,...i,children:S(ja,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})});function vk(e){const{iconButton:t=!1,...n}=e,r=De(),{isReady:i}=ye(FH),o=ye(Tr),a=()=>{r(m7(o))};return Ue(["ctrl+enter","meta+enter"],()=>{r(m7(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),S("div",{style:{flexGrow:4},children:t?S(Xe,{"aria-label":"Invoke",type:"submit",icon:S(CSe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:"Invoke",tooltipProps:{placement:"bottom"},...n}):S(Ro,{"aria-label":"Invoke",type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const GSe=rt(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:He.isEqual}});function yk(e){const{...t}=e,n=De(),{isProcessing:r,isConnected:i,isCancelable:o}=ye(GSe),a=()=>n(HSe());return Ue("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),S(Xe,{icon:S(tSe,{}),tooltip:"Cancel","aria-label":"Cancel",isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const jSe=rt(e=>e.options,e=>e.shouldLoopback),YSe=()=>{const e=De(),t=ye(jSe);return S(Xe,{"aria-label":"Toggle Loopback",tooltip:"Toggle Loopback",styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:S(kSe,{}),onClick:()=>{e(NEe(!t))}})},Sk=()=>{const e=ye(Tr);return X("div",{className:"process-buttons",children:[S(vk,{}),e==="img2img"&&S(YSe,{}),S(yk,{})]})},qSe=rt([e=>e.options,Tr],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),bk=()=>{const e=De(),{prompt:t,activeTabName:n}=ye(qSe),{isReady:r}=ye(FH),i=C.exports.useRef(null),o=s=>{e(Ob(s.target.value))};Ue("alt+a",()=>{var s;(s=i.current)==null||s.focus()},[]);const a=s=>{s.key==="Enter"&&s.shiftKey===!1&&r&&(s.preventDefault(),e(m7(n)))};return S("div",{className:"prompt-bar",children:S(Td,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:S(k$,{id:"prompt",name:"prompt",placeholder:"Type prompt here. [negative tokens], (upweight)++, (downweight)--, swap and blend are available (see docs)",size:"lg",value:t,onChange:o,onKeyDown:a,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})};function HH(e){return dt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function WH(e){return dt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function KSe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function XSe(e,t){e.classList?e.classList.add(t):KSe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function bM(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function ZSe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=bM(e.className,t):e.setAttribute("class",bM(e.className&&e.className.baseVal||"",t))}const xM={disabled:!1},VH=se.createContext(null);var UH=function(t){return t.scrollTop},_m="unmounted",Nf="exited",Bf="entering",Xp="entered",y7="exiting",Wu=function(e){f_(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=Nf,o.appearStatus=Bf):l=Xp:r.unmountOnExit||r.mountOnEnter?l=_m:l=Nf,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===_m?{status:Nf}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Bf&&a!==Xp&&(o=Bf):(a===Bf||a===Xp)&&(o=y7)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Bf){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Iy.findDOMNode(this);a&&UH(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Nf&&this.setState({status:_m})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Iy.findDOMNode(this),s],u=l[0],h=l[1],g=this.getTimeouts(),m=s?g.appear:g.enter;if(!i&&!a||xM.disabled){this.safeSetState({status:Xp},function(){o.props.onEntered(u)});return}this.props.onEnter(u,h),this.safeSetState({status:Bf},function(){o.props.onEntering(u,h),o.onTransitionEnd(m,function(){o.safeSetState({status:Xp},function(){o.props.onEntered(u,h)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Iy.findDOMNode(this);if(!o||xM.disabled){this.safeSetState({status:Nf},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:y7},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Nf},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Iy.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],h=l[1];this.props.addEndListener(u,h)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===_m)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=u_(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S(VH.Provider,{value:null,children:typeof a=="function"?a(i,s):se.cloneElement(se.Children.only(a),s)})},t}(se.Component);Wu.contextType=VH;Wu.propTypes={};function Vp(){}Wu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vp,onEntering:Vp,onEntered:Vp,onExit:Vp,onExiting:Vp,onExited:Vp};Wu.UNMOUNTED=_m;Wu.EXITED=Nf;Wu.ENTERING=Bf;Wu.ENTERED=Xp;Wu.EXITING=y7;const QSe=Wu;var JSe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return XSe(t,r)})},Fw=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return ZSe(t,r)})},xk=function(e){f_(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;aMath.floor(e/t)*t,kl=(e,t)=>Math.round(e/t)*t,Up=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Gp=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},ebe=.999,tbe=.1,nbe=20,im=.95,wM=30,S7=10,CM=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),Tf=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=kl(s/o,64)):o<1&&(r.height=s,r.width=kl(s*o,64)),a=r.width*r.height;return r},rbe=e=>({width:kl(e.width,64),height:kl(e.height,64)}),km={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},ibe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:km,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},jH=KS({name:"canvas",initialState:ibe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!mk(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:ed(He.clamp(n.width,64,512),64),height:ed(He.clamp(n.height,64,512),64)},o={x:kl(n.width/2-i.width/2,64),y:kl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=Tf(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState={...km,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Gp(r.width,r.height,n.width,n.height,im),s=Up(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=rbe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=Tf(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=CM(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldUseInpaintReplace:(e,t)=>{e.shouldUseInpaintReplace=t.payload},setInpaintReplace:(e,t)=>{e.inpaintReplace=t.payload},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...km.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(BSe);!n||n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();!t||(e.futureLayerStates.unshift(He.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();!t||(e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState=km,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(x4),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const h=Gp(i.width,i.height,512,512,im),g=Up(i.width,i.height,0,0,512,512,h),m={width:512,height:512};if(e.stageScale=h,e.stageCoordinates=g,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=Tf(m);e.scaledBoundingBoxDimensions=v}return}const{width:o,height:a}=r,l=Gp(t,n,o,a,.95),u=Up(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=CM(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(x4)){const i=Gp(r.width,r.height,512,512,im),o=Up(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=Tf(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:i}}=e,{x:o,y:a,width:s,height:l}=n;if(s!==0&&l!==0){const u=Gp(r,i,s,l,im),h=Up(r,i,o,a,s,l,u);e.stageScale=u,e.stageCoordinates=h}else{const u=Gp(r,i,512,512,im),h=Up(r,i,0,0,512,512,u),g={width:512,height:512};if(e.stageScale=u,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=g,e.boundingBoxScaleMethod==="auto"){const m=Tf(g);e.scaledBoundingBoxDimensions=m}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...km.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:ed(He.clamp(o,64,512),64),height:ed(He.clamp(a,64,512),64)},l={x:kl(o/2-s.width/2,64),y:kl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=Tf(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=Tf(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:YH,addFillRect:qH,addImageToStagingArea:obe,addLine:abe,addPointToCurrentLine:KH,clearCanvasHistory:XH,clearMask:wk,commitColorPickerColor:sbe,commitStagingAreaImage:lbe,discardStagedImages:ube,fitBoundingBoxToStage:PLe,mouseLeftCanvas:cbe,nextStagingAreaImage:dbe,prevStagingAreaImage:fbe,redo:hbe,resetCanvas:Ck,resetCanvasInteractionState:pbe,resetCanvasView:ZH,resizeAndScaleCanvas:gb,resizeCanvas:gbe,setBoundingBoxCoordinates:$w,setBoundingBoxDimensions:Em,setBoundingBoxPreviewFill:TLe,setBoundingBoxScaleMethod:mbe,setBrushColor:V0,setBrushSize:U0,setCanvasContainerDimensions:vbe,setColorPickerColor:ybe,setCursorPosition:Sbe,setDoesCanvasNeedScaling:ai,setInitialCanvasImage:mb,setInpaintReplace:_M,setIsDrawing:QH,setIsMaskEnabled:C2,setIsMouseOverBoundingBox:i3,setIsMoveBoundingBoxKeyHeld:LLe,setIsMoveStageKeyHeld:ALe,setIsMovingBoundingBox:Hw,setIsMovingStage:w4,setIsTransformingBoundingBox:Ww,setLayer:C4,setMaskColor:JH,setMergedCanvas:bbe,setShouldAutoSave:eW,setShouldCropToBoundingBoxOnSave:tW,setShouldDarkenOutsideBoundingBox:nW,setShouldLockBoundingBox:MLe,setShouldPreserveMaskedArea:rW,setShouldShowBoundingBox:xbe,setShouldShowBrush:RLe,setShouldShowBrushPreview:OLe,setShouldShowCanvasDebugInfo:iW,setShouldShowCheckboardTransparency:ILe,setShouldShowGrid:oW,setShouldShowIntermediates:aW,setShouldShowStagingImage:wbe,setShouldShowStagingOutline:kM,setShouldSnapToGrid:_4,setShouldUseInpaintReplace:Cbe,setStageCoordinates:sW,setStageScale:_be,setTool:Ol,toggleShouldLockBoundingBox:DLe,toggleTool:NLe,undo:kbe,setScaledBoundingBoxDimensions:o3,setShouldRestrictStrokesToBox:lW}=jH.actions,Ebe=jH.reducer,uW=""+new URL("logo.13003d72.png",import.meta.url).href,Pbe=rt(e=>e.options,e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),_k=e=>{const t=De(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:i}=ye(Pbe),o=C.exports.useRef(null),a=C.exports.useRef(null),s=C.exports.useRef(null),{children:l}=e;Ue("o",()=>{t(ku(!n)),i&&setTimeout(()=>t(ai(!0)),400)},[n,i]),Ue("esc",()=>{t(ku(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Ue("shift+o",()=>{m(),t(ai(!0))},[i]);const u=C.exports.useCallback(()=>{i||(t(OEe(a.current?a.current.scrollTop:0)),t(ku(!1)),t(DEe(!1)))},[t,i]),h=()=>{s.current=window.setTimeout(()=>u(),500)},g=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(BEe(!i)),t(ai(!0))};return C.exports.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),S(GH,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:S("div",{className:"options-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:g,onMouseOver:i?void 0:g,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:S("div",{className:"options-panel-margin",children:X("div",{className:"options-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?g():!i&&h()},children:[S(bi,{label:"Pin Options Panel",children:S("div",{className:"options-panel-pin-button","data-selected":i,onClick:m,children:i?S(HH,{}):S(WH,{})})}),!i&&X("div",{className:"invoke-ai-logo-wrapper",children:[S("img",{src:uW,alt:"invoke-ai-logo"}),X("h1",{children:["invoke ",S("strong",{children:"ai"})]})]}),l]})})})})};function Tbe(){const e={seed:{header:"Seed",feature:Yi.SEED,content:S(rk,{})},variations:{header:"Variations",feature:Yi.VARIATIONS,content:S(ak,{}),additionalHeaderComponents:S(ok,{})},face_restore:{header:"Face Restoration",feature:Yi.FACE_CORRECTION,content:S(tk,{}),additionalHeaderComponents:S(mH,{})},upscale:{header:"Upscaling",feature:Yi.UPSCALE,content:S(ik,{}),additionalHeaderComponents:S(wH,{})},other:{header:"Other Options",feature:Yi.OTHER,content:S(bH,{})}};return X(_k,{children:[S(bk,{}),S(Sk,{}),S(uk,{}),S(SH,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),S(d4e,{}),S(ck,{accordionInfo:e})]})}const kk=C.exports.createContext(null),Lbe=e=>{const{styleClass:t}=e,n=C.exports.useContext(kk),r=()=>{n&&n()};return S("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:X("div",{className:"image-upload-button",children:[S(hb,{}),S(sh,{size:"lg",children:"Click or Drag and Drop"})]})})},Abe=rt(e=>e.system,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),b7=C.exports.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Hv(),a=De(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=ye(Abe),h=C.exports.useRef(null),g=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a($Se(e)),o()};Ue("delete",()=>{s?i():m()},[e,s]);const v=b=>a(_H(!b.target.checked));return X(Rn,{children:[C.exports.cloneElement(t,{onClick:e?g:void 0,ref:n}),S(KF,{isOpen:r,leastDestructiveRef:h,onClose:o,children:S(u1,{children:X(XF,{className:"modal",children:[S(US,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),S(jv,{children:X(bt,{direction:"column",gap:5,children:[S(Mo,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),S(Td,{children:X(bt,{alignItems:"center",children:[S(kh,{mb:0,children:"Don't ask me again"}),S(O_,{checked:!s,onChange:v})]})})]})}),X(VS,{children:[S(ja,{ref:h,onClick:o,className:"modal-close-btn",children:"Cancel"}),S(ja,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})}),Il=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return X(P_,{...o,children:[S(A_,{children:t}),X(L_,{className:`invokeai__popover-content ${r}`,children:[i&&S(T_,{className:"invokeai__popover-arrow"}),n]})]})},Mbe=rt([e=>e.system,e=>e.options,e=>e.gallery,Tr],(e,t,n,r)=>{const{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:u,shouldShowImageDetails:h,isLightBoxOpen:g}=t,{intermediateImage:m,currentImage:v}=n;return{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:u,shouldDisableToolbarButtons:Boolean(m)||!v,currentImage:v,shouldShowImageDetails:h,activeTabName:r,isLightBoxOpen:g}},{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),cW=()=>{var D,B,$,H,j,ne;const e=De(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightBoxOpen:h,activeTabName:g}=ye(Mbe),m=x2(),v=()=>{!u||(h&&e(_u(!1)),e(O1(u)),e(Lo("img2img")))},b=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:"Image Link Copied",status:"success",duration:2500,isClosable:!0})})};Ue("shift+i",()=>{u?(v(),m({title:"Sent To Image To Image",status:"success",duration:2500,isClosable:!0})):m({title:"No Image Loaded",description:"No image found to send to image to image module.",status:"error",duration:2500,isClosable:!0})},[u]);const w=()=>{var V,q;!u||(u.metadata&&e(LEe(u.metadata)),((V=u.metadata)==null?void 0:V.image.type)==="img2img"?e(Lo("img2img")):((q=u.metadata)==null?void 0:q.image.type)==="txt2img"&&e(Lo("txt2img")))};Ue("a",()=>{var V,q;["txt2img","img2img"].includes((q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)==null?void 0:q.type)?(w(),m({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})):m({title:"Parameters Not Set",description:"No metadata found for this image.",status:"error",duration:2500,isClosable:!0})},[u]);const P=()=>{u!=null&&u.metadata&&e(T2(u.metadata.image.seed))};Ue("s",()=>{var V,q;(q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)!=null&&q.seed?(P(),m({title:"Seed Set",status:"success",duration:2500,isClosable:!0})):m({title:"Seed Not Set",description:"Could not find seed for this image.",status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var V,q;return((q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)==null?void 0:q.prompt)&&e(Ob(u.metadata.image.prompt))};Ue("p",()=>{var V,q;(q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)!=null&&q.prompt?(E(),m({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})):m({title:"Prompt Not Set",description:"Could not find prompt for this image.",status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{u&&e(zSe(u))};Ue("u",()=>{i&&!s&&n&&!t&&o?_():m({title:"Upscaling Failed",status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const T=()=>{u&&e(FSe(u))};Ue("r",()=>{r&&!s&&n&&!t&&a?T():m({title:"Face Restoration Failed",status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const M=()=>e(CU(!l)),O=()=>{!u||(h&&e(_u(!1)),e(mb(u)),e(ai(!0)),g!=="unifiedCanvas"&&e(Lo("unifiedCanvas")),m({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0}))};Ue("i",()=>{u?M():m({title:"Failed to load metadata",status:"error",duration:2500,isClosable:!0})},[u,l]);const I=()=>{e(_u(!h))};return X("div",{className:"current-image-options",children:[X(ji,{isAttached:!0,children:[S(Il,{trigger:"hover",triggerComponent:S(Xe,{"aria-label":"Send to...",icon:S(TSe,{})}),children:X("div",{className:"current-image-send-to-popover",children:[S(Ro,{size:"sm",onClick:v,leftIcon:S(yM,{}),children:"Send to Image to Image"}),S(Ro,{size:"sm",onClick:O,leftIcon:S(yM,{}),children:"Send to Unified Canvas"}),S(Ro,{size:"sm",onClick:b,leftIcon:S(w2,{}),children:"Copy Link to Image"}),S(Ro,{leftIcon:S(fk,{}),size:"sm",children:S(lh,{download:!0,href:u==null?void 0:u.url,children:"Download Image"})})]})}),S(Xe,{icon:S(pSe,{}),tooltip:h?"Close Viewer (Z)":"Open In Viewer (Z)","aria-label":h?"Close Viewer (Z)":"Open In Viewer (Z)","data-selected":h,onClick:I})]}),X(ji,{isAttached:!0,children:[S(Xe,{icon:S(_Se,{}),tooltip:"Use Prompt (P)","aria-label":"Use Prompt (P)",isDisabled:!((B=(D=u==null?void 0:u.metadata)==null?void 0:D.image)!=null&&B.prompt),onClick:E}),S(Xe,{icon:S(PSe,{}),tooltip:"Use Seed (S)","aria-label":"Use Seed (S)",isDisabled:!((H=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&H.seed),onClick:P}),S(Xe,{icon:S(dSe,{}),tooltip:"Use All (A)","aria-label":"Use All (A)",isDisabled:!["txt2img","img2img"].includes((ne=(j=u==null?void 0:u.metadata)==null?void 0:j.image)==null?void 0:ne.type),onClick:w})]}),X(ji,{isAttached:!0,children:[S(Il,{trigger:"hover",triggerComponent:S(Xe,{icon:S(vSe,{}),"aria-label":"Restore Faces"}),children:X("div",{className:"current-image-postprocessing-popover",children:[S(tk,{}),S(Ro,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:T,children:"Restore Faces"})]})}),S(Il,{trigger:"hover",triggerComponent:S(Xe,{icon:S(hSe,{}),"aria-label":"Upscale"}),children:X("div",{className:"current-image-postprocessing-popover",children:[S(ik,{}),S(Ro,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:_,children:"Upscale Image"})]})})]}),S(ji,{isAttached:!0,children:S(Xe,{icon:S(AH,{}),tooltip:"Info (I)","aria-label":"Info (I)","data-selected":l,onClick:M})}),S(b7,{image:u,children:S(Xe,{icon:S(Ah,{}),tooltip:"Delete Image","aria-label":"Delete Image",isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})},Rbe={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},dW=KS({name:"gallery",initialState:Rbe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ii.exports.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:p0,clearIntermediateImage:Vw,removeImage:fW,setCurrentImage:EM,addGalleryImages:Obe,setIntermediateImage:Ibe,selectNextImage:Ek,selectPrevImage:Pk,setShouldPinGallery:Dbe,setShouldShowGallery:hd,setGalleryScrollPosition:Nbe,setGalleryImageMinimumWidth:om,setGalleryImageObjectFit:Bbe,setShouldHoldGalleryOpen:hW,setShouldAutoSwitchToNewImages:zbe,setCurrentCategory:a3,setGalleryWidth:Fbe,setShouldUseSingleGalleryColumn:$be}=dW.actions,Hbe=dW.reducer;ut({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});ut({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});ut({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});ut({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});ut({displayName:"SunIcon",path:X("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[S("circle",{cx:"12",cy:"12",r:"5"}),S("path",{d:"M12 1v2"}),S("path",{d:"M12 21v2"}),S("path",{d:"M4.22 4.22l1.42 1.42"}),S("path",{d:"M18.36 18.36l1.42 1.42"}),S("path",{d:"M1 12h2"}),S("path",{d:"M21 12h2"}),S("path",{d:"M4.22 19.78l1.42-1.42"}),S("path",{d:"M18.36 5.64l1.42-1.42"})]})});ut({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});ut({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:S("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});ut({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});ut({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});ut({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});ut({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});ut({displayName:"ViewIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),S("circle",{cx:"12",cy:"12",r:"2"})]})});ut({displayName:"ViewOffIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),S("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"})]})});ut({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});ut({displayName:"DeleteIcon",path:S("g",{fill:"currentColor",children:S("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})});ut({displayName:"RepeatIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),S("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"})]})});ut({displayName:"RepeatClockIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),S("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"})]})});ut({displayName:"EditIcon",path:X("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[S("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),S("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});ut({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});ut({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});ut({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});ut({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});ut({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});ut({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});ut({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});ut({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});ut({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var pW=ut({displayName:"ExternalLinkIcon",path:X("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[S("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),S("path",{d:"M15 3h6v6"}),S("path",{d:"M10 14L21 3"})]})});ut({displayName:"LinkIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),S("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"})]})});ut({displayName:"PlusSquareIcon",path:X("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[S("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),S("path",{d:"M12 8v8"}),S("path",{d:"M8 12h8"})]})});ut({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});ut({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});ut({displayName:"TimeIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),S("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"})]})});ut({displayName:"ArrowRightIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),S("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"})]})});ut({displayName:"ArrowLeftIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),S("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"})]})});ut({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});ut({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});ut({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});ut({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});ut({displayName:"EmailIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),S("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"})]})});ut({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});ut({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});ut({displayName:"SpinnerIcon",path:X(Rn,{children:[S("defs",{children:X("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[S("stop",{stopColor:"currentColor",offset:"0%"}),S("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),X("g",{transform:"translate(2)",fill:"none",children:[S("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),S("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),S("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})});ut({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});ut({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:S("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});ut({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});ut({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});ut({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});ut({displayName:"InfoOutlineIcon",path:X("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[S("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),S("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),S("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})});ut({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});ut({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});ut({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});ut({displayName:"QuestionOutlineIcon",path:X("g",{stroke:"currentColor",strokeWidth:"1.5",children:[S("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),S("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),S("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})});ut({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});ut({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});ut({viewBox:"0 0 14 14",path:S("g",{fill:"currentColor",children:S("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});ut({displayName:"MinusIcon",path:S("g",{fill:"currentColor",children:S("rect",{height:"4",width:"20",x:"2",y:"10"})})});ut({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function Wbe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Nn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>X(bt,{gap:2,children:[n&&S(bi,{label:`Recall ${e}`,children:S(Ya,{"aria-label":"Use this parameter",icon:S(Wbe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&S(bi,{label:`Copy ${e}`,children:S(Ya,{"aria-label":`Copy ${e}`,icon:S(w2,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),X(bt,{direction:i?"column":"row",children:[X(Mo,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?X(lh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",S(pW,{mx:"2px"})]}):S(Mo,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),Vbe=(e,t)=>e.image.uuid===t.image.uuid,gW=C.exports.memo(({image:e,styleClass:t})=>{var H,j;const n=De();Ue("esc",()=>{n(CU(!1))});const r=((H=e==null?void 0:e.metadata)==null?void 0:H.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:h,orig_path:g,perlin:m,postprocessing:v,prompt:b,sampler:w,scale:P,seamless:E,seed:_,steps:T,strength:M,threshold:O,type:I,variations:D,width:B}=r,$=JSON.stringify(e.metadata,null,2);return S("div",{className:`image-metadata-viewer ${t}`,children:X(bt,{gap:1,direction:"column",width:"100%",children:[X(bt,{gap:2,children:[S(Mo,{fontWeight:"semibold",children:"File:"}),X(lh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,S(pW,{mx:"2px"})]})]}),Object.keys(r).length>0?X(Rn,{children:[I&&S(Nn,{label:"Generation type",value:I}),((j=e.metadata)==null?void 0:j.model_weights)&&S(Nn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(I)&&S(Nn,{label:"Original image",value:g}),I==="gfpgan"&&M!==void 0&&S(Nn,{label:"Fix faces strength",value:M,onClick:()=>n(c5(M))}),I==="esrgan"&&P!==void 0&&S(Nn,{label:"Upscaling scale",value:P,onClick:()=>n(j7(P))}),I==="esrgan"&&M!==void 0&&S(Nn,{label:"Upscaling strength",value:M,onClick:()=>n(Y7(M))}),b&&S(Nn,{label:"Prompt",labelPosition:"top",value:o5(b),onClick:()=>n(Ob(b))}),_!==void 0&&S(Nn,{label:"Seed",value:_,onClick:()=>n(T2(_))}),O!==void 0&&S(Nn,{label:"Noise Threshold",value:O,onClick:()=>n(kU(O))}),m!==void 0&&S(Nn,{label:"Perlin Noise",value:m,onClick:()=>n(yU(m))}),w&&S(Nn,{label:"Sampler",value:w,onClick:()=>n(SU(w))}),T&&S(Nn,{label:"Steps",value:T,onClick:()=>n(_U(T))}),o!==void 0&&S(Nn,{label:"CFG scale",value:o,onClick:()=>n(fU(o))}),D&&D.length>0&&S(Nn,{label:"Seed-weight pairs",value:b4(D),onClick:()=>n(xU(b4(D)))}),E&&S(Nn,{label:"Seamless",value:E,onClick:()=>n(bU(E))}),l&&S(Nn,{label:"High Resolution Optimization",value:l,onClick:()=>n(gU(l))}),B&&S(Nn,{label:"Width",value:B,onClick:()=>n(EU(B))}),s&&S(Nn,{label:"Height",value:s,onClick:()=>n(pU(s))}),u&&S(Nn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(O1(u))}),h&&S(Nn,{label:"Mask image",value:h,isLink:!0,onClick:()=>n(vU(h))}),I==="img2img"&&M&&S(Nn,{label:"Image to image strength",value:M,onClick:()=>n(G7(M))}),a&&S(Nn,{label:"Image to image fit",value:a,onClick:()=>n(wU(a))}),v&&v.length>0&&X(Rn,{children:[S(sh,{size:"sm",children:"Postprocessing"}),v.map((ne,V)=>{if(ne.type==="esrgan"){const{scale:q,strength:te}=ne;return X(bt,{pl:"2rem",gap:1,direction:"column",children:[S(Mo,{size:"md",children:`${V+1}: Upscale (ESRGAN)`}),S(Nn,{label:"Scale",value:q,onClick:()=>n(j7(q))}),S(Nn,{label:"Strength",value:te,onClick:()=>n(Y7(te))})]},V)}else if(ne.type==="gfpgan"){const{strength:q}=ne;return X(bt,{pl:"2rem",gap:1,direction:"column",children:[S(Mo,{size:"md",children:`${V+1}: Face restoration (GFPGAN)`}),S(Nn,{label:"Strength",value:q,onClick:()=>{n(c5(q)),n(d5("gfpgan"))}})]},V)}else if(ne.type==="codeformer"){const{strength:q,fidelity:te}=ne;return X(bt,{pl:"2rem",gap:1,direction:"column",children:[S(Mo,{size:"md",children:`${V+1}: Face restoration (Codeformer)`}),S(Nn,{label:"Strength",value:q,onClick:()=>{n(c5(q)),n(d5("codeformer"))}}),te&&S(Nn,{label:"Fidelity",value:te,onClick:()=>{n(hU(te)),n(d5("codeformer"))}})]},V)}})]}),i&&S(Nn,{withCopy:!0,label:"Dream Prompt",value:i}),X(bt,{gap:2,direction:"column",children:[X(bt,{gap:2,children:[S(bi,{label:"Copy metadata JSON",children:S(Ya,{"aria-label":"Copy metadata JSON",icon:S(w2,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText($)})}),S(Mo,{fontWeight:"semibold",children:"Metadata JSON:"})]}),S("div",{className:"image-json-viewer",children:S("pre",{children:$})})]})]}):S(Ez,{width:"100%",pt:10,children:S(Mo,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},Vbe),mW=rt([e=>e.gallery,e=>e.options],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var h;return u.uuid===((h=e==null?void 0:e.currentImage)==null?void 0:h.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function Ube(){const e=De(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=ye(mW),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},h=()=>{e(Pk())},g=()=>{e(Ek())};return X("div",{className:"current-image-preview",children:[i&&S(DS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&X("div",{className:"current-image-next-prev-buttons",children:[S("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&S(Ya,{"aria-label":"Previous image",icon:S(PH,{className:"next-prev-button"}),variant:"unstyled",onClick:h})}),S("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&S(Ya,{"aria-label":"Next image",icon:S(TH,{className:"next-prev-button"}),variant:"unstyled",onClick:g})})]}),r&&i&&S(gW,{image:i,styleClass:"current-image-metadata"})]})}const Gbe=rt([e=>e.gallery,e=>e.options,Tr],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),vW=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=ye(Gbe);return S("div",{className:"current-image-area","data-tab-name":t,children:e?X(Rn,{children:[S(cW,{}),S(Ube,{})]}):S("div",{className:"current-image-display-placeholder",children:S(eSe,{})})})},jbe=()=>{const e=C.exports.useContext(kk);return S(Xe,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:S(hb,{}),onClick:e||void 0})};function Ybe(){const e=ye(i=>i.options.initialImage),t=De(),n=x2(),r=()=>{n({title:"Problem loading parameters",description:"Unable to load init image.",status:"error",isClosable:!0}),t(dU())};return X(Rn,{children:[X("div",{className:"init-image-preview-header",children:[S("h2",{children:"Initial Image"}),S(jbe,{})]}),e&&S("div",{className:"init-image-preview",children:S(DS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:r})})]})}const qbe=()=>{const e=ye(r=>r.options.initialImage),{currentImage:t}=ye(r=>r.gallery);return X("div",{className:"workarea-split-view",children:[S("div",{className:"workarea-split-view-left",children:e?S("div",{className:"image-to-image-area",children:S(Ybe,{})}):S(Lbe,{})}),t&&S("div",{className:"workarea-split-view-right",children:S(vW,{})})]})};function Kbe(e){return dt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}var Xbe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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)}}(),Ur=globalThis&&globalThis.__assign||function(){return Ur=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},rxe=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],MM="__resizable_base__",yW=function(e){Jbe(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(MM):o.className+=MM,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;!o||o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||exe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),h=u/l[s]*100;return h+"%"}return Uw(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?Uw(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?Uw(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&jp("left",o),s=i&&jp("top",o),l,u;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(l=a?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,g=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,w=u||0;if(s){var P=(m-b)*this.ratio+w,E=(v-b)*this.ratio+w,_=(h-w)/this.ratio+b,T=(g-w)/this.ratio+b,M=Math.max(h,P),O=Math.min(g,E),I=Math.max(m,_),D=Math.min(v,T);n=l3(n,M,O),r=l3(r,I,D)}else n=l3(n,h,g),r=l3(r,m,v);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&txe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&u3(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var h=this.window.getComputedStyle(u).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var g={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:gl(gl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(g)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&u3(n))try{n.preventDefault(),n.stopPropagation()}catch(te){}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=u3(n)?n.touches[0].clientX:n.clientX,h=u3(n)?n.touches[0].clientY:n.clientY,g=this.state,m=g.direction,v=g.original,b=g.width,w=g.height,P=this.getParentSize(),E=nxe(P,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=E.maxWidth,a=E.maxHeight,s=E.minWidth,l=E.minHeight;var _=this.calculateNewSizeFromDirection(u,h),T=_.newHeight,M=_.newWidth,O=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(M=AM(M,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=AM(T,this.props.snap.y,this.props.snapGap));var I=this.calculateNewSizeFromAspectRatio(M,T,{width:O.maxWidth,height:O.maxHeight},{width:s,height:l});if(M=I.newWidth,T=I.newHeight,this.props.grid){var D=LM(M,this.props.grid[0]),B=LM(T,this.props.grid[1]),$=this.props.snapGap||0;M=$===0||Math.abs(D-M)<=$?D:M,T=$===0||Math.abs(B-T)<=$?B:T}var H={width:M-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var j=M/P.width*100;M=j+"%"}else if(b.endsWith("vw")){var ne=M/this.window.innerWidth*100;M=ne+"vw"}else if(b.endsWith("vh")){var V=M/this.window.innerHeight*100;M=V+"vh"}}if(w&&typeof w=="string"){if(w.endsWith("%")){var j=T/P.height*100;T=j+"%"}else if(w.endsWith("vw")){var ne=T/this.window.innerWidth*100;T=ne+"vw"}else if(w.endsWith("vh")){var V=T/this.window.innerHeight*100;T=V+"vh"}}var q={width:this.createSizeForCssProperty(M,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?q.flexBasis=q.width:this.flexDir==="column"&&(q.flexBasis=q.height),Wl.exports.flushSync(function(){r.setState(q)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,H)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:gl(gl({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var h=Object.keys(i).map(function(g){return i[g]!==!1?S(Qbe,{direction:g,onResizeStart:n.onResizeStart,replaceStyles:o&&o[g],className:a&&a[g],children:u&&u[g]?u[g]:null},g):null});return S("div",{className:l,style:s,children:h})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return rxe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=gl(gl(gl({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return X(o,{...gl({ref:this.ref,style:i,className:this.props.className},r),children:[this.state.isResizing&&S("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]})},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(C.exports.PureComponent);function Xn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function _2(e,t=[]){let n=[];function r(o,a){const s=C.exports.createContext(a),l=n.length;n=[...n,a];function u(g){const{scope:m,children:v,...b}=g,w=(m==null?void 0:m[e][l])||s,P=C.exports.useMemo(()=>b,Object.values(b));return C.exports.createElement(w.Provider,{value:P},v)}function h(g,m){const v=(m==null?void 0:m[e][l])||s,b=C.exports.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,h]}const i=()=>{const o=n.map(a=>C.exports.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return C.exports.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,ixe(i,...t)]}function ixe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const g=l(o)[`__scope${u}`];return{...s,...g}},{});return C.exports.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function oxe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function SW(...e){return t=>e.forEach(n=>oxe(n,t))}function Xa(...e){return C.exports.useCallback(SW(...e),e)}const Xv=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e,i=C.exports.Children.toArray(n),o=i.find(sxe);if(o){const a=o.props.children,s=i.map(l=>l===o?C.exports.Children.count(a)>1?C.exports.Children.only(null):C.exports.isValidElement(a)?a.props.children:null:l);return C.exports.createElement(x7,On({},r,{ref:t}),C.exports.isValidElement(a)?C.exports.cloneElement(a,void 0,s):null)}return C.exports.createElement(x7,On({},r,{ref:t}),n)});Xv.displayName="Slot";const x7=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e;return C.exports.isValidElement(n)?C.exports.cloneElement(n,{...lxe(r,n.props),ref:SW(t,n.ref)}):C.exports.Children.count(n)>1?C.exports.Children.only(null):null});x7.displayName="SlotClone";const axe=({children:e})=>C.exports.createElement(C.exports.Fragment,null,e);function sxe(e){return C.exports.isValidElement(e)&&e.type===axe}function lxe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const uxe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Iu=uxe.reduce((e,t)=>{const n=C.exports.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Xv:t;return C.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.exports.createElement(s,On({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function bW(e,t){e&&Wl.exports.flushSync(()=>e.dispatchEvent(t))}function xW(e){const t=e+"CollectionProvider",[n,r]=_2(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:w}=v,P=se.useRef(null),E=se.useRef(new Map).current;return se.createElement(i,{scope:b,itemMap:E,collectionRef:P},w)},s=e+"CollectionSlot",l=se.forwardRef((v,b)=>{const{scope:w,children:P}=v,E=o(s,w),_=Xa(b,E.collectionRef);return se.createElement(Xv,{ref:_},P)}),u=e+"CollectionItemSlot",h="data-radix-collection-item",g=se.forwardRef((v,b)=>{const{scope:w,children:P,...E}=v,_=se.useRef(null),T=Xa(b,_),M=o(u,w);return se.useEffect(()=>(M.itemMap.set(_,{ref:_,...E}),()=>void M.itemMap.delete(_))),se.createElement(Xv,{[h]:"",ref:T},P)});function m(v){const b=o(e+"CollectionConsumer",v);return se.useCallback(()=>{const P=b.collectionRef.current;if(!P)return[];const E=Array.from(P.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((M,O)=>E.indexOf(M.ref.current)-E.indexOf(O.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:g},m,r]}const cxe=C.exports.createContext(void 0);function wW(e){const t=C.exports.useContext(cxe);return e||t||"ltr"}function Fl(e){const t=C.exports.useRef(e);return C.exports.useEffect(()=>{t.current=e}),C.exports.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function dxe(e,t=globalThis==null?void 0:globalThis.document){const n=Fl(e);C.exports.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const w7="dismissableLayer.update",fxe="dismissableLayer.pointerDownOutside",hxe="dismissableLayer.focusOutside";let RM;const pxe=C.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gxe=C.exports.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,h=C.exports.useContext(pxe),[g,m]=C.exports.useState(null),v=(n=g==null?void 0:g.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=C.exports.useState({}),w=Xa(t,B=>m(B)),P=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),_=P.indexOf(E),T=g?P.indexOf(g):-1,M=h.layersWithOutsidePointerEventsDisabled.size>0,O=T>=_,I=mxe(B=>{const $=B.target,H=[...h.branches].some(j=>j.contains($));!O||H||(o==null||o(B),s==null||s(B),B.defaultPrevented||l==null||l())},v),D=vxe(B=>{const $=B.target;[...h.branches].some(j=>j.contains($))||(a==null||a(B),s==null||s(B),B.defaultPrevented||l==null||l())},v);return dxe(B=>{T===h.layers.size-1&&(i==null||i(B),!B.defaultPrevented&&l&&(B.preventDefault(),l()))},v),C.exports.useEffect(()=>{if(!!g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(RM=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),OM(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=RM)}},[g,v,r,h]),C.exports.useEffect(()=>()=>{!g||(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),OM())},[g,h]),C.exports.useEffect(()=>{const B=()=>b({});return document.addEventListener(w7,B),()=>document.removeEventListener(w7,B)},[]),C.exports.createElement(Iu.div,On({},u,{ref:w,style:{pointerEvents:M?O?"auto":"none":void 0,...e.style},onFocusCapture:Xn(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Xn(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Xn(e.onPointerDownCapture,I.onPointerDownCapture)}))});function mxe(e,t=globalThis==null?void 0:globalThis.document){const n=Fl(e),r=C.exports.useRef(!1),i=C.exports.useRef(()=>{});return C.exports.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){CW(fxe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function vxe(e,t=globalThis==null?void 0:globalThis.document){const n=Fl(e),r=C.exports.useRef(!1);return C.exports.useEffect(()=>{const i=o=>{o.target&&!r.current&&CW(hxe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function OM(){const e=new CustomEvent(w7);document.dispatchEvent(e)}function CW(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?bW(i,o):i.dispatchEvent(o)}let Gw=0;function yxe(){C.exports.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:IM()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:IM()),Gw++,()=>{Gw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Gw--}},[])}function IM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const jw="focusScope.autoFocusOnMount",Yw="focusScope.autoFocusOnUnmount",DM={bubbles:!1,cancelable:!0},Sxe=C.exports.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=C.exports.useState(null),u=Fl(i),h=Fl(o),g=C.exports.useRef(null),m=Xa(t,w=>l(w)),v=C.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.exports.useEffect(()=>{if(r){let w=function(E){if(v.paused||!s)return;const _=E.target;s.contains(_)?g.current=_:zf(g.current,{select:!0})},P=function(E){v.paused||!s||s.contains(E.relatedTarget)||zf(g.current,{select:!0})};return document.addEventListener("focusin",w),document.addEventListener("focusout",P),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",P)}}},[r,s,v.paused]),C.exports.useEffect(()=>{if(s){BM.add(v);const w=document.activeElement;if(!s.contains(w)){const E=new CustomEvent(jw,DM);s.addEventListener(jw,u),s.dispatchEvent(E),E.defaultPrevented||(bxe(kxe(_W(s)),{select:!0}),document.activeElement===w&&zf(s))}return()=>{s.removeEventListener(jw,u),setTimeout(()=>{const E=new CustomEvent(Yw,DM);s.addEventListener(Yw,h),s.dispatchEvent(E),E.defaultPrevented||zf(w!=null?w:document.body,{select:!0}),s.removeEventListener(Yw,h),BM.remove(v)},0)}}},[s,u,h,v]);const b=C.exports.useCallback(w=>{if(!n&&!r||v.paused)return;const P=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(P&&E){const _=w.currentTarget,[T,M]=xxe(_);T&&M?!w.shiftKey&&E===M?(w.preventDefault(),n&&zf(T,{select:!0})):w.shiftKey&&E===T&&(w.preventDefault(),n&&zf(M,{select:!0})):E===_&&w.preventDefault()}},[n,r,v.paused]);return C.exports.createElement(Iu.div,On({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function bxe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zf(r,{select:t}),document.activeElement!==n)return}function xxe(e){const t=_W(e),n=NM(t,e),r=NM(t.reverse(),e);return[n,r]}function _W(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function NM(e,t){for(const n of e)if(!wxe(n,{upTo:t}))return n}function wxe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Cxe(e){return e instanceof HTMLInputElement&&"select"in e}function zf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Cxe(e)&&t&&e.select()}}const BM=_xe();function _xe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=zM(e,t),e.unshift(t)},remove(t){var n;e=zM(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function zM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kxe(e){return e.filter(t=>t.tagName!=="A")}const d1=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:()=>{},Exe=l6["useId".toString()]||(()=>{});let Pxe=0;function Txe(e){const[t,n]=C.exports.useState(Exe());return d1(()=>{e||n(r=>r!=null?r:String(Pxe++))},[e]),e||(t?`radix-${t}`:"")}function L1(e){return e.split("-")[0]}function vb(e){return e.split("-")[1]}function A1(e){return["top","bottom"].includes(L1(e))?"x":"y"}function Tk(e){return e==="y"?"height":"width"}function FM(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=A1(t),l=Tk(s),u=r[l]/2-i[l]/2,h=L1(t),g=s==="x";let m;switch(h){case"top":m={x:o,y:r.y-i.height};break;case"bottom":m={x:o,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:a};break;case"left":m={x:r.x-i.width,y:a};break;default:m={x:r.x,y:r.y}}switch(vb(t)){case"start":m[s]-=u*(n&&g?-1:1);break;case"end":m[s]+=u*(n&&g?-1:1);break}return m}const Lxe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:h}=FM(l,r,s),g=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e!=null?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=kW(r),h={x:i,y:o},g=A1(a),m=vb(a),v=Tk(g),b=await l.getDimensions(n),w=g==="y"?"top":"left",P=g==="y"?"bottom":"right",E=s.reference[v]+s.reference[g]-h[g]-s.floating[v],_=h[g]-s.reference[g],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let M=T?g==="y"?T.clientHeight||0:T.clientWidth||0:0;M===0&&(M=s.floating[v]);const O=E/2-_/2,I=u[w],D=M-b[v]-u[P],B=M/2-b[v]/2+O,$=C7(I,B,D),ne=(m==="start"?u[w]:u[P])>0&&B!==$&&s.reference[v]<=s.floating[v]?BOxe[t])}function Ixe(e,t,n){n===void 0&&(n=!1);const r=vb(e),i=A1(e),o=Tk(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=P4(a)),{main:a,cross:P4(a)}}const Dxe={start:"end",end:"start"};function HM(e){return e.replace(/start|end/g,t=>Dxe[t])}const Nxe=["top","right","bottom","left"];function Bxe(e){const t=P4(e);return[HM(e),t,HM(t)]}const zxe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,w=L1(r),E=g||(w===a||!v?[P4(a)]:Bxe(a)),_=[a,...E],T=await E4(t,b),M=[];let O=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&M.push(T[w]),h){const{main:$,cross:H}=Ixe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));M.push(T[$],T[H])}if(O=[...O,{placement:r,overflows:M}],!M.every($=>$<=0)){var I,D;const $=((I=(D=i.flip)==null?void 0:D.index)!=null?I:0)+1,H=_[$];if(H)return{data:{index:$,overflows:O},reset:{placement:H}};let j="bottom";switch(m){case"bestFit":{var B;const ne=(B=O.map(V=>[V,V.overflows.filter(q=>q>0).reduce((q,te)=>q+te,0)]).sort((V,q)=>V[1]-q[1])[0])==null?void 0:B[0].placement;ne&&(j=ne);break}case"initialPlacement":j=a;break}if(r!==j)return{reset:{placement:j}}}return{}}}};function WM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function VM(e){return Nxe.some(t=>e[t]>=0)}const Fxe=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=await E4(r,{...n,elementContext:"reference"}),a=WM(o,i.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:VM(a)}}}case"escaped":{const o=await E4(r,{...n,altBoundary:!0}),a=WM(o,i.floating);return{data:{escapedOffsets:a,escaped:VM(a)}}}default:return{}}}}};async function $xe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=L1(n),s=vb(n),l=A1(n)==="x",u=["left","top"].includes(a)?-1:1,h=o&&l?-1:1,g=typeof t=="function"?t(e):t;let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return s&&typeof b=="number"&&(v=s==="end"?b*-1:b),l?{x:v*h,y:m*u}:{x:m*u,y:v*h}}const Hxe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await $xe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function EW(e){return e==="x"?"y":"x"}const Wxe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:P=>{let{x:E,y:_}=P;return{x:E,y:_}}},...l}=e,u={x:n,y:r},h=await E4(t,l),g=A1(L1(i)),m=EW(g);let v=u[g],b=u[m];if(o){const P=g==="y"?"top":"left",E=g==="y"?"bottom":"right",_=v+h[P],T=v-h[E];v=C7(_,v,T)}if(a){const P=m==="y"?"top":"left",E=m==="y"?"bottom":"right",_=b+h[P],T=b-h[E];b=C7(_,b,T)}const w=s.fn({...t,[g]:v,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r}}}}},Vxe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,h={x:n,y:r},g=A1(i),m=EW(g);let v=h[g],b=h[m];const w=typeof s=="function"?s({...o,placement:i}):s,P=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const O=g==="y"?"height":"width",I=o.reference[g]-o.floating[O]+P.mainAxis,D=o.reference[g]+o.reference[O]-P.mainAxis;vD&&(v=D)}if(u){var E,_,T,M;const O=g==="y"?"width":"height",I=["top","left"].includes(L1(i)),D=o.reference[m]-o.floating[O]+(I&&(E=(_=a.offset)==null?void 0:_[m])!=null?E:0)+(I?0:P.crossAxis),B=o.reference[m]+o.reference[O]+(I?0:(T=(M=a.offset)==null?void 0:M[m])!=null?T:0)-(I?P.crossAxis:0);bB&&(b=B)}return{[g]:v,[m]:b}}}};function PW(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Vu(e){if(e==null)return window;if(!PW(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function k2(e){return Vu(e).getComputedStyle(e)}function Du(e){return PW(e)?"":e?(e.nodeName||"").toLowerCase():""}function TW(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function $l(e){return e instanceof Vu(e).HTMLElement}function wd(e){return e instanceof Vu(e).Element}function Uxe(e){return e instanceof Vu(e).Node}function Lk(e){if(typeof ShadowRoot>"u")return!1;const t=Vu(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function yb(e){const{overflow:t,overflowX:n,overflowY:r}=k2(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function Gxe(e){return["table","td","th"].includes(Du(e))}function LW(e){const t=/firefox/i.test(TW()),n=k2(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}function AW(){return!/^((?!chrome|android).)*safari/i.test(TW())}const UM=Math.min,iv=Math.max,T4=Math.round;function Nu(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&$l(e)&&(l=e.offsetWidth>0&&T4(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&T4(s.height)/e.offsetHeight||1);const h=wd(e)?Vu(e):window,g=!AW()&&n,m=(s.left+(g&&(r=(i=h.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(g&&(o=(a=h.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,w=s.height/u;return{width:b,height:w,top:v,right:m+b,bottom:v+w,left:m,x:m,y:v}}function Od(e){return((Uxe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Sb(e){return wd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function MW(e){return Nu(Od(e)).left+Sb(e).scrollLeft}function jxe(e){const t=Nu(e);return T4(t.width)!==e.offsetWidth||T4(t.height)!==e.offsetHeight}function Yxe(e,t,n){const r=$l(t),i=Od(t),o=Nu(e,r&&jxe(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Du(t)!=="body"||yb(i))&&(a=Sb(t)),$l(t)){const l=Nu(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=MW(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function RW(e){return Du(e)==="html"?e:e.assignedSlot||e.parentNode||(Lk(e)?e.host:null)||Od(e)}function GM(e){return!$l(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function qxe(e){let t=RW(e);for(Lk(t)&&(t=t.host);$l(t)&&!["html","body"].includes(Du(t));){if(LW(t))return t;t=t.parentNode}return null}function _7(e){const t=Vu(e);let n=GM(e);for(;n&&Gxe(n)&&getComputedStyle(n).position==="static";)n=GM(n);return n&&(Du(n)==="html"||Du(n)==="body"&&getComputedStyle(n).position==="static"&&!LW(n))?t:n||qxe(e)||t}function jM(e){if($l(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Nu(e);return{width:t.width,height:t.height}}function Kxe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=$l(n),o=Od(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Du(n)!=="body"||yb(o))&&(a=Sb(n)),$l(n))){const l=Nu(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}}function Xxe(e,t){const n=Vu(e),r=Od(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=AW();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function Zxe(e){var t;const n=Od(e),r=Sb(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=iv(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=iv(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+MW(e);const l=-r.scrollTop;return k2(i||n).direction==="rtl"&&(s+=iv(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function OW(e){const t=RW(e);return["html","body","#document"].includes(Du(t))?e.ownerDocument.body:$l(t)&&yb(t)?t:OW(t)}function L4(e,t){var n;t===void 0&&(t=[]);const r=OW(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Vu(r),a=i?[o].concat(o.visualViewport||[],yb(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(L4(a))}function Qxe(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Lk(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Jxe(e,t){const n=Nu(e,!1,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function YM(e,t,n){return t==="viewport"?k4(Xxe(e,n)):wd(t)?Jxe(t,n):k4(Zxe(Od(e)))}function ewe(e){const t=L4(e),r=["absolute","fixed"].includes(k2(e).position)&&$l(e)?_7(e):e;return wd(r)?t.filter(i=>wd(i)&&Qxe(i,r)&&Du(i)!=="body"):[]}function twe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ewe(t):[].concat(n),r],s=a[0],l=a.reduce((u,h)=>{const g=YM(t,h,i);return u.top=iv(g.top,u.top),u.right=UM(g.right,u.right),u.bottom=UM(g.bottom,u.bottom),u.left=iv(g.left,u.left),u},YM(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const nwe={getClippingRect:twe,convertOffsetParentRelativeRectToViewportRelativeRect:Kxe,isElement:wd,getDimensions:jM,getOffsetParent:_7,getDocumentElement:Od,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Yxe(t,_7(n),r),floating:{...jM(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>k2(e).direction==="rtl"};function rwe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,h=l||u?[...wd(e)?L4(e):[],...L4(t)]:[];h.forEach(w=>{l&&w.addEventListener("scroll",n,{passive:!0}),u&&w.addEventListener("resize",n)});let g=null;if(a){let w=!0;g=new ResizeObserver(()=>{w||n(),w=!1}),wd(e)&&!s&&g.observe(e),g.observe(t)}let m,v=s?Nu(e):null;s&&b();function b(){const w=Nu(e);v&&(w.x!==v.x||w.y!==v.y||w.width!==v.width||w.height!==v.height)&&n(),v=w,m=requestAnimationFrame(b)}return n(),()=>{var w;h.forEach(P=>{l&&P.removeEventListener("scroll",n),u&&P.removeEventListener("resize",n)}),(w=g)==null||w.disconnect(),g=null,s&&cancelAnimationFrame(m)}}const iwe=(e,t,n)=>Lxe(e,t,{platform:nwe,...n});var k7=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function E7(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!E7(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!E7(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function owe(e){const t=C.exports.useRef(e);return k7(()=>{t.current=e}),t}function awe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=C.exports.useRef(null),a=C.exports.useRef(null),s=owe(i),l=C.exports.useRef(null),[u,h]=C.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[g,m]=C.exports.useState(t);E7(g==null?void 0:g.map(T=>{let{options:M}=T;return M}),t==null?void 0:t.map(T=>{let{options:M}=T;return M}))||m(t);const v=C.exports.useCallback(()=>{!o.current||!a.current||iwe(o.current,a.current,{middleware:g,placement:n,strategy:r}).then(T=>{b.current&&Wl.exports.flushSync(()=>{h(T)})})},[g,n,r]);k7(()=>{b.current&&v()},[v]);const b=C.exports.useRef(!1);k7(()=>(b.current=!0,()=>{b.current=!1}),[]);const w=C.exports.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,v);l.current=T}else v()},[v,s]),P=C.exports.useCallback(T=>{o.current=T,w()},[w]),E=C.exports.useCallback(T=>{a.current=T,w()},[w]),_=C.exports.useMemo(()=>({reference:o,floating:a}),[]);return C.exports.useMemo(()=>({...u,update:v,refs:_,reference:P,floating:E}),[u,v,_,P,E])}const swe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?$M({element:t.current,padding:n}).fn(i):{}:t?$M({element:t,padding:n}).fn(i):{}}}};function lwe(e){const[t,n]=C.exports.useState(void 0);return d1(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const IW="Popper",[Ak,DW]=_2(IW),[uwe,NW]=Ak(IW),cwe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.exports.useState(null);return C.exports.createElement(uwe,{scope:t,anchor:r,onAnchorChange:i},n)},dwe="PopperAnchor",fwe=C.exports.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=NW(dwe,n),a=C.exports.useRef(null),s=Xa(t,a);return C.exports.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:C.exports.createElement(Iu.div,On({},i,{ref:s}))}),A4="PopperContent",[hwe,BLe]=Ak(A4),[pwe,gwe]=Ak(A4,{hasParent:!1,positionUpdateFns:new Set}),mwe=C.exports.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:h,side:g="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:w=0,collisionBoundary:P=[],collisionPadding:E=0,sticky:_="partial",hideWhenDetached:T=!1,avoidCollisions:M=!0,...O}=e,I=NW(A4,h),[D,B]=C.exports.useState(null),$=Xa(t,Et=>B(Et)),[H,j]=C.exports.useState(null),ne=lwe(H),V=(n=ne==null?void 0:ne.width)!==null&&n!==void 0?n:0,q=(r=ne==null?void 0:ne.height)!==null&&r!==void 0?r:0,te=g+(v!=="center"?"-"+v:""),J=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(P)?P:[P],G=Z.length>0,ee={padding:J,boundary:Z.filter(ywe),altBoundary:G},{reference:le,floating:me,strategy:Me,x:Ce,y:be,placement:we,middlewareData:Ve,update:Ze}=awe({strategy:"fixed",placement:te,whileElementsMounted:rwe,middleware:[Hxe({mainAxis:m+q,alignmentAxis:b}),M?Wxe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?Vxe():void 0,...ee}):void 0,H?swe({element:H,padding:w}):void 0,M?zxe({...ee}):void 0,Swe({arrowWidth:V,arrowHeight:q}),T?Fxe({strategy:"referenceHidden"}):void 0].filter(vwe)});d1(()=>{le(I.anchor)},[le,I.anchor]);const it=Ce!==null&&be!==null,[pt,kt]=BW(we),gt=(i=Ve.arrow)===null||i===void 0?void 0:i.x,ht=(o=Ve.arrow)===null||o===void 0?void 0:o.y,vt=((a=Ve.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Te,ot]=C.exports.useState();d1(()=>{D&&ot(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:Je}=gwe(A4,h),mt=!Mt;C.exports.useLayoutEffect(()=>{if(!mt)return Je.add(Ze),()=>{Je.delete(Ze)}},[mt,Je,Ze]),C.exports.useLayoutEffect(()=>{mt&&it&&Array.from(Je).reverse().forEach(Et=>requestAnimationFrame(Et))},[mt,it,Je]);const un={"data-side":pt,"data-align":kt,...O,ref:$,style:{...O.style,animation:it?void 0:"none",opacity:(s=Ve.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return C.exports.createElement("div",{ref:me,"data-radix-popper-content-wrapper":"",style:{position:Me,left:0,top:0,transform:it?`translate3d(${Math.round(Ce)}px, ${Math.round(be)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Te,["--radix-popper-transform-origin"]:[(l=Ve.transformOrigin)===null||l===void 0?void 0:l.x,(u=Ve.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},C.exports.createElement(hwe,{scope:h,placedSide:pt,onArrowChange:j,arrowX:gt,arrowY:ht,shouldHideArrow:vt},mt?C.exports.createElement(pwe,{scope:h,hasParent:!0,positionUpdateFns:Je},C.exports.createElement(Iu.div,un)):C.exports.createElement(Iu.div,un)))});function vwe(e){return e!==void 0}function ywe(e){return e!==null}const Swe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,g=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=g?0:e.arrowWidth,v=g?0:e.arrowHeight,[b,w]=BW(s),P={start:"0%",center:"50%",end:"100%"}[w],E=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",M="";return b==="bottom"?(T=g?P:`${E}px`,M=`${-v}px`):b==="top"?(T=g?P:`${E}px`,M=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,M=g?P:`${_}px`):b==="left"&&(T=`${l.floating.width+v}px`,M=g?P:`${_}px`),{data:{x:T,y:M}}}});function BW(e){const[t,n="center"]=e.split("-");return[t,n]}const bwe=cwe,xwe=fwe,wwe=mwe;function Cwe(e,t){return C.exports.useReducer((n,r)=>{const i=t[n][r];return i!=null?i:n},e)}const zW=e=>{const{present:t,children:n}=e,r=_we(t),i=typeof n=="function"?n({present:r.isPresent}):C.exports.Children.only(n),o=Xa(r.ref,i.ref);return typeof n=="function"||r.isPresent?C.exports.cloneElement(i,{ref:o}):null};zW.displayName="Presence";function _we(e){const[t,n]=C.exports.useState(),r=C.exports.useRef({}),i=C.exports.useRef(e),o=C.exports.useRef("none"),a=e?"mounted":"unmounted",[s,l]=Cwe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.exports.useEffect(()=>{const u=d3(r.current);o.current=s==="mounted"?u:"none"},[s]),d1(()=>{const u=r.current,h=i.current;if(h!==e){const m=o.current,v=d3(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(h&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),d1(()=>{if(t){const u=g=>{const v=d3(r.current).includes(g.animationName);g.target===t&&v&&Wl.exports.flushSync(()=>l("ANIMATION_END"))},h=g=>{g.target===t&&(o.current=d3(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:C.exports.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function d3(e){return(e==null?void 0:e.animationName)||"none"}function kwe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Ewe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Fl(n),l=C.exports.useCallback(u=>{if(o){const g=typeof u=="function"?u(e):u;g!==e&&s(g)}else i(u)},[o,e,i,s]);return[a,l]}function Ewe({defaultProp:e,onChange:t}){const n=C.exports.useState(e),[r]=n,i=C.exports.useRef(r),o=Fl(t);return C.exports.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const qw="rovingFocusGroup.onEntryFocus",Pwe={bubbles:!1,cancelable:!0},Mk="RovingFocusGroup",[P7,FW,Twe]=xW(Mk),[Lwe,$W]=_2(Mk,[Twe]),[Awe,Mwe]=Lwe(Mk),Rwe=C.exports.forwardRef((e,t)=>C.exports.createElement(P7.Provider,{scope:e.__scopeRovingFocusGroup},C.exports.createElement(P7.Slot,{scope:e.__scopeRovingFocusGroup},C.exports.createElement(Owe,On({},e,{ref:t}))))),Owe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...h}=e,g=C.exports.useRef(null),m=Xa(t,g),v=wW(o),[b=null,w]=kwe({prop:a,defaultProp:s,onChange:l}),[P,E]=C.exports.useState(!1),_=Fl(u),T=FW(n),M=C.exports.useRef(!1),[O,I]=C.exports.useState(0);return C.exports.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(qw,_),()=>D.removeEventListener(qw,_)},[_]),C.exports.createElement(Awe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:C.exports.useCallback(D=>w(D),[w]),onItemShiftTab:C.exports.useCallback(()=>E(!0),[]),onFocusableItemAdd:C.exports.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:C.exports.useCallback(()=>I(D=>D-1),[])},C.exports.createElement(Iu.div,On({tabIndex:P||O===0?-1:0,"data-orientation":r},h,{ref:m,style:{outline:"none",...e.style},onMouseDown:Xn(e.onMouseDown,()=>{M.current=!0}),onFocus:Xn(e.onFocus,D=>{const B=!M.current;if(D.target===D.currentTarget&&B&&!P){const $=new CustomEvent(qw,Pwe);if(D.currentTarget.dispatchEvent($),!$.defaultPrevented){const H=T().filter(te=>te.focusable),j=H.find(te=>te.active),ne=H.find(te=>te.id===b),q=[j,ne,...H].filter(Boolean).map(te=>te.ref.current);HW(q)}}M.current=!1}),onBlur:Xn(e.onBlur,()=>E(!1))})))}),Iwe="RovingFocusGroupItem",Dwe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=Txe(),s=Mwe(Iwe,n),l=s.currentTabStopId===a,u=FW(n),{onFocusableItemAdd:h,onFocusableItemRemove:g}=s;return C.exports.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),C.exports.createElement(P7.ItemSlot,{scope:n,id:a,focusable:r,active:i},C.exports.createElement(Iu.span,On({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:Xn(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:Xn(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:Xn(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=zwe(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let w=u().filter(P=>P.focusable).map(P=>P.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const P=w.indexOf(m.currentTarget);w=s.loop?Fwe(w,P+1):w.slice(P+1)}setTimeout(()=>HW(w))}})})))}),Nwe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bwe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function zwe(e,t,n){const r=Bwe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Nwe[r]}function HW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Fwe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const $we=Rwe,Hwe=Dwe,Wwe=["Enter"," "],Vwe=["ArrowDown","PageUp","Home"],WW=["ArrowUp","PageDown","End"],Uwe=[...Vwe,...WW],bb="Menu",[T7,Gwe,jwe]=xW(bb),[Mh,VW]=_2(bb,[jwe,DW,$W]),Rk=DW(),UW=$W(),[Ywe,xb]=Mh(bb),[qwe,Ok]=Mh(bb),Kwe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=Rk(t),[l,u]=C.exports.useState(null),h=C.exports.useRef(!1),g=Fl(o),m=wW(i);return C.exports.useEffect(()=>{const v=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),C.exports.createElement(bwe,s,C.exports.createElement(Ywe,{scope:t,open:n,onOpenChange:g,content:l,onContentChange:u},C.exports.createElement(qwe,{scope:t,onClose:C.exports.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:h,dir:m,modal:a},r)))},Xwe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rk(n);return C.exports.createElement(xwe,On({},i,r,{ref:t}))}),Zwe="MenuPortal",[zLe,Qwe]=Mh(Zwe,{forceMount:void 0}),pd="MenuContent",[Jwe,GW]=Mh(pd),e6e=C.exports.forwardRef((e,t)=>{const n=Qwe(pd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=xb(pd,e.__scopeMenu),a=Ok(pd,e.__scopeMenu);return C.exports.createElement(T7.Provider,{scope:e.__scopeMenu},C.exports.createElement(zW,{present:r||o.open},C.exports.createElement(T7.Slot,{scope:e.__scopeMenu},a.modal?C.exports.createElement(t6e,On({},i,{ref:t})):C.exports.createElement(n6e,On({},i,{ref:t})))))}),t6e=C.exports.forwardRef((e,t)=>{const n=xb(pd,e.__scopeMenu),r=C.exports.useRef(null),i=Xa(t,r);return C.exports.useEffect(()=>{const o=r.current;if(o)return aF(o)},[]),C.exports.createElement(jW,On({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Xn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),n6e=C.exports.forwardRef((e,t)=>{const n=xb(pd,e.__scopeMenu);return C.exports.createElement(jW,On({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),jW=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:g,onDismiss:m,disableOutsideScroll:v,...b}=e,w=xb(pd,n),P=Ok(pd,n),E=Rk(n),_=UW(n),T=Gwe(n),[M,O]=C.exports.useState(null),I=C.exports.useRef(null),D=Xa(t,I,w.onContentChange),B=C.exports.useRef(0),$=C.exports.useRef(""),H=C.exports.useRef(0),j=C.exports.useRef(null),ne=C.exports.useRef("right"),V=C.exports.useRef(0),q=v?jF:C.exports.Fragment,te=v?{as:Xv,allowPinchZoom:!0}:void 0,J=G=>{var ee,le;const me=$.current+G,Me=T().filter(it=>!it.disabled),Ce=document.activeElement,be=(ee=Me.find(it=>it.ref.current===Ce))===null||ee===void 0?void 0:ee.textValue,we=Me.map(it=>it.textValue),Ve=d6e(we,me,be),Ze=(le=Me.find(it=>it.textValue===Ve))===null||le===void 0?void 0:le.ref.current;(function it(pt){$.current=pt,window.clearTimeout(B.current),pt!==""&&(B.current=window.setTimeout(()=>it(""),1e3))})(me),Ze&&setTimeout(()=>Ze.focus())};C.exports.useEffect(()=>()=>window.clearTimeout(B.current),[]),yxe();const Z=C.exports.useCallback(G=>{var ee,le;return ne.current===((ee=j.current)===null||ee===void 0?void 0:ee.side)&&h6e(G,(le=j.current)===null||le===void 0?void 0:le.area)},[]);return C.exports.createElement(Jwe,{scope:n,searchRef:$,onItemEnter:C.exports.useCallback(G=>{Z(G)&&G.preventDefault()},[Z]),onItemLeave:C.exports.useCallback(G=>{var ee;Z(G)||((ee=I.current)===null||ee===void 0||ee.focus(),O(null))},[Z]),onTriggerLeave:C.exports.useCallback(G=>{Z(G)&&G.preventDefault()},[Z]),pointerGraceTimerRef:H,onPointerGraceIntentChange:C.exports.useCallback(G=>{j.current=G},[])},C.exports.createElement(q,te,C.exports.createElement(Sxe,{asChild:!0,trapped:i,onMountAutoFocus:Xn(o,G=>{var ee;G.preventDefault(),(ee=I.current)===null||ee===void 0||ee.focus()}),onUnmountAutoFocus:a},C.exports.createElement(gxe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:g,onDismiss:m},C.exports.createElement($we,On({asChild:!0},_,{dir:P.dir,orientation:"vertical",loop:r,currentTabStopId:M,onCurrentTabStopIdChange:O,onEntryFocus:G=>{P.isUsingKeyboardRef.current||G.preventDefault()}}),C.exports.createElement(wwe,On({role:"menu","aria-orientation":"vertical","data-state":l6e(w.open),"data-radix-menu-content":"",dir:P.dir},E,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:Xn(b.onKeyDown,G=>{const le=G.target.closest("[data-radix-menu-content]")===G.currentTarget,me=G.ctrlKey||G.altKey||G.metaKey,Me=G.key.length===1;le&&(G.key==="Tab"&&G.preventDefault(),!me&&Me&&J(G.key));const Ce=I.current;if(G.target!==Ce||!Uwe.includes(G.key))return;G.preventDefault();const we=T().filter(Ve=>!Ve.disabled).map(Ve=>Ve.ref.current);WW.includes(G.key)&&we.reverse(),u6e(we)}),onBlur:Xn(e.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(B.current),$.current="")}),onPointerMove:Xn(e.onPointerMove,A7(G=>{const ee=G.target,le=V.current!==G.clientX;if(G.currentTarget.contains(ee)&&le){const me=G.clientX>V.current?"right":"left";ne.current=me,V.current=G.clientX}}))})))))))}),L7="MenuItem",qM="menu.itemSelect",r6e=C.exports.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=C.exports.useRef(null),a=Ok(L7,e.__scopeMenu),s=GW(L7,e.__scopeMenu),l=Xa(t,o),u=C.exports.useRef(!1),h=()=>{const g=o.current;if(!n&&g){const m=new CustomEvent(qM,{bubbles:!0,cancelable:!0});g.addEventListener(qM,v=>r==null?void 0:r(v),{once:!0}),bW(g,m),m.defaultPrevented?u.current=!1:a.onClose()}};return C.exports.createElement(i6e,On({},i,{ref:l,disabled:n,onClick:Xn(e.onClick,h),onPointerDown:g=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,g),u.current=!0},onPointerUp:Xn(e.onPointerUp,g=>{var m;u.current||(m=g.currentTarget)===null||m===void 0||m.click()}),onKeyDown:Xn(e.onKeyDown,g=>{const m=s.searchRef.current!=="";n||m&&g.key===" "||Wwe.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})}))}),i6e=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=GW(L7,n),s=UW(n),l=C.exports.useRef(null),u=Xa(t,l),[h,g]=C.exports.useState(!1),[m,v]=C.exports.useState("");return C.exports.useEffect(()=>{const b=l.current;if(b){var w;v(((w=b.textContent)!==null&&w!==void 0?w:"").trim())}},[o.children]),C.exports.createElement(T7.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:m},C.exports.createElement(Hwe,On({asChild:!0},s,{focusable:!r}),C.exports.createElement(Iu.div,On({role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:Xn(e.onPointerMove,A7(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:Xn(e.onPointerLeave,A7(b=>a.onItemLeave(b))),onFocus:Xn(e.onFocus,()=>g(!0)),onBlur:Xn(e.onBlur,()=>g(!1))}))))}),o6e="MenuRadioGroup";Mh(o6e,{value:void 0,onValueChange:()=>{}});const a6e="MenuItemIndicator";Mh(a6e,{checked:!1});const s6e="MenuSub";Mh(s6e);function l6e(e){return e?"open":"closed"}function u6e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function c6e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function d6e(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=c6e(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function f6e(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=h>r&&n<(u-s)*(r-l)/(h-l)+s&&(i=!i)}return i}function h6e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return f6e(n,t)}function A7(e){return t=>t.pointerType==="mouse"?e(t):void 0}const p6e=Kwe,g6e=Xwe,m6e=e6e,v6e=r6e,YW="ContextMenu",[y6e,FLe]=_2(YW,[VW]),wb=VW(),[S6e,qW]=y6e(YW),b6e=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=C.exports.useState(!1),l=wb(t),u=Fl(r),h=C.exports.useCallback(g=>{s(g),u(g)},[u]);return C.exports.createElement(S6e,{scope:t,open:a,onOpenChange:h,modal:o},C.exports.createElement(p6e,On({},l,{dir:i,open:a,onOpenChange:h,modal:o}),n))},x6e="ContextMenuTrigger",w6e=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=qW(x6e,n),o=wb(n),a=C.exports.useRef({x:0,y:0}),s=C.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=C.exports.useRef(0),u=C.exports.useCallback(()=>window.clearTimeout(l.current),[]),h=g=>{a.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return C.exports.useEffect(()=>u,[u]),C.exports.createElement(C.exports.Fragment,null,C.exports.createElement(g6e,On({},o,{virtualRef:s})),C.exports.createElement(Iu.span,On({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:Xn(e.onContextMenu,g=>{u(),h(g),g.preventDefault()}),onPointerDown:Xn(e.onPointerDown,f3(g=>{u(),l.current=window.setTimeout(()=>h(g),700)})),onPointerMove:Xn(e.onPointerMove,f3(u)),onPointerCancel:Xn(e.onPointerCancel,f3(u)),onPointerUp:Xn(e.onPointerUp,f3(u))})))}),C6e="ContextMenuContent",_6e=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=qW(C6e,n),o=wb(n),a=C.exports.useRef(!1);return C.exports.createElement(m6e,On({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),k6e=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=wb(n);return C.exports.createElement(v6e,On({},i,r,{ref:t}))});function f3(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const E6e=b6e,P6e=w6e,T6e=_6e,Bc=k6e,L6e=rt([e=>e.gallery,e=>e.options,vr,Tr],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:h,galleryImageObjectFit:g,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:w}=e,{isLightBoxOpen:P}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:h,galleryImageObjectFit:g,galleryGridTemplateColumns:w?"auto":`repeat(auto-fill, minmax(${h}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightBoxOpen:P,isStaging:n,shouldEnableResize:!(P||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:w}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),A6e=rt([e=>e.options,e=>e.gallery,e=>e.system,Tr],(e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),M6e=e=>e.gallery,R6e=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,O6e=C.exports.memo(e=>{var ne,V,q,te,J,Z,G,ee;const t=De(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,isLightBoxOpen:a,shouldUseSingleGalleryColumn:s}=ye(A6e),{image:l,isSelected:u}=e,{url:h,thumbnail:g,uuid:m,metadata:v}=l,[b,w]=C.exports.useState(!1),P=x2(),E=()=>w(!0),_=()=>w(!1),T=()=>{l.metadata&&t(Ob(l.metadata.image.prompt)),P({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})},M=()=>{l.metadata&&t(T2(l.metadata.image.seed)),P({title:"Seed Set",status:"success",duration:2500,isClosable:!0})},O=()=>{a&&t(_u(!1)),t(O1(l)),n!=="img2img"&&t(Lo("img2img")),P({title:"Sent to Image To Image",status:"success",duration:2500,isClosable:!0})},I=()=>{a&&t(_u(!1)),t(mb(l)),t(gb()),n!=="unifiedCanvas"&&t(Lo("unifiedCanvas")),P({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0})},D=()=>{v&&t(AEe(v)),P({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})},B=async()=>{var le;if((le=v==null?void 0:v.image)!=null&&le.init_image_path&&(await fetch(v.image.init_image_path)).ok){t(Lo("img2img")),t(TEe(v)),P({title:"Initial Image Set",status:"success",duration:2500,isClosable:!0});return}P({title:"Initial Image Not Set",description:"Could not load initial image.",status:"error",duration:2500,isClosable:!0})},$=()=>t(EM(l)),H=le=>{le.dataTransfer.setData("invokeai/imageUuid",m),le.dataTransfer.effectAllowed="move"},j=()=>{t(_u(!0)),t(EM(l))};return X(E6e,{onOpenChange:le=>{t(hW(le))},children:[S(P6e,{children:X(Ld,{position:"relative",className:"hoverable-image",onMouseOver:E,onMouseOut:_,userSelect:"none",draggable:!0,onDragStart:H,children:[S(DS,{className:"hoverable-image-image",objectFit:s?"contain":r,rounded:"md",src:g||h,loading:"lazy"}),S("div",{className:"hoverable-image-content",onClick:$,children:u&&S(wa,{width:"50%",height:"50%",as:dk,className:"hoverable-image-check"})}),b&&i>=64&&S("div",{className:"hoverable-image-delete-button",children:S(bi,{label:"Delete image",hasArrow:!0,children:S(b7,{image:l,children:S(Ya,{"aria-label":"Delete image",icon:S(LSe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})})]},m)}),X(T6e,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:le=>{le.detail.originalEvent.preventDefault()},children:[S(Bc,{onClickCapture:j,children:"Open In Viewer"}),S(Bc,{onClickCapture:T,disabled:((V=(ne=l==null?void 0:l.metadata)==null?void 0:ne.image)==null?void 0:V.prompt)===void 0,children:"Use Prompt"}),S(Bc,{onClickCapture:M,disabled:((te=(q=l==null?void 0:l.metadata)==null?void 0:q.image)==null?void 0:te.seed)===void 0,children:"Use Seed"}),S(Bc,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(J=l==null?void 0:l.metadata)==null?void 0:J.image)==null?void 0:Z.type),children:"Use All Parameters"}),S(bi,{label:"Load initial image used for this generation",children:S(Bc,{onClickCapture:B,disabled:((ee=(G=l==null?void 0:l.metadata)==null?void 0:G.image)==null?void 0:ee.type)!=="img2img",children:"Use Initial Image"})}),S(Bc,{onClickCapture:O,children:"Send to Image To Image"}),S(Bc,{onClickCapture:I,children:"Send to Unified Canvas"}),S(b7,{image:l,children:S(Bc,{"data-warning":!0,children:"Delete Image"})})]})]})},R6e),fr=e=>{const{label:t,styleClass:n,...r}=e;return S(gz,{className:`invokeai__checkbox ${n}`,...r,children:t})},h3=320,KM=40,I6e={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500}},XM=400;function KW(){const e=De(),{images:t,currentCategory:n,currentImageUuid:r,shouldPinGallery:i,shouldShowGallery:o,galleryScrollPosition:a,galleryImageMinimumWidth:s,galleryGridTemplateColumns:l,activeTabName:u,galleryImageObjectFit:h,shouldHoldGalleryOpen:g,shouldAutoSwitchToNewImages:m,areMoreImagesAvailable:v,galleryWidth:b,isLightBoxOpen:w,isStaging:P,shouldEnableResize:E,shouldUseSingleGalleryColumn:_}=ye(L6e),{galleryMinWidth:T,galleryMaxWidth:M}=w?{galleryMinWidth:XM,galleryMaxWidth:XM}:I6e[u],[O,I]=C.exports.useState(b>=h3),[D,B]=C.exports.useState(!1),[$,H]=C.exports.useState(0),j=C.exports.useRef(null),ne=C.exports.useRef(null),V=C.exports.useRef(null);C.exports.useEffect(()=>{b>=h3&&I(!1)},[b]);const q=()=>{e(Dbe(!i)),e(ai(!0))},te=()=>{o?Z():J()},J=()=>{e(hd(!0)),i&&e(ai(!0))},Z=C.exports.useCallback(()=>{e(hd(!1)),e(hW(!1)),e(Nbe(ne.current?ne.current.scrollTop:0)),setTimeout(()=>i&&e(ai(!0)),400)},[e,i]),G=()=>{e(v7(n))},ee=Ce=>{e(om(Ce))},le=()=>{g||(V.current=window.setTimeout(()=>Z(),500))},me=()=>{V.current&&window.clearTimeout(V.current)};Ue("g",()=>{te()},[o,i]),Ue("left",()=>{e(Pk())},{enabled:!P||u!=="unifiedCanvas"},[P]),Ue("right",()=>{e(Ek())},{enabled:!P||u!=="unifiedCanvas"},[P]),Ue("shift+g",()=>{q()},[i]),Ue("esc",()=>{e(hd(!1))},{enabled:()=>!i,preventDefault:!0},[i]);const Me=32;return Ue("shift+up",()=>{if(s<256){const Ce=He.clamp(s+Me,32,256);e(om(Ce))}},[s]),Ue("shift+down",()=>{if(s>32){const Ce=He.clamp(s-Me,32,256);e(om(Ce))}},[s]),C.exports.useEffect(()=>{!ne.current||(ne.current.scrollTop=a)},[a,o]),C.exports.useEffect(()=>{function Ce(be){!i&&j.current&&!j.current.contains(be.target)&&Z()}return document.addEventListener("mousedown",Ce),()=>{document.removeEventListener("mousedown",Ce)}},[Z,i]),S(GH,{nodeRef:j,in:o||g,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:X("div",{className:"image-gallery-wrapper",style:{zIndex:i?1:100},"data-pinned":i,ref:j,onMouseLeave:i?void 0:le,onMouseEnter:i?void 0:me,onMouseOver:i?void 0:me,children:[X(yW,{minWidth:T,maxWidth:i?M:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:E},size:{width:b,height:i?"100%":"100vh"},onResizeStart:(Ce,be,we)=>{H(we.clientHeight),we.style.height=`${we.clientHeight}px`,i&&(we.style.position="fixed",we.style.right="1rem",B(!0))},onResizeStop:(Ce,be,we,Ve)=>{const Ze=i?He.clamp(Number(b)+Ve.width,T,Number(M)):Number(b)+Ve.width;e(Fbe(Ze)),we.removeAttribute("data-resize-alert"),i&&(we.style.position="relative",we.style.removeProperty("right"),we.style.setProperty("height",i?"100%":"100vh"),B(!1),e(ai(!0)))},onResize:(Ce,be,we,Ve)=>{const Ze=He.clamp(Number(b)+Ve.width,T,Number(i?M:.95*window.innerWidth));Ze>=h3&&!O?I(!0):ZeZe-KM&&e(om(Ze-KM)),i&&(Ze>=M?we.setAttribute("data-resize-alert","true"):we.removeAttribute("data-resize-alert")),we.style.height=`${$}px`},children:[X("div",{className:"image-gallery-header",children:[S(ji,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:O?X(Rn,{children:[S(Ro,{size:"sm","data-selected":n==="result",onClick:()=>e(a3("result")),children:"Generations"}),S(Ro,{size:"sm","data-selected":n==="user",onClick:()=>e(a3("user")),children:"Uploads"})]}):X(Rn,{children:[S(Xe,{"aria-label":"Show Generations",tooltip:"Show Generations","data-selected":n==="result",icon:S(ySe,{}),onClick:()=>e(a3("result"))}),S(Xe,{"aria-label":"Show Uploads",tooltip:"Show Uploads","data-selected":n==="user",icon:S(MSe,{}),onClick:()=>e(a3("user"))})]})}),X("div",{className:"image-gallery-header-right-icons",children:[S(Il,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:S(Xe,{size:"sm","aria-label":"Gallery Settings",icon:S(pb,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:X("div",{className:"image-gallery-settings-popover",children:[X("div",{children:[S(Do,{value:s,onChange:ee,min:32,max:256,hideTooltip:!0,label:"Image Size"}),S(Xe,{size:"sm","aria-label":"Reset",tooltip:"Reset Size",onClick:()=>e(om(64)),icon:S(nk,{}),"data-selected":i,styleClass:"image-gallery-icon-btn"})]}),S("div",{children:S(fr,{label:"Maintain Aspect Ratio",isChecked:h==="contain",onChange:()=>e(Bbe(h==="contain"?"cover":"contain"))})}),S("div",{children:S(fr,{label:"Auto-Switch to New Images",isChecked:m,onChange:Ce=>e(zbe(Ce.target.checked))})}),S("div",{children:S(fr,{label:"Single Column Layout",isChecked:_,onChange:Ce=>e($be(Ce.target.checked))})})]})}),S(Xe,{size:"sm",className:"image-gallery-icon-btn","aria-label":"Pin Gallery",tooltip:"Pin Gallery (Shift+G)",onClick:q,icon:i?S(HH,{}):S(WH,{})})]})]}),S("div",{className:"image-gallery-container",ref:ne,children:t.length||v?X(Rn,{children:[S("div",{className:"image-gallery",style:{gridTemplateColumns:l},children:t.map(Ce=>{const{uuid:be}=Ce;return S(O6e,{image:Ce,isSelected:r===be},be)})}),S(ja,{onClick:G,isDisabled:!v,className:"image-gallery-load-more-btn",children:v?"Load More":"All Images Loaded"})]}):X("div",{className:"image-gallery-container-placeholder",children:[S(EH,{}),S("p",{children:"No Images In Gallery"})]})})]}),D&&S("div",{style:{width:b+"px",height:"100%"}})]})})}const D6e=rt(M6e,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),N6e=()=>{const{resultImages:e,userImages:t}=ye(D6e);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},B6e=rt([e=>e.options,Tr],(e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),Ik=e=>{const t=De(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=ye(B6e),u=N6e(),h=()=>{t(HEe(!a)),t(ai(!0))},g=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);!b||(o==="img2img"?t(O1(b)):o==="unifiedCanvas"&&t(mb(b)))};return S("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:X("div",{className:"workarea-main",children:[n,X("div",{className:"workarea-children-wrapper",onDrop:g,children:[r,l&&S(bi,{label:"Toggle Split View",children:S("div",{className:"workarea-split-button","data-selected":a,onClick:h,children:S(Kbe,{})})})]}),!s&&S(KW,{})]})})};function z6e(){return S(Ik,{optionsPanel:S(Tbe,{}),children:S(qbe,{})})}function F6e(){const e={seed:{header:"Seed",feature:Yi.SEED,content:S(rk,{})},variations:{header:"Variations",feature:Yi.VARIATIONS,content:S(ak,{}),additionalHeaderComponents:S(ok,{})},face_restore:{header:"Face Restoration",feature:Yi.FACE_CORRECTION,content:S(tk,{}),additionalHeaderComponents:S(mH,{})},upscale:{header:"Upscaling",feature:Yi.UPSCALE,content:S(ik,{}),additionalHeaderComponents:S(wH,{})},other:{header:"Other Options",feature:Yi.OTHER,content:S(bH,{})}};return X(_k,{children:[S(bk,{}),S(Sk,{}),S(uk,{}),S(ck,{accordionInfo:e})]})}const $6e=()=>S("div",{className:"workarea-single-view",children:S("div",{className:"text-to-image-area",children:S(vW,{})})});function H6e(){return S(Ik,{optionsPanel:S(F6e,{}),children:S($6e,{})})}var M7=function(e,t){return M7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},M7(e,t)};function W6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");M7(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Dl=function(){return Dl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Id(e,t,n,r){var i=iCe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,h=t.scale-s,g=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):QW(e,r,n,function(v){var b=s+h*v,w=l+g*v,P=u+m*v;o(b,w,P)})}}function iCe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function oCe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,h=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:h}}var aCe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,h=s,g=r-i-l,m=l;return{minPositionX:u,maxPositionX:h,minPositionY:g,maxPositionY:m}},Dk=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=oCe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,h=o.newContentHeight,g=o.newDiffHeight,m=aCe(a,l,u,s,h,g,Boolean(i));return m},f1=function(e,t){var n=Dk(e,t);return e.bounds=n,n};function Cb(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,h=n.maxPositionY,g=0,m=0;a&&(g=i,m=o);var v=R7(e,s-g,u+g,r),b=R7(t,l-m,h+m,r);return{x:v,y:b}}var R7=function(e,t,n,r){return r?en?Ha(n,2):Ha(e,2):Ha(e,2)};function _b(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,h=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var g=l-t*h,m=u-n*h,v=Cb(g,m,i,o,0,0,null);return v}function E2(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var QM=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=kb(o,n);return!l},JM=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},sCe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},lCe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function uCe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var h=e.bounds,g=h.maxPositionX,m=h.minPositionX,v=h.maxPositionY,b=h.minPositionY,w=n>g||nv||rg?u.offsetWidth:e.setup.minPositionX||0,_=r>v?u.offsetHeight:e.setup.minPositionY||0,T=_b(e,E,_,i,e.bounds,s||l),M=T.x,O=T.y;return{scale:i,positionX:w?M:n,positionY:P?O:r}}}function cCe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,h=l.positionX,g=l.positionY,m=t!==h,v=n!==g,b=!m||!v;if(!(!a||b||!s)){var w=Cb(t,n,s,o,r,i,a),P=w.x,E=w.y;e.setTransformState(u,P,E)}}var dCe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var h=t-r.x,g=n-r.y,m=a?l:h,v=s?u:g;return{x:m,y:v}},M4=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},fCe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},hCe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function pCe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function eR(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var h=a+(e-a)*u;return h>l?l:ho?o:h}}return r?t:R7(e,o,a,i)}function gCe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function mCe(e,t){var n=fCe(e);if(!!n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=gCe(a,s),h=t.x-r.x,g=t.y-r.y,m=h/u,v=g/u,b=l-i,w=h*h+g*g,P=Math.sqrt(w)/b;e.velocity={velocityX:m,velocityY:v,total:P}}e.lastMousePosition=t,e.velocityTime=l}}function vCe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=hCe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,h=n.minPositionX,g=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,w=r.zoomAnimation,P=r.panning,E=P.lockAxisY,_=P.lockAxisX,T=w.animationType,M=b.sizeX,O=b.sizeY,I=b.velocityAlignmentTime,D=I,B=pCe(e,l),$=Math.max(B,D),H=M4(e,M),j=M4(e,O),ne=H*i.offsetWidth/100,V=j*i.offsetHeight/100,q=u+ne,te=h-ne,J=g+V,Z=m-V,G=e.transformState,ee=new Date().getTime();QW(e,T,$,function(le){var me=e.transformState,Me=me.scale,Ce=me.positionX,be=me.positionY,we=new Date().getTime()-ee,Ve=we/D,Ze=XW[b.animationType],it=1-Ze(Math.min(1,Ve)),pt=1-le,kt=Ce+a*pt,gt=be+s*pt,ht=eR(kt,G.positionX,Ce,_,v,h,u,te,q,it),vt=eR(gt,G.positionY,be,E,v,m,g,Z,J,it);(Ce!==kt||be!==gt)&&e.setTransformState(Me,ht,vt)})}}function tR(e,t){var n=e.transformState.scale;wl(e),f1(e,n),t.touches?lCe(e,t):sCe(e,t)}function nR(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(!!r){var l=dCe(e,t,n),u=l.x,h=l.y,g=M4(e,a),m=M4(e,s);mCe(e,{x:u,y:h}),cCe(e,u,h,g,m)}}function yCe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,h=(a==null?void 0:a.height)||0,g=s.1&&g;m?vCe(e):JW(e)}}function JW(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,h=o||t=a;if((r>=1||s)&&JW(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,w=Nk(e,a,v,b);w&&Id(e,w,h,g)}}function Nk(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=E2(Ha(t,2),o,a,0,!1),u=f1(e,l),h=_b(e,n,r,l,u,s),g=h.x,m=h.y;return{scale:l,positionX:g,positionY:m}}var g0={previousScale:1,scale:1,positionX:0,positionY:0},SCe=Dl(Dl({},g0),{setComponents:function(){},contextInstance:null}),am={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},tV=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:g0.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:g0.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:g0.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:g0.positionY}},rR=function(e){var t=Dl({},am);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof am[n]<"u";if(i&&r){var o=Object.prototype.toString.call(am[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=Dl(Dl({},am[n]),e[n]):s?t[n]=ZM(ZM([],am[n]),e[n]):t[n]=e[n]}}),t},nV=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var h=r*Math.exp(t*n),g=E2(Ha(h,3),s,a,u,!1);return g};function rV(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var h=o.offsetWidth,g=o.offsetHeight,m=(h/2-l)/s,v=(g/2-u)/s,b=nV(e,t,n),w=Nk(e,b,m,v);if(!w)return console.error("Error during zoom event. New transformation state was not calculated.");Id(e,w,r,i)}function iV(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=tV(e.props),s=e.transformState,l=s.scale,u=s.positionX,h=s.positionY;if(!!i){var g=Dk(e,a.scale),m=Cb(a.positionX,a.positionY,g,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&h===a.positionY||Id(e,v,t,n)}}function bCe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return g0;var l=r.getBoundingClientRect(),u=xCe(t),h=u.x,g=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,w=r.offsetHeight/v,P=E2(n||Math.min(b,w),a,s,0,!1),E=(l.width-m*P)/2,_=(l.height-v*P)/2,T=(l.left-h)*P+E,M=(l.top-g)*P+_,O=Dk(e,P),I=Cb(T,M,O,o,0,0,r),D=I.x,B=I.y;return{positionX:D,positionY:B,scale:P}}function xCe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function wCe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var CCe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),rV(e,1,t,n,r)}},_Ce=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),rV(e,-1,t,n,r)}},kCe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,h=e.wrapperComponent,g=e.contentComponent,m=e.setup.disabled;if(!(m||!h||!g)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Id(e,v,i,o)}}},ECe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),iV(e,t,n)}},PCe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=oV(t||i.scale,o,a);Id(e,s,n,r)}}},TCe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),wl(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&wCe(a)&&a&&o.contains(a)){var s=bCe(e,a,n);Id(e,s,r,i)}}},Gr=function(e){return{instance:e,state:e.transformState,zoomIn:CCe(e),zoomOut:_Ce(e),setTransform:kCe(e),resetTransform:ECe(e),centerView:PCe(e),zoomToElement:TCe(e)}},Kw=!1;function Xw(){try{var e={get passive(){return Kw=!0,!1}};return e}catch(t){return Kw=!1,Kw}}var kb=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},iR=function(e){e&&clearTimeout(e)},LCe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},oV=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},ACe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,h=s&&!l&&!r&&u;if(!h||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var g=kb(u,a);return!g};function MCe(e,t){var n=e?e.deltaY<0?1:-1:0,r=V6e(t,n);return r}function aV(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var RCe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,h=s.zoomAnimation,g=h.size,m=h.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,w=E2(Ha(v,3),u,l,g,b);return w},OCe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},ICe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=kb(a,i);return!l},DCe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},NCe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=Ha(i[0].clientX-r.left,5),a=Ha(i[0].clientY-r.top,5),s=Ha(i[1].clientX-r.left,5),l=Ha(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},sV=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},BCe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var h=t/r,g=h*n;return E2(Ha(g,2),a,o,l,!u)},zCe=160,FCe=100,$Ce=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(wl(e),vi(Gr(e),t,r),vi(Gr(e),t,i))},HCe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,h=a.centerZoomedOut,g=a.zoomAnimation,m=a.wheel,v=g.size,b=g.disabled,w=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var P=MCe(t,null),E=RCe(e,P,w,!t.ctrlKey);if(l!==E){var _=f1(e,E),T=aV(t,o,l),M=b||v===0||h,O=u&&M,I=_b(e,T.x,T.y,E,_,O),D=I.x,B=I.y;e.previousWheelEvent=t,e.setTransformState(E,D,B),vi(Gr(e),t,r),vi(Gr(e),t,i)}},WCe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;iR(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){!e.mounted||(eV(e,t.x,t.y),e.wheelAnimationTimer=null)},FCe);var o=OCe(e,t);o&&(iR(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){!e.mounted||(e.wheelStopEventTimer=null,vi(Gr(e),t,r),vi(Gr(e),t,i))},zCe))},VCe=function(e,t){var n=sV(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,wl(e)},UCe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,h=l.size;if(!(r===null||!n)){var g=NCe(t,i,n);if(!(!isFinite(g.x)||!isFinite(g.y))){var m=sV(t),v=BCe(e,m);if(v!==i){var b=f1(e,v),w=u||h===0||s,P=a&&w,E=_b(e,g.x,g.y,v,b,P),_=E.x,T=E.y;e.pinchMidpoint=g,e.lastDistance=m,e.setTransformState(v,_,T)}}}},GCe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,eV(e,t==null?void 0:t.x,t==null?void 0:t.y)};function jCe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return iV(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var h=i==="zoomOut"?-1:1,g=nV(e,h,o),m=aV(t,u,l),v=Nk(e,g,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");Id(e,v,a,s)}}var YCe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),h=n&&l&&u&&!a;if(!h)return!1;var g=kb(l,s);return!(g||!h)},lV=se.createContext(SCe),qCe=function(e){W6e(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=tV(n.props),n.setup=rR(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=Xw();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=ACe(n,r);if(!!o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);!a||($Ce(n,r),HCe(n,r),WCe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=QM(n,r);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),wl(n),tR(n,r),vi(Gr(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=JM(n);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),nR(n,r.clientX,r.clientY),vi(Gr(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(yCe(n),vi(Gr(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=ICe(n,r);!l||(VCe(n,r),wl(n),vi(Gr(n),r,a),vi(Gr(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=DCe(n);!l||(r.preventDefault(),r.stopPropagation(),UCe(n,r),vi(Gr(n),r,a),vi(Gr(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(GCe(n),vi(Gr(n),r,o),vi(Gr(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=QM(n,r);if(!!a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,wl(n);var l=r.touches,u=l.length===1,h=l.length===2;u&&(wl(n),tR(n,r),vi(Gr(n),r,o)),h&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=JM(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];nR(n,s.clientX,s.clientY),vi(Gr(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=YCe(n,r);!o||jCe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,f1(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,vi(Gr(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=oV(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=LCe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(Gr(n))},n}return t.prototype.componentDidMount=function(){var n=Xw();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=Xw();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),wl(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(f1(this,this.transformState.scale),this.setup=rR(this.props))},t.prototype.render=function(){var n=Gr(this),r=this.props.children,i=typeof r=="function"?r(n):r;return S(lV.Provider,{value:Dl(Dl({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:i})},t}(C.exports.Component),KCe=se.forwardRef(function(e,t){var n=C.exports.useState(null),r=n[0],i=n[1];return C.exports.useImperativeHandle(t,function(){return r},[r]),S(qCe,{...Dl({},e,{setRef:i})})});function XCe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var ZCe=`.transform-component-module_wrapper__1_Fgj { +}`;var Ht=HE(function(){return en(F,ft+"return "+Ae).apply(n,Y)});if(Ht.source=Ae,Jb(Ht))throw Ht;return Ht}function zq(c){return _n(c).toLowerCase()}function Fq(c){return _n(c).toUpperCase()}function $q(c,p,x){if(c=_n(c),c&&(x||p===n))return Xi(c);if(!c||!(p=Ji(p)))return c;var A=Fi(c),N=Fi(p),F=Ko(A,N),Y=rs(A,N)+1;return cs(A,F,Y).join("")}function Hq(c,p,x){if(c=_n(c),c&&(x||p===n))return c.slice(0,rg(c)+1);if(!c||!(p=Ji(p)))return c;var A=Fi(c),N=rs(A,Fi(p))+1;return cs(A,0,N).join("")}function Wq(c,p,x){if(c=_n(c),c&&(x||p===n))return c.replace(qu,"");if(!c||!(p=Ji(p)))return c;var A=Fi(c),N=Ko(A,Fi(p));return cs(A,N).join("")}function Vq(c,p){var x=H,A=j;if(ur(p)){var N="separator"in p?p.separator:N;x="length"in p?Bt(p.length):x,A="omission"in p?Ji(p.omission):A}c=_n(c);var F=c.length;if(Jl(c)){var Y=Fi(c);F=Y.length}if(x>=F)return c;var Q=x-Pa(A);if(Q<1)return A;var ce=Y?cs(Y,0,Q).join(""):c.slice(0,Q);if(N===n)return ce+A;if(Y&&(Q+=ce.length-Q),ex(N)){if(c.slice(Q).search(N)){var _e,ke=ce;for(N.global||(N=rf(N.source,_n(Ja.exec(N))+"g")),N.lastIndex=0;_e=N.exec(ke);)var Ae=_e.index;ce=ce.slice(0,Ae===n?Q:Ae)}}else if(c.indexOf(Ji(N),Q)!=Q){var je=ce.lastIndexOf(N);je>-1&&(ce=ce.slice(0,je))}return ce+A}function Uq(c){return c=_n(c),c&&D1.test(c)?c.replace($r,z2):c}var Gq=al(function(c,p,x){return c+(x?" ":"")+p.toUpperCase()}),rx=Ap("toUpperCase");function $E(c,p,x){return c=_n(c),p=x?n:p,p===n?Qh(c)?nf(c):eg(c):c.match(p)||[]}var HE=Pt(function(c,p){try{return Ci(c,n,p)}catch(x){return Jb(x)?x:new Tt(x)}}),jq=nr(function(c,p){return jn(p,function(x){x=sl(x),Jo(c,x,Zb(c[x],c))}),c});function Yq(c){var p=c==null?0:c.length,x=Le();return c=p?Hn(c,function(A){if(typeof A[1]!="function")throw new _i(a);return[x(A[0]),A[1]]}):[],Pt(function(A){for(var N=-1;++NG)return[];var x=me,A=ei(c,me);p=Le(p),c-=me;for(var N=Jd(A,p);++x0||p<0)?new Yt(x):(c<0?x=x.takeRight(-c):c&&(x=x.drop(c)),p!==n&&(p=Bt(p),x=p<0?x.dropRight(-p):x.take(p-c)),x)},Yt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Yt.prototype.toArray=function(){return this.take(me)},na(Yt.prototype,function(c,p){var x=/^(?:filter|find|map|reject)|While$/.test(p),A=/^(?:head|last)$/.test(p),N=z[A?"take"+(p=="last"?"Right":""):p],F=A||/^find/.test(p);!N||(z.prototype[p]=function(){var Y=this.__wrapped__,Q=A?[1]:arguments,ce=Y instanceof Yt,_e=Q[0],ke=ce||Dt(Y),Ae=function(qt){var tn=N.apply(z,Ea([qt],Q));return A&&je?tn[0]:tn};ke&&x&&typeof _e=="function"&&_e.length!=1&&(ce=ke=!1);var je=this.__chain__,ft=!!this.__actions__.length,wt=F&&!je,Ht=ce&&!ft;if(!F&&ke){Y=Ht?Y:new Yt(this);var Ct=c.apply(Y,Q);return Ct.__actions__.push({func:uy,args:[Ae],thisArg:n}),new Zi(Ct,je)}return wt&&Ht?c.apply(this,Q):(Ct=this.thru(Ae),wt?A?Ct.value()[0]:Ct.value():Ct)})}),jn(["pop","push","shift","sort","splice","unshift"],function(c){var p=lc[c],x=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",A=/^(?:pop|shift)$/.test(c);z.prototype[c]=function(){var N=arguments;if(A&&!this.__chain__){var F=this.value();return p.apply(Dt(F)?F:[],N)}return this[x](function(Y){return p.apply(Dt(Y)?Y:[],N)})}}),na(Yt.prototype,function(c,p){var x=z[p];if(x){var A=x.name+"";rn.call(os,A)||(os[A]=[]),os[A].push({name:p,func:x})}}),os[wf(n,E).name]=[{name:"wrapper",func:n}],Yt.prototype.clone=$i,Yt.prototype.reverse=Ei,Yt.prototype.value=Y2,z.prototype.at=xj,z.prototype.chain=wj,z.prototype.commit=Cj,z.prototype.next=_j,z.prototype.plant=Ej,z.prototype.reverse=Pj,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=Tj,z.prototype.first=z.prototype.head,hc&&(z.prototype[hc]=kj),z},Ta=yo();Gt?((Gt.exports=Ta)._=Ta,At._=Ta):yt._=Ta}).call(Cs)})(ii,ii.exports);const He=ii.exports;var m3e=Object.create,nH=Object.defineProperty,v3e=Object.getOwnPropertyDescriptor,y3e=Object.getOwnPropertyNames,S3e=Object.getPrototypeOf,b3e=Object.prototype.hasOwnProperty,Fe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),x3e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of y3e(t))!b3e.call(e,i)&&i!==n&&nH(e,i,{get:()=>t[i],enumerable:!(r=v3e(t,i))||r.enumerable});return e},rH=(e,t,n)=>(n=e!=null?m3e(S3e(e)):{},x3e(t||!e||!e.__esModule?nH(n,"default",{value:e,enumerable:!0}):n,e)),w3e=Fe((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),iH=Fe((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),sb=Fe((e,t)=>{var n=iH();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),C3e=Fe((e,t)=>{var n=sb(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),_3e=Fe((e,t)=>{var n=sb();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),k3e=Fe((e,t)=>{var n=sb();function r(i){return n(this.__data__,i)>-1}t.exports=r}),E3e=Fe((e,t)=>{var n=sb();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),lb=Fe((e,t)=>{var n=w3e(),r=C3e(),i=_3e(),o=k3e(),a=E3e();function s(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u{var n=lb();function r(){this.__data__=new n,this.size=0}t.exports=r}),T3e=Fe((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),L3e=Fe((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),A3e=Fe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),oH=Fe((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),$u=Fe((e,t)=>{var n=oH(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),X_=Fe((e,t)=>{var n=$u(),r=n.Symbol;t.exports=r}),M3e=Fe((e,t)=>{var n=X_(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),h=l[a];try{l[a]=void 0;var g=!0}catch(v){}var m=o.call(l);return g&&(u?l[a]=h:delete l[a]),m}t.exports=s}),R3e=Fe((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),ub=Fe((e,t)=>{var n=X_(),r=M3e(),i=R3e(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),aH=Fe((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),sH=Fe((e,t)=>{var n=ub(),r=aH(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var h=n(u);return h==o||h==a||h==i||h==s}t.exports=l}),O3e=Fe((e,t)=>{var n=$u(),r=n["__core-js_shared__"];t.exports=r}),I3e=Fe((e,t)=>{var n=O3e(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),lH=Fe((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch(a){}try{return o+""}catch(a){}}return""}t.exports=i}),D3e=Fe((e,t)=>{var n=sH(),r=I3e(),i=aH(),o=lH(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,h=l.toString,g=u.hasOwnProperty,m=RegExp("^"+h.call(g).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var w=n(b)?m:s;return w.test(o(b))}t.exports=v}),N3e=Fe((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),T1=Fe((e,t)=>{var n=D3e(),r=N3e();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),Z_=Fe((e,t)=>{var n=T1(),r=$u(),i=n(r,"Map");t.exports=i}),cb=Fe((e,t)=>{var n=T1(),r=n(Object,"create");t.exports=r}),B3e=Fe((e,t)=>{var n=cb();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),z3e=Fe((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),F3e=Fe((e,t)=>{var n=cb(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),$3e=Fe((e,t)=>{var n=cb(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),H3e=Fe((e,t)=>{var n=cb(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),W3e=Fe((e,t)=>{var n=B3e(),r=z3e(),i=F3e(),o=$3e(),a=H3e();function s(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u{var n=W3e(),r=lb(),i=Z_();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),U3e=Fe((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),db=Fe((e,t)=>{var n=U3e();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),G3e=Fe((e,t)=>{var n=db();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),j3e=Fe((e,t)=>{var n=db();function r(i){return n(this,i).get(i)}t.exports=r}),Y3e=Fe((e,t)=>{var n=db();function r(i){return n(this,i).has(i)}t.exports=r}),q3e=Fe((e,t)=>{var n=db();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),uH=Fe((e,t)=>{var n=V3e(),r=G3e(),i=j3e(),o=Y3e(),a=q3e();function s(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u{var n=lb(),r=Z_(),i=uH(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var h=u.__data__;if(!r||h.length{var n=lb(),r=P3e(),i=T3e(),o=L3e(),a=A3e(),s=K3e();function l(u){var h=this.__data__=new n(u);this.size=h.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),Z3e=Fe((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),Q3e=Fe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),J3e=Fe((e,t)=>{var n=uH(),r=Z3e(),i=Q3e();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),cH=Fe((e,t)=>{var n=J3e(),r=e5e(),i=t5e(),o=1,a=2;function s(l,u,h,g,m,v){var b=h&o,w=l.length,P=u.length;if(w!=P&&!(b&&P>w))return!1;var E=v.get(l),_=v.get(u);if(E&&_)return E==u&&_==l;var T=-1,M=!0,O=h&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=$u(),r=n.Uint8Array;t.exports=r}),r5e=Fe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),i5e=Fe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),o5e=Fe((e,t)=>{var n=X_(),r=n5e(),i=iH(),o=cH(),a=r5e(),s=i5e(),l=1,u=2,h="[object Boolean]",g="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",w="[object RegExp]",P="[object Set]",E="[object String]",_="[object Symbol]",T="[object ArrayBuffer]",M="[object DataView]",O=n?n.prototype:void 0,I=O?O.valueOf:void 0;function D(B,$,H,j,ne,V,q){switch(H){case M:if(B.byteLength!=$.byteLength||B.byteOffset!=$.byteOffset)return!1;B=B.buffer,$=$.buffer;case T:return!(B.byteLength!=$.byteLength||!V(new r(B),new r($)));case h:case g:case b:return i(+B,+$);case m:return B.name==$.name&&B.message==$.message;case w:case E:return B==$+"";case v:var te=a;case P:var J=j&l;if(te||(te=s),B.size!=$.size&&!J)return!1;var Z=q.get(B);if(Z)return Z==$;j|=u,q.set(B,$);var G=o(te(B),te($),j,ne,V,q);return q.delete(B),G;case _:if(I)return I.call(B)==I.call($)}return!1}t.exports=D}),a5e=Fe((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),s5e=Fe((e,t)=>{var n=a5e(),r=Q_();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),l5e=Fe((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),c5e=Fe((e,t)=>{var n=l5e(),r=u5e(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),d5e=Fe((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),f5e=Fe((e,t)=>{var n=ub(),r=fb(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),h5e=Fe((e,t)=>{var n=f5e(),r=fb(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),p5e=Fe((e,t)=>{function n(){return!1}t.exports=n}),dH=Fe((e,t)=>{var n=$u(),r=p5e(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),g5e=Fe((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a!=null?a:n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),m5e=Fe((e,t)=>{var n=ub(),r=fH(),i=fb(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",h="[object Function]",g="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",w="[object Set]",P="[object String]",E="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",M="[object Float32Array]",O="[object Float64Array]",I="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",$="[object Uint8Array]",H="[object Uint8ClampedArray]",j="[object Uint16Array]",ne="[object Uint32Array]",V={};V[M]=V[O]=V[I]=V[D]=V[B]=V[$]=V[H]=V[j]=V[ne]=!0,V[o]=V[a]=V[_]=V[s]=V[T]=V[l]=V[u]=V[h]=V[g]=V[m]=V[v]=V[b]=V[w]=V[P]=V[E]=!1;function q(te){return i(te)&&r(te.length)&&!!V[n(te)]}t.exports=q}),v5e=Fe((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),y5e=Fe((e,t)=>{var n=oH(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch(u){}}();t.exports=s}),hH=Fe((e,t)=>{var n=m5e(),r=v5e(),i=y5e(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),S5e=Fe((e,t)=>{var n=d5e(),r=h5e(),i=Q_(),o=dH(),a=g5e(),s=hH(),l=Object.prototype,u=l.hasOwnProperty;function h(g,m){var v=i(g),b=!v&&r(g),w=!v&&!b&&o(g),P=!v&&!b&&!w&&s(g),E=v||b||w||P,_=E?n(g.length,String):[],T=_.length;for(var M in g)(m||u.call(g,M))&&!(E&&(M=="length"||w&&(M=="offset"||M=="parent")||P&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||a(M,T)))&&_.push(M);return _}t.exports=h}),b5e=Fe((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),x5e=Fe((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),w5e=Fe((e,t)=>{var n=x5e(),r=n(Object.keys,Object);t.exports=r}),C5e=Fe((e,t)=>{var n=b5e(),r=w5e(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),_5e=Fe((e,t)=>{var n=sH(),r=fH();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),k5e=Fe((e,t)=>{var n=S5e(),r=C5e(),i=_5e();function o(a){return i(a)?n(a):r(a)}t.exports=o}),E5e=Fe((e,t)=>{var n=s5e(),r=c5e(),i=k5e();function o(a){return n(a,i,r)}t.exports=o}),P5e=Fe((e,t)=>{var n=E5e(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,h,g,m){var v=u&r,b=n(s),w=b.length,P=n(l),E=P.length;if(w!=E&&!v)return!1;for(var _=w;_--;){var T=b[_];if(!(v?T in l:o.call(l,T)))return!1}var M=m.get(s),O=m.get(l);if(M&&O)return M==l&&O==s;var I=!0;m.set(s,l),m.set(l,s);for(var D=v;++_{var n=T1(),r=$u(),i=n(r,"DataView");t.exports=i}),L5e=Fe((e,t)=>{var n=T1(),r=$u(),i=n(r,"Promise");t.exports=i}),A5e=Fe((e,t)=>{var n=T1(),r=$u(),i=n(r,"Set");t.exports=i}),M5e=Fe((e,t)=>{var n=T1(),r=$u(),i=n(r,"WeakMap");t.exports=i}),R5e=Fe((e,t)=>{var n=T5e(),r=Z_(),i=L5e(),o=A5e(),a=M5e(),s=ub(),l=lH(),u="[object Map]",h="[object Object]",g="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",w=l(n),P=l(r),E=l(i),_=l(o),T=l(a),M=s;(n&&M(new n(new ArrayBuffer(1)))!=b||r&&M(new r)!=u||i&&M(i.resolve())!=g||o&&M(new o)!=m||a&&M(new a)!=v)&&(M=function(O){var I=s(O),D=I==h?O.constructor:void 0,B=D?l(D):"";if(B)switch(B){case w:return b;case P:return u;case E:return g;case _:return m;case T:return v}return I}),t.exports=M}),O5e=Fe((e,t)=>{var n=X3e(),r=cH(),i=o5e(),o=P5e(),a=R5e(),s=Q_(),l=dH(),u=hH(),h=1,g="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,w=b.hasOwnProperty;function P(E,_,T,M,O,I){var D=s(E),B=s(_),$=D?m:a(E),H=B?m:a(_);$=$==g?v:$,H=H==g?v:H;var j=$==v,ne=H==v,V=$==H;if(V&&l(E)){if(!l(_))return!1;D=!0,j=!1}if(V&&!j)return I||(I=new n),D||u(E)?r(E,_,T,M,O,I):i(E,_,$,T,M,O,I);if(!(T&h)){var q=j&&w.call(E,"__wrapped__"),te=ne&&w.call(_,"__wrapped__");if(q||te){var J=q?E.value():E,Z=te?_.value():_;return I||(I=new n),O(J,Z,T,M,I)}}return V?(I||(I=new n),o(E,_,T,M,O,I)):!1}t.exports=P}),I5e=Fe((e,t)=>{var n=O5e(),r=fb();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),pH=Fe((e,t)=>{var n=I5e();function r(i,o){return n(i,o)}t.exports=r}),D5e=["ctrl","shift","alt","meta","mod"],N5e={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function Bw(e,t=","){return typeof e=="string"?e.split(t):e}function rv(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>N5e[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!D5e.includes(o));return{...r,keys:i}}function B5e(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function z5e(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function F5e(e){return gH(e,["input","textarea","select"])}function gH({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function $5e(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var H5e=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:h,metaKey:g,shiftKey:m,key:v,code:b}=e,w=b.toLowerCase().replace("key",""),P=v.toLowerCase();if(u!==r&&P!=="alt"||m!==s&&P!=="shift")return!1;if(a){if(!g&&!h)return!1}else if(g!==o&&w!=="meta"||h!==i&&w!=="ctrl")return!1;return l&&l.length===1&&(l.includes(P)||l.includes(w))?!0:l?l.every(E=>n.has(E)):!l},W5e=C.exports.createContext(void 0),V5e=()=>C.exports.useContext(W5e),U5e=C.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),G5e=()=>C.exports.useContext(U5e),j5e=rH(pH());function Y5e(e){let t=C.exports.useRef(void 0);return(0,j5e.default)(t.current,e)||(t.current=e),t.current}var fM=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Ue(e,t,n,r){let i=C.exports.useRef(null),{current:o}=C.exports.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=C.exports.useCallback(t,[...s]),u=Y5e(a),{enabledScopes:h}=G5e(),g=V5e();return C.exports.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!$5e(h,u==null?void 0:u.scopes))return;let m=w=>{var P;if(!(F5e(w)&&!gH(w,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){fM(w);return}((P=w.target)==null?void 0:P.isContentEditable)&&!(u!=null&&u.enableOnContentEditable)||Bw(e,u==null?void 0:u.splitKey).forEach(E=>{var T;let _=rv(E,u==null?void 0:u.combinationKey);if(H5e(w,_,o)||((T=_.keys)==null?void 0:T.includes("*"))){if(B5e(w,_,u==null?void 0:u.preventDefault),!z5e(w,_,u==null?void 0:u.enabled)){fM(w);return}l(w,_)}})}},v=w=>{o.add(w.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||(u==null?void 0:u.keydown))&&m(w)},b=w=>{w.key.toLowerCase()!=="meta"?o.delete(w.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(w)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),g&&Bw(e,u==null?void 0:u.splitKey).forEach(w=>g.addHotkey(rv(w,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),g&&Bw(e,u==null?void 0:u.splitKey).forEach(w=>g.removeHotkey(rv(w,u==null?void 0:u.combinationKey)))}},[e,l,u,h]),i}rH(pH());var g7=new Set;function q5e(e){(Array.isArray(e)?e:[e]).forEach(t=>g7.add(rv(t)))}function K5e(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=rv(t);for(let i of g7)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&g7.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{q5e(e.key)}),document.addEventListener("keyup",e=>{K5e(e.key)})});function X5e(){return X("div",{className:"work-in-progress nodes-work-in-progress",children:[S("h1",{children:"Nodes"}),S("p",{children:"A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature."})]})}const Z5e=()=>X("div",{className:"work-in-progress post-processing-work-in-progress",children:[S("h1",{children:"Post Processing"}),S("p",{children:"Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image and Image To Image tabs. You can also process images directly, using the image action buttons above the current image display or in the viewer."}),S("p",{children:"A dedicated UI will be released soon to facilitate more advanced post processing workflows."}),S("p",{children:"The Invoke AI Command Line Interface offers various other features including Embiggen."})]}),Q5e=ut({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:S("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),J5e=ut({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),e4e=ut({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),t4e=ut({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:S("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:S("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})});var Yi=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(Yi||{});const n4e={[0]:{text:"This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:"As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:"These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:"Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:"Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:"Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.",href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:"Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:"Image to Image allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:"The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:"Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:"Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes).",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}},hM=/^-?(0\.)?\.?$/,Os=e=>{const{label:t,labelFontSize:n="1rem",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:h,min:g,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:w,numberInputFieldProps:P,numberInputStepperProps:E,tooltipProps:_,...T}=e,[M,O]=C.exports.useState(String(u));C.exports.useEffect(()=>{!M.match(hM)&&u!==Number(M)&&O(String(u))},[u,M]);const I=B=>{O(B),B.match(hM)||h(v?Math.floor(Number(B)):Number(B))},D=B=>{const $=He.clamp(v?Math.floor(Number(B.target.value)):Number(B.target.value),g,m);O(String($)),h($)};return S(bi,{..._,children:X(Td,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&S(kh,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,...w,children:t}),X(C_,{className:"invokeai__number-input-root",value:M,keepWithinRange:!0,clampValueOnBlur:!1,onChange:I,onBlur:D,width:a,...T,children:[S(__,{className:"invokeai__number-input-field",textAlign:s,...P}),o&&X("div",{className:"invokeai__number-input-stepper",children:[S(E_,{...E,className:"invokeai__number-input-stepper-button"}),S(k_,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},Is=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="md",styleClass:l,...u}=e;return X(Td,{isDisabled:n,className:`invokeai__select ${l}`,onClick:h=>{h.stopPropagation(),h.nativeEvent.stopImmediatePropagation(),h.nativeEvent.stopPropagation(),h.nativeEvent.cancelBubble=!0},children:[t&&S(kh,{className:"invokeai__select-label",fontSize:s,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t}),S(bi,{label:i,...o,children:S(o$,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(h=>typeof h=="string"||typeof h=="number"?S("option",{value:h,className:"invokeai__select-option",children:h},h):S("option",{value:h.value,className:"invokeai__select-option",children:h.key},h.value))})})]})},r4e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],i4e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],o4e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],a4e=[{key:"2x",value:2},{key:"4x",value:4}],J_=0,ek=4294967295,s4e=["gfpgan","codeformer"],l4e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],u4e=rt(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),c4e=rt(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),tk=()=>{const e=De(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=ye(u4e),{isGFPGANAvailable:i}=ye(c4e),o=l=>e(c5(l)),a=l=>e(hU(l)),s=l=>e(d5(l.target.value));return X(bt,{direction:"column",gap:2,children:[S(Is,{label:"Type",validValues:s4e.concat(),value:n,onChange:s}),S(Os,{isDisabled:!i,label:"Strength",step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&S(Os,{isDisabled:!i,label:"Fidelity",step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})},$a=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return S(Td,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,...i,children:X(kh,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",...o,children:[t,S(O_,{className:"invokeai__switch-root",...s})]})})};function mH(){const e=ye(i=>i.system.isGFPGANAvailable),t=ye(i=>i.options.shouldRunFacetool),n=De();return S($a,{isDisabled:!e,isChecked:t,onChange:i=>n($Ee(i.target.checked))})}function d4e(){const e=De(),t=ye(r=>r.options.shouldFitToWidthHeight);return S($a,{label:"Fit Initial Image To Output Size",isChecked:t,onChange:r=>e(wU(r.target.checked))})}var vH={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pM=se.createContext&&se.createContext(vH),fd=globalThis&&globalThis.__assign||function(){return fd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return S(bi,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:S(Ya,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})});function Do(e){const[t,n]=C.exports.useState(!1),{label:r,value:i,min:o=1,max:a=100,step:s=1,onChange:l,width:u="100%",tooltipSuffix:h="",withSliderMarks:g=!1,sliderMarkLeftOffset:m=0,sliderMarkRightOffset:v=-7,withInput:b=!1,isInteger:w=!1,inputWidth:P="5rem",inputReadOnly:E=!0,withReset:_=!1,hideTooltip:T=!1,handleReset:M,isResetDisabled:O,isSliderDisabled:I,isInputDisabled:D,styleClass:B,sliderFormControlProps:$,sliderFormLabelProps:H,sliderMarkProps:j,sliderTrackProps:ne,sliderThumbProps:V,sliderNumberInputProps:q,sliderNumberInputFieldProps:te,sliderNumberInputStepperProps:J,sliderTooltipProps:Z,sliderIAIIconButtonProps:G,...ee}=e,[le,me]=C.exports.useState(String(i)),Me=C.exports.useMemo(()=>q!=null&&q.max?q.max:a,[a,q==null?void 0:q.max]);C.exports.useEffect(()=>{String(i)!==le&&le!==""&&me(String(i))},[i,le,me]);const Ce=Ve=>{const Ze=He.clamp(w?Math.floor(Number(Ve.target.value)):Number(Ve.target.value),o,Me);me(String(Ze)),l(Ze)},be=Ve=>{me(Ve),l(Number(Ve))},we=()=>{!M||M()};return X(Td,{className:B?`invokeai__slider-component ${B}`:"invokeai__slider-component","data-markers":g,...$,children:[S(kh,{className:"invokeai__slider-component-label",...H,children:r}),X(Mz,{w:"100%",gap:2,children:[X(R_,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:be,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:I,width:u,...ee,children:[g&&X(Rn,{children:[S(o7,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...j,children:o}),S(o7,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...j,children:a})]}),S(m$,{className:"invokeai__slider_track",...ne,children:S(v$,{className:"invokeai__slider_track-filled"})}),S(bi,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${h}`,hidden:T,...Z,children:S(g$,{className:"invokeai__slider-thumb",...V})})]}),b&&X(C_,{min:o,max:Me,step:s,value:le,onChange:be,onBlur:Ce,className:"invokeai__slider-number-field",isDisabled:D,...q,children:[S(__,{className:"invokeai__slider-number-input",width:P,readOnly:E,...te}),X(QF,{...J,children:[S(E_,{className:"invokeai__slider-number-stepper"}),S(k_,{className:"invokeai__slider-number-stepper"})]})]}),_&&S(Xe,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:S(nk,{}),onClick:we,isDisabled:O,...G})]})]})}function SH(e){const{label:t="Strength",styleClass:n}=e,r=ye(s=>s.options.img2imgStrength),i=De();return S(Do,{label:t,step:.01,min:.01,max:.99,onChange:s=>i(G7(s)),value:r,isInteger:!1,styleClass:n,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{i(G7(.75))}})}const S4e=()=>{const e=De(),t=ye(r=>r.options.hiresFix);return S(bt,{gap:2,direction:"column",children:S($a,{label:"High Res Optimization",fontSize:"md",isChecked:t,onChange:r=>e(gU(r.target.checked))})})},b4e=()=>{const e=De(),t=ye(r=>r.options.seamless);return S(bt,{gap:2,direction:"column",children:S($a,{label:"Seamless tiling",fontSize:"md",isChecked:t,onChange:r=>e(bU(r.target.checked))})})},bH=()=>X(bt,{gap:2,direction:"column",children:[S(b4e,{}),S(S4e,{})]});function x4e(){const e=De(),t=ye(r=>r.options.shouldRandomizeSeed);return S($a,{label:"Randomize Seed",isChecked:t,onChange:r=>e(zEe(r.target.checked))})}function w4e(){const e=ye(o=>o.options.seed),t=ye(o=>o.options.shouldRandomizeSeed),n=ye(o=>o.options.shouldGenerateVariations),r=De(),i=o=>r(T2(o));return S(Os,{label:"Seed",step:1,precision:0,flexGrow:1,min:J_,max:ek,isDisabled:t,isInvalid:e<0&&n,onChange:i,value:e,width:"10rem"})}const xH=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function C4e(){const e=De(),t=ye(r=>r.options.shouldRandomizeSeed);return S(ja,{size:"sm",isDisabled:t,onClick:()=>e(T2(xH(J_,ek))),children:S("p",{children:"Shuffle"})})}function _4e(){const e=De(),t=ye(r=>r.options.threshold);return S(Os,{label:"Noise Threshold",min:0,max:1e3,step:.1,onChange:r=>e(kU(r)),value:t,isInteger:!1})}function k4e(){const e=De(),t=ye(r=>r.options.perlin);return S(Os,{label:"Perlin Noise",min:0,max:1,step:.05,onChange:r=>e(yU(r)),value:t,isInteger:!1})}const rk=()=>X(bt,{gap:2,direction:"column",children:[S(x4e,{}),X(bt,{gap:2,children:[S(w4e,{}),S(C4e,{})]}),S(bt,{gap:2,children:S(_4e,{})}),S(bt,{gap:2,children:S(k4e,{})})]}),E4e=rt(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),P4e=rt(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),ik=()=>{const e=De(),{upscalingLevel:t,upscalingStrength:n}=ye(E4e),{isESRGANAvailable:r}=ye(P4e);return X("div",{className:"upscale-options",children:[S(Is,{isDisabled:!r,label:"Scale",value:t,onChange:a=>e(j7(Number(a.target.value))),validValues:a4e}),S(Os,{isDisabled:!r,label:"Strength",step:.05,min:0,max:1,onChange:a=>e(Y7(a)),value:n,isInteger:!1})]})};function wH(){const e=ye(i=>i.system.isESRGANAvailable),t=ye(i=>i.options.shouldRunESRGAN),n=De();return S($a,{isDisabled:!e,isChecked:t,onChange:i=>n(FEe(i.target.checked))})}function ok(){const e=ye(r=>r.options.shouldGenerateVariations),t=De();return S($a,{isChecked:e,width:"auto",onChange:r=>t(IEe(r.target.checked))})}function T4e(e){const{label:t,styleClass:n,isDisabled:r=!1,fontSize:i="1rem",width:o,isInvalid:a,...s}=e;return X(Td,{className:`input ${n}`,isInvalid:a,isDisabled:r,flexGrow:1,children:[S(kh,{fontSize:i,marginBottom:1,whiteSpace:"nowrap",className:"input-label",children:t}),S(Z8,{...s,className:"input-entry",size:"sm",width:o})]})}function L4e(){const e=ye(i=>i.options.seedWeights),t=ye(i=>i.options.shouldGenerateVariations),n=De(),r=i=>n(xU(i.target.value));return S(T4e,{label:"Seed Weights",value:e,isInvalid:t&&!(K_(e)||e===""),isDisabled:!t,onChange:r})}function A4e(){const e=ye(i=>i.options.variationAmount),t=ye(i=>i.options.shouldGenerateVariations),n=De();return S(Os,{label:"Variation Amount",value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i=>n(WEe(i)),isInteger:!1})}const ak=()=>X(bt,{gap:2,direction:"column",children:[S(A4e,{}),S(L4e,{})]});function M4e(){const e=De(),t=ye(r=>r.options.cfgScale);return S(Os,{label:"CFG Scale",step:.5,min:1.01,max:200,onChange:r=>e(fU(r)),value:t,width:lk,styleClass:"main-option-block",textAlign:"center",isInteger:!1})}const Tr=rt(e=>e.options,e=>Rb[e.activeTab],{memoizeOptions:{equalityCheck:He.isEqual}});rt(e=>e.options,e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n},{memoizeOptions:{resultEqualityCheck:He.isEqual}});const sk=e=>e.options;function R4e(){const e=ye(i=>i.options.height),t=ye(Tr),n=De();return S(Is,{isDisabled:t==="unifiedCanvas",label:"Height",value:e,flexGrow:1,onChange:i=>n(pU(Number(i.target.value))),validValues:o4e,styleClass:"main-option-block"})}const O4e=rt([e=>e.options],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function I4e(){const e=De(),{iterations:t}=ye(O4e);return S(Os,{label:"Images",step:1,min:1,max:9999,onChange:r=>e(REe(r)),value:t,width:lk,labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function D4e(){const e=ye(r=>r.options.sampler),t=De();return S(Is,{label:"Sampler",value:e,onChange:r=>t(SU(r.target.value)),validValues:r4e,styleClass:"main-option-block"})}function N4e(){const e=De(),t=ye(r=>r.options.steps);return S(Os,{label:"Steps",min:1,max:9999,step:1,onChange:r=>e(_U(r)),value:t,width:lk,styleClass:"main-option-block",textAlign:"center"})}function B4e(){const e=ye(i=>i.options.width),t=ye(Tr),n=De();return S(Is,{isDisabled:t==="unifiedCanvas",label:"Width",value:e,flexGrow:1,onChange:i=>n(EU(Number(i.target.value))),validValues:i4e,styleClass:"main-option-block"})}const lk="auto";function uk(){return S("div",{className:"main-options",children:X("div",{className:"main-options-list",children:[X("div",{className:"main-options-row",children:[S(I4e,{}),S(N4e,{}),S(M4e,{})]}),X("div",{className:"main-options-row",children:[S(B4e,{}),S(R4e,{}),S(D4e,{})]})]})})}const z4e={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[]},CH=KS({name:"system",initialState:z4e,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Error",e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?"Connected":"Disconnected"},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Processing canceled"},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Preparing"},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus="Loading Model",e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1}}}),{setShouldDisplayInProgressType:F4e,setIsProcessing:Cu,addLogEntry:Po,setShouldShowLogViewer:zw,setIsConnected:gM,setSocketId:ELe,setShouldConfirmOnDelete:_H,setOpenAccordions:$4e,setSystemStatus:H4e,setCurrentStatus:a5,setSystemConfig:W4e,setShouldDisplayGuides:V4e,processingCanceled:U4e,errorOccurred:mM,errorSeen:kH,setModelList:vM,setIsCancelable:h0,modelChangeRequested:G4e,setSaveIntermediatesInterval:j4e,setEnableImageDebugging:Y4e,generationRequested:q4e,addToast:Cm,clearToastQueue:K4e,setProcessingIndeterminateTask:X4e}=CH.actions,Z4e=CH.reducer;function Q4e(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function J4e(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function EH(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function eSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function tSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}const nSe=rt(e=>e.system,e=>e.shouldDisplayGuides),rSe=({children:e,feature:t})=>{const n=ye(nSe),{text:r}=n4e[t];return n?X(P_,{trigger:"hover",children:[S(A_,{children:S(Ld,{children:e})}),X(L_,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[S(T_,{className:"guide-popover-arrow"}),S("div",{className:"guide-popover-guide-content",children:r})]})]}):null},iSe=Pe(({feature:e,icon:t=Q4e},n)=>S(rSe,{feature:e,children:S(Ld,{ref:n,children:S(wa,{marginBottom:"-.15rem",as:t})})}));function oSe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return X(Qf,{className:"advanced-settings-item",children:[S(Xf,{className:"advanced-settings-header",children:X(bt,{width:"100%",gap:"0.5rem",align:"center",children:[S(Ld,{flexGrow:1,textAlign:"left",children:t}),i,n&&S(iSe,{feature:n}),S(Zf,{})]})}),S(Jf,{className:"advanced-settings-panel",children:r})]})}const ck=e=>{const{accordionInfo:t}=e,n=ye(a=>a.system.openAccordions),r=De();return S(OS,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r($4e(a)),className:"advanced-settings",children:(()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:h,additionalHeaderComponents:g}=t[s];a.push(S(oSe,{header:l,feature:u,content:h,additionalHeaderComponents:g},s))}),a})()})};function aSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function sSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function lSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function PH(e){return dt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function TH(e){return dt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function uSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function cSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function LH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function dSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function fSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function dk(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function AH(e){return dt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function w2(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function MH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function fk(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function RH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function hSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function pSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function OH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function gSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function mSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function IH(e){return dt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function vSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function ySe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function SSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function DH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function bSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function xSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function NH(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function wSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function CSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function hk(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function _Se(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function kSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function ESe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function pk(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function PSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function TSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function yM(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function gk(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function LSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function Ah(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function ASe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function hb(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function MSe(e){return dt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function pb(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const Hu=e=>e.system,RSe=e=>e.system.toastQueue,BH=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],OSe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],mk=e=>e.kind==="line"&&e.layer==="mask",ISe=e=>e.kind==="line"&&e.layer==="base",x4=e=>e.kind==="image"&&e.layer==="base",DSe=e=>e.kind==="fillRect"&&e.layer==="base",NSe=e=>e.kind==="eraseRect"&&e.layer==="base",BSe=e=>e.kind==="line",Qt=e=>e.canvas,vr=rt([Qt,Tr,Hu],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),zH=e=>e.canvas.layerState.objects.find(x4),FH=rt([e=>e.options,e=>e.system,zH,Tr],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:h}=t;let g=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(g=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(g=!1,m.push("No initial image selected")),u&&(g=!1,m.push("System Busy")),h||(g=!1,m.push("System Disconnected")),o&&(!(K_(a)||a==="")||l===-1)&&(g=!1,m.push("Seed-Weights badly formatted.")),{isReady:g,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:He.isEqual,resultEqualityCheck:He.isEqual}}),m7=si("socketio/generateImage"),zSe=si("socketio/runESRGAN"),FSe=si("socketio/runFacetool"),$Se=si("socketio/deleteImage"),v7=si("socketio/requestImages"),SM=si("socketio/requestNewImages"),HSe=si("socketio/cancelProcessing"),WSe=si("socketio/requestSystemConfig"),$H=si("socketio/requestModelChange"),VSe=si("socketio/saveStagingAreaImageToGallery"),USe=si("socketio/requestEmptyTempFolder"),Ro=Pe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return S(bi,{label:r,...i,children:S(ja,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})});function vk(e){const{iconButton:t=!1,...n}=e,r=De(),{isReady:i}=ye(FH),o=ye(Tr),a=()=>{r(m7(o))};return Ue(["ctrl+enter","meta+enter"],()=>{r(m7(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),S("div",{style:{flexGrow:4},children:t?S(Xe,{"aria-label":"Invoke",type:"submit",icon:S(CSe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:"Invoke",tooltipProps:{placement:"bottom"},...n}):S(Ro,{"aria-label":"Invoke",type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const GSe=rt(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:He.isEqual}});function yk(e){const{...t}=e,n=De(),{isProcessing:r,isConnected:i,isCancelable:o}=ye(GSe),a=()=>n(HSe());return Ue("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),S(Xe,{icon:S(tSe,{}),tooltip:"Cancel","aria-label":"Cancel",isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const jSe=rt(e=>e.options,e=>e.shouldLoopback),YSe=()=>{const e=De(),t=ye(jSe);return S(Xe,{"aria-label":"Toggle Loopback",tooltip:"Toggle Loopback",styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:S(kSe,{}),onClick:()=>{e(NEe(!t))}})},Sk=()=>{const e=ye(Tr);return X("div",{className:"process-buttons",children:[S(vk,{}),e==="img2img"&&S(YSe,{}),S(yk,{})]})},qSe=rt([e=>e.options,Tr],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),bk=()=>{const e=De(),{prompt:t,activeTabName:n}=ye(qSe),{isReady:r}=ye(FH),i=C.exports.useRef(null),o=s=>{e(Ob(s.target.value))};Ue("alt+a",()=>{var s;(s=i.current)==null||s.focus()},[]);const a=s=>{s.key==="Enter"&&s.shiftKey===!1&&r&&(s.preventDefault(),e(m7(n)))};return S("div",{className:"prompt-bar",children:S(Td,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:S(k$,{id:"prompt",name:"prompt",placeholder:"Type prompt here. [negative tokens], (upweight)++, (downweight)--, swap and blend are available (see docs)",size:"lg",value:t,onChange:o,onKeyDown:a,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})};function HH(e){return dt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function WH(e){return dt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function KSe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function XSe(e,t){e.classList?e.classList.add(t):KSe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function bM(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function ZSe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=bM(e.className,t):e.setAttribute("class",bM(e.className&&e.className.baseVal||"",t))}const xM={disabled:!1},VH=se.createContext(null);var UH=function(t){return t.scrollTop},_m="unmounted",Nf="exited",Bf="entering",Xp="entered",y7="exiting",Wu=function(e){f_(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=Nf,o.appearStatus=Bf):l=Xp:r.unmountOnExit||r.mountOnEnter?l=_m:l=Nf,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===_m?{status:Nf}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Bf&&a!==Xp&&(o=Bf):(a===Bf||a===Xp)&&(o=y7)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Bf){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Iy.findDOMNode(this);a&&UH(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Nf&&this.setState({status:_m})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Iy.findDOMNode(this),s],u=l[0],h=l[1],g=this.getTimeouts(),m=s?g.appear:g.enter;if(!i&&!a||xM.disabled){this.safeSetState({status:Xp},function(){o.props.onEntered(u)});return}this.props.onEnter(u,h),this.safeSetState({status:Bf},function(){o.props.onEntering(u,h),o.onTransitionEnd(m,function(){o.safeSetState({status:Xp},function(){o.props.onEntered(u,h)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Iy.findDOMNode(this);if(!o||xM.disabled){this.safeSetState({status:Nf},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:y7},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Nf},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Iy.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],h=l[1];this.props.addEndListener(u,h)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===_m)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=u_(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S(VH.Provider,{value:null,children:typeof a=="function"?a(i,s):se.cloneElement(se.Children.only(a),s)})},t}(se.Component);Wu.contextType=VH;Wu.propTypes={};function Vp(){}Wu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vp,onEntering:Vp,onEntered:Vp,onExit:Vp,onExiting:Vp,onExited:Vp};Wu.UNMOUNTED=_m;Wu.EXITED=Nf;Wu.ENTERING=Bf;Wu.ENTERED=Xp;Wu.EXITING=y7;const QSe=Wu;var JSe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return XSe(t,r)})},Fw=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return ZSe(t,r)})},xk=function(e){f_(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;aMath.floor(e/t)*t,kl=(e,t)=>Math.round(e/t)*t,Up=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Gp=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},ebe=.999,tbe=.1,nbe=20,im=.95,wM=30,S7=10,CM=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),Tf=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=kl(s/o,64)):o<1&&(r.height=s,r.width=kl(s*o,64)),a=r.width*r.height;return r},rbe=e=>({width:kl(e.width,64),height:kl(e.height,64)}),km={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},ibe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:km,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},jH=KS({name:"canvas",initialState:ibe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!mk(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:ed(He.clamp(n.width,64,512),64),height:ed(He.clamp(n.height,64,512),64)},o={x:kl(n.width/2-i.width/2,64),y:kl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=Tf(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState={...km,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Gp(r.width,r.height,n.width,n.height,im),s=Up(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=rbe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=Tf(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=CM(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldUseInpaintReplace:(e,t)=>{e.shouldUseInpaintReplace=t.payload},setInpaintReplace:(e,t)=>{e.inpaintReplace=t.payload},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...km.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(BSe);!n||n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();!t||(e.futureLayerStates.unshift(He.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();!t||(e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState=km,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(x4),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const h=Gp(i.width,i.height,512,512,im),g=Up(i.width,i.height,0,0,512,512,h),m={width:512,height:512};if(e.stageScale=h,e.stageCoordinates=g,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=Tf(m);e.scaledBoundingBoxDimensions=v}return}const{width:o,height:a}=r,l=Gp(t,n,o,a,.95),u=Up(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=CM(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(x4)){const i=Gp(r.width,r.height,512,512,im),o=Up(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=Tf(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:i}}=e,{x:o,y:a,width:s,height:l}=n;if(s!==0&&l!==0){const u=Gp(r,i,s,l,im),h=Up(r,i,o,a,s,l,u);e.stageScale=u,e.stageCoordinates=h}else{const u=Gp(r,i,512,512,im),h=Up(r,i,0,0,512,512,u),g={width:512,height:512};if(e.stageScale=u,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=g,e.boundingBoxScaleMethod==="auto"){const m=Tf(g);e.scaledBoundingBoxDimensions=m}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...km.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:ed(He.clamp(o,64,512),64),height:ed(He.clamp(a,64,512),64)},l={x:kl(o/2-s.width/2,64),y:kl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=Tf(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=Tf(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:YH,addFillRect:qH,addImageToStagingArea:obe,addLine:abe,addPointToCurrentLine:KH,clearCanvasHistory:XH,clearMask:wk,commitColorPickerColor:sbe,commitStagingAreaImage:lbe,discardStagedImages:ube,fitBoundingBoxToStage:PLe,mouseLeftCanvas:cbe,nextStagingAreaImage:dbe,prevStagingAreaImage:fbe,redo:hbe,resetCanvas:Ck,resetCanvasInteractionState:pbe,resetCanvasView:ZH,resizeAndScaleCanvas:gb,resizeCanvas:gbe,setBoundingBoxCoordinates:$w,setBoundingBoxDimensions:Em,setBoundingBoxPreviewFill:TLe,setBoundingBoxScaleMethod:mbe,setBrushColor:V0,setBrushSize:U0,setCanvasContainerDimensions:vbe,setColorPickerColor:ybe,setCursorPosition:Sbe,setDoesCanvasNeedScaling:ai,setInitialCanvasImage:mb,setInpaintReplace:_M,setIsDrawing:QH,setIsMaskEnabled:C2,setIsMouseOverBoundingBox:i3,setIsMoveBoundingBoxKeyHeld:LLe,setIsMoveStageKeyHeld:ALe,setIsMovingBoundingBox:Hw,setIsMovingStage:w4,setIsTransformingBoundingBox:Ww,setLayer:C4,setMaskColor:JH,setMergedCanvas:bbe,setShouldAutoSave:eW,setShouldCropToBoundingBoxOnSave:tW,setShouldDarkenOutsideBoundingBox:nW,setShouldLockBoundingBox:MLe,setShouldPreserveMaskedArea:rW,setShouldShowBoundingBox:xbe,setShouldShowBrush:RLe,setShouldShowBrushPreview:OLe,setShouldShowCanvasDebugInfo:iW,setShouldShowCheckboardTransparency:ILe,setShouldShowGrid:oW,setShouldShowIntermediates:aW,setShouldShowStagingImage:wbe,setShouldShowStagingOutline:kM,setShouldSnapToGrid:_4,setShouldUseInpaintReplace:Cbe,setStageCoordinates:sW,setStageScale:_be,setTool:Ol,toggleShouldLockBoundingBox:DLe,toggleTool:NLe,undo:kbe,setScaledBoundingBoxDimensions:o3,setShouldRestrictStrokesToBox:lW}=jH.actions,Ebe=jH.reducer,uW=""+new URL("logo.13003d72.png",import.meta.url).href,Pbe=rt(e=>e.options,e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),_k=e=>{const t=De(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:i}=ye(Pbe),o=C.exports.useRef(null),a=C.exports.useRef(null),s=C.exports.useRef(null),{children:l}=e;Ue("o",()=>{t(ku(!n)),i&&setTimeout(()=>t(ai(!0)),400)},[n,i]),Ue("esc",()=>{t(ku(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Ue("shift+o",()=>{m(),t(ai(!0))},[i]);const u=C.exports.useCallback(()=>{i||(t(OEe(a.current?a.current.scrollTop:0)),t(ku(!1)),t(DEe(!1)))},[t,i]),h=()=>{s.current=window.setTimeout(()=>u(),500)},g=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(BEe(!i)),t(ai(!0))};return C.exports.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),S(GH,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:S("div",{className:"options-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:g,onMouseOver:i?void 0:g,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:S("div",{className:"options-panel-margin",children:X("div",{className:"options-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?g():!i&&h()},children:[S(bi,{label:"Pin Options Panel",children:S("div",{className:"options-panel-pin-button","data-selected":i,onClick:m,children:i?S(HH,{}):S(WH,{})})}),!i&&X("div",{className:"invoke-ai-logo-wrapper",children:[S("img",{src:uW,alt:"invoke-ai-logo"}),X("h1",{children:["invoke ",S("strong",{children:"ai"})]})]}),l]})})})})};function Tbe(){const e={seed:{header:"Seed",feature:Yi.SEED,content:S(rk,{})},variations:{header:"Variations",feature:Yi.VARIATIONS,content:S(ak,{}),additionalHeaderComponents:S(ok,{})},face_restore:{header:"Face Restoration",feature:Yi.FACE_CORRECTION,content:S(tk,{}),additionalHeaderComponents:S(mH,{})},upscale:{header:"Upscaling",feature:Yi.UPSCALE,content:S(ik,{}),additionalHeaderComponents:S(wH,{})},other:{header:"Other Options",feature:Yi.OTHER,content:S(bH,{})}};return X(_k,{children:[S(bk,{}),S(Sk,{}),S(uk,{}),S(SH,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),S(d4e,{}),S(ck,{accordionInfo:e})]})}const kk=C.exports.createContext(null),Lbe=e=>{const{styleClass:t}=e,n=C.exports.useContext(kk),r=()=>{n&&n()};return S("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:X("div",{className:"image-upload-button",children:[S(hb,{}),S(sh,{size:"lg",children:"Click or Drag and Drop"})]})})},Abe=rt(e=>e.system,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),b7=C.exports.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Hv(),a=De(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=ye(Abe),h=C.exports.useRef(null),g=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a($Se(e)),o()};Ue("delete",()=>{s?i():m()},[e,s]);const v=b=>a(_H(!b.target.checked));return X(Rn,{children:[C.exports.cloneElement(t,{onClick:e?g:void 0,ref:n}),S(KF,{isOpen:r,leastDestructiveRef:h,onClose:o,children:S(u1,{children:X(XF,{className:"modal",children:[S(US,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),S(jv,{children:X(bt,{direction:"column",gap:5,children:[S(Mo,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),S(Td,{children:X(bt,{alignItems:"center",children:[S(kh,{mb:0,children:"Don't ask me again"}),S(O_,{checked:!s,onChange:v})]})})]})}),X(VS,{children:[S(ja,{ref:h,onClick:o,className:"modal-close-btn",children:"Cancel"}),S(ja,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})}),Il=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return X(P_,{...o,children:[S(A_,{children:t}),X(L_,{className:`invokeai__popover-content ${r}`,children:[i&&S(T_,{className:"invokeai__popover-arrow"}),n]})]})},Mbe=rt([e=>e.system,e=>e.options,e=>e.gallery,Tr],(e,t,n,r)=>{const{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:u,shouldShowImageDetails:h,isLightBoxOpen:g}=t,{intermediateImage:m,currentImage:v}=n;return{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:u,shouldDisableToolbarButtons:Boolean(m)||!v,currentImage:v,shouldShowImageDetails:h,activeTabName:r,isLightBoxOpen:g}},{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),cW=()=>{var D,B,$,H,j,ne;const e=De(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightBoxOpen:h,activeTabName:g}=ye(Mbe),m=x2(),v=()=>{!u||(h&&e(_u(!1)),e(O1(u)),e(Lo("img2img")))},b=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:"Image Link Copied",status:"success",duration:2500,isClosable:!0})})};Ue("shift+i",()=>{u?(v(),m({title:"Sent To Image To Image",status:"success",duration:2500,isClosable:!0})):m({title:"No Image Loaded",description:"No image found to send to image to image module.",status:"error",duration:2500,isClosable:!0})},[u]);const w=()=>{var V,q;!u||(u.metadata&&e(LEe(u.metadata)),((V=u.metadata)==null?void 0:V.image.type)==="img2img"?e(Lo("img2img")):((q=u.metadata)==null?void 0:q.image.type)==="txt2img"&&e(Lo("txt2img")))};Ue("a",()=>{var V,q;["txt2img","img2img"].includes((q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)==null?void 0:q.type)?(w(),m({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})):m({title:"Parameters Not Set",description:"No metadata found for this image.",status:"error",duration:2500,isClosable:!0})},[u]);const P=()=>{u!=null&&u.metadata&&e(T2(u.metadata.image.seed))};Ue("s",()=>{var V,q;(q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)!=null&&q.seed?(P(),m({title:"Seed Set",status:"success",duration:2500,isClosable:!0})):m({title:"Seed Not Set",description:"Could not find seed for this image.",status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var V,q;return((q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)==null?void 0:q.prompt)&&e(Ob(u.metadata.image.prompt))};Ue("p",()=>{var V,q;(q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)!=null&&q.prompt?(E(),m({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})):m({title:"Prompt Not Set",description:"Could not find prompt for this image.",status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{u&&e(zSe(u))};Ue("Shift+U",()=>{i&&!s&&n&&!t&&o?_():m({title:"Upscaling Failed",status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const T=()=>{u&&e(FSe(u))};Ue("Shift+R",()=>{r&&!s&&n&&!t&&a?T():m({title:"Face Restoration Failed",status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const M=()=>e(CU(!l)),O=()=>{!u||(h&&e(_u(!1)),e(mb(u)),e(ai(!0)),g!=="unifiedCanvas"&&e(Lo("unifiedCanvas")),m({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0}))};Ue("i",()=>{u?M():m({title:"Failed to load metadata",status:"error",duration:2500,isClosable:!0})},[u,l]);const I=()=>{e(_u(!h))};return X("div",{className:"current-image-options",children:[X(ji,{isAttached:!0,children:[S(Il,{trigger:"hover",triggerComponent:S(Xe,{"aria-label":"Send to...",icon:S(TSe,{})}),children:X("div",{className:"current-image-send-to-popover",children:[S(Ro,{size:"sm",onClick:v,leftIcon:S(yM,{}),children:"Send to Image to Image"}),S(Ro,{size:"sm",onClick:O,leftIcon:S(yM,{}),children:"Send to Unified Canvas"}),S(Ro,{size:"sm",onClick:b,leftIcon:S(w2,{}),children:"Copy Link to Image"}),S(Ro,{leftIcon:S(fk,{}),size:"sm",children:S(lh,{download:!0,href:u==null?void 0:u.url,children:"Download Image"})})]})}),S(Xe,{icon:S(pSe,{}),tooltip:h?"Close Viewer (Z)":"Open In Viewer (Z)","aria-label":h?"Close Viewer (Z)":"Open In Viewer (Z)","data-selected":h,onClick:I})]}),X(ji,{isAttached:!0,children:[S(Xe,{icon:S(_Se,{}),tooltip:"Use Prompt (P)","aria-label":"Use Prompt (P)",isDisabled:!((B=(D=u==null?void 0:u.metadata)==null?void 0:D.image)!=null&&B.prompt),onClick:E}),S(Xe,{icon:S(PSe,{}),tooltip:"Use Seed (S)","aria-label":"Use Seed (S)",isDisabled:!((H=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&H.seed),onClick:P}),S(Xe,{icon:S(dSe,{}),tooltip:"Use All (A)","aria-label":"Use All (A)",isDisabled:!["txt2img","img2img"].includes((ne=(j=u==null?void 0:u.metadata)==null?void 0:j.image)==null?void 0:ne.type),onClick:w})]}),X(ji,{isAttached:!0,children:[S(Il,{trigger:"hover",triggerComponent:S(Xe,{icon:S(vSe,{}),"aria-label":"Restore Faces"}),children:X("div",{className:"current-image-postprocessing-popover",children:[S(tk,{}),S(Ro,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:T,children:"Restore Faces"})]})}),S(Il,{trigger:"hover",triggerComponent:S(Xe,{icon:S(hSe,{}),"aria-label":"Upscale"}),children:X("div",{className:"current-image-postprocessing-popover",children:[S(ik,{}),S(Ro,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:_,children:"Upscale Image"})]})})]}),S(ji,{isAttached:!0,children:S(Xe,{icon:S(AH,{}),tooltip:"Info (I)","aria-label":"Info (I)","data-selected":l,onClick:M})}),S(b7,{image:u,children:S(Xe,{icon:S(Ah,{}),tooltip:"Delete Image","aria-label":"Delete Image",isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})},Rbe={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},dW=KS({name:"gallery",initialState:Rbe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ii.exports.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:p0,clearIntermediateImage:Vw,removeImage:fW,setCurrentImage:EM,addGalleryImages:Obe,setIntermediateImage:Ibe,selectNextImage:Ek,selectPrevImage:Pk,setShouldPinGallery:Dbe,setShouldShowGallery:hd,setGalleryScrollPosition:Nbe,setGalleryImageMinimumWidth:om,setGalleryImageObjectFit:Bbe,setShouldHoldGalleryOpen:hW,setShouldAutoSwitchToNewImages:zbe,setCurrentCategory:a3,setGalleryWidth:Fbe,setShouldUseSingleGalleryColumn:$be}=dW.actions,Hbe=dW.reducer;ut({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});ut({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});ut({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});ut({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});ut({displayName:"SunIcon",path:X("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[S("circle",{cx:"12",cy:"12",r:"5"}),S("path",{d:"M12 1v2"}),S("path",{d:"M12 21v2"}),S("path",{d:"M4.22 4.22l1.42 1.42"}),S("path",{d:"M18.36 18.36l1.42 1.42"}),S("path",{d:"M1 12h2"}),S("path",{d:"M21 12h2"}),S("path",{d:"M4.22 19.78l1.42-1.42"}),S("path",{d:"M18.36 5.64l1.42-1.42"})]})});ut({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});ut({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:S("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});ut({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});ut({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});ut({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});ut({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});ut({displayName:"ViewIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),S("circle",{cx:"12",cy:"12",r:"2"})]})});ut({displayName:"ViewOffIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),S("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"})]})});ut({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});ut({displayName:"DeleteIcon",path:S("g",{fill:"currentColor",children:S("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})});ut({displayName:"RepeatIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),S("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"})]})});ut({displayName:"RepeatClockIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),S("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"})]})});ut({displayName:"EditIcon",path:X("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[S("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),S("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});ut({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});ut({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});ut({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});ut({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});ut({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});ut({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});ut({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});ut({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});ut({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var pW=ut({displayName:"ExternalLinkIcon",path:X("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[S("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),S("path",{d:"M15 3h6v6"}),S("path",{d:"M10 14L21 3"})]})});ut({displayName:"LinkIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),S("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"})]})});ut({displayName:"PlusSquareIcon",path:X("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[S("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),S("path",{d:"M12 8v8"}),S("path",{d:"M8 12h8"})]})});ut({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});ut({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});ut({displayName:"TimeIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),S("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"})]})});ut({displayName:"ArrowRightIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),S("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"})]})});ut({displayName:"ArrowLeftIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),S("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"})]})});ut({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});ut({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});ut({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});ut({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});ut({displayName:"EmailIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),S("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"})]})});ut({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});ut({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});ut({displayName:"SpinnerIcon",path:X(Rn,{children:[S("defs",{children:X("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[S("stop",{stopColor:"currentColor",offset:"0%"}),S("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),X("g",{transform:"translate(2)",fill:"none",children:[S("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),S("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),S("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})});ut({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});ut({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:S("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});ut({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});ut({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});ut({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});ut({displayName:"InfoOutlineIcon",path:X("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[S("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),S("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),S("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})});ut({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});ut({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});ut({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});ut({displayName:"QuestionOutlineIcon",path:X("g",{stroke:"currentColor",strokeWidth:"1.5",children:[S("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),S("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),S("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})});ut({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});ut({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});ut({viewBox:"0 0 14 14",path:S("g",{fill:"currentColor",children:S("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});ut({displayName:"MinusIcon",path:S("g",{fill:"currentColor",children:S("rect",{height:"4",width:"20",x:"2",y:"10"})})});ut({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function Wbe(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Nn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>X(bt,{gap:2,children:[n&&S(bi,{label:`Recall ${e}`,children:S(Ya,{"aria-label":"Use this parameter",icon:S(Wbe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&S(bi,{label:`Copy ${e}`,children:S(Ya,{"aria-label":`Copy ${e}`,icon:S(w2,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),X(bt,{direction:i?"column":"row",children:[X(Mo,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?X(lh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",S(pW,{mx:"2px"})]}):S(Mo,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),Vbe=(e,t)=>e.image.uuid===t.image.uuid,gW=C.exports.memo(({image:e,styleClass:t})=>{var H,j;const n=De();Ue("esc",()=>{n(CU(!1))});const r=((H=e==null?void 0:e.metadata)==null?void 0:H.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:h,orig_path:g,perlin:m,postprocessing:v,prompt:b,sampler:w,scale:P,seamless:E,seed:_,steps:T,strength:M,threshold:O,type:I,variations:D,width:B}=r,$=JSON.stringify(e.metadata,null,2);return S("div",{className:`image-metadata-viewer ${t}`,children:X(bt,{gap:1,direction:"column",width:"100%",children:[X(bt,{gap:2,children:[S(Mo,{fontWeight:"semibold",children:"File:"}),X(lh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,S(pW,{mx:"2px"})]})]}),Object.keys(r).length>0?X(Rn,{children:[I&&S(Nn,{label:"Generation type",value:I}),((j=e.metadata)==null?void 0:j.model_weights)&&S(Nn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(I)&&S(Nn,{label:"Original image",value:g}),I==="gfpgan"&&M!==void 0&&S(Nn,{label:"Fix faces strength",value:M,onClick:()=>n(c5(M))}),I==="esrgan"&&P!==void 0&&S(Nn,{label:"Upscaling scale",value:P,onClick:()=>n(j7(P))}),I==="esrgan"&&M!==void 0&&S(Nn,{label:"Upscaling strength",value:M,onClick:()=>n(Y7(M))}),b&&S(Nn,{label:"Prompt",labelPosition:"top",value:o5(b),onClick:()=>n(Ob(b))}),_!==void 0&&S(Nn,{label:"Seed",value:_,onClick:()=>n(T2(_))}),O!==void 0&&S(Nn,{label:"Noise Threshold",value:O,onClick:()=>n(kU(O))}),m!==void 0&&S(Nn,{label:"Perlin Noise",value:m,onClick:()=>n(yU(m))}),w&&S(Nn,{label:"Sampler",value:w,onClick:()=>n(SU(w))}),T&&S(Nn,{label:"Steps",value:T,onClick:()=>n(_U(T))}),o!==void 0&&S(Nn,{label:"CFG scale",value:o,onClick:()=>n(fU(o))}),D&&D.length>0&&S(Nn,{label:"Seed-weight pairs",value:b4(D),onClick:()=>n(xU(b4(D)))}),E&&S(Nn,{label:"Seamless",value:E,onClick:()=>n(bU(E))}),l&&S(Nn,{label:"High Resolution Optimization",value:l,onClick:()=>n(gU(l))}),B&&S(Nn,{label:"Width",value:B,onClick:()=>n(EU(B))}),s&&S(Nn,{label:"Height",value:s,onClick:()=>n(pU(s))}),u&&S(Nn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(O1(u))}),h&&S(Nn,{label:"Mask image",value:h,isLink:!0,onClick:()=>n(vU(h))}),I==="img2img"&&M&&S(Nn,{label:"Image to image strength",value:M,onClick:()=>n(G7(M))}),a&&S(Nn,{label:"Image to image fit",value:a,onClick:()=>n(wU(a))}),v&&v.length>0&&X(Rn,{children:[S(sh,{size:"sm",children:"Postprocessing"}),v.map((ne,V)=>{if(ne.type==="esrgan"){const{scale:q,strength:te}=ne;return X(bt,{pl:"2rem",gap:1,direction:"column",children:[S(Mo,{size:"md",children:`${V+1}: Upscale (ESRGAN)`}),S(Nn,{label:"Scale",value:q,onClick:()=>n(j7(q))}),S(Nn,{label:"Strength",value:te,onClick:()=>n(Y7(te))})]},V)}else if(ne.type==="gfpgan"){const{strength:q}=ne;return X(bt,{pl:"2rem",gap:1,direction:"column",children:[S(Mo,{size:"md",children:`${V+1}: Face restoration (GFPGAN)`}),S(Nn,{label:"Strength",value:q,onClick:()=>{n(c5(q)),n(d5("gfpgan"))}})]},V)}else if(ne.type==="codeformer"){const{strength:q,fidelity:te}=ne;return X(bt,{pl:"2rem",gap:1,direction:"column",children:[S(Mo,{size:"md",children:`${V+1}: Face restoration (Codeformer)`}),S(Nn,{label:"Strength",value:q,onClick:()=>{n(c5(q)),n(d5("codeformer"))}}),te&&S(Nn,{label:"Fidelity",value:te,onClick:()=>{n(hU(te)),n(d5("codeformer"))}})]},V)}})]}),i&&S(Nn,{withCopy:!0,label:"Dream Prompt",value:i}),X(bt,{gap:2,direction:"column",children:[X(bt,{gap:2,children:[S(bi,{label:"Copy metadata JSON",children:S(Ya,{"aria-label":"Copy metadata JSON",icon:S(w2,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText($)})}),S(Mo,{fontWeight:"semibold",children:"Metadata JSON:"})]}),S("div",{className:"image-json-viewer",children:S("pre",{children:$})})]})]}):S(Ez,{width:"100%",pt:10,children:S(Mo,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},Vbe),mW=rt([e=>e.gallery,e=>e.options],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var h;return u.uuid===((h=e==null?void 0:e.currentImage)==null?void 0:h.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function Ube(){const e=De(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=ye(mW),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},h=()=>{e(Pk())},g=()=>{e(Ek())};return X("div",{className:"current-image-preview",children:[i&&S(DS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&X("div",{className:"current-image-next-prev-buttons",children:[S("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&S(Ya,{"aria-label":"Previous image",icon:S(PH,{className:"next-prev-button"}),variant:"unstyled",onClick:h})}),S("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&S(Ya,{"aria-label":"Next image",icon:S(TH,{className:"next-prev-button"}),variant:"unstyled",onClick:g})})]}),r&&i&&S(gW,{image:i,styleClass:"current-image-metadata"})]})}const Gbe=rt([e=>e.gallery,e=>e.options,Tr],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),vW=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=ye(Gbe);return S("div",{className:"current-image-area","data-tab-name":t,children:e?X(Rn,{children:[S(cW,{}),S(Ube,{})]}):S("div",{className:"current-image-display-placeholder",children:S(eSe,{})})})},jbe=()=>{const e=C.exports.useContext(kk);return S(Xe,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:S(hb,{}),onClick:e||void 0})};function Ybe(){const e=ye(i=>i.options.initialImage),t=De(),n=x2(),r=()=>{n({title:"Problem loading parameters",description:"Unable to load init image.",status:"error",isClosable:!0}),t(dU())};return X(Rn,{children:[X("div",{className:"init-image-preview-header",children:[S("h2",{children:"Initial Image"}),S(jbe,{})]}),e&&S("div",{className:"init-image-preview",children:S(DS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:r})})]})}const qbe=()=>{const e=ye(r=>r.options.initialImage),{currentImage:t}=ye(r=>r.gallery);return X("div",{className:"workarea-split-view",children:[S("div",{className:"workarea-split-view-left",children:e?S("div",{className:"image-to-image-area",children:S(Ybe,{})}):S(Lbe,{})}),t&&S("div",{className:"workarea-split-view-right",children:S(vW,{})})]})};function Kbe(e){return dt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}var Xbe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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)}}(),Ur=globalThis&&globalThis.__assign||function(){return Ur=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},rxe=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],MM="__resizable_base__",yW=function(e){Jbe(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(MM):o.className+=MM,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;!o||o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||exe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),h=u/l[s]*100;return h+"%"}return Uw(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?Uw(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?Uw(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&jp("left",o),s=i&&jp("top",o),l,u;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(l=a?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,g=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,w=u||0;if(s){var P=(m-b)*this.ratio+w,E=(v-b)*this.ratio+w,_=(h-w)/this.ratio+b,T=(g-w)/this.ratio+b,M=Math.max(h,P),O=Math.min(g,E),I=Math.max(m,_),D=Math.min(v,T);n=l3(n,M,O),r=l3(r,I,D)}else n=l3(n,h,g),r=l3(r,m,v);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&txe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&u3(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var h=this.window.getComputedStyle(u).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var g={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:gl(gl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(g)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&u3(n))try{n.preventDefault(),n.stopPropagation()}catch(te){}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=u3(n)?n.touches[0].clientX:n.clientX,h=u3(n)?n.touches[0].clientY:n.clientY,g=this.state,m=g.direction,v=g.original,b=g.width,w=g.height,P=this.getParentSize(),E=nxe(P,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=E.maxWidth,a=E.maxHeight,s=E.minWidth,l=E.minHeight;var _=this.calculateNewSizeFromDirection(u,h),T=_.newHeight,M=_.newWidth,O=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(M=AM(M,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=AM(T,this.props.snap.y,this.props.snapGap));var I=this.calculateNewSizeFromAspectRatio(M,T,{width:O.maxWidth,height:O.maxHeight},{width:s,height:l});if(M=I.newWidth,T=I.newHeight,this.props.grid){var D=LM(M,this.props.grid[0]),B=LM(T,this.props.grid[1]),$=this.props.snapGap||0;M=$===0||Math.abs(D-M)<=$?D:M,T=$===0||Math.abs(B-T)<=$?B:T}var H={width:M-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var j=M/P.width*100;M=j+"%"}else if(b.endsWith("vw")){var ne=M/this.window.innerWidth*100;M=ne+"vw"}else if(b.endsWith("vh")){var V=M/this.window.innerHeight*100;M=V+"vh"}}if(w&&typeof w=="string"){if(w.endsWith("%")){var j=T/P.height*100;T=j+"%"}else if(w.endsWith("vw")){var ne=T/this.window.innerWidth*100;T=ne+"vw"}else if(w.endsWith("vh")){var V=T/this.window.innerHeight*100;T=V+"vh"}}var q={width:this.createSizeForCssProperty(M,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?q.flexBasis=q.width:this.flexDir==="column"&&(q.flexBasis=q.height),Wl.exports.flushSync(function(){r.setState(q)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,H)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:gl(gl({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var h=Object.keys(i).map(function(g){return i[g]!==!1?S(Qbe,{direction:g,onResizeStart:n.onResizeStart,replaceStyles:o&&o[g],className:a&&a[g],children:u&&u[g]?u[g]:null},g):null});return S("div",{className:l,style:s,children:h})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return rxe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=gl(gl(gl({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return X(o,{...gl({ref:this.ref,style:i,className:this.props.className},r),children:[this.state.isResizing&&S("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]})},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(C.exports.PureComponent);function Xn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function _2(e,t=[]){let n=[];function r(o,a){const s=C.exports.createContext(a),l=n.length;n=[...n,a];function u(g){const{scope:m,children:v,...b}=g,w=(m==null?void 0:m[e][l])||s,P=C.exports.useMemo(()=>b,Object.values(b));return C.exports.createElement(w.Provider,{value:P},v)}function h(g,m){const v=(m==null?void 0:m[e][l])||s,b=C.exports.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,h]}const i=()=>{const o=n.map(a=>C.exports.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return C.exports.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,ixe(i,...t)]}function ixe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const g=l(o)[`__scope${u}`];return{...s,...g}},{});return C.exports.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function oxe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function SW(...e){return t=>e.forEach(n=>oxe(n,t))}function Xa(...e){return C.exports.useCallback(SW(...e),e)}const Xv=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e,i=C.exports.Children.toArray(n),o=i.find(sxe);if(o){const a=o.props.children,s=i.map(l=>l===o?C.exports.Children.count(a)>1?C.exports.Children.only(null):C.exports.isValidElement(a)?a.props.children:null:l);return C.exports.createElement(x7,On({},r,{ref:t}),C.exports.isValidElement(a)?C.exports.cloneElement(a,void 0,s):null)}return C.exports.createElement(x7,On({},r,{ref:t}),n)});Xv.displayName="Slot";const x7=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e;return C.exports.isValidElement(n)?C.exports.cloneElement(n,{...lxe(r,n.props),ref:SW(t,n.ref)}):C.exports.Children.count(n)>1?C.exports.Children.only(null):null});x7.displayName="SlotClone";const axe=({children:e})=>C.exports.createElement(C.exports.Fragment,null,e);function sxe(e){return C.exports.isValidElement(e)&&e.type===axe}function lxe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const uxe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Iu=uxe.reduce((e,t)=>{const n=C.exports.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Xv:t;return C.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.exports.createElement(s,On({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function bW(e,t){e&&Wl.exports.flushSync(()=>e.dispatchEvent(t))}function xW(e){const t=e+"CollectionProvider",[n,r]=_2(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:w}=v,P=se.useRef(null),E=se.useRef(new Map).current;return se.createElement(i,{scope:b,itemMap:E,collectionRef:P},w)},s=e+"CollectionSlot",l=se.forwardRef((v,b)=>{const{scope:w,children:P}=v,E=o(s,w),_=Xa(b,E.collectionRef);return se.createElement(Xv,{ref:_},P)}),u=e+"CollectionItemSlot",h="data-radix-collection-item",g=se.forwardRef((v,b)=>{const{scope:w,children:P,...E}=v,_=se.useRef(null),T=Xa(b,_),M=o(u,w);return se.useEffect(()=>(M.itemMap.set(_,{ref:_,...E}),()=>void M.itemMap.delete(_))),se.createElement(Xv,{[h]:"",ref:T},P)});function m(v){const b=o(e+"CollectionConsumer",v);return se.useCallback(()=>{const P=b.collectionRef.current;if(!P)return[];const E=Array.from(P.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((M,O)=>E.indexOf(M.ref.current)-E.indexOf(O.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:g},m,r]}const cxe=C.exports.createContext(void 0);function wW(e){const t=C.exports.useContext(cxe);return e||t||"ltr"}function Fl(e){const t=C.exports.useRef(e);return C.exports.useEffect(()=>{t.current=e}),C.exports.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function dxe(e,t=globalThis==null?void 0:globalThis.document){const n=Fl(e);C.exports.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const w7="dismissableLayer.update",fxe="dismissableLayer.pointerDownOutside",hxe="dismissableLayer.focusOutside";let RM;const pxe=C.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gxe=C.exports.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,h=C.exports.useContext(pxe),[g,m]=C.exports.useState(null),v=(n=g==null?void 0:g.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=C.exports.useState({}),w=Xa(t,B=>m(B)),P=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),_=P.indexOf(E),T=g?P.indexOf(g):-1,M=h.layersWithOutsidePointerEventsDisabled.size>0,O=T>=_,I=mxe(B=>{const $=B.target,H=[...h.branches].some(j=>j.contains($));!O||H||(o==null||o(B),s==null||s(B),B.defaultPrevented||l==null||l())},v),D=vxe(B=>{const $=B.target;[...h.branches].some(j=>j.contains($))||(a==null||a(B),s==null||s(B),B.defaultPrevented||l==null||l())},v);return dxe(B=>{T===h.layers.size-1&&(i==null||i(B),!B.defaultPrevented&&l&&(B.preventDefault(),l()))},v),C.exports.useEffect(()=>{if(!!g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(RM=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),OM(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=RM)}},[g,v,r,h]),C.exports.useEffect(()=>()=>{!g||(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),OM())},[g,h]),C.exports.useEffect(()=>{const B=()=>b({});return document.addEventListener(w7,B),()=>document.removeEventListener(w7,B)},[]),C.exports.createElement(Iu.div,On({},u,{ref:w,style:{pointerEvents:M?O?"auto":"none":void 0,...e.style},onFocusCapture:Xn(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Xn(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Xn(e.onPointerDownCapture,I.onPointerDownCapture)}))});function mxe(e,t=globalThis==null?void 0:globalThis.document){const n=Fl(e),r=C.exports.useRef(!1),i=C.exports.useRef(()=>{});return C.exports.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){CW(fxe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function vxe(e,t=globalThis==null?void 0:globalThis.document){const n=Fl(e),r=C.exports.useRef(!1);return C.exports.useEffect(()=>{const i=o=>{o.target&&!r.current&&CW(hxe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function OM(){const e=new CustomEvent(w7);document.dispatchEvent(e)}function CW(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?bW(i,o):i.dispatchEvent(o)}let Gw=0;function yxe(){C.exports.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:IM()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:IM()),Gw++,()=>{Gw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Gw--}},[])}function IM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const jw="focusScope.autoFocusOnMount",Yw="focusScope.autoFocusOnUnmount",DM={bubbles:!1,cancelable:!0},Sxe=C.exports.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=C.exports.useState(null),u=Fl(i),h=Fl(o),g=C.exports.useRef(null),m=Xa(t,w=>l(w)),v=C.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.exports.useEffect(()=>{if(r){let w=function(E){if(v.paused||!s)return;const _=E.target;s.contains(_)?g.current=_:zf(g.current,{select:!0})},P=function(E){v.paused||!s||s.contains(E.relatedTarget)||zf(g.current,{select:!0})};return document.addEventListener("focusin",w),document.addEventListener("focusout",P),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",P)}}},[r,s,v.paused]),C.exports.useEffect(()=>{if(s){BM.add(v);const w=document.activeElement;if(!s.contains(w)){const E=new CustomEvent(jw,DM);s.addEventListener(jw,u),s.dispatchEvent(E),E.defaultPrevented||(bxe(kxe(_W(s)),{select:!0}),document.activeElement===w&&zf(s))}return()=>{s.removeEventListener(jw,u),setTimeout(()=>{const E=new CustomEvent(Yw,DM);s.addEventListener(Yw,h),s.dispatchEvent(E),E.defaultPrevented||zf(w!=null?w:document.body,{select:!0}),s.removeEventListener(Yw,h),BM.remove(v)},0)}}},[s,u,h,v]);const b=C.exports.useCallback(w=>{if(!n&&!r||v.paused)return;const P=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(P&&E){const _=w.currentTarget,[T,M]=xxe(_);T&&M?!w.shiftKey&&E===M?(w.preventDefault(),n&&zf(T,{select:!0})):w.shiftKey&&E===T&&(w.preventDefault(),n&&zf(M,{select:!0})):E===_&&w.preventDefault()}},[n,r,v.paused]);return C.exports.createElement(Iu.div,On({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function bxe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zf(r,{select:t}),document.activeElement!==n)return}function xxe(e){const t=_W(e),n=NM(t,e),r=NM(t.reverse(),e);return[n,r]}function _W(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function NM(e,t){for(const n of e)if(!wxe(n,{upTo:t}))return n}function wxe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Cxe(e){return e instanceof HTMLInputElement&&"select"in e}function zf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Cxe(e)&&t&&e.select()}}const BM=_xe();function _xe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=zM(e,t),e.unshift(t)},remove(t){var n;e=zM(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function zM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kxe(e){return e.filter(t=>t.tagName!=="A")}const d1=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:()=>{},Exe=l6["useId".toString()]||(()=>{});let Pxe=0;function Txe(e){const[t,n]=C.exports.useState(Exe());return d1(()=>{e||n(r=>r!=null?r:String(Pxe++))},[e]),e||(t?`radix-${t}`:"")}function L1(e){return e.split("-")[0]}function vb(e){return e.split("-")[1]}function A1(e){return["top","bottom"].includes(L1(e))?"x":"y"}function Tk(e){return e==="y"?"height":"width"}function FM(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=A1(t),l=Tk(s),u=r[l]/2-i[l]/2,h=L1(t),g=s==="x";let m;switch(h){case"top":m={x:o,y:r.y-i.height};break;case"bottom":m={x:o,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:a};break;case"left":m={x:r.x-i.width,y:a};break;default:m={x:r.x,y:r.y}}switch(vb(t)){case"start":m[s]-=u*(n&&g?-1:1);break;case"end":m[s]+=u*(n&&g?-1:1);break}return m}const Lxe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:h}=FM(l,r,s),g=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e!=null?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=kW(r),h={x:i,y:o},g=A1(a),m=vb(a),v=Tk(g),b=await l.getDimensions(n),w=g==="y"?"top":"left",P=g==="y"?"bottom":"right",E=s.reference[v]+s.reference[g]-h[g]-s.floating[v],_=h[g]-s.reference[g],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let M=T?g==="y"?T.clientHeight||0:T.clientWidth||0:0;M===0&&(M=s.floating[v]);const O=E/2-_/2,I=u[w],D=M-b[v]-u[P],B=M/2-b[v]/2+O,$=C7(I,B,D),ne=(m==="start"?u[w]:u[P])>0&&B!==$&&s.reference[v]<=s.floating[v]?BOxe[t])}function Ixe(e,t,n){n===void 0&&(n=!1);const r=vb(e),i=A1(e),o=Tk(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=P4(a)),{main:a,cross:P4(a)}}const Dxe={start:"end",end:"start"};function HM(e){return e.replace(/start|end/g,t=>Dxe[t])}const Nxe=["top","right","bottom","left"];function Bxe(e){const t=P4(e);return[HM(e),t,HM(t)]}const zxe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,w=L1(r),E=g||(w===a||!v?[P4(a)]:Bxe(a)),_=[a,...E],T=await E4(t,b),M=[];let O=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&M.push(T[w]),h){const{main:$,cross:H}=Ixe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));M.push(T[$],T[H])}if(O=[...O,{placement:r,overflows:M}],!M.every($=>$<=0)){var I,D;const $=((I=(D=i.flip)==null?void 0:D.index)!=null?I:0)+1,H=_[$];if(H)return{data:{index:$,overflows:O},reset:{placement:H}};let j="bottom";switch(m){case"bestFit":{var B;const ne=(B=O.map(V=>[V,V.overflows.filter(q=>q>0).reduce((q,te)=>q+te,0)]).sort((V,q)=>V[1]-q[1])[0])==null?void 0:B[0].placement;ne&&(j=ne);break}case"initialPlacement":j=a;break}if(r!==j)return{reset:{placement:j}}}return{}}}};function WM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function VM(e){return Nxe.some(t=>e[t]>=0)}const Fxe=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=await E4(r,{...n,elementContext:"reference"}),a=WM(o,i.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:VM(a)}}}case"escaped":{const o=await E4(r,{...n,altBoundary:!0}),a=WM(o,i.floating);return{data:{escapedOffsets:a,escaped:VM(a)}}}default:return{}}}}};async function $xe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=L1(n),s=vb(n),l=A1(n)==="x",u=["left","top"].includes(a)?-1:1,h=o&&l?-1:1,g=typeof t=="function"?t(e):t;let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return s&&typeof b=="number"&&(v=s==="end"?b*-1:b),l?{x:v*h,y:m*u}:{x:m*u,y:v*h}}const Hxe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await $xe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function EW(e){return e==="x"?"y":"x"}const Wxe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:P=>{let{x:E,y:_}=P;return{x:E,y:_}}},...l}=e,u={x:n,y:r},h=await E4(t,l),g=A1(L1(i)),m=EW(g);let v=u[g],b=u[m];if(o){const P=g==="y"?"top":"left",E=g==="y"?"bottom":"right",_=v+h[P],T=v-h[E];v=C7(_,v,T)}if(a){const P=m==="y"?"top":"left",E=m==="y"?"bottom":"right",_=b+h[P],T=b-h[E];b=C7(_,b,T)}const w=s.fn({...t,[g]:v,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r}}}}},Vxe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,h={x:n,y:r},g=A1(i),m=EW(g);let v=h[g],b=h[m];const w=typeof s=="function"?s({...o,placement:i}):s,P=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const O=g==="y"?"height":"width",I=o.reference[g]-o.floating[O]+P.mainAxis,D=o.reference[g]+o.reference[O]-P.mainAxis;vD&&(v=D)}if(u){var E,_,T,M;const O=g==="y"?"width":"height",I=["top","left"].includes(L1(i)),D=o.reference[m]-o.floating[O]+(I&&(E=(_=a.offset)==null?void 0:_[m])!=null?E:0)+(I?0:P.crossAxis),B=o.reference[m]+o.reference[O]+(I?0:(T=(M=a.offset)==null?void 0:M[m])!=null?T:0)-(I?P.crossAxis:0);bB&&(b=B)}return{[g]:v,[m]:b}}}};function PW(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Vu(e){if(e==null)return window;if(!PW(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function k2(e){return Vu(e).getComputedStyle(e)}function Du(e){return PW(e)?"":e?(e.nodeName||"").toLowerCase():""}function TW(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function $l(e){return e instanceof Vu(e).HTMLElement}function wd(e){return e instanceof Vu(e).Element}function Uxe(e){return e instanceof Vu(e).Node}function Lk(e){if(typeof ShadowRoot>"u")return!1;const t=Vu(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function yb(e){const{overflow:t,overflowX:n,overflowY:r}=k2(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function Gxe(e){return["table","td","th"].includes(Du(e))}function LW(e){const t=/firefox/i.test(TW()),n=k2(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}function AW(){return!/^((?!chrome|android).)*safari/i.test(TW())}const UM=Math.min,iv=Math.max,T4=Math.round;function Nu(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&$l(e)&&(l=e.offsetWidth>0&&T4(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&T4(s.height)/e.offsetHeight||1);const h=wd(e)?Vu(e):window,g=!AW()&&n,m=(s.left+(g&&(r=(i=h.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(g&&(o=(a=h.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,w=s.height/u;return{width:b,height:w,top:v,right:m+b,bottom:v+w,left:m,x:m,y:v}}function Od(e){return((Uxe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Sb(e){return wd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function MW(e){return Nu(Od(e)).left+Sb(e).scrollLeft}function jxe(e){const t=Nu(e);return T4(t.width)!==e.offsetWidth||T4(t.height)!==e.offsetHeight}function Yxe(e,t,n){const r=$l(t),i=Od(t),o=Nu(e,r&&jxe(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Du(t)!=="body"||yb(i))&&(a=Sb(t)),$l(t)){const l=Nu(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=MW(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function RW(e){return Du(e)==="html"?e:e.assignedSlot||e.parentNode||(Lk(e)?e.host:null)||Od(e)}function GM(e){return!$l(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function qxe(e){let t=RW(e);for(Lk(t)&&(t=t.host);$l(t)&&!["html","body"].includes(Du(t));){if(LW(t))return t;t=t.parentNode}return null}function _7(e){const t=Vu(e);let n=GM(e);for(;n&&Gxe(n)&&getComputedStyle(n).position==="static";)n=GM(n);return n&&(Du(n)==="html"||Du(n)==="body"&&getComputedStyle(n).position==="static"&&!LW(n))?t:n||qxe(e)||t}function jM(e){if($l(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Nu(e);return{width:t.width,height:t.height}}function Kxe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=$l(n),o=Od(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Du(n)!=="body"||yb(o))&&(a=Sb(n)),$l(n))){const l=Nu(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}}function Xxe(e,t){const n=Vu(e),r=Od(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=AW();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function Zxe(e){var t;const n=Od(e),r=Sb(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=iv(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=iv(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+MW(e);const l=-r.scrollTop;return k2(i||n).direction==="rtl"&&(s+=iv(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function OW(e){const t=RW(e);return["html","body","#document"].includes(Du(t))?e.ownerDocument.body:$l(t)&&yb(t)?t:OW(t)}function L4(e,t){var n;t===void 0&&(t=[]);const r=OW(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Vu(r),a=i?[o].concat(o.visualViewport||[],yb(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(L4(a))}function Qxe(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Lk(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Jxe(e,t){const n=Nu(e,!1,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function YM(e,t,n){return t==="viewport"?k4(Xxe(e,n)):wd(t)?Jxe(t,n):k4(Zxe(Od(e)))}function ewe(e){const t=L4(e),r=["absolute","fixed"].includes(k2(e).position)&&$l(e)?_7(e):e;return wd(r)?t.filter(i=>wd(i)&&Qxe(i,r)&&Du(i)!=="body"):[]}function twe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ewe(t):[].concat(n),r],s=a[0],l=a.reduce((u,h)=>{const g=YM(t,h,i);return u.top=iv(g.top,u.top),u.right=UM(g.right,u.right),u.bottom=UM(g.bottom,u.bottom),u.left=iv(g.left,u.left),u},YM(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const nwe={getClippingRect:twe,convertOffsetParentRelativeRectToViewportRelativeRect:Kxe,isElement:wd,getDimensions:jM,getOffsetParent:_7,getDocumentElement:Od,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Yxe(t,_7(n),r),floating:{...jM(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>k2(e).direction==="rtl"};function rwe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,h=l||u?[...wd(e)?L4(e):[],...L4(t)]:[];h.forEach(w=>{l&&w.addEventListener("scroll",n,{passive:!0}),u&&w.addEventListener("resize",n)});let g=null;if(a){let w=!0;g=new ResizeObserver(()=>{w||n(),w=!1}),wd(e)&&!s&&g.observe(e),g.observe(t)}let m,v=s?Nu(e):null;s&&b();function b(){const w=Nu(e);v&&(w.x!==v.x||w.y!==v.y||w.width!==v.width||w.height!==v.height)&&n(),v=w,m=requestAnimationFrame(b)}return n(),()=>{var w;h.forEach(P=>{l&&P.removeEventListener("scroll",n),u&&P.removeEventListener("resize",n)}),(w=g)==null||w.disconnect(),g=null,s&&cancelAnimationFrame(m)}}const iwe=(e,t,n)=>Lxe(e,t,{platform:nwe,...n});var k7=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function E7(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!E7(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!E7(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function owe(e){const t=C.exports.useRef(e);return k7(()=>{t.current=e}),t}function awe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=C.exports.useRef(null),a=C.exports.useRef(null),s=owe(i),l=C.exports.useRef(null),[u,h]=C.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[g,m]=C.exports.useState(t);E7(g==null?void 0:g.map(T=>{let{options:M}=T;return M}),t==null?void 0:t.map(T=>{let{options:M}=T;return M}))||m(t);const v=C.exports.useCallback(()=>{!o.current||!a.current||iwe(o.current,a.current,{middleware:g,placement:n,strategy:r}).then(T=>{b.current&&Wl.exports.flushSync(()=>{h(T)})})},[g,n,r]);k7(()=>{b.current&&v()},[v]);const b=C.exports.useRef(!1);k7(()=>(b.current=!0,()=>{b.current=!1}),[]);const w=C.exports.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,v);l.current=T}else v()},[v,s]),P=C.exports.useCallback(T=>{o.current=T,w()},[w]),E=C.exports.useCallback(T=>{a.current=T,w()},[w]),_=C.exports.useMemo(()=>({reference:o,floating:a}),[]);return C.exports.useMemo(()=>({...u,update:v,refs:_,reference:P,floating:E}),[u,v,_,P,E])}const swe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?$M({element:t.current,padding:n}).fn(i):{}:t?$M({element:t,padding:n}).fn(i):{}}}};function lwe(e){const[t,n]=C.exports.useState(void 0);return d1(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const IW="Popper",[Ak,DW]=_2(IW),[uwe,NW]=Ak(IW),cwe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.exports.useState(null);return C.exports.createElement(uwe,{scope:t,anchor:r,onAnchorChange:i},n)},dwe="PopperAnchor",fwe=C.exports.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=NW(dwe,n),a=C.exports.useRef(null),s=Xa(t,a);return C.exports.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:C.exports.createElement(Iu.div,On({},i,{ref:s}))}),A4="PopperContent",[hwe,BLe]=Ak(A4),[pwe,gwe]=Ak(A4,{hasParent:!1,positionUpdateFns:new Set}),mwe=C.exports.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:h,side:g="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:w=0,collisionBoundary:P=[],collisionPadding:E=0,sticky:_="partial",hideWhenDetached:T=!1,avoidCollisions:M=!0,...O}=e,I=NW(A4,h),[D,B]=C.exports.useState(null),$=Xa(t,Et=>B(Et)),[H,j]=C.exports.useState(null),ne=lwe(H),V=(n=ne==null?void 0:ne.width)!==null&&n!==void 0?n:0,q=(r=ne==null?void 0:ne.height)!==null&&r!==void 0?r:0,te=g+(v!=="center"?"-"+v:""),J=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(P)?P:[P],G=Z.length>0,ee={padding:J,boundary:Z.filter(ywe),altBoundary:G},{reference:le,floating:me,strategy:Me,x:Ce,y:be,placement:we,middlewareData:Ve,update:Ze}=awe({strategy:"fixed",placement:te,whileElementsMounted:rwe,middleware:[Hxe({mainAxis:m+q,alignmentAxis:b}),M?Wxe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?Vxe():void 0,...ee}):void 0,H?swe({element:H,padding:w}):void 0,M?zxe({...ee}):void 0,Swe({arrowWidth:V,arrowHeight:q}),T?Fxe({strategy:"referenceHidden"}):void 0].filter(vwe)});d1(()=>{le(I.anchor)},[le,I.anchor]);const it=Ce!==null&&be!==null,[pt,kt]=BW(we),gt=(i=Ve.arrow)===null||i===void 0?void 0:i.x,ht=(o=Ve.arrow)===null||o===void 0?void 0:o.y,vt=((a=Ve.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Te,ot]=C.exports.useState();d1(()=>{D&&ot(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:Je}=gwe(A4,h),mt=!Mt;C.exports.useLayoutEffect(()=>{if(!mt)return Je.add(Ze),()=>{Je.delete(Ze)}},[mt,Je,Ze]),C.exports.useLayoutEffect(()=>{mt&&it&&Array.from(Je).reverse().forEach(Et=>requestAnimationFrame(Et))},[mt,it,Je]);const un={"data-side":pt,"data-align":kt,...O,ref:$,style:{...O.style,animation:it?void 0:"none",opacity:(s=Ve.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return C.exports.createElement("div",{ref:me,"data-radix-popper-content-wrapper":"",style:{position:Me,left:0,top:0,transform:it?`translate3d(${Math.round(Ce)}px, ${Math.round(be)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Te,["--radix-popper-transform-origin"]:[(l=Ve.transformOrigin)===null||l===void 0?void 0:l.x,(u=Ve.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},C.exports.createElement(hwe,{scope:h,placedSide:pt,onArrowChange:j,arrowX:gt,arrowY:ht,shouldHideArrow:vt},mt?C.exports.createElement(pwe,{scope:h,hasParent:!0,positionUpdateFns:Je},C.exports.createElement(Iu.div,un)):C.exports.createElement(Iu.div,un)))});function vwe(e){return e!==void 0}function ywe(e){return e!==null}const Swe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,g=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=g?0:e.arrowWidth,v=g?0:e.arrowHeight,[b,w]=BW(s),P={start:"0%",center:"50%",end:"100%"}[w],E=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",M="";return b==="bottom"?(T=g?P:`${E}px`,M=`${-v}px`):b==="top"?(T=g?P:`${E}px`,M=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,M=g?P:`${_}px`):b==="left"&&(T=`${l.floating.width+v}px`,M=g?P:`${_}px`),{data:{x:T,y:M}}}});function BW(e){const[t,n="center"]=e.split("-");return[t,n]}const bwe=cwe,xwe=fwe,wwe=mwe;function Cwe(e,t){return C.exports.useReducer((n,r)=>{const i=t[n][r];return i!=null?i:n},e)}const zW=e=>{const{present:t,children:n}=e,r=_we(t),i=typeof n=="function"?n({present:r.isPresent}):C.exports.Children.only(n),o=Xa(r.ref,i.ref);return typeof n=="function"||r.isPresent?C.exports.cloneElement(i,{ref:o}):null};zW.displayName="Presence";function _we(e){const[t,n]=C.exports.useState(),r=C.exports.useRef({}),i=C.exports.useRef(e),o=C.exports.useRef("none"),a=e?"mounted":"unmounted",[s,l]=Cwe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.exports.useEffect(()=>{const u=d3(r.current);o.current=s==="mounted"?u:"none"},[s]),d1(()=>{const u=r.current,h=i.current;if(h!==e){const m=o.current,v=d3(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(h&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),d1(()=>{if(t){const u=g=>{const v=d3(r.current).includes(g.animationName);g.target===t&&v&&Wl.exports.flushSync(()=>l("ANIMATION_END"))},h=g=>{g.target===t&&(o.current=d3(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:C.exports.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function d3(e){return(e==null?void 0:e.animationName)||"none"}function kwe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Ewe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Fl(n),l=C.exports.useCallback(u=>{if(o){const g=typeof u=="function"?u(e):u;g!==e&&s(g)}else i(u)},[o,e,i,s]);return[a,l]}function Ewe({defaultProp:e,onChange:t}){const n=C.exports.useState(e),[r]=n,i=C.exports.useRef(r),o=Fl(t);return C.exports.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const qw="rovingFocusGroup.onEntryFocus",Pwe={bubbles:!1,cancelable:!0},Mk="RovingFocusGroup",[P7,FW,Twe]=xW(Mk),[Lwe,$W]=_2(Mk,[Twe]),[Awe,Mwe]=Lwe(Mk),Rwe=C.exports.forwardRef((e,t)=>C.exports.createElement(P7.Provider,{scope:e.__scopeRovingFocusGroup},C.exports.createElement(P7.Slot,{scope:e.__scopeRovingFocusGroup},C.exports.createElement(Owe,On({},e,{ref:t}))))),Owe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...h}=e,g=C.exports.useRef(null),m=Xa(t,g),v=wW(o),[b=null,w]=kwe({prop:a,defaultProp:s,onChange:l}),[P,E]=C.exports.useState(!1),_=Fl(u),T=FW(n),M=C.exports.useRef(!1),[O,I]=C.exports.useState(0);return C.exports.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(qw,_),()=>D.removeEventListener(qw,_)},[_]),C.exports.createElement(Awe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:C.exports.useCallback(D=>w(D),[w]),onItemShiftTab:C.exports.useCallback(()=>E(!0),[]),onFocusableItemAdd:C.exports.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:C.exports.useCallback(()=>I(D=>D-1),[])},C.exports.createElement(Iu.div,On({tabIndex:P||O===0?-1:0,"data-orientation":r},h,{ref:m,style:{outline:"none",...e.style},onMouseDown:Xn(e.onMouseDown,()=>{M.current=!0}),onFocus:Xn(e.onFocus,D=>{const B=!M.current;if(D.target===D.currentTarget&&B&&!P){const $=new CustomEvent(qw,Pwe);if(D.currentTarget.dispatchEvent($),!$.defaultPrevented){const H=T().filter(te=>te.focusable),j=H.find(te=>te.active),ne=H.find(te=>te.id===b),q=[j,ne,...H].filter(Boolean).map(te=>te.ref.current);HW(q)}}M.current=!1}),onBlur:Xn(e.onBlur,()=>E(!1))})))}),Iwe="RovingFocusGroupItem",Dwe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=Txe(),s=Mwe(Iwe,n),l=s.currentTabStopId===a,u=FW(n),{onFocusableItemAdd:h,onFocusableItemRemove:g}=s;return C.exports.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),C.exports.createElement(P7.ItemSlot,{scope:n,id:a,focusable:r,active:i},C.exports.createElement(Iu.span,On({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:Xn(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:Xn(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:Xn(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=zwe(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let w=u().filter(P=>P.focusable).map(P=>P.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const P=w.indexOf(m.currentTarget);w=s.loop?Fwe(w,P+1):w.slice(P+1)}setTimeout(()=>HW(w))}})})))}),Nwe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bwe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function zwe(e,t,n){const r=Bwe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Nwe[r]}function HW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Fwe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const $we=Rwe,Hwe=Dwe,Wwe=["Enter"," "],Vwe=["ArrowDown","PageUp","Home"],WW=["ArrowUp","PageDown","End"],Uwe=[...Vwe,...WW],bb="Menu",[T7,Gwe,jwe]=xW(bb),[Mh,VW]=_2(bb,[jwe,DW,$W]),Rk=DW(),UW=$W(),[Ywe,xb]=Mh(bb),[qwe,Ok]=Mh(bb),Kwe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=Rk(t),[l,u]=C.exports.useState(null),h=C.exports.useRef(!1),g=Fl(o),m=wW(i);return C.exports.useEffect(()=>{const v=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),C.exports.createElement(bwe,s,C.exports.createElement(Ywe,{scope:t,open:n,onOpenChange:g,content:l,onContentChange:u},C.exports.createElement(qwe,{scope:t,onClose:C.exports.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:h,dir:m,modal:a},r)))},Xwe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rk(n);return C.exports.createElement(xwe,On({},i,r,{ref:t}))}),Zwe="MenuPortal",[zLe,Qwe]=Mh(Zwe,{forceMount:void 0}),pd="MenuContent",[Jwe,GW]=Mh(pd),e6e=C.exports.forwardRef((e,t)=>{const n=Qwe(pd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=xb(pd,e.__scopeMenu),a=Ok(pd,e.__scopeMenu);return C.exports.createElement(T7.Provider,{scope:e.__scopeMenu},C.exports.createElement(zW,{present:r||o.open},C.exports.createElement(T7.Slot,{scope:e.__scopeMenu},a.modal?C.exports.createElement(t6e,On({},i,{ref:t})):C.exports.createElement(n6e,On({},i,{ref:t})))))}),t6e=C.exports.forwardRef((e,t)=>{const n=xb(pd,e.__scopeMenu),r=C.exports.useRef(null),i=Xa(t,r);return C.exports.useEffect(()=>{const o=r.current;if(o)return aF(o)},[]),C.exports.createElement(jW,On({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Xn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),n6e=C.exports.forwardRef((e,t)=>{const n=xb(pd,e.__scopeMenu);return C.exports.createElement(jW,On({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),jW=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:g,onDismiss:m,disableOutsideScroll:v,...b}=e,w=xb(pd,n),P=Ok(pd,n),E=Rk(n),_=UW(n),T=Gwe(n),[M,O]=C.exports.useState(null),I=C.exports.useRef(null),D=Xa(t,I,w.onContentChange),B=C.exports.useRef(0),$=C.exports.useRef(""),H=C.exports.useRef(0),j=C.exports.useRef(null),ne=C.exports.useRef("right"),V=C.exports.useRef(0),q=v?jF:C.exports.Fragment,te=v?{as:Xv,allowPinchZoom:!0}:void 0,J=G=>{var ee,le;const me=$.current+G,Me=T().filter(it=>!it.disabled),Ce=document.activeElement,be=(ee=Me.find(it=>it.ref.current===Ce))===null||ee===void 0?void 0:ee.textValue,we=Me.map(it=>it.textValue),Ve=d6e(we,me,be),Ze=(le=Me.find(it=>it.textValue===Ve))===null||le===void 0?void 0:le.ref.current;(function it(pt){$.current=pt,window.clearTimeout(B.current),pt!==""&&(B.current=window.setTimeout(()=>it(""),1e3))})(me),Ze&&setTimeout(()=>Ze.focus())};C.exports.useEffect(()=>()=>window.clearTimeout(B.current),[]),yxe();const Z=C.exports.useCallback(G=>{var ee,le;return ne.current===((ee=j.current)===null||ee===void 0?void 0:ee.side)&&h6e(G,(le=j.current)===null||le===void 0?void 0:le.area)},[]);return C.exports.createElement(Jwe,{scope:n,searchRef:$,onItemEnter:C.exports.useCallback(G=>{Z(G)&&G.preventDefault()},[Z]),onItemLeave:C.exports.useCallback(G=>{var ee;Z(G)||((ee=I.current)===null||ee===void 0||ee.focus(),O(null))},[Z]),onTriggerLeave:C.exports.useCallback(G=>{Z(G)&&G.preventDefault()},[Z]),pointerGraceTimerRef:H,onPointerGraceIntentChange:C.exports.useCallback(G=>{j.current=G},[])},C.exports.createElement(q,te,C.exports.createElement(Sxe,{asChild:!0,trapped:i,onMountAutoFocus:Xn(o,G=>{var ee;G.preventDefault(),(ee=I.current)===null||ee===void 0||ee.focus()}),onUnmountAutoFocus:a},C.exports.createElement(gxe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:g,onDismiss:m},C.exports.createElement($we,On({asChild:!0},_,{dir:P.dir,orientation:"vertical",loop:r,currentTabStopId:M,onCurrentTabStopIdChange:O,onEntryFocus:G=>{P.isUsingKeyboardRef.current||G.preventDefault()}}),C.exports.createElement(wwe,On({role:"menu","aria-orientation":"vertical","data-state":l6e(w.open),"data-radix-menu-content":"",dir:P.dir},E,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:Xn(b.onKeyDown,G=>{const le=G.target.closest("[data-radix-menu-content]")===G.currentTarget,me=G.ctrlKey||G.altKey||G.metaKey,Me=G.key.length===1;le&&(G.key==="Tab"&&G.preventDefault(),!me&&Me&&J(G.key));const Ce=I.current;if(G.target!==Ce||!Uwe.includes(G.key))return;G.preventDefault();const we=T().filter(Ve=>!Ve.disabled).map(Ve=>Ve.ref.current);WW.includes(G.key)&&we.reverse(),u6e(we)}),onBlur:Xn(e.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(B.current),$.current="")}),onPointerMove:Xn(e.onPointerMove,A7(G=>{const ee=G.target,le=V.current!==G.clientX;if(G.currentTarget.contains(ee)&&le){const me=G.clientX>V.current?"right":"left";ne.current=me,V.current=G.clientX}}))})))))))}),L7="MenuItem",qM="menu.itemSelect",r6e=C.exports.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=C.exports.useRef(null),a=Ok(L7,e.__scopeMenu),s=GW(L7,e.__scopeMenu),l=Xa(t,o),u=C.exports.useRef(!1),h=()=>{const g=o.current;if(!n&&g){const m=new CustomEvent(qM,{bubbles:!0,cancelable:!0});g.addEventListener(qM,v=>r==null?void 0:r(v),{once:!0}),bW(g,m),m.defaultPrevented?u.current=!1:a.onClose()}};return C.exports.createElement(i6e,On({},i,{ref:l,disabled:n,onClick:Xn(e.onClick,h),onPointerDown:g=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,g),u.current=!0},onPointerUp:Xn(e.onPointerUp,g=>{var m;u.current||(m=g.currentTarget)===null||m===void 0||m.click()}),onKeyDown:Xn(e.onKeyDown,g=>{const m=s.searchRef.current!=="";n||m&&g.key===" "||Wwe.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})}))}),i6e=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=GW(L7,n),s=UW(n),l=C.exports.useRef(null),u=Xa(t,l),[h,g]=C.exports.useState(!1),[m,v]=C.exports.useState("");return C.exports.useEffect(()=>{const b=l.current;if(b){var w;v(((w=b.textContent)!==null&&w!==void 0?w:"").trim())}},[o.children]),C.exports.createElement(T7.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:m},C.exports.createElement(Hwe,On({asChild:!0},s,{focusable:!r}),C.exports.createElement(Iu.div,On({role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:Xn(e.onPointerMove,A7(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:Xn(e.onPointerLeave,A7(b=>a.onItemLeave(b))),onFocus:Xn(e.onFocus,()=>g(!0)),onBlur:Xn(e.onBlur,()=>g(!1))}))))}),o6e="MenuRadioGroup";Mh(o6e,{value:void 0,onValueChange:()=>{}});const a6e="MenuItemIndicator";Mh(a6e,{checked:!1});const s6e="MenuSub";Mh(s6e);function l6e(e){return e?"open":"closed"}function u6e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function c6e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function d6e(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=c6e(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function f6e(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=h>r&&n<(u-s)*(r-l)/(h-l)+s&&(i=!i)}return i}function h6e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return f6e(n,t)}function A7(e){return t=>t.pointerType==="mouse"?e(t):void 0}const p6e=Kwe,g6e=Xwe,m6e=e6e,v6e=r6e,YW="ContextMenu",[y6e,FLe]=_2(YW,[VW]),wb=VW(),[S6e,qW]=y6e(YW),b6e=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=C.exports.useState(!1),l=wb(t),u=Fl(r),h=C.exports.useCallback(g=>{s(g),u(g)},[u]);return C.exports.createElement(S6e,{scope:t,open:a,onOpenChange:h,modal:o},C.exports.createElement(p6e,On({},l,{dir:i,open:a,onOpenChange:h,modal:o}),n))},x6e="ContextMenuTrigger",w6e=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=qW(x6e,n),o=wb(n),a=C.exports.useRef({x:0,y:0}),s=C.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=C.exports.useRef(0),u=C.exports.useCallback(()=>window.clearTimeout(l.current),[]),h=g=>{a.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return C.exports.useEffect(()=>u,[u]),C.exports.createElement(C.exports.Fragment,null,C.exports.createElement(g6e,On({},o,{virtualRef:s})),C.exports.createElement(Iu.span,On({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:Xn(e.onContextMenu,g=>{u(),h(g),g.preventDefault()}),onPointerDown:Xn(e.onPointerDown,f3(g=>{u(),l.current=window.setTimeout(()=>h(g),700)})),onPointerMove:Xn(e.onPointerMove,f3(u)),onPointerCancel:Xn(e.onPointerCancel,f3(u)),onPointerUp:Xn(e.onPointerUp,f3(u))})))}),C6e="ContextMenuContent",_6e=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=qW(C6e,n),o=wb(n),a=C.exports.useRef(!1);return C.exports.createElement(m6e,On({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),k6e=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=wb(n);return C.exports.createElement(v6e,On({},i,r,{ref:t}))});function f3(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const E6e=b6e,P6e=w6e,T6e=_6e,Bc=k6e,L6e=rt([e=>e.gallery,e=>e.options,vr,Tr],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:h,galleryImageObjectFit:g,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:w}=e,{isLightBoxOpen:P}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:h,galleryImageObjectFit:g,galleryGridTemplateColumns:w?"auto":`repeat(auto-fill, minmax(${h}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightBoxOpen:P,isStaging:n,shouldEnableResize:!(P||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:w}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),A6e=rt([e=>e.options,e=>e.gallery,e=>e.system,Tr],(e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),M6e=e=>e.gallery,R6e=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,O6e=C.exports.memo(e=>{var ne,V,q,te,J,Z,G,ee;const t=De(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,isLightBoxOpen:a,shouldUseSingleGalleryColumn:s}=ye(A6e),{image:l,isSelected:u}=e,{url:h,thumbnail:g,uuid:m,metadata:v}=l,[b,w]=C.exports.useState(!1),P=x2(),E=()=>w(!0),_=()=>w(!1),T=()=>{l.metadata&&t(Ob(l.metadata.image.prompt)),P({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})},M=()=>{l.metadata&&t(T2(l.metadata.image.seed)),P({title:"Seed Set",status:"success",duration:2500,isClosable:!0})},O=()=>{a&&t(_u(!1)),t(O1(l)),n!=="img2img"&&t(Lo("img2img")),P({title:"Sent to Image To Image",status:"success",duration:2500,isClosable:!0})},I=()=>{a&&t(_u(!1)),t(mb(l)),t(gb()),n!=="unifiedCanvas"&&t(Lo("unifiedCanvas")),P({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0})},D=()=>{v&&t(AEe(v)),P({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})},B=async()=>{var le;if((le=v==null?void 0:v.image)!=null&&le.init_image_path&&(await fetch(v.image.init_image_path)).ok){t(Lo("img2img")),t(TEe(v)),P({title:"Initial Image Set",status:"success",duration:2500,isClosable:!0});return}P({title:"Initial Image Not Set",description:"Could not load initial image.",status:"error",duration:2500,isClosable:!0})},$=()=>t(EM(l)),H=le=>{le.dataTransfer.setData("invokeai/imageUuid",m),le.dataTransfer.effectAllowed="move"},j=()=>{t(_u(!0)),t(EM(l))};return X(E6e,{onOpenChange:le=>{t(hW(le))},children:[S(P6e,{children:X(Ld,{position:"relative",className:"hoverable-image",onMouseOver:E,onMouseOut:_,userSelect:"none",draggable:!0,onDragStart:H,children:[S(DS,{className:"hoverable-image-image",objectFit:s?"contain":r,rounded:"md",src:g||h,loading:"lazy"}),S("div",{className:"hoverable-image-content",onClick:$,children:u&&S(wa,{width:"50%",height:"50%",as:dk,className:"hoverable-image-check"})}),b&&i>=64&&S("div",{className:"hoverable-image-delete-button",children:S(bi,{label:"Delete image",hasArrow:!0,children:S(b7,{image:l,children:S(Ya,{"aria-label":"Delete image",icon:S(LSe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})})]},m)}),X(T6e,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:le=>{le.detail.originalEvent.preventDefault()},children:[S(Bc,{onClickCapture:j,children:"Open In Viewer"}),S(Bc,{onClickCapture:T,disabled:((V=(ne=l==null?void 0:l.metadata)==null?void 0:ne.image)==null?void 0:V.prompt)===void 0,children:"Use Prompt"}),S(Bc,{onClickCapture:M,disabled:((te=(q=l==null?void 0:l.metadata)==null?void 0:q.image)==null?void 0:te.seed)===void 0,children:"Use Seed"}),S(Bc,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(J=l==null?void 0:l.metadata)==null?void 0:J.image)==null?void 0:Z.type),children:"Use All Parameters"}),S(bi,{label:"Load initial image used for this generation",children:S(Bc,{onClickCapture:B,disabled:((ee=(G=l==null?void 0:l.metadata)==null?void 0:G.image)==null?void 0:ee.type)!=="img2img",children:"Use Initial Image"})}),S(Bc,{onClickCapture:O,children:"Send to Image To Image"}),S(Bc,{onClickCapture:I,children:"Send to Unified Canvas"}),S(b7,{image:l,children:S(Bc,{"data-warning":!0,children:"Delete Image"})})]})]})},R6e),fr=e=>{const{label:t,styleClass:n,...r}=e;return S(gz,{className:`invokeai__checkbox ${n}`,...r,children:t})},h3=320,KM=40,I6e={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500}},XM=400;function KW(){const e=De(),{images:t,currentCategory:n,currentImageUuid:r,shouldPinGallery:i,shouldShowGallery:o,galleryScrollPosition:a,galleryImageMinimumWidth:s,galleryGridTemplateColumns:l,activeTabName:u,galleryImageObjectFit:h,shouldHoldGalleryOpen:g,shouldAutoSwitchToNewImages:m,areMoreImagesAvailable:v,galleryWidth:b,isLightBoxOpen:w,isStaging:P,shouldEnableResize:E,shouldUseSingleGalleryColumn:_}=ye(L6e),{galleryMinWidth:T,galleryMaxWidth:M}=w?{galleryMinWidth:XM,galleryMaxWidth:XM}:I6e[u],[O,I]=C.exports.useState(b>=h3),[D,B]=C.exports.useState(!1),[$,H]=C.exports.useState(0),j=C.exports.useRef(null),ne=C.exports.useRef(null),V=C.exports.useRef(null);C.exports.useEffect(()=>{b>=h3&&I(!1)},[b]);const q=()=>{e(Dbe(!i)),e(ai(!0))},te=()=>{o?Z():J()},J=()=>{e(hd(!0)),i&&e(ai(!0))},Z=C.exports.useCallback(()=>{e(hd(!1)),e(hW(!1)),e(Nbe(ne.current?ne.current.scrollTop:0)),setTimeout(()=>i&&e(ai(!0)),400)},[e,i]),G=()=>{e(v7(n))},ee=Ce=>{e(om(Ce))},le=()=>{g||(V.current=window.setTimeout(()=>Z(),500))},me=()=>{V.current&&window.clearTimeout(V.current)};Ue("g",()=>{te()},[o,i]),Ue("left",()=>{e(Pk())},{enabled:!P||u!=="unifiedCanvas"},[P]),Ue("right",()=>{e(Ek())},{enabled:!P||u!=="unifiedCanvas"},[P]),Ue("shift+g",()=>{q()},[i]),Ue("esc",()=>{e(hd(!1))},{enabled:()=>!i,preventDefault:!0},[i]);const Me=32;return Ue("shift+up",()=>{if(s<256){const Ce=He.clamp(s+Me,32,256);e(om(Ce))}},[s]),Ue("shift+down",()=>{if(s>32){const Ce=He.clamp(s-Me,32,256);e(om(Ce))}},[s]),C.exports.useEffect(()=>{!ne.current||(ne.current.scrollTop=a)},[a,o]),C.exports.useEffect(()=>{function Ce(be){!i&&j.current&&!j.current.contains(be.target)&&Z()}return document.addEventListener("mousedown",Ce),()=>{document.removeEventListener("mousedown",Ce)}},[Z,i]),S(GH,{nodeRef:j,in:o||g,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:X("div",{className:"image-gallery-wrapper",style:{zIndex:i?1:100},"data-pinned":i,ref:j,onMouseLeave:i?void 0:le,onMouseEnter:i?void 0:me,onMouseOver:i?void 0:me,children:[X(yW,{minWidth:T,maxWidth:i?M:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:E},size:{width:b,height:i?"100%":"100vh"},onResizeStart:(Ce,be,we)=>{H(we.clientHeight),we.style.height=`${we.clientHeight}px`,i&&(we.style.position="fixed",we.style.right="1rem",B(!0))},onResizeStop:(Ce,be,we,Ve)=>{const Ze=i?He.clamp(Number(b)+Ve.width,T,Number(M)):Number(b)+Ve.width;e(Fbe(Ze)),we.removeAttribute("data-resize-alert"),i&&(we.style.position="relative",we.style.removeProperty("right"),we.style.setProperty("height",i?"100%":"100vh"),B(!1),e(ai(!0)))},onResize:(Ce,be,we,Ve)=>{const Ze=He.clamp(Number(b)+Ve.width,T,Number(i?M:.95*window.innerWidth));Ze>=h3&&!O?I(!0):ZeZe-KM&&e(om(Ze-KM)),i&&(Ze>=M?we.setAttribute("data-resize-alert","true"):we.removeAttribute("data-resize-alert")),we.style.height=`${$}px`},children:[X("div",{className:"image-gallery-header",children:[S(ji,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:O?X(Rn,{children:[S(Ro,{size:"sm","data-selected":n==="result",onClick:()=>e(a3("result")),children:"Generations"}),S(Ro,{size:"sm","data-selected":n==="user",onClick:()=>e(a3("user")),children:"Uploads"})]}):X(Rn,{children:[S(Xe,{"aria-label":"Show Generations",tooltip:"Show Generations","data-selected":n==="result",icon:S(ySe,{}),onClick:()=>e(a3("result"))}),S(Xe,{"aria-label":"Show Uploads",tooltip:"Show Uploads","data-selected":n==="user",icon:S(MSe,{}),onClick:()=>e(a3("user"))})]})}),X("div",{className:"image-gallery-header-right-icons",children:[S(Il,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:S(Xe,{size:"sm","aria-label":"Gallery Settings",icon:S(pb,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:X("div",{className:"image-gallery-settings-popover",children:[X("div",{children:[S(Do,{value:s,onChange:ee,min:32,max:256,hideTooltip:!0,label:"Image Size"}),S(Xe,{size:"sm","aria-label":"Reset",tooltip:"Reset Size",onClick:()=>e(om(64)),icon:S(nk,{}),"data-selected":i,styleClass:"image-gallery-icon-btn"})]}),S("div",{children:S(fr,{label:"Maintain Aspect Ratio",isChecked:h==="contain",onChange:()=>e(Bbe(h==="contain"?"cover":"contain"))})}),S("div",{children:S(fr,{label:"Auto-Switch to New Images",isChecked:m,onChange:Ce=>e(zbe(Ce.target.checked))})}),S("div",{children:S(fr,{label:"Single Column Layout",isChecked:_,onChange:Ce=>e($be(Ce.target.checked))})})]})}),S(Xe,{size:"sm",className:"image-gallery-icon-btn","aria-label":"Pin Gallery",tooltip:"Pin Gallery (Shift+G)",onClick:q,icon:i?S(HH,{}):S(WH,{})})]})]}),S("div",{className:"image-gallery-container",ref:ne,children:t.length||v?X(Rn,{children:[S("div",{className:"image-gallery",style:{gridTemplateColumns:l},children:t.map(Ce=>{const{uuid:be}=Ce;return S(O6e,{image:Ce,isSelected:r===be},be)})}),S(ja,{onClick:G,isDisabled:!v,className:"image-gallery-load-more-btn",children:v?"Load More":"All Images Loaded"})]}):X("div",{className:"image-gallery-container-placeholder",children:[S(EH,{}),S("p",{children:"No Images In Gallery"})]})})]}),D&&S("div",{style:{width:b+"px",height:"100%"}})]})})}const D6e=rt(M6e,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),N6e=()=>{const{resultImages:e,userImages:t}=ye(D6e);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},B6e=rt([e=>e.options,Tr],(e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),Ik=e=>{const t=De(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=ye(B6e),u=N6e(),h=()=>{t(HEe(!a)),t(ai(!0))},g=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);!b||(o==="img2img"?t(O1(b)):o==="unifiedCanvas"&&t(mb(b)))};return S("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:X("div",{className:"workarea-main",children:[n,X("div",{className:"workarea-children-wrapper",onDrop:g,children:[r,l&&S(bi,{label:"Toggle Split View",children:S("div",{className:"workarea-split-button","data-selected":a,onClick:h,children:S(Kbe,{})})})]}),!s&&S(KW,{})]})})};function z6e(){return S(Ik,{optionsPanel:S(Tbe,{}),children:S(qbe,{})})}function F6e(){const e={seed:{header:"Seed",feature:Yi.SEED,content:S(rk,{})},variations:{header:"Variations",feature:Yi.VARIATIONS,content:S(ak,{}),additionalHeaderComponents:S(ok,{})},face_restore:{header:"Face Restoration",feature:Yi.FACE_CORRECTION,content:S(tk,{}),additionalHeaderComponents:S(mH,{})},upscale:{header:"Upscaling",feature:Yi.UPSCALE,content:S(ik,{}),additionalHeaderComponents:S(wH,{})},other:{header:"Other Options",feature:Yi.OTHER,content:S(bH,{})}};return X(_k,{children:[S(bk,{}),S(Sk,{}),S(uk,{}),S(ck,{accordionInfo:e})]})}const $6e=()=>S("div",{className:"workarea-single-view",children:S("div",{className:"text-to-image-area",children:S(vW,{})})});function H6e(){return S(Ik,{optionsPanel:S(F6e,{}),children:S($6e,{})})}var M7=function(e,t){return M7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},M7(e,t)};function W6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");M7(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Dl=function(){return Dl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Id(e,t,n,r){var i=iCe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,h=t.scale-s,g=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):QW(e,r,n,function(v){var b=s+h*v,w=l+g*v,P=u+m*v;o(b,w,P)})}}function iCe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function oCe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,h=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:h}}var aCe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,h=s,g=r-i-l,m=l;return{minPositionX:u,maxPositionX:h,minPositionY:g,maxPositionY:m}},Dk=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=oCe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,h=o.newContentHeight,g=o.newDiffHeight,m=aCe(a,l,u,s,h,g,Boolean(i));return m},f1=function(e,t){var n=Dk(e,t);return e.bounds=n,n};function Cb(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,h=n.maxPositionY,g=0,m=0;a&&(g=i,m=o);var v=R7(e,s-g,u+g,r),b=R7(t,l-m,h+m,r);return{x:v,y:b}}var R7=function(e,t,n,r){return r?en?Ha(n,2):Ha(e,2):Ha(e,2)};function _b(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,h=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var g=l-t*h,m=u-n*h,v=Cb(g,m,i,o,0,0,null);return v}function E2(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var QM=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=kb(o,n);return!l},JM=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},sCe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},lCe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function uCe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var h=e.bounds,g=h.maxPositionX,m=h.minPositionX,v=h.maxPositionY,b=h.minPositionY,w=n>g||nv||rg?u.offsetWidth:e.setup.minPositionX||0,_=r>v?u.offsetHeight:e.setup.minPositionY||0,T=_b(e,E,_,i,e.bounds,s||l),M=T.x,O=T.y;return{scale:i,positionX:w?M:n,positionY:P?O:r}}}function cCe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,h=l.positionX,g=l.positionY,m=t!==h,v=n!==g,b=!m||!v;if(!(!a||b||!s)){var w=Cb(t,n,s,o,r,i,a),P=w.x,E=w.y;e.setTransformState(u,P,E)}}var dCe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var h=t-r.x,g=n-r.y,m=a?l:h,v=s?u:g;return{x:m,y:v}},M4=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},fCe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},hCe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function pCe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function eR(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var h=a+(e-a)*u;return h>l?l:ho?o:h}}return r?t:R7(e,o,a,i)}function gCe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function mCe(e,t){var n=fCe(e);if(!!n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=gCe(a,s),h=t.x-r.x,g=t.y-r.y,m=h/u,v=g/u,b=l-i,w=h*h+g*g,P=Math.sqrt(w)/b;e.velocity={velocityX:m,velocityY:v,total:P}}e.lastMousePosition=t,e.velocityTime=l}}function vCe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=hCe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,h=n.minPositionX,g=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,w=r.zoomAnimation,P=r.panning,E=P.lockAxisY,_=P.lockAxisX,T=w.animationType,M=b.sizeX,O=b.sizeY,I=b.velocityAlignmentTime,D=I,B=pCe(e,l),$=Math.max(B,D),H=M4(e,M),j=M4(e,O),ne=H*i.offsetWidth/100,V=j*i.offsetHeight/100,q=u+ne,te=h-ne,J=g+V,Z=m-V,G=e.transformState,ee=new Date().getTime();QW(e,T,$,function(le){var me=e.transformState,Me=me.scale,Ce=me.positionX,be=me.positionY,we=new Date().getTime()-ee,Ve=we/D,Ze=XW[b.animationType],it=1-Ze(Math.min(1,Ve)),pt=1-le,kt=Ce+a*pt,gt=be+s*pt,ht=eR(kt,G.positionX,Ce,_,v,h,u,te,q,it),vt=eR(gt,G.positionY,be,E,v,m,g,Z,J,it);(Ce!==kt||be!==gt)&&e.setTransformState(Me,ht,vt)})}}function tR(e,t){var n=e.transformState.scale;wl(e),f1(e,n),t.touches?lCe(e,t):sCe(e,t)}function nR(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(!!r){var l=dCe(e,t,n),u=l.x,h=l.y,g=M4(e,a),m=M4(e,s);mCe(e,{x:u,y:h}),cCe(e,u,h,g,m)}}function yCe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,h=(a==null?void 0:a.height)||0,g=s.1&&g;m?vCe(e):JW(e)}}function JW(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,h=o||t=a;if((r>=1||s)&&JW(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,w=Nk(e,a,v,b);w&&Id(e,w,h,g)}}function Nk(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=E2(Ha(t,2),o,a,0,!1),u=f1(e,l),h=_b(e,n,r,l,u,s),g=h.x,m=h.y;return{scale:l,positionX:g,positionY:m}}var g0={previousScale:1,scale:1,positionX:0,positionY:0},SCe=Dl(Dl({},g0),{setComponents:function(){},contextInstance:null}),am={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},tV=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:g0.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:g0.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:g0.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:g0.positionY}},rR=function(e){var t=Dl({},am);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof am[n]<"u";if(i&&r){var o=Object.prototype.toString.call(am[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=Dl(Dl({},am[n]),e[n]):s?t[n]=ZM(ZM([],am[n]),e[n]):t[n]=e[n]}}),t},nV=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var h=r*Math.exp(t*n),g=E2(Ha(h,3),s,a,u,!1);return g};function rV(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var h=o.offsetWidth,g=o.offsetHeight,m=(h/2-l)/s,v=(g/2-u)/s,b=nV(e,t,n),w=Nk(e,b,m,v);if(!w)return console.error("Error during zoom event. New transformation state was not calculated.");Id(e,w,r,i)}function iV(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=tV(e.props),s=e.transformState,l=s.scale,u=s.positionX,h=s.positionY;if(!!i){var g=Dk(e,a.scale),m=Cb(a.positionX,a.positionY,g,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&h===a.positionY||Id(e,v,t,n)}}function bCe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return g0;var l=r.getBoundingClientRect(),u=xCe(t),h=u.x,g=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,w=r.offsetHeight/v,P=E2(n||Math.min(b,w),a,s,0,!1),E=(l.width-m*P)/2,_=(l.height-v*P)/2,T=(l.left-h)*P+E,M=(l.top-g)*P+_,O=Dk(e,P),I=Cb(T,M,O,o,0,0,r),D=I.x,B=I.y;return{positionX:D,positionY:B,scale:P}}function xCe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function wCe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var CCe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),rV(e,1,t,n,r)}},_Ce=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),rV(e,-1,t,n,r)}},kCe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,h=e.wrapperComponent,g=e.contentComponent,m=e.setup.disabled;if(!(m||!h||!g)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Id(e,v,i,o)}}},ECe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),iV(e,t,n)}},PCe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=oV(t||i.scale,o,a);Id(e,s,n,r)}}},TCe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),wl(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&wCe(a)&&a&&o.contains(a)){var s=bCe(e,a,n);Id(e,s,r,i)}}},Gr=function(e){return{instance:e,state:e.transformState,zoomIn:CCe(e),zoomOut:_Ce(e),setTransform:kCe(e),resetTransform:ECe(e),centerView:PCe(e),zoomToElement:TCe(e)}},Kw=!1;function Xw(){try{var e={get passive(){return Kw=!0,!1}};return e}catch(t){return Kw=!1,Kw}}var kb=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},iR=function(e){e&&clearTimeout(e)},LCe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},oV=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},ACe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,h=s&&!l&&!r&&u;if(!h||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var g=kb(u,a);return!g};function MCe(e,t){var n=e?e.deltaY<0?1:-1:0,r=V6e(t,n);return r}function aV(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var RCe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,h=s.zoomAnimation,g=h.size,m=h.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,w=E2(Ha(v,3),u,l,g,b);return w},OCe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},ICe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=kb(a,i);return!l},DCe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},NCe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=Ha(i[0].clientX-r.left,5),a=Ha(i[0].clientY-r.top,5),s=Ha(i[1].clientX-r.left,5),l=Ha(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},sV=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},BCe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var h=t/r,g=h*n;return E2(Ha(g,2),a,o,l,!u)},zCe=160,FCe=100,$Ce=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(wl(e),vi(Gr(e),t,r),vi(Gr(e),t,i))},HCe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,h=a.centerZoomedOut,g=a.zoomAnimation,m=a.wheel,v=g.size,b=g.disabled,w=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var P=MCe(t,null),E=RCe(e,P,w,!t.ctrlKey);if(l!==E){var _=f1(e,E),T=aV(t,o,l),M=b||v===0||h,O=u&&M,I=_b(e,T.x,T.y,E,_,O),D=I.x,B=I.y;e.previousWheelEvent=t,e.setTransformState(E,D,B),vi(Gr(e),t,r),vi(Gr(e),t,i)}},WCe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;iR(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){!e.mounted||(eV(e,t.x,t.y),e.wheelAnimationTimer=null)},FCe);var o=OCe(e,t);o&&(iR(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){!e.mounted||(e.wheelStopEventTimer=null,vi(Gr(e),t,r),vi(Gr(e),t,i))},zCe))},VCe=function(e,t){var n=sV(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,wl(e)},UCe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,h=l.size;if(!(r===null||!n)){var g=NCe(t,i,n);if(!(!isFinite(g.x)||!isFinite(g.y))){var m=sV(t),v=BCe(e,m);if(v!==i){var b=f1(e,v),w=u||h===0||s,P=a&&w,E=_b(e,g.x,g.y,v,b,P),_=E.x,T=E.y;e.pinchMidpoint=g,e.lastDistance=m,e.setTransformState(v,_,T)}}}},GCe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,eV(e,t==null?void 0:t.x,t==null?void 0:t.y)};function jCe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return iV(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var h=i==="zoomOut"?-1:1,g=nV(e,h,o),m=aV(t,u,l),v=Nk(e,g,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");Id(e,v,a,s)}}var YCe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),h=n&&l&&u&&!a;if(!h)return!1;var g=kb(l,s);return!(g||!h)},lV=se.createContext(SCe),qCe=function(e){W6e(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=tV(n.props),n.setup=rR(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=Xw();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=ACe(n,r);if(!!o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);!a||($Ce(n,r),HCe(n,r),WCe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=QM(n,r);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),wl(n),tR(n,r),vi(Gr(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=JM(n);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),nR(n,r.clientX,r.clientY),vi(Gr(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(yCe(n),vi(Gr(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=ICe(n,r);!l||(VCe(n,r),wl(n),vi(Gr(n),r,a),vi(Gr(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=DCe(n);!l||(r.preventDefault(),r.stopPropagation(),UCe(n,r),vi(Gr(n),r,a),vi(Gr(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(GCe(n),vi(Gr(n),r,o),vi(Gr(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=QM(n,r);if(!!a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,wl(n);var l=r.touches,u=l.length===1,h=l.length===2;u&&(wl(n),tR(n,r),vi(Gr(n),r,o)),h&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=JM(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];nR(n,s.clientX,s.clientY),vi(Gr(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=YCe(n,r);!o||jCe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,f1(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,vi(Gr(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=oV(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=LCe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(Gr(n))},n}return t.prototype.componentDidMount=function(){var n=Xw();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=Xw();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),wl(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(f1(this,this.transformState.scale),this.setup=rR(this.props))},t.prototype.render=function(){var n=Gr(this),r=this.props.children,i=typeof r=="function"?r(n):r;return S(lV.Provider,{value:Dl(Dl({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:i})},t}(C.exports.Component),KCe=se.forwardRef(function(e,t){var n=C.exports.useState(null),r=n[0],i=n[1];return C.exports.useImperativeHandle(t,function(){return r},[r]),S(qCe,{...Dl({},e,{setRef:i})})});function XCe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var ZCe=`.transform-component-module_wrapper__1_Fgj { position: relative; width: -moz-fit-content; width: fit-content; @@ -615,7 +615,7 @@ For more info see: https://github.com/konvajs/react-konva/issues/194 -`.replaceAll("black",e),I_e=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ye(O_e),[a,s]=C.exports.useState(null),[l,u]=C.exports.useState(0),h=C.exports.useRef(null),g=C.exports.useCallback(()=>{u(l+1),setTimeout(g,500)},[l]);return C.exports.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=DR(n)},[a,n]),C.exports.useEffect(()=>{!a||(a.src=DR(n))},[a,n]),C.exports.useEffect(()=>{const m=setInterval(()=>u(v=>(v+1)%5),50);return()=>clearInterval(m)},[]),!a||!ii.exports.isNumber(r.x)||!ii.exports.isNumber(r.y)||!ii.exports.isNumber(o)||!ii.exports.isNumber(i.width)||!ii.exports.isNumber(i.height)?null:S(zu,{ref:h,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:ii.exports.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},D_e=rt([Qt],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),N_e=e=>{const t=De(),{isMoveStageKeyHeld:n,stageScale:r}=ye(D_e);return C.exports.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=He.clamp(r*ebe**s,tbe,nbe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(_be(l)),t(sW(u))},[e,n,r,t])},jk=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},ZV=()=>{const e=De(),t=Ds(),n=XV();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Zp.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(ybe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(sbe())}}},B_e=rt([Tr,Qt,vr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),z_e=e=>{const t=De(),{tool:n,isStaging:r}=ye(B_e),{commitColorUnderCursor:i}=ZV();return C.exports.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(w4(!0));return}if(n==="colorPicker"){i();return}const a=jk(e.current);!a||(o.evt.preventDefault(),t(QH(!0)),t(abe([a.x,a.y])))},[e,n,r,t,i])},F_e=rt([Tr,Qt,vr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),$_e=(e,t)=>{const n=De(),{tool:r,isDrawing:i,isStaging:o}=ye(F_e);return C.exports.useCallback(()=>{if(r==="move"||o){n(w4(!1));return}if(!t.current&&i&&e.current){const a=jk(e.current);if(!a)return;n(KH([a.x,a.y]))}else t.current=!1;n(QH(!1))},[t,n,i,o,e,r])},H_e=rt([Tr,Qt,vr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),W_e=(e,t,n)=>{const r=De(),{isDrawing:i,tool:o,isStaging:a}=ye(H_e),{updateColorUnderCursor:s}=ZV();return C.exports.useCallback(()=>{if(!e.current)return;const l=jk(e.current);if(!!l){if(r(Sbe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(KH([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},V_e=()=>{const e=De();return C.exports.useCallback(()=>{e(cbe())},[e])},U_e=rt([Qt,vr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),G_e=()=>{const e=De(),{tool:t,isStaging:n,isMovingBoundingBox:r}=ye(U_e);return{handleDragStart:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(w4(!0))},[e,r,n,t]),handleDragMove:C.exports.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(sW(o))},[e,r,n,t]),handleDragEnd:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(w4(!1))},[e,r,n,t])}};var Mf=C.exports,j_e=function(t,n,r){const i=Mf.useRef("loading"),o=Mf.useRef(),[a,s]=Mf.useState(0),l=Mf.useRef(),u=Mf.useRef(),h=Mf.useRef();return(l.current!==t||u.current!==n||h.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,h.current=r),Mf.useLayoutEffect(function(){if(!t)return;var g=document.createElement("img");function m(){i.current="loaded",o.current=g,s(Math.random())}function v(){i.current="failed",o.current=void 0,s(Math.random())}return g.addEventListener("load",m),g.addEventListener("error",v),n&&(g.crossOrigin=n),r&&(g.referrerpolicy=r),g.src=t,function(){g.removeEventListener("load",m),g.removeEventListener("error",v)}},[t,n,r]),[o.current,i.current]};const QV=e=>{const{url:t,x:n,y:r}=e,[i]=j_e(t);return S(YV,{x:n,y:r,image:i,listening:!1})},Y_e=rt([Qt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),q_e=()=>{const{objects:e}=ye(Y_e);return e?S(Bu,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(x4(t))return S(QV,{x:t.x,y:t.y,url:t.image.url},n);if(ISe(t)){const r=S(O4,{points:t.points,stroke:t.color?ch(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?S(Bu,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(DSe(t))return S(zu,{x:t.x,y:t.y,width:t.width,height:t.height,fill:ch(t.color)},n);if(NSe(t))return S(zu,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},K_e=rt([Qt],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),X_e={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},Z_e=()=>{const{colorMode:e}=i2(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=ye(K_e),[i,o]=C.exports.useState([]),a=C.exports.useCallback(s=>s/t,[t]);return C.exports.useLayoutEffect(()=>{const s=X_e[e],{width:l,height:u}=r,{x:h,y:g}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(h),y:a(g)}},v={x:Math.ceil(a(h)/64)*64,y:Math.ceil(a(g)/64)*64},b={x1:-v.x,y1:-v.y,x2:a(l)-v.x+64,y2:a(u)-v.y+64},P={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},E=P.x2-P.x1,_=P.y2-P.y1,T=Math.round(E/64)+1,M=Math.round(_/64)+1,O=He.range(0,T).map(D=>S(O4,{x:P.x1+D*64,y:P.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),I=He.range(0,M).map(D=>S(O4,{x:P.x1,y:P.y1+D*64,points:[0,0,E,0],stroke:s,strokeWidth:1},`y_${D}`));o(O.concat(I))},[t,n,r,e,a]),S(Bu,{children:i})},Q_e=rt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:He.isEqual}}),J_e=e=>{const{...t}=e,n=ye(Q_e),[r,i]=C.exports.useState(null);if(C.exports.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?S(YV,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},v0=e=>Math.round(e*100)/100,eke=rt([Qt],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${v0(n)}, ${v0(r)})`}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function tke(){const{cursorCoordinatesString:e}=ye(eke);return S("div",{children:`Cursor Position: ${e}`})}const nke=rt([Qt],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:h},stageScale:g,shouldShowCanvasDebugInfo:m,layer:v,boundingBoxScaleMethod:b}=e;let w="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(w="var(--status-working-color)"),{activeLayerColor:v==="mask"?"var(--status-working-color)":"inherit",activeLayerString:v.charAt(0).toUpperCase()+v.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${v0(u)}, ${v0(h)})`,boundingBoxDimensionsString:`${o}\xD7${a}`,scaledBoundingBoxDimensionsString:`${s}\xD7${l}`,canvasCoordinatesString:`${v0(r)}\xD7${v0(i)}`,canvasDimensionsString:`${t}\xD7${n}`,canvasScaleString:Math.round(g*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none"}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),rke=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:g}=ye(nke);return X("div",{className:"canvas-status-text",children:[S("div",{style:{color:e},children:`Active Layer: ${t}`}),S("div",{children:`Canvas Scale: ${u}%`}),g&&S("div",{style:{color:n},children:`Bounding Box: ${i}`}),a&&S("div",{style:{color:n},children:`Scaled Bounding Box: ${o}`}),h&&X(Rn,{children:[S("div",{children:`Bounding Box Position: ${r}`}),S("div",{children:`Canvas Dimensions: ${l}`}),S("div",{children:`Canvas Position: ${s}`}),S(tke,{})]})]})},ike=rt([Qt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),oke=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=ye(ike);return X(Bu,{...t,children:[r&&n&&S(QV,{url:n.image.url,x:o,y:a}),i&&X(Bu,{children:[S(zu,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),S(zu,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},ake=rt([Qt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),ske=()=>{const e=De(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=ye(ake),o=C.exports.useCallback(()=>{e(kM(!0))},[e]),a=C.exports.useCallback(()=>{e(kM(!1))},[e]);Ue(["left"],()=>{s()},{enabled:()=>!0,preventDefault:!0}),Ue(["right"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Ue(["enter"],()=>{u()},{enabled:()=>!0,preventDefault:!0});const s=()=>e(fbe()),l=()=>e(dbe()),u=()=>e(lbe());return r?S(bt,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:o,onMouseOut:a,children:X(ji,{isAttached:!0,children:[S(Xe,{tooltip:"Previous (Left)","aria-label":"Previous (Left)",icon:S(uSe,{}),onClick:s,"data-selected":!0,isDisabled:t}),S(Xe,{tooltip:"Next (Right)","aria-label":"Next (Right)",icon:S(cSe,{}),onClick:l,"data-selected":!0,isDisabled:n}),S(Xe,{tooltip:"Accept (Enter)","aria-label":"Accept (Enter)",icon:S(dk,{}),onClick:u,"data-selected":!0}),S(Xe,{tooltip:"Show/Hide","aria-label":"Show/Hide","data-alert":!i,icon:i?S(mSe,{}):S(gSe,{}),onClick:()=>e(wbe(!i)),"data-selected":!0}),S(Xe,{tooltip:"Save to Gallery","aria-label":"Save to Gallery",icon:S(pk,{}),onClick:()=>e(VSe(r.image.url)),"data-selected":!0}),S(Xe,{tooltip:"Discard All","aria-label":"Discard All",icon:S(hk,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(ube()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},lke=rt(Qt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),uke=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ye(lke);return X(Bu,{children:[S(zu,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),S(zu,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},cke=rt([Qt,vr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:h,isMovingStage:g,shouldShowIntermediates:m,shouldShowGrid:v,shouldRestrictStrokesToBox:b}=e;let w="none";return h==="move"||t?g?w="grabbing":w="grab":o?w=void 0:b&&!a&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:v,stageCoordinates:u,stageCursor:w,stageDimensions:l,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),JV=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:h}=ye(cke);R_e();const g=C.exports.useRef(null),m=C.exports.useRef(null),v=C.exports.useCallback($=>{A_e($),g.current=$},[]),b=C.exports.useCallback($=>{L_e($),m.current=$},[]),w=C.exports.useRef({x:0,y:0}),P=C.exports.useRef(!1),E=N_e(g),_=z_e(g),T=$_e(g,P),M=W_e(g,P,w),O=V_e(),{handleDragStart:I,handleDragMove:D,handleDragEnd:B}=G_e();return S("div",{className:"inpainting-canvas-container",children:X("div",{className:"inpainting-canvas-wrapper",children:[X(w_e,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:M,onTouchEnd:T,onMouseDown:_,onMouseLeave:O,onMouseMove:M,onMouseUp:T,onDragStart:I,onDragMove:D,onDragEnd:B,onContextMenu:$=>$.evt.preventDefault(),onWheel:E,draggable:(l==="move"||u)&&!t,children:[S(fm,{id:"grid",visible:r,children:S(Z_e,{})}),S(fm,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:S(q_e,{})}),X(fm,{id:"mask",visible:e,listening:!1,children:[S(__e,{visible:!0,listening:!1}),S(I_e,{listening:!1})]}),S(fm,{children:S(uke,{})}),X(fm,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&S(E_e,{visible:l!=="move",listening:!1}),S(oke,{visible:u}),h&&S(J_e,{}),S(T_e,{visible:n&&!u})]})]}),S(rke,{}),S(ske,{})]})})},dke=rt([Qt,Tr,Hu],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function eU(){const e=De(),{canUndo:t,activeTabName:n}=ye(dke),r=()=>{e(kbe())};return Ue(["meta+z","ctrl+z"],()=>{r()},{enabled:()=>t,preventDefault:!0},[n,t]),S(Xe,{"aria-label":"Undo (Ctrl+Z)",tooltip:"Undo (Ctrl+Z)",icon:S(ASe,{}),onClick:r,isDisabled:!t})}const fke=rt([Qt,Tr,Hu],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function tU(){const e=De(),{canRedo:t,activeTabName:n}=ye(fke),r=()=>{e(hbe())};return Ue(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{r()},{enabled:()=>t,preventDefault:!0},[n,t]),S(Xe,{"aria-label":"Redo (Ctrl+Shift+Z)",tooltip:"Redo (Ctrl+Shift+Z)",icon:S(ESe,{}),onClick:r,isDisabled:!t})}const nU=Pe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:h,onClose:g}=Hv(),m=C.exports.useRef(null),v=()=>{r(),g()},b=()=>{o&&o(),g()};return X(Rn,{children:[C.exports.cloneElement(l,{onClick:h,ref:t}),S(KF,{isOpen:u,leastDestructiveRef:m,onClose:g,children:S(u1,{children:X(XF,{className:"modal",children:[S(US,{fontSize:"lg",fontWeight:"bold",children:s}),S(jv,{children:a}),X(VS,{children:[S(ja,{ref:m,onClick:b,className:"modal-close-btn",children:i}),S(ja,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})}),rU=()=>{const e=ye(vr),t=De();return X(nU,{title:"Empty Temp Image Folder",acceptCallback:()=>{t(USe()),t(Ck()),t(XH())},acceptButtonText:"Empty Folder",triggerComponent:S(Ro,{leftIcon:S(Ah,{}),size:"sm",isDisabled:e,children:"Empty Temp Image Folder"}),children:[S("p",{children:"Emptying the temp image folder also fully resets the Unified Canvas. This includes all undo/redo history, images in the staging area, and the canvas base layer."}),S("br",{}),S("p",{children:"Are you sure you want to empty the temp folder?"})]})},iU=()=>{const e=ye(vr),t=De();return X(nU,{title:"Clear Canvas History",acceptCallback:()=>t(XH()),acceptButtonText:"Clear History",triggerComponent:S(Ro,{size:"sm",leftIcon:S(Ah,{}),isDisabled:e,children:"Clear Canvas History"}),children:[S("p",{children:"Clearing the canvas history leaves your current canvas intact, but irreversibly clears the undo and redo history."}),S("br",{}),S("p",{children:"Are you sure you want to clear the canvas history?"})]})},hke=rt([Qt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),pke=()=>{const e=De(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=ye(hke);return Ue(["n"],()=>{e(_4(!s))},{enabled:!0,preventDefault:!0},[s]),S(Il,{trigger:"hover",triggerComponent:S(Xe,{tooltip:"Canvas Settings","aria-label":"Canvas Settings",icon:S(pb,{})}),children:X(bt,{direction:"column",gap:"0.5rem",children:[S(fr,{label:"Show Intermediates",isChecked:a,onChange:h=>e(aW(h.target.checked))}),S(fr,{label:"Show Grid",isChecked:o,onChange:h=>e(oW(h.target.checked))}),S(fr,{label:"Snap to Grid",isChecked:s,onChange:h=>e(_4(h.target.checked))}),S(fr,{label:"Darken Outside Selection",isChecked:r,onChange:h=>e(nW(h.target.checked))}),S(fr,{label:"Auto Save to Gallery",isChecked:t,onChange:h=>e(eW(h.target.checked))}),S(fr,{label:"Save Box Region Only",isChecked:n,onChange:h=>e(tW(h.target.checked))}),S(fr,{label:"Limit Strokes to Box",isChecked:l,onChange:h=>e(lW(h.target.checked))}),S(fr,{label:"Show Canvas Debug Info",isChecked:i,onChange:h=>e(iW(h.target.checked))}),S(iU,{}),S(rU,{})]})})};function Ab(){return(Ab=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function W7(e){var t=C.exports.useRef(e),n=C.exports.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var p1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:P.buttons>0)&&i.current?o(NR(i.current,P,s.current)):w(!1)},b=function(){return w(!1)};function w(P){var E=l.current,_=V7(i.current),T=P?_.addEventListener:_.removeEventListener;T(E?"touchmove":"mousemove",v),T(E?"touchend":"mouseup",b)}return[function(P){var E=P.nativeEvent,_=i.current;if(_&&(BR(E),!function(M,O){return O&&!lv(M)}(E,l.current)&&_)){if(lv(E)){l.current=!0;var T=E.changedTouches||[];T.length&&(s.current=T[0].identifier)}_.focus(),o(NR(_,E,s.current)),w(!0)}},function(P){var E=P.which||P.keyCode;E<37||E>40||(P.preventDefault(),a({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},w]},[a,o]),h=u[0],g=u[1],m=u[2];return C.exports.useEffect(function(){return m},[m]),S("div",{...Ab({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:i,onKeyDown:g,tabIndex:0,role:"slider"})})}),Mb=function(e){return e.filter(Boolean).join(" ")},qk=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=Mb(["react-colorful__pointer",e.className]);return S("div",{className:o,style:{top:100*i+"%",left:100*n+"%"},children:S("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}})})},so=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},aU=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:so(e.h),s:so(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:so(i/2),a:so(r,2)}},U7=function(e){var t=aU(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},a6=function(e){var t=aU(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},gke=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:so(255*[r,s,a,a,l,r][u]),g:so(255*[l,r,r,s,a,a][u]),b:so(255*[a,a,l,r,r,s][u]),a:so(i,2)}},mke=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:so(60*(s<0?s+6:s)),s:so(o?a/o*100:0),v:so(o/255*100),a:i}},vke=se.memo(function(e){var t=e.hue,n=e.onChange,r=Mb(["react-colorful__hue",e.className]);return se.createElement("div",{className:r},se.createElement(Yk,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:p1(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":so(t),"aria-valuemax":"360","aria-valuemin":"0"},se.createElement(qk,{className:"react-colorful__hue-pointer",left:t/360,color:U7({h:t,s:100,v:100,a:1})})))}),yke=se.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:U7({h:t.h,s:100,v:100,a:1})};return se.createElement("div",{className:"react-colorful__saturation",style:r},se.createElement(Yk,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:p1(t.s+100*i.left,0,100),v:p1(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+so(t.s)+"%, Brightness "+so(t.v)+"%"},se.createElement(qk,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:U7(t)})))}),sU=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Ske(e,t,n){var r=W7(n),i=C.exports.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=C.exports.useRef({color:t,hsva:o});C.exports.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),C.exports.useEffect(function(){var u;sU(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=C.exports.useCallback(function(u){a(function(h){return Object.assign({},h,u)})},[]);return[o,l]}var bke=typeof window<"u"?C.exports.useLayoutEffect:C.exports.useEffect,xke=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},zR=new Map,wke=function(e){bke(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!zR.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,zR.set(t,n);var r=xke();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Cke=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+a6(Object.assign({},n,{a:0}))+", "+a6(Object.assign({},n,{a:1}))+")"},o=Mb(["react-colorful__alpha",t]),a=so(100*n.a);return se.createElement("div",{className:o},S("div",{className:"react-colorful__alpha-gradient",style:i}),se.createElement(Yk,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:p1(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},se.createElement(qk,{className:"react-colorful__alpha-pointer",left:n.a,color:a6(n)})))},_ke=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=oU(e,["className","colorModel","color","onChange"]),s=C.exports.useRef(null);wke(s);var l=Ske(n,i,o),u=l[0],h=l[1],g=Mb(["react-colorful",t]);return se.createElement("div",Ab({},a,{ref:s,className:g}),S(yke,{hsva:u,onChange:h}),S(vke,{hue:u.h,onChange:h}),se.createElement(Cke,{hsva:u,onChange:h,className:"react-colorful__last-control"}))},kke={defaultColor:{r:0,g:0,b:0,a:1},toHsva:mke,fromHsva:gke,equal:sU},Eke=function(e){return se.createElement(_ke,Ab({},e,{colorModel:kke}))};const I4=e=>{const{styleClass:t,...n}=e;return S(Eke,{className:`invokeai__color-picker ${t}`,...n})},Pke=rt([Qt,vr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:ch(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),Tke=()=>{const e=De(),{layer:t,maskColor:n,isMaskEnabled:r,shouldPreserveMaskedArea:i,isStaging:o}=ye(Pke);Ue(["q"],()=>{a()},{enabled:()=>!o,preventDefault:!0},[t]),Ue(["shift+c"],()=>{s()},{enabled:()=>!o,preventDefault:!0},[]),Ue(["h"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[r]);const a=()=>{e(C4(t==="mask"?"base":"mask"))},s=()=>e(wk()),l=()=>e(C2(!r));return S(Il,{trigger:"hover",triggerComponent:S(ji,{children:S(Xe,{"aria-label":"Masking Options",tooltip:"Masking Options",icon:S(bSe,{}),style:t==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:o})}),children:X(bt,{direction:"column",gap:"0.5rem",children:[S(fr,{label:"Enable Mask (H)",isChecked:r,onChange:l}),S(fr,{label:"Preserve Masked Area",isChecked:i,onChange:u=>e(rW(u.target.checked))}),S(I4,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:u=>e(JH(u))}),S(Ro,{size:"sm",leftIcon:S(Ah,{}),onClick:s,children:"Clear Mask (Shift+C)"})]})})};let k3;const Lke=new Uint8Array(16);function Ake(){if(!k3&&(k3=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!k3))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return k3(Lke)}const Mi=[];for(let e=0;e<256;++e)Mi.push((e+256).toString(16).slice(1));function Mke(e,t=0){return(Mi[e[t+0]]+Mi[e[t+1]]+Mi[e[t+2]]+Mi[e[t+3]]+"-"+Mi[e[t+4]]+Mi[e[t+5]]+"-"+Mi[e[t+6]]+Mi[e[t+7]]+"-"+Mi[e[t+8]]+Mi[e[t+9]]+"-"+Mi[e[t+10]]+Mi[e[t+11]]+Mi[e[t+12]]+Mi[e[t+13]]+Mi[e[t+14]]+Mi[e[t+15]]).toLowerCase()}const Rke=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),FR={randomUUID:Rke};function y0(e,t,n){if(FR.randomUUID&&!t&&!e)return FR.randomUUID();e=e||{};const r=e.random||(e.rng||Ake)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Mke(r)}const Oke=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),h=r?{x:Math.round(r.x+n.x),y:Math.round(r.y+n.y),width:Math.round(r.width),height:Math.round(r.height)}:{x:Math.round(a),y:Math.round(s),width:Math.round(l),height:Math.round(u)},g=e.toDataURL(h);return e.scale(i),{dataURL:g,boundingBox:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(l),height:Math.round(u)}}},Ike=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},Dke=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");!o||(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},Nke={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},td=(e=Nke)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(X4e("Exporting Image")),t(h0(!1));const u=n(),{stageScale:h,boundingBoxCoordinates:g,boundingBoxDimensions:m,stageCoordinates:v}=u.canvas,b=Ds();if(!b){t(Cu(!1)),t(h0(!0));return}const{dataURL:w,boundingBox:P}=Oke(b,h,v,i?{...g,...m}:void 0);if(!w){t(Cu(!1)),t(h0(!0));return}const E=new FormData;E.append("data",JSON.stringify({dataURL:w,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(window.location.origin+"/upload",{method:"POST",body:E})).json(),{url:M,width:O,height:I}=T,D={uuid:y0(),category:o?"result":"user",...T};a&&(Ike(M),t(Cm({title:"Image Download Started",status:"success",duration:2500,isClosable:!0}))),s&&(Dke(M,O,I),t(Cm({title:"Image Copied",status:"success",duration:2500,isClosable:!0}))),o&&(t(p0({image:D,category:"result"})),t(Cm({title:"Image Saved to Gallery",status:"success",duration:2500,isClosable:!0}))),l&&(t(bbe({kind:"image",layer:"base",...P,image:D})),t(Cm({title:"Canvas Merged",status:"success",duration:2500,isClosable:!0}))),t(Cu(!1)),t(a5("Connected")),t(h0(!0))},Bke=rt([Qt,vr,Hu],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),zke=()=>{const e=De(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=ye(Bke);Ue(["b"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[]),Ue(["e"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[t]),Ue(["c"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Ue(["shift+f"],()=>{l()},{enabled:()=>!i,preventDefault:!0}),Ue(["delete","backspace"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Ue(["BracketLeft"],()=>{e(U0(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Ue(["BracketRight"],()=>{e(U0(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Ue(["shift+BracketLeft"],()=>{e(V0({...n,a:He.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Ue(["shift+BracketRight"],()=>{e(V0({...n,a:He.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const o=()=>e(Ol("brush")),a=()=>e(Ol("eraser")),s=()=>e(Ol("colorPicker")),l=()=>e(qH()),u=()=>e(YH());return X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:S(NH,{}),"data-selected":t==="brush"&&!i,onClick:o,isDisabled:i}),S(Xe,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:S(RH,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:a}),S(Xe,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:S(IH,{}),isDisabled:i,onClick:l}),S(Xe,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:S(hk,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:u}),S(Xe,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:S(OH,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:s}),S(Il,{trigger:"hover",triggerComponent:S(Xe,{"aria-label":"Brush Options",tooltip:"Brush Options",icon:S(gk,{})}),children:X(bt,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[S(bt,{gap:"1rem",justifyContent:"space-between",children:S(Do,{label:"Size",value:r,withInput:!0,onChange:h=>e(U0(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),S(I4,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e(V0(h))})]})})]})};let $R;const Kk=()=>({setOpenUploader:e=>{e&&($R=e)},openUploader:$R}),Fke=rt([Hu,Qt,vr],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),$ke=()=>{const e=De(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=ye(Fke),s=Ds(),{openUploader:l}=Kk();Ue(["v"],()=>{u()},{enabled:()=>!n,preventDefault:!0},[]),Ue(["r"],()=>{h()},{enabled:()=>!0,preventDefault:!0},[s]),Ue(["shift+m"],()=>{m()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ue(["shift+s"],()=>{v()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ue(["meta+c","ctrl+c"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ue(["shift+d"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[s,t]);const u=()=>e(Ol("move")),h=()=>{const E=Ds();if(!E)return;const _=E.getClientRect({skipTransform:!0});e(ZH({contentRect:_}))},g=()=>{e(Ck()),e(gb())},m=()=>{e(td({cropVisible:!1,shouldSetAsInitialImage:!0}))},v=()=>{e(td({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},b=()=>{e(td({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},w=()=>{e(td({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))};return X("div",{className:"inpainting-settings",children:[S(Is,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:BH,onChange:E=>{const _=E.target.value;e(C4(_)),_==="mask"&&!r&&e(C2(!0))},isDisabled:n}),S(Tke,{}),S(zke,{}),X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:S(LH,{}),"data-selected":o==="move"||n,onClick:u}),S(Xe,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:S(MH,{}),onClick:h})]}),X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:S(DH,{}),onClick:m,isDisabled:n}),S(Xe,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:S(pk,{}),onClick:v,isDisabled:n}),S(Xe,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:S(w2,{}),onClick:b,isDisabled:n}),S(Xe,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:S(fk,{}),onClick:w,isDisabled:n})]}),X(ji,{isAttached:!0,children:[S(eU,{}),S(tU,{})]}),X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Upload",tooltip:"Upload",icon:S(hb,{}),onClick:l,isDisabled:n}),S(Xe,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:S(Ah,{}),onClick:g,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),S(ji,{isAttached:!0,children:S(pke,{})})]})},Hke=rt([Qt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),Wke=()=>{const e=De(),{doesCanvasNeedScaling:t}=ye(Hke);return C.exports.useLayoutEffect(()=>{e(ai(!0));const n=He.debounce(()=>{e(ai(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),S("div",{className:"workarea-single-view",children:S("div",{className:"workarea-split-view-left",children:X("div",{className:"inpainting-main-area",children:[S($ke,{}),S("div",{className:"inpainting-canvas-area",children:t?S(uV,{}):S(JV,{})})]})})})},Vke=rt([Qt,vr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function Uke(){const e=De(),{layer:t,isMaskEnabled:n,isStaging:r}=ye(Vke),i=()=>{e(C4(t==="mask"?"base":"mask"))};return Ue(["q"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[t]),S(Is,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:t,validValues:BH,onChange:a=>{const s=a.target.value;e(C4(s)),s==="mask"&&!n&&e(C2(!0))},isDisabled:r})}const Gke=rt([Qt,vr,Hu],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),jke=()=>{const e=De(),{tool:t,isStaging:n}=ye(Gke);Ue(["b"],()=>{r()},{enabled:()=>!n,preventDefault:!0},[]),Ue(["e"],()=>{i()},{enabled:()=>!n,preventDefault:!0},[t]),Ue(["c"],()=>{o()},{enabled:()=>!n,preventDefault:!0},[t]),Ue(["shift+f"],()=>{a()},{enabled:()=>!n,preventDefault:!0}),Ue(["delete","backspace"],()=>{s()},{enabled:()=>!n,preventDefault:!0});const r=()=>e(Ol("brush")),i=()=>e(Ol("eraser")),o=()=>e(Ol("colorPicker")),a=()=>e(qH()),s=()=>e(YH());return X(bt,{flexDirection:"column",gap:"0.5rem",children:[X(ji,{children:[S(Xe,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:S(NH,{}),"data-selected":t==="brush"&&!n,onClick:r,isDisabled:n}),S(Xe,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:S(RH,{}),"data-selected":t==="eraser"&&!n,isDisabled:n,onClick:i})]}),X(ji,{children:[S(Xe,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:S(IH,{}),isDisabled:n,onClick:a}),S(Xe,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:S(hk,{style:{transform:"rotate(45deg)"}}),isDisabled:n,onClick:s})]}),S(Xe,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:S(OH,{}),"data-selected":t==="colorPicker"&&!n,isDisabled:n,onClick:o,width:"max-content"})]})},Yke=rt([Qt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),qke=()=>{const e=De(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=ye(Yke);return S(Il,{trigger:"hover",triggerComponent:S(Xe,{tooltip:"Canvas Settings",tooltipProps:{placement:"bottom"},"aria-label":"Canvas Settings",icon:S(pb,{})}),children:X(bt,{direction:"column",gap:"0.5rem",children:[S(fr,{label:"Show Intermediates",isChecked:i,onChange:o=>e(aW(o.target.checked))}),S(fr,{label:"Auto Save to Gallery",isChecked:t,onChange:o=>e(eW(o.target.checked))}),S(fr,{label:"Save Box Region Only",isChecked:n,onChange:o=>e(tW(o.target.checked))}),S(fr,{label:"Show Canvas Debug Info",isChecked:r,onChange:o=>e(iW(o.target.checked))}),S(iU,{}),S(rU,{})]})})};function Kke(){const e=ye(i=>i.canvas.tool),t=ye(vr),n=De();Ue(["v"],()=>{r()},{enabled:()=>!t,preventDefault:!0},[]);const r=()=>n(Ol("move"));return S(Xe,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:S(LH,{}),"data-selected":e==="move"||t,onClick:r})}function Xke(){const e=Ds(),t=De();Ue(["r"],()=>{n()},{enabled:()=>!0,preventDefault:!0},[e]);const n=()=>{const r=Ds();if(!r)return;const i=r.getClientRect({skipTransform:!0});t(ZH({contentRect:i}))};return S(Xe,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:S(MH,{}),onClick:n})}function Zke(){const e=De(),t=Ds(),n=ye(vr),r=ye(o=>o.system.isProcessing);Ue(["shift+m"],()=>{i()},{enabled:()=>!n,preventDefault:!0},[t,r]);const i=()=>{e(td({cropVisible:!1,shouldSetAsInitialImage:!0}))};return S(Xe,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:S(DH,{}),onClick:i,isDisabled:n})}function Qke(){const e=ye(vr),t=Ds(),n=ye(a=>a.system.isProcessing),r=ye(a=>a.canvas.shouldCropToBoundingBoxOnSave),i=De();Ue(["shift+s"],()=>{o()},{enabled:()=>!e,preventDefault:!0},[t,n]);const o=()=>{i(td({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return S(Xe,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:S(pk,{}),onClick:o,isDisabled:e})}function Jke(){const e=ye(vr),t=Ds(),n=ye(a=>a.system.isProcessing),r=ye(a=>a.canvas.shouldCropToBoundingBoxOnSave),i=De();Ue(["meta+c","ctrl+c"],()=>{o()},{enabled:()=>!e,preventDefault:!0},[t,n]);const o=()=>{i(td({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return S(Xe,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:S(w2,{}),onClick:o,isDisabled:e})}function eEe(){const e=De(),t=Ds(),n=ye(vr),r=ye(a=>a.system.isProcessing),i=ye(a=>a.canvas.shouldCropToBoundingBoxOnSave);Ue(["shift+d"],()=>{o()},{enabled:()=>!n,preventDefault:!0},[t,r]);const o=()=>{e(td({cropVisible:!i,cropToBoundingBox:i,shouldDownload:!0}))};return S(Xe,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:S(fk,{}),onClick:o,isDisabled:n})}function tEe(){const e=ye(vr),{openUploader:t}=Kk();return S(Xe,{"aria-label":"Upload",tooltip:"Upload",icon:S(hb,{}),onClick:t,isDisabled:e})}function nEe(){const e=De(),t=ye(vr);return S(Xe,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:S(Ah,{}),onClick:()=>{e(Ck()),e(gb())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:t})}function rEe(){const e=ye(r=>r.options.shouldPinOptionsPanel),t=De();return X(bt,{flexDirection:"column",gap:"0.5rem",children:[S(Xe,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:()=>{t(ku(!0)),e&&setTimeout(()=>t(ai(!0)),400)},children:S(gk,{})}),S(bt,{children:S(vk,{iconButton:!0})}),S(bt,{children:S(yk,{width:"100%",height:"40px"})})]})}const iEe=()=>{const e=ye(t=>t.options.shouldShowOptionsPanel);return X(bt,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[S(Uke,{}),S(jke,{}),X(bt,{gap:"0.5rem",children:[S(Kke,{}),S(Xke,{})]}),X(bt,{columnGap:"0.5rem",children:[S(Zke,{}),S(Qke,{})]}),X(bt,{columnGap:"0.5rem",children:[S(Jke,{}),S(eEe,{})]}),X(bt,{gap:"0.5rem",children:[S(eU,{}),S(tU,{})]}),X(bt,{gap:"0.5rem",children:[S(tEe,{}),S(nEe,{})]}),S(qke,{}),!e&&S(rEe,{})]})};function oEe(){const e=De(),t=ye(r=>r.canvas.brushSize),n=ye(vr);return Ue(["BracketLeft"],()=>{e(U0(Math.max(t-5,5)))},{enabled:()=>!n,preventDefault:!0},[t]),Ue(["BracketRight"],()=>{e(U0(Math.min(t+5,500)))},{enabled:()=>!n,preventDefault:!0},[t]),S(Do,{label:"Size",value:t,withInput:!0,onChange:r=>e(U0(r)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px"})}const aEe=rt([Qt,vr],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function sEe(){const e=De(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=ye(aEe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return Ue(["shift+BracketLeft"],()=>{e(V0({...t,a:He.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Ue(["shift+BracketRight"],()=>{e(V0({...t,a:He.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),S(Il,{trigger:"hover",triggerComponent:S(Ld,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:X(bt,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&S(I4,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(V0(a))}),r==="mask"&&S(I4,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(JH(a))})]})})}function lU(){return X(bt,{columnGap:"1rem",alignItems:"center",children:[S(oEe,{}),S(sEe,{})]})}function lEe(){const e=De(),t=ye(n=>n.canvas.shouldRestrictStrokesToBox);return S(fr,{label:"Limit To Box",isChecked:t,onChange:n=>e(lW(n.target.checked))})}function uEe(){return X(bt,{gap:"1rem",alignItems:"center",children:[S(lU,{}),S(lEe,{})]})}function cEe(){const e=De();return S(Ro,{size:"sm",leftIcon:S(Ah,{}),onClick:()=>e(wk()),tooltip:"Clear Mask (Shift+C)",children:"Clear"})}function dEe(){const e=ye(r=>r.canvas.isMaskEnabled),t=De();return S(fr,{label:"Enable Mask (H)",isChecked:e,onChange:()=>t(C2(!e))})}function fEe(){const e=De(),t=ye(n=>n.canvas.shouldPreserveMaskedArea);return S(fr,{label:"Preserve Masked",isChecked:t,onChange:n=>e(rW(n.target.checked))})}function hEe(){return X(bt,{gap:"1rem",alignItems:"center",children:[S(lU,{}),S(dEe,{}),S(fEe,{}),S(cEe,{})]})}function pEe(){const e=ye(n=>n.canvas.shouldDarkenOutsideBoundingBox),t=De();return S(fr,{label:"Darken Outside",isChecked:e,onChange:n=>t(nW(n.target.checked))})}function gEe(){const e=ye(n=>n.canvas.shouldShowGrid),t=De();return S(fr,{label:"Show Grid",isChecked:e,onChange:n=>t(oW(n.target.checked))})}function mEe(){const e=ye(r=>r.canvas.shouldSnapToGrid),t=De();return S(fr,{label:"Snap to Grid (N)",isChecked:e,onChange:r=>t(_4(r.target.checked))})}function vEe(){return X(bt,{alignItems:"center",gap:"1rem",children:[S(gEe,{}),S(mEe,{}),S(pEe,{})]})}const yEe=rt([Qt],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function SEe(){const{tool:e,layer:t}=ye(yEe);return X(bt,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&S(uEe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&S(hEe,{}),e=="move"&&S(vEe,{})]})}const bEe=rt([Qt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),xEe=()=>{const e=De(),{doesCanvasNeedScaling:t}=ye(bEe);return C.exports.useLayoutEffect(()=>{e(ai(!0));const n=He.debounce(()=>{e(ai(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),S("div",{className:"workarea-single-view",children:X(bt,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[S(iEe,{}),X(bt,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[S(SEe,{}),t?S(uV,{}):S(JV,{})]})]})})};function wEe(){const e=ye(t=>t.options.shouldUseCanvasBetaLayout);return S(Ik,{optionsPanel:S(u7e,{}),styleClass:"inpainting-workarea-overrides",children:e?S(xEe,{}):S(Wke,{})})}const CEe=ut({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})});function _Ee(){return X("div",{className:"work-in-progress nodes-work-in-progress",children:[S("h1",{children:"Training"}),X("p",{children:["A dedicated workflow for training your own embeddings and checkpoints using Textual Inversion and Dreambooth from the web interface. ",S("br",{}),S("br",{}),"InvokeAI already supports training custom embeddings using Textual Inversion using the main script."]})]})}const kEe=ut({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),Hf={txt2img:{title:S(t4e,{fill:"black",boxSize:"2.5rem"}),workarea:S(H6e,{}),tooltip:"Text To Image"},img2img:{title:S(Q5e,{fill:"black",boxSize:"2.5rem"}),workarea:S(z6e,{}),tooltip:"Image To Image"},unifiedCanvas:{title:S(CEe,{fill:"black",boxSize:"2.5rem"}),workarea:S(wEe,{}),tooltip:"Unified Canvas"},nodes:{title:S(J5e,{fill:"black",boxSize:"2.5rem"}),workarea:S(X5e,{}),tooltip:"Nodes"},postprocess:{title:S(e4e,{fill:"black",boxSize:"2.5rem"}),workarea:S(Z5e,{}),tooltip:"Post Processing"},training:{title:S(kEe,{fill:"black",boxSize:"2.5rem"}),workarea:S(_Ee,{}),tooltip:"Training"}},Rb=He.map(Hf,(e,t)=>t);[...Rb];function EEe(){const e=ye(o=>o.options.activeTab),t=ye(o=>o.options.isLightBoxOpen),n=De();Ue("1",()=>{n(Lo(0))}),Ue("2",()=>{n(Lo(1))}),Ue("3",()=>{n(Lo(2))}),Ue("4",()=>{n(Lo(3))}),Ue("5",()=>{n(Lo(4))}),Ue("6",()=>{n(Lo(5))}),Ue("z",()=>{n(_u(!t))},[t]);const r=()=>{const o=[];return Object.keys(Hf).forEach(a=>{o.push(S(bi,{hasArrow:!0,label:Hf[a].tooltip,placement:"right",children:S(_$,{children:Hf[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(Hf).forEach(a=>{o.push(S(w$,{className:"app-tabs-panel",children:Hf[a].workarea},a))}),o};return X(x$,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Lo(o))},children:[S("div",{className:"app-tabs-list",children:r()}),S(C$,{className:"app-tabs-panels",children:t?S(e7e,{}):i()})]})}const uU={activeTab:0,cfgScale:7.5,codeformerFidelity:.75,currentTheme:"dark",facetoolStrength:.8,facetoolType:"gfpgan",height:512,hiresFix:!1,img2imgStrength:.75,infillMethod:"patchmatch",isLightBoxOpen:!1,iterations:1,maskPath:"",optionsPanelScrollPosition:0,perlin:0,prompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:10,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldHoldOptionsPanelOpen:!1,shouldLoopback:!1,shouldPinOptionsPanel:!0,shouldRandomizeSeed:!0,shouldRunESRGAN:!1,shouldRunFacetool:!1,shouldShowImageDetails:!1,shouldShowOptionsPanel:!0,showAdvancedOptions:!0,showDualDisplay:!0,steps:50,threshold:0,tileSize:32,upscalingLevel:4,upscalingStrength:.75,variationAmount:.1,width:512,shouldUseCanvasBetaLayout:!1},PEe=uU,cU=KS({name:"options",initialState:PEe,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=o5(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:h,hires_fix:g,width:m,height:v}=t.payload.image;o&&o.length>0?(e.seedWeights=b4(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=o5(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),l&&(e.threshold=l),typeof l>"u"&&(e.threshold=0),u&&(e.perlin=u),typeof u>"u"&&(e.perlin=0),typeof h=="boolean"&&(e.seamless=h),typeof g=="boolean"&&(e.hiresFix=g),m&&(e.width=m),v&&(e.height=v)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:h,seamless:g,hires_fix:m,width:v,height:b,strength:w,fit:P,init_image_path:E,mask_image_path:_}=t.payload.image;n==="img2img"&&(E&&(e.initialImage=E),_&&(e.maskPath=_),w&&(e.img2imgStrength=w),typeof P=="boolean"&&(e.shouldFitToWidthHeight=P)),a&&a.length>0?(e.seedWeights=b4(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i&&(e.prompt=o5(i)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),u&&(e.threshold=u),typeof u>"u"&&(e.threshold=0),h&&(e.perlin=h),typeof h>"u"&&(e.perlin=0),typeof g=="boolean"&&(e.seamless=g),typeof m=="boolean"&&(e.hiresFix=m),v&&(e.width=v),b&&(e.height=b),e.shouldRunESRGAN=!1,e.shouldRunFacetool=!1},resetOptionsState:e=>({...e,...uU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setShowAdvancedOptions:(e,t)=>{e.showAdvancedOptions=t.payload},setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=Rb.indexOf(t.payload)},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShowDualDisplay:(e,t)=>{e.showDualDisplay=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setShouldPinOptionsPanel:(e,t)=>{e.shouldPinOptionsPanel=t.payload},setShouldShowOptionsPanel:(e,t)=>{e.shouldShowOptionsPanel=t.payload},setOptionsPanelScrollPosition:(e,t)=>{e.optionsPanelScrollPosition=t.payload},setShouldHoldOptionsPanelOpen:(e,t)=>{e.shouldHoldOptionsPanelOpen=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setIsLightBoxOpen:(e,t)=>{e.isLightBoxOpen=t.payload},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload}}}),{clearInitialImage:dU,resetOptionsState:$Le,resetSeed:HLe,setActiveTab:Lo,setAllImageToImageParameters:TEe,setAllParameters:LEe,setAllTextToImageParameters:AEe,setCfgScale:fU,setCodeformerFidelity:hU,setCurrentTheme:MEe,setFacetoolStrength:c5,setFacetoolType:d5,setHeight:pU,setHiresFix:gU,setImg2imgStrength:G7,setInfillMethod:mU,setInitialImage:O1,setIsLightBoxOpen:_u,setIterations:REe,setMaskPath:vU,setOptionsPanelScrollPosition:OEe,setParameter:WLe,setPerlin:yU,setPrompt:Ob,setSampler:SU,setSeamBlur:HR,setSeamless:bU,setSeamSize:WR,setSeamSteps:VR,setSeamStrength:UR,setSeed:T2,setSeedWeights:xU,setShouldFitToWidthHeight:wU,setShouldGenerateVariations:IEe,setShouldHoldOptionsPanelOpen:DEe,setShouldLoopback:NEe,setShouldPinOptionsPanel:BEe,setShouldRandomizeSeed:zEe,setShouldRunESRGAN:FEe,setShouldRunFacetool:$Ee,setShouldShowImageDetails:CU,setShouldShowOptionsPanel:ku,setShowAdvancedOptions:VLe,setShowDualDisplay:HEe,setSteps:_U,setThreshold:kU,setTileSize:GR,setUpscalingLevel:j7,setUpscalingStrength:Y7,setVariationAmount:WEe,setWidth:EU,setShouldUseCanvasBetaLayout:VEe}=cU.actions,UEe=cU.reducer,Hl=Object.create(null);Hl.open="0";Hl.close="1";Hl.ping="2";Hl.pong="3";Hl.message="4";Hl.upgrade="5";Hl.noop="6";const f5=Object.create(null);Object.keys(Hl).forEach(e=>{f5[Hl[e]]=e});const GEe={type:"error",data:"parser error"},jEe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",YEe=typeof ArrayBuffer=="function",qEe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,PU=({type:e,data:t},n,r)=>jEe&&t instanceof Blob?n?r(t):jR(t,r):YEe&&(t instanceof ArrayBuffer||qEe(t))?n?r(t):jR(new Blob([t]),r):r(Hl[e]+(t||"")),jR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},YR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Rm=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),h=new Uint8Array(u);for(r=0;r>4,h[i++]=(a&15)<<4|s>>2,h[i++]=(s&3)<<6|l&63;return u},XEe=typeof ArrayBuffer=="function",TU=(e,t)=>{if(typeof e!="string")return{type:"message",data:LU(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ZEe(e.substring(1),t)}:f5[n]?e.length>1?{type:f5[n],data:e.substring(1)}:{type:f5[n]}:GEe},ZEe=(e,t)=>{if(XEe){const n=KEe(e);return LU(n,t)}else return{base64:!0,data:e}},LU=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},AU=String.fromCharCode(30),QEe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{PU(o,!1,s=>{r[a]=s,++i===n&&t(r.join(AU))})})},JEe=(e,t)=>{const n=e.split(AU),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function RU(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const tPe=setTimeout,nPe=clearTimeout;function Ib(e,t){t.useNativeTimers?(e.setTimeoutFn=tPe.bind(nd),e.clearTimeoutFn=nPe.bind(nd)):(e.setTimeoutFn=setTimeout.bind(nd),e.clearTimeoutFn=clearTimeout.bind(nd))}const rPe=1.33;function iPe(e){return typeof e=="string"?oPe(e):Math.ceil((e.byteLength||e.size)*rPe)}function oPe(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class aPe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class OU extends Kr{constructor(t){super(),this.writable=!1,Ib(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new aPe(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=TU(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const IU="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),q7=64,sPe={};let qR=0,E3=0,KR;function XR(e){let t="";do t=IU[e%q7]+t,e=Math.floor(e/q7);while(e>0);return t}function DU(){const e=XR(+new Date);return e!==KR?(qR=0,KR=e):e+"."+XR(qR++)}for(;E3{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};JEe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,QEe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=DU()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=NU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new Nl(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Nl extends Kr{constructor(t,n){super(),Ib(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=RU(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new zU(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch(r){}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}try{n.setRequestHeader("Accept","*/*")}catch(r){}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=Nl.requestsCount++,Nl.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=cPe,t)try{this.xhr.abort()}catch(n){}typeof document<"u"&&delete Nl.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Nl.requestsCount=0;Nl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ZR);else if(typeof addEventListener=="function"){const e="onpagehide"in nd?"pagehide":"unload";addEventListener(e,ZR,!1)}}function ZR(){for(let e in Nl.requests)Nl.requests.hasOwnProperty(e)&&Nl.requests[e].abort()}const FU=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),P3=nd.WebSocket||nd.MozWebSocket,QR=!0,hPe="arraybuffer",JR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class pPe extends OU{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=JR?{}:RU(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=QR&&!JR?n?new P3(t,n):new P3(t):new P3(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||hPe,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{QR&&this.ws.send(o)}catch(s){}i&&FU(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=DU()),this.supportsBinary||(t.b64=1);const i=NU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!P3}}const gPe={websocket:pPe,polling:fPe},mPe=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vPe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function K7(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=mPe.exec(e||""),o={},a=14;for(;a--;)o[vPe[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=yPe(o,o.path),o.queryKey=SPe(o,o.query),o}function yPe(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function SPe(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}class qc extends Kr{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=K7(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=K7(n.host).host),Ib(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=lPe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=MU,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new gPe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&qc.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;qc.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",g=>{if(!r)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;qc.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,h(),n.close(),n=null)}const a=g=>{const m=new Error("probe error: "+g);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(g){n&&g.name!==n.name&&o()}const h=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",qc.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){qc.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,$U=Object.prototype.toString,CPe=typeof Blob=="function"||typeof Blob<"u"&&$U.call(Blob)==="[object BlobConstructor]",_Pe=typeof File=="function"||typeof File<"u"&&$U.call(File)==="[object FileConstructor]";function Xk(e){return xPe&&(e instanceof ArrayBuffer||wPe(e))||CPe&&e instanceof Blob||_Pe&&e instanceof File}function h5(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case on.ACK:case on.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class LPe{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=EPe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const APe=Object.freeze(Object.defineProperty({__proto__:null,protocol:PPe,get PacketType(){return on},Encoder:TPe,Decoder:Zk},Symbol.toStringTag,{value:"Module"}));function xs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const MPe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class HU extends Kr{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[xs(t,"open",this.onopen.bind(this)),xs(t,"packet",this.onpacket.bind(this)),xs(t,"error",this.onerror.bind(this)),xs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(MPe.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:on.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:on.CONNECT,data:t})}):this.packet({type:on.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case on.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case on.EVENT:case on.BINARY_EVENT:this.onevent(t);break;case on.ACK:case on.BINARY_ACK:this.onack(t);break;case on.DISCONNECT:this.ondisconnect();break;case on.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:on.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:on.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}I1.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};I1.prototype.reset=function(){this.attempts=0};I1.prototype.setMin=function(e){this.ms=e};I1.prototype.setMax=function(e){this.max=e};I1.prototype.setJitter=function(e){this.jitter=e};class Q7 extends Kr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ib(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new I1({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||APe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new qc(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=xs(n,"open",function(){r.onopen(),t&&t()}),o=xs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xs(t,"ping",this.onping.bind(this)),xs(t,"data",this.ondata.bind(this)),xs(t,"error",this.onerror.bind(this)),xs(t,"close",this.onclose.bind(this)),xs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){FU(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new HU(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const hm={};function p5(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=bPe(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=hm[i]&&o in hm[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new Q7(r,t):(hm[i]||(hm[i]=new Q7(r,t)),l=hm[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(p5,{Manager:Q7,Socket:HU,io:p5,connect:p5});var RPe=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,OPe=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,IPe=/[^-+\dA-Z]/g;function To(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(eO[t]||t||eO.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},h=function(){return e[o()+"Hours"]()},g=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},v=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},w=function(){return DPe(e)},P=function(){return NPe(e)},E={d:function(){return a()},dd:function(){return sa(a())},ddd:function(){return Eo.dayNames[s()]},DDD:function(){return tO({y:u(),m:l(),d:a(),_:o(),dayName:Eo.dayNames[s()],short:!0})},dddd:function(){return Eo.dayNames[s()+7]},DDDD:function(){return tO({y:u(),m:l(),d:a(),_:o(),dayName:Eo.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return sa(l()+1)},mmm:function(){return Eo.monthNames[l()]},mmmm:function(){return Eo.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return sa(u(),4)},h:function(){return h()%12||12},hh:function(){return sa(h()%12||12)},H:function(){return h()},HH:function(){return sa(h())},M:function(){return g()},MM:function(){return sa(g())},s:function(){return m()},ss:function(){return sa(m())},l:function(){return sa(v(),3)},L:function(){return sa(Math.floor(v()/10))},t:function(){return h()<12?Eo.timeNames[0]:Eo.timeNames[1]},tt:function(){return h()<12?Eo.timeNames[2]:Eo.timeNames[3]},T:function(){return h()<12?Eo.timeNames[4]:Eo.timeNames[5]},TT:function(){return h()<12?Eo.timeNames[6]:Eo.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":BPe(e)},o:function(){return(b()>0?"-":"+")+sa(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+sa(Math.floor(Math.abs(b())/60),2)+":"+sa(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return w()},WW:function(){return sa(w())},N:function(){return P()}};return t.replace(RPe,function(_){return _ in E?E[_]():_.slice(1,_.length-1)})}var eO={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Eo={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},sa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},tO=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,h=new Date;h.setDate(h[o+"Date"]()-1);var g=new Date;g.setDate(g[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},v=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},w=function(){return h[o+"Date"]()},P=function(){return h[o+"Month"]()},E=function(){return h[o+"FullYear"]()},_=function(){return g[o+"Date"]()},T=function(){return g[o+"Month"]()},M=function(){return g[o+"FullYear"]()};return b()===n&&v()===r&&m()===i?l?"Tdy":"Today":E()===n&&P()===r&&w()===i?l?"Ysd":"Yesterday":M()===n&&T()===r&&_()===i?l?"Tmw":"Tomorrow":a},DPe=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},NPe=function(t){var n=t.getDay();return n===0&&(n=7),n},BPe=function(t){return(String(t).match(OPe)||[""]).pop().replace(IPe,"").replace(/GMT\+0000/g,"UTC")};const zPe=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(gM(!0)),t(a5("Connected")),t(WSe());const r=n().gallery;r.categories.result.latest_mtime?t(SM("result")):t(v7("result")),r.categories.user.latest_mtime?t(SM("user")):t(v7("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(gM(!1)),t(a5("Disconnected")),t(Po({timestamp:To(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{shouldLoopback:o,activeTab:a}=i.options,{boundingBox:s,generationMode:l,...u}=r,h={uuid:y0(),...u};if(["txt2img","img2img"].includes(l)&&t(p0({category:"result",image:{...h,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:g}=r;t(obe({image:{...h,category:"temp"},boundingBox:g})),i.canvas.shouldAutoSave&&t(p0({image:{...h,category:"result"},category:"result"}))}if(o)switch(Rb[a]){case"img2img":{t(O1(h));break}}t(Vw()),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(Ibe({uuid:y0(),...r,category:"result"})),r.isBase64||t(Po({timestamp:To(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(p0({category:"result",image:{uuid:y0(),...r,category:"result"}})),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(Cu(!0)),t(H4e(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(Po({timestamp:To(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(mM()),t(Vw())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:y0(),...l}));t(Obe({images:s,areMoreImagesAvailable:o,category:a})),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(U4e());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(p0({category:"result",image:r})),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(Vw())),t(Po({timestamp:To(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(fW(r));const{initialImage:o,maskPath:a}=n().options;((o==null?void 0:o.url)===i||o===i)&&t(dU()),a===i&&t(vU("")),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(W4e(r)),r.infill_methods.includes("patchmatch")||t(mU(r.infill_methods[0]))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(vM(o)),t(a5("Model Changed")),t(Cu(!1)),t(h0(!0)),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(vM(o)),t(Cu(!1)),t(h0(!0)),t(mM()),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Cm({title:"Temp Folder Emptied",status:"success",duration:2500,isClosable:!0}))}}},FPe=(e,t)=>{const{width:n,height:r}=t,i=document.createElement("div"),o=new Zp.Stage({container:i,width:n,height:r}),a=new Zp.Layer,s=new Zp.Layer;a.add(new Zp.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Zp.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l},$Pe=e=>{const t=window.open("");!t||e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},HPe=e=>{const t=Ds(),{generationMode:n,optionsState:r,canvasState:i,systemState:o}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:u,height:h,hiresFix:g,img2imgStrength:m,infillMethod:v,initialImage:b,iterations:w,perlin:P,prompt:E,sampler:_,seamBlur:T,seamless:M,seamSize:O,seamSteps:I,seamStrength:D,seed:B,seedWeights:$,shouldFitToWidthHeight:H,shouldGenerateVariations:j,shouldRandomizeSeed:ne,shouldRunESRGAN:V,shouldRunFacetool:q,steps:te,threshold:J,tileSize:Z,upscalingLevel:G,upscalingStrength:ee,variationAmount:le,width:me}=r,{shouldDisplayInProgressType:Me,saveIntermediatesInterval:Ce,enableImageDebugging:be}=o,we={prompt:E,iterations:w,steps:te,cfg_scale:a,threshold:J,perlin:P,height:h,width:me,sampler_name:_,seed:B,progress_images:Me==="full-res",progress_latents:Me==="latents",save_intermediates:Ce,generation_mode:n,init_mask:""};let Ve=!1,Ze=!1;if(we.seed=ne?xH(J_,ek):B,["txt2img","img2img"].includes(n)&&(we.seamless=M,we.hires_fix=g,V&&(Ve={level:G,strength:ee}),q&&(Ze={type:u,strength:l},u==="codeformer"&&(Ze.codeformer_fidelity=s))),n==="img2img"&&b&&(we.init_img=typeof b=="string"?b:b.url,we.strength=m,we.fit=H),n==="unifiedCanvas"&&t){const{layerState:{objects:it},boundingBoxCoordinates:pt,boundingBoxDimensions:kt,inpaintReplace:gt,shouldUseInpaintReplace:ht,stageScale:vt,isMaskEnabled:Te,shouldPreserveMaskedArea:ot,boundingBoxScaleMethod:Mt,scaledBoundingBoxDimensions:Je}=i,mt={...pt,...kt},un=FPe(Te?it.filter(mk):[],mt);we.init_mask=un,we.fit=!1,we.strength=m,we.invert_mask=ot,ht&&(we.inpaint_replace=gt),we.bounding_box=mt;const Et=t.scale();t.scale({x:1/vt,y:1/vt});const jt=t.getAbsolutePosition(),cn=t.toDataURL({x:mt.x+jt.x,y:mt.y+jt.y,width:mt.width,height:mt.height});be&&$Pe([{base64:un,caption:"mask sent as init_mask"},{base64:cn,caption:"image sent as init_img"}]),t.scale(Et),we.init_img=cn,we.progress_images=!1,Mt!=="none"&&(we.inpaint_width=Je.width,we.inpaint_height=Je.height),we.seam_size=O,we.seam_blur=T,we.seam_strength=D,we.seam_steps=I,we.tile_size=Z,we.infill_method=v,we.force_outpaint=!1}return j?(we.variation_amount=le,$&&(we.with_variations=g3e($))):we.variation_amount=0,be&&(we.enable_image_debugging=be),{generationParameters:we,esrganParameters:Ve,facetoolParameters:Ze}},WPe=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(Cu(!0));const o=r(),{options:a,system:s,canvas:l}=o,u={generationMode:i,optionsState:a,canvasState:l,systemState:s};n(q4e());const{generationParameters:h,esrganParameters:g,facetoolParameters:m}=HPe(u);t.emit("generateImage",h,g,m),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(Po({timestamp:To(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...g,...m})}`}))},emitRunESRGAN:i=>{n(Cu(!0));const o=r().options,{upscalingLevel:a,upscalingStrength:s}=o,l={upscale:[a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(Po({timestamp:To(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(Cu(!0));const o=r().options,{facetoolType:a,facetoolStrength:s,codeformerFidelity:l}=o,u={facetool_strength:s};a==="codeformer"&&(u.codeformer_fidelity=l),t.emit("runPostprocessing",i,{type:a,...u}),n(Po({timestamp:To(new Date,"isoDateTime"),message:`Face restoration (${a}) requested: ${JSON.stringify({file:i.url,...u})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(fW(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitRequestModelChange:i=>{n(G4e()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}},VPe=()=>{const{origin:e}=new URL(window.location.href),t=p5(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:h,onGenerationResult:g,onIntermediateResult:m,onProgressUpdate:v,onGalleryImages:b,onProcessingCanceled:w,onImageDeleted:P,onSystemConfig:E,onModelChanged:_,onModelChangeFailed:T,onTempFolderEmptied:M}=zPe(i),{emitGenerateImage:O,emitRunESRGAN:I,emitRunFacetool:D,emitDeleteImage:B,emitRequestImages:$,emitRequestNewImages:H,emitCancelProcessing:j,emitRequestSystemConfig:ne,emitRequestModelChange:V,emitSaveStagingAreaImageToGallery:q,emitRequestEmptyTempFolder:te}=WPe(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",J=>u(J)),t.on("generationResult",J=>g(J)),t.on("postprocessingResult",J=>h(J)),t.on("intermediateResult",J=>m(J)),t.on("progressUpdate",J=>v(J)),t.on("galleryImages",J=>b(J)),t.on("processingCanceled",()=>{w()}),t.on("imageDeleted",J=>{P(J)}),t.on("systemConfig",J=>{E(J)}),t.on("modelChanged",J=>{_(J)}),t.on("modelChangeFailed",J=>{T(J)}),t.on("tempFolderEmptied",()=>{M()}),n=!0),a.type){case"socketio/generateImage":{O(a.payload);break}case"socketio/runESRGAN":{I(a.payload);break}case"socketio/runFacetool":{D(a.payload);break}case"socketio/deleteImage":{B(a.payload);break}case"socketio/requestImages":{$(a.payload);break}case"socketio/requestNewImages":{H(a.payload);break}case"socketio/cancelProcessing":{j();break}case"socketio/requestSystemConfig":{ne();break}case"socketio/requestModelChange":{V(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{q(a.payload);break}case"socketio/requestEmptyTempFolder":{te();break}}o(a)}},UPe=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),GPe=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps"].map(e=>`system.${e}`),jPe=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),WU=I$({options:UEe,gallery:Hbe,system:Z4e,canvas:Ebe}),YPe=eH.getPersistConfig({key:"root",storage:J$,rootReducer:WU,blacklist:[...UPe,...GPe,...jPe],debounce:300}),qPe=Qye(YPe,WU),VU=j2e({reducer:qPe,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(VPe()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),De=Bye,ye=Eye;function g5(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g5=function(n){return typeof n}:g5=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},g5(e)}function KPe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nO(e,t){for(var n=0;nS(bt,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:S(p2,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),eTe=rt(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),tTe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=ye(eTe),i=t?Math.round(t*100/n):0;return S(r$,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function nTe(e){const{title:t,hotkey:n,description:r}=e;return X("div",{className:"hotkey-modal-item",children:[X("div",{className:"hotkey-info",children:[S("p",{className:"hotkey-title",children:t}),r&&S("p",{className:"hotkey-description",children:r})]}),S("div",{className:"hotkey-key",children:n})]})}function rTe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Hv(),i=[{title:"Invoke",desc:"Generate an image",hotkey:"Ctrl+Enter"},{title:"Cancel",desc:"Cancel image generation",hotkey:"Shift+X"},{title:"Focus Prompt",desc:"Focus the prompt input area",hotkey:"Alt+A"},{title:"Toggle Options",desc:"Open and close the options panel",hotkey:"O"},{title:"Pin Options",desc:"Pin the options panel",hotkey:"Shift+O"},{title:"Toggle Viewer",desc:"Open and close Image Viewer",hotkey:"Z"},{title:"Toggle Gallery",desc:"Open and close the gallery drawer",hotkey:"G"},{title:"Maximize Workspace",desc:"Close panels and maximize work area",hotkey:"F"},{title:"Change Tabs",desc:"Switch to another workspace",hotkey:"1-5"},{title:"Console Toggle",desc:"Open and close console",hotkey:"`"}],o=[{title:"Set Prompt",desc:"Use the prompt of the current image",hotkey:"P"},{title:"Set Seed",desc:"Use the seed of the current image",hotkey:"S"},{title:"Set Parameters",desc:"Use all parameters of the current image",hotkey:"A"},{title:"Restore Faces",desc:"Restore the current image",hotkey:"R"},{title:"Upscale",desc:"Upscale the current image",hotkey:"U"},{title:"Show Info",desc:"Show metadata info of the current image",hotkey:"I"},{title:"Send To Image To Image",desc:"Send current image to Image to Image",hotkey:"Shift+I"},{title:"Delete Image",desc:"Delete the current image",hotkey:"Del"},{title:"Close Panels",desc:"Closes open panels",hotkey:"Esc"}],a=[{title:"Previous Image",desc:"Display the previous image in gallery",hotkey:"Arrow Left"},{title:"Next Image",desc:"Display the next image in gallery",hotkey:"Arrow Right"},{title:"Toggle Gallery Pin",desc:"Pins and unpins the gallery to the UI",hotkey:"Shift+G"},{title:"Increase Gallery Image Size",desc:"Increases gallery thumbnails size",hotkey:"Shift+Up"},{title:"Decrease Gallery Image Size",desc:"Decreases gallery thumbnails size",hotkey:"Shift+Down"}],s=[{title:"Select Brush",desc:"Selects the canvas brush",hotkey:"B"},{title:"Select Eraser",desc:"Selects the canvas eraser",hotkey:"E"},{title:"Decrease Brush Size",desc:"Decreases the size of the canvas brush/eraser",hotkey:"["},{title:"Increase Brush Size",desc:"Increases the size of the canvas brush/eraser",hotkey:"]"},{title:"Decrease Brush Opacity",desc:"Decreases the opacity of the canvas brush",hotkey:"Shift + ["},{title:"Increase Brush Opacity",desc:"Increases the opacity of the canvas brush",hotkey:"Shift + ]"},{title:"Move Tool",desc:"Allows canvas navigation",hotkey:"V"},{title:"Fill Bounding Box",desc:"Fills the bounding box with brush color",hotkey:"Shift + F"},{title:"Erase Bounding Box",desc:"Erases the bounding box area",hotkey:"Delete / Backspace"},{title:"Select Color Picker",desc:"Selects the canvas color picker",hotkey:"C"},{title:"Toggle Snap",desc:"Toggles Snap to Grid",hotkey:"N"},{title:"Quick Toggle Move",desc:"Temporarily toggles Move mode",hotkey:"Hold Space"},{title:"Toggle Layer",desc:"Toggles mask/base layer selection",hotkey:"Q"},{title:"Clear Mask",desc:"Clear the entire mask",hotkey:"Shift+C"},{title:"Hide Mask",desc:"Hide and unhide mask",hotkey:"H"},{title:"Show/Hide Bounding Box",desc:"Toggle visibility of bounding box",hotkey:"Shift+H"},{title:"Merge Visible",desc:"Merge all visible layers of canvas",hotkey:"Shift+M"},{title:"Save To Gallery",desc:"Save current canvas to gallery",hotkey:"Shift+S"},{title:"Copy to Clipboard",desc:"Copy current canvas to clipboard",hotkey:"Ctrl+C"},{title:"Download Image",desc:"Download current canvas",hotkey:"Shift+D"},{title:"Undo Stroke",desc:"Undo a brush stroke",hotkey:"Ctrl+Z"},{title:"Redo Stroke",desc:"Redo a brush stroke",hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:"Reset View",desc:"Reset Canvas View",hotkey:"R"},{title:"Previous Image",desc:"Previous Staging Area Image",hotkey:"Arrow Left"},{title:"Next Image",desc:"Next Staging Area Image",hotkey:"Arrow Right"},{title:"Accept Image",desc:"Accept Current Staging Area Image",hotkey:"Enter"}],l=u=>{const h=[];return u.forEach((g,m)=>{h.push(S(nTe,{title:g.title,description:g.desc,hotkey:g.hotkey},m))}),S("div",{className:"hotkey-modal-category",children:h})};return X(Rn,{children:[C.exports.cloneElement(e,{onClick:n}),X(l1,{isOpen:t,onClose:r,children:[S(u1,{}),X(Yv,{className:" modal hotkeys-modal",children:[S(x_,{className:"modal-close-btn"}),S("h1",{children:"Keyboard Shorcuts"}),S("div",{className:"hotkeys-modal-items",children:X(OS,{allowMultiple:!0,children:[X(Qf,{children:[X(Xf,{className:"hotkeys-modal-button",children:[S("h2",{children:"App Hotkeys"}),S(Zf,{})]}),S(Jf,{children:l(i)})]}),X(Qf,{children:[X(Xf,{className:"hotkeys-modal-button",children:[S("h2",{children:"General Hotkeys"}),S(Zf,{})]}),S(Jf,{children:l(o)})]}),X(Qf,{children:[X(Xf,{className:"hotkeys-modal-button",children:[S("h2",{children:"Gallery Hotkeys"}),S(Zf,{})]}),S(Jf,{children:l(a)})]}),X(Qf,{children:[X(Xf,{className:"hotkeys-modal-button",children:[S("h2",{children:"Unified Canvas Hotkeys"}),S(Zf,{})]}),S(Jf,{children:l(s)})]})]})})]})]})]})}const iTe=e=>{const{isProcessing:t,isConnected:n}=ye(l=>l.system),r=De(),{name:i,status:o,description:a}=e,s=()=>{r($H(i))};return X("div",{className:"model-list-item",children:[S(bi,{label:a,hasArrow:!0,placement:"bottom",children:S("div",{className:"model-list-item-name",children:i})}),S(Lz,{}),S("div",{className:`model-list-item-status ${o.split(" ").join("-")}`,children:o}),S("div",{className:"model-list-item-load-btn",children:S(ja,{size:"sm",onClick:s,isDisabled:o==="active"||t||!n,children:"Load"})})]})},oTe=rt(e=>e.system,e=>{const t=He.map(e.model_list,(r,i)=>({name:i,...r})),n=t.find(r=>r.status==="active");return{models:t,activeModel:n}}),aTe=()=>{const{models:e}=ye(oTe);return S(OS,{allowToggle:!0,className:"model-list-accordion",variant:"unstyled",children:X(Qf,{children:[S(Xf,{children:X("div",{className:"model-list-button",children:[S("h2",{children:"Models"}),S(Zf,{})]})}),S(Jf,{children:S("div",{className:"model-list-list",children:e.map((t,n)=>S(iTe,{name:t.name,status:t.status,description:t.description},n))})})]})})},sTe=rt([Hu,sk],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:He.map(o,(u,h)=>h),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),lTe=({children:e})=>{const t=De(),n=ye(E=>E.options.steps),{isOpen:r,onOpen:i,onClose:o}=Hv(),{isOpen:a,onOpen:s,onClose:l}=Hv(),{shouldDisplayInProgressType:u,shouldConfirmOnDelete:h,shouldDisplayGuides:g,saveIntermediatesInterval:m,enableImageDebugging:v,shouldUseCanvasBetaLayout:b}=ye(sTe),w=()=>{rG.purge().then(()=>{o(),s()})},P=E=>{E>n&&(E=n),E<1&&(E=1),t(j4e(E))};return X(Rn,{children:[C.exports.cloneElement(e,{onClick:i}),X(l1,{isOpen:r,onClose:o,children:[S(u1,{}),X(Yv,{className:"modal settings-modal",children:[S(US,{className:"settings-modal-header",children:"Settings"}),S(x_,{className:"modal-close-btn"}),X(jv,{className:"settings-modal-content",children:[X("div",{className:"settings-modal-items",children:[S("div",{className:"settings-modal-item",children:S(aTe,{})}),X("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[S(Is,{label:"Display In-Progress Images",validValues:l4e,value:u,onChange:E=>t(F4e(E.target.value))}),u==="full-res"&&S(Os,{label:"Save images every n steps",min:1,max:n,step:1,onChange:P,value:m,width:"auto",textAlign:"center"})]}),S($a,{styleClass:"settings-modal-item",label:"Confirm on Delete",isChecked:h,onChange:E=>t(_H(E.target.checked))}),S($a,{styleClass:"settings-modal-item",label:"Display Help Icons",isChecked:g,onChange:E=>t(V4e(E.target.checked))}),S($a,{styleClass:"settings-modal-item",label:"Use Canvas Beta Layout",isChecked:b,onChange:E=>t(VEe(E.target.checked))})]}),X("div",{className:"settings-modal-items",children:[S("h2",{style:{fontWeight:"bold"},children:"Developer"}),S($a,{styleClass:"settings-modal-item",label:"Enable Image Debugging",isChecked:v,onChange:E=>t(Y4e(E.target.checked))})]}),X("div",{className:"settings-modal-reset",children:[S(sh,{size:"md",children:"Reset Web UI"}),S(ja,{colorScheme:"red",onClick:w,children:"Reset Web UI"}),S(Mo,{children:"Resetting the web UI only resets the browser's local cache of your images and remembered settings. It does not delete any images from disk."}),S(Mo,{children:"If images aren't showing up in the gallery or something else isn't working, please try resetting before submitting an issue on GitHub."})]})]}),S(VS,{children:S(ja,{onClick:o,className:"modal-close-btn",children:"Close"})})]})]}),X(l1,{closeOnOverlayClick:!1,isOpen:a,onClose:l,isCentered:!0,children:[S(u1,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),S(Yv,{children:S(jv,{pb:6,pt:6,children:S(bt,{justifyContent:"center",children:S(Mo,{fontSize:"lg",children:"Web UI has been reset. Refresh the page to reload."})})})})]})]})},uTe=rt(e=>e.system,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),cTe=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=ye(uTe),s=De();let l;e&&!o?l="status-good":l="status-bad";let u=i;return["generating","preparing","saving image","restoring faces","upscaling"].includes(u.toLowerCase())&&(l="status-working"),u&&t&&r>1&&(u+=` (${n}/${r})`),S(bi,{label:o&&!a?"Click to clear, check logs for details":void 0,children:S(Mo,{cursor:o&&!a?"pointer":"initial",onClick:()=>{(o||!a)&&s(kH())},className:`status ${l}`,children:u})})},dTe=["dark","light","green"];function fTe(){const{setColorMode:e}=i2(),t=De(),n=ye(i=>i.options.currentTheme),r=i=>{e(i),t(MEe(i))};return S(Il,{trigger:"hover",triggerComponent:S(Xe,{"aria-label":"Theme",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:S(wSe,{})}),children:S(Rz,{align:"stretch",children:dTe.map(i=>S(Ro,{style:{width:"6rem"},leftIcon:n===i?S(dk,{}):void 0,size:"sm",onClick:()=>r(i),children:i.charAt(0).toUpperCase()+i.slice(1)},i))})})}const hTe=rt([Hu],e=>{const{isProcessing:t,model_list:n}=e,r=He.map(n,(a,s)=>s),i=He.reduce(n,(a,s,l)=>(s.status==="active"&&(a=l),a),""),o=n[i].description;return{models:r,activeModel:i,isProcessing:t,activeDesc:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),pTe=()=>{const e=De(),{models:t,activeModel:n,isProcessing:r,activeDesc:i}=ye(hTe);return S(bt,{style:{paddingLeft:"0.3rem"},children:S(Is,{style:{fontSize:"0.8rem"},tooltip:i,isDisabled:r,value:n,validValues:t,onChange:a=>{e($H(a.target.value))}})})},gTe=()=>X("div",{className:"site-header",children:[X("div",{className:"site-header-left-side",children:[S("img",{src:uW,alt:"invoke-ai-logo"}),X("h1",{children:["invoke ",S("strong",{children:"ai"})]})]}),X("div",{className:"site-header-right-side",children:[S(cTe,{}),S(pTe,{}),S(rTe,{children:S(Xe,{"aria-label":"Hotkeys",tooltip:"Hotkeys",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:S(SSe,{})})}),S(fTe,{}),S(Xe,{"aria-label":"Report Bug",tooltip:"Report Bug",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(lh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:S(fSe,{})})}),S(Xe,{"aria-label":"Link to Github Repo",tooltip:"Github",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(lh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:S(sSe,{})})}),S(Xe,{"aria-label":"Link to Discord Server",tooltip:"Discord",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(lh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:S(aSe,{})})}),S(lTe,{children:S(Xe,{"aria-label":"Settings",tooltip:"Settings",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(pb,{})})})]})]}),mTe=rt(e=>e.system,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),vTe=rt(e=>e.system,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),yTe=()=>{const e=De(),t=ye(mTe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=ye(vTe),[o,a]=C.exports.useState(!0),s=C.exports.useRef(null);C.exports.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(kH()),e(zw(!n))};return Ue("`",()=>{e(zw(!n))},[n]),Ue("esc",()=>{e(zw(!1))}),X(Rn,{children:[n&&S(yW,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:S("div",{className:"console",ref:s,onScroll:()=>{!s.current||o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=h;return X("div",{className:`console-entry console-${b}-color`,children:[X("p",{className:"console-timestamp",children:[m,":"]}),S("p",{className:"console-message",children:v})]},g)})})}),n&&S(bi,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:S(Ya,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:S(lSe,{}),onClick:()=>a(!o)})}),S(bi,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:S(Ya,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?S(xSe,{}):S(AH,{}),onClick:l})})]})};function STe(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV||{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}var bTe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function L2(e,t){var n=xTe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function xTe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=bTe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var wTe=[".DS_Store","Thumbs.db"];function CTe(e){return w1(this,void 0,void 0,function(){return C1(this,function(t){return D4(e)&&_Te(e.dataTransfer)?[2,TTe(e.dataTransfer,e.type)]:kTe(e)?[2,ETe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,PTe(e)]:[2,[]]})})}function _Te(e){return D4(e)}function kTe(e){return D4(e)&&D4(e.target)}function D4(e){return typeof e=="object"&&e!==null}function ETe(e){return t9(e.target.files).map(function(t){return L2(t)})}function PTe(e){return w1(this,void 0,void 0,function(){var t;return C1(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return L2(r)})]}})})}function TTe(e,t){return w1(this,void 0,void 0,function(){var n,r;return C1(this,function(i){switch(i.label){case 0:return e.items?(n=t9(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(LTe))]):[3,2];case 1:return r=i.sent(),[2,rO(GU(r))];case 2:return[2,rO(t9(e.files).map(function(o){return L2(o)}))]}})})}function rO(e){return e.filter(function(t){return wTe.indexOf(t.name)===-1})}function t9(e){if(e===null)return[];for(var t=[],n=0;n`.replaceAll("black",e),I_e=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ye(O_e),[a,s]=C.exports.useState(null),[l,u]=C.exports.useState(0),h=C.exports.useRef(null),g=C.exports.useCallback(()=>{u(l+1),setTimeout(g,500)},[l]);return C.exports.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=DR(n)},[a,n]),C.exports.useEffect(()=>{!a||(a.src=DR(n))},[a,n]),C.exports.useEffect(()=>{const m=setInterval(()=>u(v=>(v+1)%5),50);return()=>clearInterval(m)},[]),!a||!ii.exports.isNumber(r.x)||!ii.exports.isNumber(r.y)||!ii.exports.isNumber(o)||!ii.exports.isNumber(i.width)||!ii.exports.isNumber(i.height)?null:S(zu,{ref:h,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:ii.exports.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},D_e=rt([Qt],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),N_e=e=>{const t=De(),{isMoveStageKeyHeld:n,stageScale:r}=ye(D_e);return C.exports.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=He.clamp(r*ebe**s,tbe,nbe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(_be(l)),t(sW(u))},[e,n,r,t])},jk=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},ZV=()=>{const e=De(),t=Ds(),n=XV();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Zp.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(ybe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(sbe())}}},B_e=rt([Tr,Qt,vr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),z_e=e=>{const t=De(),{tool:n,isStaging:r}=ye(B_e),{commitColorUnderCursor:i}=ZV();return C.exports.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(w4(!0));return}if(n==="colorPicker"){i();return}const a=jk(e.current);!a||(o.evt.preventDefault(),t(QH(!0)),t(abe([a.x,a.y])))},[e,n,r,t,i])},F_e=rt([Tr,Qt,vr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),$_e=(e,t)=>{const n=De(),{tool:r,isDrawing:i,isStaging:o}=ye(F_e);return C.exports.useCallback(()=>{if(r==="move"||o){n(w4(!1));return}if(!t.current&&i&&e.current){const a=jk(e.current);if(!a)return;n(KH([a.x,a.y]))}else t.current=!1;n(QH(!1))},[t,n,i,o,e,r])},H_e=rt([Tr,Qt,vr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),W_e=(e,t,n)=>{const r=De(),{isDrawing:i,tool:o,isStaging:a}=ye(H_e),{updateColorUnderCursor:s}=ZV();return C.exports.useCallback(()=>{if(!e.current)return;const l=jk(e.current);if(!!l){if(r(Sbe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(KH([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},V_e=()=>{const e=De();return C.exports.useCallback(()=>{e(cbe())},[e])},U_e=rt([Qt,vr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),G_e=()=>{const e=De(),{tool:t,isStaging:n,isMovingBoundingBox:r}=ye(U_e);return{handleDragStart:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(w4(!0))},[e,r,n,t]),handleDragMove:C.exports.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(sW(o))},[e,r,n,t]),handleDragEnd:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(w4(!1))},[e,r,n,t])}};var Mf=C.exports,j_e=function(t,n,r){const i=Mf.useRef("loading"),o=Mf.useRef(),[a,s]=Mf.useState(0),l=Mf.useRef(),u=Mf.useRef(),h=Mf.useRef();return(l.current!==t||u.current!==n||h.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,h.current=r),Mf.useLayoutEffect(function(){if(!t)return;var g=document.createElement("img");function m(){i.current="loaded",o.current=g,s(Math.random())}function v(){i.current="failed",o.current=void 0,s(Math.random())}return g.addEventListener("load",m),g.addEventListener("error",v),n&&(g.crossOrigin=n),r&&(g.referrerpolicy=r),g.src=t,function(){g.removeEventListener("load",m),g.removeEventListener("error",v)}},[t,n,r]),[o.current,i.current]};const QV=e=>{const{url:t,x:n,y:r}=e,[i]=j_e(t);return S(YV,{x:n,y:r,image:i,listening:!1})},Y_e=rt([Qt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),q_e=()=>{const{objects:e}=ye(Y_e);return e?S(Bu,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(x4(t))return S(QV,{x:t.x,y:t.y,url:t.image.url},n);if(ISe(t)){const r=S(O4,{points:t.points,stroke:t.color?ch(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?S(Bu,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(DSe(t))return S(zu,{x:t.x,y:t.y,width:t.width,height:t.height,fill:ch(t.color)},n);if(NSe(t))return S(zu,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},K_e=rt([Qt],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),X_e={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},Z_e=()=>{const{colorMode:e}=i2(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=ye(K_e),[i,o]=C.exports.useState([]),a=C.exports.useCallback(s=>s/t,[t]);return C.exports.useLayoutEffect(()=>{const s=X_e[e],{width:l,height:u}=r,{x:h,y:g}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(h),y:a(g)}},v={x:Math.ceil(a(h)/64)*64,y:Math.ceil(a(g)/64)*64},b={x1:-v.x,y1:-v.y,x2:a(l)-v.x+64,y2:a(u)-v.y+64},P={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},E=P.x2-P.x1,_=P.y2-P.y1,T=Math.round(E/64)+1,M=Math.round(_/64)+1,O=He.range(0,T).map(D=>S(O4,{x:P.x1+D*64,y:P.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),I=He.range(0,M).map(D=>S(O4,{x:P.x1,y:P.y1+D*64,points:[0,0,E,0],stroke:s,strokeWidth:1},`y_${D}`));o(O.concat(I))},[t,n,r,e,a]),S(Bu,{children:i})},Q_e=rt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:He.isEqual}}),J_e=e=>{const{...t}=e,n=ye(Q_e),[r,i]=C.exports.useState(null);if(C.exports.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?S(YV,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},v0=e=>Math.round(e*100)/100,eke=rt([Qt],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${v0(n)}, ${v0(r)})`}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function tke(){const{cursorCoordinatesString:e}=ye(eke);return S("div",{children:`Cursor Position: ${e}`})}const nke=rt([Qt],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:h},stageScale:g,shouldShowCanvasDebugInfo:m,layer:v,boundingBoxScaleMethod:b}=e;let w="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(w="var(--status-working-color)"),{activeLayerColor:v==="mask"?"var(--status-working-color)":"inherit",activeLayerString:v.charAt(0).toUpperCase()+v.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${v0(u)}, ${v0(h)})`,boundingBoxDimensionsString:`${o}\xD7${a}`,scaledBoundingBoxDimensionsString:`${s}\xD7${l}`,canvasCoordinatesString:`${v0(r)}\xD7${v0(i)}`,canvasDimensionsString:`${t}\xD7${n}`,canvasScaleString:Math.round(g*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none"}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),rke=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:g}=ye(nke);return X("div",{className:"canvas-status-text",children:[S("div",{style:{color:e},children:`Active Layer: ${t}`}),S("div",{children:`Canvas Scale: ${u}%`}),g&&S("div",{style:{color:n},children:`Bounding Box: ${i}`}),a&&S("div",{style:{color:n},children:`Scaled Bounding Box: ${o}`}),h&&X(Rn,{children:[S("div",{children:`Bounding Box Position: ${r}`}),S("div",{children:`Canvas Dimensions: ${l}`}),S("div",{children:`Canvas Position: ${s}`}),S(tke,{})]})]})},ike=rt([Qt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),oke=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=ye(ike);return X(Bu,{...t,children:[r&&n&&S(QV,{url:n.image.url,x:o,y:a}),i&&X(Bu,{children:[S(zu,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),S(zu,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},ake=rt([Qt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),ske=()=>{const e=De(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=ye(ake),o=C.exports.useCallback(()=>{e(kM(!0))},[e]),a=C.exports.useCallback(()=>{e(kM(!1))},[e]);Ue(["left"],()=>{s()},{enabled:()=>!0,preventDefault:!0}),Ue(["right"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Ue(["enter"],()=>{u()},{enabled:()=>!0,preventDefault:!0});const s=()=>e(fbe()),l=()=>e(dbe()),u=()=>e(lbe());return r?S(bt,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:o,onMouseOut:a,children:X(ji,{isAttached:!0,children:[S(Xe,{tooltip:"Previous (Left)","aria-label":"Previous (Left)",icon:S(uSe,{}),onClick:s,"data-selected":!0,isDisabled:t}),S(Xe,{tooltip:"Next (Right)","aria-label":"Next (Right)",icon:S(cSe,{}),onClick:l,"data-selected":!0,isDisabled:n}),S(Xe,{tooltip:"Accept (Enter)","aria-label":"Accept (Enter)",icon:S(dk,{}),onClick:u,"data-selected":!0}),S(Xe,{tooltip:"Show/Hide","aria-label":"Show/Hide","data-alert":!i,icon:i?S(mSe,{}):S(gSe,{}),onClick:()=>e(wbe(!i)),"data-selected":!0}),S(Xe,{tooltip:"Save to Gallery","aria-label":"Save to Gallery",icon:S(pk,{}),onClick:()=>e(VSe(r.image.url)),"data-selected":!0}),S(Xe,{tooltip:"Discard All","aria-label":"Discard All",icon:S(hk,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(ube()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},lke=rt(Qt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),uke=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ye(lke);return X(Bu,{children:[S(zu,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),S(zu,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},cke=rt([Qt,vr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:h,isMovingStage:g,shouldShowIntermediates:m,shouldShowGrid:v,shouldRestrictStrokesToBox:b}=e;let w="none";return h==="move"||t?g?w="grabbing":w="grab":o?w=void 0:b&&!a&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:v,stageCoordinates:u,stageCursor:w,stageDimensions:l,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),JV=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:h}=ye(cke);R_e();const g=C.exports.useRef(null),m=C.exports.useRef(null),v=C.exports.useCallback($=>{A_e($),g.current=$},[]),b=C.exports.useCallback($=>{L_e($),m.current=$},[]),w=C.exports.useRef({x:0,y:0}),P=C.exports.useRef(!1),E=N_e(g),_=z_e(g),T=$_e(g,P),M=W_e(g,P,w),O=V_e(),{handleDragStart:I,handleDragMove:D,handleDragEnd:B}=G_e();return S("div",{className:"inpainting-canvas-container",children:X("div",{className:"inpainting-canvas-wrapper",children:[X(w_e,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:M,onTouchEnd:T,onMouseDown:_,onMouseLeave:O,onMouseMove:M,onMouseUp:T,onDragStart:I,onDragMove:D,onDragEnd:B,onContextMenu:$=>$.evt.preventDefault(),onWheel:E,draggable:(l==="move"||u)&&!t,children:[S(fm,{id:"grid",visible:r,children:S(Z_e,{})}),S(fm,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:S(q_e,{})}),X(fm,{id:"mask",visible:e,listening:!1,children:[S(__e,{visible:!0,listening:!1}),S(I_e,{listening:!1})]}),S(fm,{children:S(uke,{})}),X(fm,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&S(E_e,{visible:l!=="move",listening:!1}),S(oke,{visible:u}),h&&S(J_e,{}),S(T_e,{visible:n&&!u})]})]}),S(rke,{}),S(ske,{})]})})},dke=rt([Qt,Tr,Hu],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function eU(){const e=De(),{canUndo:t,activeTabName:n}=ye(dke),r=()=>{e(kbe())};return Ue(["meta+z","ctrl+z"],()=>{r()},{enabled:()=>t,preventDefault:!0},[n,t]),S(Xe,{"aria-label":"Undo (Ctrl+Z)",tooltip:"Undo (Ctrl+Z)",icon:S(ASe,{}),onClick:r,isDisabled:!t})}const fke=rt([Qt,Tr,Hu],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function tU(){const e=De(),{canRedo:t,activeTabName:n}=ye(fke),r=()=>{e(hbe())};return Ue(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{r()},{enabled:()=>t,preventDefault:!0},[n,t]),S(Xe,{"aria-label":"Redo (Ctrl+Shift+Z)",tooltip:"Redo (Ctrl+Shift+Z)",icon:S(ESe,{}),onClick:r,isDisabled:!t})}const nU=Pe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:h,onClose:g}=Hv(),m=C.exports.useRef(null),v=()=>{r(),g()},b=()=>{o&&o(),g()};return X(Rn,{children:[C.exports.cloneElement(l,{onClick:h,ref:t}),S(KF,{isOpen:u,leastDestructiveRef:m,onClose:g,children:S(u1,{children:X(XF,{className:"modal",children:[S(US,{fontSize:"lg",fontWeight:"bold",children:s}),S(jv,{children:a}),X(VS,{children:[S(ja,{ref:m,onClick:b,className:"modal-close-btn",children:i}),S(ja,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})}),rU=()=>{const e=ye(vr),t=De();return X(nU,{title:"Empty Temp Image Folder",acceptCallback:()=>{t(USe()),t(Ck()),t(XH())},acceptButtonText:"Empty Folder",triggerComponent:S(Ro,{leftIcon:S(Ah,{}),size:"sm",isDisabled:e,children:"Empty Temp Image Folder"}),children:[S("p",{children:"Emptying the temp image folder also fully resets the Unified Canvas. This includes all undo/redo history, images in the staging area, and the canvas base layer."}),S("br",{}),S("p",{children:"Are you sure you want to empty the temp folder?"})]})},iU=()=>{const e=ye(vr),t=De();return X(nU,{title:"Clear Canvas History",acceptCallback:()=>t(XH()),acceptButtonText:"Clear History",triggerComponent:S(Ro,{size:"sm",leftIcon:S(Ah,{}),isDisabled:e,children:"Clear Canvas History"}),children:[S("p",{children:"Clearing the canvas history leaves your current canvas intact, but irreversibly clears the undo and redo history."}),S("br",{}),S("p",{children:"Are you sure you want to clear the canvas history?"})]})},hke=rt([Qt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),pke=()=>{const e=De(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=ye(hke);return Ue(["n"],()=>{e(_4(!s))},{enabled:!0,preventDefault:!0},[s]),S(Il,{trigger:"hover",triggerComponent:S(Xe,{tooltip:"Canvas Settings","aria-label":"Canvas Settings",icon:S(pb,{})}),children:X(bt,{direction:"column",gap:"0.5rem",children:[S(fr,{label:"Show Intermediates",isChecked:a,onChange:h=>e(aW(h.target.checked))}),S(fr,{label:"Show Grid",isChecked:o,onChange:h=>e(oW(h.target.checked))}),S(fr,{label:"Snap to Grid",isChecked:s,onChange:h=>e(_4(h.target.checked))}),S(fr,{label:"Darken Outside Selection",isChecked:r,onChange:h=>e(nW(h.target.checked))}),S(fr,{label:"Auto Save to Gallery",isChecked:t,onChange:h=>e(eW(h.target.checked))}),S(fr,{label:"Save Box Region Only",isChecked:n,onChange:h=>e(tW(h.target.checked))}),S(fr,{label:"Limit Strokes to Box",isChecked:l,onChange:h=>e(lW(h.target.checked))}),S(fr,{label:"Show Canvas Debug Info",isChecked:i,onChange:h=>e(iW(h.target.checked))}),S(iU,{}),S(rU,{})]})})};function Ab(){return(Ab=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function W7(e){var t=C.exports.useRef(e),n=C.exports.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var p1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:P.buttons>0)&&i.current?o(NR(i.current,P,s.current)):w(!1)},b=function(){return w(!1)};function w(P){var E=l.current,_=V7(i.current),T=P?_.addEventListener:_.removeEventListener;T(E?"touchmove":"mousemove",v),T(E?"touchend":"mouseup",b)}return[function(P){var E=P.nativeEvent,_=i.current;if(_&&(BR(E),!function(M,O){return O&&!lv(M)}(E,l.current)&&_)){if(lv(E)){l.current=!0;var T=E.changedTouches||[];T.length&&(s.current=T[0].identifier)}_.focus(),o(NR(_,E,s.current)),w(!0)}},function(P){var E=P.which||P.keyCode;E<37||E>40||(P.preventDefault(),a({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},w]},[a,o]),h=u[0],g=u[1],m=u[2];return C.exports.useEffect(function(){return m},[m]),S("div",{...Ab({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:i,onKeyDown:g,tabIndex:0,role:"slider"})})}),Mb=function(e){return e.filter(Boolean).join(" ")},qk=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=Mb(["react-colorful__pointer",e.className]);return S("div",{className:o,style:{top:100*i+"%",left:100*n+"%"},children:S("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}})})},so=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},aU=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:so(e.h),s:so(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:so(i/2),a:so(r,2)}},U7=function(e){var t=aU(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},a6=function(e){var t=aU(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},gke=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:so(255*[r,s,a,a,l,r][u]),g:so(255*[l,r,r,s,a,a][u]),b:so(255*[a,a,l,r,r,s][u]),a:so(i,2)}},mke=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:so(60*(s<0?s+6:s)),s:so(o?a/o*100:0),v:so(o/255*100),a:i}},vke=se.memo(function(e){var t=e.hue,n=e.onChange,r=Mb(["react-colorful__hue",e.className]);return se.createElement("div",{className:r},se.createElement(Yk,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:p1(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":so(t),"aria-valuemax":"360","aria-valuemin":"0"},se.createElement(qk,{className:"react-colorful__hue-pointer",left:t/360,color:U7({h:t,s:100,v:100,a:1})})))}),yke=se.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:U7({h:t.h,s:100,v:100,a:1})};return se.createElement("div",{className:"react-colorful__saturation",style:r},se.createElement(Yk,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:p1(t.s+100*i.left,0,100),v:p1(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+so(t.s)+"%, Brightness "+so(t.v)+"%"},se.createElement(qk,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:U7(t)})))}),sU=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Ske(e,t,n){var r=W7(n),i=C.exports.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=C.exports.useRef({color:t,hsva:o});C.exports.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),C.exports.useEffect(function(){var u;sU(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=C.exports.useCallback(function(u){a(function(h){return Object.assign({},h,u)})},[]);return[o,l]}var bke=typeof window<"u"?C.exports.useLayoutEffect:C.exports.useEffect,xke=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},zR=new Map,wke=function(e){bke(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!zR.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,zR.set(t,n);var r=xke();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Cke=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+a6(Object.assign({},n,{a:0}))+", "+a6(Object.assign({},n,{a:1}))+")"},o=Mb(["react-colorful__alpha",t]),a=so(100*n.a);return se.createElement("div",{className:o},S("div",{className:"react-colorful__alpha-gradient",style:i}),se.createElement(Yk,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:p1(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},se.createElement(qk,{className:"react-colorful__alpha-pointer",left:n.a,color:a6(n)})))},_ke=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=oU(e,["className","colorModel","color","onChange"]),s=C.exports.useRef(null);wke(s);var l=Ske(n,i,o),u=l[0],h=l[1],g=Mb(["react-colorful",t]);return se.createElement("div",Ab({},a,{ref:s,className:g}),S(yke,{hsva:u,onChange:h}),S(vke,{hue:u.h,onChange:h}),se.createElement(Cke,{hsva:u,onChange:h,className:"react-colorful__last-control"}))},kke={defaultColor:{r:0,g:0,b:0,a:1},toHsva:mke,fromHsva:gke,equal:sU},Eke=function(e){return se.createElement(_ke,Ab({},e,{colorModel:kke}))};const I4=e=>{const{styleClass:t,...n}=e;return S(Eke,{className:`invokeai__color-picker ${t}`,...n})},Pke=rt([Qt,vr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:ch(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),Tke=()=>{const e=De(),{layer:t,maskColor:n,isMaskEnabled:r,shouldPreserveMaskedArea:i,isStaging:o}=ye(Pke);Ue(["q"],()=>{a()},{enabled:()=>!o,preventDefault:!0},[t]),Ue(["shift+c"],()=>{s()},{enabled:()=>!o,preventDefault:!0},[]),Ue(["h"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[r]);const a=()=>{e(C4(t==="mask"?"base":"mask"))},s=()=>e(wk()),l=()=>e(C2(!r));return S(Il,{trigger:"hover",triggerComponent:S(ji,{children:S(Xe,{"aria-label":"Masking Options",tooltip:"Masking Options",icon:S(bSe,{}),style:t==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:o})}),children:X(bt,{direction:"column",gap:"0.5rem",children:[S(fr,{label:"Enable Mask (H)",isChecked:r,onChange:l}),S(fr,{label:"Preserve Masked Area",isChecked:i,onChange:u=>e(rW(u.target.checked))}),S(I4,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:u=>e(JH(u))}),S(Ro,{size:"sm",leftIcon:S(Ah,{}),onClick:s,children:"Clear Mask (Shift+C)"})]})})};let k3;const Lke=new Uint8Array(16);function Ake(){if(!k3&&(k3=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!k3))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return k3(Lke)}const Mi=[];for(let e=0;e<256;++e)Mi.push((e+256).toString(16).slice(1));function Mke(e,t=0){return(Mi[e[t+0]]+Mi[e[t+1]]+Mi[e[t+2]]+Mi[e[t+3]]+"-"+Mi[e[t+4]]+Mi[e[t+5]]+"-"+Mi[e[t+6]]+Mi[e[t+7]]+"-"+Mi[e[t+8]]+Mi[e[t+9]]+"-"+Mi[e[t+10]]+Mi[e[t+11]]+Mi[e[t+12]]+Mi[e[t+13]]+Mi[e[t+14]]+Mi[e[t+15]]).toLowerCase()}const Rke=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),FR={randomUUID:Rke};function y0(e,t,n){if(FR.randomUUID&&!t&&!e)return FR.randomUUID();e=e||{};const r=e.random||(e.rng||Ake)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Mke(r)}const Oke=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),h=r?{x:Math.round(r.x+n.x),y:Math.round(r.y+n.y),width:Math.round(r.width),height:Math.round(r.height)}:{x:Math.round(a),y:Math.round(s),width:Math.round(l),height:Math.round(u)},g=e.toDataURL(h);return e.scale(i),{dataURL:g,boundingBox:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(l),height:Math.round(u)}}},Ike=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},Dke=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");!o||(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},Nke={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},td=(e=Nke)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(X4e("Exporting Image")),t(h0(!1));const u=n(),{stageScale:h,boundingBoxCoordinates:g,boundingBoxDimensions:m,stageCoordinates:v}=u.canvas,b=Ds();if(!b){t(Cu(!1)),t(h0(!0));return}const{dataURL:w,boundingBox:P}=Oke(b,h,v,i?{...g,...m}:void 0);if(!w){t(Cu(!1)),t(h0(!0));return}const E=new FormData;E.append("data",JSON.stringify({dataURL:w,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(window.location.origin+"/upload",{method:"POST",body:E})).json(),{url:M,width:O,height:I}=T,D={uuid:y0(),category:o?"result":"user",...T};a&&(Ike(M),t(Cm({title:"Image Download Started",status:"success",duration:2500,isClosable:!0}))),s&&(Dke(M,O,I),t(Cm({title:"Image Copied",status:"success",duration:2500,isClosable:!0}))),o&&(t(p0({image:D,category:"result"})),t(Cm({title:"Image Saved to Gallery",status:"success",duration:2500,isClosable:!0}))),l&&(t(bbe({kind:"image",layer:"base",...P,image:D})),t(Cm({title:"Canvas Merged",status:"success",duration:2500,isClosable:!0}))),t(Cu(!1)),t(a5("Connected")),t(h0(!0))},Bke=rt([Qt,vr,Hu],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),zke=()=>{const e=De(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=ye(Bke);Ue(["b"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[]),Ue(["e"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[t]),Ue(["c"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Ue(["shift+f"],()=>{l()},{enabled:()=>!i,preventDefault:!0}),Ue(["delete","backspace"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Ue(["BracketLeft"],()=>{e(U0(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Ue(["BracketRight"],()=>{e(U0(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Ue(["shift+BracketLeft"],()=>{e(V0({...n,a:He.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Ue(["shift+BracketRight"],()=>{e(V0({...n,a:He.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const o=()=>e(Ol("brush")),a=()=>e(Ol("eraser")),s=()=>e(Ol("colorPicker")),l=()=>e(qH()),u=()=>e(YH());return X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:S(NH,{}),"data-selected":t==="brush"&&!i,onClick:o,isDisabled:i}),S(Xe,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:S(RH,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:a}),S(Xe,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:S(IH,{}),isDisabled:i,onClick:l}),S(Xe,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:S(hk,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:u}),S(Xe,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:S(OH,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:s}),S(Il,{trigger:"hover",triggerComponent:S(Xe,{"aria-label":"Brush Options",tooltip:"Brush Options",icon:S(gk,{})}),children:X(bt,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[S(bt,{gap:"1rem",justifyContent:"space-between",children:S(Do,{label:"Size",value:r,withInput:!0,onChange:h=>e(U0(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),S(I4,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e(V0(h))})]})})]})};let $R;const Kk=()=>({setOpenUploader:e=>{e&&($R=e)},openUploader:$R}),Fke=rt([Hu,Qt,vr],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),$ke=()=>{const e=De(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=ye(Fke),s=Ds(),{openUploader:l}=Kk();Ue(["v"],()=>{u()},{enabled:()=>!n,preventDefault:!0},[]),Ue(["r"],()=>{h()},{enabled:()=>!0,preventDefault:!0},[s]),Ue(["shift+m"],()=>{m()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ue(["shift+s"],()=>{v()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ue(["meta+c","ctrl+c"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ue(["shift+d"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[s,t]);const u=()=>e(Ol("move")),h=()=>{const E=Ds();if(!E)return;const _=E.getClientRect({skipTransform:!0});e(ZH({contentRect:_}))},g=()=>{e(Ck()),e(gb())},m=()=>{e(td({cropVisible:!1,shouldSetAsInitialImage:!0}))},v=()=>{e(td({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},b=()=>{e(td({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},w=()=>{e(td({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))};return X("div",{className:"inpainting-settings",children:[S(Is,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:BH,onChange:E=>{const _=E.target.value;e(C4(_)),_==="mask"&&!r&&e(C2(!0))},isDisabled:n}),S(Tke,{}),S(zke,{}),X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:S(LH,{}),"data-selected":o==="move"||n,onClick:u}),S(Xe,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:S(MH,{}),onClick:h})]}),X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:S(DH,{}),onClick:m,isDisabled:n}),S(Xe,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:S(pk,{}),onClick:v,isDisabled:n}),S(Xe,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:S(w2,{}),onClick:b,isDisabled:n}),S(Xe,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:S(fk,{}),onClick:w,isDisabled:n})]}),X(ji,{isAttached:!0,children:[S(eU,{}),S(tU,{})]}),X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Upload",tooltip:"Upload",icon:S(hb,{}),onClick:l,isDisabled:n}),S(Xe,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:S(Ah,{}),onClick:g,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),S(ji,{isAttached:!0,children:S(pke,{})})]})},Hke=rt([Qt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),Wke=()=>{const e=De(),{doesCanvasNeedScaling:t}=ye(Hke);return C.exports.useLayoutEffect(()=>{e(ai(!0));const n=He.debounce(()=>{e(ai(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),S("div",{className:"workarea-single-view",children:S("div",{className:"workarea-split-view-left",children:X("div",{className:"inpainting-main-area",children:[S($ke,{}),S("div",{className:"inpainting-canvas-area",children:t?S(uV,{}):S(JV,{})})]})})})},Vke=rt([Qt,vr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function Uke(){const e=De(),{layer:t,isMaskEnabled:n,isStaging:r}=ye(Vke),i=()=>{e(C4(t==="mask"?"base":"mask"))};return Ue(["q"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[t]),S(Is,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:t,validValues:BH,onChange:a=>{const s=a.target.value;e(C4(s)),s==="mask"&&!n&&e(C2(!0))},isDisabled:r})}const Gke=rt([Qt,vr,Hu],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),jke=()=>{const e=De(),{tool:t,isStaging:n}=ye(Gke);Ue(["b"],()=>{r()},{enabled:()=>!n,preventDefault:!0},[]),Ue(["e"],()=>{i()},{enabled:()=>!n,preventDefault:!0},[t]),Ue(["c"],()=>{o()},{enabled:()=>!n,preventDefault:!0},[t]),Ue(["shift+f"],()=>{a()},{enabled:()=>!n,preventDefault:!0}),Ue(["delete","backspace"],()=>{s()},{enabled:()=>!n,preventDefault:!0});const r=()=>e(Ol("brush")),i=()=>e(Ol("eraser")),o=()=>e(Ol("colorPicker")),a=()=>e(qH()),s=()=>e(YH());return X(bt,{flexDirection:"column",gap:"0.5rem",children:[X(ji,{children:[S(Xe,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:S(NH,{}),"data-selected":t==="brush"&&!n,onClick:r,isDisabled:n}),S(Xe,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:S(RH,{}),"data-selected":t==="eraser"&&!n,isDisabled:n,onClick:i})]}),X(ji,{children:[S(Xe,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:S(IH,{}),isDisabled:n,onClick:a}),S(Xe,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:S(hk,{style:{transform:"rotate(45deg)"}}),isDisabled:n,onClick:s})]}),S(Xe,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:S(OH,{}),"data-selected":t==="colorPicker"&&!n,isDisabled:n,onClick:o,width:"max-content"})]})},Yke=rt([Qt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),qke=()=>{const e=De(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=ye(Yke);return S(Il,{trigger:"hover",triggerComponent:S(Xe,{tooltip:"Canvas Settings",tooltipProps:{placement:"bottom"},"aria-label":"Canvas Settings",icon:S(pb,{})}),children:X(bt,{direction:"column",gap:"0.5rem",children:[S(fr,{label:"Show Intermediates",isChecked:i,onChange:o=>e(aW(o.target.checked))}),S(fr,{label:"Auto Save to Gallery",isChecked:t,onChange:o=>e(eW(o.target.checked))}),S(fr,{label:"Save Box Region Only",isChecked:n,onChange:o=>e(tW(o.target.checked))}),S(fr,{label:"Show Canvas Debug Info",isChecked:r,onChange:o=>e(iW(o.target.checked))}),S(iU,{}),S(rU,{})]})})};function Kke(){const e=ye(i=>i.canvas.tool),t=ye(vr),n=De();Ue(["v"],()=>{r()},{enabled:()=>!t,preventDefault:!0},[]);const r=()=>n(Ol("move"));return S(Xe,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:S(LH,{}),"data-selected":e==="move"||t,onClick:r})}function Xke(){const e=Ds(),t=De();Ue(["r"],()=>{n()},{enabled:()=>!0,preventDefault:!0},[e]);const n=()=>{const r=Ds();if(!r)return;const i=r.getClientRect({skipTransform:!0});t(ZH({contentRect:i}))};return S(Xe,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:S(MH,{}),onClick:n})}function Zke(){const e=De(),t=Ds(),n=ye(vr),r=ye(o=>o.system.isProcessing);Ue(["shift+m"],()=>{i()},{enabled:()=>!n,preventDefault:!0},[t,r]);const i=()=>{e(td({cropVisible:!1,shouldSetAsInitialImage:!0}))};return S(Xe,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:S(DH,{}),onClick:i,isDisabled:n})}function Qke(){const e=ye(vr),t=Ds(),n=ye(a=>a.system.isProcessing),r=ye(a=>a.canvas.shouldCropToBoundingBoxOnSave),i=De();Ue(["shift+s"],()=>{o()},{enabled:()=>!e,preventDefault:!0},[t,n]);const o=()=>{i(td({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return S(Xe,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:S(pk,{}),onClick:o,isDisabled:e})}function Jke(){const e=ye(vr),t=Ds(),n=ye(a=>a.system.isProcessing),r=ye(a=>a.canvas.shouldCropToBoundingBoxOnSave),i=De();Ue(["meta+c","ctrl+c"],()=>{o()},{enabled:()=>!e,preventDefault:!0},[t,n]);const o=()=>{i(td({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return S(Xe,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:S(w2,{}),onClick:o,isDisabled:e})}function eEe(){const e=De(),t=Ds(),n=ye(vr),r=ye(a=>a.system.isProcessing),i=ye(a=>a.canvas.shouldCropToBoundingBoxOnSave);Ue(["shift+d"],()=>{o()},{enabled:()=>!n,preventDefault:!0},[t,r]);const o=()=>{e(td({cropVisible:!i,cropToBoundingBox:i,shouldDownload:!0}))};return S(Xe,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:S(fk,{}),onClick:o,isDisabled:n})}function tEe(){const e=ye(vr),{openUploader:t}=Kk();return S(Xe,{"aria-label":"Upload",tooltip:"Upload",icon:S(hb,{}),onClick:t,isDisabled:e})}function nEe(){const e=De(),t=ye(vr);return S(Xe,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:S(Ah,{}),onClick:()=>{e(Ck()),e(gb())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:t})}function rEe(){const e=ye(r=>r.options.shouldPinOptionsPanel),t=De();return X(bt,{flexDirection:"column",gap:"0.5rem",children:[S(Xe,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:()=>{t(ku(!0)),e&&setTimeout(()=>t(ai(!0)),400)},children:S(gk,{})}),S(bt,{children:S(vk,{iconButton:!0})}),S(bt,{children:S(yk,{width:"100%",height:"40px"})})]})}const iEe=()=>{const e=ye(t=>t.options.shouldShowOptionsPanel);return X(bt,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[S(Uke,{}),S(jke,{}),X(bt,{gap:"0.5rem",children:[S(Kke,{}),S(Xke,{})]}),X(bt,{columnGap:"0.5rem",children:[S(Zke,{}),S(Qke,{})]}),X(bt,{columnGap:"0.5rem",children:[S(Jke,{}),S(eEe,{})]}),X(bt,{gap:"0.5rem",children:[S(eU,{}),S(tU,{})]}),X(bt,{gap:"0.5rem",children:[S(tEe,{}),S(nEe,{})]}),S(qke,{}),!e&&S(rEe,{})]})};function oEe(){const e=De(),t=ye(r=>r.canvas.brushSize),n=ye(vr);return Ue(["BracketLeft"],()=>{e(U0(Math.max(t-5,5)))},{enabled:()=>!n,preventDefault:!0},[t]),Ue(["BracketRight"],()=>{e(U0(Math.min(t+5,500)))},{enabled:()=>!n,preventDefault:!0},[t]),S(Do,{label:"Size",value:t,withInput:!0,onChange:r=>e(U0(r)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px"})}const aEe=rt([Qt,vr],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function sEe(){const e=De(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=ye(aEe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return Ue(["shift+BracketLeft"],()=>{e(V0({...t,a:He.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Ue(["shift+BracketRight"],()=>{e(V0({...t,a:He.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),S(Il,{trigger:"hover",triggerComponent:S(Ld,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:X(bt,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&S(I4,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(V0(a))}),r==="mask"&&S(I4,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(JH(a))})]})})}function lU(){return X(bt,{columnGap:"1rem",alignItems:"center",children:[S(oEe,{}),S(sEe,{})]})}function lEe(){const e=De(),t=ye(n=>n.canvas.shouldRestrictStrokesToBox);return S(fr,{label:"Limit To Box",isChecked:t,onChange:n=>e(lW(n.target.checked))})}function uEe(){return X(bt,{gap:"1rem",alignItems:"center",children:[S(lU,{}),S(lEe,{})]})}function cEe(){const e=De();return S(Ro,{size:"sm",leftIcon:S(Ah,{}),onClick:()=>e(wk()),tooltip:"Clear Mask (Shift+C)",children:"Clear"})}function dEe(){const e=ye(r=>r.canvas.isMaskEnabled),t=De();return S(fr,{label:"Enable Mask (H)",isChecked:e,onChange:()=>t(C2(!e))})}function fEe(){const e=De(),t=ye(n=>n.canvas.shouldPreserveMaskedArea);return S(fr,{label:"Preserve Masked",isChecked:t,onChange:n=>e(rW(n.target.checked))})}function hEe(){return X(bt,{gap:"1rem",alignItems:"center",children:[S(lU,{}),S(dEe,{}),S(fEe,{}),S(cEe,{})]})}function pEe(){const e=ye(n=>n.canvas.shouldDarkenOutsideBoundingBox),t=De();return S(fr,{label:"Darken Outside",isChecked:e,onChange:n=>t(nW(n.target.checked))})}function gEe(){const e=ye(n=>n.canvas.shouldShowGrid),t=De();return S(fr,{label:"Show Grid",isChecked:e,onChange:n=>t(oW(n.target.checked))})}function mEe(){const e=ye(r=>r.canvas.shouldSnapToGrid),t=De();return S(fr,{label:"Snap to Grid (N)",isChecked:e,onChange:r=>t(_4(r.target.checked))})}function vEe(){return X(bt,{alignItems:"center",gap:"1rem",children:[S(gEe,{}),S(mEe,{}),S(pEe,{})]})}const yEe=rt([Qt],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function SEe(){const{tool:e,layer:t}=ye(yEe);return X(bt,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&S(uEe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&S(hEe,{}),e=="move"&&S(vEe,{})]})}const bEe=rt([Qt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),xEe=()=>{const e=De(),{doesCanvasNeedScaling:t}=ye(bEe);return C.exports.useLayoutEffect(()=>{e(ai(!0));const n=He.debounce(()=>{e(ai(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),S("div",{className:"workarea-single-view",children:X(bt,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[S(iEe,{}),X(bt,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[S(SEe,{}),t?S(uV,{}):S(JV,{})]})]})})};function wEe(){const e=ye(t=>t.options.shouldUseCanvasBetaLayout);return S(Ik,{optionsPanel:S(u7e,{}),styleClass:"inpainting-workarea-overrides",children:e?S(xEe,{}):S(Wke,{})})}const CEe=ut({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})});function _Ee(){return X("div",{className:"work-in-progress nodes-work-in-progress",children:[S("h1",{children:"Training"}),X("p",{children:["A dedicated workflow for training your own embeddings and checkpoints using Textual Inversion and Dreambooth from the web interface. ",S("br",{}),S("br",{}),"InvokeAI already supports training custom embeddings using Textual Inversion using the main script."]})]})}const kEe=ut({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),Hf={txt2img:{title:S(t4e,{fill:"black",boxSize:"2.5rem"}),workarea:S(H6e,{}),tooltip:"Text To Image"},img2img:{title:S(Q5e,{fill:"black",boxSize:"2.5rem"}),workarea:S(z6e,{}),tooltip:"Image To Image"},unifiedCanvas:{title:S(CEe,{fill:"black",boxSize:"2.5rem"}),workarea:S(wEe,{}),tooltip:"Unified Canvas"},nodes:{title:S(J5e,{fill:"black",boxSize:"2.5rem"}),workarea:S(X5e,{}),tooltip:"Nodes"},postprocess:{title:S(e4e,{fill:"black",boxSize:"2.5rem"}),workarea:S(Z5e,{}),tooltip:"Post Processing"},training:{title:S(kEe,{fill:"black",boxSize:"2.5rem"}),workarea:S(_Ee,{}),tooltip:"Training"}},Rb=He.map(Hf,(e,t)=>t);[...Rb];function EEe(){const e=ye(o=>o.options.activeTab),t=ye(o=>o.options.isLightBoxOpen),n=De();Ue("1",()=>{n(Lo(0))}),Ue("2",()=>{n(Lo(1))}),Ue("3",()=>{n(Lo(2))}),Ue("4",()=>{n(Lo(3))}),Ue("5",()=>{n(Lo(4))}),Ue("6",()=>{n(Lo(5))}),Ue("z",()=>{n(_u(!t))},[t]);const r=()=>{const o=[];return Object.keys(Hf).forEach(a=>{o.push(S(bi,{hasArrow:!0,label:Hf[a].tooltip,placement:"right",children:S(_$,{children:Hf[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(Hf).forEach(a=>{o.push(S(w$,{className:"app-tabs-panel",children:Hf[a].workarea},a))}),o};return X(x$,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Lo(o))},children:[S("div",{className:"app-tabs-list",children:r()}),S(C$,{className:"app-tabs-panels",children:t?S(e7e,{}):i()})]})}const uU={activeTab:0,cfgScale:7.5,codeformerFidelity:.75,currentTheme:"dark",facetoolStrength:.8,facetoolType:"gfpgan",height:512,hiresFix:!1,img2imgStrength:.75,infillMethod:"patchmatch",isLightBoxOpen:!1,iterations:1,maskPath:"",optionsPanelScrollPosition:0,perlin:0,prompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:10,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldHoldOptionsPanelOpen:!1,shouldLoopback:!1,shouldPinOptionsPanel:!0,shouldRandomizeSeed:!0,shouldRunESRGAN:!1,shouldRunFacetool:!1,shouldShowImageDetails:!1,shouldShowOptionsPanel:!0,showAdvancedOptions:!0,showDualDisplay:!0,steps:50,threshold:0,tileSize:32,upscalingLevel:4,upscalingStrength:.75,variationAmount:.1,width:512,shouldUseCanvasBetaLayout:!1},PEe=uU,cU=KS({name:"options",initialState:PEe,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=o5(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:h,hires_fix:g,width:m,height:v}=t.payload.image;o&&o.length>0?(e.seedWeights=b4(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=o5(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),l&&(e.threshold=l),typeof l>"u"&&(e.threshold=0),u&&(e.perlin=u),typeof u>"u"&&(e.perlin=0),typeof h=="boolean"&&(e.seamless=h),typeof g=="boolean"&&(e.hiresFix=g),m&&(e.width=m),v&&(e.height=v)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:h,seamless:g,hires_fix:m,width:v,height:b,strength:w,fit:P,init_image_path:E,mask_image_path:_}=t.payload.image;n==="img2img"&&(E&&(e.initialImage=E),_&&(e.maskPath=_),w&&(e.img2imgStrength=w),typeof P=="boolean"&&(e.shouldFitToWidthHeight=P)),a&&a.length>0?(e.seedWeights=b4(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i&&(e.prompt=o5(i)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),u&&(e.threshold=u),typeof u>"u"&&(e.threshold=0),h&&(e.perlin=h),typeof h>"u"&&(e.perlin=0),typeof g=="boolean"&&(e.seamless=g),typeof m=="boolean"&&(e.hiresFix=m),v&&(e.width=v),b&&(e.height=b),e.shouldRunESRGAN=!1,e.shouldRunFacetool=!1},resetOptionsState:e=>({...e,...uU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setShowAdvancedOptions:(e,t)=>{e.showAdvancedOptions=t.payload},setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=Rb.indexOf(t.payload)},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShowDualDisplay:(e,t)=>{e.showDualDisplay=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setShouldPinOptionsPanel:(e,t)=>{e.shouldPinOptionsPanel=t.payload},setShouldShowOptionsPanel:(e,t)=>{e.shouldShowOptionsPanel=t.payload},setOptionsPanelScrollPosition:(e,t)=>{e.optionsPanelScrollPosition=t.payload},setShouldHoldOptionsPanelOpen:(e,t)=>{e.shouldHoldOptionsPanelOpen=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setIsLightBoxOpen:(e,t)=>{e.isLightBoxOpen=t.payload},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload}}}),{clearInitialImage:dU,resetOptionsState:$Le,resetSeed:HLe,setActiveTab:Lo,setAllImageToImageParameters:TEe,setAllParameters:LEe,setAllTextToImageParameters:AEe,setCfgScale:fU,setCodeformerFidelity:hU,setCurrentTheme:MEe,setFacetoolStrength:c5,setFacetoolType:d5,setHeight:pU,setHiresFix:gU,setImg2imgStrength:G7,setInfillMethod:mU,setInitialImage:O1,setIsLightBoxOpen:_u,setIterations:REe,setMaskPath:vU,setOptionsPanelScrollPosition:OEe,setParameter:WLe,setPerlin:yU,setPrompt:Ob,setSampler:SU,setSeamBlur:HR,setSeamless:bU,setSeamSize:WR,setSeamSteps:VR,setSeamStrength:UR,setSeed:T2,setSeedWeights:xU,setShouldFitToWidthHeight:wU,setShouldGenerateVariations:IEe,setShouldHoldOptionsPanelOpen:DEe,setShouldLoopback:NEe,setShouldPinOptionsPanel:BEe,setShouldRandomizeSeed:zEe,setShouldRunESRGAN:FEe,setShouldRunFacetool:$Ee,setShouldShowImageDetails:CU,setShouldShowOptionsPanel:ku,setShowAdvancedOptions:VLe,setShowDualDisplay:HEe,setSteps:_U,setThreshold:kU,setTileSize:GR,setUpscalingLevel:j7,setUpscalingStrength:Y7,setVariationAmount:WEe,setWidth:EU,setShouldUseCanvasBetaLayout:VEe}=cU.actions,UEe=cU.reducer,Hl=Object.create(null);Hl.open="0";Hl.close="1";Hl.ping="2";Hl.pong="3";Hl.message="4";Hl.upgrade="5";Hl.noop="6";const f5=Object.create(null);Object.keys(Hl).forEach(e=>{f5[Hl[e]]=e});const GEe={type:"error",data:"parser error"},jEe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",YEe=typeof ArrayBuffer=="function",qEe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,PU=({type:e,data:t},n,r)=>jEe&&t instanceof Blob?n?r(t):jR(t,r):YEe&&(t instanceof ArrayBuffer||qEe(t))?n?r(t):jR(new Blob([t]),r):r(Hl[e]+(t||"")),jR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},YR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Rm=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),h=new Uint8Array(u);for(r=0;r>4,h[i++]=(a&15)<<4|s>>2,h[i++]=(s&3)<<6|l&63;return u},XEe=typeof ArrayBuffer=="function",TU=(e,t)=>{if(typeof e!="string")return{type:"message",data:LU(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ZEe(e.substring(1),t)}:f5[n]?e.length>1?{type:f5[n],data:e.substring(1)}:{type:f5[n]}:GEe},ZEe=(e,t)=>{if(XEe){const n=KEe(e);return LU(n,t)}else return{base64:!0,data:e}},LU=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},AU=String.fromCharCode(30),QEe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{PU(o,!1,s=>{r[a]=s,++i===n&&t(r.join(AU))})})},JEe=(e,t)=>{const n=e.split(AU),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function RU(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const tPe=setTimeout,nPe=clearTimeout;function Ib(e,t){t.useNativeTimers?(e.setTimeoutFn=tPe.bind(nd),e.clearTimeoutFn=nPe.bind(nd)):(e.setTimeoutFn=setTimeout.bind(nd),e.clearTimeoutFn=clearTimeout.bind(nd))}const rPe=1.33;function iPe(e){return typeof e=="string"?oPe(e):Math.ceil((e.byteLength||e.size)*rPe)}function oPe(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class aPe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class OU extends Kr{constructor(t){super(),this.writable=!1,Ib(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new aPe(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=TU(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const IU="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),q7=64,sPe={};let qR=0,E3=0,KR;function XR(e){let t="";do t=IU[e%q7]+t,e=Math.floor(e/q7);while(e>0);return t}function DU(){const e=XR(+new Date);return e!==KR?(qR=0,KR=e):e+"."+XR(qR++)}for(;E3{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};JEe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,QEe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=DU()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=NU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new Nl(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Nl extends Kr{constructor(t,n){super(),Ib(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=RU(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new zU(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch(r){}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}try{n.setRequestHeader("Accept","*/*")}catch(r){}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=Nl.requestsCount++,Nl.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=cPe,t)try{this.xhr.abort()}catch(n){}typeof document<"u"&&delete Nl.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Nl.requestsCount=0;Nl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ZR);else if(typeof addEventListener=="function"){const e="onpagehide"in nd?"pagehide":"unload";addEventListener(e,ZR,!1)}}function ZR(){for(let e in Nl.requests)Nl.requests.hasOwnProperty(e)&&Nl.requests[e].abort()}const FU=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),P3=nd.WebSocket||nd.MozWebSocket,QR=!0,hPe="arraybuffer",JR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class pPe extends OU{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=JR?{}:RU(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=QR&&!JR?n?new P3(t,n):new P3(t):new P3(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||hPe,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{QR&&this.ws.send(o)}catch(s){}i&&FU(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=DU()),this.supportsBinary||(t.b64=1);const i=NU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!P3}}const gPe={websocket:pPe,polling:fPe},mPe=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vPe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function K7(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=mPe.exec(e||""),o={},a=14;for(;a--;)o[vPe[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=yPe(o,o.path),o.queryKey=SPe(o,o.query),o}function yPe(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function SPe(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}class qc extends Kr{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=K7(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=K7(n.host).host),Ib(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=lPe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=MU,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new gPe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&qc.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;qc.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",g=>{if(!r)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;qc.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,h(),n.close(),n=null)}const a=g=>{const m=new Error("probe error: "+g);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(g){n&&g.name!==n.name&&o()}const h=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",qc.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){qc.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,$U=Object.prototype.toString,CPe=typeof Blob=="function"||typeof Blob<"u"&&$U.call(Blob)==="[object BlobConstructor]",_Pe=typeof File=="function"||typeof File<"u"&&$U.call(File)==="[object FileConstructor]";function Xk(e){return xPe&&(e instanceof ArrayBuffer||wPe(e))||CPe&&e instanceof Blob||_Pe&&e instanceof File}function h5(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case on.ACK:case on.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class LPe{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=EPe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const APe=Object.freeze(Object.defineProperty({__proto__:null,protocol:PPe,get PacketType(){return on},Encoder:TPe,Decoder:Zk},Symbol.toStringTag,{value:"Module"}));function xs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const MPe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class HU extends Kr{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[xs(t,"open",this.onopen.bind(this)),xs(t,"packet",this.onpacket.bind(this)),xs(t,"error",this.onerror.bind(this)),xs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(MPe.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:on.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:on.CONNECT,data:t})}):this.packet({type:on.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case on.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case on.EVENT:case on.BINARY_EVENT:this.onevent(t);break;case on.ACK:case on.BINARY_ACK:this.onack(t);break;case on.DISCONNECT:this.ondisconnect();break;case on.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:on.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:on.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}I1.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};I1.prototype.reset=function(){this.attempts=0};I1.prototype.setMin=function(e){this.ms=e};I1.prototype.setMax=function(e){this.max=e};I1.prototype.setJitter=function(e){this.jitter=e};class Q7 extends Kr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ib(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new I1({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||APe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new qc(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=xs(n,"open",function(){r.onopen(),t&&t()}),o=xs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xs(t,"ping",this.onping.bind(this)),xs(t,"data",this.ondata.bind(this)),xs(t,"error",this.onerror.bind(this)),xs(t,"close",this.onclose.bind(this)),xs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){FU(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new HU(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const hm={};function p5(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=bPe(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=hm[i]&&o in hm[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new Q7(r,t):(hm[i]||(hm[i]=new Q7(r,t)),l=hm[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(p5,{Manager:Q7,Socket:HU,io:p5,connect:p5});var RPe=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,OPe=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,IPe=/[^-+\dA-Z]/g;function To(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(eO[t]||t||eO.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},h=function(){return e[o()+"Hours"]()},g=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},v=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},w=function(){return DPe(e)},P=function(){return NPe(e)},E={d:function(){return a()},dd:function(){return sa(a())},ddd:function(){return Eo.dayNames[s()]},DDD:function(){return tO({y:u(),m:l(),d:a(),_:o(),dayName:Eo.dayNames[s()],short:!0})},dddd:function(){return Eo.dayNames[s()+7]},DDDD:function(){return tO({y:u(),m:l(),d:a(),_:o(),dayName:Eo.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return sa(l()+1)},mmm:function(){return Eo.monthNames[l()]},mmmm:function(){return Eo.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return sa(u(),4)},h:function(){return h()%12||12},hh:function(){return sa(h()%12||12)},H:function(){return h()},HH:function(){return sa(h())},M:function(){return g()},MM:function(){return sa(g())},s:function(){return m()},ss:function(){return sa(m())},l:function(){return sa(v(),3)},L:function(){return sa(Math.floor(v()/10))},t:function(){return h()<12?Eo.timeNames[0]:Eo.timeNames[1]},tt:function(){return h()<12?Eo.timeNames[2]:Eo.timeNames[3]},T:function(){return h()<12?Eo.timeNames[4]:Eo.timeNames[5]},TT:function(){return h()<12?Eo.timeNames[6]:Eo.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":BPe(e)},o:function(){return(b()>0?"-":"+")+sa(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+sa(Math.floor(Math.abs(b())/60),2)+":"+sa(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return w()},WW:function(){return sa(w())},N:function(){return P()}};return t.replace(RPe,function(_){return _ in E?E[_]():_.slice(1,_.length-1)})}var eO={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Eo={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},sa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},tO=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,h=new Date;h.setDate(h[o+"Date"]()-1);var g=new Date;g.setDate(g[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},v=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},w=function(){return h[o+"Date"]()},P=function(){return h[o+"Month"]()},E=function(){return h[o+"FullYear"]()},_=function(){return g[o+"Date"]()},T=function(){return g[o+"Month"]()},M=function(){return g[o+"FullYear"]()};return b()===n&&v()===r&&m()===i?l?"Tdy":"Today":E()===n&&P()===r&&w()===i?l?"Ysd":"Yesterday":M()===n&&T()===r&&_()===i?l?"Tmw":"Tomorrow":a},DPe=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},NPe=function(t){var n=t.getDay();return n===0&&(n=7),n},BPe=function(t){return(String(t).match(OPe)||[""]).pop().replace(IPe,"").replace(/GMT\+0000/g,"UTC")};const zPe=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(gM(!0)),t(a5("Connected")),t(WSe());const r=n().gallery;r.categories.result.latest_mtime?t(SM("result")):t(v7("result")),r.categories.user.latest_mtime?t(SM("user")):t(v7("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(gM(!1)),t(a5("Disconnected")),t(Po({timestamp:To(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{shouldLoopback:o,activeTab:a}=i.options,{boundingBox:s,generationMode:l,...u}=r,h={uuid:y0(),...u};if(["txt2img","img2img"].includes(l)&&t(p0({category:"result",image:{...h,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:g}=r;t(obe({image:{...h,category:"temp"},boundingBox:g})),i.canvas.shouldAutoSave&&t(p0({image:{...h,category:"result"},category:"result"}))}if(o)switch(Rb[a]){case"img2img":{t(O1(h));break}}t(Vw()),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(Ibe({uuid:y0(),...r,category:"result"})),r.isBase64||t(Po({timestamp:To(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(p0({category:"result",image:{uuid:y0(),...r,category:"result"}})),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(Cu(!0)),t(H4e(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(Po({timestamp:To(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(mM()),t(Vw())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:y0(),...l}));t(Obe({images:s,areMoreImagesAvailable:o,category:a})),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(U4e());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(p0({category:"result",image:r})),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(Vw())),t(Po({timestamp:To(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(fW(r));const{initialImage:o,maskPath:a}=n().options;((o==null?void 0:o.url)===i||o===i)&&t(dU()),a===i&&t(vU("")),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(W4e(r)),r.infill_methods.includes("patchmatch")||t(mU(r.infill_methods[0]))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(vM(o)),t(a5("Model Changed")),t(Cu(!1)),t(h0(!0)),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(vM(o)),t(Cu(!1)),t(h0(!0)),t(mM()),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Cm({title:"Temp Folder Emptied",status:"success",duration:2500,isClosable:!0}))}}},FPe=(e,t)=>{const{width:n,height:r}=t,i=document.createElement("div"),o=new Zp.Stage({container:i,width:n,height:r}),a=new Zp.Layer,s=new Zp.Layer;a.add(new Zp.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Zp.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l},$Pe=e=>{const t=window.open("");!t||e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},HPe=e=>{const t=Ds(),{generationMode:n,optionsState:r,canvasState:i,systemState:o}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:u,height:h,hiresFix:g,img2imgStrength:m,infillMethod:v,initialImage:b,iterations:w,perlin:P,prompt:E,sampler:_,seamBlur:T,seamless:M,seamSize:O,seamSteps:I,seamStrength:D,seed:B,seedWeights:$,shouldFitToWidthHeight:H,shouldGenerateVariations:j,shouldRandomizeSeed:ne,shouldRunESRGAN:V,shouldRunFacetool:q,steps:te,threshold:J,tileSize:Z,upscalingLevel:G,upscalingStrength:ee,variationAmount:le,width:me}=r,{shouldDisplayInProgressType:Me,saveIntermediatesInterval:Ce,enableImageDebugging:be}=o,we={prompt:E,iterations:w,steps:te,cfg_scale:a,threshold:J,perlin:P,height:h,width:me,sampler_name:_,seed:B,progress_images:Me==="full-res",progress_latents:Me==="latents",save_intermediates:Ce,generation_mode:n,init_mask:""};let Ve=!1,Ze=!1;if(we.seed=ne?xH(J_,ek):B,["txt2img","img2img"].includes(n)&&(we.seamless=M,we.hires_fix=g,V&&(Ve={level:G,strength:ee}),q&&(Ze={type:u,strength:l},u==="codeformer"&&(Ze.codeformer_fidelity=s))),n==="img2img"&&b&&(we.init_img=typeof b=="string"?b:b.url,we.strength=m,we.fit=H),n==="unifiedCanvas"&&t){const{layerState:{objects:it},boundingBoxCoordinates:pt,boundingBoxDimensions:kt,inpaintReplace:gt,shouldUseInpaintReplace:ht,stageScale:vt,isMaskEnabled:Te,shouldPreserveMaskedArea:ot,boundingBoxScaleMethod:Mt,scaledBoundingBoxDimensions:Je}=i,mt={...pt,...kt},un=FPe(Te?it.filter(mk):[],mt);we.init_mask=un,we.fit=!1,we.strength=m,we.invert_mask=ot,ht&&(we.inpaint_replace=gt),we.bounding_box=mt;const Et=t.scale();t.scale({x:1/vt,y:1/vt});const jt=t.getAbsolutePosition(),cn=t.toDataURL({x:mt.x+jt.x,y:mt.y+jt.y,width:mt.width,height:mt.height});be&&$Pe([{base64:un,caption:"mask sent as init_mask"},{base64:cn,caption:"image sent as init_img"}]),t.scale(Et),we.init_img=cn,we.progress_images=!1,Mt!=="none"&&(we.inpaint_width=Je.width,we.inpaint_height=Je.height),we.seam_size=O,we.seam_blur=T,we.seam_strength=D,we.seam_steps=I,we.tile_size=Z,we.infill_method=v,we.force_outpaint=!1}return j?(we.variation_amount=le,$&&(we.with_variations=g3e($))):we.variation_amount=0,be&&(we.enable_image_debugging=be),{generationParameters:we,esrganParameters:Ve,facetoolParameters:Ze}},WPe=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(Cu(!0));const o=r(),{options:a,system:s,canvas:l}=o,u={generationMode:i,optionsState:a,canvasState:l,systemState:s};n(q4e());const{generationParameters:h,esrganParameters:g,facetoolParameters:m}=HPe(u);t.emit("generateImage",h,g,m),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(Po({timestamp:To(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...g,...m})}`}))},emitRunESRGAN:i=>{n(Cu(!0));const o=r().options,{upscalingLevel:a,upscalingStrength:s}=o,l={upscale:[a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(Po({timestamp:To(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(Cu(!0));const o=r().options,{facetoolType:a,facetoolStrength:s,codeformerFidelity:l}=o,u={facetool_strength:s};a==="codeformer"&&(u.codeformer_fidelity=l),t.emit("runPostprocessing",i,{type:a,...u}),n(Po({timestamp:To(new Date,"isoDateTime"),message:`Face restoration (${a}) requested: ${JSON.stringify({file:i.url,...u})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(fW(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitRequestModelChange:i=>{n(G4e()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}},VPe=()=>{const{origin:e}=new URL(window.location.href),t=p5(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:h,onGenerationResult:g,onIntermediateResult:m,onProgressUpdate:v,onGalleryImages:b,onProcessingCanceled:w,onImageDeleted:P,onSystemConfig:E,onModelChanged:_,onModelChangeFailed:T,onTempFolderEmptied:M}=zPe(i),{emitGenerateImage:O,emitRunESRGAN:I,emitRunFacetool:D,emitDeleteImage:B,emitRequestImages:$,emitRequestNewImages:H,emitCancelProcessing:j,emitRequestSystemConfig:ne,emitRequestModelChange:V,emitSaveStagingAreaImageToGallery:q,emitRequestEmptyTempFolder:te}=WPe(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",J=>u(J)),t.on("generationResult",J=>g(J)),t.on("postprocessingResult",J=>h(J)),t.on("intermediateResult",J=>m(J)),t.on("progressUpdate",J=>v(J)),t.on("galleryImages",J=>b(J)),t.on("processingCanceled",()=>{w()}),t.on("imageDeleted",J=>{P(J)}),t.on("systemConfig",J=>{E(J)}),t.on("modelChanged",J=>{_(J)}),t.on("modelChangeFailed",J=>{T(J)}),t.on("tempFolderEmptied",()=>{M()}),n=!0),a.type){case"socketio/generateImage":{O(a.payload);break}case"socketio/runESRGAN":{I(a.payload);break}case"socketio/runFacetool":{D(a.payload);break}case"socketio/deleteImage":{B(a.payload);break}case"socketio/requestImages":{$(a.payload);break}case"socketio/requestNewImages":{H(a.payload);break}case"socketio/cancelProcessing":{j();break}case"socketio/requestSystemConfig":{ne();break}case"socketio/requestModelChange":{V(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{q(a.payload);break}case"socketio/requestEmptyTempFolder":{te();break}}o(a)}},UPe=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),GPe=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps"].map(e=>`system.${e}`),jPe=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),WU=I$({options:UEe,gallery:Hbe,system:Z4e,canvas:Ebe}),YPe=eH.getPersistConfig({key:"root",storage:J$,rootReducer:WU,blacklist:[...UPe,...GPe,...jPe],debounce:300}),qPe=Qye(YPe,WU),VU=j2e({reducer:qPe,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(VPe()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),De=Bye,ye=Eye;function g5(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g5=function(n){return typeof n}:g5=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},g5(e)}function KPe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nO(e,t){for(var n=0;nS(bt,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:S(p2,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),eTe=rt(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),tTe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=ye(eTe),i=t?Math.round(t*100/n):0;return S(r$,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function nTe(e){const{title:t,hotkey:n,description:r}=e;return X("div",{className:"hotkey-modal-item",children:[X("div",{className:"hotkey-info",children:[S("p",{className:"hotkey-title",children:t}),r&&S("p",{className:"hotkey-description",children:r})]}),S("div",{className:"hotkey-key",children:n})]})}function rTe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Hv(),i=[{title:"Invoke",desc:"Generate an image",hotkey:"Ctrl+Enter"},{title:"Cancel",desc:"Cancel image generation",hotkey:"Shift+X"},{title:"Focus Prompt",desc:"Focus the prompt input area",hotkey:"Alt+A"},{title:"Toggle Options",desc:"Open and close the options panel",hotkey:"O"},{title:"Pin Options",desc:"Pin the options panel",hotkey:"Shift+O"},{title:"Toggle Viewer",desc:"Open and close Image Viewer",hotkey:"Z"},{title:"Toggle Gallery",desc:"Open and close the gallery drawer",hotkey:"G"},{title:"Maximize Workspace",desc:"Close panels and maximize work area",hotkey:"F"},{title:"Change Tabs",desc:"Switch to another workspace",hotkey:"1-5"},{title:"Console Toggle",desc:"Open and close console",hotkey:"`"}],o=[{title:"Set Prompt",desc:"Use the prompt of the current image",hotkey:"P"},{title:"Set Seed",desc:"Use the seed of the current image",hotkey:"S"},{title:"Set Parameters",desc:"Use all parameters of the current image",hotkey:"A"},{title:"Restore Faces",desc:"Restore the current image",hotkey:"Shift+R"},{title:"Upscale",desc:"Upscale the current image",hotkey:"Shift+U"},{title:"Show Info",desc:"Show metadata info of the current image",hotkey:"I"},{title:"Send To Image To Image",desc:"Send current image to Image to Image",hotkey:"Shift+I"},{title:"Delete Image",desc:"Delete the current image",hotkey:"Del"},{title:"Close Panels",desc:"Closes open panels",hotkey:"Esc"}],a=[{title:"Previous Image",desc:"Display the previous image in gallery",hotkey:"Arrow Left"},{title:"Next Image",desc:"Display the next image in gallery",hotkey:"Arrow Right"},{title:"Toggle Gallery Pin",desc:"Pins and unpins the gallery to the UI",hotkey:"Shift+G"},{title:"Increase Gallery Image Size",desc:"Increases gallery thumbnails size",hotkey:"Shift+Up"},{title:"Decrease Gallery Image Size",desc:"Decreases gallery thumbnails size",hotkey:"Shift+Down"}],s=[{title:"Select Brush",desc:"Selects the canvas brush",hotkey:"B"},{title:"Select Eraser",desc:"Selects the canvas eraser",hotkey:"E"},{title:"Decrease Brush Size",desc:"Decreases the size of the canvas brush/eraser",hotkey:"["},{title:"Increase Brush Size",desc:"Increases the size of the canvas brush/eraser",hotkey:"]"},{title:"Decrease Brush Opacity",desc:"Decreases the opacity of the canvas brush",hotkey:"Shift + ["},{title:"Increase Brush Opacity",desc:"Increases the opacity of the canvas brush",hotkey:"Shift + ]"},{title:"Move Tool",desc:"Allows canvas navigation",hotkey:"V"},{title:"Fill Bounding Box",desc:"Fills the bounding box with brush color",hotkey:"Shift + F"},{title:"Erase Bounding Box",desc:"Erases the bounding box area",hotkey:"Delete / Backspace"},{title:"Select Color Picker",desc:"Selects the canvas color picker",hotkey:"C"},{title:"Toggle Snap",desc:"Toggles Snap to Grid",hotkey:"N"},{title:"Quick Toggle Move",desc:"Temporarily toggles Move mode",hotkey:"Hold Space"},{title:"Toggle Layer",desc:"Toggles mask/base layer selection",hotkey:"Q"},{title:"Clear Mask",desc:"Clear the entire mask",hotkey:"Shift+C"},{title:"Hide Mask",desc:"Hide and unhide mask",hotkey:"H"},{title:"Show/Hide Bounding Box",desc:"Toggle visibility of bounding box",hotkey:"Shift+H"},{title:"Merge Visible",desc:"Merge all visible layers of canvas",hotkey:"Shift+M"},{title:"Save To Gallery",desc:"Save current canvas to gallery",hotkey:"Shift+S"},{title:"Copy to Clipboard",desc:"Copy current canvas to clipboard",hotkey:"Ctrl+C"},{title:"Download Image",desc:"Download current canvas",hotkey:"Shift+D"},{title:"Undo Stroke",desc:"Undo a brush stroke",hotkey:"Ctrl+Z"},{title:"Redo Stroke",desc:"Redo a brush stroke",hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:"Reset View",desc:"Reset Canvas View",hotkey:"R"},{title:"Previous Staging Image",desc:"Previous Staging Area Image",hotkey:"Arrow Left"},{title:"Next Staging Image",desc:"Next Staging Area Image",hotkey:"Arrow Right"},{title:"Accept Staging Image",desc:"Accept Current Staging Area Image",hotkey:"Enter"}],l=u=>{const h=[];return u.forEach((g,m)=>{h.push(S(nTe,{title:g.title,description:g.desc,hotkey:g.hotkey},m))}),S("div",{className:"hotkey-modal-category",children:h})};return X(Rn,{children:[C.exports.cloneElement(e,{onClick:n}),X(l1,{isOpen:t,onClose:r,children:[S(u1,{}),X(Yv,{className:" modal hotkeys-modal",children:[S(x_,{className:"modal-close-btn"}),S("h1",{children:"Keyboard Shorcuts"}),S("div",{className:"hotkeys-modal-items",children:X(OS,{allowMultiple:!0,children:[X(Qf,{children:[X(Xf,{className:"hotkeys-modal-button",children:[S("h2",{children:"App Hotkeys"}),S(Zf,{})]}),S(Jf,{children:l(i)})]}),X(Qf,{children:[X(Xf,{className:"hotkeys-modal-button",children:[S("h2",{children:"General Hotkeys"}),S(Zf,{})]}),S(Jf,{children:l(o)})]}),X(Qf,{children:[X(Xf,{className:"hotkeys-modal-button",children:[S("h2",{children:"Gallery Hotkeys"}),S(Zf,{})]}),S(Jf,{children:l(a)})]}),X(Qf,{children:[X(Xf,{className:"hotkeys-modal-button",children:[S("h2",{children:"Unified Canvas Hotkeys"}),S(Zf,{})]}),S(Jf,{children:l(s)})]})]})})]})]})]})}const iTe=e=>{const{isProcessing:t,isConnected:n}=ye(l=>l.system),r=De(),{name:i,status:o,description:a}=e,s=()=>{r($H(i))};return X("div",{className:"model-list-item",children:[S(bi,{label:a,hasArrow:!0,placement:"bottom",children:S("div",{className:"model-list-item-name",children:i})}),S(Lz,{}),S("div",{className:`model-list-item-status ${o.split(" ").join("-")}`,children:o}),S("div",{className:"model-list-item-load-btn",children:S(ja,{size:"sm",onClick:s,isDisabled:o==="active"||t||!n,children:"Load"})})]})},oTe=rt(e=>e.system,e=>{const t=He.map(e.model_list,(r,i)=>({name:i,...r})),n=t.find(r=>r.status==="active");return{models:t,activeModel:n}}),aTe=()=>{const{models:e}=ye(oTe);return S(OS,{allowToggle:!0,className:"model-list-accordion",variant:"unstyled",children:X(Qf,{children:[S(Xf,{children:X("div",{className:"model-list-button",children:[S("h2",{children:"Models"}),S(Zf,{})]})}),S(Jf,{children:S("div",{className:"model-list-list",children:e.map((t,n)=>S(iTe,{name:t.name,status:t.status,description:t.description},n))})})]})})},sTe=rt([Hu,sk],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:He.map(o,(u,h)=>h),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),lTe=({children:e})=>{const t=De(),n=ye(E=>E.options.steps),{isOpen:r,onOpen:i,onClose:o}=Hv(),{isOpen:a,onOpen:s,onClose:l}=Hv(),{shouldDisplayInProgressType:u,shouldConfirmOnDelete:h,shouldDisplayGuides:g,saveIntermediatesInterval:m,enableImageDebugging:v,shouldUseCanvasBetaLayout:b}=ye(sTe),w=()=>{rG.purge().then(()=>{o(),s()})},P=E=>{E>n&&(E=n),E<1&&(E=1),t(j4e(E))};return X(Rn,{children:[C.exports.cloneElement(e,{onClick:i}),X(l1,{isOpen:r,onClose:o,children:[S(u1,{}),X(Yv,{className:"modal settings-modal",children:[S(US,{className:"settings-modal-header",children:"Settings"}),S(x_,{className:"modal-close-btn"}),X(jv,{className:"settings-modal-content",children:[X("div",{className:"settings-modal-items",children:[S("div",{className:"settings-modal-item",children:S(aTe,{})}),X("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[S(Is,{label:"Display In-Progress Images",validValues:l4e,value:u,onChange:E=>t(F4e(E.target.value))}),u==="full-res"&&S(Os,{label:"Save images every n steps",min:1,max:n,step:1,onChange:P,value:m,width:"auto",textAlign:"center"})]}),S($a,{styleClass:"settings-modal-item",label:"Confirm on Delete",isChecked:h,onChange:E=>t(_H(E.target.checked))}),S($a,{styleClass:"settings-modal-item",label:"Display Help Icons",isChecked:g,onChange:E=>t(V4e(E.target.checked))}),S($a,{styleClass:"settings-modal-item",label:"Use Canvas Beta Layout",isChecked:b,onChange:E=>t(VEe(E.target.checked))})]}),X("div",{className:"settings-modal-items",children:[S("h2",{style:{fontWeight:"bold"},children:"Developer"}),S($a,{styleClass:"settings-modal-item",label:"Enable Image Debugging",isChecked:v,onChange:E=>t(Y4e(E.target.checked))})]}),X("div",{className:"settings-modal-reset",children:[S(sh,{size:"md",children:"Reset Web UI"}),S(ja,{colorScheme:"red",onClick:w,children:"Reset Web UI"}),S(Mo,{children:"Resetting the web UI only resets the browser's local cache of your images and remembered settings. It does not delete any images from disk."}),S(Mo,{children:"If images aren't showing up in the gallery or something else isn't working, please try resetting before submitting an issue on GitHub."})]})]}),S(VS,{children:S(ja,{onClick:o,className:"modal-close-btn",children:"Close"})})]})]}),X(l1,{closeOnOverlayClick:!1,isOpen:a,onClose:l,isCentered:!0,children:[S(u1,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),S(Yv,{children:S(jv,{pb:6,pt:6,children:S(bt,{justifyContent:"center",children:S(Mo,{fontSize:"lg",children:"Web UI has been reset. Refresh the page to reload."})})})})]})]})},uTe=rt(e=>e.system,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),cTe=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=ye(uTe),s=De();let l;e&&!o?l="status-good":l="status-bad";let u=i;return["generating","preparing","saving image","restoring faces","upscaling"].includes(u.toLowerCase())&&(l="status-working"),u&&t&&r>1&&(u+=` (${n}/${r})`),S(bi,{label:o&&!a?"Click to clear, check logs for details":void 0,children:S(Mo,{cursor:o&&!a?"pointer":"initial",onClick:()=>{(o||!a)&&s(kH())},className:`status ${l}`,children:u})})},dTe=["dark","light","green"];function fTe(){const{setColorMode:e}=i2(),t=De(),n=ye(i=>i.options.currentTheme),r=i=>{e(i),t(MEe(i))};return S(Il,{trigger:"hover",triggerComponent:S(Xe,{"aria-label":"Theme",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:S(wSe,{})}),children:S(Rz,{align:"stretch",children:dTe.map(i=>S(Ro,{style:{width:"6rem"},leftIcon:n===i?S(dk,{}):void 0,size:"sm",onClick:()=>r(i),children:i.charAt(0).toUpperCase()+i.slice(1)},i))})})}const hTe=rt([Hu],e=>{const{isProcessing:t,model_list:n}=e,r=He.map(n,(a,s)=>s),i=He.reduce(n,(a,s,l)=>(s.status==="active"&&(a=l),a),""),o=n[i].description;return{models:r,activeModel:i,isProcessing:t,activeDesc:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),pTe=()=>{const e=De(),{models:t,activeModel:n,isProcessing:r,activeDesc:i}=ye(hTe);return S(bt,{style:{paddingLeft:"0.3rem"},children:S(Is,{style:{fontSize:"0.8rem"},tooltip:i,isDisabled:r,value:n,validValues:t,onChange:a=>{e($H(a.target.value))}})})},gTe=()=>X("div",{className:"site-header",children:[X("div",{className:"site-header-left-side",children:[S("img",{src:uW,alt:"invoke-ai-logo"}),X("h1",{children:["invoke ",S("strong",{children:"ai"})]})]}),X("div",{className:"site-header-right-side",children:[S(cTe,{}),S(pTe,{}),S(rTe,{children:S(Xe,{"aria-label":"Hotkeys",tooltip:"Hotkeys",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:S(SSe,{})})}),S(fTe,{}),S(Xe,{"aria-label":"Report Bug",tooltip:"Report Bug",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(lh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:S(fSe,{})})}),S(Xe,{"aria-label":"Link to Github Repo",tooltip:"Github",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(lh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:S(sSe,{})})}),S(Xe,{"aria-label":"Link to Discord Server",tooltip:"Discord",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(lh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:S(aSe,{})})}),S(lTe,{children:S(Xe,{"aria-label":"Settings",tooltip:"Settings",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(pb,{})})})]})]}),mTe=rt(e=>e.system,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),vTe=rt(e=>e.system,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),yTe=()=>{const e=De(),t=ye(mTe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=ye(vTe),[o,a]=C.exports.useState(!0),s=C.exports.useRef(null);C.exports.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(kH()),e(zw(!n))};return Ue("`",()=>{e(zw(!n))},[n]),Ue("esc",()=>{e(zw(!1))}),X(Rn,{children:[n&&S(yW,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:S("div",{className:"console",ref:s,onScroll:()=>{!s.current||o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=h;return X("div",{className:`console-entry console-${b}-color`,children:[X("p",{className:"console-timestamp",children:[m,":"]}),S("p",{className:"console-message",children:v})]},g)})})}),n&&S(bi,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:S(Ya,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:S(lSe,{}),onClick:()=>a(!o)})}),S(bi,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:S(Ya,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?S(xSe,{}):S(AH,{}),onClick:l})})]})};function STe(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV||{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}var bTe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function L2(e,t){var n=xTe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function xTe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=bTe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var wTe=[".DS_Store","Thumbs.db"];function CTe(e){return w1(this,void 0,void 0,function(){return C1(this,function(t){return D4(e)&&_Te(e.dataTransfer)?[2,TTe(e.dataTransfer,e.type)]:kTe(e)?[2,ETe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,PTe(e)]:[2,[]]})})}function _Te(e){return D4(e)}function kTe(e){return D4(e)&&D4(e.target)}function D4(e){return typeof e=="object"&&e!==null}function ETe(e){return t9(e.target.files).map(function(t){return L2(t)})}function PTe(e){return w1(this,void 0,void 0,function(){var t;return C1(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return L2(r)})]}})})}function TTe(e,t){return w1(this,void 0,void 0,function(){var n,r;return C1(this,function(i){switch(i.label){case 0:return e.items?(n=t9(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(LTe))]):[3,2];case 1:return r=i.sent(),[2,rO(GU(r))];case 2:return[2,rO(t9(e.files).map(function(o){return L2(o)}))]}})})}function rO(e){return e.filter(function(t){return wTe.indexOf(t.name)===-1})}function t9(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,lO(n)];if(e.sizen)return[!1,lO(n)]}return[!0,null]}function Wf(e){return e!=null}function GTe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=KU(l,n),h=Qv(u,1),g=h[0],m=XU(l,r,i),v=Qv(m,1),b=v[0],w=s?s(l):null;return g&&b&&!w})}function N4(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function T3(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 cO(e){e.preventDefault()}function jTe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function YTe(e){return e.indexOf("Edge/")!==-1}function qTe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return jTe(e)||YTe(e)}function fl(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;a InvokeAI - A Stable Diffusion Toolkit - + @@ -19,7 +19,7 @@ - + \ No newline at end of file