@emailmaker/filemanager 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from
6
6
  * Released under MIT license <https://lodash.com/license>
7
7
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
8
8
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
9
- */var Ir=(Ar||(Ar=1,function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=256,c=1/0,u=9007199254740991,h=NaN,d=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],p="[object Arguments]",g="[object Array]",m="[object Boolean]",v="[object Date]",b="[object Error]",y="[object Function]",w="[object GeneratorFunction]",x="[object Map]",_="[object Number]",C="[object Object]",S="[object Promise]",A="[object RegExp]",k="[object Set]",T="[object String]",I="[object Symbol]",O="[object WeakMap]",E="[object ArrayBuffer]",P="[object DataView]",M="[object Float32Array]",j="[object Float64Array]",F="[object Int8Array]",R="[object Int16Array]",D="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,$=RegExp(W.source),G=RegExp(Y.source),X=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",ke="\\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",Te="['’]",Ie="["+we+"]",Oe="["+ke+"]",Ee="["+xe+"]",Pe="\\d+",Me="["+_e+"]",je="["+Ce+"]",Fe="[^"+we+ke+Pe+_e+Ce+Se+"]",Re="\\ud83c[\\udffb-\\udfff]",De="[^"+we+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Se+"]",Be="\\u200d",Ve="(?:"+je+"|"+Fe+")",Ue="(?:"+ze+"|"+Fe+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ee+"|"+Re+")?",$e="["+Ae+"]?",Ge=$e+Ye+"(?:"+Be+"(?:"+[De,Le,Ne].join("|")+")"+$e+Ye+")*",Xe="(?:"+[Me,Le,Ne].join("|")+")"+Ge,Ke="(?:"+[De+Ee+"?",Ee,Le,Ne,Ie].join("|")+")",qe=RegExp(Te,"g"),Ze=RegExp(Ee,"g"),Je=RegExp(Re+"(?="+Re+")|"+Ke+Ge,"g"),Qe=RegExp([ze+"?"+je+"+"+He+"(?="+[Oe,ze,"$"].join("|")+")",Ue+"+"+We+"(?="+[Oe,ze+Ve,"$"].join("|")+")",ze+"?"+Ve+"+"+He,ze+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,Xe].join("|"),"g"),et=RegExp("["+Be+we+xe+Ae+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["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"],rt=-1,it={};it[M]=it[j]=it[F]=it[R]=it[D]=it[L]=it[N]=it[z]=it[B]=!0,it[p]=it[g]=it[E]=it[m]=it[P]=it[v]=it[b]=it[y]=it[x]=it[_]=it[C]=it[A]=it[k]=it[T]=it[O]=!1;var ot={};ot[p]=ot[g]=ot[E]=ot[P]=ot[m]=ot[v]=ot[M]=ot[j]=ot[F]=ot[R]=ot[D]=ot[x]=ot[_]=ot[C]=ot[A]=ot[k]=ot[T]=ot[I]=ot[L]=ot[N]=ot[z]=ot[B]=!0,ot[b]=ot[y]=ot[O]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Qn&&Qn&&Qn.Object===Object&&Qn,ut="object"==typeof self&&self&&self.Object===Object&&self,ht=ct||ut||Function("return this")(),dt=t&&!t.nodeType&&t,ft=dt&&e&&!e.nodeType&&e,pt=ft&&ft.exports===dt,gt=pt&&ct.process,mt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),vt=mt&&mt.isArrayBuffer,bt=mt&&mt.isDate,yt=mt&&mt.isMap,wt=mt&&mt.isRegExp,xt=mt&&mt.isSet,_t=mt&&mt.isTypedArray;function Ct(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 St(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function At(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function kt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function It(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Ot(e,t){return!(null==e||!e.length)&&zt(e,t,0)>-1}function Et(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Mt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function jt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Ft(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Dt=Ht("length");function Lt(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Nt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function zt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Nt(e,Vt,n)}function Bt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Vt(e){return e!=e}function Ut(e,t){var n=null==e?0:e.length;return n?$t(e,t)/n:h}function Ht(e){return function(t){return null==t?n:t[e]}}function Wt(e){return function(t){return null==e?n:e[t]}}function Yt(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function $t(e,t){for(var r,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==n&&(r=r===n?a:r+a)}return r}function Gt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xt(e){return e?e.slice(0,dn(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function qt(e,t){return Pt(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&zt(t,e[n],0)>-1;);return n}function Qt(e,t){for(var n=e.length;n--&&zt(t,e[n],0)>-1;);return n}var en=Wt({"À":"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"}),tn=Wt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+at[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function an(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var s=e[n];s!==t&&s!==o||(e[n]=o,a[i++]=n)}return a}function ln(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function un(e){return rn(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Dt(e)}function hn(e){return rn(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function dn(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var fn=Wt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),pn=function e(t){var re,we=(t=null==t?ht:pn.defaults(ht.Object(),t,pn.pick(ht,nt))).Array,xe=t.Date,_e=t.Error,Ce=t.Function,Se=t.Math,Ae=t.Object,ke=t.RegExp,Te=t.String,Ie=t.TypeError,Oe=we.prototype,Ee=Ce.prototype,Pe=Ae.prototype,Me=t["__core-js_shared__"],je=Ee.toString,Fe=Pe.hasOwnProperty,Re=0,De=(re=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"",Le=Pe.toString,Ne=je.call(Ae),ze=ht._,Be=ke("^"+je.call(Fe).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=pt?t.Buffer:n,Ue=t.Symbol,He=t.Uint8Array,We=Ve?Ve.allocUnsafe:n,Ye=an(Ae.getPrototypeOf,Ae),$e=Ae.create,Ge=Pe.propertyIsEnumerable,Xe=Oe.splice,Ke=Ue?Ue.isConcatSpreadable:n,Je=Ue?Ue.iterator:n,et=Ue?Ue.toStringTag:n,at=function(){try{var e=uo(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ut=xe&&xe.now!==ht.Date.now&&xe.now,dt=t.setTimeout!==ht.setTimeout&&t.setTimeout,ft=Se.ceil,gt=Se.floor,mt=Ae.getOwnPropertySymbols,Dt=Ve?Ve.isBuffer:n,Wt=t.isFinite,gn=Oe.join,mn=an(Ae.keys,Ae),vn=Se.max,bn=Se.min,yn=xe.now,wn=t.parseInt,xn=Se.random,_n=Oe.reverse,Cn=uo(t,"DataView"),Sn=uo(t,"Map"),An=uo(t,"Promise"),kn=uo(t,"Set"),Tn=uo(t,"WeakMap"),In=uo(Ae,"create"),On=Tn&&new Tn,En={},Pn=Lo(Cn),Mn=Lo(Sn),jn=Lo(An),Fn=Lo(kn),Rn=Lo(Tn),Dn=Ue?Ue.prototype:n,Ln=Dn?Dn.valueOf:n,Nn=Dn?Dn.toString:n;function zn(e){if(es(e)&&!Ha(e)&&!(e instanceof Hn)){if(e instanceof Un)return e;if(Fe.call(e,"__wrapped__"))return No(e)}return new Un(e)}var Bn=function(){function e(){}return function(t){if(!Qa(t))return{};if($e)return $e(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vn(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $n(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new $n;++t<n;)this.add(e[t])}function Xn(e){var t=this.__data__=new Yn(e);this.size=t.size}function Kn(e,t){var n=Ha(e),r=!n&&Ua(e),i=!n&&!r&&Ga(e),o=!n&&!r&&!i&&ls(e),a=n||r||i||o,s=a?Gt(e.length,Te):[],l=s.length;for(var c in e)!t&&!Fe.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||bo(c,l))||s.push(c);return s}function qn(e){var t=e.length;return t?e[Gr(0,t-1)]:n}function Zn(e,t){return Fo(Ii(e),ar(t,0,e.length))}function Jn(e){return Fo(Ii(e))}function Qn(e,t,r){(r!==n&&!za(e[t],r)||r===n&&!(t in e))&&ir(e,t,r)}function er(e,t,r){var i=e[t];Fe.call(e,t)&&za(i,r)&&(r!==n||t in e)||ir(e,t,r)}function tr(e,t){for(var n=e.length;n--;)if(za(e[n][0],t))return n;return-1}function nr(e,t,n,r){return hr(e,function(e,i,o){t(r,e,n(e),o)}),r}function rr(e,t){return e&&Oi(t,Es(t),e)}function ir(e,t,n){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function or(e,t){for(var r=-1,i=t.length,o=we(i),a=null==e;++r<i;)o[r]=a?n:As(e,t[r]);return o}function ar(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function sr(e,t,r,i,o,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=o?r(e,i,o,a):r(e)),s!==n)return s;if(!Qa(e))return e;var h=Ha(e);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Fe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Ii(e,s)}else{var d=po(e),f=d==y||d==w;if(Ga(e))return _i(e,l);if(d==C||d==p||f&&!o){if(s=c||f?{}:mo(e),!l)return c?function(e,t){return Oi(e,fo(e),t)}(e,function(e,t){return e&&Oi(t,Ps(t),e)}(s,e)):function(e,t){return Oi(e,ho(e),t)}(e,rr(s,e))}else{if(!ot[d])return o?e:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case E:return Ci(e);case m:case v:return new i(+e);case P:return function(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case j:case F:case R:case D:case L:case N:case z:case B:return Si(e,n);case x:return new i;case _:case T:return new i(e);case A:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case k:return new i;case I:return r=e,Ln?Ae(Ln.call(r)):{}}}(e,d,l)}}a||(a=new Xn);var g=a.get(e);if(g)return g;a.set(e,s),os(e)?e.forEach(function(n){s.add(sr(n,t,r,n,e,a))}):ts(e)&&e.forEach(function(n,i){s.set(i,sr(n,t,r,i,e,a))});var b=h?n:(u?c?ro:no:c?Ps:Es)(e);return At(b||e,function(n,i){b&&(n=e[i=n]),er(s,i,sr(n,t,r,i,e,a))}),s}function lr(e,t,r){var i=r.length;if(null==e)return!i;for(e=Ae(e);i--;){var o=r[i],a=t[o],s=e[o];if(s===n&&!(o in e)||!a(s))return!1}return!0}function cr(e,t,i){if("function"!=typeof e)throw new Ie(r);return Eo(function(){e.apply(n,i)},t)}function ur(e,t,n,r){var i=-1,o=Ot,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Pt(t,Kt(n))),r?(o=Et,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Gn(t));e:for(;++i<s;){var u=e[i],h=null==n?u:n(u);if(u=r||0!==u?u:0,a&&h==h){for(var d=c;d--;)if(t[d]===h)continue e;l.push(u)}else o(t,h,r)||l.push(u)}return l}zn.templateSettings={escape:X,evaluate:K,interpolate:q,variable:"",imports:{_:zn}},zn.prototype=Vn.prototype,zn.prototype.constructor=zn,Un.prototype=Bn(Vn.prototype),Un.prototype.constructor=Un,Hn.prototype=Bn(Vn.prototype),Hn.prototype.constructor=Hn,Wn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},Wn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Wn.prototype.get=function(e){var t=this.__data__;if(In){var r=t[e];return r===i?n:r}return Fe.call(t,e)?t[e]:n},Wn.prototype.has=function(e){var t=this.__data__;return In?t[e]!==n:Fe.call(t,e)},Wn.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=In&&t===n?i:t,this},Yn.prototype.clear=function(){this.__data__=[],this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=tr(t,e);return!(n<0||(n==t.length-1?t.pop():Xe.call(t,n,1),--this.size,0))},Yn.prototype.get=function(e){var t=this.__data__,r=tr(t,e);return r<0?n:t[r][1]},Yn.prototype.has=function(e){return tr(this.__data__,e)>-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=tr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$n.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Sn||Yn),string:new Wn}},$n.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},$n.prototype.get=function(e){return lo(this,e).get(e)},$n.prototype.has=function(e){return lo(this,e).has(e)},$n.prototype.set=function(e,t){var n=lo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(e){return this.__data__.set(e,i),this},Gn.prototype.has=function(e){return this.__data__.has(e)},Xn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Xn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Xn.prototype.get=function(e){return this.__data__.get(e)},Xn.prototype.has=function(e){return this.__data__.has(e)},Xn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Sn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $n(r)}return n.set(e,t),this.size=n.size,this};var hr=Mi(yr),dr=Mi(wr,!0);function fr(e,t){var n=!0;return hr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function pr(e,t,r){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(l===n?s==s&&!ss(s):r(s,l)))var l=s,c=a}return c}function gr(e,t){var n=[];return hr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function mr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=vo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?mr(s,t-1,n,r,i):Mt(i,s):r||(i[i.length]=s)}return i}var vr=ji(),br=ji(!0);function yr(e,t){return e&&vr(e,t,Es)}function wr(e,t){return e&&br(e,t,Es)}function xr(e,t){return It(t,function(t){return qa(e[t])})}function _r(e,t){for(var r=0,i=(t=bi(t,e)).length;null!=e&&r<i;)e=e[Do(t[r++])];return r&&r==i?e:n}function Cr(e,t,n){var r=t(e);return Ha(e)?r:Mt(r,n(e))}function Sr(e){return null==e?e===n?"[object Undefined]":"[object Null]":et&&et in Ae(e)?function(e){var t=Fe.call(e,et),r=e[et];try{e[et]=n;var i=!0}catch(e){}var o=Le.call(e);return i&&(t?e[et]=r:delete e[et]),o}(e):function(e){return Le.call(e)}(e)}function Ar(e,t){return e>t}function kr(e,t){return null!=e&&Fe.call(e,t)}function Tr(e,t){return null!=e&&t in Ae(e)}function Ir(e,t,r){for(var i=r?Et:Ot,o=e[0].length,a=e.length,s=a,l=we(a),c=1/0,u=[];s--;){var h=e[s];s&&t&&(h=Pt(h,Kt(t))),c=bn(h.length,c),l[s]=!r&&(t||o>=120&&h.length>=120)?new Gn(s&&h):n}h=e[0];var d=-1,f=l[0];e:for(;++d<o&&u.length<c;){var p=h[d],g=t?t(p):p;if(p=r||0!==p?p:0,!(f?Zt(f,g):i(u,g,r))){for(s=a;--s;){var m=l[s];if(!(m?Zt(m,g):i(e[s],g,r)))continue e}f&&f.push(g),u.push(p)}}return u}function Or(e,t,r){var i=null==(e=To(e,t=bi(t,e)))?e:e[Do(Ko(t))];return null==i?n:Ct(i,e,r)}function Er(e){return es(e)&&Sr(e)==p}function Pr(e,t,r,i,o){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,r,i,o,a){var s=Ha(e),l=Ha(t),c=s?g:po(e),u=l?g:po(t),h=(c=c==p?C:c)==C,d=(u=u==p?C:u)==C,f=c==u;if(f&&Ga(e)){if(!Ga(t))return!1;s=!0,h=!1}if(f&&!h)return a||(a=new Xn),s||ls(e)?eo(e,t,r,i,o,a):function(e,t,n,r,i,o,a){switch(n){case P:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case m:case v:case _:return za(+e,+t);case b:return e.name==t.name&&e.message==t.message;case A:case T:return e==t+"";case x:var s=on;case k:var l=1&r;if(s||(s=ln),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=eo(s(e),s(t),r,i,o,a);return a.delete(e),u;case I:if(Ln)return Ln.call(e)==Ln.call(t)}return!1}(e,t,c,r,i,o,a);if(!(1&r)){var y=h&&Fe.call(e,"__wrapped__"),w=d&&Fe.call(t,"__wrapped__");if(y||w){var S=y?e.value():e,O=w?t.value():t;return a||(a=new Xn),o(S,O,r,i,a)}}return!!f&&(a||(a=new Xn),function(e,t,r,i,o,a){var s=1&r,l=no(e),c=l.length,u=no(t),h=u.length;if(c!=h&&!s)return!1;for(var d=c;d--;){var f=l[d];if(!(s?f in t:Fe.call(t,f)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=s;++d<c;){var b=e[f=l[d]],y=t[f];if(i)var w=s?i(y,b,f,t,e,a):i(b,y,f,e,t,a);if(!(w===n?b===y||o(b,y,r,i,a):w)){m=!1;break}v||(v="constructor"==f)}if(m&&!v){var x=e.constructor,_=t.constructor;x==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof _&&_ instanceof _||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,r,i,o,a))}(e,t,r,i,Pr,o))}function Mr(e,t,r,i){var o=r.length,a=o,s=!i;if(null==e)return!a;for(e=Ae(e);o--;){var l=r[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=r[o])[0],u=e[c],h=l[1];if(s&&l[2]){if(u===n&&!(c in e))return!1}else{var d=new Xn;if(i)var f=i(u,h,c,e,t,d);if(!(f===n?Pr(h,u,3,i,d):f))return!1}}return!0}function jr(e){return!(!Qa(e)||(t=e,De&&De in t))&&(qa(e)?Be:pe).test(Lo(e));var t}function Fr(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?Ha(e)?Br(e[0],e[1]):zr(e):hl(e)}function Rr(e){if(!Co(e))return mn(e);var t=[];for(var n in Ae(e))Fe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Dr(e){if(!Qa(e))return function(e){var t=[];if(null!=e)for(var n in Ae(e))t.push(n);return t}(e);var t=Co(e),n=[];for(var r in e)("constructor"!=r||!t&&Fe.call(e,r))&&n.push(r);return n}function Lr(e,t){return e<t}function Nr(e,t){var n=-1,r=Ya(e)?we(e.length):[];return hr(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function zr(e){var t=co(e);return 1==t.length&&t[0][2]?Ao(t[0][0],t[0][1]):function(n){return n===e||Mr(n,e,t)}}function Br(e,t){return wo(e)&&So(t)?Ao(Do(e),t):function(r){var i=As(r,e);return i===n&&i===t?ks(r,e):Pr(t,i,3)}}function Vr(e,t,r,i,o){e!==t&&vr(t,function(a,s){if(o||(o=new Xn),Qa(a))!function(e,t,r,i,o,a,s){var l=Io(e,r),c=Io(t,r),u=s.get(c);if(u)Qn(e,r,u);else{var h=a?a(l,c,r+"",e,t,s):n,d=h===n;if(d){var f=Ha(c),p=!f&&Ga(c),g=!f&&!p&&ls(c);h=c,f||p||g?Ha(l)?h=l:$a(l)?h=Ii(l):p?(d=!1,h=_i(c,!0)):g?(d=!1,h=Si(c,!0)):h=[]:rs(c)||Ua(c)?(h=l,Ua(l)?h=ms(l):Qa(l)&&!qa(l)||(h=mo(c))):d=!1}d&&(s.set(c,h),o(h,c,i,a,s),s.delete(c)),Qn(e,r,h)}}(e,t,s,r,Vr,i,o);else{var l=i?i(Io(e,s),a,s+"",e,t,o):n;l===n&&(l=a),Qn(e,s,l)}},Ps)}function Ur(e,t){var r=e.length;if(r)return bo(t+=t<0?r:0,r)?e[t]:n}function Hr(e,t,n){t=t.length?Pt(t,function(e){return Ha(e)?function(t){return _r(t,1===e.length?e[0]:e)}:e}):[nl];var r=-1;t=Pt(t,Kt(so()));var i=Nr(e,function(e,n,i){var o=Pt(t,function(t){return t(e)});return{criteria:o,index:++r,value:e}});return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var l=Ai(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Wr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=_r(e,a);n(s,a)&&Jr(o,bi(a,e),s)}return o}function Yr(e,t,n,r){var i=r?Bt:zt,o=-1,a=t.length,s=e;for(e===t&&(t=Ii(t)),n&&(s=Pt(e,Kt(n)));++o<a;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(s,u,l,r))>-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function $r(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;bo(i)?Xe.call(e,i,1):ui(e,i)}}return e}function Gr(e,t){return e+gt(xn()*(t-e+1))}function Xr(e,t){var n="";if(!e||t<1||t>u)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Kr(e,t){return Po(ko(e,t,nl),e+"")}function qr(e){return qn(zs(e))}function Zr(e,t){var n=zs(e);return Fo(n,ar(t,0,n.length))}function Jr(e,t,r,i){if(!Qa(e))return e;for(var o=-1,a=(t=bi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Do(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var h=l[c];(u=i?i(h,c,l):n)===n&&(u=Qa(h)?h:bo(t[o+1])?[]:{})}er(l,c,u),l=l[c]}return e}var Qr=On?function(e,t){return On.set(e,t),e}:nl,ei=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:Qs(t),writable:!0})}:nl;function ti(e){return Fo(zs(e))}function ni(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=we(i);++r<i;)o[r]=e[r+t];return o}function ri(e,t){var n;return hr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function ii(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!ss(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return oi(e,t,nl,n)}function oi(e,t,r,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,l=null===t,c=ss(t),u=t===n;o<a;){var h=gt((o+a)/2),d=r(e[h]),f=d!==n,p=null===d,g=d==d,m=ss(d);if(s)var v=i||g;else v=u?g&&(i||f):l?g&&f&&(i||!p):c?g&&f&&!p&&(i||!m):!p&&!m&&(i?d<=t:d<t);v?o=h+1:a=h}return bn(a,4294967294)}function ai(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!za(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function si(e){return"number"==typeof e?e:ss(e)?h:+e}function li(e){if("string"==typeof e)return e;if(Ha(e))return Pt(e,li)+"";if(ss(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,n){var r=-1,i=Ot,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Et;else if(o>=200){var c=t?null:Xi(e);if(c)return ln(c);a=!1,i=Zt,l=new Gn}else l=t?[]:s;e:for(;++r<o;){var u=e[r],h=t?t(u):u;if(u=n||0!==u?u:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(u)}else i(l,h,n)||(l!==s&&l.push(h),s.push(u))}return s}function ui(e,t){return null==(e=To(e,t=bi(t,e)))||delete e[Do(Ko(t))]}function hi(e,t,n,r){return Jr(e,t,n(_r(e,t)),r)}function di(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ni(e,r?0:o,r?o+1:i):ni(e,r?o+1:0,r?i:o)}function fi(e,t){var n=e;return n instanceof Hn&&(n=n.value()),jt(t,function(e,t){return t.func.apply(t.thisArg,Mt([e],t.args))},n)}function pi(e,t,n){var r=e.length;if(r<2)return r?ci(e[0]):[];for(var i=-1,o=we(r);++i<r;)for(var a=e[i],s=-1;++s<r;)s!=i&&(o[i]=ur(o[i]||a,e[s],t,n));return ci(mr(o,1),t,n)}function gi(e,t,r){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var l=i<a?t[i]:n;r(s,e[i],l)}return s}function mi(e){return $a(e)?e:[]}function vi(e){return"function"==typeof e?e:nl}function bi(e,t){return Ha(e)?e:wo(e,t)?[e]:Ro(vs(e))}var yi=Kr;function wi(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:ni(e,t,r)}var xi=ct||function(e){return ht.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var n=e.length,r=We?We(n):new e.constructor(n);return e.copy(r),r}function Ci(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Si(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ai(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,a=ss(e),s=t!==n,l=null===t,c=t==t,u=ss(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||i&&s&&c||!r&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&r&&o&&!i&&!a||l&&r&&o||!s&&o||!c)return-1}return 0}function ki(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,l=t.length,c=vn(o-a,0),u=we(l+c),h=!r;++s<l;)u[s]=t[s];for(;++i<a;)(h||i<o)&&(u[n[i]]=e[i]);for(;c--;)u[s++]=e[i++];return u}function Ti(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,l=-1,c=t.length,u=vn(o-s,0),h=we(u+c),d=!r;++i<u;)h[i]=e[i];for(var f=i;++l<c;)h[f+l]=t[l];for(;++a<s;)(d||i<o)&&(h[f+n[a]]=e[i++]);return h}function Ii(e,t){var n=-1,r=e.length;for(t||(t=we(r));++n<r;)t[n]=e[n];return t}function Oi(e,t,r,i){var o=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=i?i(r[l],e[l],l,r,e):n;c===n&&(c=e[l]),o?ir(r,l,c):er(r,l,c)}return r}function Ei(e,t){return function(n,r){var i=Ha(n)?St:nr,o=t?t():{};return i(n,e,so(r,2),o)}}function Pi(e){return Kr(function(t,r){var i=-1,o=r.length,a=o>1?r[o-1]:n,s=o>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(o--,a):n,s&&yo(r[0],r[1],s)&&(a=o<3?n:a,o=1),t=Ae(t);++i<o;){var l=r[i];l&&e(t,l,i,a)}return t})}function Mi(e,t){return function(n,r){if(null==n)return n;if(!Ya(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Ae(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function ji(e){return function(t,n,r){for(var i=-1,o=Ae(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Fi(e){return function(t){var r=rn(t=vs(t))?hn(t):n,i=r?r[0]:t.charAt(0),o=r?wi(r,1).join(""):t.slice(1);return i[e]()+o}}function Ri(e){return function(t){return jt(qs(Us(t).replace(qe,"")),e,"")}}function Di(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Bn(e.prototype),r=e.apply(n,t);return Qa(r)?r:n}}function Li(e){return function(t,r,i){var o=Ae(t);if(!Ya(t)){var a=so(r,3);t=Es(t),r=function(e){return a(o[e],e,o)}}var s=e(t,r,i);return s>-1?o[a?t[s]:s]:n}}function Ni(e){return to(function(t){var i=t.length,o=i,a=Un.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(r);if(a&&!l&&"wrapper"==oo(s))var l=new Un([],!0)}for(o=l?o:i;++o<i;){var c=oo(s=t[o]),u="wrapper"==c?io(s):n;l=u&&xo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[oo(u[0])].apply(l,u[3]):1==s.length&&xo(s)?l[c]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ha(n))return l.plant(n).value();for(var r=0,o=i?t[r].apply(this,e):n;++r<i;)o=t[r].call(this,o);return o}})}function zi(e,t,r,i,o,a,l,c,u,h){var d=t&s,f=1&t,p=2&t,g=24&t,m=512&t,v=p?n:Di(e);return function s(){for(var b=arguments.length,y=we(b),w=b;w--;)y[w]=arguments[w];if(g)var x=ao(s),_=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(y,x);if(i&&(y=ki(y,i,o,g)),a&&(y=Ti(y,a,l,g)),b-=_,g&&b<h){var C=sn(y,x);return $i(e,t,zi,s.placeholder,r,y,C,c,u,h-b)}var S=f?r:this,A=p?S[e]:e;return b=y.length,c?y=function(e,t){for(var r=e.length,i=bn(t.length,r),o=Ii(e);i--;){var a=t[i];e[i]=bo(a,r)?o[a]:n}return e}(y,c):m&&b>1&&y.reverse(),d&&u<b&&(y.length=u),this&&this!==ht&&this instanceof s&&(A=v||Di(A)),A.apply(S,y)}}function Bi(e,t){return function(n,r){return function(e,t,n,r){return yr(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function Vi(e,t){return function(r,i){var o;if(r===n&&i===n)return t;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=li(r),i=li(i)):(r=si(r),i=si(i)),o=e(r,i)}return o}}function Ui(e){return to(function(t){return t=Pt(t,Kt(so())),Kr(function(n){var r=this;return e(t,function(e){return Ct(e,r,n)})})})}function Hi(e,t){var r=(t=t===n?" ":li(t)).length;if(r<2)return r?Xr(t,e):t;var i=Xr(t,ft(e/un(t)));return rn(t)?wi(hn(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(t,r,i){return i&&"number"!=typeof i&&yo(t,r,i)&&(r=i=n),t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n,r){for(var i=-1,o=vn(ft((t-e)/(n||1)),0),a=we(o);o--;)a[r?o:++i]=e,e+=n;return a}(t,r,i=i===n?t<r?1:-1:ds(i),e)}}function Yi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=gs(t),n=gs(n)),e(t,n)}}function $i(e,t,r,i,o,s,l,c,u,h){var d=8&t;t|=d?a:64,4&(t&=~(d?64:a))||(t&=-4);var f=[e,t,o,d?s:n,d?l:n,d?n:s,d?n:l,c,u,h],p=r.apply(n,f);return xo(e)&&Oo(p,f),p.placeholder=i,Mo(p,e,t)}function Gi(e){var t=Se[e];return function(e,n){if(e=gs(e),(n=null==n?0:bn(fs(n),292))&&Wt(e)){var r=(vs(e)+"e").split("e");return+((r=(vs(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Xi=kn&&1/ln(new kn([,-0]))[1]==c?function(e){return new kn(e)}:sl;function Ki(e){return function(t){var n=po(t);return n==x?on(t):n==k?cn(t):function(e,t){return Pt(t,function(t){return[t,e[t]]})}(t,e(t))}}function qi(e,t,i,c,u,h,d,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Ie(r);var g=c?c.length:0;if(g||(t&=-97,c=u=n),d=d===n?d:vn(fs(d),0),f=f===n?f:fs(f),g-=u?u.length:0,64&t){var m=c,v=u;c=u=n}var b=p?n:io(e),y=[e,t,i,c,u,m,v,h,d,f];if(b&&function(e,t){var n=e[1],r=t[1],i=n|r,a=i<131,c=r==s&&8==n||r==s&&n==l&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!c)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var u=t[3];if(u){var h=e[3];e[3]=h?ki(h,u,t[4]):u,e[4]=h?sn(e[3],o):t[4]}(u=t[5])&&(h=e[5],e[5]=h?Ti(h,u,t[6]):u,e[6]=h?sn(e[5],o):t[6]),(u=t[7])&&(e[7]=u),r&s&&(e[8]=null==e[8]?t[8]:bn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(y,b),e=y[0],t=y[1],i=y[2],c=y[3],u=y[4],!(f=y[9]=y[9]===n?p?0:e.length:vn(y[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)w=8==t||16==t?function(e,t,r){var i=Di(e);return function o(){for(var a=arguments.length,s=we(a),l=a,c=ao(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:sn(s,c);return(a-=u.length)<r?$i(e,t,zi,o.placeholder,n,s,u,n,n,r-a):Ct(this&&this!==ht&&this instanceof o?i:e,this,s)}}(e,t,f):t!=a&&33!=t||u.length?zi.apply(n,y):function(e,t,n,r){var i=1&t,o=Di(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=r.length,u=we(c+s),h=this&&this!==ht&&this instanceof t?o:e;++l<c;)u[l]=r[l];for(;s--;)u[l++]=arguments[++a];return Ct(h,i?n:this,u)}}(e,t,i,c);else var w=function(e,t,n){var r=1&t,i=Di(e);return function t(){return(this&&this!==ht&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,i);return Mo((b?Qr:Oo)(w,y),e,t)}function Zi(e,t,r,i){return e===n||za(e,Pe[r])&&!Fe.call(i,r)?t:e}function Ji(e,t,r,i,o,a){return Qa(e)&&Qa(t)&&(a.set(t,e),Vr(e,t,n,Ji,a),a.delete(t)),e}function Qi(e){return rs(e)?n:e}function eo(e,t,r,i,o,a){var s=1&r,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),h=a.get(t);if(u&&h)return u==t&&h==e;var d=-1,f=!0,p=2&r?new Gn:n;for(a.set(e,t),a.set(t,e);++d<l;){var g=e[d],m=t[d];if(i)var v=s?i(m,g,d,t,e,a):i(g,m,d,e,t,a);if(v!==n){if(v)continue;f=!1;break}if(p){if(!Rt(t,function(e,t){if(!Zt(p,t)&&(g===e||o(g,e,r,i,a)))return p.push(t)})){f=!1;break}}else if(g!==m&&!o(g,m,r,i,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function to(e){return Po(ko(e,n,Wo),e+"")}function no(e){return Cr(e,Es,ho)}function ro(e){return Cr(e,Ps,fo)}var io=On?function(e){return On.get(e)}:sl;function oo(e){for(var t=e.name+"",n=En[t],r=Fe.call(En,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function ao(e){return(Fe.call(zn,"placeholder")?zn:e).placeholder}function so(){var e=zn.iteratee||rl;return e=e===rl?Fr:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function co(e){for(var t=Es(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,So(i)]}return t}function uo(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return jr(r)?r:n}var ho=mt?function(e){return null==e?[]:(e=Ae(e),It(mt(e),function(t){return Ge.call(e,t)}))}:pl,fo=mt?function(e){for(var t=[];e;)Mt(t,ho(e)),e=Ye(e);return t}:pl,po=Sr;function go(e,t,n){for(var r=-1,i=(t=bi(t,e)).length,o=!1;++r<i;){var a=Do(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Ja(i)&&bo(a,i)&&(Ha(e)||Ua(e))}function mo(e){return"function"!=typeof e.constructor||Co(e)?{}:Bn(Ye(e))}function vo(e){return Ha(e)||Ua(e)||!!(Ke&&e&&e[Ke])}function bo(e,t){var n=typeof e;return!!(t=null==t?u:t)&&("number"==n||"symbol"!=n&&me.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,n){if(!Qa(n))return!1;var r=typeof t;return!!("number"==r?Ya(n)&&bo(t,n.length):"string"==r&&t in n)&&za(n[t],e)}function wo(e,t){if(Ha(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ss(e))||J.test(e)||!Z.test(e)||null!=t&&e in Ae(t)}function xo(e){var t=oo(e),n=zn[t];if("function"!=typeof n||!(t in Hn.prototype))return!1;if(e===n)return!0;var r=io(n);return!!r&&e===r[0]}(Cn&&po(new Cn(new ArrayBuffer(1)))!=P||Sn&&po(new Sn)!=x||An&&po(An.resolve())!=S||kn&&po(new kn)!=k||Tn&&po(new Tn)!=O)&&(po=function(e){var t=Sr(e),r=t==C?e.constructor:n,i=r?Lo(r):"";if(i)switch(i){case Pn:return P;case Mn:return x;case jn:return S;case Fn:return k;case Rn:return O}return t});var _o=Me?qa:gl;function Co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pe)}function So(e){return e==e&&!Qa(e)}function Ao(e,t){return function(r){return null!=r&&r[e]===t&&(t!==n||e in Ae(r))}}function ko(e,t,r){return t=vn(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=vn(n.length-t,0),a=we(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=we(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),Ct(e,this,s)}}function To(e,t){return t.length<2?e:_r(e,ni(t,0,-1))}function Io(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Oo=jo(Qr),Eo=dt||function(e,t){return ht.setTimeout(e,t)},Po=jo(ei);function Mo(e,t,n){var r=t+"";return Po(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return At(f,function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(r),n)))}function jo(e){var t=0,r=0;return function(){var i=yn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Fo(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r<t;){var a=Gr(r,o),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var Ro=function(e){var t=ja(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,n,r,i){t.push(r?i.replace(ce,"$1"):n||e)}),t});function Do(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return je.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof Hn)return e.clone();var t=new Un(e.__wrapped__,e.__chain__);return t.__actions__=Ii(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var zo=Kr(function(e,t){return $a(e)?ur(e,mr(t,1,$a,!0)):[]}),Bo=Kr(function(e,t){var r=Ko(t);return $a(r)&&(r=n),$a(e)?ur(e,mr(t,1,$a,!0),so(r,2)):[]}),Vo=Kr(function(e,t){var r=Ko(t);return $a(r)&&(r=n),$a(e)?ur(e,mr(t,1,$a,!0),n,r):[]});function Uo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=vn(r+i,0)),Nt(e,so(t,3),i)}function Ho(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==n&&(o=fs(r),o=r<0?vn(i+o,0):bn(o,i-1)),Nt(e,so(t,3),o,!0)}function Wo(e){return null!=e&&e.length?mr(e,1):[]}function Yo(e){return e&&e.length?e[0]:n}var $o=Kr(function(e){var t=Pt(e,mi);return t.length&&t[0]===e[0]?Ir(t):[]}),Go=Kr(function(e){var t=Ko(e),r=Pt(e,mi);return t===Ko(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Ir(r,so(t,2)):[]}),Xo=Kr(function(e){var t=Ko(e),r=Pt(e,mi);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?Ir(r,n,t):[]});function Ko(e){var t=null==e?0:e.length;return t?e[t-1]:n}var qo=Kr(Zo);function Zo(e,t){return e&&e.length&&t&&t.length?Yr(e,t):e}var Jo=to(function(e,t){var n=null==e?0:e.length,r=or(e,t);return $r(e,Pt(t,function(e){return bo(e,n)?+e:e}).sort(Ai)),r});function Qo(e){return null==e?e:_n.call(e)}var ea=Kr(function(e){return ci(mr(e,1,$a,!0))}),ta=Kr(function(e){var t=Ko(e);return $a(t)&&(t=n),ci(mr(e,1,$a,!0),so(t,2))}),na=Kr(function(e){var t=Ko(e);return t="function"==typeof t?t:n,ci(mr(e,1,$a,!0),n,t)});function ra(e){if(!e||!e.length)return[];var t=0;return e=It(e,function(e){if($a(e))return t=vn(e.length,t),!0}),Gt(t,function(t){return Pt(e,Ht(t))})}function ia(e,t){if(!e||!e.length)return[];var r=ra(e);return null==t?r:Pt(r,function(e){return Ct(t,n,e)})}var oa=Kr(function(e,t){return $a(e)?ur(e,t):[]}),aa=Kr(function(e){return pi(It(e,$a))}),sa=Kr(function(e){var t=Ko(e);return $a(t)&&(t=n),pi(It(e,$a),so(t,2))}),la=Kr(function(e){var t=Ko(e);return t="function"==typeof t?t:n,pi(It(e,$a),n,t)}),ca=Kr(ra),ua=Kr(function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ia(e,r)});function ha(e){var t=zn(e);return t.__chain__=!0,t}function da(e,t){return t(e)}var fa=to(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hn&&bo(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:da,args:[o],thisArg:n}),new Un(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(o)}),pa=Ei(function(e,t,n){Fe.call(e,n)?++e[n]:ir(e,n,1)}),ga=Li(Uo),ma=Li(Ho);function va(e,t){return(Ha(e)?At:hr)(e,so(t,3))}function ba(e,t){return(Ha(e)?kt:dr)(e,so(t,3))}var ya=Ei(function(e,t,n){Fe.call(e,n)?e[n].push(t):ir(e,n,[t])}),wa=Kr(function(e,t,n){var r=-1,i="function"==typeof t,o=Ya(e)?we(e.length):[];return hr(e,function(e){o[++r]=i?Ct(t,e,n):Or(e,t,n)}),o}),xa=Ei(function(e,t,n){ir(e,n,t)});function _a(e,t){return(Ha(e)?Pt:Nr)(e,so(t,3))}var Ca=Ei(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),Sa=Kr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Hr(e,mr(t,1),[])}),Aa=ut||function(){return ht.Date.now()};function ka(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,qi(e,s,n,n,n,n,t)}function Ta(e,t){var i;if("function"!=typeof t)throw new Ie(r);return e=fs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Ia=Kr(function(e,t,n){var r=1;if(n.length){var i=sn(n,ao(Ia));r|=a}return qi(e,r,t,n,i)}),Oa=Kr(function(e,t,n){var r=3;if(n.length){var i=sn(n,ao(Oa));r|=a}return qi(t,r,e,n,i)});function Ea(e,t,i){var o,a,s,l,c,u,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ie(r);function g(t){var r=o,i=a;return o=a=n,h=t,l=e.apply(i,r)}function m(e){var r=e-u;return u===n||r>=t||r<0||f&&e-h>=s}function v(){var e=Aa();if(m(e))return b(e);c=Eo(v,function(e){var n=t-(e-u);return f?bn(n,s-(e-h)):n}(e))}function b(e){return c=n,p&&o?g(e):(o=a=n,l)}function y(){var e=Aa(),r=m(e);if(o=arguments,a=this,u=e,r){if(c===n)return function(e){return h=e,c=Eo(v,t),d?g(e):l}(u);if(f)return xi(c),c=Eo(v,t),g(u)}return c===n&&(c=Eo(v,t)),l}return t=gs(t)||0,Qa(i)&&(d=!!i.leading,s=(f="maxWait"in i)?vn(gs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),y.cancel=function(){c!==n&&xi(c),h=0,o=u=a=c=n},y.flush=function(){return c===n?l:b(Aa())},y}var Pa=Kr(function(e,t){return cr(e,1,t)}),Ma=Kr(function(e,t,n){return cr(e,gs(t)||0,n)});function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ja.Cache||$n),n}function Fa(e){if("function"!=typeof e)throw new Ie(r);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)}}ja.Cache=$n;var Ra=yi(function(e,t){var n=(t=1==t.length&&Ha(t[0])?Pt(t[0],Kt(so())):Pt(mr(t,1),Kt(so()))).length;return Kr(function(r){for(var i=-1,o=bn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ct(e,this,r)})}),Da=Kr(function(e,t){var r=sn(t,ao(Da));return qi(e,a,n,t,r)}),La=Kr(function(e,t){var r=sn(t,ao(La));return qi(e,64,n,t,r)}),Na=to(function(e,t){return qi(e,l,n,n,n,t)});function za(e,t){return e===t||e!=e&&t!=t}var Ba=Yi(Ar),Va=Yi(function(e,t){return e>=t}),Ua=Er(function(){return arguments}())?Er:function(e){return es(e)&&Fe.call(e,"callee")&&!Ge.call(e,"callee")},Ha=we.isArray,Wa=vt?Kt(vt):function(e){return es(e)&&Sr(e)==E};function Ya(e){return null!=e&&Ja(e.length)&&!qa(e)}function $a(e){return es(e)&&Ya(e)}var Ga=Dt||gl,Xa=bt?Kt(bt):function(e){return es(e)&&Sr(e)==v};function Ka(e){if(!es(e))return!1;var t=Sr(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function qa(e){if(!Qa(e))return!1;var t=Sr(e);return t==y||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==fs(e)}function Ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=yt?Kt(yt):function(e){return es(e)&&po(e)==x};function ns(e){return"number"==typeof e||es(e)&&Sr(e)==_}function rs(e){if(!es(e)||Sr(e)!=C)return!1;var t=Ye(e);if(null===t)return!0;var n=Fe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&je.call(n)==Ne}var is=wt?Kt(wt):function(e){return es(e)&&Sr(e)==A},os=xt?Kt(xt):function(e){return es(e)&&po(e)==k};function as(e){return"string"==typeof e||!Ha(e)&&es(e)&&Sr(e)==T}function ss(e){return"symbol"==typeof e||es(e)&&Sr(e)==I}var ls=_t?Kt(_t):function(e){return es(e)&&Ja(e.length)&&!!it[Sr(e)]},cs=Yi(Lr),us=Yi(function(e,t){return e<=t});function hs(e){if(!e)return[];if(Ya(e))return as(e)?hn(e):Ii(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=po(e);return(t==x?on:t==k?ln:zs)(e)}function ds(e){return e?(e=gs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=ds(e),n=t%1;return t==t?n?t-n:t:0}function ps(e){return e?ar(fs(e),0,d):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return h;if(Qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=fe.test(e);return n||ge.test(e)?lt(e.slice(2),n?2:8):de.test(e)?h:+e}function ms(e){return Oi(e,Ps(e))}function vs(e){return null==e?"":li(e)}var bs=Pi(function(e,t){if(Co(t)||Ya(t))Oi(t,Es(t),e);else for(var n in t)Fe.call(t,n)&&er(e,n,t[n])}),ys=Pi(function(e,t){Oi(t,Ps(t),e)}),ws=Pi(function(e,t,n,r){Oi(t,Ps(t),e,r)}),xs=Pi(function(e,t,n,r){Oi(t,Es(t),e,r)}),_s=to(or),Cs=Kr(function(e,t){e=Ae(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&yo(t[0],t[1],o)&&(i=1);++r<i;)for(var a=t[r],s=Ps(a),l=-1,c=s.length;++l<c;){var u=s[l],h=e[u];(h===n||za(h,Pe[u])&&!Fe.call(e,u))&&(e[u]=a[u])}return e}),Ss=Kr(function(e){return e.push(n,Ji),Ct(js,n,e)});function As(e,t,r){var i=null==e?n:_r(e,t);return i===n?r:i}function ks(e,t){return null!=e&&go(e,t,Tr)}var Ts=Bi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),e[t]=n},Qs(nl)),Is=Bi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),Fe.call(e,t)?e[t].push(n):e[t]=[n]},so),Os=Kr(Or);function Es(e){return Ya(e)?Kn(e):Rr(e)}function Ps(e){return Ya(e)?Kn(e,!0):Dr(e)}var Ms=Pi(function(e,t,n){Vr(e,t,n)}),js=Pi(function(e,t,n,r){Vr(e,t,n,r)}),Fs=to(function(e,t){var n={};if(null==e)return n;var r=!1;t=Pt(t,function(t){return t=bi(t,e),r||(r=t.length>1),t}),Oi(e,ro(e),n),r&&(n=sr(n,7,Qi));for(var i=t.length;i--;)ui(n,t[i]);return n}),Rs=to(function(e,t){return null==e?{}:function(e,t){return Wr(e,t,function(t,n){return ks(e,n)})}(e,t)});function Ds(e,t){if(null==e)return{};var n=Pt(ro(e),function(e){return[e]});return t=so(t),Wr(e,n,function(e,n){return t(e,n[0])})}var Ls=Ki(Es),Ns=Ki(Ps);function zs(e){return null==e?[]:qt(e,Es(e))}var Bs=Ri(function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)});function Vs(e){return Ks(vs(e).toLowerCase())}function Us(e){return(e=vs(e))&&e.replace(ve,en).replace(Ze,"")}var Hs=Ri(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ws=Ri(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ys=Fi("toLowerCase"),$s=Ri(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Gs=Ri(function(e,t,n){return e+(n?" ":"")+Ks(t)}),Xs=Ri(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ks=Fi("toUpperCase");function qs(e,t,r){return e=vs(e),(t=r?n:t)===n?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Zs=Kr(function(e,t){try{return Ct(e,n,t)}catch(e){return Ka(e)?e:new _e(e)}}),Js=to(function(e,t){return At(t,function(t){t=Do(t),ir(e,t,Ia(e[t],e))}),e});function Qs(e){return function(){return e}}var el=Ni(),tl=Ni(!0);function nl(e){return e}function rl(e){return Fr("function"==typeof e?e:sr(e,1))}var il=Kr(function(e,t){return function(n){return Or(n,e,t)}}),ol=Kr(function(e,t){return function(n){return Or(e,n,t)}});function al(e,t,n){var r=Es(t),i=xr(t,r);null!=n||Qa(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=xr(t,Es(t)));var o=!(Qa(n)&&"chain"in n&&!n.chain),a=qa(e);return At(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ii(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})}),e}function sl(){}var ll=Ui(Pt),cl=Ui(Tt),ul=Ui(Rt);function hl(e){return wo(e)?Ht(Do(e)):function(e){return function(t){return _r(t,e)}}(e)}var dl=Wi(),fl=Wi(!0);function pl(){return[]}function gl(){return!1}var ml,vl=Vi(function(e,t){return e+t},0),bl=Gi("ceil"),yl=Vi(function(e,t){return e/t},1),wl=Gi("floor"),xl=Vi(function(e,t){return e*t},1),_l=Gi("round"),Cl=Vi(function(e,t){return e-t},0);return zn.after=function(e,t){if("function"!=typeof t)throw new Ie(r);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},zn.ary=ka,zn.assign=bs,zn.assignIn=ys,zn.assignInWith=ws,zn.assignWith=xs,zn.at=_s,zn.before=Ta,zn.bind=Ia,zn.bindAll=Js,zn.bindKey=Oa,zn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},zn.chain=ha,zn.chunk=function(e,t,r){t=(r?yo(e,t,r):t===n)?1:vn(fs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=we(ft(i/t));o<i;)s[a++]=ni(e,o,o+=t);return s},zn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},zn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=we(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Mt(Ha(n)?Ii(n):[n],mr(t,1))},zn.cond=function(e){var t=null==e?0:e.length,n=so();return e=t?Pt(e,function(e){if("function"!=typeof e[1])throw new Ie(r);return[n(e[0]),e[1]]}):[],Kr(function(n){for(var r=-1;++r<t;){var i=e[r];if(Ct(i[0],this,n))return Ct(i[1],this,n)}})},zn.conforms=function(e){return function(e){var t=Es(e);return function(n){return lr(n,e,t)}}(sr(e,1))},zn.constant=Qs,zn.countBy=pa,zn.create=function(e,t){var n=Bn(e);return null==t?n:rr(n,t)},zn.curry=function e(t,r,i){var o=qi(t,8,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},zn.curryRight=function e(t,r,i){var o=qi(t,16,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},zn.debounce=Ea,zn.defaults=Cs,zn.defaultsDeep=Ss,zn.defer=Pa,zn.delay=Ma,zn.difference=zo,zn.differenceBy=Bo,zn.differenceWith=Vo,zn.drop=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,(t=r||t===n?1:fs(t))<0?0:t,i):[]},zn.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,0,(t=i-(t=r||t===n?1:fs(t)))<0?0:t):[]},zn.dropRightWhile=function(e,t){return e&&e.length?di(e,so(t,3),!0,!0):[]},zn.dropWhile=function(e,t){return e&&e.length?di(e,so(t,3),!0):[]},zn.fill=function(e,t,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&yo(e,t,r)&&(r=0,i=o),function(e,t,r,i){var o=e.length;for((r=fs(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:fs(i))<0&&(i+=o),i=r>i?0:ps(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},zn.filter=function(e,t){return(Ha(e)?It:gr)(e,so(t,3))},zn.flatMap=function(e,t){return mr(_a(e,t),1)},zn.flatMapDeep=function(e,t){return mr(_a(e,t),c)},zn.flatMapDepth=function(e,t,r){return r=r===n?1:fs(r),mr(_a(e,t),r)},zn.flatten=Wo,zn.flattenDeep=function(e){return null!=e&&e.length?mr(e,c):[]},zn.flattenDepth=function(e,t){return null!=e&&e.length?mr(e,t=t===n?1:fs(t)):[]},zn.flip=function(e){return qi(e,512)},zn.flow=el,zn.flowRight=tl,zn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},zn.functions=function(e){return null==e?[]:xr(e,Es(e))},zn.functionsIn=function(e){return null==e?[]:xr(e,Ps(e))},zn.groupBy=ya,zn.initial=function(e){return null!=e&&e.length?ni(e,0,-1):[]},zn.intersection=$o,zn.intersectionBy=Go,zn.intersectionWith=Xo,zn.invert=Ts,zn.invertBy=Is,zn.invokeMap=wa,zn.iteratee=rl,zn.keyBy=xa,zn.keys=Es,zn.keysIn=Ps,zn.map=_a,zn.mapKeys=function(e,t){var n={};return t=so(t,3),yr(e,function(e,r,i){ir(n,t(e,r,i),e)}),n},zn.mapValues=function(e,t){var n={};return t=so(t,3),yr(e,function(e,r,i){ir(n,r,t(e,r,i))}),n},zn.matches=function(e){return zr(sr(e,1))},zn.matchesProperty=function(e,t){return Br(e,sr(t,1))},zn.memoize=ja,zn.merge=Ms,zn.mergeWith=js,zn.method=il,zn.methodOf=ol,zn.mixin=al,zn.negate=Fa,zn.nthArg=function(e){return e=fs(e),Kr(function(t){return Ur(t,e)})},zn.omit=Fs,zn.omitBy=function(e,t){return Ds(e,Fa(so(t)))},zn.once=function(e){return Ta(2,e)},zn.orderBy=function(e,t,r,i){return null==e?[]:(Ha(t)||(t=null==t?[]:[t]),Ha(r=i?n:r)||(r=null==r?[]:[r]),Hr(e,t,r))},zn.over=ll,zn.overArgs=Ra,zn.overEvery=cl,zn.overSome=ul,zn.partial=Da,zn.partialRight=La,zn.partition=Ca,zn.pick=Rs,zn.pickBy=Ds,zn.property=hl,zn.propertyOf=function(e){return function(t){return null==e?n:_r(e,t)}},zn.pull=qo,zn.pullAll=Zo,zn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,so(n,2)):e},zn.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Yr(e,t,n,r):e},zn.pullAt=Jo,zn.range=dl,zn.rangeRight=fl,zn.rearg=Na,zn.reject=function(e,t){return(Ha(e)?It:gr)(e,Fa(so(t,3)))},zn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=so(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return $r(e,i),n},zn.rest=function(e,t){if("function"!=typeof e)throw new Ie(r);return Kr(e,t=t===n?t:fs(t))},zn.reverse=Qo,zn.sampleSize=function(e,t,r){return t=(r?yo(e,t,r):t===n)?1:fs(t),(Ha(e)?Zn:Zr)(e,t)},zn.set=function(e,t,n){return null==e?e:Jr(e,t,n)},zn.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Jr(e,t,r,i)},zn.shuffle=function(e){return(Ha(e)?Jn:ti)(e)},zn.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&yo(e,t,r)?(t=0,r=i):(t=null==t?0:fs(t),r=r===n?i:fs(r)),ni(e,t,r)):[]},zn.sortBy=Sa,zn.sortedUniq=function(e){return e&&e.length?ai(e):[]},zn.sortedUniqBy=function(e,t){return e&&e.length?ai(e,so(t,2)):[]},zn.split=function(e,t,r){return r&&"number"!=typeof r&&yo(e,t,r)&&(t=r=n),(r=r===n?d:r>>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=li(t))&&rn(e)?wi(hn(e),0,r):e.split(t,r):[]},zn.spread=function(e,t){if("function"!=typeof e)throw new Ie(r);return t=null==t?0:vn(fs(t),0),Kr(function(n){var r=n[t],i=wi(n,0,t);return r&&Mt(i,r),Ct(e,this,i)})},zn.tail=function(e){var t=null==e?0:e.length;return t?ni(e,1,t):[]},zn.take=function(e,t,r){return e&&e.length?ni(e,0,(t=r||t===n?1:fs(t))<0?0:t):[]},zn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,(t=i-(t=r||t===n?1:fs(t)))<0?0:t,i):[]},zn.takeRightWhile=function(e,t){return e&&e.length?di(e,so(t,3),!1,!0):[]},zn.takeWhile=function(e,t){return e&&e.length?di(e,so(t,3)):[]},zn.tap=function(e,t){return t(e),e},zn.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(r);return Qa(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ea(e,t,{leading:i,maxWait:t,trailing:o})},zn.thru=da,zn.toArray=hs,zn.toPairs=Ls,zn.toPairsIn=Ns,zn.toPath=function(e){return Ha(e)?Pt(e,Do):ss(e)?[e]:Ii(Ro(vs(e)))},zn.toPlainObject=ms,zn.transform=function(e,t,n){var r=Ha(e),i=r||Ga(e)||ls(e);if(t=so(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Qa(e)&&qa(o)?Bn(Ye(e)):{}}return(i?At:yr)(e,function(e,r,i){return t(n,e,r,i)}),n},zn.unary=function(e){return ka(e,1)},zn.union=ea,zn.unionBy=ta,zn.unionWith=na,zn.uniq=function(e){return e&&e.length?ci(e):[]},zn.uniqBy=function(e,t){return e&&e.length?ci(e,so(t,2)):[]},zn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ci(e,n,t):[]},zn.unset=function(e,t){return null==e||ui(e,t)},zn.unzip=ra,zn.unzipWith=ia,zn.update=function(e,t,n){return null==e?e:hi(e,t,vi(n))},zn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:hi(e,t,vi(r),i)},zn.values=zs,zn.valuesIn=function(e){return null==e?[]:qt(e,Ps(e))},zn.without=oa,zn.words=qs,zn.wrap=function(e,t){return Da(vi(t),e)},zn.xor=aa,zn.xorBy=sa,zn.xorWith=la,zn.zip=ca,zn.zipObject=function(e,t){return gi(e||[],t||[],er)},zn.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jr)},zn.zipWith=ua,zn.entries=Ls,zn.entriesIn=Ns,zn.extend=ys,zn.extendWith=ws,al(zn,zn),zn.add=vl,zn.attempt=Zs,zn.camelCase=Bs,zn.capitalize=Vs,zn.ceil=bl,zn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=gs(r))==r?r:0),t!==n&&(t=(t=gs(t))==t?t:0),ar(gs(e),t,r)},zn.clone=function(e){return sr(e,4)},zn.cloneDeep=function(e){return sr(e,5)},zn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:n)},zn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:n)},zn.conformsTo=function(e,t){return null==t||lr(e,t,Es(t))},zn.deburr=Us,zn.defaultTo=function(e,t){return null==e||e!=e?t:e},zn.divide=yl,zn.endsWith=function(e,t,r){e=vs(e),t=li(t);var i=e.length,o=r=r===n?i:ar(fs(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},zn.eq=za,zn.escape=function(e){return(e=vs(e))&&G.test(e)?e.replace(Y,tn):e},zn.escapeRegExp=function(e){return(e=vs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},zn.every=function(e,t,r){var i=Ha(e)?Tt:fr;return r&&yo(e,t,r)&&(t=n),i(e,so(t,3))},zn.find=ga,zn.findIndex=Uo,zn.findKey=function(e,t){return Lt(e,so(t,3),yr)},zn.findLast=ma,zn.findLastIndex=Ho,zn.findLastKey=function(e,t){return Lt(e,so(t,3),wr)},zn.floor=wl,zn.forEach=va,zn.forEachRight=ba,zn.forIn=function(e,t){return null==e?e:vr(e,so(t,3),Ps)},zn.forInRight=function(e,t){return null==e?e:br(e,so(t,3),Ps)},zn.forOwn=function(e,t){return e&&yr(e,so(t,3))},zn.forOwnRight=function(e,t){return e&&wr(e,so(t,3))},zn.get=As,zn.gt=Ba,zn.gte=Va,zn.has=function(e,t){return null!=e&&go(e,t,kr)},zn.hasIn=ks,zn.head=Yo,zn.identity=nl,zn.includes=function(e,t,n,r){e=Ya(e)?e:zs(e),n=n&&!r?fs(n):0;var i=e.length;return n<0&&(n=vn(i+n,0)),as(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&zt(e,t,n)>-1},zn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=vn(r+i,0)),zt(e,t,i)},zn.inRange=function(e,t,r){return t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n){return e>=bn(t,n)&&e<vn(t,n)}(e=gs(e),t,r)},zn.invoke=Os,zn.isArguments=Ua,zn.isArray=Ha,zn.isArrayBuffer=Wa,zn.isArrayLike=Ya,zn.isArrayLikeObject=$a,zn.isBoolean=function(e){return!0===e||!1===e||es(e)&&Sr(e)==m},zn.isBuffer=Ga,zn.isDate=Xa,zn.isElement=function(e){return es(e)&&1===e.nodeType&&!rs(e)},zn.isEmpty=function(e){if(null==e)return!0;if(Ya(e)&&(Ha(e)||"string"==typeof e||"function"==typeof e.splice||Ga(e)||ls(e)||Ua(e)))return!e.length;var t=po(e);if(t==x||t==k)return!e.size;if(Co(e))return!Rr(e).length;for(var n in e)if(Fe.call(e,n))return!1;return!0},zn.isEqual=function(e,t){return Pr(e,t)},zn.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?Pr(e,t,n,r):!!i},zn.isError=Ka,zn.isFinite=function(e){return"number"==typeof e&&Wt(e)},zn.isFunction=qa,zn.isInteger=Za,zn.isLength=Ja,zn.isMap=ts,zn.isMatch=function(e,t){return e===t||Mr(e,t,co(t))},zn.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Mr(e,t,co(t),r)},zn.isNaN=function(e){return ns(e)&&e!=+e},zn.isNative=function(e){if(_o(e))throw new _e("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return jr(e)},zn.isNil=function(e){return null==e},zn.isNull=function(e){return null===e},zn.isNumber=ns,zn.isObject=Qa,zn.isObjectLike=es,zn.isPlainObject=rs,zn.isRegExp=is,zn.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=u},zn.isSet=os,zn.isString=as,zn.isSymbol=ss,zn.isTypedArray=ls,zn.isUndefined=function(e){return e===n},zn.isWeakMap=function(e){return es(e)&&po(e)==O},zn.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Sr(e)},zn.join=function(e,t){return null==e?"":gn.call(e,t)},zn.kebabCase=Hs,zn.last=Ko,zn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=fs(r))<0?vn(i+o,0):bn(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Nt(e,Vt,o,!0)},zn.lowerCase=Ws,zn.lowerFirst=Ys,zn.lt=cs,zn.lte=us,zn.max=function(e){return e&&e.length?pr(e,nl,Ar):n},zn.maxBy=function(e,t){return e&&e.length?pr(e,so(t,2),Ar):n},zn.mean=function(e){return Ut(e,nl)},zn.meanBy=function(e,t){return Ut(e,so(t,2))},zn.min=function(e){return e&&e.length?pr(e,nl,Lr):n},zn.minBy=function(e,t){return e&&e.length?pr(e,so(t,2),Lr):n},zn.stubArray=pl,zn.stubFalse=gl,zn.stubObject=function(){return{}},zn.stubString=function(){return""},zn.stubTrue=function(){return!0},zn.multiply=xl,zn.nth=function(e,t){return e&&e.length?Ur(e,fs(t)):n},zn.noConflict=function(){return ht._===this&&(ht._=ze),this},zn.noop=sl,zn.now=Aa,zn.pad=function(e,t,n){e=vs(e);var r=(t=fs(t))?un(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Hi(gt(i),n)+e+Hi(ft(i),n)},zn.padEnd=function(e,t,n){e=vs(e);var r=(t=fs(t))?un(e):0;return t&&r<t?e+Hi(t-r,n):e},zn.padStart=function(e,t,n){e=vs(e);var r=(t=fs(t))?un(e):0;return t&&r<t?Hi(t-r,n)+e:e},zn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),wn(vs(e).replace(ne,""),t||0)},zn.random=function(e,t,r){if(r&&"boolean"!=typeof r&&yo(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=ds(e),t===n?(t=e,e=0):t=ds(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var o=xn();return bn(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Gr(e,t)},zn.reduce=function(e,t,n){var r=Ha(e)?jt:Yt,i=arguments.length<3;return r(e,so(t,4),n,i,hr)},zn.reduceRight=function(e,t,n){var r=Ha(e)?Ft:Yt,i=arguments.length<3;return r(e,so(t,4),n,i,dr)},zn.repeat=function(e,t,r){return t=(r?yo(e,t,r):t===n)?1:fs(t),Xr(vs(e),t)},zn.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zn.result=function(e,t,r){var i=-1,o=(t=bi(t,e)).length;for(o||(o=1,e=n);++i<o;){var a=null==e?n:e[Do(t[i])];a===n&&(i=o,a=r),e=qa(a)?a.call(e):a}return e},zn.round=_l,zn.runInContext=e,zn.sample=function(e){return(Ha(e)?qn:qr)(e)},zn.size=function(e){if(null==e)return 0;if(Ya(e))return as(e)?un(e):e.length;var t=po(e);return t==x||t==k?e.size:Rr(e).length},zn.snakeCase=$s,zn.some=function(e,t,r){var i=Ha(e)?Rt:ri;return r&&yo(e,t,r)&&(t=n),i(e,so(t,3))},zn.sortedIndex=function(e,t){return ii(e,t)},zn.sortedIndexBy=function(e,t,n){return oi(e,t,so(n,2))},zn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ii(e,t);if(r<n&&za(e[r],t))return r}return-1},zn.sortedLastIndex=function(e,t){return ii(e,t,!0)},zn.sortedLastIndexBy=function(e,t,n){return oi(e,t,so(n,2),!0)},zn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ii(e,t,!0)-1;if(za(e[n],t))return n}return-1},zn.startCase=Gs,zn.startsWith=function(e,t,n){return e=vs(e),n=null==n?0:ar(fs(n),0,e.length),t=li(t),e.slice(n,n+t.length)==t},zn.subtract=Cl,zn.sum=function(e){return e&&e.length?$t(e,nl):0},zn.sumBy=function(e,t){return e&&e.length?$t(e,so(t,2)):0},zn.template=function(e,t,r){var i=zn.templateSettings;r&&yo(e,t,r)&&(t=n),e=vs(e),t=ws({},t,i,Zi);var o,a,s=ws({},t.imports,i.imports,Zi),l=Es(s),c=qt(s,l),u=0,h=t.interpolate||be,d="__p += '",f=ke((t.escape||be).source+"|"+h.source+"|"+(h===q?ue:be).source+"|"+(t.evaluate||be).source+"|$","g"),p="//# sourceURL="+(Fe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(f,function(t,n,r,i,s,l){return r||(r=i),d+=e.slice(u,l).replace(ye,nn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t}),d+="';\n";var g=Fe.call(t,"variable")&&t.variable;if(g){if(le.test(g))throw new _e("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(V,""):d).replace(U,"$1").replace(H,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Zs(function(){return Ce(l,p+"return "+d).apply(n,c)});if(m.source=d,Ka(m))throw m;return m},zn.times=function(e,t){if((e=fs(e))<1||e>u)return[];var n=d,r=bn(e,d);t=so(t),e-=d;for(var i=Gt(r,t);++n<e;)t(n);return i},zn.toFinite=ds,zn.toInteger=fs,zn.toLength=ps,zn.toLower=function(e){return vs(e).toLowerCase()},zn.toNumber=gs,zn.toSafeInteger=function(e){return e?ar(fs(e),-9007199254740991,u):0===e?e:0},zn.toString=vs,zn.toUpper=function(e){return vs(e).toUpperCase()},zn.trim=function(e,t,r){if((e=vs(e))&&(r||t===n))return Xt(e);if(!e||!(t=li(t)))return e;var i=hn(e),o=hn(t);return wi(i,Jt(i,o),Qt(i,o)+1).join("")},zn.trimEnd=function(e,t,r){if((e=vs(e))&&(r||t===n))return e.slice(0,dn(e)+1);if(!e||!(t=li(t)))return e;var i=hn(e);return wi(i,0,Qt(i,hn(t))+1).join("")},zn.trimStart=function(e,t,r){if((e=vs(e))&&(r||t===n))return e.replace(ne,"");if(!e||!(t=li(t)))return e;var i=hn(e);return wi(i,Jt(i,hn(t))).join("")},zn.truncate=function(e,t){var r=30,i="...";if(Qa(t)){var o="separator"in t?t.separator:o;r="length"in t?fs(t.length):r,i="omission"in t?li(t.omission):i}var a=(e=vs(e)).length;if(rn(e)){var s=hn(e);a=s.length}if(r>=a)return e;var l=r-un(i);if(l<1)return i;var c=s?wi(s,0,l).join(""):e.slice(0,l);if(o===n)return c+i;if(s&&(l+=c.length-l),is(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=ke(o.source,vs(he.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===n?l:d)}}else if(e.indexOf(li(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},zn.unescape=function(e){return(e=vs(e))&&$.test(e)?e.replace(W,fn):e},zn.uniqueId=function(e){var t=++Re;return vs(e)+t},zn.upperCase=Xs,zn.upperFirst=Ks,zn.each=va,zn.eachRight=ba,zn.first=Yo,al(zn,(ml={},yr(zn,function(e,t){Fe.call(zn.prototype,t)||(ml[t]=e)}),ml),{chain:!1}),zn.VERSION="4.17.21",At(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){zn[e].placeholder=zn}),At(["drop","take"],function(e,t){Hn.prototype[e]=function(r){r=r===n?1:vn(fs(r),0);var i=this.__filtered__&&!t?new Hn(this):this.clone();return i.__filtered__?i.__takeCount__=bn(r,i.__takeCount__):i.__views__.push({size:bn(r,d),type:e+(i.__dir__<0?"Right":"")}),i},Hn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),At(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:so(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),At(["head","last"],function(e,t){var n="take"+(t?"Right":"");Hn.prototype[e]=function(){return this[n](1).value()[0]}}),At(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}}),Hn.prototype.compact=function(){return this.filter(nl)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Kr(function(e,t){return"function"==typeof e?new Hn(this):this.map(function(n){return Or(n,e,t)})}),Hn.prototype.reject=function(e){return this.filter(Fa(so(e)))},Hn.prototype.slice=function(e,t){e=fs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Hn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=fs(t))<0?r.dropRight(-t):r.take(t-e)),r)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(d)},yr(Hn.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=zn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(zn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Hn,c=s[0],u=l||Ha(t),h=function(e){var t=o.apply(zn,Mt([e],s));return i&&d?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=a&&!d,g=l&&!f;if(!a&&u){t=g?t:new Hn(this);var m=e.apply(t,s);return m.__actions__.push({func:da,args:[h],thisArg:n}),new Un(m,d)}return p&&g?e.apply(this,s):(m=this.thru(h),p?i?m.value()[0]:m.value():m)})}),At(["pop","push","shift","sort","splice","unshift"],function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);zn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ha(i)?i:[],e)}return this[n](function(n){return t.apply(Ha(n)?n:[],e)})}}),yr(Hn.prototype,function(e,t){var n=zn[t];if(n){var r=n.name+"";Fe.call(En,r)||(En[r]=[]),En[r].push({name:t,func:n})}}),En[zi(n,2).name]=[{name:"wrapper",func:n}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ha(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=bn(t,e+a);break;case"takeRight":e=vn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,u=this.__iteratees__,h=u.length,d=0,f=bn(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return fi(e,this.__actions__);var p=[];e:for(;l--&&d<f;){for(var g=-1,m=e[c+=t];++g<h;){var v=u[g],b=v.iteratee,y=v.type,w=b(m);if(2==y)m=w;else if(!w){if(1==y)continue e;break e}}p[d++]=m}return p},zn.prototype.at=fa,zn.prototype.chain=function(){return ha(this)},zn.prototype.commit=function(){return new Un(this.value(),this.__chain__)},zn.prototype.next=function(){this.__values__===n&&(this.__values__=hs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},zn.prototype.plant=function(e){for(var t,r=this;r instanceof Vn;){var i=No(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},zn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:da,args:[Qo],thisArg:n}),new Un(t,this.__chain__)}return this.thru(Qo)},zn.prototype.toJSON=zn.prototype.valueOf=zn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},zn.prototype.first=zn.prototype.head,Je&&(zn.prototype[Je]=function(){return this}),zn}();ft?((ft.exports=pn)._=pn,dt._=pn):ht._=pn}).call(Tr)}(kr,kr.exports)),kr.exports);const Or=({onSearch:t,placeholder:n="Поиск файлов...",className:r})=>{const[i,s]=o(""),l=u(null);a(()=>(l.current=Ir.debounce(e=>{t(e)},500),()=>{var e;null===(e=l.current)||void 0===e||e.cancel()}),[t]);return e(E,{value:i,onChange:e=>{var t;const n=e.target.value;s(n),null===(t=l.current)||void 0===t||t.call(l,n)},placeholder:n,prefix:e(se,{}),className:r,allowClear:!0,onClear:()=>{s(""),t("")}})},Er=({className:n,style:r,customIcon:i})=>i?e("img",{src:i,alt:"Upload",className:n,style:Object.assign(Object.assign({},r),{width:"64px",height:"64px",objectFit:"contain"})}):t("svg",{className:n,style:Object.assign(Object.assign({},r),{width:"64px",height:"64px"}),viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("circle",{cx:"32",cy:"32",r:"30",fill:"none",stroke:"#1890ff",strokeWidth:"2",opacity:"0.3"}),e("circle",{cx:"32",cy:"32",r:"20",fill:"none",stroke:"#1890ff",strokeWidth:"2"}),e("path",{d:"M32 12L32 28M24 20L32 12L40 20",stroke:"#1890ff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e("circle",{cx:"20",cy:"40",r:"2",fill:"#1890ff",opacity:"0.6"}),e("circle",{cx:"32",cy:"40",r:"2",fill:"#1890ff",opacity:"0.6"}),e("circle",{cx:"44",cy:"40",r:"2",fill:"#1890ff",opacity:"0.6"})]}),Pr="my_files",Mr="gif",jr="stock_images",Fr="ai",Rr="editor",Dr=!1,Lr=["jpg","jpeg","png","gif","bmp","webp","svg","ico","tiff","tif"],Nr="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQABLAEsAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAEsAAAAAQAAASwAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQOgAwAEAAAAAQAAAMoAAAAA/+EJ2Wh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6c3RvY2s6Mzk2MmU4NTQtNjA1NC00MGZmLWEwYzMtYjJkNjcwMzQ2OWFhIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmE5M2NiZTgyLWI5NjEtNGUzNS1iYmQ0LWJjZWE1Zjc1YTQwZiIvPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4A/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAMoBAwMBIgACEQADEQD/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/3QAEABH/2gAMAwEAAhEDEQA/APsuiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqG7uIbWB55nCooyTS208VxCssLh0boRQBLRRRQAUUUUAFFFFAH/9D7LooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAqG7uIrWBppnCoo5Jou7iK1gaaZwqKM5NcRq2oXOsXqxQq2wnEcYPX3NABq2oXOr3qwxK3l5xHGO/ua6nw7pzadZ7ZJGaR+WBPA9hUfh7R49Pi82TDXDDkkfd9hWxQAUUUUAFFFFABRRRQB//9H7LooooAKKKKACiiuOv/EOpQX88KNDsSQqMp6H60AdjRXD/wDCTapn70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iiuH/4SfVP70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iobq4itYHmncIijJJrE0jUdQlt2v8AUJIYrNVyMJgv9Oaw9X1C51e8WGJWMecRxr39zQAatqNzq94kUasELYjjB6/Wul8P6NHp8Qlkw1ww5P8Ad9hWRmDw9bfwTajIv4Riqw8Tap6wf98f/XoA7elrh/8AhJtU/vQ/9+//AK9avhnWL3UL94bgx7BGWG1cdwPX3oA6OiiigAooooAKKKKAP//S+y6KKKACiiigArgHAbxSVYAg3mCD3+eu/rgT/wAjV/2+f+z0Adt9jtMf8esH/fsUfY7T/n1g/wC/Yqeh2CIWY4AGSaAK7WlmqktbQADkkxr/AIVUe50JJPLZ7EN6YWuX17WJr+dkRylurYVQfve5rKJoA9Ghh0+Zd0MVtIvqqKaf9jtP+fWD/v2K89sry4sphLbyFD3HY/Wu+0e9TULFLhQATww9DQBJ9jtP+fWD/v2KattZM7ILe3LL94bF4p99cx2lpJcS/dRc/X2rjdG1eSLWmuZ2Oy4bEnoPQ/hQB2P2O0/59YP+/Yo+x2n/AD6wf9+xU4IPSloAr/Y7T/n1g/79ij7Haf8APrB/37FWKKAK/wBjtP8An1g/79ij7Haf8+sH/fsVYooAr/Y7T/n1g/79ioruPTrWBppoLdUUckxj/Cp7u4itYGnmcKijJJriNX1C61i9EUKtsziOMHr7mgBNVv7jVrxYII/3YOIYl/ma6bw9o8enxCSTD3DDkn+H2FHh/R49Pi8yTDXDDkkfd9hWxQBC9rbOxZ7eJmPUlATTfsdp/wA+sH/fsVYooAztXtbVdLumW3hBELkEIOPlNc74H/5Csv8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0/suiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72s/xI7R6HdMpwdmPzODWhUN/ALqymt26SIVoA816UlS3ML207wSrtdCQai+lAC11HgN2xdx4+XKH6Hn/AArl++K6jSv+JN4flvJhiWfBRe/Tj+ZNAEHjLUfOnFjEw2R/NJju3Yfl/Oudp0jtJIzucsxJJ96bQB2/hLUftdkLeRh50OF+q9jW3XnOkXrWF/HcDJUHDjPUV6HDIssSSIQVYAg0APooooAKhu7iK1gaeZwqKM5NF3cQ2sDTTOFRRk5riNW1C51i9WKJW8vOI4x39zQAavqF1rF6IYVbZnEcYPX3NdL4e0ePT4hLIA1w45JH3fYUeHtHj0+LzJcNcMOTj7vsK2KACiiigAooooAqaz/yCbz/AK4v/wCgmuX8D/8AIWl/64n+YrqNZ/5BN5/1xf8A9BNcv4H/AOQtL/1xP8xQB2dFFFABRRRQAUUUUAf/1PsuiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72lpKWgDO1bSLXUQDKCsg6OvX/wCvWFJ4Tn3fJdxFc8FkOa66igDC0zw3a2riadzPIOeRhR+FYXinUPtl+Yoz+5h+VcdCe5/p+FdH4n1H7DYFYziaX5U9vU1wn40AFFFFABXW+DNR3xtp8x+ZPmjyeo7j/PrXJVNZzva3UdxG2HjbP/1qAPTKhu7iK2gaaZwqKOSahTULf+zFv3bZEybsmuP1XULnV70QxK3l7sRxr39zQAmrahc6xerFEreXnEcY7+5rpfD2jx6fF5suGuGHJx932FHh7R49PiEkuGuGHJ/u+wrYoAKKKKACiiigAooooAqaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5iuo1n/AJBN5/1xf/0E1y/gf/kLS/8AXE/zFAHZ0UUUAFFFFABRRRQB/9X7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAKazBVZicBRkmnVz3jHUfs9qLOJsSy/ex2XvQBzuu351DUXlDfu1+WMewqhRRQAUUUv40AFbGi6ZG8TahqB8uzTkA9ZP/AK1Gi6ZG8TajqJ2WcfIB/wCWn/1qi1W+uNWu0hhQiIHbFEv86ADU7+fVbpIIU2xZ2xRL/M103h7R00+LzZcPcMOTj7vsKyCYfD9sQNsupSr+EY/z+ddDot8uoWCTj7/Rx6N3oAvUUUUAFZ17rFta6jDZydZPvNnhPTNSaxqEWn2bTv8AM3RF9TXntxLJPK8sp3O5yx9TQB6dmlrA8Kar9qg+yzt+/jHBP8QrfoAKKKKAKms/8gm8/wCuL/8AoJrl/A//ACFpf+uJ/mK6jWf+QTef9cX/APQTXL+B/wDkLS/9cT/MUAdnRRRQAUUUUAFFFFAH/9b7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAjuZo7eB5pThEGSa851G6e9vJLl+rngeg7Ct/xpqOWXT4m6fNLj9B/X8q5mgBKKKO9AADzWzoumRvEdQ1A7LOPkA/8tP/AK1JoulxvE2oagQlnHyAf+Wn/wBaotVv59WukhhjIizthiX+dABql/catdJBDGRHnbDEv86vkweH7bHyy6jKv4Rj/P8An0UmDw/bEfLLqMq/hGP8/n/Ln5JHlkaSRi7scsx70AEkjySNLIxd2OWY961fCuo/Y78RSNiGY7T7Hsax6WgD1EGmyuscbSOwVVBJPoKy/DGofbrABzmaLCvk9fQ1k+MNU3MdPgY4X/WkevpQBla7qLajel84iTiMe3rWdS0lAEtrPJbXMdxC2HQ5HvXoWlXsd/ZpPGevDD0PevOK0/D2pHTr0FiTBJgOP60Ad/RTUYOoZSCCMg06gCprP/IJvP8Ari//AKCa5fwP/wAhaX/rif5iuo1n/kE3n/XF/wD0E1y/gf8A5C0v/XE/zFAHZ0UUUAFFFFABRRRQB//X+y6KKKACiiigArgT/wAjV/2+f+z131cCf+Rq/wC3z/2egDvarapeJY2Mlw/8I+UZ6nsKs1xni7UftN39ljb91Eecd2/z/WgDFnlknmeaRsu5JJqOigdeKAFrX0XS43iOoagQlnHyAf8Alp/9al0XTI3ibUNQISzj5Ab/AJaf/WqHVb+41a6SGGMrEDtiiX+dAC6rfT6tdJBChEWdsMS/zq+TB4ftj92XUZV/CMf5/P8AkhMPh+2x8suoyr+EY/z+f8sCSR5ZGlkYu7HLMe9ABJI8sjSSMXdjlmPemUUUAFLSUUAWtOvp7CZ5YD8zIVOenNVmJZixJJPUmkooAKKKKAClFJRQB1Pg/VOBp87Dj/VEn9K6jPFeYRs0bh0JDqQQR2Nd7oGpJqNkGJxKnEg/rQBY1n/kE3n/AFxf/wBBNcv4H/5C0v8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0PsuiiigAooooAK4E/8AI1f9vn/s9d8a89u5RB4hlnYEiO5LkDvhs0Adtq808Ni7W0TyTEbUCjkE964c6TqhJJspyTySVroB4stsY+xzf99Cj/hK7X/nzl/76FAHPnSdTx/x4z/981d0zRvL33eqr5NtFztbq5/wro7PVo5rF72SB7eBfutIcbvpXLatqFzq94IokYpnEca859zQAmq31xq12sEEZEQOIol/nWxBYzaPZeZBavc30oxlVyIxUVsbLw6i+epuL1wCyp/AP6VY/wCEstv+fSb/AL6FAGBLpmrSyNJJZ3DuxyzFetN/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmj+yNT/wCfGf8A75roP+Ertf8Anzl/76FH/CV2v/PnL/30KAOf/sjU/wDnxn/75o/sjU/+fGf/AL5roP8AhK7X/nzl/wC+hR/wldr/AM+cv/fQoA5/+yNT/wCfGf8A75o/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmrmkW+r6ferOllPtzh12n5hWp/wldr/wA+cv8A30KP+Ertf+fOX/voUAa+rNu0a6bBGYGOD1HymuZ8D/8AIWl/64n+YqzfeJre4spoBayqZI2UEkcZGKreB/8AkKyn/pif5igDs6KKKACiiigAooooA//R+y6KKKACiiigArHn8OadPO80nm73YscNjknNbFFAGJ/wjGmf9N/+/lRXGg6NZxG4nMnlpyQ0mQfatq7uIrWBppnCoozk1xGrajdaxeLFCh2E4jjHf3NACapfT6tdpBDGfKU4hjUfrXTeH9HTT4vNkw1yw5JH3fYUeHtHj0+LzZMNcMOSR932FbFAGNL4b0+WRpJXuHdjks0nJNN/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTPSf/v5VrTNGs9PnM1v5m4qVO5s8ZB/pWjRQAUUUUAFFFFABRRRQB//0vsuiiigAooooAKhu7mK1t2nmYKijkmpq5fxda6jNcReXukgYgBVHQ+9AGVq2oXOsXqxRK2zdiNB39zXS+H9Hj0+ISSYa4Ycn+77Cjw/o8enxebLhrhhySPu+wrYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9P7LooooAKKKKACkxS0UAFFFFABRRTW6D6igB1FN7n8KQE+YRQA+iiigAopsnEZI64pR90UALRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q==",zr=s({state:{},actions:{},options:{}}),Br=()=>l(zr),Vr=({children:t,options:n})=>{const[r,s]=o([]),[l,u]=o([]),[h,d]=o(null),[f,p]=o(n.searchQuery||""),[g,m]=o(n.sortBySize||"name"),{config:v}=n,[b,y]=o("name"),[w,x]=o("asc"),[_,C]=o([{id:"folders",name:"Папки"}]),[S,A]=o(new Set);i.useEffect(()=>{A(new Set)},[]);const k=i.useRef(null);i.useEffect(()=>{if(n.onChangeSelection&&k.current!==S){if(null!==k.current){const e=(Array.isArray(l)?l:[]).filter(e=>S.has(e.id));n.onChangeSelection(e)}k.current=S}},[l,S,n.onChangeSelection]);const[T,I]=o(!1),[O,E]=o(Pr);a(()=>{(null==v?void 0:v.activeLibraryItem)&&E&&E(null==v?void 0:v.activeLibraryItem)},[null==v?void 0:v.activeLibraryItem,E]);const[M,j]=o({current:1,pageSize:12,total:0}),[F]=P.useForm(),[R]=P.useForm(),[D]=P.useForm(),[L]=P.useForm(),[N]=P.useForm(),[z]=P.useForm(),[B,V]=o(!1),[U,H]=o(!1),[W,Y]=o(!1),[$,G]=o(!1),[X,K]=o(!1),[q,Z]=o(!1),[J,Q]=o(null),[ee,te]=o(null),ne=c(e=>{j(t=>Object.assign(Object.assign({},t),e))},[j]),re={setFolders:s,setFiles:u,setSelectedFolder:d,setSearchTerm:p,setSortField:m,setSortBy:y,setSortOrder:x,setPathHistory:C,setSelectedFiles:A,setLoading:I,setPagination:ne,setIsModalVisible:V,setIsUrlModalVisible:H,setIsRenameModalVisible:Y,setIsMoveModalVisible:G,setIsRenameFolderModalVisible:K,setIsCopyModalVisible:Z,setFileToRename:Q,setFolderToRename:te,updatePathHistoryOnFolderRename:(e,t)=>{C(n=>n.map(n=>n.id===e?Object.assign(Object.assign({},n),{name:t}):n))},setActiveLibraryItem:E},ie={state:{folders:r,files:l,selectedFolder:h,searchTerm:f,sortField:g,sortBy:b,sortOrder:w,pathHistory:_,selectedFiles:S,loading:T,pagination:M,isModalVisible:B,isUrlModalVisible:U,isRenameModalVisible:W,isMoveModalVisible:$,isRenameFolderModalVisible:X,isCopyModalVisible:q,form:F,urlForm:R,renameForm:D,moveForm:L,renameFolderForm:N,copyForm:z,fileToRename:J,folderToRename:ee,activeLibraryItem:O},actions:re,options:n};return e(zr.Provider,{value:ie,children:t})},Ur=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Hr=async(e,t,n)=>{var r;if(console.log("📁 addSubfoldersToFiles: params:",JSON.stringify(t,null,2)),null===(r=null==t?void 0:t.search)||void 0===r?void 0:r.trim())return console.log("🔍 Поиск активен, папки не добавляются"),e;let i=[];if(!n)return console.warn("🔍 getFolders не доступен!"),e;{const e=await n();i=Array.isArray(e)?e:[],console.log("📁 Получено папок от dataProvider:",i.length,"тип данных:",typeof e,"данные:",e)}const o=((e,t)=>{const n=Array.isArray(e)?e:[];return(r=t.folderId)&&"root"!==r&&"folders"!==r&&"null"!==r&&null!==r?n.filter(e=>e.parentId===t.folderId):n.filter(Ur);var r})(i,t);if(console.log("📁 Найдено подпапок для добавления:",o.length),0===o.length)return e;const a=o.map(e=>({id:e.id,name:e.name,size:"-",date:"-",isFolder:!0,folderId:e.parentId||"",type:"",selected:!1,extension:""})),s=[...a,...e];return console.log("📁 РЕЗУЛЬТАТ: папок:",a.length,"файлов:",e.length,"всего:",s.length),s},Wr=()=>{const{state:e,actions:t,options:n}=Br(),{t:r}=gr(),{message:i}=O.useApp(),{selectedFolder:o,urlForm:a,pagination:s,files:l}=e,{setFiles:u,setLoading:h,setIsUrlModalVisible:d,setSelectedFiles:f,setActiveLibraryItem:p,setPagination:g}=t,{dataProviders:m}=n,v=c(async e=>{var t;if(!(null==m?void 0:m.getFiles))return[];const{files:n,pagination:r}=await m.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,search:(null===(t=null==e?void 0:e.search)||void 0===t?void 0:t.trim())||void 0,sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder,page:null==e?void 0:e.page,limit:null==e?void 0:e.limit});return console.log("🔍 fetchFilesFromDataProvider результат:",n,"с параметрами сортировки:",{sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder}),r&&g&&g({current:r.page,pageSize:r.limit,total:r.total}),n},[m]),b=c(async e=>{try{null==h||h(!0),console.log("fetchFiles вызван с параметрами:",e);let t=[];if(!(null==m?void 0:m.getFiles))return void console.error("DataProvider для получения файлов не определен");t=await v(e),console.log("Получены файлы:",t),e&&(t=await Hr(t,e,null==m?void 0:m.getFolders)),null==u||u(t),null==f||f(new Set)}catch(e){console.error("Ошибка при загрузке файлов:",e),i.error("Не удалось загрузить файлы")}finally{null==h||h(!1)}},[m,u,h,f,v,i]),y=c(async e=>{try{if(!(null==m?void 0:m.deleteFile))return void i.error("DataProvider для удаления файлов не настроен");if(!await m.deleteFile(e))throw new Error("Не удалось удалить файл");i.success(r("File deleted"));await b({folderId:null===o?"root":o||void 0,page:l.length>=1?s.current:s.current-1})}catch(e){console.error("Ошибка при удалении файла:",e),i.error(r("Error when deleting a file"))}},[m,b,o,r,i,s,l]),w=c(async e=>{try{if(!(null==m?void 0:m.deleteFolder))return void i.error("DataProvider для удаления папок не настроен");if(!await m.deleteFolder(e))throw new Error("Не удалось удалить папку");i.success(r("Folder deleted"));o===e?await b():await b({folderId:null===o?"root":o||void 0})}catch(e){console.error("Ошибка при удалении папки:",e),i.error(r("Error when deleting a folder"))}},[m,b,o,r,i]),x=c(async e=>{try{if(null==m?void 0:m.getFile){const t=await m.getFile(e);if(t)return t;throw new Error("Не удалось загрузить файл")}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error("Ошибка загрузки файла");return await t.blob()}}catch(e){console.error("Ошибка при загрузке файла:",e),i.error(r("Error when deleting a folder"))}},[m,r,i]),_=c(async e=>{if(!(null==m?void 0:m.uploadFile))return;const t=e.name.split(".").pop()||"";await m.uploadFile({name:e.name,size:`${(e.size/1024).toFixed(0)} КБ`,type:e.type,folderId:o||null,data:e,extension:t}),p&&p(Pr)},[m,o,p]),C=c(async e=>{try{if(null==m?void 0:m.getFolders){const t=await m.getFolders(),n=(Array.isArray(t)?t:[]).some(t=>t.id===e);return console.log(n?"✅ Папка найдена:":"❌ Папка не найдена:",e),n}}catch(e){console.warn("⚠️ Ошибка проверки папки:",e)}return!1},[null==m?void 0:m.getFolders]),S=c(async e=>{if(!(null==m?void 0:m.uploadFile))return void i.error("DataProvider для загрузки файлов не настроен");if(o)try{if(!await C(o))return console.error("❌ Выбранная папка не найдена на сервере:",o),void i.error("Выбранная папка не найдена. Попробуйте обновить список папок или создать папку заново.")}catch(e){console.warn("⚠️ Не удалось проверить существование папки, продолжаем загрузку:",e)}const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=async t=>{var n;const a=null===(n=t.target.files)||void 0===n?void 0:n[0];if(a)if(a.type.startsWith("image/"))try{if(null==h||h(!0),null==e||e.onStart(a),null==e?void 0:e.onProgress){let t=0;const n=setInterval(()=>{t=Math.min(t+10+Math.floor(Date.now()%10),90),e.onProgress(a.name,t)},200);await _(a),clearInterval(n),e.onProgress(a.name,100)}else await _(a);null==e||e.onComplete(a.name),i.success(`${r("File")} ${a.name} ${r("has been successfully uploaded")}`),await b({folderId:null===o?"root":o||void 0})}catch(t){console.error("Ошибка при загрузке файла:",t),null==e||e.onError(a.name,"Ошибка при загрузке файла"),i.error("Ошибка при загрузке файла")}finally{null==h||h(!1)}else i.error(r("Please select an image file"))},t.click()},[m,o,h,b,r,_,C]),A=c(async(e,t)=>{try{let n;const s=await(null==a?void 0:a.validateFields()),l=e||(null==s?void 0:s.fileUrl);return l?(null==h||h(!0),(null==m?void 0:m.uploadFileByUrl)?(n=await m.uploadFileByUrl({url:l,folderId:o||null,noFolder:t}),i.success(`${r("File")} ${(null==s?void 0:s.name)||"unnamed file"} ${r("successfully uploaded")}`),null==d||d(!1),null==a||a.resetFields(),p&&p(Pr),await b({folderId:null===o?"root":o||void 0}),n):void i.error("Загрузка по URL не поддерживается")):void i.error("Заполните все поля")}catch(e){console.error("Ошибка при загрузке файла по URL:",e),i.error(r("Error when downloading a file by URL"))}finally{null==h||h(!1)}},[a,m,o,h,d,b,r]),k=c(async e=>{if(e.type.startsWith("image/"))try{await _(e),i.success(`${r("File")} ${e.name} ${r("has been successfully uploaded")}`)}catch(t){console.error(`Ошибка при загрузке файла ${e.name}:`,t),i.error(`Ошибка при загрузке файла ${e.name}`)}else i.warning(`Файл ${e.name} не является изображением и будет пропущен`)},[m,r,_]),T=c(async e=>{for(const t of e)await k(t);await b({folderId:null===o?"root":o||void 0})},[k,b,o]);return{fetchFiles:b,handleDeleteFile:y,handleDeleteFolder:w,handleAddFile:S,handleAddFileByUrl:A,handleDroppedFiles:T,getFileData:x,uploadFileWithProvider:_}},Yr=new Map,$r=(e,t)=>{Yr.set(e,t),console.log("Изображение сохранено в кеш:",e),Yr.size>350&&(Array.from(Yr.keys()).slice(0,50).forEach(e=>Yr.delete(e)),console.warn("Очищен кеш изображений. Удалено 50 самых старых записей."))},Gr=e=>{if(e.type&&e.type.startsWith("image/"))return!0;if(e.name){const t=e.name.toLowerCase().split(".").pop();return Lr.includes(t||"")}return!1},Xr=({src:t,alt:n,className:r,width:i,height:s,preview:l=!1,file:u})=>{const h=Wr(),[d,f]=o(!1),[p,g]=o(t),[m,v]=o(!1),b=c(e=>{g(e),f(!1),v(!1)},[]),y=c(e=>{console.warn("Не удалось загрузить изображение:",e),g(void 0),f(!0),v(!1)},[]),w=c(()=>{g(Nr),f(!0)},[]),x=c(e=>{g(e),f(!1)},[]),_=c(e=>{const t=e.split(",")[1];t&&t.length>20?g(e):(console.warn("Некорректные base64 данные:",e.substring(0,50)+"..."),w())},[w]),C=c(async e=>{if(console.log("loadImageFromFile",e),(e=>Yr.has(e))(e))return console.log("Изображение найдено в кеше:",e),(e=>Yr.get(e))(e);if(!u||!Gr(u))return console.warn("Файл не является изображением:",null==u?void 0:u.name,null==u?void 0:u.type),w(),Nr;try{const t=await h.getFileData(e);if(!t)throw new Error("Ошибка загрузки файла");return new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{const t=i.result;$r(e,t),n(t)},i.onerror=()=>r(new Error("Ошибка чтения файла")),i.readAsDataURL(t)})}catch(e){throw console.error("Ошибка загрузки изображения:",e),e}},[u,w,h]),S=c(()=>{(null==u?void 0:u.id)&&Gr(u)?C(u.id).then(b).catch(y):u&&!Gr(u)&&(console.warn("Файл не является изображением, показываем fallback:",u.name,u.type),w())},[u,C,b,y,w]),A=c(e=>{console.log("HandleBlobSrc:",{blobSrc:e,file:u?{id:u.id,name:u.name,type:u.type,extension:u.extension,folderId:u.folderId}:null}),u&&Gr(u)?(console.log("Blob файл является изображением, устанавливаем src:",u.name,u.type),g(e),f(!1)):(console.warn("Blob файл не является изображением, показываем fallback:",null==u?void 0:u.name,null==u?void 0:u.type),w())},[u,w,Gr]),k=c(()=>{(null==u?void 0:u.id)&&Gr(u)?(v(!0),C(u.id).then(b).catch(y)):u&&!Gr(u)?(console.warn("Файл не является изображением, показываем fallback:",u.name,u.type),w()):(console.warn("Неподдерживаемый формат изображения:",t),g(void 0))},[u,t,C,b,y,w]);a(()=>{v(!1),t?t.startsWith("data:image/")?_(t):t.startsWith("blob:")?A(t):t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?x(t):(console.log("setImageError 1"),k()):S()},[t,S,_,A,x,k]);return e(j,{className:r,src:p,alt:n,width:i,height:s,preview:l&&!d&&{src:p,toolbarRender:()=>null,destroyOnHidden:!0},onError:()=>{console.warn("Ошибка загрузки изображения:",(null==p?void 0:p.substring(0,50))+"..."),f(!0)},fallback:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",loading:m?"lazy":void 0})},Kr="filemanager_view_mode",qr=()=>{const{state:e}=Br(),{files:t,loading:n,isUrlModalVisible:r}=e,i=Wr(),o=(()=>{const{state:e,actions:t}=Br(),{selectedFiles:n}=e,{setSelectedFiles:r}=t,i=c(e=>{if(!n||!r)return;const t=new Set(n);t.has(e)?t.delete(e):t.add(e),r(t)},[n,r]);return{state:{selectedFiles:n||new Set},actions:{toggleFileSelection:i}}})(),a=(e=>{const{state:t,actions:n,options:r}=Br(),{t:i}=gr(),{files:o,selectedFolder:a,selectedFiles:s,fileToRename:l,renameForm:u,isRenameModalVisible:h,moveForm:d,copyForm:f}=t,{setFileToRename:p,setIsRenameModalVisible:g,setIsMoveModalVisible:m,setIsCopyModalVisible:v,setSelectedFiles:b}=n,{apiEndpoints:y,dataProviders:w}=r,x=c(e=>{null==p||p(e),null==g||g(!0);const t=null==o?void 0:o.find(t=>t.id===e);t&&u&&u.setFieldsValue({newFileName:t.name})},[p,g,o,u]),_=c(()=>{null==g||g(!1),null==p||p(null),null==u||u.resetFields()},[g,p,u]),C=c(async()=>{var t;if(l&&u)try{const r=await u.validateFields();if(!(null==r?void 0:r.newFileName))return;const s=null==o?void 0:o.find(e=>e.id===l);if((null==s?void 0:s.isFolder)||l.startsWith("folder_")){if(!(null==w?void 0:w.renameFolder))return void M.error("DataProvider для переименования папок не настроен");{const e=await w.renameFolder(l,r.newFileName.trim());if(!(null==e?void 0:e.id))return void M.error("Некорректный ответ при переименовании папки");M.success(`${i("Folder renamed to")} ${r.newFileName}`),await(null===(t=n.fetchFolders)||void 0===t?void 0:t.call(n)),l!==e.id&&n.setSelectedFolder&&n.setSelectedFolder(e.id)}}else{if(!(null==w?void 0:w.renameFile))return void M.error("DataProvider для переименования файлов не настроен");await w.renameFile(l,r.newFileName),M.success(`${i("File renamed to")} ${r.newFileName}`)}_(),await e({folderId:a||void 0})}catch(e){console.error("Ошибка при переименовании:",e),M.error(e instanceof Error?e.message:"Ошибка при переименовании")}},[l,u,o,w,y,_,e,a,i]),S=c(()=>{null==m||m(!0)},[m]),A=c(()=>{null==m||m(!1),null==d||d.resetFields()},[m,d]),k=c(async()=>{if(s&&0!==s.size&&d)try{const t=await d.validateFields(),n=null==t?void 0:t.targetFolder;if(!n)return void M.error("Выберите папку назначения");const r=Array.from(s);let i=0,l=0;for(const e of r)try{const t=null==o?void 0:o.find(t=>t.id===e),r=(null==t?void 0:t.isFolder)||e.startsWith("folder_");(null==w?void 0:w.moveItem)?(await w.moveItem({itemId:e,targetFolderId:n,isFolder:r}),i++):(console.warn(`DataProvider для перемещения не настроен для ${r?"папки":"файла"} ${e}`),l++)}catch(t){console.error(`Ошибка при перемещении объекта ${e}:`,t),l++}i>0&&M.success(`Успешно перемещено ${i} из ${r.length} объектов`),l>0&&M.error(`Не удалось переместить ${l} из ${r.length} объектов`),A(),null==b||b(new Set),await e({folderId:a||void 0})}catch(e){console.error("Ошибка при перемещении:",e),M.error("Ошибка при перемещении")}},[s,d,o,w,y,A,b,e,a]),T=c(()=>{null==v||v(!0)},[v]),I=c(()=>{null==v||v(!1),null==f||f.resetFields()},[v,f]),O=c(async()=>{if(s&&0!==s.size&&f)try{const t=await f.validateFields();if(!(null==t?void 0:t.targetFolder))return void M.error("Выберите папку назначения");const n=Array.from(s);let r=0;for(const e of n)try{const t=null==o?void 0:o.find(t=>t.id===e),n=(null==t?void 0:t.isFolder)||e.startsWith("folder_");console.warn(`Копирование не поддерживается для ${n?"папки":"файла"} ${e}`),r++}catch(t){console.error(`Ошибка при копировании объекта ${e}:`,t),r++}r>0&&M.error(`Не удалось скопировать ${r} из ${n.length} объектов`),I(),null==b||b(new Set),await e({folderId:a||void 0})}catch(e){console.error("Ошибка при копировании:",e),M.error("Ошибка при копировании")}},[s,f,o,y,I,b,e,a]);return{state:{isRenamingFile:h||!1,fileToRename:l},actions:{showRenameModal:x,handleRenameCancel:_,handleRenameOk:C,showMoveModal:S,handleMoveCancel:A,handleMoveOk:k,showCopyModal:T,handleCopyCancel:I,handleCopyOk:O}}})(i.fetchFiles);return{state:{files:t||[],selectedFiles:o.state.selectedFiles,loading:n||!1,isAddingFileByUrl:r||!1,isRenamingFile:a.state.isRenamingFile,fileToRename:a.state.fileToRename},actions:{fetchFiles:i.fetchFiles,handleDeleteFile:i.handleDeleteFile,handleDeleteFolder:i.handleDeleteFolder,handleAddFile:i.handleAddFile,handleAddFileByUrl:i.handleAddFileByUrl,handleDroppedFiles:i.handleDroppedFiles,uploadFileWithProvider:i.uploadFileWithProvider,toggleFileSelection:o.actions.toggleFileSelection,showRenameModal:a.actions.showRenameModal,handleRenameCancel:a.actions.handleRenameCancel,handleRenameOk:a.actions.handleRenameOk,showMoveModal:a.actions.showMoveModal,handleMoveCancel:a.actions.handleMoveCancel,handleMoveOk:a.actions.handleMoveOk,showCopyModal:a.actions.showCopyModal,handleCopyCancel:a.actions.handleCopyCancel,handleCopyOk:a.actions.handleCopyOk}}},Zr=()=>{var e;const{state:t,actions:n,options:i}=Br(),{t:o}=gr(),{message:a}=O.useApp(),{folders:s,selectedFolder:l,form:u,loading:h,isModalVisible:d}=t,{setFolders:f,setLoading:p,setIsModalVisible:g}=n,{dataProviders:m}=i,v=c(async()=>{console.log("Запрос папок..."),null==p||p(!0);try{let e=[];if(!(null==m?void 0:m.getFolders))return void console.error("DataProvider для папок не определен");e=await m.getFolders(),console.log("Полученные папки:",e);const t=Array.isArray(e)?e:[];null==f||f(t);const n=t.filter(e=>e.id===e.parentId);n.length>0&&console.warn("Обнаружены папки с циклическими зависимостями:",n)}catch(e){console.error("Ошибка при загрузке папок:",e),a.error("Ошибка при загрузке папок")}finally{null==p||p(!1)}},[null==m?void 0:m.getFolders,f,p,a]),b=c(()=>{u.setFieldsValue({folderName:"Новая папка"}),null==g||g(!0)},[u,g]),y=c(e=>{const r=[...(Array.isArray(s)?s:[]).filter(t=>t.id!==e.id),e];if(null==f||f(r),console.log("📂 Обновлен список папок, новая папка:",e),n.setSelectedFolder&&(n.setSelectedFolder(e.id),console.log("🎯 Выбрана созданная папка как активная:",e.id)),n.setPathHistory){const r=[...t.pathHistory||[],{id:e.id,name:e.name}];n.setPathHistory(r),console.log("🧭 Обновлен путь навигации:",r)}},[s,f,n,t.pathHistory]),w=c(async e=>{try{if(null==m?void 0:m.getFolders){const t=await m.getFolders(),n=(Array.isArray(t)?t:[]).some(t=>t.id===e);return console.log(n?"✅ Папка найдена:":"❌ Папка не найдена:",e),n}}catch(e){console.warn("⚠️ Ошибка проверки папки:",e)}return!1},[null==m?void 0:m.getFolders]),x=c(async()=>{try{const e=(await u.validateFields()).folderName.trim();if(!e)return void a.error("Имя папки не может быть пустым");const t=l&&"folders"!==l?l:null;let n;if(console.log("🆕 Создание новой папки:",{folderName:e,parentId:t,selectedFolder:l}),!(null==m?void 0:m.createFolder))return void a.error("DataProvider для создания папок не настроен");n=await m.createFolder({name:e,parentId:t}),(e=>{if(!e||!e.id)throw new Error("Некорректный ответ от сервера: отсутствует ID папки");if(e.id===e.parentId&&e.parentId)throw console.error("Обнаружена циклическая зависимость: папка является родителем сама для себя"),new Error("Ошибка: папка не может быть родителем самой себя")})(n),y(n),await v(),await new Promise(e=>setTimeout(e,200));await w(n.id)||console.warn("⚠️ Не удалось подтвердить создание папки на сервере, но продолжаем..."),a.success(`Папка "${e}" создана и выбрана`),null==g||g(!1)}catch(e){console.error("❌ Ошибка при создании папки:",e),a.error(e instanceof Error?e.message:o("Failed to create folder"))}},[u,l,null==m?void 0:m.createFolder,y,g,o,v,w,a]),_=c(()=>{null==g||g(!1)},[g]),C=c((e,t=new Set)=>{const n=Array.isArray(s)?s:[];return e.map(e=>{if(t.has(e.id))return console.warn(`Обнаружен цикл в структуре папок с id=${e.id}. Пропускаем обработку дочерних элементов.`),{key:e.id,label:e.name+" (ошибка)",icon:r.createElement(le,{style:{color:"red"}})};const i=new Set(t);i.add(e.id);const o=n.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:o.length>0?C(o,i):void 0}})},[s]),S=c(()=>{const e=Array.isArray(s)?s:[],t={key:"folders",label:o("Folders"),children:[]},n=e.filter(e=>null===e.parentId||!e.parentId);return t.children=C(n),[t]},[s,o,C]),A=c(async(e,t)=>{var r;try{if(!t||""===t.trim())return void a.error("Имя папки не может быть пустым");if(!(null===(r=i.dataProviders)||void 0===r?void 0:r.renameFolder))return void a.error("DataProvider для переименования папок не настроен");const o=await i.dataProviders.renameFolder(e,t.trim());if(!(null==o?void 0:o.id))return void a.error("Некорректный ответ при переименовании папки");await v(),e!==o.id&&n.setSelectedFolder&&n.setSelectedFolder(o.id),a.success(`Папка переименована на "${t.trim()}"`)}catch(e){console.error("Ошибка при переименовании папки:",e),a.error(e instanceof Error?e.message:"Ошибка при переименовании папки")}},[v,a,null===(e=i.dataProviders)||void 0===e?void 0:e.renameFolder]);return{state:{folders:s,isCreatingFolder:d,loading:h},actions:{fetchFolders:v,handleCreateFolder:b,handleModalOk:x,handleModalCancel:_,generateMenuItems:S,renameFolder:A}}},Jr=()=>{const{notification:e}=O.useApp(),t=Br().options.notification;return h(()=>Object.assign(Object.assign({},e),t),[e,t])},Qr="filemanager_sidebar_width",ei=()=>{const{options:e}=Br(),{customIcons:t}=e,n=(e,n,r)=>{const o=null==t?void 0:t[e];return o?i.createElement(o,r):i.createElement(n,r)};return{RootFolderIcon:e=>n("rootFolder",le,e),FolderIcon:e=>n("folder",le,e),FolderOpenIcon:e=>n("folderOpen",ve,e),AddFolderIcon:e=>n("addFolder",me,e),FileIcon:e=>n("file",ge,e),UploadIcon:e=>n("upload",pe,e),UploadByUrlIcon:e=>n("uploadByUrl",fe,e),ExpandArrowIcon:e=>n("expandArrow",de,e),CollapseArrowIcon:e=>n("collapseArrow",he,e),FolderPreviewIcon:e=>n("folderPreview",le,e),GridViewIcon:e=>n("gridView",ue,e),ListViewIcon:e=>n("listView",ce,e),getCustomIcon:n}};var ti={headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",paginationContainer:"paginationContainer",uploadZone:"uploadZone",active:"active",uploadIcon:"uploadIcon",uploadText:"uploadText",uploadSubtext:"uploadSubtext",tableContainer:"tableContainer",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileName:"fileName",fileNameClickable:"fileNameClickable",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",gridRow:"gridRow",gridCard:"gridCard",gridCardContent:"gridCardContent",gridCheckbox:"gridCheckbox",gridPreviewContainer:"gridPreviewContainer",gridPreviewContainerFolder:"gridPreviewContainerFolder",gridFolderIcon:"gridFolderIcon",gridFolderIconImage:"gridFolderIconImage",gridFileName:"gridFileName",gridFileInfo:"gridFileInfo",actionsBox:"actionsBox"};const{Option:ni}=F,ri=({files:r,handleSearch:i,handleSort:s,sortBy:l,sortOrder:h,handleSortOptionChange:d,pagination:f,setPagination:p,loading:g,handleItemClick:m,selectedFiles:v,toggleFileSelection:b,handleDroppedFiles:y,fileUpload:w})=>{const{t:x}=gr(),{FolderPreviewIcon:_}=ei(),{options:C}=Br(),{dataProviders:S}=C,{viewMode:A,setViewMode:k}=(()=>{const[e,t]=o(()=>{try{return localStorage.getItem(Kr)||"table"}catch(e){return"table"}}),n=c(e=>{t(e);try{localStorage.setItem(Kr,e)}catch(e){console.warn("Не удалось сохранить режим отображения:",e)}},[]),r=c(()=>{n("table"===e?"grid":"table")},[e,n]);return{viewMode:e,setViewMode:n,toggleViewMode:r}})(),[T,I]=o(!1),[O,E]=o({}),P=u(0),j=`${l}-${h}`,H=c(async e=>{try{if(null==S?void 0:S.getFiles){const{files:t,pagination:n}=await S.getFiles({folderId:"folders"===e?void 0:e});return(null==n?void 0:n.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return console.error(`Ошибка при получении количества файлов для папки ${e}:`,t),0}},[S]),W=c(async()=>{const e=r.filter(e=>e.isFolder);if(0===e.length)return;const t={},n=e.map(async e=>{t[e.id]=await H(e.id)});await Promise.all(n),E(t)},[r,H]);a(()=>{W()},[W]);const Y=c(e=>{e.preventDefault(),e.stopPropagation(),P.current+=1,e.dataTransfer.items&&e.dataTransfer.items.length>0&&I(!0)},[]),$=c(e=>{e.preventDefault(),e.stopPropagation(),P.current-=1,0===P.current&&I(!1)},[]),G=c(e=>{e.preventDefault(),e.stopPropagation()},[]),X=c(e=>{if(e.preventDefault(),e.stopPropagation(),I(!1),P.current=0,e.dataTransfer.files&&e.dataTransfer.files.length>0){const t=Array.from(e.dataTransfer.files);y(t).catch(e=>{console.error("Ошибка при загрузке файлов:",e),M.error("Произошла ошибка при загрузке файлов")})}},[y]),K=[{key:"selection",width:60,render:(t,n)=>e(R,{checked:v.has(n.id),onChange:()=>b(n.id)})},{key:"preview",width:100,render:(t,n)=>n.isFolder?e("div",{className:ti.fileManagerTableFolder,children:e("div",{className:ti.fileManagerTableFolderInner,children:e(_,{className:ti.tableFolderIcon})})}):e(Xr,{className:`${ti.imagePreview} ${ti.tableImagePreview}`,src:n.thumbnail||n.thumbnailUrl||n.url,alt:n.name,width:100,height:60,preview:!0,file:n})},{title:x("Name"),dataIndex:"name",key:"name",render:(e,n)=>{const r=n.isFolder&&O[n.id]||0,i=1===r?"item":"items";return t("div",{className:n.isFolder?ti.fileNameClickable:ti.fileName,children:[e||"Без названия",n.isFolder&&t("div",{className:ti.fileItemCount,children:[r," ",i]})]})}},{title:x("Dimensions"),key:"dimensions",width:100,render:(t,n)=>e("div",{className:ti.fileSize,children:n.isFolder?"Папка":n.dimensions||"600×300"})},{title:x("Size"),key:"size",width:100,render:(t,n)=>e("div",{className:ti.fileSize,children:n.isFolder?"-":`${n.size||350} КБ`})},{title:x("Date"),dataIndex:"date",key:"date",width:180,render:(t,n)=>{const r=n.date?new Date(n.date):new Date;return e("div",{className:ti.fileDate,children:x("date_of_add",{date:(e=>`${e.getDate()} ${[x("months.january"),x("months.february"),x("months.march"),x("months.april"),x("months.may"),x("months.june"),x("months.july"),x("months.august"),x("months.september"),x("months.october"),x("months.november"),x("months.december")][e.getMonth()]} ${e.getFullYear()}`)(r)})})}}];return t("div",{className:"content-layout",onDragEnter:Y,onDragLeave:$,onDragOver:G,onDrop:X,children:[T&&t("div",{className:`${ti.uploadZone} ${T?ti.active:""}`,children:[e(Er,{className:ti.uploadIcon,customIcon:null==C?void 0:C.dragDropIcon}),e("div",{className:ti.uploadText,children:x("Drag files to upload")}),e("div",{className:ti.uploadSubtext,children:x("Drop files here to upload")})]}),e("h1",{children:"My files"}),t("div",{className:ti.headerContainer,children:[e("div",{className:"search-container",children:e(Or,{placeholder:x("Image search..."),onSearch:i,className:ti.searchInput})}),t("div",{className:ti.actionsBox,children:[t("div",{className:"sort-container",children:[e("div",{className:"sort-label",children:x("Sort by")}),t(F,{value:j,onChange:d,className:ti.sortSelect,popupMatchSelectWidth:!1,children:[e(ni,{value:"date-desc",children:x("Newest first")}),e(ni,{value:"date-asc",children:x("Oldest first")}),e(ni,{value:"size-desc",children:x("Largest first")}),e(ni,{value:"size-asc",children:x("Smallest first")}),e(ni,{value:"name-asc",children:x("A-Z")}),e(ni,{value:"name-desc",children:x("Z-A")}),e(ni,{value:"type-asc",children:x("By type")})]})]}),e("div",{className:ti.actionsContainer,children:e(D,{options:[{value:"grid",icon:e(ue,{})},{value:"table",icon:e(ce,{})}],value:A,onChange:e=>k(e)})})]})]}),e("div",{className:ti.filesContainer,children:t(n,"table"===A?{children:[g||r&&0!==r.length?e("div",{className:ti.tableContainer,children:e(N,{dataSource:r,columns:K,rowKey:"id",pagination:!1,loading:g,onRow:e=>({onClick:t=>{const n=t.target;n.closest(".ant-checkbox-wrapper")||n.closest(".ant-checkbox")||n.classList.contains("ant-checkbox-input")||m(e)}}),showHeader:!1})}):e(L,{description:x("No data to display"),style:{margin:"40px 0"}}),f.total>f.pageSize&&e("div",{className:ti.paginationContainer,children:e(z,{current:f.current,pageSize:f.pageSize,total:f.total,onChange:(e,t)=>p({current:e,pageSize:t,total:f.total}),showSizeChanger:!0,showTotal:e=>x("total pages",{total:e})})})]}:{children:[e(()=>r&&0!==r.length?e(B,{gutter:[16,16],className:ti.gridRow,style:{gap:32,padding:"0 16px 16px"},children:r.map(r=>e(V,{className:ti.gridCard_col,style:{padding:0},children:t(U,{hoverable:!0,cover:e("div",{className:r.isFolder?ti.gridPreviewContainerFolder:ti.gridPreviewContainer,onClick:e=>{e.stopPropagation(),r.isFolder&&m(r)},children:r.isFolder?e("div",{className:ti.gridFolderIcon,children:e(_,{className:ti.gridFolderIconImage})}):e(Xr,{src:r.thumbnail||r.thumbnailUrl||r.url,alt:r.name,className:ti.gridImagePreview,preview:!0,file:r})}),className:`${ti.gridCard} ${v.has(r.id)?ti.gridCardSelected:""}`,onClick:e=>{e.stopPropagation(),b(r.id)},children:[t("div",{className:ti.gridCardContent,children:[e("div",{className:ti.gridFileName,children:r.name||x("Untitled")}),e("div",{className:ti.gridFileInfo,children:r.isFolder?(()=>{const e=O[r.id]||0;return`${e} ${1===e?"item":"items"}`})():t(n,{children:[r.dimensions||"1440 × 900"," • ",r.size||"120.54 КБ"," • jpg"]})})]}),e("div",{onClick:e=>{e.stopPropagation()},className:ti.gridCheckbox,children:e(R,{checked:v.has(r.id),onChange:e=>{e.stopPropagation(),b(r.id)}})})]})},r.id))}):e(L,{description:x("No data to display"),style:{margin:"40px 0"}}),{}),f.total>f.pageSize&&e("div",{className:ti.paginationContainer,children:e(z,{current:f.current,pageSize:f.pageSize,total:f.total,onChange:(e,t)=>p({current:e,pageSize:t,total:f.total}),showSizeChanger:!0,showTotal:e=>x("total pages",{total:e})})})]})})]})},ii=({isModalVisible:r,handleModalOk:i,handleModalCancel:o,form:a,selectedFolder:s,folders:l,isUrlModalVisible:c,setIsUrlModalVisible:u,handleAddFileByUrl:h,urlForm:d,isRenameModalVisible:f,handleRenameOk:p,handleRenameCancel:g,renameForm:m,fileToRename:v,files:b,isMoveModalVisible:y,handleMoveOk:w,handleMoveCancel:x,moveForm:_,selectedFiles:C,isRenameFolderModalVisible:S,handleRenameFolderOk:A,handleRenameFolderCancel:k,renameFolderForm:T,folderToRename:I,isCopyModalVisible:O,handleCopyOk:M,handleCopyCancel:j,copyForm:F})=>{var R,D,L;const{t:N}=gr(),z=Array.isArray(b)?b:[],B=v?null===(R=z.find(e=>e.id===v))||void 0===R?void 0:R.name:"",V=Array.isArray(l)?l:[],U=I?null===(D=V.find(e=>e.id===I))||void 0===D?void 0:D.name:"",Y=v?z.find(e=>e.id===v):null,$=(null==Y?void 0:Y.isFolder)||(null==v?void 0:v.startsWith("folder_")),G=()=>{const t=(n=null,r=new Set)=>l.filter(e=>{const t=null===n&&!e.parentId,r=e.parentId===n;return t||r}).map(n=>{if(r.has(n.id))return{key:n.id,title:`${n.name} (циклическая ссылка)`,icon:e(le,{style:{color:"red"}}),disabled:!0,isLeaf:!0};const i=Array.from(C).includes(n.id),o=new Set(r);o.add(n.id);const a=t(n.id,o);return{key:n.id,title:n.name,icon:e(le,{}),disabled:i,children:a.length>0?a:void 0,isLeaf:0===a.length}}),n=t();return[{key:"root",title:N("Folders"),icon:e(le,{}),children:n}]};return t(n,{children:[e(H,{title:e("div",{className:"modal-title",children:N("Creating a new folder")}),open:r,onOk:i,onCancel:o,okText:N("Create"),cancelText:N("Cancel"),children:t(P,{form:a,layout:"vertical",children:[e(P.Item,{name:"folderName",label:e("div",{className:"form-label",children:N("Folder name")}),rules:[{required:!0,message:N("Enter the name of the folder")}],initialValue:N("New folder"),className:"form-item",children:e(E,{autoFocus:!0,className:"form-input"})}),e("div",{children:s&&"folders"!==s?t("p",{children:[N("A folder will be created inside:")," ",(null===(L=V.find(e=>e.id===s))||void 0===L?void 0:L.name)||N("selected folder")]}):e("p",{children:N("The folder will be created in the root directory")})})]})}),e(H,{title:e("div",{className:"modal-title",children:N("Upload image by URL")}),open:c,onOk:()=>h(null),onCancel:()=>u(!1),okText:N("Download"),cancelText:N("Cancel"),children:t(P,{form:d,layout:"vertical",children:[e(P.Item,{name:"fileUrl",label:e("div",{className:"form-label",children:N("image URL")}),rules:[{required:!0,message:N("Enter the URL of the image")}],className:"form-item",children:e(E,{autoFocus:!0,placeholder:"https://example.com/image.jpg",className:"form-input"})}),e("p",{children:N("Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP")})]})}),e(H,{title:e("div",{className:"modal-title",children:$?`${N("Rename folder")} ${B}`:N("Rename file",{currentFileName:B})}),open:f,onOk:p,onCancel:g,okText:N("Rename"),cancelText:N("Cancel"),children:e(P,{form:m,layout:"vertical",children:e(P.Item,{name:"newFileName",label:e("div",{className:"form-label",children:N($?"New folder name":"New file name")}),rules:[{required:!0,message:N($?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:e(E,{autoFocus:!0,className:"form-input"})})})}),e(H,{title:e("div",{className:"modal-title",children:N("Move to folder")}),open:y,onOk:w,onCancel:x,okText:"Переместить",cancelText:N("Cancel"),children:t(P,{form:_,layout:"vertical",children:[e("div",{className:"file-name-label",children:N("Selected files:",{count:C.size})}),e(P.Item,{name:"targetFolder",label:e("div",{className:"form-label",children:N("Select the destination folder")}),rules:[{required:!0,message:N("Select the destination folder")}],className:"form-item",children:e(W,{defaultExpandAll:!0,treeData:G(),selectable:!0,onSelect:e=>{e.length>0&&_.setFieldsValue({targetFolder:e[0]})}})})]})}),e(H,{title:t("div",{className:"modal-title",children:[N("Rename folder")," ",U]}),open:S,onOk:A,onCancel:k,okText:N("Rename"),cancelText:N("Cancel"),children:e(P,{form:T,layout:"vertical",children:e(P.Item,{name:"newFolderName",label:e("div",{className:"form-label",children:N("New folder name")}),rules:[{required:!0,message:N("Enter a new folder name")}],className:"form-item",children:e(E,{autoFocus:!0,className:"form-input"})})})}),e(H,{title:e("div",{className:"modal-title",children:N("Copy to folder")}),open:O,onOk:M,onCancel:j,okText:N("Copy"),cancelText:N("Cancel"),children:t(P,{form:F,layout:"vertical",children:[e("div",{className:"file-name-label",children:N("Selected files:",{count:C.size})}),e(P.Item,{name:"targetFolder",label:e("div",{className:"form-label",children:N("Select the destination folder")}),rules:[{required:!0,message:N("Select the destination folder")}],className:"form-item",children:e(W,{defaultExpandAll:!0,treeData:G(),selectable:!0,onSelect:e=>{e.length>0&&F.setFieldsValue({targetFolder:e[0]})}})})]})})]})},oi=e=>{const{state:t,actions:n,options:r}=Br(),{t:i}=gr(),{folders:o,folderToRename:a,renameFolderForm:s,isRenameFolderModalVisible:l}=t,{setFolderToRename:u,setIsRenameFolderModalVisible:h}=n,{apiEndpoints:d,dataProviders:f}=r,p=c(e=>{null==u||u(e),null==h||h(!0);const t=null==o?void 0:o.find(t=>t.id===e);t&&s&&s.setFieldsValue({newFolderName:t.name})},[u,h,o,s]),g=c(()=>{null==h||h(!1),null==u||u(null),null==s||s.resetFields()},[h,u,s]),m=c(async()=>{if(a&&s)try{const t=await s.validateFields();if(!(null==t?void 0:t.newFolderName))return;if(!(null==f?void 0:f.renameFolder))return void M.error("DataProvider для переименования папок не настроен");const r=await f.renameFolder(a,t.newFolderName.trim());if(!(null==r?void 0:r.id))return void M.error("Некорректный ответ при переименовании папки");M.success(`${i("Folder renamed to")} ${t.newFolderName}`),g(),await e(),a!==r.id&&n.setSelectedFolder&&n.setSelectedFolder(r.id)}catch(e){console.error("Ошибка при переименовании папки:",e),M.error("Ошибка при переименовании папки")}},[a,s,d,g,e,i]);return{state:{isRenamingFolder:l||!1,folderToRename:a},actions:{showRenameFolderModal:p,handleRenameFolderCancel:g,handleRenameFolderOk:m}}},ai=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),si=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),li=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),ci=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),ui=()=>e("svg",{width:"20",height:"20",style:{verticalAlign:"-0.35em",marginRight:10},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M7.49984 11.668H15.8332L12.9582 7.91797L11.0415 10.418L9.74984 8.7513L7.49984 11.668ZM6.6665 15.0013C6.20817 15.0013 5.81581 14.8381 5.48942 14.5117C5.16303 14.1853 4.99984 13.793 4.99984 13.3346V3.33464C4.99984 2.8763 5.16303 2.48394 5.48942 2.15755C5.81581 1.83116 6.20817 1.66797 6.6665 1.66797H16.6665C17.1248 1.66797 17.5172 1.83116 17.8436 2.15755C18.17 2.48394 18.3332 2.8763 18.3332 3.33464V13.3346C18.3332 13.793 18.17 14.1853 17.8436 14.5117C17.5172 14.8381 17.1248 15.0013 16.6665 15.0013H6.6665ZM6.6665 13.3346H16.6665V3.33464H6.6665V13.3346ZM3.33317 18.3346C2.87484 18.3346 2.48248 18.1714 2.15609 17.8451C1.8297 17.5187 1.6665 17.1263 1.6665 16.668V5.0013H3.33317V16.668H14.9998V18.3346H3.33317Z",fill:"currentColor"})}),hi=()=>e("svg",{width:"20",height:"20",style:{verticalAlign:"-0.35em",marginRight:10},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M3.33317 14.1654C2.87484 14.1654 2.48248 14.0022 2.15609 13.6758C1.8297 13.3494 1.6665 12.957 1.6665 12.4987V7.4987C1.6665 7.04036 1.8297 6.648 2.15609 6.32161C2.48248 5.99523 2.87484 5.83203 3.33317 5.83203H6.6665C7.12484 5.83203 7.5172 5.99523 7.84359 6.32161C8.16998 6.648 8.33317 7.04036 8.33317 7.4987H3.33317V12.4987H6.6665V10.832H4.99984V9.16536H8.33317V12.4987C8.33317 12.957 8.16998 13.3494 7.84359 13.6758C7.5172 14.0022 7.12484 14.1654 6.6665 14.1654H3.33317ZM9.99984 14.1654V5.83203H11.6665V14.1654H9.99984ZM13.3332 14.1654V5.83203H19.1665V7.4987H14.9998V9.16536H18.3332V10.832H14.9998V14.1654H13.3332Z",fill:"currentColor"})}),di=()=>e("svg",{width:"20",height:"20",style:{verticalAlign:"-0.35em",marginRight:10},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M0.833496 15.8346V4.16797H2.50016V15.8346H0.833496ZM4.16683 15.8346V4.16797H5.8335V15.8346H4.16683ZM9.16683 15.8346C8.7085 15.8346 8.31614 15.6714 7.98975 15.3451C7.66336 15.0187 7.50016 14.6263 7.50016 14.168V5.83464C7.50016 5.3763 7.66336 4.98394 7.98975 4.65755C8.31614 4.33116 8.7085 4.16797 9.16683 4.16797H17.5002C17.9585 4.16797 18.3509 4.33116 18.6772 4.65755C19.0036 4.98394 19.1668 5.3763 19.1668 5.83464V14.168C19.1668 14.6263 19.0036 15.0187 18.6772 15.3451C18.3509 15.6714 17.9585 15.8346 17.5002 15.8346H9.16683ZM9.16683 14.168H17.5002V5.83464H9.16683V14.168ZM10.0002 12.5013H16.6668L14.5002 9.58464L12.9168 11.668L11.7502 10.1263L10.0002 12.5013Z",fill:"currentColor"})}),fi=()=>t("svg",{width:"20",height:"20",style:{verticalAlign:"-0.35em",marginRight:10},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M5.9471 17.4987C5.9471 17.4987 5.5606 15.9327 4.87018 15.2423C4.17976 14.5519 2.61377 14.1653 2.61377 14.1653C2.61377 14.1653 4.17976 13.7788 4.87018 13.0884C5.5606 12.398 5.9471 10.832 5.9471 10.832C5.9471 10.832 6.3336 12.398 7.02402 13.0884C7.71443 13.7788 9.28044 14.1653 9.28044 14.1653C9.28044 14.1653 7.71443 14.5519 7.02402 15.2423C6.3336 15.9327 5.9471 17.4987 5.9471 17.4987Z",fill:"currentColor"}),e("path",{d:"M13.0304 14.9987C13.0304 14.9987 12.4024 12.2582 11.2804 11.05C10.1585 9.84174 7.61377 9.16536 7.61377 9.16536C7.61377 9.16536 10.1585 8.48899 11.2804 7.28074C12.4024 6.07251 13.0304 3.33203 13.0304 3.33203C13.0304 3.33203 13.6585 6.07251 14.7804 7.28074C15.9023 8.48899 18.4471 9.16536 18.4471 9.16536C18.4471 9.16536 15.9023 9.84174 14.7804 11.05C13.6585 12.2582 13.0304 14.9987 13.0304 14.9987Z",fill:"currentColor"}),e("path",{d:"M4.6971 7.4987C4.6971 7.4987 4.45554 6.51995 4.02402 6.08844C3.59251 5.65693 2.61377 5.41537 2.61377 5.41537C2.61377 5.41537 3.59251 5.1738 4.02402 4.74228C4.45554 4.31077 4.6971 3.33203 4.6971 3.33203C4.6971 3.33203 4.93866 4.31077 5.37017 4.74228C5.80169 5.1738 6.78044 5.41537 6.78044 5.41537C6.78044 5.41537 5.80169 5.65693 5.37017 6.08844C4.93866 6.51995 4.6971 7.4987 4.6971 7.4987Z",fill:"currentColor"}),e("path",{d:"M15.947 17.5C15.947 17.5 15.7536 16.9127 15.4085 16.6538C15.0633 16.395 14.2803 16.25 14.2803 16.25C14.2803 16.25 15.0633 16.105 15.4085 15.8461C15.7536 15.5872 15.947 15 15.947 15C15.947 15 16.1402 15.5872 16.4854 15.8461C16.8306 16.105 17.6136 16.25 17.6136 16.25C17.6136 16.25 16.8306 16.395 16.4854 16.6538C16.1402 16.9127 15.947 17.5 15.947 17.5Z",fill:"currentColor"})]}),pi=()=>t("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[e("path",{d:"M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"}),e("path",{d:"M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"}),e("path",{d:"M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"}),e("path",{d:"M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"})]}),gi=t=>e(ae,Object.assign({component:ai},t)),mi=t=>e(ae,Object.assign({component:si},t)),vi=t=>e(ae,Object.assign({component:li},t)),bi=t=>e(ae,Object.assign({component:ci},t)),yi=t=>e(ae,Object.assign({component:fi},t)),wi=t=>e(ae,Object.assign({component:pi},t)),xi=t=>e(ae,Object.assign({component:di},t)),_i=t=>e(ae,Object.assign({component:hi},t)),Ci=t=>e(ae,Object.assign({component:ui},t));var Si={button:"button",foldersTitle:"foldersTitle",folderActions:"folderActions",fileCount:"fileCount",uploadButton:"uploadButton",folderMenu:"folderMenu",folderIcon:"folderIcon",folderLabelItem:"folderLabelItem",foldersTitleItem:"foldersTitleItem",folderLabel:"folderLabel",foldersContainer:"foldersContainer",divider:"divider"};const Ai=f(p(({selectedFolder:n,generateMenuItems:r,onFolderSelect:i,folders:s,fetchFolders:l,handleAddFile:u,setIsUrlModalVisible:d,handleCreateFolder:f,activeLibraryItem:p,setActiveLibraryItem:m},v)=>{const b=Array.isArray(s)?s:[],{t:y}=gr(),[w,x]=o({}),{options:_}=Br(),{dataProviders:C,config:S}=_,A=oi(l),{FolderIcon:k,AddFolderIcon:T,UploadByUrlIcon:I,ExpandArrowIcon:O,CollapseArrowIcon:E}=ei(),P=c(e=>{const t=["folders"],n=e=>{e.forEach(e=>{t.push(e.key),e.children&&n(e.children)})};return n(e),t},[]),[M,j]=o(()=>{const e=r();return P(e)});a(()=>{const e=r(),t=P(e);j(t)},[b,r,P]);const F=c(async e=>{try{if(null==C?void 0:C.getFiles){const{files:t,pagination:n}=await C.getFiles({folderId:"folders"===e?void 0:e});return(null==n?void 0:n.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return console.error(`Ошибка при получении количества файлов для папки ${e}:`,t),0}},[C]),R=c(async()=>{if(0===b.length)return;const e={};e.folders=await F("folders");const t=b.map(async t=>{const n=await F(t.id);e[t.id]=n});await Promise.all(t),x(e)},[b,F]),D=c(async e=>{const t=await F(e);x(n=>Object.assign(Object.assign({},n),{[e]:t}))},[F]);g(v,()=>({refreshFileCounts:R}),[R]),a(()=>{R()},[R]);const N=c(async()=>{await u(),n?await D(n):await D("folders")},[u,n,D]),z=h(()=>({items:[{key:"upload-url",label:y("Upload image by URL"),icon:e(I,{}),onClick:()=>null==d?void 0:d(!0)}]}),[I,d,y]),B=[{key:Pr,label:y("My files"),icon:e(Ci,{})},{key:Mr,label:y("GIF"),icon:e(_i,{})},{key:jr,label:y("Stock images"),icon:e(xi,{})},{key:Fr,label:y("AI"),icon:e(yi,{}),disabled:!(null==S?void 0:S.sseQuery)}],V=c(e=>{const t=e[0];t&&(null==i||i(t))},[i]),U=c(({key:e})=>{console.log("key",e),m(e)},[m]),H=c(e=>{j(e)},[]),K=c(()=>{var n;const i=r();if(0===i.length||1===i.length&&(!i[0].children||0===i[0].children.length))return[{key:"empty",title:e("div",{className:Si.emptyFolderContainer,children:e(L,{image:L.PRESENTED_IMAGE_SIMPLE,description:"Нет доступных папок"})})}];const o=n=>{var r;const i=b.find(e=>e.id===n.key),a=w[n.key]||0,s={items:[{key:"rename",label:y("Rename"),icon:e(ye,{}),onClick:e=>{i&&e.domEvent&&(e.domEvent.stopPropagation(),A.actions.showRenameFolderModal(i.id))}}]},l=e(Y,{menu:s,trigger:["contextMenu"],children:t("div",{className:"folder-item-container",children:[t("div",{className:Si.folderLabel,children:[e(k,{className:Si.folderIcon}),e("span",{className:Si.folderLabelItem,children:n.label})]}),e("div",{className:Si.fileCount,title:`${a} ${1===a?"файл":"файлов"}`,children:a})]})});return{key:n.key,title:l,children:null===(r=n.children)||void 0===r?void 0:r.map(o)}},a=e("div",{className:Si.foldersTitle,children:t("div",{className:Si.foldersTitleItem,children:[e(ve,{className:Si.folderIcon}),e("span",{className:Si.folderLabelItem,children:y("Folders")})]})});return i.length>0&&"folders"===i[0].key?[{key:"folders",title:a,children:null===(n=i[0].children)||void 0===n?void 0:n.map(o)}]:i.map(o)},[r,y,b,w,k,A.actions]),q=h(()=>K(),[K]);return t("div",{className:"sidebar-container",children:[t(Y.Button,{type:"primary",size:"large",icon:e(E,{}),onClick:N,menu:z,className:Si.uploadButton,children:[e(be,{})," ",e("span",{className:"",children:y("Upload image")})]}),e("div",{className:"sidebar__sections-title",children:y("Library")}),e($,{className:"folder-menu",items:B,defaultSelectedKeys:[Pr],onSelect:({key:e})=>U({key:e}),selectedKeys:[p]}),e(G,{className:Si.divider}),t("div",{className:Si.foldersContainer,children:[e(W,{className:`${Si.folderMenu} folder-tree`,selectedKeys:n?[n]:["folders"],expandedKeys:M,onSelect:V,onExpand:H,treeData:q,switcherIcon:({expanded:t})=>e(t?E:O,{}),showLine:!1}),e("div",{className:Si.folderActions,children:e(X,{onClick:e=>{e.stopPropagation(),f()},className:Si.button,icon:e(T,{}),size:"middle"})})]})]})}));Ai.displayName="FolderSidebar";var ki=Object.defineProperty,Ti=(e,t,n)=>(((e,t,n)=>{t in e?ki(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),Ii=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ei(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Pi=function(e){return!(t=e,!t||"object"!=typeof t||function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Mi}(e)}(e));var t};var Mi="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function ji(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Ni(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function Fi(e,t,n){return e.concat(t).map(function(e){return ji(e,n)})}function Ri(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function Di(e,t){try{return t in e}catch{return!1}}function Li(e,t,n){var r={};return n.isMergeableObject(e)&&Ri(e).forEach(function(t){r[t]=ji(e[t],n)}),Ri(t).forEach(function(i){(function(e,t){return Di(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(Di(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Ni;var n=t.customMerge(e);return"function"==typeof n?n:Ni}(i,n)(e[i],t[i],n):r[i]=ji(t[i],n))}),r}function Ni(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Fi,n.isMergeableObject=n.isMergeableObject||Pi,n.cloneUnlessOtherwiseSpecified=ji;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Li(e,t,n):ji(t,n)}Ni.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return Ni(e,n,t)},{})};var zi=Ni;function Bi(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function Vi(e){var t=e.toString().split(/[eE]/),n=(t[0].split(".")[1]||"").length-+(t[1]||0);return n>0?n:0}function Ui(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=Vi(e);return t>0?Bi(Number(e)*Math.pow(10,t)):Number(e)}function Hi(e){Gi&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&console.warn(e+" is beyond boundary when transfer to integer, the results may not be accurate")}function Wi(e,t){var n=e[0],r=e[1],i=e.slice(2),o=t(n,r);return i.forEach(function(e){o=t(o,e)}),o}function Yi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length>2)return Wi(e,Yi);var n=e[0],r=e[1],i=Ui(n),o=Ui(r),a=Vi(n)+Vi(r),s=i*o;return Hi(s),s/Math.pow(10,a)}function $i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length>2)return Wi(e,$i);var n=e[0],r=e[1],i=Ui(n),o=Ui(r);return Hi(i),Hi(o),Yi(i/o,Bi(Math.pow(10,Vi(r)-Vi(n))))}var Gi=!0;var Xi={strip:Bi,plus:function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length>2)return Wi(t,e);var r=t[0],i=t[1],o=Math.pow(10,Math.max(Vi(r),Vi(i)));return(Yi(r,o)+Yi(i,o))/o},minus:function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length>2)return Wi(t,e);var r=t[0],i=t[1],o=Math.pow(10,Math.max(Vi(r),Vi(i)));return(Yi(r,o)-Yi(i,o))/o},times:Yi,divide:$i,round:function(e,t){var n=Math.pow(10,t),r=$i(Math.round(Math.abs(Yi(e,n))),n);return e<0&&0!==r&&(r=Yi(r,-1)),r},digitLength:Vi,float2Fixed:Ui,enableBoundaryChecking:function(e){void 0===e&&(e=!0),Gi=e}};function Ki(e){return e&&e.Math==Math?e:void 0}var qi="object"==typeof globalThis&&Ki(globalThis)||"object"==typeof window&&Ki(window)||"object"==typeof self&&Ki(self)||"object"==typeof global&&Ki(global)||function(){return this}()||{};function Zi(){return qi}function Ji(e,t,n){var r=n||qi,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}var Qi=Object.prototype.toString;function eo(e){switch(Qi.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return co(e,Error)}}function to(e,t){return Qi.call(e)===`[object ${t}]`}function no(e){return to(e,"ErrorEvent")}function ro(e){return to(e,"DOMError")}function io(e){return to(e,"String")}function oo(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function ao(e){return to(e,"Object")}function so(e){return typeof Event<"u"&&co(e,Event)}function lo(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function co(e,t){try{return e instanceof t}catch{return!1}}function uo(e,t){try{let r=e;var n=[];let i=0,o=0;let a;for(;r&&i++<5&&(a=ho(r,t),!("html"===a||i>1&&o+3*n.length+a.length>=80));)n.push(a),o+=a.length,r=r.parentNode;return n.reverse().join(" > ")}catch{return"<unknown>"}}function ho(e,t){var n=e,r=[];let i,o,a,s,l;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());var c=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(c&&c.length)c.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&io(i))for(o=i.split(/\s+/),l=0;l<o.length;l++)r.push(`.${o[l]}`);var u=["type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}class fo extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}var po=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function go(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${a}`}function mo(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function vo(e){var t="string"==typeof e?function(e){var t=po.exec(e);if(!t)throw new fo(`Invalid Sentry Dsn: ${e}`);const[n,r,i="",o,a="",s]=t.slice(1);let l="",c=s;var u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){var h=c.match(/^\d+/);h&&(c=h[0])}return mo({host:o,pass:i,path:l,projectId:c,port:a,protocol:n,publicKey:r})}(e):mo(e);return function(e){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return;const{port:t,projectId:n,protocol:r}=e;if(["protocol","publicKey","host","projectId"].forEach(t=>{if(!e[t])throw new fo(`Invalid Sentry Dsn: ${t} missing`)}),!n.match(/^\d+$/))throw new fo(`Invalid Sentry Dsn: Invalid projectId ${n}`);if(!function(e){return"http"===e||"https"===e}(r))throw new fo(`Invalid Sentry Dsn: Invalid protocol ${r}`);if(t&&isNaN(parseInt(t,10)))throw new fo(`Invalid Sentry Dsn: Invalid port ${t}`)}(t),t}var bo=Zi(),yo=["debug","info","warn","error","log","assert","trace"];function wo(e){var t=Zi();if(!("console"in t))return e();var n=t.console,r={};yo.forEach(e=>{var i=n[e]&&n[e].__sentry_original__;e in t.console&&i&&(r[e]=n[e],n[e]=i)});try{return e()}finally{Object.keys(r).forEach(e=>{n[e]=r[e]})}}function xo(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?yo.forEach(n=>{t[n]=(...t)=>{e&&wo(()=>{bo.console[n](`Sentry Logger [${n}]:`,...t)})}}):yo.forEach(e=>{t[e]=()=>{}}),t}let _o;function Co(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.substr(0,t)}...`}function So(e,t){if(!Array.isArray(e))return"";var n=[];for(let t=0;t<e.length;t++){var r=e[t];try{n.push(String(r))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Ao(e,t){return!!io(e)&&(function(e){return to(e,"RegExp")}(t)?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function ko(e,t,n){if(t in e){var r=e[t],i=n(r);if("function"==typeof i)try{Io(i,r)}catch{}e[t]=i}}function To(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function Io(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,To(e,"__sentry_original__",t)}function Oo(e){return e.__sentry_original__}function Eo(e){if(eo(e))return{message:e.message,name:e.name,stack:e.stack,...Mo(e)};if(so(e)){var t={type:e.type,target:Po(e.target),currentTarget:Po(e.currentTarget),...Mo(e)};return typeof CustomEvent<"u"&&co(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Po(e){try{return function(e){return typeof Element<"u"&&co(e,Element)}(e)?uo(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Mo(e){if("object"==typeof e&&null!==e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function jo(e,t=40){var n=Object.keys(Eo(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Co(n[0],t);for(let e=n.length;e>0;e--){var r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:Co(r,t)}return""}function Fo(e){return Ro(e,new Map)}function Ro(e,t){if(ao(e)){if(void 0!==(i=t.get(e)))return i;var n={};for(var r of(t.set(e,n),Object.keys(e)))typeof e[r]<"u"&&(n[r]=Ro(e[r],t));return n}if(Array.isArray(e)){var i;if(void 0!==(i=t.get(e)))return i;n=[];return t.set(e,n),e.forEach(e=>{n.push(Ro(e,t))}),n}return e}_o=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Ji("logger",xo):xo();function Do(...e){var t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0)=>{var r=[];for(var i of e.split("\n").slice(n)){var o=i.replace(/\(error: (.*)\)/,"$1");for(var a of t){var s=a(o);if(s){r.push(s);break}}}return function(e){if(!e.length)return[];let t=e;var n=t[0].function||"",r=t[t.length-1].function||"";return(-1!==n.indexOf("captureMessage")||-1!==n.indexOf("captureException"))&&(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map(e=>({...e,filename:e.filename||t[0].filename,function:e.function||"?"})).reverse()}(r)}}function Lo(e){return Array.isArray(e)?Do(...e):e}var No="<anonymous>";function zo(e){try{return e&&"function"==typeof e&&e.name||No}catch{return No}}function Bo(){if(!("fetch"in Zi()))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Vo(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}var Uo=Zi(),Ho={},Wo={};function Yo(e){if(!Wo[e])switch(Wo[e]=!0,e){case"console":"console"in Uo&&yo.forEach(function(e){e in Uo.console&&ko(Uo.console,e,function(t){return function(...n){Go("console",{args:n,level:e}),t&&t.apply(Uo.console,n)}})});break;case"dom":!function(){if("document"in Uo){var e=Go.bind(null,"dom"),t=ea(e,!0);Uo.document.addEventListener("click",t,!1),Uo.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{var n=Uo[t]&&Uo[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(ko(n,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{var o=this,a=o.__sentry_instrumentation_handlers__=o.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var l=ea(e);s.handler=l,t.call(this,n,l,i)}s.refCount+=1}catch{}return t.call(this,n,r,i)}}),ko(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var i=this,o=i.__sentry_instrumentation_handlers__||{},a=o[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete i.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}}();break;case"xhr":!function(){if("XMLHttpRequest"in Uo){var e=XMLHttpRequest.prototype;ko(e,"open",function(e){return function(...t){var n=this,r=t[1],i=n.__sentry_xhr__={method:io(t[0])?t[0].toUpperCase():t[0],url:t[1]};io(r)&&"POST"===i.method&&r.match(/sentry_key/)&&(n.__sentry_own_request__=!0);var o=function(){if(4===n.readyState){try{i.status_code=n.status}catch{}Go("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?ko(n,"onreadystatechange",function(e){return function(...t){return o(),e.apply(n,t)}}):n.addEventListener("readystatechange",o),e.apply(n,t)}}),ko(e,"send",function(e){return function(...t){return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),Go("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}}();break;case"fetch":!function(){if(!Bo())return!1;var e=Zi();if(Vo(e.fetch))return!0;let t=!1;var n=e.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=Vo(r.contentWindow.fetch)),n.head.removeChild(r)}catch(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}()||ko(Uo,"fetch",function(e){return function(...t){var n={args:t,fetchData:{method:Xo(t),url:Ko(t)},startTimestamp:Date.now()};return Go("fetch",{...n}),e.apply(Uo,t).then(e=>(Go("fetch",{...n,endTimestamp:Date.now(),response:e}),e),e=>{throw Go("fetch",{...n,endTimestamp:Date.now(),error:e}),e})}});break;case"history":!function(){if(!function(){var e=Zi(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}())return;var e=Uo.onpopstate;function t(e){return function(...t){var n=t.length>2?t[2]:void 0;if(n){var r=qo,i=String(n);qo=i,Go("history",{from:r,to:i})}return e.apply(this,t)}}Uo.onpopstate=function(...t){var n=Uo.location.href,r=qo;if(qo=n,Go("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch{}},ko(Uo.history,"pushState",t),ko(Uo.history,"replaceState",t)}();break;case"error":ta=Uo.onerror,Uo.onerror=function(e,t,n,r,i){return Go("error",{column:r,error:i,line:n,msg:e,url:t}),!!ta&&ta.apply(this,arguments)};break;case"unhandledrejection":na=Uo.onunhandledrejection,Uo.onunhandledrejection=function(e){return Go("unhandledrejection",e),!na||na.apply(this,arguments)};break;default:return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("unknown instrumentation type:",e))}}function $o(e,t){Ho[e]=Ho[e]||[],Ho[e].push(t),Yo(e)}function Go(e,t){if(e&&Ho[e])for(var n of Ho[e]||[])try{n(t)}catch(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${zo(n)}\nError:`,t)}}function Xo(e=[]){return"Request"in Uo&&co(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function Ko(e=[]){return"string"==typeof e[0]?e[0]:"Request"in Uo&&co(e[0],Request)?e[0].url:String(e[0])}let qo;var Zo=1e3;let Jo,Qo;function ea(e,t=!1){return n=>{if(n&&Qo!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch{}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===Jo||function(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch{}return!1}(Qo,n))&&(e({event:n,name:r,global:t}),Qo=n),clearTimeout(Jo),Jo=Uo.setTimeout(()=>{Jo=void 0},Zo)}}}let ta=null;let na=null;function ra(){var e=Zi(),t=e.crypto||e.msCrypto;if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");var n=t&&t.getRandomValues?()=>t.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function ia(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function oa(e){const{message:t,event_id:n}=e;if(t)return t;var r=ia(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function aa(e,t,n){var r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type="Error")}function sa(e,t){var n=ia(e);if(n){var r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){var i={...r&&r.data,...t.data};n.mechanism.data=i}}}function la(e){if(e&&e.__sentry_captured__)return!0;try{To(e,"__sentry_captured__",!0)}catch{}return!1}function ca(e){return Array.isArray(e)?e:[e]}function ua(){return!(typeof __SENTRY_BROWSER_BUNDLE__<"u"&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call(typeof process<"u"?process:0)}function ha(e,t=1/0,n=1/0){try{return fa("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function da(e,t=3,n=102400){var r=ha(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(r)>n?da(e,t-1,n):r}function fa(e,t,n=1/0,r=1/0,i=function(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[o,a]=i;if(null===t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;var s=function(e,t){try{return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":typeof global<"u"&&t===global?"[Global]":typeof window<"u"&&t===window?"[Window]":typeof document<"u"&&t===document?"[Document]":function(e){return ao(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t)?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?`[Function: ${zo(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${Object.getPrototypeOf(t).constructor.name}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;if(0===n)return s.replace("object ","");if(o(t))return"[Circular ~]";var l=t;if(l&&"function"==typeof l.toJSON)try{return fa("",l.toJSON(),n-1,r,i)}catch{}var c=Array.isArray(t)?[]:{};let u=0;var h=Eo(t);for(var d in h)if(Object.prototype.hasOwnProperty.call(h,d)){if(u>=r){c[d]="[MaxProperties ~]";break}var f=h[d];c[d]=fa(d,f,n-1,r,i),u+=1}return a(t),c}var pa;function ga(e){return new va(t=>{t(e)})}function ma(e){return new va((t,n)=>{n(e)})}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(pa||(pa={}));class va{__init(){this._state=pa.PENDING}__init2(){this._handlers=[]}constructor(e){va.prototype.__init.call(this),va.prototype.__init2.call(this),va.prototype.__init3.call(this),va.prototype.__init4.call(this),va.prototype.__init5.call(this),va.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new va((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new va((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{i?n(r):t(r)})})}__init3(){this._resolve=e=>{this._setResult(pa.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(pa.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{if(this._state===pa.PENDING){if(lo(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init6(){this._executeHandlers=()=>{if(this._state!==pa.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===pa.RESOLVED&&e[1](this._value),this._state===pa.REJECTED&&e[2](this._value),e[0]=!0)})}}}}function ba(e){var t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return ma(new fo("Not adding Promise because buffer limit was reached."));var i=r();return-1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new va((n,r)=>{let i=t.length;if(!i)return n(!0);var o=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{ga(e).then(()=>{--i||(clearTimeout(o),n(!0))},r)})})}}}function ya(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}var wa=["fatal","error","warning","log","info","debug"];function xa(e){return"warn"===e?"warning":wa.includes(e)?e:"log"}var _a={nowSeconds:()=>Date.now()/1e3};var Ca=ua()?function(){try{return function(e,t){return e.require(t)}(module,"perf_hooks").performance}catch{return}}():function(){const{performance:e}=Zi();if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),Sa=void 0===Ca?_a:{nowSeconds:()=>(Ca.timeOrigin+Ca.now())/1e3},Aa=_a.nowSeconds.bind(_a),ka=Sa.nowSeconds.bind(Sa);function Ta(e,t=[]){return[e,t]}function Ia(e,t){const[n,r]=e;return[n,[...r,t]]}function Oa(e,t){e[1].forEach(e=>{var n=e[0].type;t(e,n)})}function Ea(e,t){return(t||new TextEncoder).encode(e)}function Pa(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[Ea(i,t),e]:i.push("string"==typeof e?Ea(e,t):e)}for(var a of r){const[e,t]=a;o(`\n${JSON.stringify(e)}\n`),o("string"==typeof t||t instanceof Uint8Array?t:JSON.stringify(t))}return"string"==typeof i?i:function(e){var t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(var i of e)n.set(i,r),r+=i.length;return n}(i)}function Ma(e,t){var n="string"==typeof e.data?Ea(e.data,t):e.data;return[Fo({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=Zi();if(e&&e.now){var t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=i<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(o||s<t)&&(i<=s&&e.timeOrigin)}})();var ja={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function Fa(e){return ja[e]}function Ra(e,{statusCode:t,headers:n},r=Date.now()){var i={...e},o=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(o)for(var s of o.trim().split(",")){const[e,t]=s.split(":",2);var l=parseInt(e,10),c=1e3*(isNaN(l)?60:l);if(t)for(var u of t.split(";"))i[u]=r+c;else i.all=r+c}else a?i.all=r+function(e,t=Date.now()){var n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(i.all=r+6e4);return i}function Da(e){var t=ka(),n={sid:ra(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Fo({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&La(n,e),n}function La(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||ka(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ra()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{var n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class Na{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){var t=new Na;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&La(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){var t=e(this);return t instanceof Na?t:this}return e instanceof Na?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):ao(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r={timestamp:Aa(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags={transaction:n,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...za(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,n,r=0){return new va((i,o)=>{var a=e[r];if(null===t||"function"!=typeof a)i(t);else{var s=a({...t},n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&a.id&&null===s&&_o.log(`Event processor "${a.id}" dropped event`),lo(s)?s.then(t=>this._notifyEventProcessors(e,t,n,r+1).then(i)).then(null,o):this._notifyEventProcessors(e,s,n,r+1).then(i).then(null,o)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?ca(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function za(){return Ji("globalEventProcessors",()=>[])}function Ba(e){za().push(e)}var Va=100;class Ua{__init(){this._stack=[{}]}constructor(e,t=new Na,n=4){this._version=n,Ua.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=Na.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var n=this._lastEventId=t&&t.event_id?t.event_id:ra(),r=new Error("Sentry syntheticException");return this._withClient((i,o)=>{i.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},o)}),n}captureMessage(e,t,n){var r=this._lastEventId=n&&n.event_id?n.event_id:ra(),i=new Error(e);return this._withClient((o,a)=>{o.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},a)}),r}captureEvent(e,t){var n=t&&t.event_id?t.event_id:ra();return"transaction"!==e.type&&(this._lastEventId=n),this._withClient((r,i)=>{r.captureEvent(e,{...t,event_id:n},i)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!n||!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=Va}=r.getOptions&&r.getOptions()||{};if(!(o<=0)){var a={timestamp:Aa(),...e},s=i?wo(()=>i(a,t)):a;null!==s&&n.addBreadcrumb(s,o)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var n=this.getScope();n&&n.setTag(e,t)}setExtra(e,t){var n=this.getScope();n&&n.setExtra(e,t)}setContext(e,t){var n=this.getScope();n&&n.setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();t&&n&&e(t)}run(e){var t=Wa(this);try{e(this)}finally{Wa(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),La(e,t)}(n),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i}=n&&n.getOptions()||{};var o=Zi();const{userAgent:a}=o.navigator||{};var s=Da({release:r,environment:i,...t&&{user:t.getUser()},...a&&{userAgent:a},...e});if(t){var l=t.getSession&&t.getSession();l&&"ok"===l.status&&La(l,{status:"exited"}),this.endSession(),t.setSession(s)}return s}shouldSendDefaultPii(){var e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){var n=Ha().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Ha(){var e=Zi();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Wa(e){var t=Ha(),n=Ga(t);return Xa(t,e),n}function Ya(){var e=Ha();return(!$a(e)||Ga(e).isOlderThan(4))&&Xa(e,new Ua),ua()?function(e){try{var t=Ha().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return Ga(e);if(!$a(n)||Ga(n).isOlderThan(4)){var r=Ga(e).getStackTop();Xa(n,new Ua(r.client,Na.clone(r.scope)))}return Ga(n)}catch{return Ga(e)}}(e):Ga(e)}function $a(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Ga(e){return Ji("hub",()=>new Ua,e)}function Xa(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Ka(e,t){return function(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}({sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}})}function qa(e,t={}){var n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){var t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${Ka(e,r)}`}function Za(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Ja(e,t,n,r){var i=Za(n),o=e.type||"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);var a=function(e,t,n,r){var i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:go(r)},..."transaction"===e.type&&i&&{trace:Fo({...i})}}}(e,i,r,t);return delete e.sdkProcessingMetadata,Ta(a,[[{type:o},e]])}var Qa=[];function es(e){var t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach(e=>{e.isDefaultInstance=!0}),r=Array.isArray(n)?[...t,...n]:"function"==typeof n?ca(n(t)):t;var i=function(e){var t={};return e.forEach(e=>{const{name:n}=e;var r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r),o=i.findIndex(e=>"Debug"===e.name);if(-1!==o){const[e]=i.splice(o,1);i.push(e)}return i}var ts="Not capturing exception because it's already been captured.";class ns{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}constructor(e){if(ns.prototype.__init.call(this),ns.prototype.__init2.call(this),ns.prototype.__init3.call(this),ns.prototype.__init4.call(this),this._options=e,e.dsn){this._dsn=vo(e.dsn);var t=qa(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("No DSN provided, client will not do anything.")}captureException(e,t,n){if(la(e))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(ts));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,n)).then(e=>{r=e})),r}captureMessage(e,t,n,r){let i=n&&n.event_id;var o=oo(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(o.then(e=>this._captureEvent(e,n,r)).then(e=>{i=e})),i}captureEvent(e,t,n){if(t&&t.originalException&&la(t.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(ts));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then(e=>{r=e})),r}captureSession(e){this._isEnabled()?"string"!=typeof e.release?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),La(e,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getTransport(){return this._transport}flush(e){var t=this._transport;return t?this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e)):ga(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,e))}setupIntegrations(){var e,t;this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=(e=this._options.integrations,t={},e.forEach(e=>{t[e.name]=e,-1===Qa.indexOf(e.name)&&(e.setupOnce(Ba,Ya),Qa.push(e.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(`Integration installed: ${e.name}`))}),t),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}sendEvent(e,t={}){if(this._dsn){let r=Ja(e,this._dsn,this._options._metadata,this._options.tunnel);for(var n of t.attachments||[])r=Ia(r,Ma(n,this._options.transportOptions&&this._options.transportOptions.textEncoder));this._sendEnvelope(r)}}sendSession(e){if(this._dsn){var t=function(e,t,n,r){var i=Za(n);return Ta({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&{dsn:go(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t){if(this._options.sendClientReports){var n=`${e}:${t}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}_updateSessionFromEvent(e,t){let n=!1,r=!1;var i=t.exception&&t.exception.values;if(i)for(var o of(r=!0,i)){var a=o.mechanism;if(a&&!1===a.handled){n=!0;break}}var s="ok"===e.status;(s&&0===e.errors||s&&n)&&(La(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new va(t=>{let n=0;var r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const{normalizeDepth:r=3,normalizeMaxBreadth:i=1e3}=this.getOptions();var o={...e,event_id:e.event_id||t.event_id||ra(),timestamp:e.timestamp||Aa()};this._applyClientOptions(o),this._applyIntegrationsMetadata(o);let a=n;t.captureContext&&(a=Na.clone(a).update(t.captureContext));let s=ga(o);if(a){var l=[...t.attachments||[],...a.getAttachments()];l.length&&(t.attachments=l),s=a.applyToEvent(o,t)}return s.then(e=>"number"==typeof r&&r>0?this._normalizeEvent(e,r,i):e)}_normalizeEvent(e,t,n){if(!e)return null;var r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:ha(e.data,t,n)}}))},...e.user&&{user:ha(e.user,t,n)},...e.contexts&&{contexts:ha(e.contexts,t,n)},...e.extra&&{extra:ha(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=ha(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>(e.data&&(e.data=ha(e.data,t,n)),e))),r}_applyClientOptions(e){var t=this.getOptions();const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=Co(e.message,o));var a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Co(a.value,o));var s=e.request;s&&s.url&&(s.url=Co(s.url,o))}_applyIntegrationsMetadata(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){var t=e;"log"===t.logLevel?_o.log(t.message):_o.warn(t)}})}_processEvent(e,t,n){const{beforeSend:r,sampleRate:i}=this.getOptions();if(!this._isEnabled())return ma(new fo("SDK not enabled, will not capture event.","log"));var o="transaction"===e.type;return!o&&"number"==typeof i&&Math.random()>i?(this.recordDroppedEvent("sample_rate","error"),ma(new fo(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"))):this._prepareEvent(e,t,n).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",e.type||"error"),new fo("An event processor returned null, will not send event.","log");return t.data&&!0===t.data.__sentry__||o||!r?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(lo(e))return e.then(e=>{if(!ao(e)&&null!==e)throw new fo(t);return e},e=>{throw new fo(`beforeSend rejected with ${e}`)});if(!ao(e)&&null!==e)throw new fo(t);return e}(r(n,t))}).then(r=>{if(null===r)throw this.recordDroppedEvent("before_send",e.type||"error"),new fo("`beforeSend` returned `null`, will not send event.","log");var i=n&&n.getSession();!o&&i&&this._updateSessionFromEvent(i,r);var a=r.transaction_info;if(o&&a&&r.transaction!==e.transaction){var s="custom";r.transaction_info={...a,source:s,changes:[...a.changes,{source:s,timestamp:r.timestamp,propagations:a.propagations}]}}return this.sendEvent(r,t),r}).then(null,e=>{throw e instanceof fo?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new fo(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing+=1,e.then(e=>(this._numProcessing-=1,e),e=>(this._numProcessing-=1,e))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,e=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error("Error while sending event:",e)}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error("Transport disabled")}_clearOutcomes(){var e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}})}}function rs(e,t,n=ba(e.bufferSize||30)){let r={};return{send:function(i){var o=[];if(Oa(i,(t,n)=>{var i=Fa(n);!function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)?o.push(t):e.recordDroppedEvent("ratelimit_backoff",i)}),0===o.length)return ga();var a=Ta(i[0],o),s=t=>{Oa(a,(n,r)=>{e.recordDroppedEvent(t,Fa(r))})};return n.add(()=>t({body:Pa(a,e.textEncoder)}).then(e=>{void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Ra(r,e)},e=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error("Failed while sending event:",e),s("network_error")})).then(e=>e,e=>{if(e instanceof fo)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error("Skipped sending event because buffer is full."),s("queue_overflow"),ga();throw e})},flush:e=>n.drain(e)}}var is="7.14.0";let os;class as{constructor(){as.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=as.id}setupOnce(){os=Function.prototype.toString,Function.prototype.toString=function(...e){var t=Oo(this)||this;return os.apply(t,e)}}}as.__initStatic();var ss=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class ls{static __initStatic(){this.id="InboundFilters"}__init(){this.name=ls.id}constructor(e={}){this._options=e,ls.prototype.__init.call(this)}setupOnce(e,t){var n=e=>{var n=t();if(n){var r=n.getIntegration(ls);if(r){var i=n.getClient(),o=i?i.getOptions():{},a=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...ss],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(r._options,o);return function(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch{}return!1}(e)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${oa(e)}`),!0):function(e,t){return!(!t||!t.length)&&function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:n=""}=e.exception.values&&e.exception.values[0]||{};return[`${n}`,`${t}: ${n}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error(`Cannot extract message for event ${oa(e)}`),[]}return[]}(e).some(e=>t.some(t=>Ao(e,t)))}(e,t.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${oa(e)}`),!0):function(e,t){if(!t||!t.length)return!1;var n=cs(e);return!!n&&t.some(e=>Ao(n,e))}(e,t.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${oa(e)}.\nUrl: ${cs(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;var n=cs(e);return!n||t.some(e=>Ao(n,e))}(e,t.allowUrls)&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${oa(e)}.\nUrl: ${cs(e)}`),!0)}(e,a)?null:e}}return e};n.id=this.name,e(n)}}function cs(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?function(e=[]){for(let n=e.length-1;n>=0;n--){var t=e[n];if(t&&"<anonymous>"!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error(`Cannot extract url for event ${oa(e)}`),null}}function us(e,t){var n=ds(e,t),r={type:t&&t.name,value:ps(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function hs(e,t){return{exception:{values:[us(e,t)]}}}function ds(e,t){var n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(fs.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch{}return[]}ls.__initStatic();var fs=/Minified React error #\d+;/i;function ps(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function gs(e,t,n,r,i){let o;if(no(t)&&t.error)return hs(e,t.error);if(ro(t)||function(e){return to(e,"DOMException")}(t)){var a=t;if("stack"in t)o=hs(e,t);else{var s=a.name||(ro(a)?"DOMError":"DOMException"),l=a.message?`${s}: ${a.message}`:s;o=ms(e,l,n,r),aa(o,l)}return"code"in a&&(o.tags={...o.tags,"DOMException.code":`${a.code}`}),o}return eo(t)?hs(e,t):ao(t)||so(t)?(o=function(e,t,n,r){var i=Ya().getClient(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:so(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${jo(t)}`}]},extra:{__serialized__:da(t,o)}};if(n){var s=ds(e,n);s.length&&(a.exception.values[0].stacktrace={frames:s})}return a}(e,t,n,i),sa(o,{synthetic:!0}),o):(o=ms(e,t,n,r),aa(o,`${t}`),sa(o,{synthetic:!0}),o)}function ms(e,t,n,r){var i={message:t};if(r&&n){var o=ds(e,n);o.length&&(i.exception={values:[{value:t,stacktrace:{frames:o}}]})}return i}var vs="Breadcrumbs";class bs{static __initStatic(){this.id=vs}__init(){this.name=bs.id}constructor(e){bs.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&$o("console",ys),this.options.dom&&$o("dom",function(e){function t(t){let n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?uo(t.event.target,r):uo(t.event,r)}catch{n="<unknown>"}0!==n.length&&Ya().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&$o("xhr",ws),this.options.fetch&&$o("fetch",xs),this.options.history&&$o("history",_s)}}function ys(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:xa(e.level),message:So(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${So(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}Ya().addBreadcrumb(t,{input:e.args,level:e.level})}function ws(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;const{method:t,url:n,status_code:r,body:i}=e.xhr.__sentry_xhr__||{};return void Ya().addBreadcrumb({category:"xhr",data:{method:t,url:n,status_code:r},type:"http"},{xhr:e.xhr,input:i})}}function xs(e){!e.endTimestamp||e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?Ya().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):Ya().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response}))}function _s(e){var t=Zi();let n=e.from,r=e.to;var i=ya(t.location.href);let o=ya(n);var a=ya(r);o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),Ya().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}bs.__initStatic();var Cs=Zi();class Ss extends ns{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:is}],version:is},super(e),e.sendClientReports&&Cs.document&&Cs.document.addEventListener("visibilitychange",()=>{"hidden"===Cs.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){var i=gs(e,t,n&&n.syntheticException||void 0,r);return sa(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),ga(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){var o=ms(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),ga(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){var n=this.getIntegrationById(vs);n&&n.options&&n.options.sentry&&Ya().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:oa(e)},{event:e}),super.sendEvent(e,t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){var e=this._clearOutcomes();if(0!==e.length)if(this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log("Sending outcomes:",e);var t=qa(this._dsn,this._options),n=function(e,t){return Ta(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:Aa(),discarded_events:e}]])}(e,this._options.tunnel&&go(this._dsn));try{var r=Zi();if("[object Navigator]"===Object.prototype.toString.call(r&&r.navigator)&&"function"==typeof r.navigator.sendBeacon&&!this._options.transportOptions)r.navigator.sendBeacon.bind(r.navigator)(t,Pa(n));else this._sendEnvelope(n)}catch(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error(e)}}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log("No dsn provided, will not send outcomes");else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log("No outcomes to send")}}var As=Zi();let ks;function Ts(e,t=function(){if(ks)return ks;if(Vo(As.fetch))return ks=As.fetch.bind(As);var e=As.document;let t=As.fetch;if(e&&"function"==typeof e.createElement)try{var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return ks=t.bind(As)}()){return rs(e,function(n){var r={body:n.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n.body.length<=65536,...e.fetchOptions};return t(e.url,r).then(e=>({statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))})}function Is(e){return rs(e,function(t){return new va((n,r)=>{var i=new XMLHttpRequest;for(var o in i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url),e.headers)Object.prototype.hasOwnProperty.call(e.headers,o)&&i.setRequestHeader(o,e.headers[o]);i.send(t.body)})})}var Os="?";function Es(e,t,n,r){var i={filename:e,function:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}var Ps=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ms=/\((\S*)(?::(\d+))(?::(\d+))\)/,js=[30,e=>{var t=Ps.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=Ms.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}const[e,r]=Bs(t[1]||Os,t[2]);return Es(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Fs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rs=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ds=[50,e=>{var t=Fs.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=Rs.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}let e=t[3],r=t[1]||Os;return[r,e]=Bs(r,e),Es(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Ls=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Ns=[40,e=>{var t=Ls.exec(e);return t?Es(t[2],t[1]||Os,+t[3],t[4]?+t[4]:void 0):void 0}],zs=Do(...[js,Ds,Ns]),Bs=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Os,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let Vs=0;function Us(){return Vs>0}function Hs(e,t={},n){if("function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(Oo(e))return e}catch{return e}var i=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var i=r.map(e=>Hs(e,t));return e.apply(this,i)}catch(e){throw Vs+=1,setTimeout(()=>{Vs-=1}),function(e){Ya().withScope(e)}(n=>{n.addEventProcessor(e=>(t.mechanism&&(aa(e,void 0),sa(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),function(e,t){Ya().captureException(e,{captureContext:t})}(e)}),e}};try{for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o])}catch{}Io(i,e),To(e,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get:()=>e.name})}catch{}return i}class Ws{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=Ws.id}__init2(){this._installFunc={onerror:Ys,onunhandledrejection:$s}}constructor(e){Ws.prototype.__init.call(this),Ws.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;var e=this._options;for(var t in e){var n=this._installFunc[t];n&&e[t]&&(Xs(t),n(),this._installFunc[t]=void 0)}}}function Ys(){$o("error",e=>{const[t,n,r]=qs();if(!t.getIntegration(Ws))return;const{msg:i,url:o,line:a,column:s,error:l}=e;if(!(Us()||l&&l.__sentry_own_request__)){var c=void 0===l&&io(i)?function(e,t,n,r){var i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=no(e)?e.message:e,a="Error";var s=o.match(i);s&&(a=s[1],o=s[2]);var l={exception:{values:[{type:a,value:o}]}};return Gs(l,t,n,r)}(i,o,a,s):Gs(gs(n,l||i,void 0,r,!1),o,a,s);c.level="error",Ks(t,l,c,"onerror")}})}function $s(){$o("unhandledrejection",e=>{const[t,n,r]=qs();if(!t.getIntegration(Ws))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch{}if(Us()||i&&i.__sentry_own_request__)return!0;var o=oo(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):gs(n,i,void 0,r,!0);o.level="error",Ks(t,i,o,"onunhandledrejection")})}function Gs(e,t,n,r){var i=e.exception=e.exception||{},o=i.values=i.values||[],a=o[0]=o[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,h=io(t)&&t.length>0?t:function(){var e=Zi();try{return e.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:h,function:"?",in_app:!0,lineno:u}),e}function Xs(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(`Global Handler attached: ${e}`)}function Ks(e,t,n,r){sa(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function qs(){var e=Ya(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}Ws.__initStatic();var Zs=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Js{static __initStatic(){this.id="TryCatch"}__init(){this.name=Js.id}constructor(e){Js.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){var e=Zi();this._options.setTimeout&&ko(e,"setTimeout",Qs),this._options.setInterval&&ko(e,"setInterval",Qs),this._options.requestAnimationFrame&&ko(e,"requestAnimationFrame",el),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&ko(XMLHttpRequest.prototype,"send",tl);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:Zs).forEach(nl)}}function Qs(e){return function(...t){var n=t[0];return t[0]=Hs(n,{mechanism:{data:{function:zo(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function el(e){return function(t){return e.apply(this,[Hs(t,{mechanism:{data:{function:"requestAnimationFrame",handler:zo(e)},handled:!0,type:"instrument"}})])}}function tl(e){return function(...t){var n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&ko(n,e,function(t){var n={mechanism:{data:{function:e,handler:zo(t)},handled:!0,type:"instrument"}},r=Oo(t);return r&&(n.mechanism.data.handler=zo(r)),Hs(t,n)})}),e.apply(this,t)}}function nl(e){var t=Zi(),n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(ko(n,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Hs(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:zo(r),target:e},handled:!0,type:"instrument"}}))}catch{}return t.apply(this,[n,Hs(r,{mechanism:{data:{function:"addEventListener",handler:zo(r),target:e},handled:!0,type:"instrument"}}),i])}}),ko(n,"removeEventListener",function(e){return function(t,n,r){var i=n;try{var o=i&&i.__sentry_wrapped__;o&&e.call(this,t,o,r)}catch{}return e.call(this,t,i,r)}}))}Js.__initStatic();class rl{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=rl.id}constructor(e={}){rl.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){var e=Ya().getClient();!e||Ba((t,n)=>{var r=Ya().getIntegration(rl);return r?function(e,t,n,r,i){if(!(r.exception&&r.exception.values&&i&&co(i.originalException,Error)))return r;var o=il(e,n,i.originalException,t);return r.exception.values=[...o,...r.exception.values],r}(e.getOptions().stackParser,r._key,r._limit,t,n):t})}}function il(e,t,n,r,i=[]){if(!co(n[r],Error)||i.length+1>=t)return i;var o=us(e,n[r]);return il(e,t,n[r],r,[o,...i])}rl.__initStatic();var ol=Zi();class al{constructor(){al.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=al.id}setupOnce(){Ba(e=>{if(Ya().getIntegration(al)){if(!ol.navigator&&!ol.location&&!ol.document)return e;var t=e.request&&e.request.url||ol.location&&ol.location.href;const{referrer:r}=ol.document||{},{userAgent:i}=ol.navigator||{};var n={...t&&{url:t},headers:{...e.request&&e.request.headers,...r&&{Referer:r},...i&&{"User-Agent":i}}};return{...e,request:n}}return e})}}al.__initStatic();class sl{constructor(){sl.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=sl.id}setupOnce(e,t){var n=e=>{var n=t().getIntegration(sl);if(n){try{if(function(e,t){return!!t&&!(!function(e,t){var n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!cl(e,t)||!ll(e,t))}(e,t)&&!function(e,t){var n=ul(t),r=ul(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&cl(e,t)&&ll(e,t))}(e,t))}(e,n._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function ll(e,t){let n=hl(e),r=hl(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let e=0;e<r.length;e++){var i=r[e],o=n[e];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function cl(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function ul(e){return e.exception&&e.exception.values&&e.exception.values[0]}function hl(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}sl.__initStatic();var dl=[new ls,new as,new Js,new bs,new Ws,new rl,new sl,new al];function fl(e={}){if(void 0===e.defaultIntegrations&&(e.defaultIntegrations=dl),void 0===e.release){var t=Zi();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);var n={...e,stackParser:Lo(e.stackParser||zs),integrations:es(e),transport:e.transport||(Bo()?Ts:Is)};(function(e,t){!0===t.debug&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?_o.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));var n=Ya(),r=n.getScope();r&&r.update(t.initialScope);var i=new e(t);n.bindClient(i)})(Ss,n),e.autoSessionTracking&&function(){var e=Zi(),t=e.document;if(typeof t>"u")return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var n=Ya();!n.captureSession||(pl(n),$o("history",({from:e,to:t})=>{void 0===e||e===t||pl(Ya())}))}()}function pl(e){e.startSession({ignoreDuration:!0}),e.captureSession()}var gl={exports:{}},ml={},vl=i,bl=Symbol.for("react.element"),yl=Symbol.for("react.fragment"),wl=Object.prototype.hasOwnProperty,xl=vl.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_l={key:!0,ref:!0,__self:!0,__source:!0};
9
+ */var Ir=(Ar||(Ar=1,function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=256,c=1/0,u=9007199254740991,h=NaN,d=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],p="[object Arguments]",g="[object Array]",m="[object Boolean]",v="[object Date]",b="[object Error]",y="[object Function]",w="[object GeneratorFunction]",x="[object Map]",_="[object Number]",C="[object Object]",S="[object Promise]",A="[object RegExp]",k="[object Set]",T="[object String]",I="[object Symbol]",O="[object WeakMap]",E="[object ArrayBuffer]",P="[object DataView]",M="[object Float32Array]",j="[object Float64Array]",F="[object Int8Array]",R="[object Int16Array]",D="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,$=RegExp(W.source),G=RegExp(Y.source),X=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",ke="\\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",Te="['’]",Ie="["+we+"]",Oe="["+ke+"]",Ee="["+xe+"]",Pe="\\d+",Me="["+_e+"]",je="["+Ce+"]",Fe="[^"+we+ke+Pe+_e+Ce+Se+"]",Re="\\ud83c[\\udffb-\\udfff]",De="[^"+we+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Se+"]",Be="\\u200d",Ve="(?:"+je+"|"+Fe+")",Ue="(?:"+ze+"|"+Fe+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ee+"|"+Re+")?",$e="["+Ae+"]?",Ge=$e+Ye+"(?:"+Be+"(?:"+[De,Le,Ne].join("|")+")"+$e+Ye+")*",Xe="(?:"+[Me,Le,Ne].join("|")+")"+Ge,Ke="(?:"+[De+Ee+"?",Ee,Le,Ne,Ie].join("|")+")",qe=RegExp(Te,"g"),Ze=RegExp(Ee,"g"),Je=RegExp(Re+"(?="+Re+")|"+Ke+Ge,"g"),Qe=RegExp([ze+"?"+je+"+"+He+"(?="+[Oe,ze,"$"].join("|")+")",Ue+"+"+We+"(?="+[Oe,ze+Ve,"$"].join("|")+")",ze+"?"+Ve+"+"+He,ze+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,Xe].join("|"),"g"),et=RegExp("["+Be+we+xe+Ae+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["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"],rt=-1,it={};it[M]=it[j]=it[F]=it[R]=it[D]=it[L]=it[N]=it[z]=it[B]=!0,it[p]=it[g]=it[E]=it[m]=it[P]=it[v]=it[b]=it[y]=it[x]=it[_]=it[C]=it[A]=it[k]=it[T]=it[O]=!1;var ot={};ot[p]=ot[g]=ot[E]=ot[P]=ot[m]=ot[v]=ot[M]=ot[j]=ot[F]=ot[R]=ot[D]=ot[x]=ot[_]=ot[C]=ot[A]=ot[k]=ot[T]=ot[I]=ot[L]=ot[N]=ot[z]=ot[B]=!0,ot[b]=ot[y]=ot[O]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Qn&&Qn&&Qn.Object===Object&&Qn,ut="object"==typeof self&&self&&self.Object===Object&&self,ht=ct||ut||Function("return this")(),dt=t&&!t.nodeType&&t,ft=dt&&e&&!e.nodeType&&e,pt=ft&&ft.exports===dt,gt=pt&&ct.process,mt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),vt=mt&&mt.isArrayBuffer,bt=mt&&mt.isDate,yt=mt&&mt.isMap,wt=mt&&mt.isRegExp,xt=mt&&mt.isSet,_t=mt&&mt.isTypedArray;function Ct(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 St(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function At(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function kt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function It(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Ot(e,t){return!(null==e||!e.length)&&zt(e,t,0)>-1}function Et(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Mt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function jt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Ft(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Dt=Ht("length");function Lt(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Nt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function zt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Nt(e,Vt,n)}function Bt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Vt(e){return e!=e}function Ut(e,t){var n=null==e?0:e.length;return n?$t(e,t)/n:h}function Ht(e){return function(t){return null==t?n:t[e]}}function Wt(e){return function(t){return null==e?n:e[t]}}function Yt(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function $t(e,t){for(var r,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==n&&(r=r===n?a:r+a)}return r}function Gt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xt(e){return e?e.slice(0,dn(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function qt(e,t){return Pt(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&zt(t,e[n],0)>-1;);return n}function Qt(e,t){for(var n=e.length;n--&&zt(t,e[n],0)>-1;);return n}var en=Wt({"À":"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"}),tn=Wt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+at[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function an(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var s=e[n];s!==t&&s!==o||(e[n]=o,a[i++]=n)}return a}function ln(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function un(e){return rn(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Dt(e)}function hn(e){return rn(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function dn(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var fn=Wt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),pn=function e(t){var re,we=(t=null==t?ht:pn.defaults(ht.Object(),t,pn.pick(ht,nt))).Array,xe=t.Date,_e=t.Error,Ce=t.Function,Se=t.Math,Ae=t.Object,ke=t.RegExp,Te=t.String,Ie=t.TypeError,Oe=we.prototype,Ee=Ce.prototype,Pe=Ae.prototype,Me=t["__core-js_shared__"],je=Ee.toString,Fe=Pe.hasOwnProperty,Re=0,De=(re=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"",Le=Pe.toString,Ne=je.call(Ae),ze=ht._,Be=ke("^"+je.call(Fe).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=pt?t.Buffer:n,Ue=t.Symbol,He=t.Uint8Array,We=Ve?Ve.allocUnsafe:n,Ye=an(Ae.getPrototypeOf,Ae),$e=Ae.create,Ge=Pe.propertyIsEnumerable,Xe=Oe.splice,Ke=Ue?Ue.isConcatSpreadable:n,Je=Ue?Ue.iterator:n,et=Ue?Ue.toStringTag:n,at=function(){try{var e=uo(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ut=xe&&xe.now!==ht.Date.now&&xe.now,dt=t.setTimeout!==ht.setTimeout&&t.setTimeout,ft=Se.ceil,gt=Se.floor,mt=Ae.getOwnPropertySymbols,Dt=Ve?Ve.isBuffer:n,Wt=t.isFinite,gn=Oe.join,mn=an(Ae.keys,Ae),vn=Se.max,bn=Se.min,yn=xe.now,wn=t.parseInt,xn=Se.random,_n=Oe.reverse,Cn=uo(t,"DataView"),Sn=uo(t,"Map"),An=uo(t,"Promise"),kn=uo(t,"Set"),Tn=uo(t,"WeakMap"),In=uo(Ae,"create"),On=Tn&&new Tn,En={},Pn=Lo(Cn),Mn=Lo(Sn),jn=Lo(An),Fn=Lo(kn),Rn=Lo(Tn),Dn=Ue?Ue.prototype:n,Ln=Dn?Dn.valueOf:n,Nn=Dn?Dn.toString:n;function zn(e){if(es(e)&&!Ha(e)&&!(e instanceof Hn)){if(e instanceof Un)return e;if(Fe.call(e,"__wrapped__"))return No(e)}return new Un(e)}var Bn=function(){function e(){}return function(t){if(!Qa(t))return{};if($e)return $e(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vn(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $n(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new $n;++t<n;)this.add(e[t])}function Xn(e){var t=this.__data__=new Yn(e);this.size=t.size}function Kn(e,t){var n=Ha(e),r=!n&&Ua(e),i=!n&&!r&&Ga(e),o=!n&&!r&&!i&&ls(e),a=n||r||i||o,s=a?Gt(e.length,Te):[],l=s.length;for(var c in e)!t&&!Fe.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||bo(c,l))||s.push(c);return s}function qn(e){var t=e.length;return t?e[Gr(0,t-1)]:n}function Zn(e,t){return Fo(Ii(e),ar(t,0,e.length))}function Jn(e){return Fo(Ii(e))}function Qn(e,t,r){(r!==n&&!za(e[t],r)||r===n&&!(t in e))&&ir(e,t,r)}function er(e,t,r){var i=e[t];Fe.call(e,t)&&za(i,r)&&(r!==n||t in e)||ir(e,t,r)}function tr(e,t){for(var n=e.length;n--;)if(za(e[n][0],t))return n;return-1}function nr(e,t,n,r){return hr(e,function(e,i,o){t(r,e,n(e),o)}),r}function rr(e,t){return e&&Oi(t,Es(t),e)}function ir(e,t,n){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function or(e,t){for(var r=-1,i=t.length,o=we(i),a=null==e;++r<i;)o[r]=a?n:As(e,t[r]);return o}function ar(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function sr(e,t,r,i,o,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=o?r(e,i,o,a):r(e)),s!==n)return s;if(!Qa(e))return e;var h=Ha(e);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Fe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Ii(e,s)}else{var d=po(e),f=d==y||d==w;if(Ga(e))return _i(e,l);if(d==C||d==p||f&&!o){if(s=c||f?{}:mo(e),!l)return c?function(e,t){return Oi(e,fo(e),t)}(e,function(e,t){return e&&Oi(t,Ps(t),e)}(s,e)):function(e,t){return Oi(e,ho(e),t)}(e,rr(s,e))}else{if(!ot[d])return o?e:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case E:return Ci(e);case m:case v:return new i(+e);case P:return function(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case j:case F:case R:case D:case L:case N:case z:case B:return Si(e,n);case x:return new i;case _:case T:return new i(e);case A:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case k:return new i;case I:return r=e,Ln?Ae(Ln.call(r)):{}}}(e,d,l)}}a||(a=new Xn);var g=a.get(e);if(g)return g;a.set(e,s),os(e)?e.forEach(function(n){s.add(sr(n,t,r,n,e,a))}):ts(e)&&e.forEach(function(n,i){s.set(i,sr(n,t,r,i,e,a))});var b=h?n:(u?c?ro:no:c?Ps:Es)(e);return At(b||e,function(n,i){b&&(n=e[i=n]),er(s,i,sr(n,t,r,i,e,a))}),s}function lr(e,t,r){var i=r.length;if(null==e)return!i;for(e=Ae(e);i--;){var o=r[i],a=t[o],s=e[o];if(s===n&&!(o in e)||!a(s))return!1}return!0}function cr(e,t,i){if("function"!=typeof e)throw new Ie(r);return Eo(function(){e.apply(n,i)},t)}function ur(e,t,n,r){var i=-1,o=Ot,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Pt(t,Kt(n))),r?(o=Et,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Gn(t));e:for(;++i<s;){var u=e[i],h=null==n?u:n(u);if(u=r||0!==u?u:0,a&&h==h){for(var d=c;d--;)if(t[d]===h)continue e;l.push(u)}else o(t,h,r)||l.push(u)}return l}zn.templateSettings={escape:X,evaluate:K,interpolate:q,variable:"",imports:{_:zn}},zn.prototype=Vn.prototype,zn.prototype.constructor=zn,Un.prototype=Bn(Vn.prototype),Un.prototype.constructor=Un,Hn.prototype=Bn(Vn.prototype),Hn.prototype.constructor=Hn,Wn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},Wn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Wn.prototype.get=function(e){var t=this.__data__;if(In){var r=t[e];return r===i?n:r}return Fe.call(t,e)?t[e]:n},Wn.prototype.has=function(e){var t=this.__data__;return In?t[e]!==n:Fe.call(t,e)},Wn.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=In&&t===n?i:t,this},Yn.prototype.clear=function(){this.__data__=[],this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=tr(t,e);return!(n<0||(n==t.length-1?t.pop():Xe.call(t,n,1),--this.size,0))},Yn.prototype.get=function(e){var t=this.__data__,r=tr(t,e);return r<0?n:t[r][1]},Yn.prototype.has=function(e){return tr(this.__data__,e)>-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=tr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$n.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Sn||Yn),string:new Wn}},$n.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},$n.prototype.get=function(e){return lo(this,e).get(e)},$n.prototype.has=function(e){return lo(this,e).has(e)},$n.prototype.set=function(e,t){var n=lo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(e){return this.__data__.set(e,i),this},Gn.prototype.has=function(e){return this.__data__.has(e)},Xn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Xn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Xn.prototype.get=function(e){return this.__data__.get(e)},Xn.prototype.has=function(e){return this.__data__.has(e)},Xn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Sn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $n(r)}return n.set(e,t),this.size=n.size,this};var hr=Mi(yr),dr=Mi(wr,!0);function fr(e,t){var n=!0;return hr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function pr(e,t,r){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(l===n?s==s&&!ss(s):r(s,l)))var l=s,c=a}return c}function gr(e,t){var n=[];return hr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function mr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=vo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?mr(s,t-1,n,r,i):Mt(i,s):r||(i[i.length]=s)}return i}var vr=ji(),br=ji(!0);function yr(e,t){return e&&vr(e,t,Es)}function wr(e,t){return e&&br(e,t,Es)}function xr(e,t){return It(t,function(t){return qa(e[t])})}function _r(e,t){for(var r=0,i=(t=bi(t,e)).length;null!=e&&r<i;)e=e[Do(t[r++])];return r&&r==i?e:n}function Cr(e,t,n){var r=t(e);return Ha(e)?r:Mt(r,n(e))}function Sr(e){return null==e?e===n?"[object Undefined]":"[object Null]":et&&et in Ae(e)?function(e){var t=Fe.call(e,et),r=e[et];try{e[et]=n;var i=!0}catch(e){}var o=Le.call(e);return i&&(t?e[et]=r:delete e[et]),o}(e):function(e){return Le.call(e)}(e)}function Ar(e,t){return e>t}function kr(e,t){return null!=e&&Fe.call(e,t)}function Tr(e,t){return null!=e&&t in Ae(e)}function Ir(e,t,r){for(var i=r?Et:Ot,o=e[0].length,a=e.length,s=a,l=we(a),c=1/0,u=[];s--;){var h=e[s];s&&t&&(h=Pt(h,Kt(t))),c=bn(h.length,c),l[s]=!r&&(t||o>=120&&h.length>=120)?new Gn(s&&h):n}h=e[0];var d=-1,f=l[0];e:for(;++d<o&&u.length<c;){var p=h[d],g=t?t(p):p;if(p=r||0!==p?p:0,!(f?Zt(f,g):i(u,g,r))){for(s=a;--s;){var m=l[s];if(!(m?Zt(m,g):i(e[s],g,r)))continue e}f&&f.push(g),u.push(p)}}return u}function Or(e,t,r){var i=null==(e=To(e,t=bi(t,e)))?e:e[Do(Ko(t))];return null==i?n:Ct(i,e,r)}function Er(e){return es(e)&&Sr(e)==p}function Pr(e,t,r,i,o){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,r,i,o,a){var s=Ha(e),l=Ha(t),c=s?g:po(e),u=l?g:po(t),h=(c=c==p?C:c)==C,d=(u=u==p?C:u)==C,f=c==u;if(f&&Ga(e)){if(!Ga(t))return!1;s=!0,h=!1}if(f&&!h)return a||(a=new Xn),s||ls(e)?eo(e,t,r,i,o,a):function(e,t,n,r,i,o,a){switch(n){case P:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case m:case v:case _:return za(+e,+t);case b:return e.name==t.name&&e.message==t.message;case A:case T:return e==t+"";case x:var s=on;case k:var l=1&r;if(s||(s=ln),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=eo(s(e),s(t),r,i,o,a);return a.delete(e),u;case I:if(Ln)return Ln.call(e)==Ln.call(t)}return!1}(e,t,c,r,i,o,a);if(!(1&r)){var y=h&&Fe.call(e,"__wrapped__"),w=d&&Fe.call(t,"__wrapped__");if(y||w){var S=y?e.value():e,O=w?t.value():t;return a||(a=new Xn),o(S,O,r,i,a)}}return!!f&&(a||(a=new Xn),function(e,t,r,i,o,a){var s=1&r,l=no(e),c=l.length,u=no(t),h=u.length;if(c!=h&&!s)return!1;for(var d=c;d--;){var f=l[d];if(!(s?f in t:Fe.call(t,f)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=s;++d<c;){var b=e[f=l[d]],y=t[f];if(i)var w=s?i(y,b,f,t,e,a):i(b,y,f,e,t,a);if(!(w===n?b===y||o(b,y,r,i,a):w)){m=!1;break}v||(v="constructor"==f)}if(m&&!v){var x=e.constructor,_=t.constructor;x==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof _&&_ instanceof _||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,r,i,o,a))}(e,t,r,i,Pr,o))}function Mr(e,t,r,i){var o=r.length,a=o,s=!i;if(null==e)return!a;for(e=Ae(e);o--;){var l=r[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=r[o])[0],u=e[c],h=l[1];if(s&&l[2]){if(u===n&&!(c in e))return!1}else{var d=new Xn;if(i)var f=i(u,h,c,e,t,d);if(!(f===n?Pr(h,u,3,i,d):f))return!1}}return!0}function jr(e){return!(!Qa(e)||(t=e,De&&De in t))&&(qa(e)?Be:pe).test(Lo(e));var t}function Fr(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?Ha(e)?Br(e[0],e[1]):zr(e):hl(e)}function Rr(e){if(!Co(e))return mn(e);var t=[];for(var n in Ae(e))Fe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Dr(e){if(!Qa(e))return function(e){var t=[];if(null!=e)for(var n in Ae(e))t.push(n);return t}(e);var t=Co(e),n=[];for(var r in e)("constructor"!=r||!t&&Fe.call(e,r))&&n.push(r);return n}function Lr(e,t){return e<t}function Nr(e,t){var n=-1,r=Ya(e)?we(e.length):[];return hr(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function zr(e){var t=co(e);return 1==t.length&&t[0][2]?Ao(t[0][0],t[0][1]):function(n){return n===e||Mr(n,e,t)}}function Br(e,t){return wo(e)&&So(t)?Ao(Do(e),t):function(r){var i=As(r,e);return i===n&&i===t?ks(r,e):Pr(t,i,3)}}function Vr(e,t,r,i,o){e!==t&&vr(t,function(a,s){if(o||(o=new Xn),Qa(a))!function(e,t,r,i,o,a,s){var l=Io(e,r),c=Io(t,r),u=s.get(c);if(u)Qn(e,r,u);else{var h=a?a(l,c,r+"",e,t,s):n,d=h===n;if(d){var f=Ha(c),p=!f&&Ga(c),g=!f&&!p&&ls(c);h=c,f||p||g?Ha(l)?h=l:$a(l)?h=Ii(l):p?(d=!1,h=_i(c,!0)):g?(d=!1,h=Si(c,!0)):h=[]:rs(c)||Ua(c)?(h=l,Ua(l)?h=ms(l):Qa(l)&&!qa(l)||(h=mo(c))):d=!1}d&&(s.set(c,h),o(h,c,i,a,s),s.delete(c)),Qn(e,r,h)}}(e,t,s,r,Vr,i,o);else{var l=i?i(Io(e,s),a,s+"",e,t,o):n;l===n&&(l=a),Qn(e,s,l)}},Ps)}function Ur(e,t){var r=e.length;if(r)return bo(t+=t<0?r:0,r)?e[t]:n}function Hr(e,t,n){t=t.length?Pt(t,function(e){return Ha(e)?function(t){return _r(t,1===e.length?e[0]:e)}:e}):[nl];var r=-1;t=Pt(t,Kt(so()));var i=Nr(e,function(e,n,i){var o=Pt(t,function(t){return t(e)});return{criteria:o,index:++r,value:e}});return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var l=Ai(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Wr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=_r(e,a);n(s,a)&&Jr(o,bi(a,e),s)}return o}function Yr(e,t,n,r){var i=r?Bt:zt,o=-1,a=t.length,s=e;for(e===t&&(t=Ii(t)),n&&(s=Pt(e,Kt(n)));++o<a;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(s,u,l,r))>-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function $r(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;bo(i)?Xe.call(e,i,1):ui(e,i)}}return e}function Gr(e,t){return e+gt(xn()*(t-e+1))}function Xr(e,t){var n="";if(!e||t<1||t>u)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Kr(e,t){return Po(ko(e,t,nl),e+"")}function qr(e){return qn(zs(e))}function Zr(e,t){var n=zs(e);return Fo(n,ar(t,0,n.length))}function Jr(e,t,r,i){if(!Qa(e))return e;for(var o=-1,a=(t=bi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Do(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var h=l[c];(u=i?i(h,c,l):n)===n&&(u=Qa(h)?h:bo(t[o+1])?[]:{})}er(l,c,u),l=l[c]}return e}var Qr=On?function(e,t){return On.set(e,t),e}:nl,ei=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:Qs(t),writable:!0})}:nl;function ti(e){return Fo(zs(e))}function ni(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=we(i);++r<i;)o[r]=e[r+t];return o}function ri(e,t){var n;return hr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function ii(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!ss(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return oi(e,t,nl,n)}function oi(e,t,r,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,l=null===t,c=ss(t),u=t===n;o<a;){var h=gt((o+a)/2),d=r(e[h]),f=d!==n,p=null===d,g=d==d,m=ss(d);if(s)var v=i||g;else v=u?g&&(i||f):l?g&&f&&(i||!p):c?g&&f&&!p&&(i||!m):!p&&!m&&(i?d<=t:d<t);v?o=h+1:a=h}return bn(a,4294967294)}function ai(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!za(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function si(e){return"number"==typeof e?e:ss(e)?h:+e}function li(e){if("string"==typeof e)return e;if(Ha(e))return Pt(e,li)+"";if(ss(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,n){var r=-1,i=Ot,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Et;else if(o>=200){var c=t?null:Xi(e);if(c)return ln(c);a=!1,i=Zt,l=new Gn}else l=t?[]:s;e:for(;++r<o;){var u=e[r],h=t?t(u):u;if(u=n||0!==u?u:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(u)}else i(l,h,n)||(l!==s&&l.push(h),s.push(u))}return s}function ui(e,t){return null==(e=To(e,t=bi(t,e)))||delete e[Do(Ko(t))]}function hi(e,t,n,r){return Jr(e,t,n(_r(e,t)),r)}function di(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ni(e,r?0:o,r?o+1:i):ni(e,r?o+1:0,r?i:o)}function fi(e,t){var n=e;return n instanceof Hn&&(n=n.value()),jt(t,function(e,t){return t.func.apply(t.thisArg,Mt([e],t.args))},n)}function pi(e,t,n){var r=e.length;if(r<2)return r?ci(e[0]):[];for(var i=-1,o=we(r);++i<r;)for(var a=e[i],s=-1;++s<r;)s!=i&&(o[i]=ur(o[i]||a,e[s],t,n));return ci(mr(o,1),t,n)}function gi(e,t,r){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var l=i<a?t[i]:n;r(s,e[i],l)}return s}function mi(e){return $a(e)?e:[]}function vi(e){return"function"==typeof e?e:nl}function bi(e,t){return Ha(e)?e:wo(e,t)?[e]:Ro(vs(e))}var yi=Kr;function wi(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:ni(e,t,r)}var xi=ct||function(e){return ht.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var n=e.length,r=We?We(n):new e.constructor(n);return e.copy(r),r}function Ci(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Si(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ai(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,a=ss(e),s=t!==n,l=null===t,c=t==t,u=ss(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||i&&s&&c||!r&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&r&&o&&!i&&!a||l&&r&&o||!s&&o||!c)return-1}return 0}function ki(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,l=t.length,c=vn(o-a,0),u=we(l+c),h=!r;++s<l;)u[s]=t[s];for(;++i<a;)(h||i<o)&&(u[n[i]]=e[i]);for(;c--;)u[s++]=e[i++];return u}function Ti(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,l=-1,c=t.length,u=vn(o-s,0),h=we(u+c),d=!r;++i<u;)h[i]=e[i];for(var f=i;++l<c;)h[f+l]=t[l];for(;++a<s;)(d||i<o)&&(h[f+n[a]]=e[i++]);return h}function Ii(e,t){var n=-1,r=e.length;for(t||(t=we(r));++n<r;)t[n]=e[n];return t}function Oi(e,t,r,i){var o=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=i?i(r[l],e[l],l,r,e):n;c===n&&(c=e[l]),o?ir(r,l,c):er(r,l,c)}return r}function Ei(e,t){return function(n,r){var i=Ha(n)?St:nr,o=t?t():{};return i(n,e,so(r,2),o)}}function Pi(e){return Kr(function(t,r){var i=-1,o=r.length,a=o>1?r[o-1]:n,s=o>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(o--,a):n,s&&yo(r[0],r[1],s)&&(a=o<3?n:a,o=1),t=Ae(t);++i<o;){var l=r[i];l&&e(t,l,i,a)}return t})}function Mi(e,t){return function(n,r){if(null==n)return n;if(!Ya(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Ae(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function ji(e){return function(t,n,r){for(var i=-1,o=Ae(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Fi(e){return function(t){var r=rn(t=vs(t))?hn(t):n,i=r?r[0]:t.charAt(0),o=r?wi(r,1).join(""):t.slice(1);return i[e]()+o}}function Ri(e){return function(t){return jt(qs(Us(t).replace(qe,"")),e,"")}}function Di(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Bn(e.prototype),r=e.apply(n,t);return Qa(r)?r:n}}function Li(e){return function(t,r,i){var o=Ae(t);if(!Ya(t)){var a=so(r,3);t=Es(t),r=function(e){return a(o[e],e,o)}}var s=e(t,r,i);return s>-1?o[a?t[s]:s]:n}}function Ni(e){return to(function(t){var i=t.length,o=i,a=Un.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(r);if(a&&!l&&"wrapper"==oo(s))var l=new Un([],!0)}for(o=l?o:i;++o<i;){var c=oo(s=t[o]),u="wrapper"==c?io(s):n;l=u&&xo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[oo(u[0])].apply(l,u[3]):1==s.length&&xo(s)?l[c]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ha(n))return l.plant(n).value();for(var r=0,o=i?t[r].apply(this,e):n;++r<i;)o=t[r].call(this,o);return o}})}function zi(e,t,r,i,o,a,l,c,u,h){var d=t&s,f=1&t,p=2&t,g=24&t,m=512&t,v=p?n:Di(e);return function s(){for(var b=arguments.length,y=we(b),w=b;w--;)y[w]=arguments[w];if(g)var x=ao(s),_=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(y,x);if(i&&(y=ki(y,i,o,g)),a&&(y=Ti(y,a,l,g)),b-=_,g&&b<h){var C=sn(y,x);return $i(e,t,zi,s.placeholder,r,y,C,c,u,h-b)}var S=f?r:this,A=p?S[e]:e;return b=y.length,c?y=function(e,t){for(var r=e.length,i=bn(t.length,r),o=Ii(e);i--;){var a=t[i];e[i]=bo(a,r)?o[a]:n}return e}(y,c):m&&b>1&&y.reverse(),d&&u<b&&(y.length=u),this&&this!==ht&&this instanceof s&&(A=v||Di(A)),A.apply(S,y)}}function Bi(e,t){return function(n,r){return function(e,t,n,r){return yr(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function Vi(e,t){return function(r,i){var o;if(r===n&&i===n)return t;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=li(r),i=li(i)):(r=si(r),i=si(i)),o=e(r,i)}return o}}function Ui(e){return to(function(t){return t=Pt(t,Kt(so())),Kr(function(n){var r=this;return e(t,function(e){return Ct(e,r,n)})})})}function Hi(e,t){var r=(t=t===n?" ":li(t)).length;if(r<2)return r?Xr(t,e):t;var i=Xr(t,ft(e/un(t)));return rn(t)?wi(hn(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(t,r,i){return i&&"number"!=typeof i&&yo(t,r,i)&&(r=i=n),t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n,r){for(var i=-1,o=vn(ft((t-e)/(n||1)),0),a=we(o);o--;)a[r?o:++i]=e,e+=n;return a}(t,r,i=i===n?t<r?1:-1:ds(i),e)}}function Yi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=gs(t),n=gs(n)),e(t,n)}}function $i(e,t,r,i,o,s,l,c,u,h){var d=8&t;t|=d?a:64,4&(t&=~(d?64:a))||(t&=-4);var f=[e,t,o,d?s:n,d?l:n,d?n:s,d?n:l,c,u,h],p=r.apply(n,f);return xo(e)&&Oo(p,f),p.placeholder=i,Mo(p,e,t)}function Gi(e){var t=Se[e];return function(e,n){if(e=gs(e),(n=null==n?0:bn(fs(n),292))&&Wt(e)){var r=(vs(e)+"e").split("e");return+((r=(vs(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Xi=kn&&1/ln(new kn([,-0]))[1]==c?function(e){return new kn(e)}:sl;function Ki(e){return function(t){var n=po(t);return n==x?on(t):n==k?cn(t):function(e,t){return Pt(t,function(t){return[t,e[t]]})}(t,e(t))}}function qi(e,t,i,c,u,h,d,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Ie(r);var g=c?c.length:0;if(g||(t&=-97,c=u=n),d=d===n?d:vn(fs(d),0),f=f===n?f:fs(f),g-=u?u.length:0,64&t){var m=c,v=u;c=u=n}var b=p?n:io(e),y=[e,t,i,c,u,m,v,h,d,f];if(b&&function(e,t){var n=e[1],r=t[1],i=n|r,a=i<131,c=r==s&&8==n||r==s&&n==l&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!c)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var u=t[3];if(u){var h=e[3];e[3]=h?ki(h,u,t[4]):u,e[4]=h?sn(e[3],o):t[4]}(u=t[5])&&(h=e[5],e[5]=h?Ti(h,u,t[6]):u,e[6]=h?sn(e[5],o):t[6]),(u=t[7])&&(e[7]=u),r&s&&(e[8]=null==e[8]?t[8]:bn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(y,b),e=y[0],t=y[1],i=y[2],c=y[3],u=y[4],!(f=y[9]=y[9]===n?p?0:e.length:vn(y[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)w=8==t||16==t?function(e,t,r){var i=Di(e);return function o(){for(var a=arguments.length,s=we(a),l=a,c=ao(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:sn(s,c);return(a-=u.length)<r?$i(e,t,zi,o.placeholder,n,s,u,n,n,r-a):Ct(this&&this!==ht&&this instanceof o?i:e,this,s)}}(e,t,f):t!=a&&33!=t||u.length?zi.apply(n,y):function(e,t,n,r){var i=1&t,o=Di(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=r.length,u=we(c+s),h=this&&this!==ht&&this instanceof t?o:e;++l<c;)u[l]=r[l];for(;s--;)u[l++]=arguments[++a];return Ct(h,i?n:this,u)}}(e,t,i,c);else var w=function(e,t,n){var r=1&t,i=Di(e);return function t(){return(this&&this!==ht&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,i);return Mo((b?Qr:Oo)(w,y),e,t)}function Zi(e,t,r,i){return e===n||za(e,Pe[r])&&!Fe.call(i,r)?t:e}function Ji(e,t,r,i,o,a){return Qa(e)&&Qa(t)&&(a.set(t,e),Vr(e,t,n,Ji,a),a.delete(t)),e}function Qi(e){return rs(e)?n:e}function eo(e,t,r,i,o,a){var s=1&r,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),h=a.get(t);if(u&&h)return u==t&&h==e;var d=-1,f=!0,p=2&r?new Gn:n;for(a.set(e,t),a.set(t,e);++d<l;){var g=e[d],m=t[d];if(i)var v=s?i(m,g,d,t,e,a):i(g,m,d,e,t,a);if(v!==n){if(v)continue;f=!1;break}if(p){if(!Rt(t,function(e,t){if(!Zt(p,t)&&(g===e||o(g,e,r,i,a)))return p.push(t)})){f=!1;break}}else if(g!==m&&!o(g,m,r,i,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function to(e){return Po(ko(e,n,Wo),e+"")}function no(e){return Cr(e,Es,ho)}function ro(e){return Cr(e,Ps,fo)}var io=On?function(e){return On.get(e)}:sl;function oo(e){for(var t=e.name+"",n=En[t],r=Fe.call(En,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function ao(e){return(Fe.call(zn,"placeholder")?zn:e).placeholder}function so(){var e=zn.iteratee||rl;return e=e===rl?Fr:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function co(e){for(var t=Es(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,So(i)]}return t}function uo(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return jr(r)?r:n}var ho=mt?function(e){return null==e?[]:(e=Ae(e),It(mt(e),function(t){return Ge.call(e,t)}))}:pl,fo=mt?function(e){for(var t=[];e;)Mt(t,ho(e)),e=Ye(e);return t}:pl,po=Sr;function go(e,t,n){for(var r=-1,i=(t=bi(t,e)).length,o=!1;++r<i;){var a=Do(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Ja(i)&&bo(a,i)&&(Ha(e)||Ua(e))}function mo(e){return"function"!=typeof e.constructor||Co(e)?{}:Bn(Ye(e))}function vo(e){return Ha(e)||Ua(e)||!!(Ke&&e&&e[Ke])}function bo(e,t){var n=typeof e;return!!(t=null==t?u:t)&&("number"==n||"symbol"!=n&&me.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,n){if(!Qa(n))return!1;var r=typeof t;return!!("number"==r?Ya(n)&&bo(t,n.length):"string"==r&&t in n)&&za(n[t],e)}function wo(e,t){if(Ha(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ss(e))||J.test(e)||!Z.test(e)||null!=t&&e in Ae(t)}function xo(e){var t=oo(e),n=zn[t];if("function"!=typeof n||!(t in Hn.prototype))return!1;if(e===n)return!0;var r=io(n);return!!r&&e===r[0]}(Cn&&po(new Cn(new ArrayBuffer(1)))!=P||Sn&&po(new Sn)!=x||An&&po(An.resolve())!=S||kn&&po(new kn)!=k||Tn&&po(new Tn)!=O)&&(po=function(e){var t=Sr(e),r=t==C?e.constructor:n,i=r?Lo(r):"";if(i)switch(i){case Pn:return P;case Mn:return x;case jn:return S;case Fn:return k;case Rn:return O}return t});var _o=Me?qa:gl;function Co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pe)}function So(e){return e==e&&!Qa(e)}function Ao(e,t){return function(r){return null!=r&&r[e]===t&&(t!==n||e in Ae(r))}}function ko(e,t,r){return t=vn(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=vn(n.length-t,0),a=we(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=we(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),Ct(e,this,s)}}function To(e,t){return t.length<2?e:_r(e,ni(t,0,-1))}function Io(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Oo=jo(Qr),Eo=dt||function(e,t){return ht.setTimeout(e,t)},Po=jo(ei);function Mo(e,t,n){var r=t+"";return Po(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return At(f,function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(r),n)))}function jo(e){var t=0,r=0;return function(){var i=yn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Fo(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r<t;){var a=Gr(r,o),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var Ro=function(e){var t=ja(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,n,r,i){t.push(r?i.replace(ce,"$1"):n||e)}),t});function Do(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return je.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof Hn)return e.clone();var t=new Un(e.__wrapped__,e.__chain__);return t.__actions__=Ii(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var zo=Kr(function(e,t){return $a(e)?ur(e,mr(t,1,$a,!0)):[]}),Bo=Kr(function(e,t){var r=Ko(t);return $a(r)&&(r=n),$a(e)?ur(e,mr(t,1,$a,!0),so(r,2)):[]}),Vo=Kr(function(e,t){var r=Ko(t);return $a(r)&&(r=n),$a(e)?ur(e,mr(t,1,$a,!0),n,r):[]});function Uo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=vn(r+i,0)),Nt(e,so(t,3),i)}function Ho(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==n&&(o=fs(r),o=r<0?vn(i+o,0):bn(o,i-1)),Nt(e,so(t,3),o,!0)}function Wo(e){return null!=e&&e.length?mr(e,1):[]}function Yo(e){return e&&e.length?e[0]:n}var $o=Kr(function(e){var t=Pt(e,mi);return t.length&&t[0]===e[0]?Ir(t):[]}),Go=Kr(function(e){var t=Ko(e),r=Pt(e,mi);return t===Ko(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Ir(r,so(t,2)):[]}),Xo=Kr(function(e){var t=Ko(e),r=Pt(e,mi);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?Ir(r,n,t):[]});function Ko(e){var t=null==e?0:e.length;return t?e[t-1]:n}var qo=Kr(Zo);function Zo(e,t){return e&&e.length&&t&&t.length?Yr(e,t):e}var Jo=to(function(e,t){var n=null==e?0:e.length,r=or(e,t);return $r(e,Pt(t,function(e){return bo(e,n)?+e:e}).sort(Ai)),r});function Qo(e){return null==e?e:_n.call(e)}var ea=Kr(function(e){return ci(mr(e,1,$a,!0))}),ta=Kr(function(e){var t=Ko(e);return $a(t)&&(t=n),ci(mr(e,1,$a,!0),so(t,2))}),na=Kr(function(e){var t=Ko(e);return t="function"==typeof t?t:n,ci(mr(e,1,$a,!0),n,t)});function ra(e){if(!e||!e.length)return[];var t=0;return e=It(e,function(e){if($a(e))return t=vn(e.length,t),!0}),Gt(t,function(t){return Pt(e,Ht(t))})}function ia(e,t){if(!e||!e.length)return[];var r=ra(e);return null==t?r:Pt(r,function(e){return Ct(t,n,e)})}var oa=Kr(function(e,t){return $a(e)?ur(e,t):[]}),aa=Kr(function(e){return pi(It(e,$a))}),sa=Kr(function(e){var t=Ko(e);return $a(t)&&(t=n),pi(It(e,$a),so(t,2))}),la=Kr(function(e){var t=Ko(e);return t="function"==typeof t?t:n,pi(It(e,$a),n,t)}),ca=Kr(ra),ua=Kr(function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ia(e,r)});function ha(e){var t=zn(e);return t.__chain__=!0,t}function da(e,t){return t(e)}var fa=to(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hn&&bo(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:da,args:[o],thisArg:n}),new Un(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(o)}),pa=Ei(function(e,t,n){Fe.call(e,n)?++e[n]:ir(e,n,1)}),ga=Li(Uo),ma=Li(Ho);function va(e,t){return(Ha(e)?At:hr)(e,so(t,3))}function ba(e,t){return(Ha(e)?kt:dr)(e,so(t,3))}var ya=Ei(function(e,t,n){Fe.call(e,n)?e[n].push(t):ir(e,n,[t])}),wa=Kr(function(e,t,n){var r=-1,i="function"==typeof t,o=Ya(e)?we(e.length):[];return hr(e,function(e){o[++r]=i?Ct(t,e,n):Or(e,t,n)}),o}),xa=Ei(function(e,t,n){ir(e,n,t)});function _a(e,t){return(Ha(e)?Pt:Nr)(e,so(t,3))}var Ca=Ei(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),Sa=Kr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Hr(e,mr(t,1),[])}),Aa=ut||function(){return ht.Date.now()};function ka(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,qi(e,s,n,n,n,n,t)}function Ta(e,t){var i;if("function"!=typeof t)throw new Ie(r);return e=fs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Ia=Kr(function(e,t,n){var r=1;if(n.length){var i=sn(n,ao(Ia));r|=a}return qi(e,r,t,n,i)}),Oa=Kr(function(e,t,n){var r=3;if(n.length){var i=sn(n,ao(Oa));r|=a}return qi(t,r,e,n,i)});function Ea(e,t,i){var o,a,s,l,c,u,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ie(r);function g(t){var r=o,i=a;return o=a=n,h=t,l=e.apply(i,r)}function m(e){var r=e-u;return u===n||r>=t||r<0||f&&e-h>=s}function v(){var e=Aa();if(m(e))return b(e);c=Eo(v,function(e){var n=t-(e-u);return f?bn(n,s-(e-h)):n}(e))}function b(e){return c=n,p&&o?g(e):(o=a=n,l)}function y(){var e=Aa(),r=m(e);if(o=arguments,a=this,u=e,r){if(c===n)return function(e){return h=e,c=Eo(v,t),d?g(e):l}(u);if(f)return xi(c),c=Eo(v,t),g(u)}return c===n&&(c=Eo(v,t)),l}return t=gs(t)||0,Qa(i)&&(d=!!i.leading,s=(f="maxWait"in i)?vn(gs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),y.cancel=function(){c!==n&&xi(c),h=0,o=u=a=c=n},y.flush=function(){return c===n?l:b(Aa())},y}var Pa=Kr(function(e,t){return cr(e,1,t)}),Ma=Kr(function(e,t,n){return cr(e,gs(t)||0,n)});function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ja.Cache||$n),n}function Fa(e){if("function"!=typeof e)throw new Ie(r);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)}}ja.Cache=$n;var Ra=yi(function(e,t){var n=(t=1==t.length&&Ha(t[0])?Pt(t[0],Kt(so())):Pt(mr(t,1),Kt(so()))).length;return Kr(function(r){for(var i=-1,o=bn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ct(e,this,r)})}),Da=Kr(function(e,t){var r=sn(t,ao(Da));return qi(e,a,n,t,r)}),La=Kr(function(e,t){var r=sn(t,ao(La));return qi(e,64,n,t,r)}),Na=to(function(e,t){return qi(e,l,n,n,n,t)});function za(e,t){return e===t||e!=e&&t!=t}var Ba=Yi(Ar),Va=Yi(function(e,t){return e>=t}),Ua=Er(function(){return arguments}())?Er:function(e){return es(e)&&Fe.call(e,"callee")&&!Ge.call(e,"callee")},Ha=we.isArray,Wa=vt?Kt(vt):function(e){return es(e)&&Sr(e)==E};function Ya(e){return null!=e&&Ja(e.length)&&!qa(e)}function $a(e){return es(e)&&Ya(e)}var Ga=Dt||gl,Xa=bt?Kt(bt):function(e){return es(e)&&Sr(e)==v};function Ka(e){if(!es(e))return!1;var t=Sr(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function qa(e){if(!Qa(e))return!1;var t=Sr(e);return t==y||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==fs(e)}function Ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=yt?Kt(yt):function(e){return es(e)&&po(e)==x};function ns(e){return"number"==typeof e||es(e)&&Sr(e)==_}function rs(e){if(!es(e)||Sr(e)!=C)return!1;var t=Ye(e);if(null===t)return!0;var n=Fe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&je.call(n)==Ne}var is=wt?Kt(wt):function(e){return es(e)&&Sr(e)==A},os=xt?Kt(xt):function(e){return es(e)&&po(e)==k};function as(e){return"string"==typeof e||!Ha(e)&&es(e)&&Sr(e)==T}function ss(e){return"symbol"==typeof e||es(e)&&Sr(e)==I}var ls=_t?Kt(_t):function(e){return es(e)&&Ja(e.length)&&!!it[Sr(e)]},cs=Yi(Lr),us=Yi(function(e,t){return e<=t});function hs(e){if(!e)return[];if(Ya(e))return as(e)?hn(e):Ii(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=po(e);return(t==x?on:t==k?ln:zs)(e)}function ds(e){return e?(e=gs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=ds(e),n=t%1;return t==t?n?t-n:t:0}function ps(e){return e?ar(fs(e),0,d):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return h;if(Qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=fe.test(e);return n||ge.test(e)?lt(e.slice(2),n?2:8):de.test(e)?h:+e}function ms(e){return Oi(e,Ps(e))}function vs(e){return null==e?"":li(e)}var bs=Pi(function(e,t){if(Co(t)||Ya(t))Oi(t,Es(t),e);else for(var n in t)Fe.call(t,n)&&er(e,n,t[n])}),ys=Pi(function(e,t){Oi(t,Ps(t),e)}),ws=Pi(function(e,t,n,r){Oi(t,Ps(t),e,r)}),xs=Pi(function(e,t,n,r){Oi(t,Es(t),e,r)}),_s=to(or),Cs=Kr(function(e,t){e=Ae(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&yo(t[0],t[1],o)&&(i=1);++r<i;)for(var a=t[r],s=Ps(a),l=-1,c=s.length;++l<c;){var u=s[l],h=e[u];(h===n||za(h,Pe[u])&&!Fe.call(e,u))&&(e[u]=a[u])}return e}),Ss=Kr(function(e){return e.push(n,Ji),Ct(js,n,e)});function As(e,t,r){var i=null==e?n:_r(e,t);return i===n?r:i}function ks(e,t){return null!=e&&go(e,t,Tr)}var Ts=Bi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),e[t]=n},Qs(nl)),Is=Bi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),Fe.call(e,t)?e[t].push(n):e[t]=[n]},so),Os=Kr(Or);function Es(e){return Ya(e)?Kn(e):Rr(e)}function Ps(e){return Ya(e)?Kn(e,!0):Dr(e)}var Ms=Pi(function(e,t,n){Vr(e,t,n)}),js=Pi(function(e,t,n,r){Vr(e,t,n,r)}),Fs=to(function(e,t){var n={};if(null==e)return n;var r=!1;t=Pt(t,function(t){return t=bi(t,e),r||(r=t.length>1),t}),Oi(e,ro(e),n),r&&(n=sr(n,7,Qi));for(var i=t.length;i--;)ui(n,t[i]);return n}),Rs=to(function(e,t){return null==e?{}:function(e,t){return Wr(e,t,function(t,n){return ks(e,n)})}(e,t)});function Ds(e,t){if(null==e)return{};var n=Pt(ro(e),function(e){return[e]});return t=so(t),Wr(e,n,function(e,n){return t(e,n[0])})}var Ls=Ki(Es),Ns=Ki(Ps);function zs(e){return null==e?[]:qt(e,Es(e))}var Bs=Ri(function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)});function Vs(e){return Ks(vs(e).toLowerCase())}function Us(e){return(e=vs(e))&&e.replace(ve,en).replace(Ze,"")}var Hs=Ri(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ws=Ri(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ys=Fi("toLowerCase"),$s=Ri(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Gs=Ri(function(e,t,n){return e+(n?" ":"")+Ks(t)}),Xs=Ri(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ks=Fi("toUpperCase");function qs(e,t,r){return e=vs(e),(t=r?n:t)===n?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Zs=Kr(function(e,t){try{return Ct(e,n,t)}catch(e){return Ka(e)?e:new _e(e)}}),Js=to(function(e,t){return At(t,function(t){t=Do(t),ir(e,t,Ia(e[t],e))}),e});function Qs(e){return function(){return e}}var el=Ni(),tl=Ni(!0);function nl(e){return e}function rl(e){return Fr("function"==typeof e?e:sr(e,1))}var il=Kr(function(e,t){return function(n){return Or(n,e,t)}}),ol=Kr(function(e,t){return function(n){return Or(e,n,t)}});function al(e,t,n){var r=Es(t),i=xr(t,r);null!=n||Qa(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=xr(t,Es(t)));var o=!(Qa(n)&&"chain"in n&&!n.chain),a=qa(e);return At(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ii(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})}),e}function sl(){}var ll=Ui(Pt),cl=Ui(Tt),ul=Ui(Rt);function hl(e){return wo(e)?Ht(Do(e)):function(e){return function(t){return _r(t,e)}}(e)}var dl=Wi(),fl=Wi(!0);function pl(){return[]}function gl(){return!1}var ml,vl=Vi(function(e,t){return e+t},0),bl=Gi("ceil"),yl=Vi(function(e,t){return e/t},1),wl=Gi("floor"),xl=Vi(function(e,t){return e*t},1),_l=Gi("round"),Cl=Vi(function(e,t){return e-t},0);return zn.after=function(e,t){if("function"!=typeof t)throw new Ie(r);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},zn.ary=ka,zn.assign=bs,zn.assignIn=ys,zn.assignInWith=ws,zn.assignWith=xs,zn.at=_s,zn.before=Ta,zn.bind=Ia,zn.bindAll=Js,zn.bindKey=Oa,zn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},zn.chain=ha,zn.chunk=function(e,t,r){t=(r?yo(e,t,r):t===n)?1:vn(fs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=we(ft(i/t));o<i;)s[a++]=ni(e,o,o+=t);return s},zn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},zn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=we(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Mt(Ha(n)?Ii(n):[n],mr(t,1))},zn.cond=function(e){var t=null==e?0:e.length,n=so();return e=t?Pt(e,function(e){if("function"!=typeof e[1])throw new Ie(r);return[n(e[0]),e[1]]}):[],Kr(function(n){for(var r=-1;++r<t;){var i=e[r];if(Ct(i[0],this,n))return Ct(i[1],this,n)}})},zn.conforms=function(e){return function(e){var t=Es(e);return function(n){return lr(n,e,t)}}(sr(e,1))},zn.constant=Qs,zn.countBy=pa,zn.create=function(e,t){var n=Bn(e);return null==t?n:rr(n,t)},zn.curry=function e(t,r,i){var o=qi(t,8,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},zn.curryRight=function e(t,r,i){var o=qi(t,16,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},zn.debounce=Ea,zn.defaults=Cs,zn.defaultsDeep=Ss,zn.defer=Pa,zn.delay=Ma,zn.difference=zo,zn.differenceBy=Bo,zn.differenceWith=Vo,zn.drop=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,(t=r||t===n?1:fs(t))<0?0:t,i):[]},zn.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,0,(t=i-(t=r||t===n?1:fs(t)))<0?0:t):[]},zn.dropRightWhile=function(e,t){return e&&e.length?di(e,so(t,3),!0,!0):[]},zn.dropWhile=function(e,t){return e&&e.length?di(e,so(t,3),!0):[]},zn.fill=function(e,t,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&yo(e,t,r)&&(r=0,i=o),function(e,t,r,i){var o=e.length;for((r=fs(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:fs(i))<0&&(i+=o),i=r>i?0:ps(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},zn.filter=function(e,t){return(Ha(e)?It:gr)(e,so(t,3))},zn.flatMap=function(e,t){return mr(_a(e,t),1)},zn.flatMapDeep=function(e,t){return mr(_a(e,t),c)},zn.flatMapDepth=function(e,t,r){return r=r===n?1:fs(r),mr(_a(e,t),r)},zn.flatten=Wo,zn.flattenDeep=function(e){return null!=e&&e.length?mr(e,c):[]},zn.flattenDepth=function(e,t){return null!=e&&e.length?mr(e,t=t===n?1:fs(t)):[]},zn.flip=function(e){return qi(e,512)},zn.flow=el,zn.flowRight=tl,zn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},zn.functions=function(e){return null==e?[]:xr(e,Es(e))},zn.functionsIn=function(e){return null==e?[]:xr(e,Ps(e))},zn.groupBy=ya,zn.initial=function(e){return null!=e&&e.length?ni(e,0,-1):[]},zn.intersection=$o,zn.intersectionBy=Go,zn.intersectionWith=Xo,zn.invert=Ts,zn.invertBy=Is,zn.invokeMap=wa,zn.iteratee=rl,zn.keyBy=xa,zn.keys=Es,zn.keysIn=Ps,zn.map=_a,zn.mapKeys=function(e,t){var n={};return t=so(t,3),yr(e,function(e,r,i){ir(n,t(e,r,i),e)}),n},zn.mapValues=function(e,t){var n={};return t=so(t,3),yr(e,function(e,r,i){ir(n,r,t(e,r,i))}),n},zn.matches=function(e){return zr(sr(e,1))},zn.matchesProperty=function(e,t){return Br(e,sr(t,1))},zn.memoize=ja,zn.merge=Ms,zn.mergeWith=js,zn.method=il,zn.methodOf=ol,zn.mixin=al,zn.negate=Fa,zn.nthArg=function(e){return e=fs(e),Kr(function(t){return Ur(t,e)})},zn.omit=Fs,zn.omitBy=function(e,t){return Ds(e,Fa(so(t)))},zn.once=function(e){return Ta(2,e)},zn.orderBy=function(e,t,r,i){return null==e?[]:(Ha(t)||(t=null==t?[]:[t]),Ha(r=i?n:r)||(r=null==r?[]:[r]),Hr(e,t,r))},zn.over=ll,zn.overArgs=Ra,zn.overEvery=cl,zn.overSome=ul,zn.partial=Da,zn.partialRight=La,zn.partition=Ca,zn.pick=Rs,zn.pickBy=Ds,zn.property=hl,zn.propertyOf=function(e){return function(t){return null==e?n:_r(e,t)}},zn.pull=qo,zn.pullAll=Zo,zn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,so(n,2)):e},zn.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Yr(e,t,n,r):e},zn.pullAt=Jo,zn.range=dl,zn.rangeRight=fl,zn.rearg=Na,zn.reject=function(e,t){return(Ha(e)?It:gr)(e,Fa(so(t,3)))},zn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=so(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return $r(e,i),n},zn.rest=function(e,t){if("function"!=typeof e)throw new Ie(r);return Kr(e,t=t===n?t:fs(t))},zn.reverse=Qo,zn.sampleSize=function(e,t,r){return t=(r?yo(e,t,r):t===n)?1:fs(t),(Ha(e)?Zn:Zr)(e,t)},zn.set=function(e,t,n){return null==e?e:Jr(e,t,n)},zn.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Jr(e,t,r,i)},zn.shuffle=function(e){return(Ha(e)?Jn:ti)(e)},zn.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&yo(e,t,r)?(t=0,r=i):(t=null==t?0:fs(t),r=r===n?i:fs(r)),ni(e,t,r)):[]},zn.sortBy=Sa,zn.sortedUniq=function(e){return e&&e.length?ai(e):[]},zn.sortedUniqBy=function(e,t){return e&&e.length?ai(e,so(t,2)):[]},zn.split=function(e,t,r){return r&&"number"!=typeof r&&yo(e,t,r)&&(t=r=n),(r=r===n?d:r>>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=li(t))&&rn(e)?wi(hn(e),0,r):e.split(t,r):[]},zn.spread=function(e,t){if("function"!=typeof e)throw new Ie(r);return t=null==t?0:vn(fs(t),0),Kr(function(n){var r=n[t],i=wi(n,0,t);return r&&Mt(i,r),Ct(e,this,i)})},zn.tail=function(e){var t=null==e?0:e.length;return t?ni(e,1,t):[]},zn.take=function(e,t,r){return e&&e.length?ni(e,0,(t=r||t===n?1:fs(t))<0?0:t):[]},zn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,(t=i-(t=r||t===n?1:fs(t)))<0?0:t,i):[]},zn.takeRightWhile=function(e,t){return e&&e.length?di(e,so(t,3),!1,!0):[]},zn.takeWhile=function(e,t){return e&&e.length?di(e,so(t,3)):[]},zn.tap=function(e,t){return t(e),e},zn.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(r);return Qa(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ea(e,t,{leading:i,maxWait:t,trailing:o})},zn.thru=da,zn.toArray=hs,zn.toPairs=Ls,zn.toPairsIn=Ns,zn.toPath=function(e){return Ha(e)?Pt(e,Do):ss(e)?[e]:Ii(Ro(vs(e)))},zn.toPlainObject=ms,zn.transform=function(e,t,n){var r=Ha(e),i=r||Ga(e)||ls(e);if(t=so(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Qa(e)&&qa(o)?Bn(Ye(e)):{}}return(i?At:yr)(e,function(e,r,i){return t(n,e,r,i)}),n},zn.unary=function(e){return ka(e,1)},zn.union=ea,zn.unionBy=ta,zn.unionWith=na,zn.uniq=function(e){return e&&e.length?ci(e):[]},zn.uniqBy=function(e,t){return e&&e.length?ci(e,so(t,2)):[]},zn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ci(e,n,t):[]},zn.unset=function(e,t){return null==e||ui(e,t)},zn.unzip=ra,zn.unzipWith=ia,zn.update=function(e,t,n){return null==e?e:hi(e,t,vi(n))},zn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:hi(e,t,vi(r),i)},zn.values=zs,zn.valuesIn=function(e){return null==e?[]:qt(e,Ps(e))},zn.without=oa,zn.words=qs,zn.wrap=function(e,t){return Da(vi(t),e)},zn.xor=aa,zn.xorBy=sa,zn.xorWith=la,zn.zip=ca,zn.zipObject=function(e,t){return gi(e||[],t||[],er)},zn.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jr)},zn.zipWith=ua,zn.entries=Ls,zn.entriesIn=Ns,zn.extend=ys,zn.extendWith=ws,al(zn,zn),zn.add=vl,zn.attempt=Zs,zn.camelCase=Bs,zn.capitalize=Vs,zn.ceil=bl,zn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=gs(r))==r?r:0),t!==n&&(t=(t=gs(t))==t?t:0),ar(gs(e),t,r)},zn.clone=function(e){return sr(e,4)},zn.cloneDeep=function(e){return sr(e,5)},zn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:n)},zn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:n)},zn.conformsTo=function(e,t){return null==t||lr(e,t,Es(t))},zn.deburr=Us,zn.defaultTo=function(e,t){return null==e||e!=e?t:e},zn.divide=yl,zn.endsWith=function(e,t,r){e=vs(e),t=li(t);var i=e.length,o=r=r===n?i:ar(fs(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},zn.eq=za,zn.escape=function(e){return(e=vs(e))&&G.test(e)?e.replace(Y,tn):e},zn.escapeRegExp=function(e){return(e=vs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},zn.every=function(e,t,r){var i=Ha(e)?Tt:fr;return r&&yo(e,t,r)&&(t=n),i(e,so(t,3))},zn.find=ga,zn.findIndex=Uo,zn.findKey=function(e,t){return Lt(e,so(t,3),yr)},zn.findLast=ma,zn.findLastIndex=Ho,zn.findLastKey=function(e,t){return Lt(e,so(t,3),wr)},zn.floor=wl,zn.forEach=va,zn.forEachRight=ba,zn.forIn=function(e,t){return null==e?e:vr(e,so(t,3),Ps)},zn.forInRight=function(e,t){return null==e?e:br(e,so(t,3),Ps)},zn.forOwn=function(e,t){return e&&yr(e,so(t,3))},zn.forOwnRight=function(e,t){return e&&wr(e,so(t,3))},zn.get=As,zn.gt=Ba,zn.gte=Va,zn.has=function(e,t){return null!=e&&go(e,t,kr)},zn.hasIn=ks,zn.head=Yo,zn.identity=nl,zn.includes=function(e,t,n,r){e=Ya(e)?e:zs(e),n=n&&!r?fs(n):0;var i=e.length;return n<0&&(n=vn(i+n,0)),as(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&zt(e,t,n)>-1},zn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=vn(r+i,0)),zt(e,t,i)},zn.inRange=function(e,t,r){return t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n){return e>=bn(t,n)&&e<vn(t,n)}(e=gs(e),t,r)},zn.invoke=Os,zn.isArguments=Ua,zn.isArray=Ha,zn.isArrayBuffer=Wa,zn.isArrayLike=Ya,zn.isArrayLikeObject=$a,zn.isBoolean=function(e){return!0===e||!1===e||es(e)&&Sr(e)==m},zn.isBuffer=Ga,zn.isDate=Xa,zn.isElement=function(e){return es(e)&&1===e.nodeType&&!rs(e)},zn.isEmpty=function(e){if(null==e)return!0;if(Ya(e)&&(Ha(e)||"string"==typeof e||"function"==typeof e.splice||Ga(e)||ls(e)||Ua(e)))return!e.length;var t=po(e);if(t==x||t==k)return!e.size;if(Co(e))return!Rr(e).length;for(var n in e)if(Fe.call(e,n))return!1;return!0},zn.isEqual=function(e,t){return Pr(e,t)},zn.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?Pr(e,t,n,r):!!i},zn.isError=Ka,zn.isFinite=function(e){return"number"==typeof e&&Wt(e)},zn.isFunction=qa,zn.isInteger=Za,zn.isLength=Ja,zn.isMap=ts,zn.isMatch=function(e,t){return e===t||Mr(e,t,co(t))},zn.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Mr(e,t,co(t),r)},zn.isNaN=function(e){return ns(e)&&e!=+e},zn.isNative=function(e){if(_o(e))throw new _e("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return jr(e)},zn.isNil=function(e){return null==e},zn.isNull=function(e){return null===e},zn.isNumber=ns,zn.isObject=Qa,zn.isObjectLike=es,zn.isPlainObject=rs,zn.isRegExp=is,zn.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=u},zn.isSet=os,zn.isString=as,zn.isSymbol=ss,zn.isTypedArray=ls,zn.isUndefined=function(e){return e===n},zn.isWeakMap=function(e){return es(e)&&po(e)==O},zn.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Sr(e)},zn.join=function(e,t){return null==e?"":gn.call(e,t)},zn.kebabCase=Hs,zn.last=Ko,zn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=fs(r))<0?vn(i+o,0):bn(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Nt(e,Vt,o,!0)},zn.lowerCase=Ws,zn.lowerFirst=Ys,zn.lt=cs,zn.lte=us,zn.max=function(e){return e&&e.length?pr(e,nl,Ar):n},zn.maxBy=function(e,t){return e&&e.length?pr(e,so(t,2),Ar):n},zn.mean=function(e){return Ut(e,nl)},zn.meanBy=function(e,t){return Ut(e,so(t,2))},zn.min=function(e){return e&&e.length?pr(e,nl,Lr):n},zn.minBy=function(e,t){return e&&e.length?pr(e,so(t,2),Lr):n},zn.stubArray=pl,zn.stubFalse=gl,zn.stubObject=function(){return{}},zn.stubString=function(){return""},zn.stubTrue=function(){return!0},zn.multiply=xl,zn.nth=function(e,t){return e&&e.length?Ur(e,fs(t)):n},zn.noConflict=function(){return ht._===this&&(ht._=ze),this},zn.noop=sl,zn.now=Aa,zn.pad=function(e,t,n){e=vs(e);var r=(t=fs(t))?un(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Hi(gt(i),n)+e+Hi(ft(i),n)},zn.padEnd=function(e,t,n){e=vs(e);var r=(t=fs(t))?un(e):0;return t&&r<t?e+Hi(t-r,n):e},zn.padStart=function(e,t,n){e=vs(e);var r=(t=fs(t))?un(e):0;return t&&r<t?Hi(t-r,n)+e:e},zn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),wn(vs(e).replace(ne,""),t||0)},zn.random=function(e,t,r){if(r&&"boolean"!=typeof r&&yo(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=ds(e),t===n?(t=e,e=0):t=ds(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var o=xn();return bn(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Gr(e,t)},zn.reduce=function(e,t,n){var r=Ha(e)?jt:Yt,i=arguments.length<3;return r(e,so(t,4),n,i,hr)},zn.reduceRight=function(e,t,n){var r=Ha(e)?Ft:Yt,i=arguments.length<3;return r(e,so(t,4),n,i,dr)},zn.repeat=function(e,t,r){return t=(r?yo(e,t,r):t===n)?1:fs(t),Xr(vs(e),t)},zn.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zn.result=function(e,t,r){var i=-1,o=(t=bi(t,e)).length;for(o||(o=1,e=n);++i<o;){var a=null==e?n:e[Do(t[i])];a===n&&(i=o,a=r),e=qa(a)?a.call(e):a}return e},zn.round=_l,zn.runInContext=e,zn.sample=function(e){return(Ha(e)?qn:qr)(e)},zn.size=function(e){if(null==e)return 0;if(Ya(e))return as(e)?un(e):e.length;var t=po(e);return t==x||t==k?e.size:Rr(e).length},zn.snakeCase=$s,zn.some=function(e,t,r){var i=Ha(e)?Rt:ri;return r&&yo(e,t,r)&&(t=n),i(e,so(t,3))},zn.sortedIndex=function(e,t){return ii(e,t)},zn.sortedIndexBy=function(e,t,n){return oi(e,t,so(n,2))},zn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ii(e,t);if(r<n&&za(e[r],t))return r}return-1},zn.sortedLastIndex=function(e,t){return ii(e,t,!0)},zn.sortedLastIndexBy=function(e,t,n){return oi(e,t,so(n,2),!0)},zn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ii(e,t,!0)-1;if(za(e[n],t))return n}return-1},zn.startCase=Gs,zn.startsWith=function(e,t,n){return e=vs(e),n=null==n?0:ar(fs(n),0,e.length),t=li(t),e.slice(n,n+t.length)==t},zn.subtract=Cl,zn.sum=function(e){return e&&e.length?$t(e,nl):0},zn.sumBy=function(e,t){return e&&e.length?$t(e,so(t,2)):0},zn.template=function(e,t,r){var i=zn.templateSettings;r&&yo(e,t,r)&&(t=n),e=vs(e),t=ws({},t,i,Zi);var o,a,s=ws({},t.imports,i.imports,Zi),l=Es(s),c=qt(s,l),u=0,h=t.interpolate||be,d="__p += '",f=ke((t.escape||be).source+"|"+h.source+"|"+(h===q?ue:be).source+"|"+(t.evaluate||be).source+"|$","g"),p="//# sourceURL="+(Fe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(f,function(t,n,r,i,s,l){return r||(r=i),d+=e.slice(u,l).replace(ye,nn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t}),d+="';\n";var g=Fe.call(t,"variable")&&t.variable;if(g){if(le.test(g))throw new _e("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(V,""):d).replace(U,"$1").replace(H,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Zs(function(){return Ce(l,p+"return "+d).apply(n,c)});if(m.source=d,Ka(m))throw m;return m},zn.times=function(e,t){if((e=fs(e))<1||e>u)return[];var n=d,r=bn(e,d);t=so(t),e-=d;for(var i=Gt(r,t);++n<e;)t(n);return i},zn.toFinite=ds,zn.toInteger=fs,zn.toLength=ps,zn.toLower=function(e){return vs(e).toLowerCase()},zn.toNumber=gs,zn.toSafeInteger=function(e){return e?ar(fs(e),-9007199254740991,u):0===e?e:0},zn.toString=vs,zn.toUpper=function(e){return vs(e).toUpperCase()},zn.trim=function(e,t,r){if((e=vs(e))&&(r||t===n))return Xt(e);if(!e||!(t=li(t)))return e;var i=hn(e),o=hn(t);return wi(i,Jt(i,o),Qt(i,o)+1).join("")},zn.trimEnd=function(e,t,r){if((e=vs(e))&&(r||t===n))return e.slice(0,dn(e)+1);if(!e||!(t=li(t)))return e;var i=hn(e);return wi(i,0,Qt(i,hn(t))+1).join("")},zn.trimStart=function(e,t,r){if((e=vs(e))&&(r||t===n))return e.replace(ne,"");if(!e||!(t=li(t)))return e;var i=hn(e);return wi(i,Jt(i,hn(t))).join("")},zn.truncate=function(e,t){var r=30,i="...";if(Qa(t)){var o="separator"in t?t.separator:o;r="length"in t?fs(t.length):r,i="omission"in t?li(t.omission):i}var a=(e=vs(e)).length;if(rn(e)){var s=hn(e);a=s.length}if(r>=a)return e;var l=r-un(i);if(l<1)return i;var c=s?wi(s,0,l).join(""):e.slice(0,l);if(o===n)return c+i;if(s&&(l+=c.length-l),is(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=ke(o.source,vs(he.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===n?l:d)}}else if(e.indexOf(li(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},zn.unescape=function(e){return(e=vs(e))&&$.test(e)?e.replace(W,fn):e},zn.uniqueId=function(e){var t=++Re;return vs(e)+t},zn.upperCase=Xs,zn.upperFirst=Ks,zn.each=va,zn.eachRight=ba,zn.first=Yo,al(zn,(ml={},yr(zn,function(e,t){Fe.call(zn.prototype,t)||(ml[t]=e)}),ml),{chain:!1}),zn.VERSION="4.17.21",At(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){zn[e].placeholder=zn}),At(["drop","take"],function(e,t){Hn.prototype[e]=function(r){r=r===n?1:vn(fs(r),0);var i=this.__filtered__&&!t?new Hn(this):this.clone();return i.__filtered__?i.__takeCount__=bn(r,i.__takeCount__):i.__views__.push({size:bn(r,d),type:e+(i.__dir__<0?"Right":"")}),i},Hn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),At(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:so(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),At(["head","last"],function(e,t){var n="take"+(t?"Right":"");Hn.prototype[e]=function(){return this[n](1).value()[0]}}),At(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}}),Hn.prototype.compact=function(){return this.filter(nl)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Kr(function(e,t){return"function"==typeof e?new Hn(this):this.map(function(n){return Or(n,e,t)})}),Hn.prototype.reject=function(e){return this.filter(Fa(so(e)))},Hn.prototype.slice=function(e,t){e=fs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Hn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=fs(t))<0?r.dropRight(-t):r.take(t-e)),r)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(d)},yr(Hn.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=zn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(zn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Hn,c=s[0],u=l||Ha(t),h=function(e){var t=o.apply(zn,Mt([e],s));return i&&d?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=a&&!d,g=l&&!f;if(!a&&u){t=g?t:new Hn(this);var m=e.apply(t,s);return m.__actions__.push({func:da,args:[h],thisArg:n}),new Un(m,d)}return p&&g?e.apply(this,s):(m=this.thru(h),p?i?m.value()[0]:m.value():m)})}),At(["pop","push","shift","sort","splice","unshift"],function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);zn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ha(i)?i:[],e)}return this[n](function(n){return t.apply(Ha(n)?n:[],e)})}}),yr(Hn.prototype,function(e,t){var n=zn[t];if(n){var r=n.name+"";Fe.call(En,r)||(En[r]=[]),En[r].push({name:t,func:n})}}),En[zi(n,2).name]=[{name:"wrapper",func:n}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ha(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=bn(t,e+a);break;case"takeRight":e=vn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,u=this.__iteratees__,h=u.length,d=0,f=bn(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return fi(e,this.__actions__);var p=[];e:for(;l--&&d<f;){for(var g=-1,m=e[c+=t];++g<h;){var v=u[g],b=v.iteratee,y=v.type,w=b(m);if(2==y)m=w;else if(!w){if(1==y)continue e;break e}}p[d++]=m}return p},zn.prototype.at=fa,zn.prototype.chain=function(){return ha(this)},zn.prototype.commit=function(){return new Un(this.value(),this.__chain__)},zn.prototype.next=function(){this.__values__===n&&(this.__values__=hs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},zn.prototype.plant=function(e){for(var t,r=this;r instanceof Vn;){var i=No(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},zn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:da,args:[Qo],thisArg:n}),new Un(t,this.__chain__)}return this.thru(Qo)},zn.prototype.toJSON=zn.prototype.valueOf=zn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},zn.prototype.first=zn.prototype.head,Je&&(zn.prototype[Je]=function(){return this}),zn}();ft?((ft.exports=pn)._=pn,dt._=pn):ht._=pn}).call(Tr)}(kr,kr.exports)),kr.exports);const Or=({onSearch:t,placeholder:n="Поиск файлов...",className:r})=>{const[i,s]=o(""),l=u(null);a(()=>(l.current=Ir.debounce(e=>{t(e)},500),()=>{var e;null===(e=l.current)||void 0===e||e.cancel()}),[t]);return e(E,{value:i,onChange:e=>{var t;const n=e.target.value;s(n),null===(t=l.current)||void 0===t||t.call(l,n)},placeholder:n,prefix:e(se,{}),className:r,allowClear:!0,onClear:()=>{s(""),t("")}})},Er=({className:n,style:r,customIcon:i})=>i?e("img",{src:i,alt:"Upload",className:n,style:Object.assign(Object.assign({},r),{width:"64px",height:"64px",objectFit:"contain"})}):t("svg",{className:n,style:Object.assign(Object.assign({},r),{width:"64px",height:"64px"}),viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("circle",{cx:"32",cy:"32",r:"30",fill:"none",stroke:"#1890ff",strokeWidth:"2",opacity:"0.3"}),e("circle",{cx:"32",cy:"32",r:"20",fill:"none",stroke:"#1890ff",strokeWidth:"2"}),e("path",{d:"M32 12L32 28M24 20L32 12L40 20",stroke:"#1890ff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e("circle",{cx:"20",cy:"40",r:"2",fill:"#1890ff",opacity:"0.6"}),e("circle",{cx:"32",cy:"40",r:"2",fill:"#1890ff",opacity:"0.6"}),e("circle",{cx:"44",cy:"40",r:"2",fill:"#1890ff",opacity:"0.6"})]}),Pr="my_files",Mr="gif",jr="stock_images",Fr="ai",Rr="editor",Dr=!1,Lr=["jpg","jpeg","png","gif","bmp","webp","svg","ico","tiff","tif"],Nr="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQABLAEsAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAEsAAAAAQAAASwAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQOgAwAEAAAAAQAAAMoAAAAA/+EJ2Wh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6c3RvY2s6Mzk2MmU4NTQtNjA1NC00MGZmLWEwYzMtYjJkNjcwMzQ2OWFhIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmE5M2NiZTgyLWI5NjEtNGUzNS1iYmQ0LWJjZWE1Zjc1YTQwZiIvPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4A/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAMoBAwMBIgACEQADEQD/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/3QAEABH/2gAMAwEAAhEDEQA/APsuiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqG7uIbWB55nCooyTS208VxCssLh0boRQBLRRRQAUUUUAFFFFAH/9D7LooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAqG7uIrWBppnCoo5Jou7iK1gaaZwqKM5NcRq2oXOsXqxQq2wnEcYPX3NABq2oXOr3qwxK3l5xHGO/ua6nw7pzadZ7ZJGaR+WBPA9hUfh7R49Pi82TDXDDkkfd9hWxQAUUUUAFFFFABRRRQB//9H7LooooAKKKKACiiuOv/EOpQX88KNDsSQqMp6H60AdjRXD/wDCTapn70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iiuH/4SfVP70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iobq4itYHmncIijJJrE0jUdQlt2v8AUJIYrNVyMJgv9Oaw9X1C51e8WGJWMecRxr39zQAatqNzq94kUasELYjjB6/Wul8P6NHp8Qlkw1ww5P8Ad9hWRmDw9bfwTajIv4Riqw8Tap6wf98f/XoA7elrh/8AhJtU/vQ/9+//AK9avhnWL3UL94bgx7BGWG1cdwPX3oA6OiiigAooooAKKKKAP//S+y6KKKACiiigArgHAbxSVYAg3mCD3+eu/rgT/wAjV/2+f+z0Adt9jtMf8esH/fsUfY7T/n1g/wC/Yqeh2CIWY4AGSaAK7WlmqktbQADkkxr/AIVUe50JJPLZ7EN6YWuX17WJr+dkRylurYVQfve5rKJoA9Ghh0+Zd0MVtIvqqKaf9jtP+fWD/v2K89sry4sphLbyFD3HY/Wu+0e9TULFLhQATww9DQBJ9jtP+fWD/v2KattZM7ILe3LL94bF4p99cx2lpJcS/dRc/X2rjdG1eSLWmuZ2Oy4bEnoPQ/hQB2P2O0/59YP+/Yo+x2n/AD6wf9+xU4IPSloAr/Y7T/n1g/79ij7Haf8APrB/37FWKKAK/wBjtP8An1g/79ij7Haf8+sH/fsVYooAr/Y7T/n1g/79ioruPTrWBppoLdUUckxj/Cp7u4itYGnmcKijJJriNX1C61i9EUKtsziOMHr7mgBNVv7jVrxYII/3YOIYl/ma6bw9o8enxCSTD3DDkn+H2FHh/R49Pi8yTDXDDkkfd9hWxQBC9rbOxZ7eJmPUlATTfsdp/wA+sH/fsVYooAztXtbVdLumW3hBELkEIOPlNc74H/5Csv8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0/suiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72s/xI7R6HdMpwdmPzODWhUN/ALqymt26SIVoA816UlS3ML207wSrtdCQai+lAC11HgN2xdx4+XKH6Hn/AArl++K6jSv+JN4flvJhiWfBRe/Tj+ZNAEHjLUfOnFjEw2R/NJju3Yfl/Oudp0jtJIzucsxJJ96bQB2/hLUftdkLeRh50OF+q9jW3XnOkXrWF/HcDJUHDjPUV6HDIssSSIQVYAg0APooooAKhu7iK1gaeZwqKM5NF3cQ2sDTTOFRRk5riNW1C51i9WKJW8vOI4x39zQAavqF1rF6IYVbZnEcYPX3NdL4e0ePT4hLIA1w45JH3fYUeHtHj0+LzJcNcMOTj7vsK2KACiiigAooooAqaz/yCbz/AK4v/wCgmuX8D/8AIWl/64n+YrqNZ/5BN5/1xf8A9BNcv4H/AOQtL/1xP8xQB2dFFFABRRRQAUUUUAf/1PsuiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72lpKWgDO1bSLXUQDKCsg6OvX/wCvWFJ4Tn3fJdxFc8FkOa66igDC0zw3a2riadzPIOeRhR+FYXinUPtl+Yoz+5h+VcdCe5/p+FdH4n1H7DYFYziaX5U9vU1wn40AFFFFABXW+DNR3xtp8x+ZPmjyeo7j/PrXJVNZzva3UdxG2HjbP/1qAPTKhu7iK2gaaZwqKOSahTULf+zFv3bZEybsmuP1XULnV70QxK3l7sRxr39zQAmrahc6xerFEreXnEcY7+5rpfD2jx6fF5suGuGHJx932FHh7R49PiEkuGuGHJ/u+wrYoAKKKKACiiigAooooAqaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5iuo1n/AJBN5/1xf/0E1y/gf/kLS/8AXE/zFAHZ0UUUAFFFFABRRRQB/9X7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAKazBVZicBRkmnVz3jHUfs9qLOJsSy/ex2XvQBzuu351DUXlDfu1+WMewqhRRQAUUUv40AFbGi6ZG8TahqB8uzTkA9ZP/AK1Gi6ZG8TajqJ2WcfIB/wCWn/1qi1W+uNWu0hhQiIHbFEv86ADU7+fVbpIIU2xZ2xRL/M103h7R00+LzZcPcMOTj7vsKyCYfD9sQNsupSr+EY/z+ddDot8uoWCTj7/Rx6N3oAvUUUUAFZ17rFta6jDZydZPvNnhPTNSaxqEWn2bTv8AM3RF9TXntxLJPK8sp3O5yx9TQB6dmlrA8Kar9qg+yzt+/jHBP8QrfoAKKKKAKms/8gm8/wCuL/8AoJrl/A//ACFpf+uJ/mK6jWf+QTef9cX/APQTXL+B/wDkLS/9cT/MUAdnRRRQAUUUUAFFFFAH/9b7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAjuZo7eB5pThEGSa851G6e9vJLl+rngeg7Ct/xpqOWXT4m6fNLj9B/X8q5mgBKKKO9AADzWzoumRvEdQ1A7LOPkA/8tP/AK1JoulxvE2oagQlnHyAf+Wn/wBaotVv59WukhhjIizthiX+dABql/catdJBDGRHnbDEv86vkweH7bHyy6jKv4Rj/P8An0UmDw/bEfLLqMq/hGP8/n/Ln5JHlkaSRi7scsx70AEkjySNLIxd2OWY961fCuo/Y78RSNiGY7T7Hsax6WgD1EGmyuscbSOwVVBJPoKy/DGofbrABzmaLCvk9fQ1k+MNU3MdPgY4X/WkevpQBla7qLajel84iTiMe3rWdS0lAEtrPJbXMdxC2HQ5HvXoWlXsd/ZpPGevDD0PevOK0/D2pHTr0FiTBJgOP60Ad/RTUYOoZSCCMg06gCprP/IJvP8Ari//AKCa5fwP/wAhaX/rif5iuo1n/kE3n/XF/wD0E1y/gf8A5C0v/XE/zFAHZ0UUUAFFFFABRRRQB//X+y6KKKACiiigArgT/wAjV/2+f+z131cCf+Rq/wC3z/2egDvarapeJY2Mlw/8I+UZ6nsKs1xni7UftN39ljb91Eecd2/z/WgDFnlknmeaRsu5JJqOigdeKAFrX0XS43iOoagQlnHyAf8Alp/9al0XTI3ibUNQISzj5Ab/AJaf/WqHVb+41a6SGGMrEDtiiX+dAC6rfT6tdJBChEWdsMS/zq+TB4ftj92XUZV/CMf5/P8AkhMPh+2x8suoyr+EY/z+f8sCSR5ZGlkYu7HLMe9ABJI8sjSSMXdjlmPemUUUAFLSUUAWtOvp7CZ5YD8zIVOenNVmJZixJJPUmkooAKKKKAClFJRQB1Pg/VOBp87Dj/VEn9K6jPFeYRs0bh0JDqQQR2Nd7oGpJqNkGJxKnEg/rQBY1n/kE3n/AFxf/wBBNcv4H/5C0v8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0PsuiiigAooooAK4E/8AI1f9vn/s9d8a89u5RB4hlnYEiO5LkDvhs0Adtq808Ni7W0TyTEbUCjkE964c6TqhJJspyTySVroB4stsY+xzf99Cj/hK7X/nzl/76FAHPnSdTx/x4z/981d0zRvL33eqr5NtFztbq5/wro7PVo5rF72SB7eBfutIcbvpXLatqFzq94IokYpnEca859zQAmq31xq12sEEZEQOIol/nWxBYzaPZeZBavc30oxlVyIxUVsbLw6i+epuL1wCyp/AP6VY/wCEstv+fSb/AL6FAGBLpmrSyNJJZ3DuxyzFetN/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmj+yNT/wCfGf8A75roP+Ertf8Anzl/76FH/CV2v/PnL/30KAOf/sjU/wDnxn/75o/sjU/+fGf/AL5roP8AhK7X/nzl/wC+hR/wldr/AM+cv/fQoA5/+yNT/wCfGf8A75o/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmrmkW+r6ferOllPtzh12n5hWp/wldr/wA+cv8A30KP+Ertf+fOX/voUAa+rNu0a6bBGYGOD1HymuZ8D/8AIWl/64n+YqzfeJre4spoBayqZI2UEkcZGKreB/8AkKyn/pif5igDs6KKKACiiigAooooA//R+y6KKKACiiigArHn8OadPO80nm73YscNjknNbFFAGJ/wjGmf9N/+/lRXGg6NZxG4nMnlpyQ0mQfatq7uIrWBppnCoozk1xGrajdaxeLFCh2E4jjHf3NACapfT6tdpBDGfKU4hjUfrXTeH9HTT4vNkw1yw5JH3fYUeHtHj0+LzZMNcMOSR932FbFAGNL4b0+WRpJXuHdjks0nJNN/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTPSf/v5VrTNGs9PnM1v5m4qVO5s8ZB/pWjRQAUUUUAFFFFABRRRQB//0vsuiiigAooooAKhu7mK1t2nmYKijkmpq5fxda6jNcReXukgYgBVHQ+9AGVq2oXOsXqxRK2zdiNB39zXS+H9Hj0+ISSYa4Ycn+77Cjw/o8enxebLhrhhySPu+wrYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9P7LooooAKKKKACkxS0UAFFFFABRRTW6D6igB1FN7n8KQE+YRQA+iiigAopsnEZI64pR90UALRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q==",zr=s({state:{},actions:{},options:{}}),Br=()=>l(zr),Vr=({children:t,options:n})=>{const[r,s]=o([]),[l,u]=o([]),[h,d]=o(null),[f,p]=o(n.searchQuery||""),[g,m]=o(n.sortBySize||"name"),{config:v}=n,[b,y]=o("name"),[w,x]=o("asc"),[_,C]=o([{id:"folders",name:"Папки"}]),[S,A]=o(new Set);i.useEffect(()=>{A(new Set)},[]);const k=i.useRef(null);i.useEffect(()=>{if(n.onChangeSelection&&k.current!==S){if(null!==k.current){const e=(Array.isArray(l)?l:[]).filter(e=>S.has(e.id));n.onChangeSelection(e)}k.current=S}},[l,S,n.onChangeSelection]);const[T,I]=o(!1),[O,E]=o(Pr);a(()=>{(null==v?void 0:v.activeLibraryItem)&&E&&E(null==v?void 0:v.activeLibraryItem)},[null==v?void 0:v.activeLibraryItem,E]);const[M,j]=o({current:1,pageSize:12,total:0}),[F]=P.useForm(),[R]=P.useForm(),[D]=P.useForm(),[L]=P.useForm(),[N]=P.useForm(),[z]=P.useForm(),[B,V]=o(!1),[U,H]=o(!1),[W,Y]=o(!1),[$,G]=o(!1),[X,K]=o(!1),[q,Z]=o(!1),[J,Q]=o(!1),[ee,te]=o(null),[ne,re]=o(null),ie=c(e=>{j(t=>Object.assign(Object.assign({},t),e))},[j]),oe={setFolders:s,setFiles:u,setSelectedFolder:d,setSearchTerm:p,setSortField:m,setSortBy:y,setSortOrder:x,setPathHistory:C,setSelectedFiles:A,setLoading:I,setPagination:ie,setIsModalVisible:V,setIsUrlModalVisible:H,setIsRenameModalVisible:Y,setIsMoveModalVisible:G,setIsRenameFolderModalVisible:K,setIsCopyModalVisible:Z,setIsDeleteConfirmVisible:Q,setFileToRename:te,setFolderToRename:re,updatePathHistoryOnFolderRename:(e,t)=>{C(n=>n.map(n=>n.id===e?Object.assign(Object.assign({},n),{name:t}):n))},setActiveLibraryItem:E},ae={state:{folders:r,files:l,selectedFolder:h,searchTerm:f,sortField:g,sortBy:b,sortOrder:w,pathHistory:_,selectedFiles:S,loading:T,pagination:M,isModalVisible:B,isUrlModalVisible:U,isRenameModalVisible:W,isMoveModalVisible:$,isRenameFolderModalVisible:X,isCopyModalVisible:q,isDeleteConfirmVisible:J,form:F,urlForm:R,renameForm:D,moveForm:L,renameFolderForm:N,copyForm:z,fileToRename:ee,folderToRename:ne,activeLibraryItem:O},actions:oe,options:n};return e(zr.Provider,{value:ae,children:t})},Ur=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Hr=async(e,t,n)=>{var r;if(console.log("📁 addSubfoldersToFiles: params:",JSON.stringify(t,null,2)),null===(r=null==t?void 0:t.search)||void 0===r?void 0:r.trim())return console.log("🔍 Поиск активен, папки не добавляются"),e;let i=[];if(!n)return console.warn("🔍 getFolders не доступен!"),e;{const e=await n();i=Array.isArray(e)?e:[],console.log("📁 Получено папок от dataProvider:",i.length,"тип данных:",typeof e,"данные:",e)}const o=((e,t)=>{const n=Array.isArray(e)?e:[];return(r=t.folderId)&&"root"!==r&&"folders"!==r&&"null"!==r&&null!==r?n.filter(e=>e.parentId===t.folderId):n.filter(Ur);var r})(i,t);if(console.log("📁 Найдено подпапок для добавления:",o.length),0===o.length)return e;const a=o.map(e=>({id:e.id,name:e.name,size:"-",date:"-",isFolder:!0,folderId:e.parentId||"",type:"",selected:!1,extension:""})),s=[...a,...e];return console.log("📁 РЕЗУЛЬТАТ: папок:",a.length,"файлов:",e.length,"всего:",s.length),s},Wr=()=>{const{state:e,actions:t,options:n}=Br(),{t:r}=gr(),{message:i}=O.useApp(),{selectedFolder:o,urlForm:a,pagination:s,files:l}=e,{setFiles:u,setLoading:h,setIsUrlModalVisible:d,setSelectedFiles:f,setActiveLibraryItem:p,setPagination:g}=t,{dataProviders:m}=n,v=c(async e=>{var t;if(!(null==m?void 0:m.getFiles))return[];const{files:n,pagination:r}=await m.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,search:(null===(t=null==e?void 0:e.search)||void 0===t?void 0:t.trim())||void 0,sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder,page:null==e?void 0:e.page,limit:null==e?void 0:e.limit});return console.log("🔍 fetchFilesFromDataProvider результат:",n,"с параметрами сортировки:",{sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder}),r&&g&&g({current:r.page,pageSize:r.limit,total:r.total}),n},[m]),b=c(async e=>{try{null==h||h(!0),console.log("fetchFiles вызван с параметрами:",e);let t=[];if(!(null==m?void 0:m.getFiles))return void console.error("DataProvider для получения файлов не определен");t=await v(e),console.log("Получены файлы:",t),e&&(t=await Hr(t,e,null==m?void 0:m.getFolders)),null==u||u(t),null==f||f(new Set)}catch(e){console.error("Ошибка при загрузке файлов:",e),i.error("Не удалось загрузить файлы")}finally{null==h||h(!1)}},[m,u,h,f,v,i]),y=c(async e=>{try{if(!(null==m?void 0:m.deleteFile))return void i.error("DataProvider для удаления файлов не настроен");if(!await m.deleteFile(e))throw new Error("Не удалось удалить файл");i.success(r("File deleted"));await b({folderId:null===o?"root":o||void 0,page:l.length>=1?s.current:s.current-1})}catch(e){console.error("Ошибка при удалении файла:",e),i.error(r("Error when deleting a file"))}},[m,b,o,r,i,s,l]),w=c(async e=>{try{if(!(null==m?void 0:m.deleteFolder))return void i.error("DataProvider для удаления папок не настроен");if(!await m.deleteFolder(e))throw new Error("Не удалось удалить папку");i.success(r("Folder deleted"));o===e?await b():await b({folderId:null===o?"root":o||void 0})}catch(e){console.error("Ошибка при удалении папки:",e),i.error(r("Error when deleting a folder"))}},[m,b,o,r,i]),x=c(async e=>{try{if(null==m?void 0:m.getFile){const t=await m.getFile(e);if(t)return t;throw new Error("Не удалось загрузить файл")}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error("Ошибка загрузки файла");return await t.blob()}}catch(e){console.error("Ошибка при загрузке файла:",e)}},[m,i]),_=c(async e=>{if(!(null==m?void 0:m.uploadFile))return;const t=e.name.split(".").pop()||"";await m.uploadFile({name:e.name,size:`${(e.size/1024).toFixed(0)} КБ`,type:e.type,folderId:o||null,data:e,extension:t}),p&&p(Pr)},[m,o,p]),C=c(async e=>{try{if(null==m?void 0:m.getFolders){const t=await m.getFolders(),n=(Array.isArray(t)?t:[]).some(t=>t.id===e);return console.log(n?"✅ Папка найдена:":"❌ Папка не найдена:",e),n}}catch(e){console.warn("⚠️ Ошибка проверки папки:",e)}return!1},[null==m?void 0:m.getFolders]),S=c(async e=>{if(!(null==m?void 0:m.uploadFile))return void i.error("DataProvider для загрузки файлов не настроен");if(o)try{if(!await C(o))return console.error("❌ Выбранная папка не найдена на сервере:",o),void i.error("Выбранная папка не найдена. Попробуйте обновить список папок или создать папку заново.")}catch(e){console.warn("⚠️ Не удалось проверить существование папки, продолжаем загрузку:",e)}const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=async t=>{var n;const a=null===(n=t.target.files)||void 0===n?void 0:n[0];if(a)if(a.type.startsWith("image/"))try{if(null==h||h(!0),null==e||e.onStart(a),null==e?void 0:e.onProgress){let t=0;const n=setInterval(()=>{t=Math.min(t+10+Math.floor(Date.now()%10),90),e.onProgress(a.name,t)},200);await _(a),clearInterval(n),e.onProgress(a.name,100)}else await _(a);null==e||e.onComplete(a.name),i.success(`${r("File")} ${a.name} ${r("has been successfully uploaded")}`),await b({folderId:null===o?"root":o||void 0})}catch(t){console.error("Ошибка при загрузке файла:",t),null==e||e.onError(a.name,"Ошибка при загрузке файла"),i.error("Ошибка при загрузке файла")}finally{null==h||h(!1)}else i.error(r("Please select an image file"))},t.click()},[m,o,h,b,r,_,C]),A=c(async(e,t)=>{try{let n;const s=await(null==a?void 0:a.validateFields()),l=e||(null==s?void 0:s.fileUrl);return l?(null==h||h(!0),(null==m?void 0:m.uploadFileByUrl)?(n=await m.uploadFileByUrl({url:l,folderId:o||null,noFolder:t}),i.success(`${r("File")} ${(null==s?void 0:s.name)||"unnamed file"} ${r("successfully uploaded")}`),null==d||d(!1),null==a||a.resetFields(),p&&p(Pr),await b({folderId:null===o?"root":o||void 0}),n):void i.error("Загрузка по URL не поддерживается")):void i.error("Заполните все поля")}catch(e){console.error("Ошибка при загрузке файла по URL:",e),i.error(r("Error when downloading a file by URL"))}finally{null==h||h(!1)}},[a,m,o,h,d,b,r]),k=c(async e=>{if(e.type.startsWith("image/"))try{await _(e),i.success(`${r("File")} ${e.name} ${r("has been successfully uploaded")}`)}catch(t){console.error(`Ошибка при загрузке файла ${e.name}:`,t),i.error(`Ошибка при загрузке файла ${e.name}`)}else i.warning(`Файл ${e.name} не является изображением и будет пропущен`)},[m,r,_]),T=c(async e=>{for(const t of e)await k(t);await b({folderId:null===o?"root":o||void 0})},[k,b,o]);return{fetchFiles:b,handleDeleteFile:y,handleDeleteFolder:w,handleAddFile:S,handleAddFileByUrl:A,handleDroppedFiles:T,getFileData:x,uploadFileWithProvider:_}},Yr=()=>{var e;const{state:t,actions:n,options:i}=Br(),{t:o}=gr(),{message:a}=O.useApp(),{folders:s,selectedFolder:l,form:u,loading:h,isModalVisible:d}=t,{setFolders:f,setLoading:p,setIsModalVisible:g}=n,{dataProviders:m}=i,v=c(async()=>{console.log("Запрос папок..."),null==p||p(!0);try{let e=[];if(!(null==m?void 0:m.getFolders))return void console.error("DataProvider для папок не определен");e=await m.getFolders(),console.log("Полученные папки:",e);const t=Array.isArray(e)?e:[];null==f||f(t);const n=t.filter(e=>e.id===e.parentId);n.length>0&&console.warn("Обнаружены папки с циклическими зависимостями:",n)}catch(e){console.error("Ошибка при загрузке папок:",e),a.error("Ошибка при загрузке папок")}finally{null==p||p(!1)}},[null==m?void 0:m.getFolders,f,p,a]),b=c(()=>{u.setFieldsValue({folderName:"Новая папка"}),null==g||g(!0)},[u,g]),y=c(e=>{const r=[...(Array.isArray(s)?s:[]).filter(t=>t.id!==e.id),e];if(null==f||f(r),console.log("📂 Обновлен список папок, новая папка:",e),n.setSelectedFolder&&(n.setSelectedFolder(e.id),console.log("🎯 Выбрана созданная папка как активная:",e.id)),n.setPathHistory){const r=[...t.pathHistory||[],{id:e.id,name:e.name}];n.setPathHistory(r),console.log("🧭 Обновлен путь навигации:",r)}},[s,f,n,t.pathHistory]),w=c(async e=>{try{if(null==m?void 0:m.getFolders){const t=await m.getFolders(),n=(Array.isArray(t)?t:[]).some(t=>t.id===e);return console.log(n?"✅ Папка найдена:":"❌ Папка не найдена:",e),n}}catch(e){console.warn("⚠️ Ошибка проверки папки:",e)}return!1},[null==m?void 0:m.getFolders]),x=c(async()=>{try{const e=(await u.validateFields()).folderName.trim();if(!e)return void a.error("Имя папки не может быть пустым");const t=l&&"folders"!==l?l:null;let n;if(console.log("🆕 Создание новой папки:",{folderName:e,parentId:t,selectedFolder:l}),!(null==m?void 0:m.createFolder))return void a.error("DataProvider для создания папок не настроен");n=await m.createFolder({name:e,parentId:t}),(e=>{if(!e||!e.id)throw new Error("Некорректный ответ от сервера: отсутствует ID папки");if(e.id===e.parentId&&e.parentId)throw console.error("Обнаружена циклическая зависимость: папка является родителем сама для себя"),new Error("Ошибка: папка не может быть родителем самой себя")})(n),y(n),await v(),await new Promise(e=>setTimeout(e,200));await w(n.id)||console.warn("⚠️ Не удалось подтвердить создание папки на сервере, но продолжаем..."),a.success(`Папка "${e}" создана и выбрана`),null==g||g(!1)}catch(e){console.error("❌ Ошибка при создании папки:",e),a.error(e instanceof Error?e.message:o("Failed to create folder"))}},[u,l,null==m?void 0:m.createFolder,y,g,o,v,w,a]),_=c(()=>{null==g||g(!1)},[g]),C=c((e,t=new Set)=>{const n=Array.isArray(s)?s:[];return e.map(e=>{if(t.has(e.id))return console.warn(`Обнаружен цикл в структуре папок с id=${e.id}. Пропускаем обработку дочерних элементов.`),{key:e.id,label:e.name+" (ошибка)",icon:r.createElement(le,{style:{color:"red"}})};const i=new Set(t);i.add(e.id);const o=n.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:o.length>0?C(o,i):void 0}})},[s]),S=c(()=>{const e=Array.isArray(s)?s:[],t={key:"folders",label:o("Folders"),children:[]},n=e.filter(e=>null===e.parentId||!e.parentId);return t.children=C(n),[t]},[s,o,C]),A=c(async(e,t)=>{var r;try{if(!t||""===t.trim())return void a.error("Имя папки не может быть пустым");if(!(null===(r=i.dataProviders)||void 0===r?void 0:r.renameFolder))return void a.error("DataProvider для переименования папок не настроен");const o=await i.dataProviders.renameFolder(e,t.trim());if(!(null==o?void 0:o.id))return void a.error("Некорректный ответ при переименовании папки");await v(),e!==o.id&&n.setSelectedFolder&&n.setSelectedFolder(o.id),a.success(`Папка переименована на "${t.trim()}"`)}catch(e){console.error("Ошибка при переименовании папки:",e),a.error(e instanceof Error?e.message:"Ошибка при переименовании папки")}},[v,a,null===(e=i.dataProviders)||void 0===e?void 0:e.renameFolder]);return{state:{folders:s,isCreatingFolder:d,loading:h},actions:{fetchFolders:v,handleCreateFolder:b,handleModalOk:x,handleModalCancel:_,generateMenuItems:S,renameFolder:A}}},$r=new Map,Gr=(e,t)=>{$r.set(e,t),console.log("Изображение сохранено в кеш:",e),$r.size>350&&(Array.from($r.keys()).slice(0,50).forEach(e=>$r.delete(e)),console.warn("Очищен кеш изображений. Удалено 50 самых старых записей."))},Xr=e=>{if(e.type&&e.type.startsWith("image/"))return!0;if(e.name){const t=e.name.toLowerCase().split(".").pop();return Lr.includes(t||"")}return!1},Kr=({src:t,alt:n,className:r,width:i,height:s,preview:l=!1,file:u})=>{const h=Wr(),[d,f]=o(!1),[p,g]=o(t),[m,v]=o(!1),b=c(e=>{g(e),f(!1),v(!1)},[]),y=c(e=>{console.warn("Не удалось загрузить изображение:",e),g(void 0),f(!0),v(!1)},[]),w=c(()=>{g(Nr),f(!0)},[]),x=c(e=>{g(e),f(!1)},[]),_=c(e=>{const t=e.split(",")[1];t&&t.length>20?g(e):(console.warn("Некорректные base64 данные:",e.substring(0,50)+"..."),w())},[w]),C=c(async e=>{if(console.log("loadImageFromFile",e),(e=>$r.has(e))(e))return console.log("Изображение найдено в кеше:",e),(e=>$r.get(e))(e);if(!u||!Xr(u))return console.warn("Файл не является изображением:",null==u?void 0:u.name,null==u?void 0:u.type),w(),Nr;try{const t=await h.getFileData(e);if(!t)throw new Error("Ошибка загрузки файла");return new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{const t=i.result;Gr(e,t),n(t)},i.onerror=()=>r(new Error("Ошибка чтения файла")),i.readAsDataURL(t)})}catch(e){throw console.error("Ошибка загрузки изображения:",e),e}},[u,w,h]),S=c(()=>{(null==u?void 0:u.id)&&Xr(u)?C(u.id).then(b).catch(y):u&&!Xr(u)&&(console.warn("Файл не является изображением, показываем fallback:",u.name,u.type),w())},[u,C,b,y,w]),A=c(e=>{console.log("HandleBlobSrc:",{blobSrc:e,file:u?{id:u.id,name:u.name,type:u.type,extension:u.extension,folderId:u.folderId}:null}),u&&Xr(u)?(console.log("Blob файл является изображением, устанавливаем src:",u.name,u.type),g(e),f(!1)):(console.warn("Blob файл не является изображением, показываем fallback:",null==u?void 0:u.name,null==u?void 0:u.type),w())},[u,w,Xr]),k=c(()=>{(null==u?void 0:u.id)&&Xr(u)?(v(!0),C(u.id).then(b).catch(y)):u&&!Xr(u)?(console.warn("Файл не является изображением, показываем fallback:",u.name,u.type),w()):(console.warn("Неподдерживаемый формат изображения:",t),g(void 0))},[u,t,C,b,y,w]);a(()=>{v(!1),t?t.startsWith("data:image/")?_(t):t.startsWith("blob:")?A(t):t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?x(t):(console.log("setImageError 1"),k()):S()},[t,S,_,A,x,k]);return e(j,{className:r,src:p,alt:n,width:i,height:s,preview:l&&!d&&{src:p,toolbarRender:()=>null,destroyOnHidden:!0},onError:()=>{console.warn("Ошибка загрузки изображения:",(null==p?void 0:p.substring(0,50))+"..."),f(!0)},fallback:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",loading:m?"lazy":void 0})},qr="filemanager_view_mode",Zr=()=>{const{state:e}=Br(),{files:t,loading:n,isUrlModalVisible:r}=e,i=Wr(),o=(()=>{const{state:e,actions:t}=Br(),{selectedFiles:n}=e,{setSelectedFiles:r}=t,i=c(e=>{if(!n||!r)return;const t=new Set(n);t.has(e)?t.delete(e):t.add(e),r(t)},[n,r]);return{state:{selectedFiles:n||new Set},actions:{toggleFileSelection:i}}})(),a=(e=>{const{state:t,actions:n,options:r}=Br(),{t:i}=gr(),o=Yr(),{fetchFolders:a}=o.actions,{files:s,selectedFolder:l,selectedFiles:u,fileToRename:h,renameForm:d,isRenameModalVisible:f,moveForm:p,copyForm:g}=t,{setFileToRename:m,setIsRenameModalVisible:v,setIsMoveModalVisible:b,setIsCopyModalVisible:y,setSelectedFiles:w,setIsDeleteConfirmVisible:x}=n,{apiEndpoints:_,dataProviders:C}=r,S=c(e=>{null==m||m(e),null==v||v(!0);const t=null==s?void 0:s.find(t=>t.id===e);t&&d&&d.setFieldsValue({newFileName:t.name})},[m,v,s,d]),A=c(()=>{null==v||v(!1),null==m||m(null),null==d||d.resetFields()},[v,m,d]),k=c(async()=>{if(h&&d)try{const t=await d.validateFields();if(!(null==t?void 0:t.newFileName))return;const r=null==s?void 0:s.find(e=>e.id===h);if((null==r?void 0:r.isFolder)||h.startsWith("folder_")){if(!(null==C?void 0:C.renameFolder))return void M.error("DataProvider для переименования папок не настроен");{const e=await C.renameFolder(h,t.newFileName.trim());if(!(null==e?void 0:e.id))return void M.error("Некорректный ответ при переименовании папки");M.success(`${i("Folder renamed to")} ${t.newFileName}`),await a(),h!==e.id&&n.setSelectedFolder&&n.setSelectedFolder(e.id)}}else{if(!(null==C?void 0:C.renameFile))return void M.error("DataProvider для переименования файлов не настроен");await C.renameFile(h,t.newFileName),M.success(`${i("File renamed to")} ${t.newFileName}`)}A(),await e({folderId:l||void 0})}catch(e){console.error("Ошибка при переименовании:",e),M.error(e instanceof Error?e.message:"Ошибка при переименовании")}},[h,d,s,C,_,A,e,l,i]),T=c(()=>{null==b||b(!0)},[b]),I=c(()=>{null==b||b(!1),null==p||p.resetFields()},[b,p]),O=c(async()=>{if(u&&0!==u.size&&p)try{const t=await p.validateFields(),n=null==t?void 0:t.targetFolder;if(!n)return void M.error("Выберите папку назначения");const r=Array.from(u);let i=0,o=0,c=!1;for(const e of r)try{const t=null==s?void 0:s.find(t=>t.id===e),r=(null==t?void 0:t.isFolder)||e.startsWith("folder_");r&&(c=!0),(null==C?void 0:C.moveItem)?(await C.moveItem({itemId:e,targetFolderId:n,isFolder:r}),i++):(console.warn(`DataProvider для перемещения не настроен для ${r?"папки":"файла"} ${e}`),o++)}catch(t){console.error(`Ошибка при перемещении объекта ${e}:`,t),o++}i>0&&M.success(`Успешно перемещено ${i} из ${r.length} объектов`),o>0&&M.error(`Не удалось переместить ${o} из ${r.length} объектов`),I(),null==w||w(new Set),c&&await a(),await e({folderId:l||void 0})}catch(e){console.error("Ошибка при перемещении:",e),M.error("Ошибка при перемещении")}},[u,p,s,C,_,I,w,e,l]),E=c(()=>{null==y||y(!0)},[y]),P=c(()=>{null==y||y(!1),null==g||g.resetFields()},[y,g]),j=c(async()=>{if(u&&0!==u.size&&g)try{const t=await g.validateFields();if(!(null==t?void 0:t.targetFolder))return void M.error("Выберите папку назначения");const n=Array.from(u);let r=0,i=!1;for(const e of n)try{const t=null==s?void 0:s.find(t=>t.id===e),n=(null==t?void 0:t.isFolder)||e.startsWith("folder_");n&&(i=!0),console.warn(`Копирование не поддерживается для ${n?"папки":"файла"} ${e}`),r++}catch(t){console.error(`Ошибка при копировании объекта ${e}:`,t),r++}r>0&&M.error(`Не удалось скопировать ${r} из ${n.length} объектов`),P(),null==w||w(new Set),i&&await a(),await e({folderId:l||void 0})}catch(e){console.error("Ошибка при копировании:",e),M.error("Ошибка при копировании")}},[u,g,s,_,P,w,e,l]),F=c(()=>{null==x||x(!0)},[x]),R=c(()=>{null==x||x(!1)},[x]),D=c(async()=>{var t;if(u&&0!==u.size)try{const r=Array.from(u);let i=0,o=0;for(const e of r)try{const t=null==s?void 0:s.find(t=>t.id===e);(null==t?void 0:t.isFolder)||e.startsWith("folder_")?(null==C?void 0:C.deleteFolder)?await C.deleteFolder(e)?i++:o++:(console.warn("DataProvider для удаления папок не настроен"),o++):(null==C?void 0:C.deleteFile)?await C.deleteFile(e)?i++:o++:(console.warn("DataProvider для удаления файлов не настроен"),o++)}catch(t){console.error(`Ошибка при удалении объекта ${e}:`,t),o++}i>0&&M.success(`Успешно удалено ${i} из ${r.length} объектов`),o>0&&M.error(`Не удалось удалить ${o} из ${r.length} объектов`),null==w||w(new Set),null==x||x(!1),await(null===(t=n.fetchFolders)||void 0===t?void 0:t.call(n)),await e({folderId:l||void 0})}catch(e){console.error("Ошибка при удалении:",e),M.error("Ошибка при удалении")}else null==x||x(!1)},[u,s,C,n,e,l,w,x]);return{state:{isRenamingFile:f||!1,fileToRename:h},actions:{showRenameModal:S,handleRenameCancel:A,handleRenameOk:k,showMoveModal:T,handleMoveCancel:I,handleMoveOk:O,showCopyModal:E,handleCopyCancel:P,handleCopyOk:j,showDeleteConfirm:F,handleDeleteConfirmCancel:R,handleDeleteConfirmOk:D}}})(i.fetchFiles);return{state:{files:t||[],selectedFiles:o.state.selectedFiles,loading:n||!1,isAddingFileByUrl:r||!1,isRenamingFile:a.state.isRenamingFile,fileToRename:a.state.fileToRename},actions:{fetchFiles:i.fetchFiles,handleDeleteFile:i.handleDeleteFile,handleDeleteFolder:i.handleDeleteFolder,handleAddFile:i.handleAddFile,handleAddFileByUrl:i.handleAddFileByUrl,handleDroppedFiles:i.handleDroppedFiles,uploadFileWithProvider:i.uploadFileWithProvider,toggleFileSelection:o.actions.toggleFileSelection,showRenameModal:a.actions.showRenameModal,handleRenameCancel:a.actions.handleRenameCancel,handleRenameOk:a.actions.handleRenameOk,showMoveModal:a.actions.showMoveModal,handleMoveCancel:a.actions.handleMoveCancel,handleMoveOk:a.actions.handleMoveOk,showCopyModal:a.actions.showCopyModal,handleCopyCancel:a.actions.handleCopyCancel,handleCopyOk:a.actions.handleCopyOk,showDeleteConfirm:a.actions.showDeleteConfirm,handleDeleteConfirmCancel:a.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:a.actions.handleDeleteConfirmOk}}},Jr=()=>{const{notification:e}=O.useApp(),t=Br().options.notification;return h(()=>Object.assign(Object.assign({},e),t),[e,t])},Qr="filemanager_sidebar_width",ei=()=>{const{options:e}=Br(),{customIcons:t}=e,n=(e,n,r)=>{const o=null==t?void 0:t[e];return o?i.createElement(o,r):i.createElement(n,r)};return{RootFolderIcon:e=>n("rootFolder",le,e),FolderIcon:e=>n("folder",le,e),FolderOpenIcon:e=>n("folderOpen",ve,e),AddFolderIcon:e=>n("addFolder",me,e),FileIcon:e=>n("file",ge,e),UploadIcon:e=>n("upload",pe,e),UploadByUrlIcon:e=>n("uploadByUrl",fe,e),ExpandArrowIcon:e=>n("expandArrow",de,e),CollapseArrowIcon:e=>n("collapseArrow",he,e),FolderPreviewIcon:e=>n("folderPreview",le,e),GridViewIcon:e=>n("gridView",ue,e),ListViewIcon:e=>n("listView",ce,e),getCustomIcon:n}};var ti={headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",paginationContainer:"paginationContainer",uploadZone:"uploadZone",active:"active",uploadIcon:"uploadIcon",uploadText:"uploadText",uploadSubtext:"uploadSubtext",tableContainer:"tableContainer",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileName:"fileName",fileNameClickable:"fileNameClickable",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",gridRow:"gridRow",gridCard:"gridCard",gridCardContent:"gridCardContent",gridCheckbox:"gridCheckbox",gridPreviewContainer:"gridPreviewContainer",gridPreviewContainerFolder:"gridPreviewContainerFolder",gridFolderIcon:"gridFolderIcon",gridFolderIconImage:"gridFolderIconImage",gridFileName:"gridFileName",gridFileInfo:"gridFileInfo",actionsBox:"actionsBox"};const{Option:ni}=F,ri=({files:r,handleSearch:i,handleSort:s,sortBy:l,sortOrder:h,handleSortOptionChange:d,pagination:f,setPagination:p,loading:g,handleItemClick:m,selectedFiles:v,toggleFileSelection:b,handleDroppedFiles:y,fileUpload:w})=>{const{t:x}=gr(),{FolderPreviewIcon:_}=ei(),{options:C}=Br(),{dataProviders:S}=C,{viewMode:A,setViewMode:k}=(()=>{const[e,t]=o(()=>{try{return localStorage.getItem(qr)||"table"}catch(e){return"table"}}),n=c(e=>{t(e);try{localStorage.setItem(qr,e)}catch(e){console.warn("Не удалось сохранить режим отображения:",e)}},[]),r=c(()=>{n("table"===e?"grid":"table")},[e,n]);return{viewMode:e,setViewMode:n,toggleViewMode:r}})(),[T,I]=o(!1),[O,E]=o({}),P=u(0),j=`${l}-${h}`,H=c(async e=>{try{if(null==S?void 0:S.getFiles){const{files:t,pagination:n}=await S.getFiles({folderId:"folders"===e?void 0:e});return(null==n?void 0:n.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return console.error(`Ошибка при получении количества файлов для папки ${e}:`,t),0}},[S]),W=c(async()=>{const e=r.filter(e=>e.isFolder);if(0===e.length)return;const t={},n=e.map(async e=>{t[e.id]=await H(e.id)});await Promise.all(n),E(t)},[r,H]);a(()=>{W()},[W]);const Y=c(e=>{e.preventDefault(),e.stopPropagation(),P.current+=1,e.dataTransfer.items&&e.dataTransfer.items.length>0&&I(!0)},[]),$=c(e=>{e.preventDefault(),e.stopPropagation(),P.current-=1,0===P.current&&I(!1)},[]),G=c(e=>{e.preventDefault(),e.stopPropagation()},[]),X=c(e=>{if(e.preventDefault(),e.stopPropagation(),I(!1),P.current=0,e.dataTransfer.files&&e.dataTransfer.files.length>0){const t=Array.from(e.dataTransfer.files);y(t).catch(e=>{console.error("Ошибка при загрузке файлов:",e),M.error("Произошла ошибка при загрузке файлов")})}},[y]),K=[{key:"selection",width:60,render:(t,n)=>e(R,{checked:v.has(n.id),onChange:()=>b(n.id)})},{key:"preview",width:100,render:(t,n)=>n.isFolder?e("div",{className:ti.fileManagerTableFolder,children:e("div",{className:ti.fileManagerTableFolderInner,children:e(_,{className:ti.tableFolderIcon})})}):e(Kr,{className:`${ti.imagePreview} ${ti.tableImagePreview}`,src:n.thumbnail||n.thumbnailUrl||n.url,alt:n.name,width:100,height:60,preview:!0,file:n})},{title:x("Name"),dataIndex:"name",key:"name",render:(e,n)=>{const r=n.isFolder&&O[n.id]||0,i=1===r?"item":"items";return t("div",{className:n.isFolder?ti.fileNameClickable:ti.fileName,children:[e||"Без названия",n.isFolder&&t("div",{className:ti.fileItemCount,children:[r," ",i]})]})}},{title:x("Dimensions"),key:"dimensions",width:100,render:(t,n)=>e("div",{className:ti.fileSize,children:n.isFolder?"Папка":n.dimensions||"600×300"})},{title:x("Size"),key:"size",width:100,render:(t,n)=>e("div",{className:ti.fileSize,children:n.isFolder?"-":`${n.size||350} КБ`})},{title:x("Date"),dataIndex:"date",key:"date",width:180,render:(t,n)=>{const r=function(e){const t=new Date(e);return!isNaN(t.getTime())}(n.date)?new Date(n.date):new Date;return e("div",{className:ti.fileDate,children:x("date_of_add",{date:(e=>`${e.getDate()} ${[x("months.january"),x("months.february"),x("months.march"),x("months.april"),x("months.may"),x("months.june"),x("months.july"),x("months.august"),x("months.september"),x("months.october"),x("months.november"),x("months.december")][e.getMonth()]} ${e.getFullYear()}`)(r)})})}}];return t("div",{className:"content-layout",onDragEnter:Y,onDragLeave:$,onDragOver:G,onDrop:X,children:[T&&t("div",{className:`${ti.uploadZone} ${T?ti.active:""}`,children:[e(Er,{className:ti.uploadIcon,customIcon:null==C?void 0:C.dragDropIcon}),e("div",{className:ti.uploadText,children:x("Drag files to upload")}),e("div",{className:ti.uploadSubtext,children:x("Drop files here to upload")})]}),e("h1",{children:"My files"}),t("div",{className:ti.headerContainer,children:[e("div",{className:"search-container",children:e(Or,{placeholder:x("Image search..."),onSearch:i,className:ti.searchInput})}),t("div",{className:ti.actionsBox,children:[t("div",{className:"sort-container",children:[e("div",{className:"sort-label",children:x("Sort by")}),t(F,{value:j,onChange:d,className:ti.sortSelect,popupMatchSelectWidth:!1,children:[e(ni,{value:"date-desc",children:x("Newest first")}),e(ni,{value:"date-asc",children:x("Oldest first")}),e(ni,{value:"size-desc",children:x("Largest first")}),e(ni,{value:"size-asc",children:x("Smallest first")}),e(ni,{value:"name-asc",children:x("A-Z")}),e(ni,{value:"name-desc",children:x("Z-A")}),e(ni,{value:"type-asc",children:x("By type")})]})]}),e("div",{className:ti.actionsContainer,children:e(D,{options:[{value:"grid",icon:e(ue,{})},{value:"table",icon:e(ce,{})}],value:A,onChange:e=>k(e)})})]})]}),e("div",{className:ti.filesContainer,children:t(n,"table"===A?{children:[g||r&&0!==r.length?e("div",{className:ti.tableContainer,children:e(N,{dataSource:r,columns:K,rowKey:"id",pagination:!1,loading:g,onRow:e=>({onClick:t=>{const n=t.target;n.closest(".ant-checkbox-wrapper")||n.closest(".ant-checkbox")||n.classList.contains("ant-checkbox-input")||m(e)}}),showHeader:!1})}):e(L,{description:x("No data to display"),style:{margin:"40px 0"}}),f.total>f.pageSize&&e("div",{className:ti.paginationContainer,children:e(z,{current:f.current,pageSize:f.pageSize,total:f.total,onChange:(e,t)=>p({current:e,pageSize:t,total:f.total}),showSizeChanger:!0,showTotal:e=>x("total pages",{total:e})})})]}:{children:[e(()=>r&&0!==r.length?e(B,{gutter:[16,16],className:ti.gridRow,style:{gap:32,padding:"0 16px 16px"},children:r.map(r=>e(V,{className:ti.gridCard_col,style:{padding:0},children:t(U,{hoverable:!0,cover:e("div",{className:r.isFolder?ti.gridPreviewContainerFolder:ti.gridPreviewContainer,onClick:e=>{e.stopPropagation(),r.isFolder&&m(r)},children:r.isFolder?e("div",{className:ti.gridFolderIcon,children:e(_,{className:ti.gridFolderIconImage})}):e(Kr,{src:r.thumbnail||r.thumbnailUrl||r.url,alt:r.name,className:ti.gridImagePreview,preview:!0,file:r})}),className:`${ti.gridCard} ${v.has(r.id)?ti.gridCardSelected:""}`,onClick:e=>{e.stopPropagation(),b(r.id)},children:[t("div",{className:ti.gridCardContent,children:[e("div",{className:ti.gridFileName,children:r.name||x("Untitled")}),e("div",{className:ti.gridFileInfo,children:r.isFolder?(()=>{const e=O[r.id]||0;return`${e} ${1===e?"item":"items"}`})():t(n,{children:[r.dimensions||"1440 × 900"," • ",r.size||"120.54 КБ"," • jpg"]})})]}),e("div",{onClick:e=>{e.stopPropagation()},className:ti.gridCheckbox,children:e(R,{checked:v.has(r.id),onChange:e=>{e.stopPropagation(),b(r.id)}})})]})},r.id))}):e(L,{description:x("No data to display"),style:{margin:"40px 0"}}),{}),f.total>f.pageSize&&e("div",{className:ti.paginationContainer,children:e(z,{current:f.current,pageSize:f.pageSize,total:f.total,onChange:(e,t)=>p({current:e,pageSize:t,total:f.total}),showSizeChanger:!0,showTotal:e=>x("total pages",{total:e})})})]})})]})},ii=({isModalVisible:r,handleModalOk:i,handleModalCancel:o,form:a,selectedFolder:s,folders:l,isUrlModalVisible:c,setIsUrlModalVisible:u,handleAddFileByUrl:h,urlForm:d,isRenameModalVisible:f,handleRenameOk:p,handleRenameCancel:g,renameForm:m,fileToRename:v,files:b,isMoveModalVisible:y,handleMoveOk:w,handleMoveCancel:x,moveForm:_,selectedFiles:C,isRenameFolderModalVisible:S,handleRenameFolderOk:A,handleRenameFolderCancel:k,renameFolderForm:T,folderToRename:I,isCopyModalVisible:O,handleCopyOk:M,handleCopyCancel:j,copyForm:F,isDeleteConfirmVisible:R,handleDeleteConfirmOk:D,handleDeleteConfirmCancel:L})=>{var N,z,B;const{t:V}=gr(),U=Array.isArray(b)?b:[],Y=v?null===(N=U.find(e=>e.id===v))||void 0===N?void 0:N.name:"",$=Array.isArray(l)?l:[],G=I?null===(z=$.find(e=>e.id===I))||void 0===z?void 0:z.name:"",X=v?U.find(e=>e.id===v):null,K=(null==X?void 0:X.isFolder)||(null==v?void 0:v.startsWith("folder_")),q=()=>{const t=(n=null,r=new Set)=>l.filter(e=>{const t=null===n&&!e.parentId,r=e.parentId===n;return t||r}).map(n=>{if(r.has(n.id))return{key:n.id,title:`${n.name} (циклическая ссылка)`,icon:e(le,{style:{color:"red"}}),disabled:!0,isLeaf:!0};const i=Array.from(C).includes(n.id),o=new Set(r);o.add(n.id);const a=t(n.id,o);return{key:n.id,title:n.name,icon:e(le,{}),disabled:i,children:a.length>0?a:void 0,isLeaf:0===a.length}}),n=t();return[{key:"root",title:V("Folders"),icon:e(le,{}),children:n}]};return t(n,{children:[e(H,{title:e("div",{className:"modal-title",children:V("Creating a new folder")}),open:r,onOk:i,onCancel:o,okText:V("Create"),cancelText:V("Cancel"),children:t(P,{form:a,layout:"vertical",children:[e(P.Item,{name:"folderName",label:e("div",{className:"form-label",children:V("Folder name")}),rules:[{required:!0,message:V("Enter the name of the folder")}],initialValue:V("New folder"),className:"form-item",children:e(E,{autoFocus:!0,className:"form-input"})}),e("div",{children:s&&"folders"!==s?t("p",{children:[V("A folder will be created inside:")," ",(null===(B=$.find(e=>e.id===s))||void 0===B?void 0:B.name)||V("selected folder")]}):e("p",{children:V("The folder will be created in the root directory")})})]})}),e(H,{title:e("div",{className:"modal-title",children:V("Upload image by URL")}),open:c,onOk:()=>h(null),onCancel:()=>u(!1),okText:V("Download"),cancelText:V("Cancel"),children:t(P,{form:d,layout:"vertical",children:[e(P.Item,{name:"fileUrl",label:e("div",{className:"form-label",children:V("image URL")}),rules:[{required:!0,message:V("Enter the URL of the image")}],className:"form-item",children:e(E,{autoFocus:!0,placeholder:"https://example.com/image.jpg",className:"form-input"})}),e("p",{children:V("Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP")})]})}),e(H,{title:e("div",{className:"modal-title",children:K?`${V("Rename folder")} ${Y}`:V("Rename file",{currentFileName:Y})}),open:f,onOk:p,onCancel:g,okText:V("Rename"),cancelText:V("Cancel"),children:e(P,{form:m,layout:"vertical",children:e(P.Item,{name:"newFileName",label:e("div",{className:"form-label",children:V(K?"New folder name":"New file name")}),rules:[{required:!0,message:V(K?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:e(E,{autoFocus:!0,className:"form-input"})})})}),e(H,{title:e("div",{className:"modal-title",children:V("Move to folder")}),open:y,onOk:w,onCancel:x,okText:"Переместить",cancelText:V("Cancel"),children:t(P,{form:_,layout:"vertical",children:[e("div",{className:"file-name-label",children:V("Selected files:",{count:C.size})}),e(P.Item,{name:"targetFolder",label:e("div",{className:"form-label",children:V("Select the destination folder")}),rules:[{required:!0,message:V("Select the destination folder")}],className:"form-item",children:e(W,{defaultExpandAll:!0,treeData:q(),selectable:!0,onSelect:e=>{e.length>0&&_.setFieldsValue({targetFolder:e[0]})}})})]})}),e(H,{title:t("div",{className:"modal-title",children:[V("Rename folder")," ",G]}),open:S,onOk:A,onCancel:k,okText:V("Rename"),cancelText:V("Cancel"),children:e(P,{form:T,layout:"vertical",children:e(P.Item,{name:"newFolderName",label:e("div",{className:"form-label",children:V("New folder name")}),rules:[{required:!0,message:V("Enter a new folder name")}],className:"form-item",children:e(E,{autoFocus:!0,className:"form-input"})})})}),e(H,{title:e("div",{className:"modal-title",children:V("Copy to folder")}),open:O,onOk:M,onCancel:j,okText:V("Copy"),cancelText:V("Cancel"),children:t(P,{form:F,layout:"vertical",children:[e("div",{className:"file-name-label",children:V("Selected files:",{count:C.size})}),e(P.Item,{name:"targetFolder",label:e("div",{className:"form-label",children:V("Select the destination folder")}),rules:[{required:!0,message:V("Select the destination folder")}],className:"form-item",children:e(W,{defaultExpandAll:!0,treeData:q(),selectable:!0,onSelect:e=>{e.length>0&&F.setFieldsValue({targetFolder:e[0]})}})})]})}),e(H,{title:e("div",{className:"modal-title",children:V("Confirm deletion")}),open:!!R,onOk:()=>D&&D(),onCancel:()=>L&&L(),okText:V("Delete"),cancelText:V("Cancel"),okButtonProps:{danger:!0},children:e("div",{children:V("Are you sure you want to delete the selected items?")})})]})},oi=e=>{const{state:t,actions:n,options:r}=Br(),{t:i}=gr(),{folders:o,folderToRename:a,renameFolderForm:s,isRenameFolderModalVisible:l}=t,{setFolderToRename:u,setIsRenameFolderModalVisible:h}=n,{apiEndpoints:d,dataProviders:f}=r,p=c(e=>{null==u||u(e),null==h||h(!0);const t=null==o?void 0:o.find(t=>t.id===e);t&&s&&s.setFieldsValue({newFolderName:t.name})},[u,h,o,s]),g=c(()=>{null==h||h(!1),null==u||u(null),null==s||s.resetFields()},[h,u,s]),m=c(async()=>{if(a&&s)try{const t=await s.validateFields();if(!(null==t?void 0:t.newFolderName))return;if(!(null==f?void 0:f.renameFolder))return void M.error("DataProvider для переименования папок не настроен");const r=await f.renameFolder(a,t.newFolderName.trim());if(!(null==r?void 0:r.id))return void M.error("Некорректный ответ при переименовании папки");M.success(`${i("Folder renamed to")} ${t.newFolderName}`),g(),await e(),a!==r.id&&n.setSelectedFolder&&n.setSelectedFolder(r.id)}catch(e){console.error("Ошибка при переименовании папки:",e),M.error("Ошибка при переименовании папки")}},[a,s,d,g,e,i]);return{state:{isRenamingFolder:l||!1,folderToRename:a},actions:{showRenameFolderModal:p,handleRenameFolderCancel:g,handleRenameFolderOk:m}}},ai=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),si=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),li=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),ci=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),ui=()=>e("svg",{width:"20",height:"20",style:{verticalAlign:"-0.35em",marginRight:10},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M7.49984 11.668H15.8332L12.9582 7.91797L11.0415 10.418L9.74984 8.7513L7.49984 11.668ZM6.6665 15.0013C6.20817 15.0013 5.81581 14.8381 5.48942 14.5117C5.16303 14.1853 4.99984 13.793 4.99984 13.3346V3.33464C4.99984 2.8763 5.16303 2.48394 5.48942 2.15755C5.81581 1.83116 6.20817 1.66797 6.6665 1.66797H16.6665C17.1248 1.66797 17.5172 1.83116 17.8436 2.15755C18.17 2.48394 18.3332 2.8763 18.3332 3.33464V13.3346C18.3332 13.793 18.17 14.1853 17.8436 14.5117C17.5172 14.8381 17.1248 15.0013 16.6665 15.0013H6.6665ZM6.6665 13.3346H16.6665V3.33464H6.6665V13.3346ZM3.33317 18.3346C2.87484 18.3346 2.48248 18.1714 2.15609 17.8451C1.8297 17.5187 1.6665 17.1263 1.6665 16.668V5.0013H3.33317V16.668H14.9998V18.3346H3.33317Z",fill:"currentColor"})}),hi=()=>e("svg",{width:"20",height:"20",style:{verticalAlign:"-0.35em",marginRight:10},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M3.33317 14.1654C2.87484 14.1654 2.48248 14.0022 2.15609 13.6758C1.8297 13.3494 1.6665 12.957 1.6665 12.4987V7.4987C1.6665 7.04036 1.8297 6.648 2.15609 6.32161C2.48248 5.99523 2.87484 5.83203 3.33317 5.83203H6.6665C7.12484 5.83203 7.5172 5.99523 7.84359 6.32161C8.16998 6.648 8.33317 7.04036 8.33317 7.4987H3.33317V12.4987H6.6665V10.832H4.99984V9.16536H8.33317V12.4987C8.33317 12.957 8.16998 13.3494 7.84359 13.6758C7.5172 14.0022 7.12484 14.1654 6.6665 14.1654H3.33317ZM9.99984 14.1654V5.83203H11.6665V14.1654H9.99984ZM13.3332 14.1654V5.83203H19.1665V7.4987H14.9998V9.16536H18.3332V10.832H14.9998V14.1654H13.3332Z",fill:"currentColor"})}),di=()=>e("svg",{width:"20",height:"20",style:{verticalAlign:"-0.35em",marginRight:10},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M0.833496 15.8346V4.16797H2.50016V15.8346H0.833496ZM4.16683 15.8346V4.16797H5.8335V15.8346H4.16683ZM9.16683 15.8346C8.7085 15.8346 8.31614 15.6714 7.98975 15.3451C7.66336 15.0187 7.50016 14.6263 7.50016 14.168V5.83464C7.50016 5.3763 7.66336 4.98394 7.98975 4.65755C8.31614 4.33116 8.7085 4.16797 9.16683 4.16797H17.5002C17.9585 4.16797 18.3509 4.33116 18.6772 4.65755C19.0036 4.98394 19.1668 5.3763 19.1668 5.83464V14.168C19.1668 14.6263 19.0036 15.0187 18.6772 15.3451C18.3509 15.6714 17.9585 15.8346 17.5002 15.8346H9.16683ZM9.16683 14.168H17.5002V5.83464H9.16683V14.168ZM10.0002 12.5013H16.6668L14.5002 9.58464L12.9168 11.668L11.7502 10.1263L10.0002 12.5013Z",fill:"currentColor"})}),fi=()=>t("svg",{width:"20",height:"20",style:{verticalAlign:"-0.35em",marginRight:10},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M5.9471 17.4987C5.9471 17.4987 5.5606 15.9327 4.87018 15.2423C4.17976 14.5519 2.61377 14.1653 2.61377 14.1653C2.61377 14.1653 4.17976 13.7788 4.87018 13.0884C5.5606 12.398 5.9471 10.832 5.9471 10.832C5.9471 10.832 6.3336 12.398 7.02402 13.0884C7.71443 13.7788 9.28044 14.1653 9.28044 14.1653C9.28044 14.1653 7.71443 14.5519 7.02402 15.2423C6.3336 15.9327 5.9471 17.4987 5.9471 17.4987Z",fill:"currentColor"}),e("path",{d:"M13.0304 14.9987C13.0304 14.9987 12.4024 12.2582 11.2804 11.05C10.1585 9.84174 7.61377 9.16536 7.61377 9.16536C7.61377 9.16536 10.1585 8.48899 11.2804 7.28074C12.4024 6.07251 13.0304 3.33203 13.0304 3.33203C13.0304 3.33203 13.6585 6.07251 14.7804 7.28074C15.9023 8.48899 18.4471 9.16536 18.4471 9.16536C18.4471 9.16536 15.9023 9.84174 14.7804 11.05C13.6585 12.2582 13.0304 14.9987 13.0304 14.9987Z",fill:"currentColor"}),e("path",{d:"M4.6971 7.4987C4.6971 7.4987 4.45554 6.51995 4.02402 6.08844C3.59251 5.65693 2.61377 5.41537 2.61377 5.41537C2.61377 5.41537 3.59251 5.1738 4.02402 4.74228C4.45554 4.31077 4.6971 3.33203 4.6971 3.33203C4.6971 3.33203 4.93866 4.31077 5.37017 4.74228C5.80169 5.1738 6.78044 5.41537 6.78044 5.41537C6.78044 5.41537 5.80169 5.65693 5.37017 6.08844C4.93866 6.51995 4.6971 7.4987 4.6971 7.4987Z",fill:"currentColor"}),e("path",{d:"M15.947 17.5C15.947 17.5 15.7536 16.9127 15.4085 16.6538C15.0633 16.395 14.2803 16.25 14.2803 16.25C14.2803 16.25 15.0633 16.105 15.4085 15.8461C15.7536 15.5872 15.947 15 15.947 15C15.947 15 16.1402 15.5872 16.4854 15.8461C16.8306 16.105 17.6136 16.25 17.6136 16.25C17.6136 16.25 16.8306 16.395 16.4854 16.6538C16.1402 16.9127 15.947 17.5 15.947 17.5Z",fill:"currentColor"})]}),pi=()=>t("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[e("path",{d:"M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"}),e("path",{d:"M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"}),e("path",{d:"M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"}),e("path",{d:"M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"})]}),gi=t=>e(ae,Object.assign({component:ai},t)),mi=t=>e(ae,Object.assign({component:si},t)),vi=t=>e(ae,Object.assign({component:li},t)),bi=t=>e(ae,Object.assign({component:ci},t)),yi=t=>e(ae,Object.assign({component:fi},t)),wi=t=>e(ae,Object.assign({component:pi},t)),xi=t=>e(ae,Object.assign({component:di},t)),_i=t=>e(ae,Object.assign({component:hi},t)),Ci=t=>e(ae,Object.assign({component:ui},t));var Si={button:"button",foldersTitle:"foldersTitle",folderActions:"folderActions",fileCount:"fileCount",uploadButton:"uploadButton",folderMenu:"folderMenu",folderIcon:"folderIcon",folderLabelItem:"folderLabelItem",foldersTitleItem:"foldersTitleItem",folderLabel:"folderLabel",foldersContainer:"foldersContainer",divider:"divider"};const Ai=f(p(({selectedFolder:n,generateMenuItems:r,onFolderSelect:i,folders:s,fetchFolders:l,handleAddFile:u,setIsUrlModalVisible:d,handleCreateFolder:f,activeLibraryItem:p,setActiveLibraryItem:m},v)=>{const b=Array.isArray(s)?s:[],{t:y}=gr(),[w,x]=o({}),{options:_}=Br(),{dataProviders:C,config:S}=_,A=oi(l),{FolderIcon:k,AddFolderIcon:T,UploadByUrlIcon:I,ExpandArrowIcon:O,CollapseArrowIcon:E}=ei(),P=c(e=>{const t=["folders"],n=e=>{e.forEach(e=>{t.push(e.key),e.children&&n(e.children)})};return n(e),t},[]),[M,j]=o(()=>{const e=r();return P(e)});a(()=>{const e=r(),t=P(e);j(t)},[b,r,P]);const F=c(async e=>{try{if(null==C?void 0:C.getFiles){const{files:t,pagination:n}=await C.getFiles({folderId:"folders"===e?void 0:e});return(null==n?void 0:n.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return console.error(`Ошибка при получении количества файлов для папки ${e}:`,t),0}},[C]),R=c(async()=>{if(0===b.length)return;const e={};e.folders=await F("folders");const t=b.map(async t=>{const n=await F(t.id);e[t.id]=n});await Promise.all(t),x(e)},[b,F]),D=c(async e=>{const t=await F(e);x(n=>Object.assign(Object.assign({},n),{[e]:t}))},[F]);g(v,()=>({refreshFileCounts:R}),[R]),a(()=>{R()},[R]);const N=c(async()=>{await u(),n?await D(n):await D("folders")},[u,n,D]),z=h(()=>({items:[{key:"upload-url",label:y("Upload image by URL"),icon:e(I,{}),onClick:()=>null==d?void 0:d(!0)}]}),[I,d,y]),B=[{key:Pr,label:y("My files"),icon:e(Ci,{})},{key:Mr,label:y("GIF"),icon:e(_i,{})},{key:jr,label:y("Stock images"),icon:e(xi,{})},{key:Fr,label:y("AI"),icon:e(yi,{}),disabled:!(null==S?void 0:S.sseQuery)}],V=c(e=>{const t=e[0];t&&"empty"!==t&&(p!==Pr&&m(Pr),null==i||i(t))},[i,p,m]),U=c(({key:e})=>{console.log("key",e),m(e)},[m]),H=c(e=>{j(e)},[]),K=c(()=>{var n;const i=r();if(0===i.length||1===i.length&&(!i[0].children||0===i[0].children.length))return[{key:"empty",title:e("div",{className:Si.emptyFolderContainer,children:e(L,{image:L.PRESENTED_IMAGE_SIMPLE,description:"Нет доступных папок"})})}];const o=n=>{var r;const i=b.find(e=>e.id===n.key),a=w[n.key]||0,s={items:[{key:"rename",label:y("Rename"),icon:e(ye,{}),onClick:e=>{i&&e.domEvent&&(e.domEvent.stopPropagation(),A.actions.showRenameFolderModal(i.id))}}]},l=e(Y,{menu:s,trigger:["contextMenu"],children:t("div",{className:"folder-item-container",children:[t("div",{className:Si.folderLabel,children:[e(k,{className:Si.folderIcon}),e("span",{className:Si.folderLabelItem,children:n.label})]}),e("div",{className:Si.fileCount,title:`${a} ${1===a?"файл":"файлов"}`,children:a})]})});return{key:n.key,title:l,children:null===(r=n.children)||void 0===r?void 0:r.map(o)}},a=e("div",{className:Si.foldersTitle,children:t("div",{className:Si.foldersTitleItem,children:[e(ve,{className:Si.folderIcon}),e("span",{className:Si.folderLabelItem,children:y("Folders")})]})});return i.length>0&&"folders"===i[0].key?[{key:"folders",title:a,children:null===(n=i[0].children)||void 0===n?void 0:n.map(o)}]:i.map(o)},[r,y,b,w,k,A.actions]),q=h(()=>K(),[K]);return t("div",{className:"sidebar-container",children:[t(Y.Button,{type:"primary",size:"large",icon:e(E,{}),onClick:N,menu:z,className:Si.uploadButton,children:[e(be,{})," ",e("span",{className:"",children:y("Upload image")})]}),e("div",{className:"sidebar__sections-title",children:y("Library")}),e($,{className:"folder-menu",items:B,defaultSelectedKeys:[Pr],onSelect:({key:e})=>U({key:e}),selectedKeys:[p]}),e(G,{className:Si.divider}),t("div",{className:Si.foldersContainer,children:[e(W,{className:`${Si.folderMenu} folder-tree`,selectedKeys:n?[n]:["folders"],expandedKeys:M,onSelect:V,onExpand:H,treeData:q,switcherIcon:({expanded:t})=>e(t?E:O,{}),showLine:!1}),e("div",{className:Si.folderActions,children:e(X,{onClick:e=>{e.stopPropagation(),f()},className:Si.button,icon:e(T,{}),size:"middle"})})]})]})}));Ai.displayName="FolderSidebar";var ki=Object.defineProperty,Ti=(e,t,n)=>(((e,t,n)=>{t in e?ki(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),Ii=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ei(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Pi=function(e){return!(t=e,!t||"object"!=typeof t||function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Mi}(e)}(e));var t};var Mi="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function ji(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Ni(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function Fi(e,t,n){return e.concat(t).map(function(e){return ji(e,n)})}function Ri(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function Di(e,t){try{return t in e}catch{return!1}}function Li(e,t,n){var r={};return n.isMergeableObject(e)&&Ri(e).forEach(function(t){r[t]=ji(e[t],n)}),Ri(t).forEach(function(i){(function(e,t){return Di(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(Di(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Ni;var n=t.customMerge(e);return"function"==typeof n?n:Ni}(i,n)(e[i],t[i],n):r[i]=ji(t[i],n))}),r}function Ni(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Fi,n.isMergeableObject=n.isMergeableObject||Pi,n.cloneUnlessOtherwiseSpecified=ji;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Li(e,t,n):ji(t,n)}Ni.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return Ni(e,n,t)},{})};var zi=Ni;function Bi(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function Vi(e){var t=e.toString().split(/[eE]/),n=(t[0].split(".")[1]||"").length-+(t[1]||0);return n>0?n:0}function Ui(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=Vi(e);return t>0?Bi(Number(e)*Math.pow(10,t)):Number(e)}function Hi(e){Gi&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&console.warn(e+" is beyond boundary when transfer to integer, the results may not be accurate")}function Wi(e,t){var n=e[0],r=e[1],i=e.slice(2),o=t(n,r);return i.forEach(function(e){o=t(o,e)}),o}function Yi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length>2)return Wi(e,Yi);var n=e[0],r=e[1],i=Ui(n),o=Ui(r),a=Vi(n)+Vi(r),s=i*o;return Hi(s),s/Math.pow(10,a)}function $i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length>2)return Wi(e,$i);var n=e[0],r=e[1],i=Ui(n),o=Ui(r);return Hi(i),Hi(o),Yi(i/o,Bi(Math.pow(10,Vi(r)-Vi(n))))}var Gi=!0;var Xi={strip:Bi,plus:function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length>2)return Wi(t,e);var r=t[0],i=t[1],o=Math.pow(10,Math.max(Vi(r),Vi(i)));return(Yi(r,o)+Yi(i,o))/o},minus:function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length>2)return Wi(t,e);var r=t[0],i=t[1],o=Math.pow(10,Math.max(Vi(r),Vi(i)));return(Yi(r,o)-Yi(i,o))/o},times:Yi,divide:$i,round:function(e,t){var n=Math.pow(10,t),r=$i(Math.round(Math.abs(Yi(e,n))),n);return e<0&&0!==r&&(r=Yi(r,-1)),r},digitLength:Vi,float2Fixed:Ui,enableBoundaryChecking:function(e){void 0===e&&(e=!0),Gi=e}};function Ki(e){return e&&e.Math==Math?e:void 0}var qi="object"==typeof globalThis&&Ki(globalThis)||"object"==typeof window&&Ki(window)||"object"==typeof self&&Ki(self)||"object"==typeof global&&Ki(global)||function(){return this}()||{};function Zi(){return qi}function Ji(e,t,n){var r=n||qi,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}var Qi=Object.prototype.toString;function eo(e){switch(Qi.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return co(e,Error)}}function to(e,t){return Qi.call(e)===`[object ${t}]`}function no(e){return to(e,"ErrorEvent")}function ro(e){return to(e,"DOMError")}function io(e){return to(e,"String")}function oo(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function ao(e){return to(e,"Object")}function so(e){return typeof Event<"u"&&co(e,Event)}function lo(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function co(e,t){try{return e instanceof t}catch{return!1}}function uo(e,t){try{let r=e;var n=[];let i=0,o=0;let a;for(;r&&i++<5&&(a=ho(r,t),!("html"===a||i>1&&o+3*n.length+a.length>=80));)n.push(a),o+=a.length,r=r.parentNode;return n.reverse().join(" > ")}catch{return"<unknown>"}}function ho(e,t){var n=e,r=[];let i,o,a,s,l;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());var c=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(c&&c.length)c.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&io(i))for(o=i.split(/\s+/),l=0;l<o.length;l++)r.push(`.${o[l]}`);var u=["type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}class fo extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}var po=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function go(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${a}`}function mo(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function vo(e){var t="string"==typeof e?function(e){var t=po.exec(e);if(!t)throw new fo(`Invalid Sentry Dsn: ${e}`);const[n,r,i="",o,a="",s]=t.slice(1);let l="",c=s;var u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){var h=c.match(/^\d+/);h&&(c=h[0])}return mo({host:o,pass:i,path:l,projectId:c,port:a,protocol:n,publicKey:r})}(e):mo(e);return function(e){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return;const{port:t,projectId:n,protocol:r}=e;if(["protocol","publicKey","host","projectId"].forEach(t=>{if(!e[t])throw new fo(`Invalid Sentry Dsn: ${t} missing`)}),!n.match(/^\d+$/))throw new fo(`Invalid Sentry Dsn: Invalid projectId ${n}`);if(!function(e){return"http"===e||"https"===e}(r))throw new fo(`Invalid Sentry Dsn: Invalid protocol ${r}`);if(t&&isNaN(parseInt(t,10)))throw new fo(`Invalid Sentry Dsn: Invalid port ${t}`)}(t),t}var bo=Zi(),yo=["debug","info","warn","error","log","assert","trace"];function wo(e){var t=Zi();if(!("console"in t))return e();var n=t.console,r={};yo.forEach(e=>{var i=n[e]&&n[e].__sentry_original__;e in t.console&&i&&(r[e]=n[e],n[e]=i)});try{return e()}finally{Object.keys(r).forEach(e=>{n[e]=r[e]})}}function xo(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?yo.forEach(n=>{t[n]=(...t)=>{e&&wo(()=>{bo.console[n](`Sentry Logger [${n}]:`,...t)})}}):yo.forEach(e=>{t[e]=()=>{}}),t}let _o;function Co(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.substr(0,t)}...`}function So(e,t){if(!Array.isArray(e))return"";var n=[];for(let t=0;t<e.length;t++){var r=e[t];try{n.push(String(r))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Ao(e,t){return!!io(e)&&(function(e){return to(e,"RegExp")}(t)?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function ko(e,t,n){if(t in e){var r=e[t],i=n(r);if("function"==typeof i)try{Io(i,r)}catch{}e[t]=i}}function To(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function Io(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,To(e,"__sentry_original__",t)}function Oo(e){return e.__sentry_original__}function Eo(e){if(eo(e))return{message:e.message,name:e.name,stack:e.stack,...Mo(e)};if(so(e)){var t={type:e.type,target:Po(e.target),currentTarget:Po(e.currentTarget),...Mo(e)};return typeof CustomEvent<"u"&&co(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Po(e){try{return function(e){return typeof Element<"u"&&co(e,Element)}(e)?uo(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Mo(e){if("object"==typeof e&&null!==e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function jo(e,t=40){var n=Object.keys(Eo(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Co(n[0],t);for(let e=n.length;e>0;e--){var r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:Co(r,t)}return""}function Fo(e){return Ro(e,new Map)}function Ro(e,t){if(ao(e)){if(void 0!==(i=t.get(e)))return i;var n={};for(var r of(t.set(e,n),Object.keys(e)))typeof e[r]<"u"&&(n[r]=Ro(e[r],t));return n}if(Array.isArray(e)){var i;if(void 0!==(i=t.get(e)))return i;n=[];return t.set(e,n),e.forEach(e=>{n.push(Ro(e,t))}),n}return e}_o=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Ji("logger",xo):xo();function Do(...e){var t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0)=>{var r=[];for(var i of e.split("\n").slice(n)){var o=i.replace(/\(error: (.*)\)/,"$1");for(var a of t){var s=a(o);if(s){r.push(s);break}}}return function(e){if(!e.length)return[];let t=e;var n=t[0].function||"",r=t[t.length-1].function||"";return(-1!==n.indexOf("captureMessage")||-1!==n.indexOf("captureException"))&&(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map(e=>({...e,filename:e.filename||t[0].filename,function:e.function||"?"})).reverse()}(r)}}function Lo(e){return Array.isArray(e)?Do(...e):e}var No="<anonymous>";function zo(e){try{return e&&"function"==typeof e&&e.name||No}catch{return No}}function Bo(){if(!("fetch"in Zi()))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Vo(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}var Uo=Zi(),Ho={},Wo={};function Yo(e){if(!Wo[e])switch(Wo[e]=!0,e){case"console":"console"in Uo&&yo.forEach(function(e){e in Uo.console&&ko(Uo.console,e,function(t){return function(...n){Go("console",{args:n,level:e}),t&&t.apply(Uo.console,n)}})});break;case"dom":!function(){if("document"in Uo){var e=Go.bind(null,"dom"),t=ea(e,!0);Uo.document.addEventListener("click",t,!1),Uo.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{var n=Uo[t]&&Uo[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(ko(n,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{var o=this,a=o.__sentry_instrumentation_handlers__=o.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var l=ea(e);s.handler=l,t.call(this,n,l,i)}s.refCount+=1}catch{}return t.call(this,n,r,i)}}),ko(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var i=this,o=i.__sentry_instrumentation_handlers__||{},a=o[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete i.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}}();break;case"xhr":!function(){if("XMLHttpRequest"in Uo){var e=XMLHttpRequest.prototype;ko(e,"open",function(e){return function(...t){var n=this,r=t[1],i=n.__sentry_xhr__={method:io(t[0])?t[0].toUpperCase():t[0],url:t[1]};io(r)&&"POST"===i.method&&r.match(/sentry_key/)&&(n.__sentry_own_request__=!0);var o=function(){if(4===n.readyState){try{i.status_code=n.status}catch{}Go("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?ko(n,"onreadystatechange",function(e){return function(...t){return o(),e.apply(n,t)}}):n.addEventListener("readystatechange",o),e.apply(n,t)}}),ko(e,"send",function(e){return function(...t){return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),Go("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}}();break;case"fetch":!function(){if(!Bo())return!1;var e=Zi();if(Vo(e.fetch))return!0;let t=!1;var n=e.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=Vo(r.contentWindow.fetch)),n.head.removeChild(r)}catch(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}()||ko(Uo,"fetch",function(e){return function(...t){var n={args:t,fetchData:{method:Xo(t),url:Ko(t)},startTimestamp:Date.now()};return Go("fetch",{...n}),e.apply(Uo,t).then(e=>(Go("fetch",{...n,endTimestamp:Date.now(),response:e}),e),e=>{throw Go("fetch",{...n,endTimestamp:Date.now(),error:e}),e})}});break;case"history":!function(){if(!function(){var e=Zi(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}())return;var e=Uo.onpopstate;function t(e){return function(...t){var n=t.length>2?t[2]:void 0;if(n){var r=qo,i=String(n);qo=i,Go("history",{from:r,to:i})}return e.apply(this,t)}}Uo.onpopstate=function(...t){var n=Uo.location.href,r=qo;if(qo=n,Go("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch{}},ko(Uo.history,"pushState",t),ko(Uo.history,"replaceState",t)}();break;case"error":ta=Uo.onerror,Uo.onerror=function(e,t,n,r,i){return Go("error",{column:r,error:i,line:n,msg:e,url:t}),!!ta&&ta.apply(this,arguments)};break;case"unhandledrejection":na=Uo.onunhandledrejection,Uo.onunhandledrejection=function(e){return Go("unhandledrejection",e),!na||na.apply(this,arguments)};break;default:return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("unknown instrumentation type:",e))}}function $o(e,t){Ho[e]=Ho[e]||[],Ho[e].push(t),Yo(e)}function Go(e,t){if(e&&Ho[e])for(var n of Ho[e]||[])try{n(t)}catch(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${zo(n)}\nError:`,t)}}function Xo(e=[]){return"Request"in Uo&&co(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function Ko(e=[]){return"string"==typeof e[0]?e[0]:"Request"in Uo&&co(e[0],Request)?e[0].url:String(e[0])}let qo;var Zo=1e3;let Jo,Qo;function ea(e,t=!1){return n=>{if(n&&Qo!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch{}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===Jo||function(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch{}return!1}(Qo,n))&&(e({event:n,name:r,global:t}),Qo=n),clearTimeout(Jo),Jo=Uo.setTimeout(()=>{Jo=void 0},Zo)}}}let ta=null;let na=null;function ra(){var e=Zi(),t=e.crypto||e.msCrypto;if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");var n=t&&t.getRandomValues?()=>t.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function ia(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function oa(e){const{message:t,event_id:n}=e;if(t)return t;var r=ia(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function aa(e,t,n){var r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type="Error")}function sa(e,t){var n=ia(e);if(n){var r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){var i={...r&&r.data,...t.data};n.mechanism.data=i}}}function la(e){if(e&&e.__sentry_captured__)return!0;try{To(e,"__sentry_captured__",!0)}catch{}return!1}function ca(e){return Array.isArray(e)?e:[e]}function ua(){return!(typeof __SENTRY_BROWSER_BUNDLE__<"u"&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call(typeof process<"u"?process:0)}function ha(e,t=1/0,n=1/0){try{return fa("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function da(e,t=3,n=102400){var r=ha(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(r)>n?da(e,t-1,n):r}function fa(e,t,n=1/0,r=1/0,i=function(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[o,a]=i;if(null===t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;var s=function(e,t){try{return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":typeof global<"u"&&t===global?"[Global]":typeof window<"u"&&t===window?"[Window]":typeof document<"u"&&t===document?"[Document]":function(e){return ao(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t)?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?`[Function: ${zo(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${Object.getPrototypeOf(t).constructor.name}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;if(0===n)return s.replace("object ","");if(o(t))return"[Circular ~]";var l=t;if(l&&"function"==typeof l.toJSON)try{return fa("",l.toJSON(),n-1,r,i)}catch{}var c=Array.isArray(t)?[]:{};let u=0;var h=Eo(t);for(var d in h)if(Object.prototype.hasOwnProperty.call(h,d)){if(u>=r){c[d]="[MaxProperties ~]";break}var f=h[d];c[d]=fa(d,f,n-1,r,i),u+=1}return a(t),c}var pa;function ga(e){return new va(t=>{t(e)})}function ma(e){return new va((t,n)=>{n(e)})}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(pa||(pa={}));class va{__init(){this._state=pa.PENDING}__init2(){this._handlers=[]}constructor(e){va.prototype.__init.call(this),va.prototype.__init2.call(this),va.prototype.__init3.call(this),va.prototype.__init4.call(this),va.prototype.__init5.call(this),va.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new va((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new va((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{i?n(r):t(r)})})}__init3(){this._resolve=e=>{this._setResult(pa.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(pa.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{if(this._state===pa.PENDING){if(lo(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init6(){this._executeHandlers=()=>{if(this._state!==pa.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===pa.RESOLVED&&e[1](this._value),this._state===pa.REJECTED&&e[2](this._value),e[0]=!0)})}}}}function ba(e){var t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return ma(new fo("Not adding Promise because buffer limit was reached."));var i=r();return-1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new va((n,r)=>{let i=t.length;if(!i)return n(!0);var o=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{ga(e).then(()=>{--i||(clearTimeout(o),n(!0))},r)})})}}}function ya(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}var wa=["fatal","error","warning","log","info","debug"];function xa(e){return"warn"===e?"warning":wa.includes(e)?e:"log"}var _a={nowSeconds:()=>Date.now()/1e3};var Ca=ua()?function(){try{return function(e,t){return e.require(t)}(module,"perf_hooks").performance}catch{return}}():function(){const{performance:e}=Zi();if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),Sa=void 0===Ca?_a:{nowSeconds:()=>(Ca.timeOrigin+Ca.now())/1e3},Aa=_a.nowSeconds.bind(_a),ka=Sa.nowSeconds.bind(Sa);function Ta(e,t=[]){return[e,t]}function Ia(e,t){const[n,r]=e;return[n,[...r,t]]}function Oa(e,t){e[1].forEach(e=>{var n=e[0].type;t(e,n)})}function Ea(e,t){return(t||new TextEncoder).encode(e)}function Pa(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[Ea(i,t),e]:i.push("string"==typeof e?Ea(e,t):e)}for(var a of r){const[e,t]=a;o(`\n${JSON.stringify(e)}\n`),o("string"==typeof t||t instanceof Uint8Array?t:JSON.stringify(t))}return"string"==typeof i?i:function(e){var t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(var i of e)n.set(i,r),r+=i.length;return n}(i)}function Ma(e,t){var n="string"==typeof e.data?Ea(e.data,t):e.data;return[Fo({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=Zi();if(e&&e.now){var t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=i<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(o||s<t)&&(i<=s&&e.timeOrigin)}})();var ja={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function Fa(e){return ja[e]}function Ra(e,{statusCode:t,headers:n},r=Date.now()){var i={...e},o=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(o)for(var s of o.trim().split(",")){const[e,t]=s.split(":",2);var l=parseInt(e,10),c=1e3*(isNaN(l)?60:l);if(t)for(var u of t.split(";"))i[u]=r+c;else i.all=r+c}else a?i.all=r+function(e,t=Date.now()){var n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(i.all=r+6e4);return i}function Da(e){var t=ka(),n={sid:ra(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Fo({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&La(n,e),n}function La(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||ka(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ra()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{var n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class Na{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){var t=new Na;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&La(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){var t=e(this);return t instanceof Na?t:this}return e instanceof Na?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):ao(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r={timestamp:Aa(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags={transaction:n,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...za(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,n,r=0){return new va((i,o)=>{var a=e[r];if(null===t||"function"!=typeof a)i(t);else{var s=a({...t},n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&a.id&&null===s&&_o.log(`Event processor "${a.id}" dropped event`),lo(s)?s.then(t=>this._notifyEventProcessors(e,t,n,r+1).then(i)).then(null,o):this._notifyEventProcessors(e,s,n,r+1).then(i).then(null,o)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?ca(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function za(){return Ji("globalEventProcessors",()=>[])}function Ba(e){za().push(e)}var Va=100;class Ua{__init(){this._stack=[{}]}constructor(e,t=new Na,n=4){this._version=n,Ua.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=Na.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var n=this._lastEventId=t&&t.event_id?t.event_id:ra(),r=new Error("Sentry syntheticException");return this._withClient((i,o)=>{i.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},o)}),n}captureMessage(e,t,n){var r=this._lastEventId=n&&n.event_id?n.event_id:ra(),i=new Error(e);return this._withClient((o,a)=>{o.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},a)}),r}captureEvent(e,t){var n=t&&t.event_id?t.event_id:ra();return"transaction"!==e.type&&(this._lastEventId=n),this._withClient((r,i)=>{r.captureEvent(e,{...t,event_id:n},i)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!n||!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=Va}=r.getOptions&&r.getOptions()||{};if(!(o<=0)){var a={timestamp:Aa(),...e},s=i?wo(()=>i(a,t)):a;null!==s&&n.addBreadcrumb(s,o)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var n=this.getScope();n&&n.setTag(e,t)}setExtra(e,t){var n=this.getScope();n&&n.setExtra(e,t)}setContext(e,t){var n=this.getScope();n&&n.setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();t&&n&&e(t)}run(e){var t=Wa(this);try{e(this)}finally{Wa(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),La(e,t)}(n),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i}=n&&n.getOptions()||{};var o=Zi();const{userAgent:a}=o.navigator||{};var s=Da({release:r,environment:i,...t&&{user:t.getUser()},...a&&{userAgent:a},...e});if(t){var l=t.getSession&&t.getSession();l&&"ok"===l.status&&La(l,{status:"exited"}),this.endSession(),t.setSession(s)}return s}shouldSendDefaultPii(){var e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){var n=Ha().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Ha(){var e=Zi();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Wa(e){var t=Ha(),n=Ga(t);return Xa(t,e),n}function Ya(){var e=Ha();return(!$a(e)||Ga(e).isOlderThan(4))&&Xa(e,new Ua),ua()?function(e){try{var t=Ha().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return Ga(e);if(!$a(n)||Ga(n).isOlderThan(4)){var r=Ga(e).getStackTop();Xa(n,new Ua(r.client,Na.clone(r.scope)))}return Ga(n)}catch{return Ga(e)}}(e):Ga(e)}function $a(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Ga(e){return Ji("hub",()=>new Ua,e)}function Xa(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Ka(e,t){return function(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}({sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}})}function qa(e,t={}){var n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){var t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${Ka(e,r)}`}function Za(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Ja(e,t,n,r){var i=Za(n),o=e.type||"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);var a=function(e,t,n,r){var i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:go(r)},..."transaction"===e.type&&i&&{trace:Fo({...i})}}}(e,i,r,t);return delete e.sdkProcessingMetadata,Ta(a,[[{type:o},e]])}var Qa=[];function es(e){var t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach(e=>{e.isDefaultInstance=!0}),r=Array.isArray(n)?[...t,...n]:"function"==typeof n?ca(n(t)):t;var i=function(e){var t={};return e.forEach(e=>{const{name:n}=e;var r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r),o=i.findIndex(e=>"Debug"===e.name);if(-1!==o){const[e]=i.splice(o,1);i.push(e)}return i}var ts="Not capturing exception because it's already been captured.";class ns{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}constructor(e){if(ns.prototype.__init.call(this),ns.prototype.__init2.call(this),ns.prototype.__init3.call(this),ns.prototype.__init4.call(this),this._options=e,e.dsn){this._dsn=vo(e.dsn);var t=qa(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("No DSN provided, client will not do anything.")}captureException(e,t,n){if(la(e))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(ts));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,n)).then(e=>{r=e})),r}captureMessage(e,t,n,r){let i=n&&n.event_id;var o=oo(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(o.then(e=>this._captureEvent(e,n,r)).then(e=>{i=e})),i}captureEvent(e,t,n){if(t&&t.originalException&&la(t.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(ts));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then(e=>{r=e})),r}captureSession(e){this._isEnabled()?"string"!=typeof e.release?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),La(e,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getTransport(){return this._transport}flush(e){var t=this._transport;return t?this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e)):ga(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,e))}setupIntegrations(){var e,t;this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=(e=this._options.integrations,t={},e.forEach(e=>{t[e.name]=e,-1===Qa.indexOf(e.name)&&(e.setupOnce(Ba,Ya),Qa.push(e.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(`Integration installed: ${e.name}`))}),t),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}sendEvent(e,t={}){if(this._dsn){let r=Ja(e,this._dsn,this._options._metadata,this._options.tunnel);for(var n of t.attachments||[])r=Ia(r,Ma(n,this._options.transportOptions&&this._options.transportOptions.textEncoder));this._sendEnvelope(r)}}sendSession(e){if(this._dsn){var t=function(e,t,n,r){var i=Za(n);return Ta({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&{dsn:go(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t){if(this._options.sendClientReports){var n=`${e}:${t}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}_updateSessionFromEvent(e,t){let n=!1,r=!1;var i=t.exception&&t.exception.values;if(i)for(var o of(r=!0,i)){var a=o.mechanism;if(a&&!1===a.handled){n=!0;break}}var s="ok"===e.status;(s&&0===e.errors||s&&n)&&(La(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new va(t=>{let n=0;var r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const{normalizeDepth:r=3,normalizeMaxBreadth:i=1e3}=this.getOptions();var o={...e,event_id:e.event_id||t.event_id||ra(),timestamp:e.timestamp||Aa()};this._applyClientOptions(o),this._applyIntegrationsMetadata(o);let a=n;t.captureContext&&(a=Na.clone(a).update(t.captureContext));let s=ga(o);if(a){var l=[...t.attachments||[],...a.getAttachments()];l.length&&(t.attachments=l),s=a.applyToEvent(o,t)}return s.then(e=>"number"==typeof r&&r>0?this._normalizeEvent(e,r,i):e)}_normalizeEvent(e,t,n){if(!e)return null;var r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:ha(e.data,t,n)}}))},...e.user&&{user:ha(e.user,t,n)},...e.contexts&&{contexts:ha(e.contexts,t,n)},...e.extra&&{extra:ha(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=ha(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>(e.data&&(e.data=ha(e.data,t,n)),e))),r}_applyClientOptions(e){var t=this.getOptions();const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=Co(e.message,o));var a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Co(a.value,o));var s=e.request;s&&s.url&&(s.url=Co(s.url,o))}_applyIntegrationsMetadata(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){var t=e;"log"===t.logLevel?_o.log(t.message):_o.warn(t)}})}_processEvent(e,t,n){const{beforeSend:r,sampleRate:i}=this.getOptions();if(!this._isEnabled())return ma(new fo("SDK not enabled, will not capture event.","log"));var o="transaction"===e.type;return!o&&"number"==typeof i&&Math.random()>i?(this.recordDroppedEvent("sample_rate","error"),ma(new fo(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"))):this._prepareEvent(e,t,n).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",e.type||"error"),new fo("An event processor returned null, will not send event.","log");return t.data&&!0===t.data.__sentry__||o||!r?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(lo(e))return e.then(e=>{if(!ao(e)&&null!==e)throw new fo(t);return e},e=>{throw new fo(`beforeSend rejected with ${e}`)});if(!ao(e)&&null!==e)throw new fo(t);return e}(r(n,t))}).then(r=>{if(null===r)throw this.recordDroppedEvent("before_send",e.type||"error"),new fo("`beforeSend` returned `null`, will not send event.","log");var i=n&&n.getSession();!o&&i&&this._updateSessionFromEvent(i,r);var a=r.transaction_info;if(o&&a&&r.transaction!==e.transaction){var s="custom";r.transaction_info={...a,source:s,changes:[...a.changes,{source:s,timestamp:r.timestamp,propagations:a.propagations}]}}return this.sendEvent(r,t),r}).then(null,e=>{throw e instanceof fo?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new fo(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing+=1,e.then(e=>(this._numProcessing-=1,e),e=>(this._numProcessing-=1,e))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,e=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error("Error while sending event:",e)}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error("Transport disabled")}_clearOutcomes(){var e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}})}}function rs(e,t,n=ba(e.bufferSize||30)){let r={};return{send:function(i){var o=[];if(Oa(i,(t,n)=>{var i=Fa(n);!function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)?o.push(t):e.recordDroppedEvent("ratelimit_backoff",i)}),0===o.length)return ga();var a=Ta(i[0],o),s=t=>{Oa(a,(n,r)=>{e.recordDroppedEvent(t,Fa(r))})};return n.add(()=>t({body:Pa(a,e.textEncoder)}).then(e=>{void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Ra(r,e)},e=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error("Failed while sending event:",e),s("network_error")})).then(e=>e,e=>{if(e instanceof fo)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error("Skipped sending event because buffer is full."),s("queue_overflow"),ga();throw e})},flush:e=>n.drain(e)}}var is="7.14.0";let os;class as{constructor(){as.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=as.id}setupOnce(){os=Function.prototype.toString,Function.prototype.toString=function(...e){var t=Oo(this)||this;return os.apply(t,e)}}}as.__initStatic();var ss=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class ls{static __initStatic(){this.id="InboundFilters"}__init(){this.name=ls.id}constructor(e={}){this._options=e,ls.prototype.__init.call(this)}setupOnce(e,t){var n=e=>{var n=t();if(n){var r=n.getIntegration(ls);if(r){var i=n.getClient(),o=i?i.getOptions():{},a=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...ss],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(r._options,o);return function(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch{}return!1}(e)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${oa(e)}`),!0):function(e,t){return!(!t||!t.length)&&function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:n=""}=e.exception.values&&e.exception.values[0]||{};return[`${n}`,`${t}: ${n}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error(`Cannot extract message for event ${oa(e)}`),[]}return[]}(e).some(e=>t.some(t=>Ao(e,t)))}(e,t.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${oa(e)}`),!0):function(e,t){if(!t||!t.length)return!1;var n=cs(e);return!!n&&t.some(e=>Ao(n,e))}(e,t.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${oa(e)}.\nUrl: ${cs(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;var n=cs(e);return!n||t.some(e=>Ao(n,e))}(e,t.allowUrls)&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${oa(e)}.\nUrl: ${cs(e)}`),!0)}(e,a)?null:e}}return e};n.id=this.name,e(n)}}function cs(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?function(e=[]){for(let n=e.length-1;n>=0;n--){var t=e[n];if(t&&"<anonymous>"!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error(`Cannot extract url for event ${oa(e)}`),null}}function us(e,t){var n=ds(e,t),r={type:t&&t.name,value:ps(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function hs(e,t){return{exception:{values:[us(e,t)]}}}function ds(e,t){var n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(fs.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch{}return[]}ls.__initStatic();var fs=/Minified React error #\d+;/i;function ps(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function gs(e,t,n,r,i){let o;if(no(t)&&t.error)return hs(e,t.error);if(ro(t)||function(e){return to(e,"DOMException")}(t)){var a=t;if("stack"in t)o=hs(e,t);else{var s=a.name||(ro(a)?"DOMError":"DOMException"),l=a.message?`${s}: ${a.message}`:s;o=ms(e,l,n,r),aa(o,l)}return"code"in a&&(o.tags={...o.tags,"DOMException.code":`${a.code}`}),o}return eo(t)?hs(e,t):ao(t)||so(t)?(o=function(e,t,n,r){var i=Ya().getClient(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:so(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${jo(t)}`}]},extra:{__serialized__:da(t,o)}};if(n){var s=ds(e,n);s.length&&(a.exception.values[0].stacktrace={frames:s})}return a}(e,t,n,i),sa(o,{synthetic:!0}),o):(o=ms(e,t,n,r),aa(o,`${t}`),sa(o,{synthetic:!0}),o)}function ms(e,t,n,r){var i={message:t};if(r&&n){var o=ds(e,n);o.length&&(i.exception={values:[{value:t,stacktrace:{frames:o}}]})}return i}var vs="Breadcrumbs";class bs{static __initStatic(){this.id=vs}__init(){this.name=bs.id}constructor(e){bs.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&$o("console",ys),this.options.dom&&$o("dom",function(e){function t(t){let n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?uo(t.event.target,r):uo(t.event,r)}catch{n="<unknown>"}0!==n.length&&Ya().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&$o("xhr",ws),this.options.fetch&&$o("fetch",xs),this.options.history&&$o("history",_s)}}function ys(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:xa(e.level),message:So(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${So(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}Ya().addBreadcrumb(t,{input:e.args,level:e.level})}function ws(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;const{method:t,url:n,status_code:r,body:i}=e.xhr.__sentry_xhr__||{};return void Ya().addBreadcrumb({category:"xhr",data:{method:t,url:n,status_code:r},type:"http"},{xhr:e.xhr,input:i})}}function xs(e){!e.endTimestamp||e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?Ya().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):Ya().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response}))}function _s(e){var t=Zi();let n=e.from,r=e.to;var i=ya(t.location.href);let o=ya(n);var a=ya(r);o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),Ya().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}bs.__initStatic();var Cs=Zi();class Ss extends ns{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:is}],version:is},super(e),e.sendClientReports&&Cs.document&&Cs.document.addEventListener("visibilitychange",()=>{"hidden"===Cs.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){var i=gs(e,t,n&&n.syntheticException||void 0,r);return sa(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),ga(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){var o=ms(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),ga(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){var n=this.getIntegrationById(vs);n&&n.options&&n.options.sentry&&Ya().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:oa(e)},{event:e}),super.sendEvent(e,t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){var e=this._clearOutcomes();if(0!==e.length)if(this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log("Sending outcomes:",e);var t=qa(this._dsn,this._options),n=function(e,t){return Ta(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:Aa(),discarded_events:e}]])}(e,this._options.tunnel&&go(this._dsn));try{var r=Zi();if("[object Navigator]"===Object.prototype.toString.call(r&&r.navigator)&&"function"==typeof r.navigator.sendBeacon&&!this._options.transportOptions)r.navigator.sendBeacon.bind(r.navigator)(t,Pa(n));else this._sendEnvelope(n)}catch(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.error(e)}}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log("No dsn provided, will not send outcomes");else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log("No outcomes to send")}}var As=Zi();let ks;function Ts(e,t=function(){if(ks)return ks;if(Vo(As.fetch))return ks=As.fetch.bind(As);var e=As.document;let t=As.fetch;if(e&&"function"==typeof e.createElement)try{var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return ks=t.bind(As)}()){return rs(e,function(n){var r={body:n.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n.body.length<=65536,...e.fetchOptions};return t(e.url,r).then(e=>({statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))})}function Is(e){return rs(e,function(t){return new va((n,r)=>{var i=new XMLHttpRequest;for(var o in i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url),e.headers)Object.prototype.hasOwnProperty.call(e.headers,o)&&i.setRequestHeader(o,e.headers[o]);i.send(t.body)})})}var Os="?";function Es(e,t,n,r){var i={filename:e,function:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}var Ps=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ms=/\((\S*)(?::(\d+))(?::(\d+))\)/,js=[30,e=>{var t=Ps.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=Ms.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}const[e,r]=Bs(t[1]||Os,t[2]);return Es(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Fs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rs=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ds=[50,e=>{var t=Fs.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=Rs.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}let e=t[3],r=t[1]||Os;return[r,e]=Bs(r,e),Es(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Ls=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Ns=[40,e=>{var t=Ls.exec(e);return t?Es(t[2],t[1]||Os,+t[3],t[4]?+t[4]:void 0):void 0}],zs=Do(...[js,Ds,Ns]),Bs=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Os,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let Vs=0;function Us(){return Vs>0}function Hs(e,t={},n){if("function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(Oo(e))return e}catch{return e}var i=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var i=r.map(e=>Hs(e,t));return e.apply(this,i)}catch(e){throw Vs+=1,setTimeout(()=>{Vs-=1}),function(e){Ya().withScope(e)}(n=>{n.addEventProcessor(e=>(t.mechanism&&(aa(e,void 0),sa(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),function(e,t){Ya().captureException(e,{captureContext:t})}(e)}),e}};try{for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o])}catch{}Io(i,e),To(e,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get:()=>e.name})}catch{}return i}class Ws{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=Ws.id}__init2(){this._installFunc={onerror:Ys,onunhandledrejection:$s}}constructor(e){Ws.prototype.__init.call(this),Ws.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;var e=this._options;for(var t in e){var n=this._installFunc[t];n&&e[t]&&(Xs(t),n(),this._installFunc[t]=void 0)}}}function Ys(){$o("error",e=>{const[t,n,r]=qs();if(!t.getIntegration(Ws))return;const{msg:i,url:o,line:a,column:s,error:l}=e;if(!(Us()||l&&l.__sentry_own_request__)){var c=void 0===l&&io(i)?function(e,t,n,r){var i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=no(e)?e.message:e,a="Error";var s=o.match(i);s&&(a=s[1],o=s[2]);var l={exception:{values:[{type:a,value:o}]}};return Gs(l,t,n,r)}(i,o,a,s):Gs(gs(n,l||i,void 0,r,!1),o,a,s);c.level="error",Ks(t,l,c,"onerror")}})}function $s(){$o("unhandledrejection",e=>{const[t,n,r]=qs();if(!t.getIntegration(Ws))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch{}if(Us()||i&&i.__sentry_own_request__)return!0;var o=oo(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):gs(n,i,void 0,r,!0);o.level="error",Ks(t,i,o,"onunhandledrejection")})}function Gs(e,t,n,r){var i=e.exception=e.exception||{},o=i.values=i.values||[],a=o[0]=o[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,h=io(t)&&t.length>0?t:function(){var e=Zi();try{return e.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:h,function:"?",in_app:!0,lineno:u}),e}function Xs(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.log(`Global Handler attached: ${e}`)}function Ks(e,t,n,r){sa(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function qs(){var e=Ya(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}Ws.__initStatic();var Zs=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Js{static __initStatic(){this.id="TryCatch"}__init(){this.name=Js.id}constructor(e){Js.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){var e=Zi();this._options.setTimeout&&ko(e,"setTimeout",Qs),this._options.setInterval&&ko(e,"setInterval",Qs),this._options.requestAnimationFrame&&ko(e,"requestAnimationFrame",el),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&ko(XMLHttpRequest.prototype,"send",tl);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:Zs).forEach(nl)}}function Qs(e){return function(...t){var n=t[0];return t[0]=Hs(n,{mechanism:{data:{function:zo(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function el(e){return function(t){return e.apply(this,[Hs(t,{mechanism:{data:{function:"requestAnimationFrame",handler:zo(e)},handled:!0,type:"instrument"}})])}}function tl(e){return function(...t){var n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&ko(n,e,function(t){var n={mechanism:{data:{function:e,handler:zo(t)},handled:!0,type:"instrument"}},r=Oo(t);return r&&(n.mechanism.data.handler=zo(r)),Hs(t,n)})}),e.apply(this,t)}}function nl(e){var t=Zi(),n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(ko(n,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Hs(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:zo(r),target:e},handled:!0,type:"instrument"}}))}catch{}return t.apply(this,[n,Hs(r,{mechanism:{data:{function:"addEventListener",handler:zo(r),target:e},handled:!0,type:"instrument"}}),i])}}),ko(n,"removeEventListener",function(e){return function(t,n,r){var i=n;try{var o=i&&i.__sentry_wrapped__;o&&e.call(this,t,o,r)}catch{}return e.call(this,t,i,r)}}))}Js.__initStatic();class rl{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=rl.id}constructor(e={}){rl.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){var e=Ya().getClient();!e||Ba((t,n)=>{var r=Ya().getIntegration(rl);return r?function(e,t,n,r,i){if(!(r.exception&&r.exception.values&&i&&co(i.originalException,Error)))return r;var o=il(e,n,i.originalException,t);return r.exception.values=[...o,...r.exception.values],r}(e.getOptions().stackParser,r._key,r._limit,t,n):t})}}function il(e,t,n,r,i=[]){if(!co(n[r],Error)||i.length+1>=t)return i;var o=us(e,n[r]);return il(e,t,n[r],r,[o,...i])}rl.__initStatic();var ol=Zi();class al{constructor(){al.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=al.id}setupOnce(){Ba(e=>{if(Ya().getIntegration(al)){if(!ol.navigator&&!ol.location&&!ol.document)return e;var t=e.request&&e.request.url||ol.location&&ol.location.href;const{referrer:r}=ol.document||{},{userAgent:i}=ol.navigator||{};var n={...t&&{url:t},headers:{...e.request&&e.request.headers,...r&&{Referer:r},...i&&{"User-Agent":i}}};return{...e,request:n}}return e})}}al.__initStatic();class sl{constructor(){sl.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=sl.id}setupOnce(e,t){var n=e=>{var n=t().getIntegration(sl);if(n){try{if(function(e,t){return!!t&&!(!function(e,t){var n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!cl(e,t)||!ll(e,t))}(e,t)&&!function(e,t){var n=ul(t),r=ul(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&cl(e,t)&&ll(e,t))}(e,t))}(e,n._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function ll(e,t){let n=hl(e),r=hl(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let e=0;e<r.length;e++){var i=r[e],o=n[e];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function cl(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function ul(e){return e.exception&&e.exception.values&&e.exception.values[0]}function hl(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}sl.__initStatic();var dl=[new ls,new as,new Js,new bs,new Ws,new rl,new sl,new al];function fl(e={}){if(void 0===e.defaultIntegrations&&(e.defaultIntegrations=dl),void 0===e.release){var t=Zi();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);var n={...e,stackParser:Lo(e.stackParser||zs),integrations:es(e),transport:e.transport||(Bo()?Ts:Is)};(function(e,t){!0===t.debug&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?_o.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));var n=Ya(),r=n.getScope();r&&r.update(t.initialScope);var i=new e(t);n.bindClient(i)})(Ss,n),e.autoSessionTracking&&function(){var e=Zi(),t=e.document;if(typeof t>"u")return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_o.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var n=Ya();!n.captureSession||(pl(n),$o("history",({from:e,to:t})=>{void 0===e||e===t||pl(Ya())}))}()}function pl(e){e.startSession({ignoreDuration:!0}),e.captureSession()}var gl={exports:{}},ml={},vl=i,bl=Symbol.for("react.element"),yl=Symbol.for("react.fragment"),wl=Object.prototype.hasOwnProperty,xl=vl.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_l={key:!0,ref:!0,__self:!0,__source:!0};
10
10
  /**
11
11
  * @license React
12
12
  * react-jsx-runtime.production.min.js
@@ -77,7 +77,7 @@ var t,n,r,i,o,a,s=s||{version:"5.2.4"};if(e.fabric=s,typeof document<"u"&&typeof
77
77
  *
78
78
  * @license MIT
79
79
  */
80
- function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,vI),d=function(e,t){let{relative:n}=void 0===t?{}:t;hI()||nI();let{basename:i,navigator:o}=r.useContext(lI),{hash:a,pathname:s,search:l}=pI(e,{relative:n}),c=s;return"/"!==i&&(c="/"===s?i:oI([i,s])),o.createHref({pathname:c,search:l,hash:a})}(c,{relative:i}),f=function(e,t){let{target:n,replace:i,state:o,preventScrollReset:a,relative:s}=void 0===t?{}:t,l=function(){hI()||nI();let{basename:e,navigator:t}=r.useContext(lI),{matches:n}=r.useContext(uI),{pathname:i}=dI(),o=JSON.stringify(fI(n).map(e=>e.pathnameBase)),a=r.useRef(!1);return r.useEffect(()=>{a.current=!0}),r.useCallback(function(n,r){if(void 0===r&&(r={}),!a.current)return;if("number"==typeof n)return void t.go(n);let s=iI(n,JSON.parse(o),i,"path"===r.relative);"/"!==e&&(s.pathname="/"===s.pathname?e:oI([e,s.pathname])),(r.replace?t.replace:t.push)(s,r.state,r)},[e,t,o,i])}(),c=dI(),u=pI(e,{relative:s});return r.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==i?i:eI(c)===eI(u);l(e,{replace:n,state:o,preventScrollReset:a,relative:s})}},[c,l,u,i,o,n,e,a,s])}(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i});return Al("a",{...h,href:d,onClick:o?n:function(e){n&&n(e),e.defaultPrevented||f(e)},ref:t,target:l})});const yI=Vl(Al("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutlineOutlined"),wI=Vl(Al("path",{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.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined");function xI(){const e=id(e=>e.toasts);return Al("div",{className:"relative pointer-events-none",children:Al(Lv,{initial:!1,children:e.map(e=>Al("div",{"data-toast":!0,className:Nl("fixed mx-auto p-20 z-toast","bottom-center"===e.position?"left-0 right-0 bottom-0":"right-0 bottom-0"),children:kl(Ev.div,{initial:{opacity:0,y:50,scale:.3},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.5,transition:{duration:.2}},className:Nl("flex items-center gap-10 min-w-288 max-w-500 shadow-lg w-min rounded-lg pl-16 pr-6 py-6 text-sm pointer-events-auto max-h-100 bg-paper text-main bg-paper border mx-auto"),onPointerEnter:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onPointerLeave:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},role:"alert","aria-live":"danger"===e.type?"assertive":"polite",children:["danger"===e.type&&Al(yI,{className:"text-danger flex-shrink-0",size:"md"}),"positive"===e.type&&Al(wI,{className:"text-positive flex-shrink-0",size:"md"}),Al("div",{className:"overflow-hidden overflow-ellipsis w-max mr-auto",children:Al(i_,{value:e.message})}),e.action&&Al(Py,{variant:"text",color:"primary",size:"sm",className:"flex-shrink-0",onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},onClick:()=>od().remove(e.id),elementType:bI,to:e.action.action,children:Al(i_,{value:e.action.label})}),Al(n_,{onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},type:"button",className:"flex-shrink-0",onClick:()=>{od().remove(e.id)},size:"sm",children:Al(v_,{})})]})},e.id))})})}function _I(e){switch(e.key){case"z":(function(e){return ab()?e.metaKey:e.ctrlKey})(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?Gh().history.redo():Gh().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),Gh().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),Gh().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),Gh().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),Gh().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),Gh().objects.delete()}}const CI=new Map,SI=new Map,AI={};async function*kI(e){const t=e.createReader();let n;do{n=await new Promise((e,n)=>{t.readEntries(e,n)});for(const e of n)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await TI(e);yield new oy(t,e.fullPath)}else e.isDirectory&&(yield*kI(e))}while(n.length>0)}function TI(e){return new Promise((t,n)=>e.file(t,n))}function II(e){return null!=AI.dragTargetId?CI.get(AI.dragTargetId):e.dataTransfer.types.includes("Files")?{type:"nativeFile",el:null,ref:null,getData:()=>async function(e){const t=[];for await(const n of e)t.push(n);return t}(async function*(e){for(const t of e.items)if("file"===t.kind)if("function"==typeof t.webkitGetAsEntry){const e=t.webkitGetAsEntry();if(!e)continue;if(e.isFile){if(".DS_Store"===e.name)continue;yield new oy(t.getAsFile(),e.fullPath)}else e.isDirectory&&(yield*kI(e))}else{const e=t.getAsFile();if(!e||".DS_Store"===e.name)continue;yield new oy(e,t.fullPath)}}(e.dataTransfer))}:void 0}function OI({children:e}){const t=Yh(e=>e.bootstrapData),n=h(()=>({data:t,setBootstrapData:()=>{},mergeBootstrapData:()=>{},invalidateBootstrapData:()=>{}}),[t]);return Al(Vx.Provider,{value:n,children:e})}function EI(){var e,t,n,r;const i=null==(e=Yh(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible}))||e,o=null!=(t=Yh(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.nav)?void 0:n.position}))?t:"bottom",s=null!=(n=Yh(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.menubar)?void 0:n.position}))?n:"top",l=null==(r=Yh(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose}))||r,h=u(null),d=u(null),{isModal:f,isMobile:p}=b_(),g=c(async e=>{var t,n,r;if($h().activeTool||$h().dirty||"nativeFile"!==e.type)return;const i=await e.getData();!Gh().import.fileIsValid(i[0])||(null!=(r=null==(n=null==(t=$h().config.tools)?void 0:t.import)?void 0:n.openDroppedImageAsBackground)&&r?await Gh().import.openBackgroundImage(i[0]):await Gh().import.openUploadedFile(i[0]))},[]),{droppableProps:m}=function({id:e,disabled:t,ref:n,...r}){const i=u({dragOverElements:new Set,dropActivateTimer:void 0}).current,o=u(r);o.current=r,_(()=>(SI.set(e,{...SI.get(e),disabled:t,id:e,ref:n}),()=>{SI.delete(e)}),[e,o,t,n]);const a=e=>{var t;const r=o.current;return!(!(null==e?void 0:e.type)||n.current===(null==(t=e.ref)?void 0:t.current)||!r.types.includes(e.type)||r.acceptsDrop&&!r.acceptsDrop(e))},s=e=>{var t,n;const r=II(e);r&&(null==(n=(t=o.current).onDragLeave)||n.call(t,r))};return{droppableProps:t?{}:{onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDragEnter:e=>{var t,n;if(e.stopPropagation(),i.dragOverElements.add(e.target),i.dragOverElements.size>1)return;const r=II(e);r&&a(r)&&(null==(n=(t=o.current).onDragEnter)||n.call(t,r),clearTimeout(i.dropActivateTimer),"function"==typeof o.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;r&&(null==(t=(e=o.current).onDropActivate)||t.call(e,r))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const t of i.dragOverElements)e.currentTarget.contains(t)||i.dragOverElements.delete(t);if(i.dragOverElements.size>0)return;const t=II(e);t&&a(t)&&(s(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,n,r,l;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),s(e),clearTimeout(i.dropActivateTimer);const c=II(e);c&&(null==(n=(t=o.current).onDragLeave)||n.call(t,c),a(c)&&(null==(l=(r=o.current).onDrop)||l.call(r,c)))}}}}({id:"pixie-root",ref:d,types:["nativeFile"],onDrop:g});a(()=>{var e,t;$h().fabric||(Yh.setState({canvasRef:h}),xy(h.current),null!=(e=$h().config.ui)&&e.defaultTool&&$h().setActiveTool(null==(t=$h().config.ui)?void 0:t.defaultTool,null),Gh().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=$h().config).onLoad)||t.call(e,$h().editor)}));const n=_y(d,()=>{$h().setStageSize(Cy(d.current))}),r=_y(h,()=>{$h().setCanvasSize(Cy(h.current))});return()=>{n(),r()}},[d]);const v=Nl("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!f,"fixed inset-0 w-full h-full z-20":f,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":f&&!p});return Al(Nv,{features:Bv,strict:!0,children:kl(OI,{children:[f&&i&&!p&&l&&Al(n_,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{$h().editor.close()},children:Al(v_,{})}),f&&i&&Al(Nx,{position:"fixed",disableInitialTransition:!0}),kl(Ev.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:i?"visible":"hidden",className:v,children:["top"===s&&Al(A_,{}),"top"===o&&Al(MT,{className:"pt-14"}),kl("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...qv(m,{onKeyDownCapture:_I}),ref:d,children:[Al(T_,{}),Al(iS,{ref:h})]}),Al(Ak,{}),"bottom"===o&&Al(MT,{}),"bottom"===s&&Al(A_,{}),Al(qT,{}),Al(xI,{})]})]})})}Xi.enableBoundaryChecking(!1);const PI=class{constructor(e){if(Ti(this,"tools",{}),Ti(this,"fabric",null),e.sentryDsn&&function(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:is}],version:is},fl(e)}({dsn:e.sentryDsn}),function(e,t){void 0===t&&(t={});var n=t.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.1.8 | MIT License | https://tailwindcss.com*/.pi *,.pi :after,.pi :before{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity));border-style:solid;border-width:0;box-sizing:border-box}.pi :after,.pi :before{--tw-content:""}.pi hr{border-top-width:1px;color:inherit;height:0}.pi abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6{font-size:inherit;font-weight:inherit}.pi a{color:inherit;text-decoration:inherit}.pi b,.pi strong{font-weight:bolder}.pi code,.pi kbd,.pi pre,.pi samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.pi small{font-size:80%}.pi sub,.pi sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.pi sub{bottom:-.25em}.pi sup{top:-.5em}.pi table{border-collapse:collapse;border-color:inherit;text-indent:0}.pi button,.pi input,.pi optgroup,.pi select,.pi textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}.pi button,.pi select{text-transform:none}.pi [type=button],.pi [type=reset],.pi [type=submit],.pi button{-webkit-appearance:button;background-color:transparent;background-image:none}.pi :-moz-focusring{outline:auto}.pi :-moz-ui-invalid{box-shadow:none}.pi progress{vertical-align:baseline}.pi ::-webkit-inner-spin-button,.pi ::-webkit-outer-spin-button{height:auto}.pi [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.pi ::-webkit-search-decoration{-webkit-appearance:none}.pi ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.pi summary{display:list-item}.pi blockquote,.pi dd,.pi dl,.pi figure,.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6,.pi hr,.pi p,.pi pre{margin:0}.pi fieldset{margin:0;padding:0}.pi legend{padding:0}.pi menu,.pi ol,.pi ul{list-style:none;margin:0;padding:0}.pi textarea{resize:vertical}.pi input::-moz-placeholder,.pi textarea::-moz-placeholder{color:#9ca3af;opacity:1}.pi input::placeholder,.pi textarea::placeholder{color:#9ca3af;opacity:1}.pi [role=button],.pi button{cursor:pointer}.pi :disabled{cursor:default}.pi audio,.pi canvas,.pi embed,.pi iframe,.pi img,.pi object,.pi svg,.pi video{display:block;vertical-align:middle}.pi img,.pi video{height:auto;max-width:100%}.pi *,.pi :after,.pi :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi .container{width:100%}.pi .\\!container{width:100%!important}@media (min-width:640px){.pi .container{max-width:640px}.pi .\\!container{max-width:640px!important}}@media (min-width:768px){.pi .container{max-width:768px}.pi .\\!container{max-width:768px!important}}@media (min-width:1024px){.pi .container{max-width:1024px}.pi .\\!container{max-width:1024px!important}}@media (min-width:1280px){.pi .container{max-width:1280px}.pi .\\!container{max-width:1280px!important}}@media (min-width:1536px){.pi .container{max-width:1536px}.pi .\\!container{max-width:1536px!important}}.pi .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pi .pointer-events-none{pointer-events:none}.pi .pointer-events-auto{pointer-events:auto}.pi .visible{visibility:visible}.pi .\\!visible{visibility:visible!important}.pi .invisible{visibility:hidden}.pi .static{position:static}.pi .fixed{position:fixed}.pi .absolute{position:absolute}.pi .relative{position:relative}.pi .sticky{position:sticky}.pi .inset-0{bottom:0;top:0}.pi .inset-0,.pi .inset-x-0{left:0;right:0}.pi .right-2{right:2px}.pi .top-2{top:2px}.pi .top-0{top:0}.pi .left-0{left:0}.pi .left-16{left:16px}.pi .top-26{top:26px}.pi .-left-5{left:-5px}.pi .-top-5{top:-5px}.pi .bottom-0{bottom:0}.pi .-bottom-5{bottom:-5px}.pi .right-0{right:0}.pi .-right-5{right:-5px}.pi .bottom-20{bottom:20px}.pi .right-20{right:20px}.pi .top-24{top:24px}.pi .-bottom-14{bottom:-14px}.pi .left-30{left:30px}.pi .right-4{right:4px}.pi .top-1\\/2{top:50%}.pi .-bottom-20{bottom:-20px}.pi .left-1\\/2{left:50%}.pi .-bottom-10{bottom:-10px}.pi .-left-8{left:-8px}.pi .-left-80{left:-80px}.pi .-bottom-2{bottom:-2px}.pi .-right-2{right:-2px}.pi .isolate{isolation:isolate}.pi .z-20{z-index:20}.pi .z-modal{z-index:110}.pi .z-10{z-index:10}.pi .z-obj-box{z-index:20}.pi .z-navbar{z-index:40}.pi .z-tool-overlay{z-index:30}.pi .z-50,.pi .z-loading-indicator{z-index:50}.pi .z-popover{z-index:130}.pi .z-tray{z-index:120}.pi .z-toast{z-index:160}.pi .z-tooltip{z-index:150}.pi .z-cropzone{z-index:10}.pi .col-auto{grid-column:auto}.pi .m-auto{margin:auto}.pi .m-10{margin:10px}.pi .my-20{margin-bottom:20px;margin-top:20px}.pi .my-12{margin-bottom:12px;margin-top:12px}.pi .mx-auto{margin-left:auto;margin-right:auto}.pi .my-50{margin-bottom:50px;margin-top:50px}.pi .mx-14{margin-left:14px;margin-right:14px}.pi .my-30{margin-bottom:30px;margin-top:30px}.pi .my-24{margin-bottom:24px;margin-top:24px}.pi .my-80{margin-bottom:80px;margin-top:80px}.pi .my-32{margin-bottom:32px;margin-top:32px}.pi .my-40{margin-bottom:40px;margin-top:40px}.pi .my-8{margin-bottom:8px;margin-top:8px}.pi .my-10{margin-bottom:10px;margin-top:10px}.pi .my-100{margin-bottom:6.25rem;margin-top:6.25rem}.pi .mx-4{margin-left:4px;margin-right:4px}.pi .my-4{margin-bottom:4px;margin-top:4px}.pi .mx-8{margin-left:8px;margin-right:8px}.pi .mx-20{margin-left:20px;margin-right:20px}.pi .my-auto{margin-bottom:auto;margin-top:auto}.pi .mr-5{margin-right:5px}.pi .ml-auto{margin-left:auto}.pi .mr-20{margin-right:20px}.pi .mb-16{margin-bottom:16px}.pi .mr-10{margin-right:10px}.pi .mt-auto{margin-top:auto}.pi .mt-80{margin-top:80px}.pi .mt-30{margin-top:30px}.pi .mt-4{margin-top:4px}.pi .mb-30{margin-bottom:30px}.pi .mb-20{margin-bottom:20px}.pi .mr-auto{margin-right:auto}.pi .mr-24{margin-right:24px}.pi .mb-24{margin-bottom:24px}.pi .mb-14{margin-bottom:14px}.pi .mt-6{margin-top:6px}.pi .mt-12{margin-top:12px}.pi .mb-4{margin-bottom:4px}.pi .mt-14{margin-top:14px}.pi .ml-6{margin-left:6px}.pi .mr-14{margin-right:14px}.pi .mt-8{margin-top:8px}.pi .mb-10{margin-bottom:10px}.pi .mb-8{margin-bottom:8px}.pi .mt-20{margin-top:20px}.pi .mb-1{margin-bottom:1px}.pi .ml-10{margin-left:10px}.pi .mt-10{margin-top:10px}.pi .mt-2{margin-top:2px}.pi .mb-12{margin-bottom:12px}.pi .mb-40{margin-bottom:40px}.pi .mt-40{margin-top:40px}.pi .mb-32{margin-bottom:32px}.pi .mb-64{margin-bottom:64px}.pi .mt-32{margin-top:32px}.pi .mb-48{margin-bottom:48px}.pi .mt-50{margin-top:50px}.pi .mb-6{margin-bottom:6px}.pi .mt-60{margin-top:60px}.pi .-ml-1{margin-left:-1px}.pi .-ml-4{margin-left:-4px}.pi .mr-8{margin-right:8px}.pi .-mr-4{margin-right:-4px}.pi .ml-8{margin-left:8px}.pi .mt-16{margin-top:16px}.pi .mb-2{margin-bottom:2px}.pi .mt-24{margin-top:24px}.pi .-mt-2{margin-top:-2px}.pi .mt-36{margin-top:36px}.pi .mb-110{margin-bottom:110px}.pi .mt-18{margin-top:18px}.pi .mr-6{margin-right:6px}.pi .mr-16{margin-right:16px}.pi .ml-12{margin-left:12px}.pi .mr-4{margin-right:4px}.pi .mr-12{margin-right:12px}.pi .mr-2{margin-right:2px}.pi .mb-18{margin-bottom:18px}.pi .-ml-3{margin-left:-3px}.pi .-ml-12{margin-left:-12px}.pi .-ml-6{margin-left:-6px}.pi .box-content{box-sizing:content-box}.pi .block{display:block}.pi .inline-block{display:inline-block}.pi .inline{display:inline}.pi .flex{display:flex}.pi .inline-flex{display:inline-flex}.pi .table{display:table}.pi .table-cell{display:table-cell}.pi .table-row{display:table-row}.pi .grid{display:grid}.pi .\\!grid{display:grid!important}.pi .contents{display:contents}.pi .hidden{display:none}.pi .aspect-square{aspect-ratio:1/1}.pi .h-2\\/4{height:50%}.pi .h-full{height:100%}.pi .h-font{height:1em}.pi .h-1{height:1px}.pi .h-80{height:80px}.pi .h-400{height:25rem}.pi .h-50{height:50px}.pi .h-42{height:42px}.pi .h-54{height:3.375rem}.pi .h-8{height:8px}.pi .h-24{height:24px}.pi .h-36{height:36px}.pi .h-40{height:40px}.pi .h-20{height:20px}.pi .h-30{height:30px}.pi .h-84{height:84px}.pi .h-68{height:68px}.pi .h-32{height:32px}.pi .h-\\[54px\\]{height:54px}.pi .h-\\[186px\\]{height:186px}.pi .h-60{height:60px}.pi .h-18{height:18px}.pi .h-12{height:12px}.pi .h-26{height:26px}.pi .h-90{height:5.625rem}.pi .h-128{height:128px}.pi .h-6{height:6px}.pi .h-4{height:4px}.pi .h-48{height:48px}.pi .h-2{height:2px}.pi .h-16{height:16px}.pi .h-56{height:56px}.pi .h-64{height:64px}.pi .h-144{height:144px}.pi .h-100{height:6.25rem}.pi .h-max{height:-moz-max-content;height:max-content}.pi .h-px{height:1px}.pi .h-28{height:28px}.pi .h-92{height:92px}.pi .h-14{height:14px}.pi .h-38{height:2.375rem}.pi .h-22{height:22px}.pi .max-h-\\[calc\\(100vh-90px\\)\\]{max-height:calc(100vh - 90px)}.pi .max-h-\\[calc\\(100\\%-40px\\)\\]{max-height:calc(100% - 40px)}.pi .max-h-620{max-height:38.75rem}.pi .max-h-100{max-height:6.25rem}.pi .max-h-\\[36px\\]{max-height:36px}.pi .max-h-8{max-height:8px}.pi .max-h-tray{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .max-h-\\[calc\\(100\\%-30px\\)\\]{max-height:calc(100% - 30px)}.pi .max-h-40{max-height:40px}.pi .max-h-inherit{max-height:inherit}.pi .max-h-\\[583px\\]{max-height:583px}.pi .max-h-full{max-height:100%}.pi .max-h-26{max-height:26px}.pi .max-h-36{max-height:36px}.pi .max-h-dialog{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .max-h-240{max-height:240px}.pi .min-h-440{min-height:27.5rem}.pi .min-h-full{min-height:100%}.pi .min-h-\\[238px\\]{min-height:238px}.pi .min-h-86{min-height:86px}.pi .min-h-90{min-height:5.625rem}.pi .min-h-36{min-height:36px}.pi .min-h-42{min-height:42px}.pi .min-h-dialog{min-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .min-h-50{min-height:50px}.pi .min-h-\\[228px\\]{min-height:228px}.pi .min-h-30{min-height:30px}.pi .min-h-60{min-height:60px}.pi .w-max{width:-moz-max-content;width:max-content}.pi .w-full{width:100%}.pi .w-font{width:1em}.pi .w-80{width:80px}.pi .w-50{width:50px}.pi .w-8{width:8px}.pi .w-24{width:24px}.pi .w-36{width:36px}.pi .w-20{width:20px}.pi .w-30{width:30px}.pi .w-224{width:224px}.pi .w-68{width:68px}.pi .w-96{width:96px}.pi .w-144{width:144px}.pi .w-auto{width:auto}.pi .w-1{width:1px}.pi .w-240{width:240px}.pi .w-\\[168px\\]{width:168px}.pi .w-1\\/2{width:50%}.pi .w-384{width:384px}.pi .w-min{width:-moz-min-content;width:min-content}.pi .w-256{width:256px}.pi .w-18{width:18px}.pi .w-12{width:12px}.pi .w-42{width:42px}.pi .w-60{width:60px}.pi .\\!w-auto{width:auto!important}.pi .w-26{width:26px}.pi .w-32{width:32px}.pi .w-850{width:53.125rem}.pi .w-288{width:288px}.pi .w-320{width:320px}.pi .w-440{width:27.5rem}.pi .w-40{width:40px}.pi .w-64{width:64px}.pi .w-1\\/3{width:33.333333%}.pi .w-16{width:16px}.pi .w-56{width:56px}.pi .w-2{width:2px}.pi .w-110{width:110px}.pi .w-\\[4ch\\]{width:4ch}.pi .w-\\[233px\\]{width:233px}.pi .w-46{width:2.875rem}.pi .w-38{width:2.375rem}.pi .w-\\[210px\\]{width:210px}.pi .w-100{width:6.25rem}.pi .w-620{width:38.75rem}.pi .w-780{width:48.75rem}.pi .w-\\[calc\\(100\\%-40px\\)\\]{width:calc(100% - 40px)}.pi .w-px{width:1px}.pi .w-28{width:28px}.pi .w-90{width:5.625rem}.pi .w-14{width:14px}.pi .w-22{width:22px}.pi .w-280{width:17.5rem}.pi .min-w-0{min-width:0}.pi .min-w-320{min-width:320px}.pi .min-w-80{min-width:80px}.pi .min-w-224{min-width:224px}.pi .min-w-288{min-width:288px}.pi .min-w-240{min-width:240px}.pi .min-w-42{min-width:42px}.pi .min-w-90{min-width:5.625rem}.pi .min-w-180{min-width:11.25rem}.pi .min-w-128{min-width:128px}.pi .min-w-4{min-width:4px}.pi .min-w-192{min-width:192px}.pi .max-w-\\[calc\\(100vw-90px\\)\\]{max-width:calc(100vw - 90px)}.pi .max-w-max{max-width:-moz-max-content;max-width:max-content}.pi .max-w-280{max-width:17.5rem}.pi .max-w-620{max-width:38.75rem}.pi .max-w-440{max-width:27.5rem}.pi .max-w-\\[calc\\(100\\%-40px\\)\\]{max-width:calc(100% - 40px)}.pi .max-w-\\[90\\%\\]{max-width:90%}.pi .max-w-full{max-width:100%}.pi .max-w-500{max-width:31.25rem}.pi .max-w-\\[464px\\]{max-width:464px}.pi .max-w-180{max-width:11.25rem}.pi .max-w-400{max-width:25rem}.pi .max-w-780{max-width:48.75rem}.pi .max-w-375{max-width:375px}.pi .max-w-240{max-width:240px}.pi .max-w-320{max-width:320px}.pi .max-w-288{max-width:288px}.pi .max-w-112{max-width:112px}.pi .max-w-80{max-width:80px}.pi .max-w-850{max-width:53.125rem}.pi .max-w-580{max-width:36.25rem}.pi .max-w-dialog{max-width:calc(var(--be-viewport-width, 100vw)*.9)}.pi .max-w-950{max-width:59.375rem}.pi .flex-auto{flex:1 1 auto}.pi .flex-shrink-0,.pi .shrink-0{flex-shrink:0}.pi .flex-grow-0{flex-grow:0}.pi .origin-\\[100\\%\\]{transform-origin:100%}.pi .-translate-y-1\\/2{--tw-translate-y:-50%}.pi .-translate-x-1\\/2,.pi .-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .-translate-x-1\\/2{--tw-translate-x:-50%}.pi .rotate-180{--tw-rotate:180deg}.pi .rotate-0,.pi .rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-0{--tw-rotate:0deg}.pi .rotate-45{--tw-rotate:45deg}.pi .rotate-45,.pi .rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-90{--tw-rotate:90deg}.pi .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .cursor-pointer{cursor:pointer}.pi .cursor-nwse-resize{cursor:nwse-resize}.pi .cursor-nesw-resize{cursor:nesw-resize}.pi .cursor-se-resize{cursor:se-resize}.pi .cursor-sw-resize{cursor:sw-resize}.pi .cursor-zoom-in{cursor:zoom-in}.pi .cursor-default{cursor:default}.pi .cursor-move{cursor:move}.pi .cursor-not-allowed{cursor:not-allowed}.pi .touch-none{touch-action:none}.pi .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pi .resize-none{resize:none}.pi .resize{resize:both}.pi .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.pi .break-inside-avoid{-moz-column-break-inside:avoid;break-inside:avoid}.pi .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.pi .grid-cols-5-min-content{grid-template-columns:repeat(5,min-content)}.pi .flex-row{flex-direction:row}.pi .flex-col{flex-direction:column}.pi .flex-col-reverse{flex-direction:column-reverse}.pi .flex-wrap{flex-wrap:wrap}.pi .flex-nowrap{flex-wrap:nowrap}.pi .items-start{align-items:flex-start}.pi .items-center{align-items:center}.pi .items-stretch{align-items:stretch}.pi .justify-start{justify-content:flex-start}.pi .justify-end{justify-content:flex-end}.pi .justify-center{justify-content:center}.pi .justify-between{justify-content:space-between}.pi .gap-16{gap:16px}.pi .gap-20{gap:20px}.pi .gap-8{gap:8px}.pi .gap-14{gap:14px}.pi .gap-24{gap:24px}.pi .gap-6{gap:6px}.pi .gap-30{gap:30px}.pi .gap-10{gap:10px}.pi .gap-12{gap:12px}.pi .gap-4{gap:4px}.pi .gap-18{gap:18px}.pi .gap-32{gap:32px}.pi .gap-40{gap:40px}.pi .gap-64{gap:64px}.pi .gap-36{gap:36px}.pi .gap-x-10{-moz-column-gap:10px;column-gap:10px}.pi .space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(10px*var(--tw-space-y-reverse));margin-top:calc(10px*(1 - var(--tw-space-y-reverse)))}.pi .self-stretch{align-self:stretch}.pi .overflow-auto{overflow:auto}.pi .overflow-hidden{overflow:hidden}.pi .overflow-visible{overflow:visible}.pi .overflow-scroll{overflow:scroll}.pi .overflow-x-auto{overflow-x:auto}.pi .overflow-y-auto{overflow-y:auto}.pi .overflow-x-hidden{overflow-x:hidden}.pi .overflow-y-hidden{overflow-y:hidden}.pi .truncate{overflow:hidden;white-space:nowrap}.pi .overflow-ellipsis,.pi .text-ellipsis,.pi .truncate{text-overflow:ellipsis}.pi .whitespace-normal{white-space:normal}.pi .whitespace-nowrap{white-space:nowrap}.pi .whitespace-pre-wrap{white-space:pre-wrap}.pi .break-words{overflow-wrap:break-word}.pi .rounded{border-radius:4px}.pi .rounded-md{border-radius:6px}.pi .rounded-full{border-radius:9999px}.pi .rounded-lg{border-radius:8px}.pi .rounded-none{border-radius:0}.pi .rounded-2xl{border-radius:16px}.pi .rounded-sm{border-radius:2px}.pi .rounded-\\[16px\\]{border-radius:16px}.pi .rounded-\\[64px\\]{border-radius:64px}.pi .rounded-\\[32px\\]{border-radius:32px}.pi .rounded-3xl{border-radius:24px}.pi .rounded-xl{border-radius:12px}.pi .rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.pi .rounded-l{border-bottom-left-radius:4px;border-top-left-radius:4px}.pi .rounded-r-md{border-bottom-right-radius:6px;border-top-right-radius:6px}.pi .rounded-l-md{border-bottom-left-radius:6px;border-top-left-radius:6px}.pi .rounded-r{border-bottom-right-radius:4px;border-top-right-radius:4px}.pi .rounded-l-none{border-bottom-left-radius:0;border-top-left-radius:0}.pi .rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.pi .rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.pi .rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.pi .rounded-tr-none{border-top-right-radius:0}.pi .rounded-br-none{border-bottom-right-radius:0}.pi .rounded-tl-none{border-top-left-radius:0}.pi .rounded-bl-none{border-bottom-left-radius:0}.pi .border{border-width:1px}.pi .border-2{border-width:2px}.pi .border-4{border-width:4px}.pi .border-\\[3px\\]{border-width:3px}.pi .border-y{border-bottom-width:1px;border-top-width:1px}.pi .border-r{border-right-width:1px}.pi .border-l-4{border-left-width:4px}.pi .border-b{border-bottom-width:1px}.pi .border-t-4{border-top-width:4px}.pi .border-r-4{border-right-width:4px}.pi .border-b-4{border-bottom-width:4px}.pi .border-t{border-top-width:1px}.pi .border-l{border-left-width:1px}.pi .border-dotted{border-style:dotted}.pi .border-none{border-style:none}.pi .border-divider{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .border-primary\\/50{border-color:rgb(var(--be-primary)/.5)}.pi .border-danger\\/50{border-color:#ef444480}.pi .border-transparent{border-color:transparent}.pi .border-primary{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-danger{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .border-chip{--tw-border-opacity:1;border-color:rgb(var(--be-background-chip)/var(--tw-border-opacity))}.pi .border-paper{--tw-border-opacity:1;border-color:rgb(var(--be-paper)/var(--tw-border-opacity))}.pi .border-background{--tw-border-opacity:1;border-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-text-muted{border-color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .border-white\\/50{border-color:#ffffff80}.pi .border-l-primary{--tw-border-opacity:1;border-left-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-l-transparent{border-left-color:transparent}.pi .border-l-positive{--tw-border-opacity:1;border-left-color:rgb(34 197 94/var(--tw-border-opacity))}.pi .border-l-warning{--tw-border-opacity:1;border-left-color:rgb(243 164 50/var(--tw-border-opacity))}.pi .border-l-danger{--tw-border-opacity:1;border-left-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .border-r-transparent{border-right-color:transparent}.pi .border-r-primary-light{--tw-border-opacity:1;border-right-color:rgb(var(--be-primary-light)/var(--tw-border-opacity))}.pi .border-b-primary{--tw-border-opacity:1;border-bottom-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .bg-background{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-divider{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .bg-paper{--tw-bg-opacity:1;background-color:rgb(var(--be-paper)/var(--tw-bg-opacity))}.pi .bg{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-alt{--tw-bg-opacity:1;background-color:rgb(var(--be-background-alt)/var(--tw-bg-opacity))}.pi .bg-primary\\/hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .bg-primary{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .bg-positive\\/focus{background-color:rgb(34 197 94/var(--be-focus-opacity))}.pi .bg-warning\\/focus{background-color:rgb(243 164 50/var(--be-focus-opacity))}.pi .bg-danger\\/focus{background-color:rgb(239 68 68/var(--be-focus-opacity))}.pi .bg-primary\\/focus{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .bg-primary\\/5{background-color:rgb(var(--be-primary)/.05)}.pi .bg-controls{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-chip{--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi .bg-primary-light\\/20{background-color:rgb(var(--be-primary-light)/.2)}.pi .bg-primary\\/selected{background-color:rgb(var(--be-primary)/var(--be-selected-opacity))}.pi .bg-warning{--tw-bg-opacity:1;background-color:rgb(243 164 50/var(--tw-bg-opacity))}.pi .bg-transparent{background-color:transparent}.pi .bg-danger{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .bg-toast{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-focus{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .bg-black\\/30{background-color:#0000004d}.pi .bg-primary-light{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-light)/var(--tw-bg-opacity))}.pi .bg-fg-base\\/4{background-color:rgb(var(--be-foreground-base)/4%)}.pi .bg-positive{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.pi .bg-inherit{background-color:inherit}.pi .bg-background\\/70{background-color:rgb(var(--be-background)/.7)}.pi .bg-envato{--tw-bg-opacity:1;background-color:rgb(108 161 43/var(--tw-bg-opacity))}.pi .bg-disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .bg-disabled-fg{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .bg-slider-disabled{--tw-bg-opacity:1;background-color:rgb(189 189 189/var(--tw-bg-opacity))}.pi .bg-primary-dark{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .bg-white\\/50{background-color:#ffffff80}.pi .bg-black\\/50{background-color:#00000080}.pi .bg-primary-light\\/40{background-color:rgb(var(--be-primary-light)/.4)}.pi .bg-positive-lighter{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity))}.pi .bg-danger-lighter{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity))}.pi .bg-opacity-95{--tw-bg-opacity:.95}.pi .bg-no-repeat{background-repeat:no-repeat}.pi .fill-current{fill:currentColor}.pi .fill-transparent{fill:transparent}.pi .stroke-current{stroke:currentColor}.pi .object-contain{-o-object-fit:contain;object-fit:contain}.pi .object-cover{-o-object-fit:cover;object-fit:cover}.pi .p-0{padding:0}.pi .p-14{padding:14px}.pi .p-16{padding:16px}.pi .p-24{padding:24px}.pi .p-10{padding:10px}.pi .p-8{padding:8px}.pi .p-6{padding:6px}.pi .p-12{padding:12px}.pi .p-20{padding:20px}.pi .p-4{padding:4px}.pi .p-18{padding:18px}.pi .p-40{padding:40px}.pi .p-2{padding:2px}.pi .px-24{padding-left:24px;padding-right:24px}.pi .py-20{padding-bottom:20px;padding-top:20px}.pi .px-6{padding-left:6px;padding-right:6px}.pi .px-8{padding-left:8px;padding-right:8px}.pi .py-12{padding-bottom:12px;padding-top:12px}.pi .px-16{padding-left:16px;padding-right:16px}.pi .py-14{padding-bottom:14px;padding-top:14px}.pi .px-14{padding-left:14px;padding-right:14px}.pi .px-20{padding-left:20px;padding-right:20px}.pi .px-32{padding-left:32px;padding-right:32px}.pi .py-10{padding-bottom:10px;padding-top:10px}.pi .px-4{padding-left:4px;padding-right:4px}.pi .px-10{padding-left:10px;padding-right:10px}.pi .py-2{padding-bottom:2px;padding-top:2px}.pi .px-5vw{padding-left:5vw;padding-right:5vw}.pi .px-12{padding-left:12px;padding-right:12px}.pi .py-\\[9px\\]{padding-bottom:9px;padding-top:9px}.pi .px-40{padding-left:40px;padding-right:40px}.pi .py-32{padding-bottom:32px;padding-top:32px}.pi .px-28{padding-left:28px;padding-right:28px}.pi .py-56{padding-bottom:56px;padding-top:56px}.pi .py-28{padding-bottom:28px;padding-top:28px}.pi .py-90{padding-bottom:5.625rem;padding-top:5.625rem}.pi .py-4{padding-bottom:4px;padding-top:4px}.pi .px-18{padding-left:18px;padding-right:18px}.pi .px-22{padding-left:22px;padding-right:22px}.pi .px-26{padding-left:26px;padding-right:26px}.pi .py-8{padding-bottom:8px;padding-top:8px}.pi .py-96{padding-bottom:96px;padding-top:96px}.pi .py-6{padding-bottom:6px;padding-top:6px}.pi .py-3{padding-bottom:3px;padding-top:3px}.pi .py-5{padding-bottom:5px;padding-top:5px}.pi .py-40{padding-bottom:40px;padding-top:40px}.pi .pt-14{padding-top:14px}.pi .pt-24{padding-top:24px}.pi .pb-12{padding-bottom:12px}.pi .pt-26{padding-top:26px}.pi .pb-16{padding-bottom:16px}.pi .pb-24{padding-bottom:24px}.pi .pt-50{padding-top:50px}.pi .pt-20{padding-top:20px}.pi .pb-10{padding-bottom:10px}.pi .pb-4{padding-bottom:4px}.pi .pr-10{padding-right:10px}.pi .pl-10{padding-left:10px}.pi .pb-20{padding-bottom:20px}.pi .pb-30{padding-bottom:30px}.pi .pt-30{padding-top:30px}.pi .pl-8{padding-left:8px}.pi .pb-14{padding-bottom:14px}.pi .pl-14{padding-left:14px}.pi .pt-54{padding-top:3.375rem}.pi .pb-28{padding-bottom:28px}.pi .pb-48{padding-bottom:48px}.pi .pb-safe-area{padding-bottom:env(safe-area-inset-bottom)}.pi .pl-24{padding-left:24px}.pi .pr-16{padding-right:16px}.pi .pr-24{padding-right:24px}.pi .pl-16{padding-left:16px}.pi .pr-6{padding-right:6px}.pi .pb-18{padding-bottom:18px}.pi .pt-6{padding-top:6px}.pi .pt-16{padding-top:16px}.pi .pt-10{padding-top:10px}.pi .pl-12{padding-left:12px}.pi .pr-12{padding-right:12px}.pi .pb-6{padding-bottom:6px}.pi .pt-42{padding-top:42px}.pi .pb-32{padding-bottom:32px}.pi .pt-70{padding-top:70px}.pi .pt-40{padding-top:40px}.pi .pr-8{padding-right:8px}.pi .pl-46{padding-left:2.875rem}.pi .pr-46{padding-right:2.875rem}.pi .pl-6{padding-left:6px}.pi .pl-18{padding-left:18px}.pi .pr-18{padding-right:18px}.pi .text-left{text-align:left}.pi .text-center{text-align:center}.pi .text-right{text-align:right}.pi .align-top{vertical-align:top}.pi .align-middle{vertical-align:middle}.pi .text-sm{font-size:14px;line-height:20px}.pi .text-xs{font-size:12px;line-height:16px}.pi .text-xl{font-size:20px;line-height:28px}.pi .text-6xl{font-size:60px;line-height:1}.pi .text-2xl{font-size:24px;line-height:32px}.pi .text-3xl{font-size:30px;line-height:36px}.pi .text-base{font-size:16px;line-height:24px}.pi .text-lg{font-size:18px;line-height:28px}.pi .text-4xl{font-size:36px;line-height:40px}.pi .font-medium{font-weight:500}.pi .font-semibold{font-weight:600}.pi .font-light{font-weight:300}.pi .font-bold{font-weight:700}.pi .font-normal{font-weight:400}.pi .uppercase{text-transform:uppercase}.pi .capitalize{text-transform:capitalize}.pi .italic{font-style:italic}.pi .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.pi .leading-none{line-height:1}.pi .leading-5{line-height:1.25rem}.pi .tracking-wide{letter-spacing:.025em}.pi .text,.pi .text-main{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.pi .text-muted{color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .text-positive{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.pi .text-danger{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.pi .text-primary{--tw-text-opacity:1;color:rgb(var(--be-primary)/var(--tw-text-opacity))}.pi .\\!text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))!important}.pi .text-facebook{--tw-text-opacity:1;color:rgb(59 89 152/var(--tw-text-opacity))}.pi .text-twitter{--tw-text-opacity:1;color:rgb(29 161 242/var(--tw-text-opacity))}.pi .text-positive-darker{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.pi .text-disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .text-on-primary{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .text-primary-light{--tw-text-opacity:1;color:rgb(var(--be-primary-light)/var(--tw-text-opacity))}.pi .text-primary\\/40{color:rgb(var(--be-primary)/.4)}.pi .text-black\\/30{color:#0000004d}.pi .text-danger-darker{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.pi .underline{text-decoration-line:underline}.pi .no-underline{text-decoration-line:none}.pi .caret-transparent{caret-color:transparent}.pi .opacity-0{opacity:0}.pi .opacity-100{opacity:1}.pi .opacity-80{opacity:.8}.pi .opacity-90{opacity:.9}.pi .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.pi .shadow,.pi .shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.pi .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.pi .shadow-\\[15px_0_30px_0_rgb\\(0_0_0_\\/_18\\%\\)\\],.pi .shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-\\[15px_0_30px_0_rgb\\(0_0_0_\\/_18\\%\\)\\]{--tw-shadow:15px 0 30px 0 rgba(0,0,0,.18);--tw-shadow-colored:15px 0 30px 0 var(--tw-shadow-color)}.pi .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.pi .shadow-md,.pi .shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.pi .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .outline-none{outline:2px solid transparent;outline-offset:2px}.pi .outline{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .ring-inset{--tw-ring-inset:inset}.pi .ring-offset-4{--tw-ring-offset-width:4px}.pi .blur{--tw-blur:blur(8px)}.pi .blur,.pi .grayscale{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .grayscale{--tw-grayscale:grayscale(100%)}.pi .invert{--tw-invert:invert(100%)}.pi .invert,.pi .sepia{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .sepia{--tw-sepia:sepia(100%)}.pi .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-shadow{transition-duration:.15s;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-bg-color{transition-duration:.15s;transition-property:background-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-button{transition-duration:.15s;transition-property:background-color,box-shadow,border-color,color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-width{transition-duration:.15s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .duration-200{transition-duration:.2s}.pi .duration-100{transition-duration:.1s}.pi .will-change-\\[width\\]{will-change:width}.pi .will-change-transform{will-change:transform}.pi .icon-2xs{font-size:.75rem}.pi .icon-xs{font-size:1rem}.pi .icon-sm{font-size:1.25rem}.pi .icon-md{font-size:1.5rem}.pi .icon-lg{font-size:2.1875rem}.pi .icon-xl{font-size:2.6875rem}.pi .col-w-1{flex:1 0 0px}.pi .col-w-2{flex:2 0 0px}.pi .col-w-3{flex:3 0 0px}.pi .no-tap-highlight{-webkit-tap-highlight-color:transparent}@media only screen and (min-device-width:768px){.pi .tiny-scrollbar{scrollbar-color:rgba(0,0,0,.2) transparent;scrollbar-width:thin}.pi .tiny-scrollbar::-webkit-scrollbar{background-color:transparent;height:6px;width:6px}.pi .tiny-scrollbar::-webkit-scrollbar-thumb{background-color:rgb(var(--be-foreground-base)/.2);border-radius:10px}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:start{background:transparent}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:end{background:transparent}}.pi .hide-scrollbar{scrollbar-width:none}.pi .hide-scrollbar::-webkit-scrollbar{background:transparent;height:0;width:0}.pi .svg-icon{fill:currentColor;display:inline-block;flex-shrink:0;transition-duration:.15s;transition-property:transform,fill;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;user-select:none}.pi .cropzone:not(.moving) .cropzone-transition{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .first-letter\\:capitalize:first-letter{text-transform:capitalize}.pi .file\\:mr-10::file-selector-button{margin-right:10px}.pi .file\\:h-24::file-selector-button{height:24px}.pi .file\\:rounded::file-selector-button{border-radius:4px}.pi .file\\:border-none::file-selector-button{border-style:none}.pi .file\\:bg-primary::file-selector-button{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .file\\:px-10::file-selector-button{padding-left:10px;padding-right:10px}.pi .file\\:text-sm::file-selector-button{font-size:14px;line-height:20px}.pi .file\\:font-semibold::file-selector-button{font-weight:600}.pi .file\\:text-on-primary::file-selector-button{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .before\\:absolute:before{content:var(--tw-content);position:absolute}.pi .before\\:left-0:before{content:var(--tw-content);left:0}.pi .before\\:top-1\\/2:before{content:var(--tw-content);top:50%}.pi .before\\:z-10:before{content:var(--tw-content);z-index:10}.pi .before\\:block:before{content:var(--tw-content);display:block}.pi .before\\:h-1:before{content:var(--tw-content);height:1px}.pi .before\\:h-full:before{content:var(--tw-content);height:100%}.pi .before\\:h-28:before{content:var(--tw-content);height:28px}.pi .before\\:h-22:before{content:var(--tw-content);height:22px}.pi .before\\:h-18:before{content:var(--tw-content);height:18px}.pi .before\\:h-12:before{content:var(--tw-content);height:12px}.pi .before\\:h-14:before{content:var(--tw-content);height:14px}.pi .before\\:w-full:before{content:var(--tw-content);width:100%}.pi .before\\:w-28:before{content:var(--tw-content);width:28px}.pi .before\\:w-22:before{content:var(--tw-content);width:22px}.pi .before\\:w-18:before{content:var(--tw-content);width:18px}.pi .before\\:w-12:before{content:var(--tw-content);width:12px}.pi .before\\:w-14:before{content:var(--tw-content);width:14px}.pi .before\\:-translate-y-1\\/2:before{--tw-translate-y:-50%}.pi .before\\:-translate-y-1\\/2:before,.pi .before\\:translate-x-2:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .before\\:translate-x-2:before{--tw-translate-x:2px}.pi .before\\:scale-10:before{--tw-scale-x:.1;--tw-scale-y:.1;content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .before\\:rounded-full:before{border-radius:9999px;content:var(--tw-content)}.pi .before\\:rounded-3xl:before{border-radius:24px;content:var(--tw-content)}.pi .before\\:border:before{border-width:1px;content:var(--tw-content)}.pi .before\\:bg-divider:before{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity));content:var(--tw-content)}.pi .before\\:bg-primary:before{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity));content:var(--tw-content)}.pi .before\\:bg-white:before{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));content:var(--tw-content)}.pi .before\\:opacity-0:before{content:var(--tw-content);opacity:0}.pi .before\\:transition:before{content:var(--tw-content);transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:transition-transform:before{content:var(--tw-content);transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:duration-200:before{content:var(--tw-content);transition-duration:.2s}.pi .before\\:content-\\[\\\\\\\\00a0\\]:before{--tw-content:\\\\00a0;content:var(--tw-content)}.pi .after\\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.pi .after\\:absolute:after{content:var(--tw-content);position:absolute}.pi .after\\:inset-0:after{bottom:0;content:var(--tw-content);left:0;right:0;top:0}.pi .first\\:capitalize:first-child{text-transform:capitalize}.pi .checked\\:border-primary:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .checked\\:border-danger:checked{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .checked\\:bg-primary:checked{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .checked\\:bg-danger:checked{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .checked\\:before\\:translate-x-36:checked:before{--tw-translate-x:36px}.pi .checked\\:before\\:translate-x-30:checked:before,.pi .checked\\:before\\:translate-x-36:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-30:checked:before{--tw-translate-x:30px}.pi .checked\\:before\\:translate-x-24:checked:before{--tw-translate-x:24px}.pi .checked\\:before\\:translate-x-16:checked:before,.pi .checked\\:before\\:translate-x-24:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-16:checked:before{--tw-translate-x:16px}.pi .checked\\:before\\:translate-x-20:checked:before{--tw-translate-x:20px}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before,.pi .checked\\:before\\:translate-x-20:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before{--tw-scale-x:.65;--tw-scale-y:.65}.pi .checked\\:before\\:border-white:checked:before{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity));content:var(--tw-content)}.pi .checked\\:before\\:opacity-100:checked:before{content:var(--tw-content);opacity:1}.pi .focus-within\\:border-primary\\/60:focus-within{border-color:rgb(var(--be-primary)/.6)}.pi .focus-within\\:ring:focus-within{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-within\\:ring-primary\\/focus:focus-within{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus-within\\:ring-primary-light:focus-within{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--be-primary-light)/var(--tw-ring-opacity))}.pi .hover\\:scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05}.pi .hover\\:scale-105:hover,.pi .hover\\:scale-110:hover{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1}.pi .hover\\:cursor-move:hover{cursor:move}.pi .hover\\:border-primary:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .hover\\:border-danger:hover{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .hover\\:border-primary-dark:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .hover\\:border-danger\\/90:hover{border-color:#ef4444e6}.pi .hover\\:border-chip\\/90:hover{border-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:bg-hover:hover{background-color:rgb(var(--be-foreground-base)/var(--be-hover-opacity))}.pi .hover\\:bg-primary\\/10:hover{background-color:rgb(var(--be-primary)/.1)}.pi .hover\\:bg-white\\/hover:hover{background-color:rgb(255 255 255/var(--be-hover-opacity))}.pi .hover\\:bg-primary\\/hover:hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .hover\\:bg-danger\\/4:hover{background-color:#ef44440a}.pi .hover\\:bg-primary\\/4:hover{background-color:rgb(var(--be-primary)/4%)}.pi .hover\\:bg-primary-dark:hover{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:bg-danger\\/90:hover{background-color:#ef4444e6}.pi .hover\\:bg-chip\\/90:hover{background-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:bg-paper\\/90:hover{background-color:rgb(var(--be-paper)/.9)}.pi .hover\\:bg-primary\\/focus:hover{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:bg-fg-base\\/15:hover{background-color:rgb(var(--be-foreground-base)/15%)}.pi .hover\\:text-primary-dark:hover{--tw-text-opacity:1;color:rgb(var(--be-primary-dark)/var(--tw-text-opacity))}.pi .hover\\:text-main:hover{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .hover\\:text-fg-base:hover{--tw-text-opacity:1;color:rgb(var(--be-foreground-base)/var(--tw-text-opacity))}.pi .hover\\:underline:hover{text-decoration-line:underline}.pi .hover\\:opacity-100:hover{opacity:1}.pi .hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .before\\:hover\\:bg-primary-dark:hover:before{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity));content:var(--tw-content)}.pi .hover\\:after\\:bg-black\\/5:hover:after{background-color:#0000000d;content:var(--tw-content)}.pi .checked\\:hover\\:border-primary-dark:hover:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .focus\\:border-danger\\/60:focus{border-color:#ef444499}.pi .focus\\:border-primary\\/60:focus{border-color:rgb(var(--be-primary)/.6)}.pi .focus\\:bg-primary:focus{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .focus\\:text-on-primary:focus{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.pi .focus\\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.pi .focus\\:ring-2:focus,.pi .focus\\:ring:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.pi .focus\\:ring-danger\\/focus:focus{--tw-ring-color:rgb(239 68 68/var(--be-focus-opacity))}.pi .focus\\:ring-primary\\/focus:focus{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px}.pi .focus\\:after\\:bg-black\\/10:focus:after{background-color:#0000001a;content:var(--tw-content)}.pi .focus-visible\\:bg-primary\\/focus:focus-visible{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus-visible\\:bg-focus:focus-visible{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .focus-visible\\:outline:focus-visible{outline-style:solid;outline-width:2px}.pi .focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.pi .focus-visible\\:outline:focus-visible{outline-color:rgb(var(--be-primary-lighter)/1)}.pi .focus-visible\\:outline-primary-light:focus-visible{outline-color:rgb(var(--be-primary-light)/1)}.pi .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .disabled\\:pointer-events-none:disabled{pointer-events:none}.pi .disabled\\:cursor-default:disabled{cursor:default}.pi .disabled\\:border-disabled-bg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:border-transparent:disabled{border-color:transparent}.pi .disabled\\:border-disabled-fg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:border-r-transparent:disabled{border-right-color:transparent}.pi .disabled\\:bg-transparent:disabled{background-color:transparent}.pi .disabled\\:bg-disabled:disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:text-disabled:disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:shadow-none:disabled{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .disabled\\:before\\:bg-disabled-fg:disabled:before{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity));content:var(--tw-content)}.pi .dark .dark\\:bg-alt{--tw-bg-opacity:1;background-color:rgb(var(--be-background-alt)/var(--tw-bg-opacity))}.pi .dark .dark\\:bg-none{background-image:none}.pi .dark .dark\\:text-white\\/50{color:#ffffff80}.pi .dark .dark\\:opacity-5{opacity:.05}.pi .dark .dark\\:opacity-80{opacity:.8}.pi .dark .dark\\:checked\\:border-primary-dark:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .dark .dark\\:checked\\:bg-primary-dark:checked{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}@media (min-width:640px){.pi .sm\\:justify-start{justify-content:flex-start}.pi .sm\\:text-sm{font-size:14px;line-height:20px}}@media (min-width:768px){.pi .md\\:invisible{visibility:hidden}.pi .md\\:my-24{margin-bottom:24px;margin-top:24px}.pi .md\\:mx-40{margin-left:40px;margin-right:40px}.pi .md\\:my-64{margin-bottom:64px;margin-top:64px}.pi .md\\:my-100{margin-bottom:6.25rem;margin-top:6.25rem}.pi .md\\:mr-0{margin-right:0}.pi .md\\:mb-0{margin-bottom:0}.pi .md\\:mr-10{margin-right:10px}.pi .md\\:mb-40{margin-bottom:40px}.pi .md\\:mb-24{margin-bottom:24px}.pi .md\\:mt-60{margin-top:60px}.pi .md\\:mb-70{margin-bottom:70px}.pi .md\\:mt-0{margin-top:0}.pi .md\\:mr-24{margin-right:24px}.pi .md\\:mr-80{margin-right:80px}.pi .md\\:block{display:block}.pi .md\\:flex{display:flex}.pi .md\\:h-0{height:0}.pi .md\\:w-min{width:-moz-min-content;width:min-content}.pi .md\\:w-320{width:320px}.pi .md\\:w-400{width:25rem}.pi .md\\:min-w-440{min-width:27.5rem}.pi .md\\:max-w-950{max-width:59.375rem}.pi .md\\:max-w-350{max-width:21.875rem}.pi .md\\:flex-row{flex-direction:row}.pi .md\\:items-start{align-items:flex-start}.pi .md\\:gap-12{gap:12px}.pi .md\\:gap-24{gap:24px}.pi .md\\:gap-80{gap:80px}.pi .md\\:gap-112{gap:112px}.pi .md\\:overflow-hidden{overflow:hidden}.pi .md\\:p-24{padding:24px}.pi .md\\:px-24{padding-left:24px;padding-right:24px}.pi .md\\:px-30{padding-left:30px;padding-right:30px}.pi .md\\:px-0{padding-left:0;padding-right:0}.pi .md\\:px-20{padding-left:20px;padding-right:20px}.pi .md\\:py-80{padding-bottom:80px;padding-top:80px}.pi .md\\:px-176{padding-left:176px;padding-right:176px}.pi .md\\:px-10vw{padding-left:10vw;padding-right:10vw}.pi .md\\:pt-128{padding-top:128px}.pi .md\\:pl-20{padding-left:20px}.pi .md\\:pb-0{padding-bottom:0}.pi .md\\:pb-54{padding-bottom:3.375rem}.pi .md\\:text-left{text-align:left}.pi .md\\:text-3xl{font-size:30px;line-height:36px}.pi .md\\:text-4xl{font-size:36px;line-height:40px}.pi .md\\:text-lg{font-size:18px;line-height:28px}.pi .md\\:text-base{font-size:16px;line-height:24px}.pi .md\\:font-medium{font-weight:500}.pi .md\\:font-normal{font-weight:400}.pi .md\\:shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}}@media (min-width:1024px){.pi .lg\\:min-w-500{min-width:31.25rem}.pi .lg\\:flex-row{flex-direction:row}.pi .lg\\:items-center{align-items:center}.pi .lg\\:px-96{padding-left:96px;padding-right:96px}.pi .lg\\:py-96{padding-bottom:96px;padding-top:96px}.pi .lg\\:pb-0{padding-bottom:0}}@media (min-width:1280px){.pi .xl\\:w-1\\/2{width:50%}.pi .xl\\:pt-96{padding-top:96px}}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-2:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-inset:focus-visible>.tree-label{--tw-ring-inset:inset}\n'),!e.selector)throw new Error('Pixie required "selector" option.');const t=document.querySelector(e.selector);t&&(t.classList.add("pi"),function(e){Uh=e}(t),this.setConfig(e),Yh.setState({editor:this}),sd(t).render(Al(i.StrictMode,{children:Al(EI,{})})))}get state(){return $h()}get defaultConfig(){return PI.defaultConfig}open(e={}){var t;null!=(t=$h().config.ui)&&t.visible||(this.setConfig(zi(e,{ui:{visible:!0}})),requestAnimationFrame(()=>{var e,t,n,r;Gh().zoom.fitToScreen(),Gh().history.addInitial(),td()&&(null==(t=null==(e=$h().config.ui)?void 0:e.openImageDialog)?void 0:t.show)&&this.togglePanel("newImage",!0),null==(r=(n=$h().config).onOpen)||r.call(n)}))}close(){var e,t,n;null==(e=$h().config.ui)||!e.visible||(this.setConfig({ui:{visible:!1}}),null==(n=(t=$h().config).onClose)||n.call(t))}setConfig(e){$h().setConfig(e)}uploadAndAddImage(){return Gh().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return Gh().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return Gh().import.uploadAndOpenStateFile()}newCanvas(e,t,n){return Gh().canvas.openNew(e,t,n)}getState(e){return JSON.stringify(Jh(e))}setState(e){return Gh().import.loadState(e)}async setStateFromUrl(e){const t=await qh(e);return Gh().import.loadState(t)}openTool(e){Qh(e)}applyChanges(){$h().applyChanges()}cancelChanges(){$h().cancelChanges()}async resetEditor(e){await Kh(e),await Gh().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&$h().togglePanel("history",!1),"history"===e&&$h().togglePanel("objects",!1),$h().togglePanel(e,t)}on(e,t){var n;null==(n=this.fabric)||n.on(e,t)}isDirty(){return $h().dirty}get(e){return this.tools[e]}notify(e){return ad(e)}static init(e){return new Promise(t=>{const n=e.onLoad;e.onLoad=e=>{null==n||n(e),t(e)},new this(e)})}};let MI=PI;Ti(MI,"defaultConfig",uc),Ti(MI,"version",cc);const jI=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob());const FI=({visible:n,onClose:i,file:o,onSave:a})=>{const[s,l]=r.useState(null),[c,u]=r.useState(null),[h,d]=r.useState(""),[f,p]=r.useState(!1),[g,m]=r.useState(!1),v=Wr(),{options:b}=Br(),y=r.useRef(!1),w=r.useRef();w.current=a;const x=r.useCallback(async e=>{try{if(e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await v.getFileData(e.id);if(!t)throw new Error("Ошибка загрузки файла");return new Promise(e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(t)})}catch(e){throw console.error("Ошибка получения данных изображения:",e),e}},[v]);r.useEffect(()=>{(async()=>{try{const e=o?await x(o):null;u(e);const t=o?o.type:"";d(t||"image/png")}catch(e){console.error("🎨 Ошибка загрузки изображения:",e),M.error("Ошибка загрузки изображения"),i()}})()},[n,o,x,i]);const _=r.useCallback(async(e,t,n)=>{if(o&&w.current)try{const t=await function(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});let n=`image/${e}`;if("jpg"===e&&(n="image/jpeg"),t.startsWith("data:")){const e=t.match(/^data:([^;]+)/);e&&e[1].startsWith("image/")&&(n=e[1]);const r=t.replace(/data:image\/[^;]+;base64,/,"");return jI(r,n)}return jI(t,n)}(n,e);let r=t.type||`image/${n}`;"jpg"===n&&(r="image/jpeg");const a=e.startsWith("data:")?e:`data:${r};base64,${e}`,s=Object.assign(Object.assign({},o),{thumbnail:a,size:t.size.toString(),date:(new Date).toISOString().split("T")[0],type:r,folderId:o.folderId||"",name:o.name,extension:o.extension});await w.current(s),i()}catch(e){console.error("Ошибка сохранения:",e),M.error("Ошибка при сохранении изображения")}},[o,i]),C=r.useCallback(async()=>{if(!s||!o)return void console.error("❌ Pixie instance или file отсутствует");const e=o.name||"edited-image",t=o.extension||h.split("/")[1]||"png";try{await s.tools.export.save(e.replace(/\.[^/.]+$/,""),t)}catch(n){console.error("🎨 Ошибка при сохранении через кнопку:",n);try{const n=document.querySelector("#pixie-editor canvas"),r=n?n.toDataURL(`image/${t}`):null;r&&await _(r,e,t)}catch(e){console.error("🎨 Альтернативный способ тоже не сработал:",e)}}},[s,o,h,_]),S=r.useCallback(async()=>{var e;if(c&&n&&f&&!y.current)try{y.current=!0;const t=document.getElementById("pixie-editor");if(!t)throw new Error("Контейнер #pixie-editor не найден");let n=0;for(;n<20&&(0===t.clientWidth||0===t.clientHeight);)await new Promise(e=>setTimeout(e,50)),n++;const r={selector:"#pixie-editor",baseUrl:b.publicPath?`${b.publicPath}/loacal_module/pixie/dist`:"/loacal_module/pixie/dist",image:c,activeLanguage:"ru-RU",ui:{mode:"inline",forceOverlayModeOnMobile:!1,visible:!0},tools:{filter:{items:["crop","resize","draw","text","shapes","frame","export","import"]}},onLoad:()=>{try{const e=document.querySelector("#pixie-editor canvas");e&&e.focus(),m(!0)}catch(e){console.warn("Pixie onLoad focus failed:",e)}},onSave:async function(e,t,n){try{return await _(e,t,n)}catch(e){throw console.error("🎨 PIXIE onSave ERROR:",e),e}}};if(s)try{m(!1);const t=s.resetEditor;"function"==typeof t?(await t({image:c,ui:{visible:!0}}),m(!0)):(null===(e=s.setConfig)||void 0===e||e.call(s,{image:c,ui:{visible:!0}}),m(!0))}catch(e){console.error("resetEditor/setConfig failed:",e)}else{const e=await MI.init(r);l(e),"function"==typeof e.setConfig&&(setTimeout(()=>{var t;return null===(t=e.setConfig)||void 0===t?void 0:t.call(e,{ui:{visible:!0}})},0),setTimeout(()=>{var t;return null===(t=e.setConfig)||void 0===t?void 0:t.call(e,{ui:{visible:!0}})},200)),setTimeout(()=>m(!0),700)}}catch(e){console.error("Ошибка инициализации Pixie:",e),M.error("Ошибка инициализации редактора"),y.current=!1,i()}},[c,n,f,b.publicPath,i,_,s]);return r.useEffect(()=>{n&&c&&f&&S()},[n,c,f,null==o?void 0:o.id,S]),r.useEffect(()=>{var e;if(!n){try{null===(e=null==s?void 0:s.close)||void 0===e||e.call(s)}catch(e){console.warn("Ошибка при закрытии Pixie:",e)}u(null),d(""),y.current=!1,p(!1),m(!1)}},[n,s]),r.useEffect(()=>{if(g&&s&&"function"==typeof s.open)try{s.open()}catch(e){console.warn("Pixie open() after ready failed:",e)}},[g,s]),r.useEffect(()=>{if(!n||!s)return;let e=!1,t=0;const r=()=>{if(e)return;const n=document.querySelector("#pixie-editor .pixie-root"),i=document.querySelector("#pixie-editor canvas"),o=n&&"none"!==n.style.display&&"0"!==n.style.opacity,a=!!(i&&i.width>0&&i.height>0);if(n&&!o&&"function"==typeof s.setConfig)try{s.setConfig({ui:{visible:!0}})}catch(e){console.warn("setConfig visible failed",e)}a?m(!0):t<30&&(t+=1,setTimeout(r,100))};return r(),()=>{e=!0}},[n,s]),e(H,{title:`Редактирование: ${(null==o?void 0:o.name)||"Изображение"}`,open:n,onCancel:i,afterOpenChange:e=>p(e),forceRender:!0,width:"95vw",style:{top:20},styles:{body:{height:"85vh",padding:0}},footer:[e(X,{onClick:i,children:"Отмена"},"cancel"),e(X,{type:"primary",onClick:C,children:"Сохранить"},"save")],maskClosable:!1,destroyOnClose:!1,children:t("div",{style:{position:"relative",width:"100%",height:"100%"},children:[e("div",{id:"pixie-editor",style:{width:"100%",height:"85vh",minHeight:400}}),n&&!g?e("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.45)",backdropFilter:"blur(1px)",pointerEvents:"all",zIndex:10},children:e("span",{style:{fontSize:14,color:"#555"},children:"Загрузка редактора…"})}):null]})})};var RI="container",DI="uploadCard",LI="header",NI="headerButton",zI="fileList",BI="fileItem",VI="fileAvatar",UI="fileInfo",HI="fileName",WI="fileSize",YI="progressBar",$I="errorNote",GI="minimizedContainer",XI="minimizedButton";const{Text:KI}=K,qI=({visible:n,files:r,totalFiles:i,completedFiles:o,onClose:a,onMinimize:s,onInsert:l,minimized:c=!1})=>{if(!n)return null;const u=t=>{switch(t){case"success":return e(Se,{style:{color:"#52c41a"}});case"error":return e(Ce,{style:{color:"#ff4d4f"}});default:return e(_e,{style:{color:"#1890ff"}})}},h=e=>{if(e.includes("КБ")||e.includes("MB")||e.includes("KB"))return e;const t=parseInt(e);return isNaN(t)?e:`${(t/1024).toFixed(2)} КБ`},d=t=>"success"===t.status?[e(X,{type:"primary",size:"small",onClick:()=>l(t.id),children:"Insert"},"insert")]:"error"===t.status?[e(KI,{type:"danger",style:{fontSize:"12px"},children:t.error||"Error"},"error")]:[];return e("div",c?{className:GI,children:t(X,{type:"primary",size:"small",onClick:s,className:XI,children:["Загрузка ",o,"/",i]})}:{className:RI,children:t(U,{className:DI,size:"small",title:t("div",{className:LI,children:[t(KI,{strong:!0,children:["Uploaded ",o,"/",i," files"]}),t(Q,{children:[e(X,{type:"text",size:"small",icon:e(we,{}),onClick:s,className:NI}),e(X,{type:"text",size:"small",icon:e(xe,{}),onClick:a,className:NI})]})]}),bodyStyle:{padding:"12px"},children:[e(q,{className:zI,size:"small",dataSource:r,renderItem:n=>e(q.Item,{className:BI,actions:d(n),children:e(q.Item.Meta,{avatar:e(J,{size:"small",icon:u(n.status),className:VI}),title:t("div",{className:UI,children:[e(KI,{ellipsis:!0,className:HI,children:n.name}),e(KI,{type:"secondary",className:WI,children:h(n.size)})]}),description:"uploading"===n.status&&e(Z,{percent:n.progress,size:"small",status:"active",showInfo:!1,className:YI})})})}),r.some(e=>"error"===e.status)&&e("div",{className:$I,children:e(KI,{type:"danger",style:{fontSize:"12px"},children:"Некоторые файлы не удалось загрузить. Проверьте размер и формат файлов."})})]})})},{Header:ZI}=ee,{Text:JI,Title:QI}=K,eO=({selectedFiles:i,onClearSelection:o,onRename:a,onDelete:s,onCopy:l,onMove:c,onEdit:u,files:h})=>{const{t:d}=gr(),f=i.size,p=r.useMemo(()=>{var e,t;if(1!==f)return!1;const n=Array.from(i)[0],r=h.find(e=>e.id===n);if(!r||r.isFolder)return!1;let o=!1;if(r.type&&r.type.startsWith("image/"))o=!0;else if(r.extension){const e=r.extension.toLowerCase();o=Lr.includes(e)}else{const t=null===(e=r.name.split(".").pop())||void 0===e?void 0:e.toLowerCase();o=!!t&&Lr.includes(t)}return console.log("isImageSelected проверка:",{fileName:r.name,fileType:r.type,fileExtension:r.extension,nameExtension:null===(t=r.name.split(".").pop())||void 0===t?void 0:t.toLowerCase(),isImage:o,IMAGE_EXTENSIONS:Lr}),o},[f,i,h]);return t(ZI,{className:"actions-header",children:[t("div",{className:"header-title-container",children:[e(QI,{level:5,className:"header-title",children:d("Files")}),f>0&&t(JI,{type:"secondary",className:"selected-text",children:[f," ",d("selected")]})]}),e(Q,{children:f>0?t(n,{children:[e(X,{icon:e(xe,{}),onClick:o,children:d("Deselected")}),e(X,{icon:e(ye,{}),onClick:a,disabled:1!==f,children:d("Rename")}),e(X,{icon:e(Ae,{}),onClick:u,disabled:!p,title:p?"Редактировать изображение":"Выберите одно изображение для редактирования",children:d("Edit")}),e(X,{icon:e(ke,{}),onClick:l,children:d("Copy")}),e(X,{icon:e(ve,{}),onClick:c,children:d("Move to folder")}),e(X,{danger:!0,icon:e(Te,{}),onClick:s,children:d("Delete")})]}):null})]})};
80
+ function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,vI),d=function(e,t){let{relative:n}=void 0===t?{}:t;hI()||nI();let{basename:i,navigator:o}=r.useContext(lI),{hash:a,pathname:s,search:l}=pI(e,{relative:n}),c=s;return"/"!==i&&(c="/"===s?i:oI([i,s])),o.createHref({pathname:c,search:l,hash:a})}(c,{relative:i}),f=function(e,t){let{target:n,replace:i,state:o,preventScrollReset:a,relative:s}=void 0===t?{}:t,l=function(){hI()||nI();let{basename:e,navigator:t}=r.useContext(lI),{matches:n}=r.useContext(uI),{pathname:i}=dI(),o=JSON.stringify(fI(n).map(e=>e.pathnameBase)),a=r.useRef(!1);return r.useEffect(()=>{a.current=!0}),r.useCallback(function(n,r){if(void 0===r&&(r={}),!a.current)return;if("number"==typeof n)return void t.go(n);let s=iI(n,JSON.parse(o),i,"path"===r.relative);"/"!==e&&(s.pathname="/"===s.pathname?e:oI([e,s.pathname])),(r.replace?t.replace:t.push)(s,r.state,r)},[e,t,o,i])}(),c=dI(),u=pI(e,{relative:s});return r.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==i?i:eI(c)===eI(u);l(e,{replace:n,state:o,preventScrollReset:a,relative:s})}},[c,l,u,i,o,n,e,a,s])}(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i});return Al("a",{...h,href:d,onClick:o?n:function(e){n&&n(e),e.defaultPrevented||f(e)},ref:t,target:l})});const yI=Vl(Al("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutlineOutlined"),wI=Vl(Al("path",{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.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined");function xI(){const e=id(e=>e.toasts);return Al("div",{className:"relative pointer-events-none",children:Al(Lv,{initial:!1,children:e.map(e=>Al("div",{"data-toast":!0,className:Nl("fixed mx-auto p-20 z-toast","bottom-center"===e.position?"left-0 right-0 bottom-0":"right-0 bottom-0"),children:kl(Ev.div,{initial:{opacity:0,y:50,scale:.3},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.5,transition:{duration:.2}},className:Nl("flex items-center gap-10 min-w-288 max-w-500 shadow-lg w-min rounded-lg pl-16 pr-6 py-6 text-sm pointer-events-auto max-h-100 bg-paper text-main bg-paper border mx-auto"),onPointerEnter:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onPointerLeave:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},role:"alert","aria-live":"danger"===e.type?"assertive":"polite",children:["danger"===e.type&&Al(yI,{className:"text-danger flex-shrink-0",size:"md"}),"positive"===e.type&&Al(wI,{className:"text-positive flex-shrink-0",size:"md"}),Al("div",{className:"overflow-hidden overflow-ellipsis w-max mr-auto",children:Al(i_,{value:e.message})}),e.action&&Al(Py,{variant:"text",color:"primary",size:"sm",className:"flex-shrink-0",onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},onClick:()=>od().remove(e.id),elementType:bI,to:e.action.action,children:Al(i_,{value:e.action.label})}),Al(n_,{onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},type:"button",className:"flex-shrink-0",onClick:()=>{od().remove(e.id)},size:"sm",children:Al(v_,{})})]})},e.id))})})}function _I(e){switch(e.key){case"z":(function(e){return ab()?e.metaKey:e.ctrlKey})(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?Gh().history.redo():Gh().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),Gh().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),Gh().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),Gh().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),Gh().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),Gh().objects.delete()}}const CI=new Map,SI=new Map,AI={};async function*kI(e){const t=e.createReader();let n;do{n=await new Promise((e,n)=>{t.readEntries(e,n)});for(const e of n)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await TI(e);yield new oy(t,e.fullPath)}else e.isDirectory&&(yield*kI(e))}while(n.length>0)}function TI(e){return new Promise((t,n)=>e.file(t,n))}function II(e){return null!=AI.dragTargetId?CI.get(AI.dragTargetId):e.dataTransfer.types.includes("Files")?{type:"nativeFile",el:null,ref:null,getData:()=>async function(e){const t=[];for await(const n of e)t.push(n);return t}(async function*(e){for(const t of e.items)if("file"===t.kind)if("function"==typeof t.webkitGetAsEntry){const e=t.webkitGetAsEntry();if(!e)continue;if(e.isFile){if(".DS_Store"===e.name)continue;yield new oy(t.getAsFile(),e.fullPath)}else e.isDirectory&&(yield*kI(e))}else{const e=t.getAsFile();if(!e||".DS_Store"===e.name)continue;yield new oy(e,t.fullPath)}}(e.dataTransfer))}:void 0}function OI({children:e}){const t=Yh(e=>e.bootstrapData),n=h(()=>({data:t,setBootstrapData:()=>{},mergeBootstrapData:()=>{},invalidateBootstrapData:()=>{}}),[t]);return Al(Vx.Provider,{value:n,children:e})}function EI(){var e,t,n,r;const i=null==(e=Yh(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible}))||e,o=null!=(t=Yh(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.nav)?void 0:n.position}))?t:"bottom",s=null!=(n=Yh(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.menubar)?void 0:n.position}))?n:"top",l=null==(r=Yh(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose}))||r,h=u(null),d=u(null),{isModal:f,isMobile:p}=b_(),g=c(async e=>{var t,n,r;if($h().activeTool||$h().dirty||"nativeFile"!==e.type)return;const i=await e.getData();!Gh().import.fileIsValid(i[0])||(null!=(r=null==(n=null==(t=$h().config.tools)?void 0:t.import)?void 0:n.openDroppedImageAsBackground)&&r?await Gh().import.openBackgroundImage(i[0]):await Gh().import.openUploadedFile(i[0]))},[]),{droppableProps:m}=function({id:e,disabled:t,ref:n,...r}){const i=u({dragOverElements:new Set,dropActivateTimer:void 0}).current,o=u(r);o.current=r,_(()=>(SI.set(e,{...SI.get(e),disabled:t,id:e,ref:n}),()=>{SI.delete(e)}),[e,o,t,n]);const a=e=>{var t;const r=o.current;return!(!(null==e?void 0:e.type)||n.current===(null==(t=e.ref)?void 0:t.current)||!r.types.includes(e.type)||r.acceptsDrop&&!r.acceptsDrop(e))},s=e=>{var t,n;const r=II(e);r&&(null==(n=(t=o.current).onDragLeave)||n.call(t,r))};return{droppableProps:t?{}:{onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDragEnter:e=>{var t,n;if(e.stopPropagation(),i.dragOverElements.add(e.target),i.dragOverElements.size>1)return;const r=II(e);r&&a(r)&&(null==(n=(t=o.current).onDragEnter)||n.call(t,r),clearTimeout(i.dropActivateTimer),"function"==typeof o.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;r&&(null==(t=(e=o.current).onDropActivate)||t.call(e,r))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const t of i.dragOverElements)e.currentTarget.contains(t)||i.dragOverElements.delete(t);if(i.dragOverElements.size>0)return;const t=II(e);t&&a(t)&&(s(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,n,r,l;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),s(e),clearTimeout(i.dropActivateTimer);const c=II(e);c&&(null==(n=(t=o.current).onDragLeave)||n.call(t,c),a(c)&&(null==(l=(r=o.current).onDrop)||l.call(r,c)))}}}}({id:"pixie-root",ref:d,types:["nativeFile"],onDrop:g});a(()=>{var e,t;$h().fabric||(Yh.setState({canvasRef:h}),xy(h.current),null!=(e=$h().config.ui)&&e.defaultTool&&$h().setActiveTool(null==(t=$h().config.ui)?void 0:t.defaultTool,null),Gh().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=$h().config).onLoad)||t.call(e,$h().editor)}));const n=_y(d,()=>{$h().setStageSize(Cy(d.current))}),r=_y(h,()=>{$h().setCanvasSize(Cy(h.current))});return()=>{n(),r()}},[d]);const v=Nl("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!f,"fixed inset-0 w-full h-full z-20":f,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":f&&!p});return Al(Nv,{features:Bv,strict:!0,children:kl(OI,{children:[f&&i&&!p&&l&&Al(n_,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{$h().editor.close()},children:Al(v_,{})}),f&&i&&Al(Nx,{position:"fixed",disableInitialTransition:!0}),kl(Ev.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:i?"visible":"hidden",className:v,children:["top"===s&&Al(A_,{}),"top"===o&&Al(MT,{className:"pt-14"}),kl("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...qv(m,{onKeyDownCapture:_I}),ref:d,children:[Al(T_,{}),Al(iS,{ref:h})]}),Al(Ak,{}),"bottom"===o&&Al(MT,{}),"bottom"===s&&Al(A_,{}),Al(qT,{}),Al(xI,{})]})]})})}Xi.enableBoundaryChecking(!1);const PI=class{constructor(e){if(Ti(this,"tools",{}),Ti(this,"fabric",null),e.sentryDsn&&function(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:is}],version:is},fl(e)}({dsn:e.sentryDsn}),function(e,t){void 0===t&&(t={});var n=t.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.1.8 | MIT License | https://tailwindcss.com*/.pi *,.pi :after,.pi :before{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity));border-style:solid;border-width:0;box-sizing:border-box}.pi :after,.pi :before{--tw-content:""}.pi hr{border-top-width:1px;color:inherit;height:0}.pi abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6{font-size:inherit;font-weight:inherit}.pi a{color:inherit;text-decoration:inherit}.pi b,.pi strong{font-weight:bolder}.pi code,.pi kbd,.pi pre,.pi samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.pi small{font-size:80%}.pi sub,.pi sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.pi sub{bottom:-.25em}.pi sup{top:-.5em}.pi table{border-collapse:collapse;border-color:inherit;text-indent:0}.pi button,.pi input,.pi optgroup,.pi select,.pi textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}.pi button,.pi select{text-transform:none}.pi [type=button],.pi [type=reset],.pi [type=submit],.pi button{-webkit-appearance:button;background-color:transparent;background-image:none}.pi :-moz-focusring{outline:auto}.pi :-moz-ui-invalid{box-shadow:none}.pi progress{vertical-align:baseline}.pi ::-webkit-inner-spin-button,.pi ::-webkit-outer-spin-button{height:auto}.pi [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.pi ::-webkit-search-decoration{-webkit-appearance:none}.pi ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.pi summary{display:list-item}.pi blockquote,.pi dd,.pi dl,.pi figure,.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6,.pi hr,.pi p,.pi pre{margin:0}.pi fieldset{margin:0;padding:0}.pi legend{padding:0}.pi menu,.pi ol,.pi ul{list-style:none;margin:0;padding:0}.pi textarea{resize:vertical}.pi input::-moz-placeholder,.pi textarea::-moz-placeholder{color:#9ca3af;opacity:1}.pi input::placeholder,.pi textarea::placeholder{color:#9ca3af;opacity:1}.pi [role=button],.pi button{cursor:pointer}.pi :disabled{cursor:default}.pi audio,.pi canvas,.pi embed,.pi iframe,.pi img,.pi object,.pi svg,.pi video{display:block;vertical-align:middle}.pi img,.pi video{height:auto;max-width:100%}.pi *,.pi :after,.pi :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi .container{width:100%}.pi .\\!container{width:100%!important}@media (min-width:640px){.pi .container{max-width:640px}.pi .\\!container{max-width:640px!important}}@media (min-width:768px){.pi .container{max-width:768px}.pi .\\!container{max-width:768px!important}}@media (min-width:1024px){.pi .container{max-width:1024px}.pi .\\!container{max-width:1024px!important}}@media (min-width:1280px){.pi .container{max-width:1280px}.pi .\\!container{max-width:1280px!important}}@media (min-width:1536px){.pi .container{max-width:1536px}.pi .\\!container{max-width:1536px!important}}.pi .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pi .pointer-events-none{pointer-events:none}.pi .pointer-events-auto{pointer-events:auto}.pi .visible{visibility:visible}.pi .\\!visible{visibility:visible!important}.pi .invisible{visibility:hidden}.pi .static{position:static}.pi .fixed{position:fixed}.pi .absolute{position:absolute}.pi .relative{position:relative}.pi .sticky{position:sticky}.pi .inset-0{bottom:0;top:0}.pi .inset-0,.pi .inset-x-0{left:0;right:0}.pi .right-2{right:2px}.pi .top-2{top:2px}.pi .top-0{top:0}.pi .left-0{left:0}.pi .left-16{left:16px}.pi .top-26{top:26px}.pi .-left-5{left:-5px}.pi .-top-5{top:-5px}.pi .bottom-0{bottom:0}.pi .-bottom-5{bottom:-5px}.pi .right-0{right:0}.pi .-right-5{right:-5px}.pi .bottom-20{bottom:20px}.pi .right-20{right:20px}.pi .top-24{top:24px}.pi .-bottom-14{bottom:-14px}.pi .left-30{left:30px}.pi .right-4{right:4px}.pi .top-1\\/2{top:50%}.pi .-bottom-20{bottom:-20px}.pi .left-1\\/2{left:50%}.pi .-bottom-10{bottom:-10px}.pi .-left-8{left:-8px}.pi .-left-80{left:-80px}.pi .-bottom-2{bottom:-2px}.pi .-right-2{right:-2px}.pi .isolate{isolation:isolate}.pi .z-20{z-index:20}.pi .z-modal{z-index:110}.pi .z-10{z-index:10}.pi .z-obj-box{z-index:20}.pi .z-navbar{z-index:40}.pi .z-tool-overlay{z-index:30}.pi .z-50,.pi .z-loading-indicator{z-index:50}.pi .z-popover{z-index:130}.pi .z-tray{z-index:120}.pi .z-toast{z-index:160}.pi .z-tooltip{z-index:150}.pi .z-cropzone{z-index:10}.pi .col-auto{grid-column:auto}.pi .m-auto{margin:auto}.pi .m-10{margin:10px}.pi .my-20{margin-bottom:20px;margin-top:20px}.pi .my-12{margin-bottom:12px;margin-top:12px}.pi .mx-auto{margin-left:auto;margin-right:auto}.pi .my-50{margin-bottom:50px;margin-top:50px}.pi .mx-14{margin-left:14px;margin-right:14px}.pi .my-30{margin-bottom:30px;margin-top:30px}.pi .my-24{margin-bottom:24px;margin-top:24px}.pi .my-80{margin-bottom:80px;margin-top:80px}.pi .my-32{margin-bottom:32px;margin-top:32px}.pi .my-40{margin-bottom:40px;margin-top:40px}.pi .my-8{margin-bottom:8px;margin-top:8px}.pi .my-10{margin-bottom:10px;margin-top:10px}.pi .my-100{margin-bottom:6.25rem;margin-top:6.25rem}.pi .mx-4{margin-left:4px;margin-right:4px}.pi .my-4{margin-bottom:4px;margin-top:4px}.pi .mx-8{margin-left:8px;margin-right:8px}.pi .mx-20{margin-left:20px;margin-right:20px}.pi .my-auto{margin-bottom:auto;margin-top:auto}.pi .mr-5{margin-right:5px}.pi .ml-auto{margin-left:auto}.pi .mr-20{margin-right:20px}.pi .mb-16{margin-bottom:16px}.pi .mr-10{margin-right:10px}.pi .mt-auto{margin-top:auto}.pi .mt-80{margin-top:80px}.pi .mt-30{margin-top:30px}.pi .mt-4{margin-top:4px}.pi .mb-30{margin-bottom:30px}.pi .mb-20{margin-bottom:20px}.pi .mr-auto{margin-right:auto}.pi .mr-24{margin-right:24px}.pi .mb-24{margin-bottom:24px}.pi .mb-14{margin-bottom:14px}.pi .mt-6{margin-top:6px}.pi .mt-12{margin-top:12px}.pi .mb-4{margin-bottom:4px}.pi .mt-14{margin-top:14px}.pi .ml-6{margin-left:6px}.pi .mr-14{margin-right:14px}.pi .mt-8{margin-top:8px}.pi .mb-10{margin-bottom:10px}.pi .mb-8{margin-bottom:8px}.pi .mt-20{margin-top:20px}.pi .mb-1{margin-bottom:1px}.pi .ml-10{margin-left:10px}.pi .mt-10{margin-top:10px}.pi .mt-2{margin-top:2px}.pi .mb-12{margin-bottom:12px}.pi .mb-40{margin-bottom:40px}.pi .mt-40{margin-top:40px}.pi .mb-32{margin-bottom:32px}.pi .mb-64{margin-bottom:64px}.pi .mt-32{margin-top:32px}.pi .mb-48{margin-bottom:48px}.pi .mt-50{margin-top:50px}.pi .mb-6{margin-bottom:6px}.pi .mt-60{margin-top:60px}.pi .-ml-1{margin-left:-1px}.pi .-ml-4{margin-left:-4px}.pi .mr-8{margin-right:8px}.pi .-mr-4{margin-right:-4px}.pi .ml-8{margin-left:8px}.pi .mt-16{margin-top:16px}.pi .mb-2{margin-bottom:2px}.pi .mt-24{margin-top:24px}.pi .-mt-2{margin-top:-2px}.pi .mt-36{margin-top:36px}.pi .mb-110{margin-bottom:110px}.pi .mt-18{margin-top:18px}.pi .mr-6{margin-right:6px}.pi .mr-16{margin-right:16px}.pi .ml-12{margin-left:12px}.pi .mr-4{margin-right:4px}.pi .mr-12{margin-right:12px}.pi .mr-2{margin-right:2px}.pi .mb-18{margin-bottom:18px}.pi .-ml-3{margin-left:-3px}.pi .-ml-12{margin-left:-12px}.pi .-ml-6{margin-left:-6px}.pi .box-content{box-sizing:content-box}.pi .block{display:block}.pi .inline-block{display:inline-block}.pi .inline{display:inline}.pi .flex{display:flex}.pi .inline-flex{display:inline-flex}.pi .table{display:table}.pi .table-cell{display:table-cell}.pi .table-row{display:table-row}.pi .grid{display:grid}.pi .\\!grid{display:grid!important}.pi .contents{display:contents}.pi .hidden{display:none}.pi .aspect-square{aspect-ratio:1/1}.pi .h-2\\/4{height:50%}.pi .h-full{height:100%}.pi .h-font{height:1em}.pi .h-1{height:1px}.pi .h-80{height:80px}.pi .h-400{height:25rem}.pi .h-50{height:50px}.pi .h-42{height:42px}.pi .h-54{height:3.375rem}.pi .h-8{height:8px}.pi .h-24{height:24px}.pi .h-36{height:36px}.pi .h-40{height:40px}.pi .h-20{height:20px}.pi .h-30{height:30px}.pi .h-84{height:84px}.pi .h-68{height:68px}.pi .h-32{height:32px}.pi .h-\\[54px\\]{height:54px}.pi .h-\\[186px\\]{height:186px}.pi .h-60{height:60px}.pi .h-18{height:18px}.pi .h-12{height:12px}.pi .h-26{height:26px}.pi .h-90{height:5.625rem}.pi .h-128{height:128px}.pi .h-6{height:6px}.pi .h-4{height:4px}.pi .h-48{height:48px}.pi .h-2{height:2px}.pi .h-16{height:16px}.pi .h-56{height:56px}.pi .h-64{height:64px}.pi .h-144{height:144px}.pi .h-100{height:6.25rem}.pi .h-max{height:-moz-max-content;height:max-content}.pi .h-px{height:1px}.pi .h-28{height:28px}.pi .h-92{height:92px}.pi .h-14{height:14px}.pi .h-38{height:2.375rem}.pi .h-22{height:22px}.pi .max-h-\\[calc\\(100vh-90px\\)\\]{max-height:calc(100vh - 90px)}.pi .max-h-\\[calc\\(100\\%-40px\\)\\]{max-height:calc(100% - 40px)}.pi .max-h-620{max-height:38.75rem}.pi .max-h-100{max-height:6.25rem}.pi .max-h-\\[36px\\]{max-height:36px}.pi .max-h-8{max-height:8px}.pi .max-h-tray{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .max-h-\\[calc\\(100\\%-30px\\)\\]{max-height:calc(100% - 30px)}.pi .max-h-40{max-height:40px}.pi .max-h-inherit{max-height:inherit}.pi .max-h-\\[583px\\]{max-height:583px}.pi .max-h-full{max-height:100%}.pi .max-h-26{max-height:26px}.pi .max-h-36{max-height:36px}.pi .max-h-dialog{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .max-h-240{max-height:240px}.pi .min-h-440{min-height:27.5rem}.pi .min-h-full{min-height:100%}.pi .min-h-\\[238px\\]{min-height:238px}.pi .min-h-86{min-height:86px}.pi .min-h-90{min-height:5.625rem}.pi .min-h-36{min-height:36px}.pi .min-h-42{min-height:42px}.pi .min-h-dialog{min-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .min-h-50{min-height:50px}.pi .min-h-\\[228px\\]{min-height:228px}.pi .min-h-30{min-height:30px}.pi .min-h-60{min-height:60px}.pi .w-max{width:-moz-max-content;width:max-content}.pi .w-full{width:100%}.pi .w-font{width:1em}.pi .w-80{width:80px}.pi .w-50{width:50px}.pi .w-8{width:8px}.pi .w-24{width:24px}.pi .w-36{width:36px}.pi .w-20{width:20px}.pi .w-30{width:30px}.pi .w-224{width:224px}.pi .w-68{width:68px}.pi .w-96{width:96px}.pi .w-144{width:144px}.pi .w-auto{width:auto}.pi .w-1{width:1px}.pi .w-240{width:240px}.pi .w-\\[168px\\]{width:168px}.pi .w-1\\/2{width:50%}.pi .w-384{width:384px}.pi .w-min{width:-moz-min-content;width:min-content}.pi .w-256{width:256px}.pi .w-18{width:18px}.pi .w-12{width:12px}.pi .w-42{width:42px}.pi .w-60{width:60px}.pi .\\!w-auto{width:auto!important}.pi .w-26{width:26px}.pi .w-32{width:32px}.pi .w-850{width:53.125rem}.pi .w-288{width:288px}.pi .w-320{width:320px}.pi .w-440{width:27.5rem}.pi .w-40{width:40px}.pi .w-64{width:64px}.pi .w-1\\/3{width:33.333333%}.pi .w-16{width:16px}.pi .w-56{width:56px}.pi .w-2{width:2px}.pi .w-110{width:110px}.pi .w-\\[4ch\\]{width:4ch}.pi .w-\\[233px\\]{width:233px}.pi .w-46{width:2.875rem}.pi .w-38{width:2.375rem}.pi .w-\\[210px\\]{width:210px}.pi .w-100{width:6.25rem}.pi .w-620{width:38.75rem}.pi .w-780{width:48.75rem}.pi .w-\\[calc\\(100\\%-40px\\)\\]{width:calc(100% - 40px)}.pi .w-px{width:1px}.pi .w-28{width:28px}.pi .w-90{width:5.625rem}.pi .w-14{width:14px}.pi .w-22{width:22px}.pi .w-280{width:17.5rem}.pi .min-w-0{min-width:0}.pi .min-w-320{min-width:320px}.pi .min-w-80{min-width:80px}.pi .min-w-224{min-width:224px}.pi .min-w-288{min-width:288px}.pi .min-w-240{min-width:240px}.pi .min-w-42{min-width:42px}.pi .min-w-90{min-width:5.625rem}.pi .min-w-180{min-width:11.25rem}.pi .min-w-128{min-width:128px}.pi .min-w-4{min-width:4px}.pi .min-w-192{min-width:192px}.pi .max-w-\\[calc\\(100vw-90px\\)\\]{max-width:calc(100vw - 90px)}.pi .max-w-max{max-width:-moz-max-content;max-width:max-content}.pi .max-w-280{max-width:17.5rem}.pi .max-w-620{max-width:38.75rem}.pi .max-w-440{max-width:27.5rem}.pi .max-w-\\[calc\\(100\\%-40px\\)\\]{max-width:calc(100% - 40px)}.pi .max-w-\\[90\\%\\]{max-width:90%}.pi .max-w-full{max-width:100%}.pi .max-w-500{max-width:31.25rem}.pi .max-w-\\[464px\\]{max-width:464px}.pi .max-w-180{max-width:11.25rem}.pi .max-w-400{max-width:25rem}.pi .max-w-780{max-width:48.75rem}.pi .max-w-375{max-width:375px}.pi .max-w-240{max-width:240px}.pi .max-w-320{max-width:320px}.pi .max-w-288{max-width:288px}.pi .max-w-112{max-width:112px}.pi .max-w-80{max-width:80px}.pi .max-w-850{max-width:53.125rem}.pi .max-w-580{max-width:36.25rem}.pi .max-w-dialog{max-width:calc(var(--be-viewport-width, 100vw)*.9)}.pi .max-w-950{max-width:59.375rem}.pi .flex-auto{flex:1 1 auto}.pi .flex-shrink-0,.pi .shrink-0{flex-shrink:0}.pi .flex-grow-0{flex-grow:0}.pi .origin-\\[100\\%\\]{transform-origin:100%}.pi .-translate-y-1\\/2{--tw-translate-y:-50%}.pi .-translate-x-1\\/2,.pi .-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .-translate-x-1\\/2{--tw-translate-x:-50%}.pi .rotate-180{--tw-rotate:180deg}.pi .rotate-0,.pi .rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-0{--tw-rotate:0deg}.pi .rotate-45{--tw-rotate:45deg}.pi .rotate-45,.pi .rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-90{--tw-rotate:90deg}.pi .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .cursor-pointer{cursor:pointer}.pi .cursor-nwse-resize{cursor:nwse-resize}.pi .cursor-nesw-resize{cursor:nesw-resize}.pi .cursor-se-resize{cursor:se-resize}.pi .cursor-sw-resize{cursor:sw-resize}.pi .cursor-zoom-in{cursor:zoom-in}.pi .cursor-default{cursor:default}.pi .cursor-move{cursor:move}.pi .cursor-not-allowed{cursor:not-allowed}.pi .touch-none{touch-action:none}.pi .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pi .resize-none{resize:none}.pi .resize{resize:both}.pi .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.pi .break-inside-avoid{-moz-column-break-inside:avoid;break-inside:avoid}.pi .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.pi .grid-cols-5-min-content{grid-template-columns:repeat(5,min-content)}.pi .flex-row{flex-direction:row}.pi .flex-col{flex-direction:column}.pi .flex-col-reverse{flex-direction:column-reverse}.pi .flex-wrap{flex-wrap:wrap}.pi .flex-nowrap{flex-wrap:nowrap}.pi .items-start{align-items:flex-start}.pi .items-center{align-items:center}.pi .items-stretch{align-items:stretch}.pi .justify-start{justify-content:flex-start}.pi .justify-end{justify-content:flex-end}.pi .justify-center{justify-content:center}.pi .justify-between{justify-content:space-between}.pi .gap-16{gap:16px}.pi .gap-20{gap:20px}.pi .gap-8{gap:8px}.pi .gap-14{gap:14px}.pi .gap-24{gap:24px}.pi .gap-6{gap:6px}.pi .gap-30{gap:30px}.pi .gap-10{gap:10px}.pi .gap-12{gap:12px}.pi .gap-4{gap:4px}.pi .gap-18{gap:18px}.pi .gap-32{gap:32px}.pi .gap-40{gap:40px}.pi .gap-64{gap:64px}.pi .gap-36{gap:36px}.pi .gap-x-10{-moz-column-gap:10px;column-gap:10px}.pi .space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(10px*var(--tw-space-y-reverse));margin-top:calc(10px*(1 - var(--tw-space-y-reverse)))}.pi .self-stretch{align-self:stretch}.pi .overflow-auto{overflow:auto}.pi .overflow-hidden{overflow:hidden}.pi .overflow-visible{overflow:visible}.pi .overflow-scroll{overflow:scroll}.pi .overflow-x-auto{overflow-x:auto}.pi .overflow-y-auto{overflow-y:auto}.pi .overflow-x-hidden{overflow-x:hidden}.pi .overflow-y-hidden{overflow-y:hidden}.pi .truncate{overflow:hidden;white-space:nowrap}.pi .overflow-ellipsis,.pi .text-ellipsis,.pi .truncate{text-overflow:ellipsis}.pi .whitespace-normal{white-space:normal}.pi .whitespace-nowrap{white-space:nowrap}.pi .whitespace-pre-wrap{white-space:pre-wrap}.pi .break-words{overflow-wrap:break-word}.pi .rounded{border-radius:4px}.pi .rounded-md{border-radius:6px}.pi .rounded-full{border-radius:9999px}.pi .rounded-lg{border-radius:8px}.pi .rounded-none{border-radius:0}.pi .rounded-2xl{border-radius:16px}.pi .rounded-sm{border-radius:2px}.pi .rounded-\\[16px\\]{border-radius:16px}.pi .rounded-\\[64px\\]{border-radius:64px}.pi .rounded-\\[32px\\]{border-radius:32px}.pi .rounded-3xl{border-radius:24px}.pi .rounded-xl{border-radius:12px}.pi .rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.pi .rounded-l{border-bottom-left-radius:4px;border-top-left-radius:4px}.pi .rounded-r-md{border-bottom-right-radius:6px;border-top-right-radius:6px}.pi .rounded-l-md{border-bottom-left-radius:6px;border-top-left-radius:6px}.pi .rounded-r{border-bottom-right-radius:4px;border-top-right-radius:4px}.pi .rounded-l-none{border-bottom-left-radius:0;border-top-left-radius:0}.pi .rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.pi .rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.pi .rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.pi .rounded-tr-none{border-top-right-radius:0}.pi .rounded-br-none{border-bottom-right-radius:0}.pi .rounded-tl-none{border-top-left-radius:0}.pi .rounded-bl-none{border-bottom-left-radius:0}.pi .border{border-width:1px}.pi .border-2{border-width:2px}.pi .border-4{border-width:4px}.pi .border-\\[3px\\]{border-width:3px}.pi .border-y{border-bottom-width:1px;border-top-width:1px}.pi .border-r{border-right-width:1px}.pi .border-l-4{border-left-width:4px}.pi .border-b{border-bottom-width:1px}.pi .border-t-4{border-top-width:4px}.pi .border-r-4{border-right-width:4px}.pi .border-b-4{border-bottom-width:4px}.pi .border-t{border-top-width:1px}.pi .border-l{border-left-width:1px}.pi .border-dotted{border-style:dotted}.pi .border-none{border-style:none}.pi .border-divider{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .border-primary\\/50{border-color:rgb(var(--be-primary)/.5)}.pi .border-danger\\/50{border-color:#ef444480}.pi .border-transparent{border-color:transparent}.pi .border-primary{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-danger{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .border-chip{--tw-border-opacity:1;border-color:rgb(var(--be-background-chip)/var(--tw-border-opacity))}.pi .border-paper{--tw-border-opacity:1;border-color:rgb(var(--be-paper)/var(--tw-border-opacity))}.pi .border-background{--tw-border-opacity:1;border-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-text-muted{border-color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .border-white\\/50{border-color:#ffffff80}.pi .border-l-primary{--tw-border-opacity:1;border-left-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-l-transparent{border-left-color:transparent}.pi .border-l-positive{--tw-border-opacity:1;border-left-color:rgb(34 197 94/var(--tw-border-opacity))}.pi .border-l-warning{--tw-border-opacity:1;border-left-color:rgb(243 164 50/var(--tw-border-opacity))}.pi .border-l-danger{--tw-border-opacity:1;border-left-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .border-r-transparent{border-right-color:transparent}.pi .border-r-primary-light{--tw-border-opacity:1;border-right-color:rgb(var(--be-primary-light)/var(--tw-border-opacity))}.pi .border-b-primary{--tw-border-opacity:1;border-bottom-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .bg-background{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-divider{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .bg-paper{--tw-bg-opacity:1;background-color:rgb(var(--be-paper)/var(--tw-bg-opacity))}.pi .bg{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-alt{--tw-bg-opacity:1;background-color:rgb(var(--be-background-alt)/var(--tw-bg-opacity))}.pi .bg-primary\\/hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .bg-primary{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .bg-positive\\/focus{background-color:rgb(34 197 94/var(--be-focus-opacity))}.pi .bg-warning\\/focus{background-color:rgb(243 164 50/var(--be-focus-opacity))}.pi .bg-danger\\/focus{background-color:rgb(239 68 68/var(--be-focus-opacity))}.pi .bg-primary\\/focus{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .bg-primary\\/5{background-color:rgb(var(--be-primary)/.05)}.pi .bg-controls{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-chip{--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi .bg-primary-light\\/20{background-color:rgb(var(--be-primary-light)/.2)}.pi .bg-primary\\/selected{background-color:rgb(var(--be-primary)/var(--be-selected-opacity))}.pi .bg-warning{--tw-bg-opacity:1;background-color:rgb(243 164 50/var(--tw-bg-opacity))}.pi .bg-transparent{background-color:transparent}.pi .bg-danger{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .bg-toast{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-focus{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .bg-black\\/30{background-color:#0000004d}.pi .bg-primary-light{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-light)/var(--tw-bg-opacity))}.pi .bg-fg-base\\/4{background-color:rgb(var(--be-foreground-base)/4%)}.pi .bg-positive{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.pi .bg-inherit{background-color:inherit}.pi .bg-background\\/70{background-color:rgb(var(--be-background)/.7)}.pi .bg-envato{--tw-bg-opacity:1;background-color:rgb(108 161 43/var(--tw-bg-opacity))}.pi .bg-disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .bg-disabled-fg{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .bg-slider-disabled{--tw-bg-opacity:1;background-color:rgb(189 189 189/var(--tw-bg-opacity))}.pi .bg-primary-dark{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .bg-white\\/50{background-color:#ffffff80}.pi .bg-black\\/50{background-color:#00000080}.pi .bg-primary-light\\/40{background-color:rgb(var(--be-primary-light)/.4)}.pi .bg-positive-lighter{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity))}.pi .bg-danger-lighter{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity))}.pi .bg-opacity-95{--tw-bg-opacity:.95}.pi .bg-no-repeat{background-repeat:no-repeat}.pi .fill-current{fill:currentColor}.pi .fill-transparent{fill:transparent}.pi .stroke-current{stroke:currentColor}.pi .object-contain{-o-object-fit:contain;object-fit:contain}.pi .object-cover{-o-object-fit:cover;object-fit:cover}.pi .p-0{padding:0}.pi .p-14{padding:14px}.pi .p-16{padding:16px}.pi .p-24{padding:24px}.pi .p-10{padding:10px}.pi .p-8{padding:8px}.pi .p-6{padding:6px}.pi .p-12{padding:12px}.pi .p-20{padding:20px}.pi .p-4{padding:4px}.pi .p-18{padding:18px}.pi .p-40{padding:40px}.pi .p-2{padding:2px}.pi .px-24{padding-left:24px;padding-right:24px}.pi .py-20{padding-bottom:20px;padding-top:20px}.pi .px-6{padding-left:6px;padding-right:6px}.pi .px-8{padding-left:8px;padding-right:8px}.pi .py-12{padding-bottom:12px;padding-top:12px}.pi .px-16{padding-left:16px;padding-right:16px}.pi .py-14{padding-bottom:14px;padding-top:14px}.pi .px-14{padding-left:14px;padding-right:14px}.pi .px-20{padding-left:20px;padding-right:20px}.pi .px-32{padding-left:32px;padding-right:32px}.pi .py-10{padding-bottom:10px;padding-top:10px}.pi .px-4{padding-left:4px;padding-right:4px}.pi .px-10{padding-left:10px;padding-right:10px}.pi .py-2{padding-bottom:2px;padding-top:2px}.pi .px-5vw{padding-left:5vw;padding-right:5vw}.pi .px-12{padding-left:12px;padding-right:12px}.pi .py-\\[9px\\]{padding-bottom:9px;padding-top:9px}.pi .px-40{padding-left:40px;padding-right:40px}.pi .py-32{padding-bottom:32px;padding-top:32px}.pi .px-28{padding-left:28px;padding-right:28px}.pi .py-56{padding-bottom:56px;padding-top:56px}.pi .py-28{padding-bottom:28px;padding-top:28px}.pi .py-90{padding-bottom:5.625rem;padding-top:5.625rem}.pi .py-4{padding-bottom:4px;padding-top:4px}.pi .px-18{padding-left:18px;padding-right:18px}.pi .px-22{padding-left:22px;padding-right:22px}.pi .px-26{padding-left:26px;padding-right:26px}.pi .py-8{padding-bottom:8px;padding-top:8px}.pi .py-96{padding-bottom:96px;padding-top:96px}.pi .py-6{padding-bottom:6px;padding-top:6px}.pi .py-3{padding-bottom:3px;padding-top:3px}.pi .py-5{padding-bottom:5px;padding-top:5px}.pi .py-40{padding-bottom:40px;padding-top:40px}.pi .pt-14{padding-top:14px}.pi .pt-24{padding-top:24px}.pi .pb-12{padding-bottom:12px}.pi .pt-26{padding-top:26px}.pi .pb-16{padding-bottom:16px}.pi .pb-24{padding-bottom:24px}.pi .pt-50{padding-top:50px}.pi .pt-20{padding-top:20px}.pi .pb-10{padding-bottom:10px}.pi .pb-4{padding-bottom:4px}.pi .pr-10{padding-right:10px}.pi .pl-10{padding-left:10px}.pi .pb-20{padding-bottom:20px}.pi .pb-30{padding-bottom:30px}.pi .pt-30{padding-top:30px}.pi .pl-8{padding-left:8px}.pi .pb-14{padding-bottom:14px}.pi .pl-14{padding-left:14px}.pi .pt-54{padding-top:3.375rem}.pi .pb-28{padding-bottom:28px}.pi .pb-48{padding-bottom:48px}.pi .pb-safe-area{padding-bottom:env(safe-area-inset-bottom)}.pi .pl-24{padding-left:24px}.pi .pr-16{padding-right:16px}.pi .pr-24{padding-right:24px}.pi .pl-16{padding-left:16px}.pi .pr-6{padding-right:6px}.pi .pb-18{padding-bottom:18px}.pi .pt-6{padding-top:6px}.pi .pt-16{padding-top:16px}.pi .pt-10{padding-top:10px}.pi .pl-12{padding-left:12px}.pi .pr-12{padding-right:12px}.pi .pb-6{padding-bottom:6px}.pi .pt-42{padding-top:42px}.pi .pb-32{padding-bottom:32px}.pi .pt-70{padding-top:70px}.pi .pt-40{padding-top:40px}.pi .pr-8{padding-right:8px}.pi .pl-46{padding-left:2.875rem}.pi .pr-46{padding-right:2.875rem}.pi .pl-6{padding-left:6px}.pi .pl-18{padding-left:18px}.pi .pr-18{padding-right:18px}.pi .text-left{text-align:left}.pi .text-center{text-align:center}.pi .text-right{text-align:right}.pi .align-top{vertical-align:top}.pi .align-middle{vertical-align:middle}.pi .text-sm{font-size:14px;line-height:20px}.pi .text-xs{font-size:12px;line-height:16px}.pi .text-xl{font-size:20px;line-height:28px}.pi .text-6xl{font-size:60px;line-height:1}.pi .text-2xl{font-size:24px;line-height:32px}.pi .text-3xl{font-size:30px;line-height:36px}.pi .text-base{font-size:16px;line-height:24px}.pi .text-lg{font-size:18px;line-height:28px}.pi .text-4xl{font-size:36px;line-height:40px}.pi .font-medium{font-weight:500}.pi .font-semibold{font-weight:600}.pi .font-light{font-weight:300}.pi .font-bold{font-weight:700}.pi .font-normal{font-weight:400}.pi .uppercase{text-transform:uppercase}.pi .capitalize{text-transform:capitalize}.pi .italic{font-style:italic}.pi .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.pi .leading-none{line-height:1}.pi .leading-5{line-height:1.25rem}.pi .tracking-wide{letter-spacing:.025em}.pi .text,.pi .text-main{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.pi .text-muted{color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .text-positive{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.pi .text-danger{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.pi .text-primary{--tw-text-opacity:1;color:rgb(var(--be-primary)/var(--tw-text-opacity))}.pi .\\!text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))!important}.pi .text-facebook{--tw-text-opacity:1;color:rgb(59 89 152/var(--tw-text-opacity))}.pi .text-twitter{--tw-text-opacity:1;color:rgb(29 161 242/var(--tw-text-opacity))}.pi .text-positive-darker{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.pi .text-disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .text-on-primary{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .text-primary-light{--tw-text-opacity:1;color:rgb(var(--be-primary-light)/var(--tw-text-opacity))}.pi .text-primary\\/40{color:rgb(var(--be-primary)/.4)}.pi .text-black\\/30{color:#0000004d}.pi .text-danger-darker{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.pi .underline{text-decoration-line:underline}.pi .no-underline{text-decoration-line:none}.pi .caret-transparent{caret-color:transparent}.pi .opacity-0{opacity:0}.pi .opacity-100{opacity:1}.pi .opacity-80{opacity:.8}.pi .opacity-90{opacity:.9}.pi .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.pi .shadow,.pi .shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.pi .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.pi .shadow-\\[15px_0_30px_0_rgb\\(0_0_0_\\/_18\\%\\)\\],.pi .shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-\\[15px_0_30px_0_rgb\\(0_0_0_\\/_18\\%\\)\\]{--tw-shadow:15px 0 30px 0 rgba(0,0,0,.18);--tw-shadow-colored:15px 0 30px 0 var(--tw-shadow-color)}.pi .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.pi .shadow-md,.pi .shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.pi .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .outline-none{outline:2px solid transparent;outline-offset:2px}.pi .outline{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .ring-inset{--tw-ring-inset:inset}.pi .ring-offset-4{--tw-ring-offset-width:4px}.pi .blur{--tw-blur:blur(8px)}.pi .blur,.pi .grayscale{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .grayscale{--tw-grayscale:grayscale(100%)}.pi .invert{--tw-invert:invert(100%)}.pi .invert,.pi .sepia{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .sepia{--tw-sepia:sepia(100%)}.pi .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-shadow{transition-duration:.15s;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-bg-color{transition-duration:.15s;transition-property:background-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-button{transition-duration:.15s;transition-property:background-color,box-shadow,border-color,color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-width{transition-duration:.15s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .duration-200{transition-duration:.2s}.pi .duration-100{transition-duration:.1s}.pi .will-change-\\[width\\]{will-change:width}.pi .will-change-transform{will-change:transform}.pi .icon-2xs{font-size:.75rem}.pi .icon-xs{font-size:1rem}.pi .icon-sm{font-size:1.25rem}.pi .icon-md{font-size:1.5rem}.pi .icon-lg{font-size:2.1875rem}.pi .icon-xl{font-size:2.6875rem}.pi .col-w-1{flex:1 0 0px}.pi .col-w-2{flex:2 0 0px}.pi .col-w-3{flex:3 0 0px}.pi .no-tap-highlight{-webkit-tap-highlight-color:transparent}@media only screen and (min-device-width:768px){.pi .tiny-scrollbar{scrollbar-color:rgba(0,0,0,.2) transparent;scrollbar-width:thin}.pi .tiny-scrollbar::-webkit-scrollbar{background-color:transparent;height:6px;width:6px}.pi .tiny-scrollbar::-webkit-scrollbar-thumb{background-color:rgb(var(--be-foreground-base)/.2);border-radius:10px}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:start{background:transparent}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:end{background:transparent}}.pi .hide-scrollbar{scrollbar-width:none}.pi .hide-scrollbar::-webkit-scrollbar{background:transparent;height:0;width:0}.pi .svg-icon{fill:currentColor;display:inline-block;flex-shrink:0;transition-duration:.15s;transition-property:transform,fill;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;user-select:none}.pi .cropzone:not(.moving) .cropzone-transition{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .first-letter\\:capitalize:first-letter{text-transform:capitalize}.pi .file\\:mr-10::file-selector-button{margin-right:10px}.pi .file\\:h-24::file-selector-button{height:24px}.pi .file\\:rounded::file-selector-button{border-radius:4px}.pi .file\\:border-none::file-selector-button{border-style:none}.pi .file\\:bg-primary::file-selector-button{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .file\\:px-10::file-selector-button{padding-left:10px;padding-right:10px}.pi .file\\:text-sm::file-selector-button{font-size:14px;line-height:20px}.pi .file\\:font-semibold::file-selector-button{font-weight:600}.pi .file\\:text-on-primary::file-selector-button{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .before\\:absolute:before{content:var(--tw-content);position:absolute}.pi .before\\:left-0:before{content:var(--tw-content);left:0}.pi .before\\:top-1\\/2:before{content:var(--tw-content);top:50%}.pi .before\\:z-10:before{content:var(--tw-content);z-index:10}.pi .before\\:block:before{content:var(--tw-content);display:block}.pi .before\\:h-1:before{content:var(--tw-content);height:1px}.pi .before\\:h-full:before{content:var(--tw-content);height:100%}.pi .before\\:h-28:before{content:var(--tw-content);height:28px}.pi .before\\:h-22:before{content:var(--tw-content);height:22px}.pi .before\\:h-18:before{content:var(--tw-content);height:18px}.pi .before\\:h-12:before{content:var(--tw-content);height:12px}.pi .before\\:h-14:before{content:var(--tw-content);height:14px}.pi .before\\:w-full:before{content:var(--tw-content);width:100%}.pi .before\\:w-28:before{content:var(--tw-content);width:28px}.pi .before\\:w-22:before{content:var(--tw-content);width:22px}.pi .before\\:w-18:before{content:var(--tw-content);width:18px}.pi .before\\:w-12:before{content:var(--tw-content);width:12px}.pi .before\\:w-14:before{content:var(--tw-content);width:14px}.pi .before\\:-translate-y-1\\/2:before{--tw-translate-y:-50%}.pi .before\\:-translate-y-1\\/2:before,.pi .before\\:translate-x-2:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .before\\:translate-x-2:before{--tw-translate-x:2px}.pi .before\\:scale-10:before{--tw-scale-x:.1;--tw-scale-y:.1;content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .before\\:rounded-full:before{border-radius:9999px;content:var(--tw-content)}.pi .before\\:rounded-3xl:before{border-radius:24px;content:var(--tw-content)}.pi .before\\:border:before{border-width:1px;content:var(--tw-content)}.pi .before\\:bg-divider:before{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity));content:var(--tw-content)}.pi .before\\:bg-primary:before{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity));content:var(--tw-content)}.pi .before\\:bg-white:before{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));content:var(--tw-content)}.pi .before\\:opacity-0:before{content:var(--tw-content);opacity:0}.pi .before\\:transition:before{content:var(--tw-content);transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:transition-transform:before{content:var(--tw-content);transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:duration-200:before{content:var(--tw-content);transition-duration:.2s}.pi .before\\:content-\\[\\\\\\\\00a0\\]:before{--tw-content:\\\\00a0;content:var(--tw-content)}.pi .after\\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.pi .after\\:absolute:after{content:var(--tw-content);position:absolute}.pi .after\\:inset-0:after{bottom:0;content:var(--tw-content);left:0;right:0;top:0}.pi .first\\:capitalize:first-child{text-transform:capitalize}.pi .checked\\:border-primary:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .checked\\:border-danger:checked{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .checked\\:bg-primary:checked{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .checked\\:bg-danger:checked{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .checked\\:before\\:translate-x-36:checked:before{--tw-translate-x:36px}.pi .checked\\:before\\:translate-x-30:checked:before,.pi .checked\\:before\\:translate-x-36:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-30:checked:before{--tw-translate-x:30px}.pi .checked\\:before\\:translate-x-24:checked:before{--tw-translate-x:24px}.pi .checked\\:before\\:translate-x-16:checked:before,.pi .checked\\:before\\:translate-x-24:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-16:checked:before{--tw-translate-x:16px}.pi .checked\\:before\\:translate-x-20:checked:before{--tw-translate-x:20px}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before,.pi .checked\\:before\\:translate-x-20:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before{--tw-scale-x:.65;--tw-scale-y:.65}.pi .checked\\:before\\:border-white:checked:before{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity));content:var(--tw-content)}.pi .checked\\:before\\:opacity-100:checked:before{content:var(--tw-content);opacity:1}.pi .focus-within\\:border-primary\\/60:focus-within{border-color:rgb(var(--be-primary)/.6)}.pi .focus-within\\:ring:focus-within{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-within\\:ring-primary\\/focus:focus-within{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus-within\\:ring-primary-light:focus-within{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--be-primary-light)/var(--tw-ring-opacity))}.pi .hover\\:scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05}.pi .hover\\:scale-105:hover,.pi .hover\\:scale-110:hover{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1}.pi .hover\\:cursor-move:hover{cursor:move}.pi .hover\\:border-primary:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .hover\\:border-danger:hover{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .hover\\:border-primary-dark:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .hover\\:border-danger\\/90:hover{border-color:#ef4444e6}.pi .hover\\:border-chip\\/90:hover{border-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:bg-hover:hover{background-color:rgb(var(--be-foreground-base)/var(--be-hover-opacity))}.pi .hover\\:bg-primary\\/10:hover{background-color:rgb(var(--be-primary)/.1)}.pi .hover\\:bg-white\\/hover:hover{background-color:rgb(255 255 255/var(--be-hover-opacity))}.pi .hover\\:bg-primary\\/hover:hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .hover\\:bg-danger\\/4:hover{background-color:#ef44440a}.pi .hover\\:bg-primary\\/4:hover{background-color:rgb(var(--be-primary)/4%)}.pi .hover\\:bg-primary-dark:hover{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:bg-danger\\/90:hover{background-color:#ef4444e6}.pi .hover\\:bg-chip\\/90:hover{background-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:bg-paper\\/90:hover{background-color:rgb(var(--be-paper)/.9)}.pi .hover\\:bg-primary\\/focus:hover{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:bg-fg-base\\/15:hover{background-color:rgb(var(--be-foreground-base)/15%)}.pi .hover\\:text-primary-dark:hover{--tw-text-opacity:1;color:rgb(var(--be-primary-dark)/var(--tw-text-opacity))}.pi .hover\\:text-main:hover{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .hover\\:text-fg-base:hover{--tw-text-opacity:1;color:rgb(var(--be-foreground-base)/var(--tw-text-opacity))}.pi .hover\\:underline:hover{text-decoration-line:underline}.pi .hover\\:opacity-100:hover{opacity:1}.pi .hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .before\\:hover\\:bg-primary-dark:hover:before{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity));content:var(--tw-content)}.pi .hover\\:after\\:bg-black\\/5:hover:after{background-color:#0000000d;content:var(--tw-content)}.pi .checked\\:hover\\:border-primary-dark:hover:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .focus\\:border-danger\\/60:focus{border-color:#ef444499}.pi .focus\\:border-primary\\/60:focus{border-color:rgb(var(--be-primary)/.6)}.pi .focus\\:bg-primary:focus{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .focus\\:text-on-primary:focus{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.pi .focus\\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.pi .focus\\:ring-2:focus,.pi .focus\\:ring:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.pi .focus\\:ring-danger\\/focus:focus{--tw-ring-color:rgb(239 68 68/var(--be-focus-opacity))}.pi .focus\\:ring-primary\\/focus:focus{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px}.pi .focus\\:after\\:bg-black\\/10:focus:after{background-color:#0000001a;content:var(--tw-content)}.pi .focus-visible\\:bg-primary\\/focus:focus-visible{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus-visible\\:bg-focus:focus-visible{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .focus-visible\\:outline:focus-visible{outline-style:solid;outline-width:2px}.pi .focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.pi .focus-visible\\:outline:focus-visible{outline-color:rgb(var(--be-primary-lighter)/1)}.pi .focus-visible\\:outline-primary-light:focus-visible{outline-color:rgb(var(--be-primary-light)/1)}.pi .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .disabled\\:pointer-events-none:disabled{pointer-events:none}.pi .disabled\\:cursor-default:disabled{cursor:default}.pi .disabled\\:border-disabled-bg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:border-transparent:disabled{border-color:transparent}.pi .disabled\\:border-disabled-fg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:border-r-transparent:disabled{border-right-color:transparent}.pi .disabled\\:bg-transparent:disabled{background-color:transparent}.pi .disabled\\:bg-disabled:disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:text-disabled:disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:shadow-none:disabled{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .disabled\\:before\\:bg-disabled-fg:disabled:before{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity));content:var(--tw-content)}.pi .dark .dark\\:bg-alt{--tw-bg-opacity:1;background-color:rgb(var(--be-background-alt)/var(--tw-bg-opacity))}.pi .dark .dark\\:bg-none{background-image:none}.pi .dark .dark\\:text-white\\/50{color:#ffffff80}.pi .dark .dark\\:opacity-5{opacity:.05}.pi .dark .dark\\:opacity-80{opacity:.8}.pi .dark .dark\\:checked\\:border-primary-dark:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .dark .dark\\:checked\\:bg-primary-dark:checked{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}@media (min-width:640px){.pi .sm\\:justify-start{justify-content:flex-start}.pi .sm\\:text-sm{font-size:14px;line-height:20px}}@media (min-width:768px){.pi .md\\:invisible{visibility:hidden}.pi .md\\:my-24{margin-bottom:24px;margin-top:24px}.pi .md\\:mx-40{margin-left:40px;margin-right:40px}.pi .md\\:my-64{margin-bottom:64px;margin-top:64px}.pi .md\\:my-100{margin-bottom:6.25rem;margin-top:6.25rem}.pi .md\\:mr-0{margin-right:0}.pi .md\\:mb-0{margin-bottom:0}.pi .md\\:mr-10{margin-right:10px}.pi .md\\:mb-40{margin-bottom:40px}.pi .md\\:mb-24{margin-bottom:24px}.pi .md\\:mt-60{margin-top:60px}.pi .md\\:mb-70{margin-bottom:70px}.pi .md\\:mt-0{margin-top:0}.pi .md\\:mr-24{margin-right:24px}.pi .md\\:mr-80{margin-right:80px}.pi .md\\:block{display:block}.pi .md\\:flex{display:flex}.pi .md\\:h-0{height:0}.pi .md\\:w-min{width:-moz-min-content;width:min-content}.pi .md\\:w-320{width:320px}.pi .md\\:w-400{width:25rem}.pi .md\\:min-w-440{min-width:27.5rem}.pi .md\\:max-w-950{max-width:59.375rem}.pi .md\\:max-w-350{max-width:21.875rem}.pi .md\\:flex-row{flex-direction:row}.pi .md\\:items-start{align-items:flex-start}.pi .md\\:gap-12{gap:12px}.pi .md\\:gap-24{gap:24px}.pi .md\\:gap-80{gap:80px}.pi .md\\:gap-112{gap:112px}.pi .md\\:overflow-hidden{overflow:hidden}.pi .md\\:p-24{padding:24px}.pi .md\\:px-24{padding-left:24px;padding-right:24px}.pi .md\\:px-30{padding-left:30px;padding-right:30px}.pi .md\\:px-0{padding-left:0;padding-right:0}.pi .md\\:px-20{padding-left:20px;padding-right:20px}.pi .md\\:py-80{padding-bottom:80px;padding-top:80px}.pi .md\\:px-176{padding-left:176px;padding-right:176px}.pi .md\\:px-10vw{padding-left:10vw;padding-right:10vw}.pi .md\\:pt-128{padding-top:128px}.pi .md\\:pl-20{padding-left:20px}.pi .md\\:pb-0{padding-bottom:0}.pi .md\\:pb-54{padding-bottom:3.375rem}.pi .md\\:text-left{text-align:left}.pi .md\\:text-3xl{font-size:30px;line-height:36px}.pi .md\\:text-4xl{font-size:36px;line-height:40px}.pi .md\\:text-lg{font-size:18px;line-height:28px}.pi .md\\:text-base{font-size:16px;line-height:24px}.pi .md\\:font-medium{font-weight:500}.pi .md\\:font-normal{font-weight:400}.pi .md\\:shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}}@media (min-width:1024px){.pi .lg\\:min-w-500{min-width:31.25rem}.pi .lg\\:flex-row{flex-direction:row}.pi .lg\\:items-center{align-items:center}.pi .lg\\:px-96{padding-left:96px;padding-right:96px}.pi .lg\\:py-96{padding-bottom:96px;padding-top:96px}.pi .lg\\:pb-0{padding-bottom:0}}@media (min-width:1280px){.pi .xl\\:w-1\\/2{width:50%}.pi .xl\\:pt-96{padding-top:96px}}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-2:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-inset:focus-visible>.tree-label{--tw-ring-inset:inset}\n'),!e.selector)throw new Error('Pixie required "selector" option.');const t=document.querySelector(e.selector);t&&(t.classList.add("pi"),function(e){Uh=e}(t),this.setConfig(e),Yh.setState({editor:this}),sd(t).render(Al(i.StrictMode,{children:Al(EI,{})})))}get state(){return $h()}get defaultConfig(){return PI.defaultConfig}open(e={}){var t;null!=(t=$h().config.ui)&&t.visible||(this.setConfig(zi(e,{ui:{visible:!0}})),requestAnimationFrame(()=>{var e,t,n,r;Gh().zoom.fitToScreen(),Gh().history.addInitial(),td()&&(null==(t=null==(e=$h().config.ui)?void 0:e.openImageDialog)?void 0:t.show)&&this.togglePanel("newImage",!0),null==(r=(n=$h().config).onOpen)||r.call(n)}))}close(){var e,t,n;null==(e=$h().config.ui)||!e.visible||(this.setConfig({ui:{visible:!1}}),null==(n=(t=$h().config).onClose)||n.call(t))}setConfig(e){$h().setConfig(e)}uploadAndAddImage(){return Gh().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return Gh().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return Gh().import.uploadAndOpenStateFile()}newCanvas(e,t,n){return Gh().canvas.openNew(e,t,n)}getState(e){return JSON.stringify(Jh(e))}setState(e){return Gh().import.loadState(e)}async setStateFromUrl(e){const t=await qh(e);return Gh().import.loadState(t)}openTool(e){Qh(e)}applyChanges(){$h().applyChanges()}cancelChanges(){$h().cancelChanges()}async resetEditor(e){await Kh(e),await Gh().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&$h().togglePanel("history",!1),"history"===e&&$h().togglePanel("objects",!1),$h().togglePanel(e,t)}on(e,t){var n;null==(n=this.fabric)||n.on(e,t)}isDirty(){return $h().dirty}get(e){return this.tools[e]}notify(e){return ad(e)}static init(e){return new Promise(t=>{const n=e.onLoad;e.onLoad=e=>{null==n||n(e),t(e)},new this(e)})}};let MI=PI;Ti(MI,"defaultConfig",uc),Ti(MI,"version",cc);const jI=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob());const FI=({visible:n,onClose:i,file:o,onSave:a})=>{const[s,l]=r.useState(null),[c,u]=r.useState(null),[h,d]=r.useState(""),[f,p]=r.useState(!1),[g,m]=r.useState(!1),v=Wr(),b=r.useRef(!1),y=r.useRef(),w=r.useRef(void 0),[x,_]=r.useState(null);r.useEffect(()=>{o&&(async()=>{if(w.current!==o)if("object"!=typeof o)try{if(w.current=o,o.startsWith("data:"))_({thumbnail:o});else{const e=await v.handleAddFileByUrl(o,!0);if(!e)throw new Error("Не удалось загрузить файл");w.current===o&&_(e)}}finally{w.current===o&&(w.current=null)}else _(o)})()},[o,_]),y.current=a;const C=r.useCallback(async e=>{try{if(e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await v.getFileData(e.id);if(!t)throw new Error("Ошибка загрузки файла");return new Promise(e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(t)})}catch(e){throw console.error("Ошибка получения данных изображения:",e),e}},[v.getFileData]);r.useEffect(()=>{(async()=>{try{const e=x?await C(x):null;u(e);const t=x?x.type:"";d(t||"image/png")}catch(e){console.error("🎨 Ошибка загрузки изображения:",e),M.error("Ошибка загрузки изображения"),null==i||i()}})()},[n,x,C,i]);const S=r.useCallback(async(e,t,n)=>{if(x&&y.current)try{const t=await function(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});let n=`image/${e}`;if("jpg"===e&&(n="image/jpeg"),t.startsWith("data:")){const e=t.match(/^data:([^;]+)/);e&&e[1].startsWith("image/")&&(n=e[1]);const r=t.replace(/data:image\/[^;]+;base64,/,"");return jI(r,n)}return jI(t,n)}(n,e);let r=t.type||`image/${n}`;"jpg"===n&&(r="image/jpeg");const o=e.startsWith("data:")?e:`data:${r};base64,${e}`,a=Object.assign(Object.assign({},x),{thumbnail:o,size:t.size.toString(),date:(new Date).toISOString().split("T")[0],type:r,folderId:x.folderId||"",name:x.name,extension:x.extension});await y.current(a),null==i||i()}catch(e){console.error("Ошибка сохранения:",e),M.error("Ошибка при сохранении изображения")}},[x,i]),A=r.useCallback(async()=>{if(!s||!x)return void console.error("❌ Pixie instance или file отсутствует");const e=x.name||"edited-image",t=x.extension||h.split("/")[1]||"png";try{await s.tools.export.save(e.replace(/\.[^/.]+$/,""),t)}catch(n){console.error("🎨 Ошибка при сохранении через кнопку:",n);try{const n=document.querySelector("#pixie-editor canvas"),r=n?n.toDataURL(`image/${t}`):null;r&&await S(r,e,t)}catch(e){console.error("🎨 Альтернативный способ тоже не сработал:",e)}}},[s,x,h,S]),k=r.useCallback(async()=>{var e;if(c&&n&&f&&!b.current)try{b.current=!0;const t=document.getElementById("pixie-editor");if(!t)throw new Error("Контейнер #pixie-editor не найден");let n=0;for(;n<20&&(0===t.clientWidth||0===t.clientHeight);)await new Promise(e=>setTimeout(e,50)),n++;const r={selector:"#pixie-editor",image:c,activeLanguage:"ru-RU",ui:{mode:"inline",forceOverlayModeOnMobile:!1,visible:!0},tools:{filter:{items:["crop","resize","draw","text","shapes","frame","export","import"]}},onLoad:()=>{try{const e=document.querySelector("#pixie-editor canvas");e&&e.focus(),m(!0)}catch(e){console.warn("Pixie onLoad focus failed:",e)}},onSave:async function(e,t,n){try{return await S(e,t,n)}catch(e){throw console.error("🎨 PIXIE onSave ERROR:",e),e}}};if(s)try{m(!1);const t=s.resetEditor;"function"==typeof t?(await t({image:c,ui:{visible:!0}}),m(!0)):(null===(e=s.setConfig)||void 0===e||e.call(s,{image:c,ui:{visible:!0}}),m(!0))}catch(e){console.error("resetEditor/setConfig failed:",e)}else{const e=await MI.init(r);l(e),"function"==typeof e.setConfig&&(setTimeout(()=>{var t;return null===(t=e.setConfig)||void 0===t?void 0:t.call(e,{ui:{visible:!0}})},0),setTimeout(()=>{var t;return null===(t=e.setConfig)||void 0===t?void 0:t.call(e,{ui:{visible:!0}})},200)),setTimeout(()=>m(!0),700)}}catch(e){console.error("Ошибка инициализации Pixie:",e),M.error("Ошибка инициализации редактора"),b.current=!1,null==i||i()}},[c,n,f,i,S,s]);return r.useEffect(()=>{n&&c&&f&&k()},[n,c,f,null==x?void 0:x.id,k]),r.useEffect(()=>{var e;if(!n){try{null===(e=null==s?void 0:s.close)||void 0===e||e.call(s)}catch(e){console.warn("Ошибка при закрытии Pixie:",e)}u(null),d(""),b.current=!1,p(!1),m(!1)}},[n,s]),r.useEffect(()=>{if(g&&s&&"function"==typeof s.open)try{s.open()}catch(e){console.warn("Pixie open() after ready failed:",e)}},[g,s]),r.useEffect(()=>{if(!n||!s)return;let e=!1,t=0;const r=()=>{if(e)return;const n=document.querySelector("#pixie-editor .pixie-root"),i=document.querySelector("#pixie-editor canvas"),o=n&&"none"!==n.style.display&&"0"!==n.style.opacity,a=!!(i&&i.width>0&&i.height>0);if(n&&!o&&"function"==typeof s.setConfig)try{s.setConfig({ui:{visible:!0}})}catch(e){console.warn("setConfig visible failed",e)}a?m(!0):t<30&&(t+=1,setTimeout(r,100))};return r(),()=>{e=!0}},[n,s]),e(H,{title:`Редактирование: ${(null==x?void 0:x.name)||"Изображение"}`,open:n,onCancel:i,afterOpenChange:e=>p(e),forceRender:!0,width:"95vw",style:{top:20},styles:{body:{height:"85vh",padding:0}},footer:[e(X,{onClick:i,children:"Отмена"},"cancel"),e(X,{type:"primary",onClick:A,children:"Сохранить"},"save")],maskClosable:!1,destroyOnClose:!1,children:t("div",{style:{position:"relative",width:"100%",height:"100%"},children:[e("div",{id:"pixie-editor",style:{width:"100%",height:"85vh",minHeight:400}}),n&&!g?e("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.45)",backdropFilter:"blur(1px)",pointerEvents:"all",zIndex:10},children:e("span",{style:{fontSize:14,color:"#555"},children:"Загрузка редактора…"})}):null]})})};var RI="container",DI="uploadCard",LI="header",NI="headerButton",zI="fileList",BI="fileItem",VI="fileAvatar",UI="fileInfo",HI="fileName",WI="fileSize",YI="progressBar",$I="errorNote",GI="minimizedContainer",XI="minimizedButton";const{Text:KI}=K,qI=({visible:n,files:r,totalFiles:i,completedFiles:o,onClose:a,onMinimize:s,onInsert:l,minimized:c=!1})=>{if(!n)return null;const{token:u}=T.useToken(),h=t=>{switch(t){case"success":return e(Se,{style:{color:u.colorSuccess}});case"error":return e(Ce,{style:{color:u.colorError}});default:return e(_e,{style:{color:"#1890ff"}})}},d=e=>{if(e.includes("КБ")||e.includes("MB")||e.includes("KB"))return e;const t=parseInt(e);return isNaN(t)?e:`${(t/1024).toFixed(2)} КБ`},f=t=>"success"===t.status?[e(X,{type:"primary",size:"small",onClick:()=>l(t.id),children:"Insert"},"insert")]:"error"===t.status?[e(KI,{type:"danger",style:{fontSize:"12px"},children:t.error||"Error"},"error")]:[];return e("div",c?{className:GI,children:t(X,{type:"primary",size:"small",onClick:s,className:XI,children:["Загрузка ",o,"/",i]})}:{className:RI,children:t(U,{className:DI,size:"small",title:t("div",{className:LI,children:[t(KI,{strong:!0,children:["Uploaded ",o,"/",i," files"]}),t(Q,{children:[e(X,{type:"text",size:"small",icon:e(we,{}),onClick:s,className:NI}),e(X,{type:"text",size:"small",icon:e(xe,{}),onClick:a,className:NI})]})]}),bodyStyle:{padding:"12px"},children:[e(q,{className:zI,size:"small",dataSource:r,renderItem:n=>e(q.Item,{className:BI,actions:f(n),children:e(q.Item.Meta,{avatar:e(J,{size:"small",icon:h(n.status),className:VI}),title:t("div",{className:UI,children:[e(KI,{ellipsis:!0,className:HI,children:n.name}),e(KI,{type:"secondary",className:WI,children:d(n.size)})]}),description:"uploading"===n.status&&e(Z,{percent:n.progress,size:"small",status:"active",showInfo:!1,className:YI})})})}),r.some(e=>"error"===e.status)&&e("div",{className:$I,children:e(KI,{type:"danger",style:{fontSize:"12px"},children:"Некоторые файлы не удалось загрузить. Проверьте размер и формат файлов."})})]})})},{Header:ZI}=ee,{Text:JI,Title:QI}=K,eO=({selectedFiles:i,onClearSelection:o,onRename:a,onDelete:s,onCopy:l,onMove:c,onEdit:u,files:h})=>{const{t:d}=gr(),f=i.size,p=r.useMemo(()=>{var e,t;if(1!==f)return!1;const n=Array.from(i)[0],r=h.find(e=>e.id===n);if(!r||r.isFolder)return!1;let o=!1;if(r.type&&r.type.startsWith("image/"))o=!0;else if(r.extension){const e=r.extension.toLowerCase();o=Lr.includes(e)}else{const t=null===(e=r.name.split(".").pop())||void 0===e?void 0:e.toLowerCase();o=!!t&&Lr.includes(t)}return console.log("isImageSelected проверка:",{fileName:r.name,fileType:r.type,fileExtension:r.extension,nameExtension:null===(t=r.name.split(".").pop())||void 0===t?void 0:t.toLowerCase(),isImage:o,IMAGE_EXTENSIONS:Lr}),o},[f,i,h]);return t(ZI,{className:"actions-header",children:[t("div",{className:"header-title-container",children:[e(QI,{level:5,className:"header-title",children:d("Files")}),f>0&&t(JI,{type:"secondary",className:"selected-text",children:[f," ",d("selected")]})]}),e(Q,{children:f>0?t(n,{children:[e(X,{icon:e(xe,{}),onClick:o,children:d("Deselected")}),e(X,{icon:e(ye,{}),onClick:a,disabled:1!==f,children:d("Rename")}),e(X,{icon:e(Ae,{}),onClick:u,disabled:!p,title:p?"Редактировать изображение":"Выберите одно изображение для редактирования",children:d("Edit")}),e(X,{icon:e(ke,{}),onClick:l,children:d("Copy")}),e(X,{icon:e(ve,{}),onClick:c,children:d("Move to folder")}),e(X,{danger:!0,icon:e(Te,{}),onClick:s,children:d("Delete")})]}):null})]})};
81
81
  /*! *****************************************************************************
82
82
  Copyright (c) Microsoft Corporation. All rights reserved.
83
83
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -92,5 +92,5 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
92
92
  See the Apache Version 2.0 License for specific language governing permissions
93
93
  and limitations under the License.
94
94
  ***************************************************************************** */
95
- var tO=function(e,t){return tO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},tO(e,t)};var nO=function(){return nO=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},nO.apply(this,arguments)};var rO="Pixel",iO="Percent",oO={unit:iO,value:.8};function aO(e){return"number"==typeof e?{unit:iO,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:rO,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:iO,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),oO):(console.warn("scrollThreshold should be string or number"),oO)}var sO=function(e){function t(t){var n=e.call(this,t)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(null===n.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},n.onStart=function(e){n.lastScrollTop||(n.dragging=!0,e instanceof MouseEvent?n.startY=e.pageY:e instanceof TouchEvent&&(n.startY=e.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(e){n.dragging&&(e instanceof MouseEvent?n.currentY=e.pageY:e instanceof TouchEvent&&(n.currentY=e.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")})},n.onScrollListener=function(e){"function"==typeof n.props.onScroll&&setTimeout(function(){return n.props.onScroll&&n.props.onScroll(e)},0);var t=n.props.height||n._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(t,n.props.scrollThreshold):n.isElementAtBottom(t,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=t.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},n.throttledOnScrollListener=function(e,t,n,r){var i,o=!1,a=0;function s(){i&&clearTimeout(i)}function l(){var l=this,c=Date.now()-a,u=arguments;function h(){a=Date.now(),n.apply(l,u)}o||(r&&!i&&h(),s(),void 0===r&&c>e?h():!0!==t&&(i=setTimeout(r?function(){i=void 0}:h,void 0===r?e-c:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),l.cancel=function(){s(),o=!0},l}(150,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(e,t){function n(){this.constructor=e}tO(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?nO(nO({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=aO(t);return r.unit===rO?e.scrollTop<=r.value+n-e.scrollHeight+1:e.scrollTop<=r.value/100+n-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=aO(t);return r.unit===rO?e.scrollTop+n>=e.scrollHeight-r.value:e.scrollTop+n>=r.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=nO({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return i.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},i.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&i.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},i.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(S),lO={gifTab:"gifTab",gifSearchInput:"gifSearchInput",scrollableDiv:"scrollableDiv",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage"};const cO=e(Ie,{style:{fontSize:20},spin:!0}),uO=({setImageGifList:n,imageGifList:r=[],currentReqGif:i,setCurrentReqGif:a,inputRef:s,customRequest:l})=>{const{t:c}=gr(),{options:u}=Br(),{config:h}=u,[d,f]=o(null),[p,g]=o(!1),[m,v]=o(25),b=async function({query:e,page:t}){const n=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null==h?void 0:h.REACT_APP_GIPHY_KEY}&q=${n}&limit=25&offset=${t}&lang=en`,r=await fetch(e);return{data:await r.json()}}catch(e){console.log(e)}},y=async()=>{var e,t;const r=await b({query:i,page:0});(null===(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.data)||void 0===t?void 0:t.length)&&r.data.data.length>0&&n(r.data.data)};return t("div",{className:lO.gifTab,children:[t(P,{onValuesChange:y,className:r.length>0?lO.searchResults:"",children:[e(P.Item,{className:lO.gifSearchInput,children:e(E,{onKeyDown:e=>"Space"===e.code&&y(),onPressEnter:e=>y(),allowClear:!0,placeholder:c("Search GIFs"),value:null==i?void 0:i.keywords,onChange:e=>a(t=>Object.assign(Object.assign({},t),{keywords:e.target.value})),ref:s,spellCheck:"false",suffix:e(se,{onClick:y,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})})}),r.length>0&&e("div",{className:"ant-divider blocks-search__divider",role:"separator"})]}),e("div",{className:"serach-output-wrapper",children:r.length>0&&e("div",{id:"scrollableDiv",className:lO.scrollableDiv,children:e(sO,{dataLength:r&&r.length,next:async()=>{p||(g(!0),b({query:i,page:m}).then(e=>{e&&e.data&&e.data.data&&n(t=>[...t,...e.data.data]),g(!1),v(e=>e+25)}).catch(()=>{g(!1)}))},hasMore:!!r,endMessage:t(G,{plain:!0,children:[c("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:e(te,{indicator:cO}),children:r.map((n,r)=>t("div",{className:lO.listItem,onClick:()=>((e,t)=>{f(t),setTimeout(()=>{f(null)},2e3),l(e)})(n.images.downsized.url,n.id),children:[e("img",{className:d===n.id?lO.loadedImage:"",width:"322px",src:`${n.images.downsized.url}`,alt:n.title,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(lO.loaded)}}),e("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),d===n.id&&e(te,{className:"ant-spin",indicator:e(Ie,{spin:!0})})]},n.id+r))})})})]})};var hO="stockTab",dO="stockSearchInput",fO="searchResults",pO="blocksSearchDividerWrapper",gO="scrollableDiv",mO="listItem",vO="loaded",bO="loadedImage",yO="creatorInfo",wO="stockColorFilter",xO="allColors",_O="blackColor",CO="bwColor",SO="whiteColor",AO="orangeColor",kO="redColor",TO="purpleColor",IO="magentaColor",OO="greenColor",EO="tealColor",PO="blueColor";const MO=e(Ie,{style:{fontSize:20},spin:!0}),jO=({imageStockList:r,setImageStockList:i,currentReq:s,setCurrentReq:l,inputRef:c,customRequest:u})=>{const[h,d]=o(!1),[f,p]=o(2),{t:g}=gr(),{options:m}=Br(),{config:v}=m,b=async function({query:e,page:t}){const n=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{let r=`https://api.unsplash.com/search/photos?client_id=${null==v?void 0:v.UNSPLASH_KEY}&lang=ru&per_page=18&query=${n}&page=${t}`;""!==e.color&&(r+=`&color=${e.color}`),""!==e.orientation&&(r+=`&orientation=${e.orientation}`);const i=await fetch(r);return{data:await i.json()}}catch(e){console.log(e)}};a(()=>{""!==s.keywords&&y()},[s.color,s.orientation]);const y=async()=>{var e,t;const n=await b({query:s,page:1});(null===(t=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.results)||void 0===t?void 0:t.length)&&n.data.results.length>0&&i(n.data.results)},[w,x]=o(null),_=(e,t,n)=>{!async function(e){try{const t=await fetch(`${e}&client_id=${null==v?void 0:v.UNSPLASH_KEY}`);return{data:await t.json()}}catch(e){console.log(e)}}(t.download_location),x(n),setTimeout(()=>x(null),2e3),u(`${e.raw}&w=1200&q=96`)};return t("div",{className:hO,children:[t(P,{onValuesChange:y,className:r.length>0?fO:"",children:[t(B,{gutter:24,children:[e(V,{span:r.length>0?void 0:24,children:e(P.Item,{className:dO,children:e(E,{onKeyDown:e=>"Space"===e.code&&y(),onPressEnter:e=>y(),allowClear:!0,placeholder:g("Search image"),value:s.keywords,onChange:e=>l(t=>Object.assign(Object.assign({},t),{keywords:e.target.value})),ref:c,spellCheck:"false",suffix:e(se,{onClick:y,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})})})}),r.length>0&&t(n,{children:[e(V,{children:t(ne.Group,{defaultValue:"",onChange:e=>l(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[e(re,{title:g("All"),placement:"top",children:e(ne.Button,{value:"",children:e(gi,{})})}),e(re,{title:g("Landscape"),placement:"top",children:e(ne.Button,{value:"landscape",children:e(mi,{})})}),e(re,{title:g("Portrait"),placement:"top",children:e(ne.Button,{value:"portrait",children:e(vi,{})})}),e(re,{title:g("Squarish"),placement:"top",children:e(ne.Button,{value:"squarish",children:e(bi,{})})})]})}),e(V,{children:t(ne.Group,{defaultValue:"",className:wO,onChange:e=>l(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[e(re,{title:g("All"),placement:"top",children:e(ne.Button,{className:xO,value:"",children:"All"})}),e(re,{title:g("Black"),placement:"top",children:e(ne.Button,{className:_O,value:"black",children:"B"})}),e(re,{title:g("Black and White"),placement:"top",children:e(ne.Button,{className:CO,value:"black_and_white",children:"B&W"})}),e(re,{title:g("White"),placement:"top",children:e(ne.Button,{className:SO,value:"white",children:"W"})}),e(re,{title:g("Orange"),placement:"top",children:e(ne.Button,{className:AO,value:"orange",children:"O"})}),e(re,{title:g("Red"),placement:"top",children:e(ne.Button,{className:kO,value:"red",children:"R"})}),e(re,{title:g("Purple"),placement:"top",children:e(ne.Button,{className:TO,value:"purple",children:"P"})}),e(re,{title:g("Magenta"),placement:"top",children:e(ne.Button,{className:IO,value:"magenta",children:"M"})}),e(re,{title:g("Green"),placement:"top",children:e(ne.Button,{className:OO,value:"green",children:"G"})}),e(re,{title:g("Teal"),placement:"top",children:e(ne.Button,{className:EO,value:"teal",children:"T"})}),e(re,{title:g("Blue"),placement:"top",children:e(ne.Button,{className:PO,value:"blue",children:"B"})})]})})]})]}),r.length>0&&e("div",{className:pO,children:e(G,{className:"zero-divider"})})]}),e("div",{className:"serach-output-wrapper",children:r.length>0&&e("div",{id:"scrollableDiv",className:gO,children:e(sO,{dataLength:r&&r.length,next:async()=>{h||(d(!0),b({query:s,page:f}).then(e=>{e&&e.data&&e.data.results&&i(t=>[...t,...e.data.results]),d(!1),p(e=>e+1)}).catch(()=>{d(!1)}))},hasMore:!!r,endMessage:t(G,{plain:!0,children:[g("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:e(te,{indicator:MO}),children:r.map((n,r)=>t("div",{className:mO,onClick:()=>_(n.urls,n.links,n.id),children:[e("img",{className:w===n.id?bO:"",width:"310px",src:`${n.urls.raw}&w=644&q=96`,alt:n.description,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(vO)}}),t("p",{className:yO,onClick:e=>e.stopPropagation(),children:[g("Photo by")," ",e("a",{target:"_blank",href:`${n.user.links.html}?utm_source=${null==v?void 0:v.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:n.user.name})," ",g("on")," ",e("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==v?void 0:v.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),w===n.id&&e(te,{className:"ant-spin",indicator:e(Ie,{spin:!0})})]},n.id+r))})})})]})},FO=()=>{const{options:e}=Br(),t=e.config;return c((e,n)=>{!1!==(null==t?void 0:t.pushToGTM)&&((e,t)=>{const n=()=>{try{const t=Object.assign(Object.assign({},e),{appLabel:"blocks_app"});window.dataLayer&&"function"==typeof window.dataLayer.push?window.dataLayer.push(t):console.log("Attempting to add to the dataLayer:",e)}catch(e){console.error("Ошибка при вызове GTM:",e)}};t?setTimeout(n,t):n()})(e,n)},[null==t?void 0:t.pushToGTM])};var RO="slideshowContainer",DO="slideshowImage";const LO=({images:t,transitionDuration:n=1e3,frameHeight:r})=>{const[i,s]=o([]),l=()=>{s(e=>e.map((t,n)=>n===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return a(()=>{if(t.length>0){const e=t[t.length-1];s(t=>[...t,{src:e,opacity:0}]),setTimeout(l,1e3)}else s([])},[t]),e("div",{className:RO,style:{height:r,minHeight:130},children:i.map((t,r)=>e("img",{src:`data:image/jpeg;base64, ${t.src}`,alt:`Slide ${r+1}`,className:DO,style:{opacity:t.opacity,transition:`opacity ${n}ms linear`,display:"block"}},r))})};const NO=t=>{var{className:n,style:r,color:i,text:o,bordered:a}=t,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["className","style","color","text","bordered"]);const l=o||"";return e(ie,Object.assign({style:r,color:i,bordered:a,className:n},s,{children:l}))},zO=({text:n,counter:r,limits:i,wrapperStyles:o})=>{const{t:a}=gr(),{options:s}=Br(),l=s.config,{token:c}=T.useToken(),u=+i>0,h=!u||r<+i,d=(null==l?void 0:l.billingPageUrl)||"/billing",f=r+" "+a("of")+" "+(u?i:"∞")+" "+(n||a("tests",{count:i}))+" "+a("was used",{count:r});return t("div",{className:"limits-couter-wrapper",style:o,children:[e(NO,{bordered:!1,text:f,className:"limit-counter",style:{color:h?c.colorText:"white"},color:h?c.colorFillSecondary:"rgb(255, 77, 79)"}),u&&e("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(d),children:a("Need more?")})]})};var BO={imageAi:"imageAi",imageItem:"imageItem",textAreaInputHybrid:"textAreaInputHybrid",loading:"loading",carousel:"carousel",arrow:"arrow",arrowNext:"arrowNext",arrowPrev:"arrowPrev",arrowBtn:"arrowBtn",arrowBtnNext:"arrowBtnNext",arrowBtnPrev:"arrowBtnPrev",row:"row",inputAffixWrapper:"inputAffixWrapper",textarea:"textarea",inputIcon:"inputIcon"};const VO=f(({className:t,onClick:n})=>e("div",{className:`${BO.arrow} ${BO.arrowNext} ${t||""}`,onClick:n,children:e(X,{className:`${BO.arrowBtn} ${BO.arrowBtnNext}`,size:"large",icon:e(Oe,{})})}));VO.displayName="SampleNextArrow";const UO=f(({className:t,onClick:n})=>e("div",{className:`${BO.arrow} ${BO.arrowPrev} ${t||""}`,onClick:n,children:e(X,{className:`${BO.arrowBtn} ${BO.arrowBtnPrev}`,size:"large",icon:e(Ee,{})})}));UO.displayName="SamplePrevArrow";const HO=({customRequest:n,aiTabRef:r,inputAiRef:i,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:u,setAiImageRequest:d,imageAiList:f,setImageAiList:p,isLoadingAi:g,setIsLoadingAi:m})=>{const[v,b]=o("auto"),{aiImageCounter:y,currentAiImgLimits:w,loadingDuringGeneration:x,requestStatus:_,handleGenerate:C,convertBase64ToFile:S,isShiftPressed:A,setIsShiftPressed:k,limitsInPlugin:T}=function({setFrameHeight:e,customRequest:t,aiTabRef:n,isImageUploaded:r,setIsImageUploaded:i,aiImageRequest:s,imageAiList:l,setImageAiList:u,isLoadingAi:d,setIsLoadingAi:f}){const{t:p}=gr(),{options:g}=Br(),m=g.config,v=Jr(),b=FO(),{messages:y}=g.config,[w,x]=o([]),[_,C]=o(0),[S,A]=o(null),[k,T]=o(!1),[I,O]=o(p("Evaluating the task")),[E,P]=o(!1);a(()=>{x(y)},[y]),a(()=>{l.length||S||x([])},[l,S]);const M=h(()=>(console.log("sendAIImageRequest"),m&&"function"==typeof(null==m?void 0:m.sendAIImageRequest)?null==m?void 0:m.sendAIImageRequest:()=>Promise.resolve({})),[m]),j=c(e=>{"error"!==e.status&&"Canceled"!==e.status?e.images?(O(String(e.status)),100===e.progress&&(f(!1),u(e.images),A(null),P(!1))):(u([String(e.data)]),100===e.progress&&f(!1)):(f(!1),P(!1),v.error({message:p("Something went wrong, please try again"),placement:"bottomRight",description:String(S)||void 0}))},[u,O,p,f,S,v,P]);a(()=>{w.length>1&&j(w[w.length-1])},[j,w]);const F=h(()=>{if(m&&"function"==typeof(null==m?void 0:m.sseQuery)){const e=null==m?void 0:m.sseQuery;return t=>e(t)}return e=>{}},[m]),R=h(()=>m&&"object"==typeof(null==m?void 0:m.handleLimitUsageEmitter)?null==m?void 0:m.handleLimitUsageEmitter:{fire:()=>{}},[m]),D=null==m?void 0:m.elementId,{projectId:L}=m,{limits:N}=(null==m?void 0:m.limits)?m:{limits:{ai_img_limit:0}},{ai_img_limit:z}=N,B=z>0&&_>=z,V=!(!(null==m?void 0:m.limits)||!m.counters)&&Dr,U=c(()=>{R.fire({name:"AiImgCount",count:_+1})},[R,_]),H=h(()=>!B&&!V,[B,V,_,z]),W=c(async()=>{console.log("generateImage"),O(p("Evaluating the task")),""===s||d||(f(!0),P(!0),u([]),b({event:"submit_form",action:"ai_image_generation",entity_id:D,project_id:L}),M({body:{project_id:L,request:"create-image",connection:"midjourney",message:s}}).then(e=>{var t,n,r;const{data:i,error:o}=e||{};if(o)throw o;const a=i;if(401===(null==a?void 0:a.status)||401===(null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.status))throw new Error("ERROR");if(200===(null==a?void 0:a.status)||200===(null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.status)){const e=(null==a?void 0:a.task)||(null===(r=null==a?void 0:a.data)||void 0===r?void 0:r.task);(null==e?void 0:e.id)&&(O(e.message),A(e.id)),(null==a?void 0:a.message)&&v.success({message:a.message,placement:"bottomRight",description:s}),F({task_id:null==e?void 0:e.id,entity_id:D})}else f(!1),P(!1),v.error({message:(null==a?void 0:a.message)||p("Something went wrong, please try again"),placement:"bottomRight",description:s})}).catch(e=>{f(!1),P(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&(null==v||v.error({message:p("Something went wrong, please try again"),placement:"bottomRight",description:s})),t}))},[s,d,f,P,u,b,D,L,M,v,F,p]),Y=c(()=>{H&&W()},[H,V,C,U,W,v,p]);a(()=>{},[m,V]);const $=c(e=>{if(!r){i(!0);const n=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!n)return;const r=n[1],o=n[2],a=atob(o),s=new Array(a.length);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);const l=new Uint8Array(s),c=new Blob([l],{type:`image/${r}`}),u=new File([c],"image.jpeg",{type:c.type,lastModified:Date.now()});t({file:u})}},[r,i,t]);return a(()=>{(d||l.length>0)&&setTimeout(()=>{let t=350;n.current&&(t=n.current.offsetHeight),e(t)},0)},[n,l.length,d,e]),{aiImageCounter:_,setAiImageCounter:C,currentAiImgLimits:z,isFieldsDisabled:B,canGenerateImage:H,aiImageRequest:s,imageAiList:l,setImageAiList:u,isLoadingAi:d,setIsLoadingAi:f,loadingDuringGeneration:E,setLoadingDuringGeneration:P,requestStatus:I,setRequestStatus:O,handleGenerate:Y,handleLimitAiImgCount:U,convertBase64ToFile:$,isShiftPressed:k,setIsShiftPressed:T,currentReqId:S,setCurrentReqId:A,limitsInPlugin:V}}({setFrameHeight:b,customRequest:n,aiTabRef:r,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:u,imageAiList:f,setImageAiList:p,isLoadingAi:g,setIsLoadingAi:m}),[I,O]=o(!1),M=c(()=>O(!0),[]),j=c(()=>O(!1),[]),F=c(e=>d(e.target.value),[d]),R=c(e=>{"Shift"===e.key?k(!0):"Enter"!==e.key||A||(e.preventDefault(),C())},[A,C,k]),D=c(e=>{"Shift"===e.key&&k(!1)},[k]);return t("div",{className:BO.imageAi,children:[T&&e(zO,{text:"images",counter:y,limits:w,wrapperStyles:{marginTop:-25}}),e(B,{gutter:24,className:BO.row,children:e(V,{span:24,children:e(P.Item,{children:t("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${BO.inputAffixWrapper}${I?" ant-input-affix-wrapper-focused":""}`,children:[e(E.TextArea,{ref:i,onKeyDown:R,onKeyUp:D,onFocus:M,onBlur:j,autoSize:!0,allowClear:!0,className:`${BO.textAreaInputHybrid} ${BO.textarea}`,placeholder:"Generate image",value:u,onChange:F,spellCheck:"false"}),e("span",{className:`ant-input-suffix ${BO.inputSuffix}`,children:g||x?e(Ie,{className:`${BO.inputIcon} input-icon`,spin:!0}):e(wi,{className:`${BO.inputIcon} input-icon`,onClick:C})})]})})})}),(g||f.length>0)&&t(oe,{dotPosition:"top",arrows:!0,nextArrow:e(VO,{}),prevArrow:e(UO,{}),className:BO.carousel,children:[g&&!f.length&&e("div",{className:BO.loading,children:t("div",{className:"spin",children:[e(Ie,{style:{fontSize:48},spin:!0}),e("p",{className:"status",children:_})]})}),f.length>0&&f.map((n,r)=>t("div",{className:BO.imageItem,children:[e(LO,{images:f,frameHeight:v}),e("div",{className:"buttons",children:f.length>0&&!g&&e(X,{onClick:()=>S(`data:image/jpeg;base64, ${n}`),icon:e(Pe,{}),children:"Use this variant"})})]},r))]})]})};let WO=!1;const YO=()=>{if(WO)return;window.addEventListener("error",e=>!(!e.message||!e.message.includes("ResizeObserver loop completed with undelivered notifications"))&&(e.stopImmediatePropagation(),e.preventDefault(),!0),!0);const e=window.onerror;window.onerror=(t,n,r,i,o)=>!("string"!=typeof t||!t.includes("ResizeObserver loop completed with undelivered notifications"))||!!e&&e(t,n,r,i,o),window.addEventListener("unhandledrejection",e=>{var t,n;(null===(n=null===(t=e.reason)||void 0===t?void 0:t.message)||void 0===n?void 0:n.includes("ResizeObserver loop completed with undelivered notifications"))&&e.preventDefault()});const t=console.error;if(console.error=(...e)=>{var n;((null===(n=e[0])||void 0===n?void 0:n.toString())||"").includes("ResizeObserver loop completed with undelivered notifications")||t.apply(console,e)},"undefined"!=typeof window){const e=()=>{try{["webpackHotUpdate","__webpack_require__","__webpack_hash__"].forEach(e=>{if(window[e]){const e=window.__webpack_require__;e&&"object"==typeof e&&null!==e&&"cache"in e&&console.warn("✅ Webpack обнаружен, активирована дополнительная защита от ResizeObserver ошибок")}})}catch(e){console.warn("Ошибка при поиске webpack объектов:",e)}};e(),setTimeout(e,1e3)}WO=!0},$O=()=>{WO=!1},GO=e=>{(null==e?void 0:e.customTheme)&&((e={})=>{const t=document.querySelector("head");if(!t)return;const n=document.createElement("style");if(n.type="text/css",n.dataset.themeVaribalse="true",n.setAttribute("data-emailmaker","true"),Object.entries(e).length){let r="";Object.entries(e).forEach(([e,t])=>{"object"!=typeof t&&(r+=`\t--${e}: ${t};\n`)}),r=`.em-filemanager {\n${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-theme-varibalse="true"]');i?t.replaceChild(n,i):t.insertBefore(n,t.firstChild)}})(null==e?void 0:e.customTheme)},{Sider:XO,Content:KO}=ee,qO={keywords:"",color:"",orientation:""},ZO={keywords:""},JO=()=>{const s=Zr(),l=qr(),h=(()=>{const{state:e,actions:t,options:n}=Br(),{selectedFolder:r,pathHistory:i,folders:o}=e,{t:a}=gr(),{setSelectedFolder:s,setPathHistory:l}=t,u=c((e,t=new Set)=>{if(t.has(e))return console.warn(`Обнаружен цикл в пути к папке с id=${e}`),[];const n=(Array.isArray(o)?o:[]).find(t=>t.id===e);if(!n)return[];const r=new Set(t);return r.add(e),n.parentId?n.parentId===n.id?(console.warn(`Обнаружена циклическая зависимость: папка ${n.id} является родителем самой себя`),[{id:n.id,name:n.name+" (ошибка)"}]):[...u(n.parentId,r),{id:n.id,name:n.name}]:[{id:n.id,name:n.name}]},[o]),h=c(e=>{console.log("🎯 handleFolderSelect:",e);const t="folders"===e?null:e;if(t!==r)if(null==s||s(t),"folders"===e){const e=[{id:"folders",name:a("Folders")}];null==l||l(e),n.onPathChange&&n.onPathChange([])}else if((Array.isArray(o)?o:[]).find(t=>t.id===e)){const t=u(e),r=[{id:"folders",name:a("Folders")},...t];null==l||l(r),n.onPathChange&&n.onPathChange(r.map(e=>e.name))}else console.warn("⚠️ Папка не найдена:",e);else console.log("🚫 Папка уже выбрана, пропускаем обновление:",e)},[n,l,s,a,o,u,r]),d=c(e=>{if(console.log("handleBreadcrumbClick вызван с index:",e),-1===e)null==s||s(null),null==l||l([{id:"folders",name:a("Folders")}]),n.onPathChange&&n.onPathChange([]);else{const t=i.slice(0,e+1),r=t[t.length-1],o="folders"===r.id?void 0:r.id;null==s||s(o||null),null==l||l(t),n.onPathChange&&n.onPathChange(t.map(e=>e.name))}},[n,i,l,s,a]),f=c(e=>{if(!e.isFolder)return;null==s||s(e.id);const t={id:e.id,name:e.name};if(l){const e=[...i,t];l(e)}if(n.onPathChange){const t=[...i.map(e=>e.name),e.name];n.onPathChange(t)}},[n,i,l,s]);return{state:{selectedFolder:r,pathHistory:i},actions:{handleFolderSelect:h,handleBreadcrumbClick:d,handleItemClick:f},selectedFolder:r,pathHistory:i,handleFolderSelect:h,handleBreadcrumbClick:d,handleItemClick:f}})(),d=(()=>{const{state:e,actions:t}=Br(),{pagination:n}=e,{setPagination:r}=t,i=c((e,t)=>{const i=t||n.pageSize;null==r||r({current:e,pageSize:i,total:n.total})},[n.pageSize,n.total,r]);return{state:{pagination:n},actions:{handlePaginationChange:i}}})(),f=(()=>{const[e,t]=r.useState(()=>{const e=localStorage.getItem(Qr);return e?Math.max(200,parseInt(e,10)):298}),[n,i]=r.useState(!1),[o,a]=r.useState(!1),[s,l]=r.useState(0),c=r.useCallback(()=>{console.log("Double click: Resetting to default width"),t(298),localStorage.setItem(Qr,298..toString())},[]),u=r.useCallback(n=>{n.preventDefault(),n.stopPropagation(),i(!0),document.body.classList.add("resizing");const r=n.clientX,o=e;let s=o;const c=e=>{e.preventDefault();const n=Math.max(Math.min(o+e.clientX-r,600),200);s=n,t(n),l(e.clientX),a(!0)},u=()=>{i(!1),document.body.classList.remove("resizing"),a(!1),localStorage.setItem(Qr,s.toString()),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)},[e]);return r.useEffect(()=>()=>{document.body.classList.remove("resizing")},[]),{sidebarWidth:e,isResizing:n,showResizeGuide:o,resizeGuidePosition:s,handleResizeStart:u,handleDoubleClick:c}})(),p=(()=>{const[e,t]=o([]),[n,r]=o(!1),[i,a]=o(!1),s=u(0),l=c(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),h=c(e=>`${(e.size/1024).toFixed(2)} КБ`,[]),d=c(e=>{const n=e.map(e=>({id:l(),name:e.name,size:h(e),status:"uploading",progress:0}));return t(n),r(!0),a(!1),n.map(e=>e.id)},[l,h]),f=c((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,n))}):t))},[]),p=c(e=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"success",progress:100}):t))},[]),g=c((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:n}):t))},[]),m=c(()=>{r(!1),a(!1),setTimeout(()=>{t([])},300)},[]),v=c(()=>{a(e=>!e)},[]),b=c(e=>{t(t=>t.filter(t=>t.id!==e)),t(t=>(t.length<=1&&setTimeout(()=>{r(!1),a(!1)},100),t.filter(t=>t.id!==e)))},[]),y=e.length,w=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:n,isUploadMinimized:i,totalFiles:y,completedFiles:w,startUpload:d,updateProgress:f,markAsSuccess:p,markAsError:g,closeUpload:m,minimizeUpload:v,insertFile:b}})(),g=Wr(),m=i.useRef(null),{folders:v,loading:b}=s.state,{fetchFolders:y,handleCreateFolder:w,handleModalOk:x,handleModalCancel:_,generateMenuItems:C}=s.actions,S=oi(y),{files:A,selectedFiles:k,loading:T,isRenamingFile:I,fileToRename:O}=l.state,{fetchFiles:E,handleDeleteFile:P,handleDeleteFolder:M,handleAddFile:j,handleAddFileByUrl:F,uploadFileWithProvider:R,toggleFileSelection:D,showRenameModal:L,handleRenameCancel:N,handleRenameOk:z,handleDroppedFiles:B,showMoveModal:V,handleMoveCancel:U,handleMoveOk:H}=l.actions,{selectedFolder:W,pathHistory:Y}=h.state,{handleFolderSelect:$,handleBreadcrumbClick:X,handleItemClick:K}=h.actions,{pagination:q}=d.state,Z=(e=>{const{state:t,actions:n}=Br(),{searchTerm:r,sortBy:i,sortOrder:o,selectedFolder:s,pagination:l}=t,{setSearchTerm:h,setSortBy:d,setSortOrder:f,setPagination:p}=n,g=e||n.fetchFiles,m=u(null),v=u(Ir.debounce(e=>{const t=JSON.stringify(e);m.current!==t?(m.current=t,console.log("✅ Выполняется запрос:",e),null==g||g(e)):console.log("🚫 Дублированный запрос пропущен:",e)},150)).current,b=c(()=>({folderId:null===s?"root":s||void 0,search:(null==r?void 0:r.trim())||void 0,page:l.current,limit:l.pageSize,sortBy:i,sortOrder:o}),[s,r,l.current,l.pageSize,i,o]),y=c(e=>{if(console.log("🔎 useSortAndFilter: handleSearch вызван с:",e),h&&(console.log("🔎 useSortAndFilter: Обновляем searchTerm в стейте"),h(e)),p&&(console.log("🔎 useSortAndFilter: Сбрасываем пагинацию"),p({current:1,pageSize:l.pageSize,total:0})),console.log("🔎 useSortAndFilter: Проверяем fetchFiles:",!!g),g){console.log("🔎 useSortAndFilter: Вызываем fetchFiles с параметрами поиска");const t={folderId:null===s?"root":s||void 0,search:(null==e?void 0:e.trim())||void 0,page:1,limit:l.pageSize,sortBy:i,sortOrder:o};console.log("🔎 useSortAndFilter: Параметры запроса:",t),g(t),console.log("🔎 useSortAndFilter: fetchFiles вызван!")}else console.error("🔎 useSortAndFilter: fetchFiles НЕ ОПРЕДЕЛЕНА!")},[h,p,l.pageSize,g,s,i,o]),w=c((e,t)=>{null==d||d(e),null==f||f(t),g&&v({folderId:null===s?"root":s||void 0,search:(null==r?void 0:r.trim())||void 0,page:l.current,limit:l.pageSize,sortBy:e,sortOrder:t})},[d,f,v,s,r,l.current,l.pageSize]),x=c((e,t)=>{p&&p({current:e,pageSize:t||l.pageSize,total:l.total}),g&&v({folderId:null===s?"root":s||void 0,search:(null==r?void 0:r.trim())||void 0,page:e,limit:t||l.pageSize,sortBy:i,sortOrder:o})},[p,l.pageSize,l.total,v,s,r,i,o]);return a(()=>{if(g){console.log("🔄 useSortAndFilter: изменение selectedFolder, загрузка файлов для папки:",s);const e=b();v(Object.assign(Object.assign({},e),{page:1}))}},[s]),a(()=>{g&&(console.log("🔄 useSortAndFilter: начальная загрузка файлов, selectedFolder:",s),v(b()))},[]),a(()=>()=>{var e;null===(e=v.cancel)||void 0===e||e.call(v)},[v]),{state:{searchTerm:r||"",sortBy:i||"name",sortOrder:o||"asc"},actions:{setSearchTerm:h||(()=>{}),setSortBy:d||(()=>{}),setSortOrder:f||(()=>{}),handleSearch:y,handleSort:w,handlePaginationChange:x,getCurrentQueryParams:b}}})(E),{searchTerm:J,sortBy:Q,sortOrder:te}=Z.state,{handleSearch:ne,handleSort:re,handlePaginationChange:ie}=Z.actions,oe=(({files:e,selectedFiles:t,fetchFiles:n,selectedFolder:i})=>{const o=Jr(),{options:a,actions:s,state:l}=r.useContext(zr),{setActiveLibraryItem:c}=s,{activeLibraryItem:u}=l,[h,d]=r.useState(!1),[f,p]=r.useState(null);r.useEffect(()=>{console.log(h)},[h]);const g=r.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return Lr.includes(t)}const n=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!n&&Lr.includes(n)},[]),m=r.useCallback(async e=>{const{dataProviders:t}=a;if(console.log("🔧 saveFileToServer: dataProviders доступны:",{hasUpdateFile:!!(null==t?void 0:t.updateFile),hasUploadFile:!!(null==t?void 0:t.uploadFile),hasThumbnail:!!e.thumbnail,fileId:e.id}),(null==t?void 0:t.updateFile)&&e.thumbnail)try{let n=e.type||"image/png";if(e.thumbnail.startsWith("data:")){const t=e.thumbnail.match(/^data:([^;]+)/);t&&t[1].startsWith("image/")&&(n=t[1])}const r=e.thumbnail.split(",")[1],i=atob(r),o=new Array(i.length);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);const a=new Uint8Array(o),s=new Blob([a],{type:n});return console.log("Using updateFile method with:",{fileId:e.id,mimeType:n,blobType:s.type}),await t.updateFile(e.id,{name:e.name,type:n,data:s,thumbnail:e.thumbnail,extension:e.extension})}catch(e){return console.error("Ошибка при обновлении файла через updateFile:",e),null}else if((null==t?void 0:t.uploadFile)&&e.thumbnail)try{let n=e.type||"image/png";if(e.thumbnail.startsWith("data:")){const t=e.thumbnail.match(/^data:([^;]+)/);t&&t[1].startsWith("image/")&&(n=t[1])}const r=e.thumbnail.split(",")[1],i=atob(r),o=new Array(i.length);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);const a=new Uint8Array(o),s=new Blob([a],{type:n});console.log("Using uploadFile method as fallback with:",{mimeType:n,blobType:s.type}),await t.uploadFile(Object.assign(Object.assign({},e),{type:n,data:s}))}catch(e){return console.error("Ошибка при сохранении файла через uploadFile:",e),null}else if(null==t?void 0:t.renameFile)try{return await t.renameFile(e.id,e.name)}catch(e){return console.error("Ошибка при переименовании файла:",e),null}return console.warn("DataProvider для обновления файлов не настроен"),null},[a]),v=r.useCallback(n=>{let r;if(console.log("🎨 handleEdit ВЫЗВАНА!",{fileForEdit:n,selectedFilesSize:t.size}),n)r=n;else{if(1!==t.size)return;const n=Array.from(t)[0];if(r=e.find(e=>e.id===n),!r||r.isFolder||!g(r))return}console.log("🎨 usePixieEditor: Открываем редактор для файла:",r),c&&c(Rr),console.log("🎨 usePixieEditor: Устанавливаем editingFile"),p(r),console.log("🎨 usePixieEditor: Устанавливаем isPixieEditorVisible = true"),d(!0),console.log("🎨 usePixieEditor: Редактор должен открыться")},[t,e,g,d,c]),b=r.useCallback(()=>{console.log("🎨 usePixieEditor: Закрываем редактор"),c&&u===Rr&&c(Pr),d(!1),p(null),console.log("🎨 usePixieEditor: Редактор закрыт")},[u,c]),y=r.useCallback(async e=>{console.log("Файл обновлен:",e);try{const t=await m(e);if(t)return await n({folderId:i||void 0}),o.success({message:"Успех",description:"Изображение успешно обновлено"}),b(),a.onEditorOk&&a.onEditorOk(t),t}catch(e){console.error("Ошибка при сохранении файла:",e),o.error({message:"Ошибка",description:`Не удалось сохранить изменения: ${e instanceof Error?e.message:"Неизвестная ошибка"}`})}},[m,n,i,o,b]);return{isPixieEditorVisible:h,editingFile:f,handleEdit:v,handlePixieEditorSave:y,handlePixieEditorClose:b}})({files:A||[],selectedFiles:k||new Set,fetchFiles:E,selectedFolder:W||null}),ae=i.useCallback(async()=>{var e;let t=null;await j({onStart:e=>{const n=p.startUpload([e]);t=n[0],console.log("🚀 onStart: файл запущен",{fileName:e.name,fileId:t})},onProgress:(e,n)=>{t&&(p.updateProgress(t,n),console.log("🔍 onProgress:",{fileName:e,fileId:t,progress:n}))},onComplete:e=>{t?(p.markAsSuccess(t),console.log("✅ onComplete: markAsSuccess вызван",{fileName:e,fileId:t})):console.error("❌ currentFileId отсутствует для onComplete:",e)},onError:(e,n)=>{t&&(p.markAsError(t,n),console.log("❌ onError: markAsError вызван",{fileName:e,fileId:t,error:n}))}}),await(null===(e=m.current)||void 0===e?void 0:e.refreshFileCounts())},[j,p]),se=i.useCallback(async()=>{var e;await F(),await(null===(e=m.current)||void 0===e?void 0:e.refreshFileCounts())},[F]),le=i.useCallback(async e=>{var t;await P(e),await(null===(t=m.current)||void 0===t?void 0:t.refreshFileCounts())},[P]),ce=i.useCallback(async e=>{var t;if(B){const n=p.startUpload(e);console.log("🚀 Drag&Drop: файлы запущены",{fileCount:e.length,fileIds:n}),e.forEach(async(e,t)=>{const r=n[t];if(!r)return;let i=0;const o=setInterval(()=>{i=Math.min(i+10+Math.floor(Date.now()%10),85),p.updateProgress(r,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await B(e),n.forEach(e=>{p.updateProgress(e,100),p.markAsSuccess(e)}),await(null===(t=m.current)||void 0===t?void 0:t.refreshFileCounts())}},[B,p]),ue=i.useCallback(async e=>{var t;await M(e),await y(),await(null===(t=m.current)||void 0===t?void 0:t.refreshFileCounts())},[M,y]),he=(({files:e,selectedFiles:t,toggleFileSelection:n,showRenameModal:i,showMoveModal:o,showCopyModal:a,handleDeleteFile:s,handleDeleteFolder:l,onEdit:c})=>({handleClearSelection:r.useCallback(()=>{t&&t.size>0&&t.forEach(e=>{n(e)})},[t,n]),handleRename:r.useCallback(()=>{if(t&&1===t.size){const e=Array.from(t)[0];i(e)}},[t,i]),handleDeleteSelected:r.useCallback(()=>{t&&t.size>0&&t.forEach(t=>{const n=e.find(e=>e.id===t);n?n.isFolder?l(t):s(t):console.warn(`Объект с ID ${t} не найден в списке файлов`)})},[t,e,s,l]),handleCopy:r.useCallback(()=>{a()},[a]),handleMove:r.useCallback(()=>{o()},[o]),handleEdit:r.useCallback(()=>{c()},[c])}))({files:A||[],selectedFiles:k||new Set,toggleFileSelection:D,showRenameModal:L,showMoveModal:V,showCopyModal:l.actions.showCopyModal||(()=>{}),handleDeleteFile:P,handleDeleteFolder:ue,onEdit:oe.handleEdit}),de=b||T;a(()=>{YO(),y()},[y]),i.useEffect(()=>{!W&&$&&v.length>0&&(console.log("✅ Инициализация: автоматический выбор корневой папки"),$("folders"))},[W,$,v.length]);const{state:fe,actions:pe,options:ge}=i.useContext(zr),{form:me,urlForm:ve,renameForm:be,moveForm:ye,renameFolderForm:we,copyForm:xe,isModalVisible:_e,isUrlModalVisible:Ce,isMoveModalVisible:Se,isRenameFolderModalVisible:Ae,isCopyModalVisible:ke,folderToRename:Te,activeLibraryItem:Ie}=fe,{setIsUrlModalVisible:Oe,setSortField:Ee,setActiveLibraryItem:Pe}=pe,{config:Me}=ge,{handleRenameFolderCancel:je,handleRenameFolderOk:Fe}=S.actions,Re=c(e=>{ie(e.current||q.current,e.pageSize||q.pageSize)},[ie,q.current,q.pageSize]),De=i.useCallback(e=>{const{sortBy:t,sortOrder:n}=(e=>{const[t,n]=e.split("-");return{sortBy:t,sortOrder:n}})(e);re(t,n)},[re]),[Le,Ne]=o(ZO),[ze,Be]=o([]),Ve=u(null),[Ue,He]=o(qO),[We,Ye]=o([]),$e=u(null),[Ge,Xe]=o(""),[Ke,qe]=o([]),Ze=i.useRef(void 0),[Je,Qe]=o(!1),[et,tt]=o(!1),nt=i.useRef(null),rt=i.useRef(null);return a(()=>{(async()=>{const e=null==Me?void 0:Me.fileForEdit;if(Ze.current!==e)try{if(Ze.current=e,Ie===Rr&&e&&!oe.editingFile&&"string"==typeof e)if(e.startsWith("data:"))null==oe||oe.handleEdit({thumbnail:e});else{const t=await g.handleAddFileByUrl(e,!0);if(!t)throw new Error("Не удалось загрузить файл");Ze.current===e&&(null==oe||oe.handleEdit(t))}}finally{Ze.current===e&&(Ze.current=null)}})()},[Ie,null==Me?void 0:Me.fileForEdit]),a(()=>{var e,t,n;Ie===Pr?(console.log("reset requests"),Be([]),Ne(ZO),Ye([]),He(qO),qe([]),Xe(""),tt(!1),Qe(!1)):Ie===Fr?null===(e=rt.current)||void 0===e||e.focus():Ie===Mr?null===(t=Ve.current)||void 0===t||t.focus():Ie===jr&&(null===(n=$e.current)||void 0===n||n.focus())},[Ie]),t(ee,{className:"file-manager__layout",children:[f.showResizeGuide&&e("div",{className:"resize-guide",style:{left:`${f.resizeGuidePosition}px`}}),e(eO,{selectedFiles:k||new Set,onClearSelection:he.handleClearSelection,onRename:he.handleRename,onDelete:he.handleDeleteSelected,onCopy:he.handleCopy,onMove:he.handleMove,onEdit:he.handleEdit,files:A||[]}),e(G,{className:"zero-divider"}),t(ee,{className:"file-manager__content",children:[t(XO,{width:f.sidebarWidth,theme:"light",className:"file-manager-sider",children:[e(Ai,{ref:m,selectedFolder:W||null,generateMenuItems:C,onFolderSelect:e=>null==$?void 0:$(e),folders:v||[],fetchFolders:y,handleAddFile:ae,setIsUrlModalVisible:e=>null==Oe?void 0:Oe(e),handleDeleteFolder:ue,handleCreateFolder:w,activeLibraryItem:Ie,setActiveLibraryItem:e=>null==Pe?void 0:Pe(e)}),e("div",{className:"sidebar-resizer "+(f.isResizing?"resizing":""),onMouseDown:f.handleResizeStart,onDoubleClick:f.handleDoubleClick,children:e("div",{className:"sidebar-resizer-indicator"})})]}),e(ee,{className:"file-manager__main-content",children:t(KO,{className:"main-content",ref:nt,children:[Ie===Pr&&e(ri,{searchTerm:J,sortField:fe.sortField||"name",setSortField:e=>null==Ee?void 0:Ee(e),pathHistory:Y||[],handleBreadcrumbClick:e=>null==X?void 0:X(e),handleAddFile:ae,setIsUrlModalVisible:e=>null==Oe?void 0:Oe(e),files:A||[],handleSearch:ne,handleSort:re,sortBy:Q,sortOrder:te,handleSortOptionChange:De,pagination:q,setPagination:Re,loading:de,handleItemClick:e=>null==K?void 0:K(e),handleDeleteFile:le,selectedFiles:k||new Set,toggleFileSelection:e=>null==D?void 0:D(e),handleDroppedFiles:ce,fileUpload:p}),Ie===Mr&&e(uO,{imageGifList:ze,setImageGifList:Be,currentReqGif:Le,setCurrentReqGif:Ne,inputRef:Ve,customRequest:F}),Ie===jr&&e(jO,{imageStockList:We,setImageStockList:Ye,currentReq:Ue,setCurrentReq:He,inputRef:$e,customRequest:F}),Ie===Fr&&!!(null==Me?void 0:Me.sseQuery)&&e(HO,{imageAiList:Ke,setImageAiList:qe,aiImageRequest:Ge,setAiImageRequest:Xe,inputAiRef:rt,customRequest:e=>R(e.file),isLoadingAi:Je,setIsLoadingAi:Qe,isImageUploaded:et,setIsImageUploaded:tt,aiTabRef:nt}),Ie===Rr&&e(n,{})]})})]}),e(ii,{isModalVisible:_e,handleModalOk:x,handleModalCancel:_,form:me,selectedFolder:W||null,folders:v||[],isUrlModalVisible:Ce,setIsUrlModalVisible:e=>null==Oe?void 0:Oe(e),handleAddFileByUrl:se,urlForm:ve,isRenameModalVisible:I,handleRenameOk:()=>null==z?void 0:z(),handleRenameCancel:()=>null==N?void 0:N(),renameForm:be,fileToRename:O,files:A||[],isMoveModalVisible:Se,handleMoveOk:H,handleMoveCancel:U,moveForm:ye,selectedFiles:k||new Set,isRenameFolderModalVisible:Ae,handleRenameFolderOk:Fe,handleRenameFolderCancel:je,renameFolderForm:we,folderToRename:Te,isCopyModalVisible:ke,handleCopyOk:l.actions.handleCopyOk||(()=>Promise.resolve()),handleCopyCancel:l.actions.handleCopyCancel||(()=>{}),copyForm:xe}),e(FI,{visible:oe.isPixieEditorVisible,onClose:oe.handlePixieEditorClose,file:oe.editingFile,onSave:oe.handlePixieEditorSave}),e(qI,{files:p.uploadFiles,visible:p.isUploadVisible,minimized:p.isUploadMinimized,totalFiles:p.totalFiles,completedFiles:p.completedFiles,onClose:p.closeUpload,onMinimize:p.minimizeUpload,onInsert:p.insertFile})]})},QO=f(({config:r={},onPathChange:o,onChangeSelection:s,onEditorOk:l,searchQuery:c="",sortBySize:h="name",apiEndpoints:d={},customIcons:f,dragDropIcon:p,dataProviders:g,publicPath:m,notification:v})=>{i.useEffect(()=>{r.theme&&(e=>{document.documentElement.setAttribute("data-theme",e)})(r.theme),GO(r)},[r]),a(()=>{let e;const t=r.locale||Jn.language;return r.customLocale&&t&&(e=Jn.getResourceBundle(t,"translation"),Jn.addResourceBundle(t,"translation",r.customLocale,!0,!0)),()=>{r.customLocale&&t&&e&&Jn.addResourceBundle(t,"translation",e,!0,!0)}},[r.customLocale,r.locale]);const b=u(null);return e(O,{className:"em-filemanager",children:t(n,{children:[e(I,{getPopupContainer:()=>b.current||document.body,children:e(Vr,{options:{apiEndpoints:d,searchQuery:c,sortBySize:h,onPathChange:o,onChangeSelection:s,onEditorOk:l,config:r,customIcons:f,dragDropIcon:p,dataProviders:g,publicPath:m,notification:v},children:e(JO,{})})}),e("div",{ref:b,className:"file-manager-modal-root"})]})})});QO.displayName="FileManagerApp";const eE=t=>{var n,r,i;return e(mr,{i18n:Jn,children:e(cn,{externalTheme:null!==(r=null===(n=t.config)||void 0===n?void 0:n.theme)&&void 0!==r?r:"light",customThemeToken:null===(i=t.config)||void 0===i?void 0:i.customTheme,children:e(k,{children:e(QO,Object.assign({},t))})})})},tE=new Map,nE=(t,n)=>{var r;let i;YO();let o={};const a=e=>{const t=!e||"fileManager"!==e.mode&&"imageCenter"!==e.mode&&"plugin"!==e.mode?void 0:e.mode;return"imageCenter"===t?hn("imageCenter",e):hn(t)};if(t instanceof HTMLElement){i=t;o={config:a(n),apiEndpoints:null==n?void 0:n.apiEndpoints}}else{i=t.element;const e=a(t.config),n=Object.assign(Object.assign({},null===(r=t.config)||void 0===r?void 0:r.apiEndpoints),t.apiEndpoints);o={config:e,currentPath:t.currentPath,onPathChange:t.onPathChange,onChangeSelection:t.onChangeSelection,searchQuery:t.searchQuery,sortBySize:t.sortBySize,apiEndpoints:n,dataProviders:t.dataProviders,customIcons:t.customIcons,dragDropIcon:t.dragDropIcon}}const s=A(i);s.render(e(eE,Object.assign({},o))),tE.set(i.id||`container_${Date.now()}`,s)},rE=e=>{const t=e.id||Object.keys(tE).find(e=>e.startsWith("container_"));if(t&&tE.has(t)){const e=tE.get(t);null==e||e.unmount(),tE.delete(t)}else{console.warn("Не удалось найти корень для размонтирования");try{A(e).unmount()}catch(e){console.error("Ошибка при размонтировании компонента:",e)}}};var iE={init:nE,unmount:rE};export{ri as FileContent,QO as FileManagerApp,eE as FileManagerAppWithContext,ii as FileModals,Ai as FolderSidebar,iE as default,nE as init,YO as installResizeObserverErrorHandler,$O as uninstallResizeObserverErrorHandler,rE as unmount};
95
+ var tO=function(e,t){return tO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},tO(e,t)};var nO=function(){return nO=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},nO.apply(this,arguments)};var rO="Pixel",iO="Percent",oO={unit:iO,value:.8};function aO(e){return"number"==typeof e?{unit:iO,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:rO,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:iO,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),oO):(console.warn("scrollThreshold should be string or number"),oO)}var sO=function(e){function t(t){var n=e.call(this,t)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(null===n.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},n.onStart=function(e){n.lastScrollTop||(n.dragging=!0,e instanceof MouseEvent?n.startY=e.pageY:e instanceof TouchEvent&&(n.startY=e.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(e){n.dragging&&(e instanceof MouseEvent?n.currentY=e.pageY:e instanceof TouchEvent&&(n.currentY=e.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")})},n.onScrollListener=function(e){"function"==typeof n.props.onScroll&&setTimeout(function(){return n.props.onScroll&&n.props.onScroll(e)},0);var t=n.props.height||n._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(t,n.props.scrollThreshold):n.isElementAtBottom(t,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=t.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},n.throttledOnScrollListener=function(e,t,n,r){var i,o=!1,a=0;function s(){i&&clearTimeout(i)}function l(){var l=this,c=Date.now()-a,u=arguments;function h(){a=Date.now(),n.apply(l,u)}o||(r&&!i&&h(),s(),void 0===r&&c>e?h():!0!==t&&(i=setTimeout(r?function(){i=void 0}:h,void 0===r?e-c:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),l.cancel=function(){s(),o=!0},l}(150,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(e,t){function n(){this.constructor=e}tO(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?nO(nO({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=aO(t);return r.unit===rO?e.scrollTop<=r.value+n-e.scrollHeight+1:e.scrollTop<=r.value/100+n-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=aO(t);return r.unit===rO?e.scrollTop+n>=e.scrollHeight-r.value:e.scrollTop+n>=r.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=nO({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return i.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},i.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&i.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},i.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(S),lO={gifTab:"gifTab",gifSearchInput:"gifSearchInput",scrollableDiv:"scrollableDiv",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage"};const cO=e(Ie,{style:{fontSize:20},spin:!0}),uO=({setImageGifList:n,imageGifList:r=[],currentReqGif:i,setCurrentReqGif:a,inputRef:s,customRequest:l})=>{const{t:c}=gr(),{options:u}=Br(),{config:h}=u,[d,f]=o(null),[p,g]=o(!1),[m,v]=o(25),b=async function({query:e,page:t}){const n=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null==h?void 0:h.REACT_APP_GIPHY_KEY}&q=${n}&limit=25&offset=${t}&lang=en`,r=await fetch(e);return{data:await r.json()}}catch(e){console.log(e)}},y=async()=>{var e,t;const r=await b({query:i,page:0});(null===(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.data)||void 0===t?void 0:t.length)&&r.data.data.length>0&&n(r.data.data)};return t("div",{className:lO.gifTab,children:[t(P,{onValuesChange:y,className:r.length>0?lO.searchResults:"",children:[e(P.Item,{className:lO.gifSearchInput,children:e(E,{onKeyDown:e=>"Space"===e.code&&y(),onPressEnter:e=>y(),allowClear:!0,placeholder:c("Search GIFs"),value:null==i?void 0:i.keywords,onChange:e=>a(t=>Object.assign(Object.assign({},t),{keywords:e.target.value})),ref:s,spellCheck:"false",suffix:e(se,{onClick:y,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})})}),r.length>0&&e("div",{className:"ant-divider blocks-search__divider",role:"separator"})]}),e("div",{className:"serach-output-wrapper",children:r.length>0&&e("div",{id:"scrollableDiv",className:lO.scrollableDiv,children:e(sO,{dataLength:r&&r.length,next:async()=>{p||(g(!0),b({query:i,page:m}).then(e=>{e&&e.data&&e.data.data&&n(t=>[...t,...e.data.data]),g(!1),v(e=>e+25)}).catch(()=>{g(!1)}))},hasMore:!!r,endMessage:t(G,{plain:!0,children:[c("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:e(te,{indicator:cO}),children:r.map((n,r)=>t("div",{className:lO.listItem,onClick:()=>((e,t)=>{f(t),setTimeout(()=>{f(null)},2e3),l(e)})(n.images.downsized.url,n.id),children:[e("img",{className:d===n.id?lO.loadedImage:"",width:"322px",src:`${n.images.downsized.url}`,alt:n.title,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(lO.loaded)}}),e("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),d===n.id&&e(te,{className:"ant-spin",indicator:e(Ie,{spin:!0})})]},n.id+r))})})})]})};var hO="stockTab",dO="stockSearchInput",fO="searchResults",pO="blocksSearchDividerWrapper",gO="scrollableDiv",mO="listItem",vO="loaded",bO="loadedImage",yO="creatorInfo",wO="stockColorFilter",xO="allColors",_O="blackColor",CO="bwColor",SO="whiteColor",AO="orangeColor",kO="redColor",TO="purpleColor",IO="magentaColor",OO="greenColor",EO="tealColor",PO="blueColor";const MO=e(Ie,{style:{fontSize:20},spin:!0}),jO=({imageStockList:r,setImageStockList:i,currentReq:s,setCurrentReq:l,inputRef:c,customRequest:u})=>{const[h,d]=o(!1),[f,p]=o(2),{t:g}=gr(),{options:m}=Br(),{config:v}=m,b=async function({query:e,page:t}){const n=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{let r=`https://api.unsplash.com/search/photos?client_id=${null==v?void 0:v.UNSPLASH_KEY}&lang=ru&per_page=18&query=${n}&page=${t}`;""!==e.color&&(r+=`&color=${e.color}`),""!==e.orientation&&(r+=`&orientation=${e.orientation}`);const i=await fetch(r);return{data:await i.json()}}catch(e){console.log(e)}};a(()=>{""!==s.keywords&&y()},[s.color,s.orientation]);const y=async()=>{var e,t;const n=await b({query:s,page:1});(null===(t=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.results)||void 0===t?void 0:t.length)&&n.data.results.length>0&&i(n.data.results)},[w,x]=o(null),_=(e,t,n)=>{!async function(e){try{const t=await fetch(`${e}&client_id=${null==v?void 0:v.UNSPLASH_KEY}`);return{data:await t.json()}}catch(e){console.log(e)}}(t.download_location),x(n),setTimeout(()=>x(null),2e3),u(`${e.raw}&w=1200&q=96`)};return t("div",{className:hO,children:[t(P,{onValuesChange:y,className:r.length>0?fO:"",children:[t(B,{gutter:24,children:[e(V,{span:r.length>0?void 0:24,children:e(P.Item,{className:dO,children:e(E,{onKeyDown:e=>"Space"===e.code&&y(),onPressEnter:e=>y(),allowClear:!0,placeholder:g("Search image"),value:s.keywords,onChange:e=>l(t=>Object.assign(Object.assign({},t),{keywords:e.target.value})),ref:c,spellCheck:"false",suffix:e(se,{onClick:y,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})})})}),r.length>0&&t(n,{children:[e(V,{children:t(ne.Group,{defaultValue:"",onChange:e=>l(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[e(re,{title:g("All"),placement:"top",children:e(ne.Button,{value:"",children:e(gi,{})})}),e(re,{title:g("Landscape"),placement:"top",children:e(ne.Button,{value:"landscape",children:e(mi,{})})}),e(re,{title:g("Portrait"),placement:"top",children:e(ne.Button,{value:"portrait",children:e(vi,{})})}),e(re,{title:g("Squarish"),placement:"top",children:e(ne.Button,{value:"squarish",children:e(bi,{})})})]})}),e(V,{children:t(ne.Group,{defaultValue:"",className:wO,onChange:e=>l(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[e(re,{title:g("All"),placement:"top",children:e(ne.Button,{className:xO,value:"",children:"All"})}),e(re,{title:g("Black"),placement:"top",children:e(ne.Button,{className:_O,value:"black",children:"B"})}),e(re,{title:g("Black and White"),placement:"top",children:e(ne.Button,{className:CO,value:"black_and_white",children:"B&W"})}),e(re,{title:g("White"),placement:"top",children:e(ne.Button,{className:SO,value:"white",children:"W"})}),e(re,{title:g("Orange"),placement:"top",children:e(ne.Button,{className:AO,value:"orange",children:"O"})}),e(re,{title:g("Red"),placement:"top",children:e(ne.Button,{className:kO,value:"red",children:"R"})}),e(re,{title:g("Purple"),placement:"top",children:e(ne.Button,{className:TO,value:"purple",children:"P"})}),e(re,{title:g("Magenta"),placement:"top",children:e(ne.Button,{className:IO,value:"magenta",children:"M"})}),e(re,{title:g("Green"),placement:"top",children:e(ne.Button,{className:OO,value:"green",children:"G"})}),e(re,{title:g("Teal"),placement:"top",children:e(ne.Button,{className:EO,value:"teal",children:"T"})}),e(re,{title:g("Blue"),placement:"top",children:e(ne.Button,{className:PO,value:"blue",children:"B"})})]})})]})]}),r.length>0&&e("div",{className:pO,children:e(G,{className:"zero-divider"})})]}),e("div",{className:"serach-output-wrapper",children:r.length>0&&e("div",{id:"scrollableDiv",className:gO,children:e(sO,{dataLength:r&&r.length,next:async()=>{h||(d(!0),b({query:s,page:f}).then(e=>{e&&e.data&&e.data.results&&i(t=>[...t,...e.data.results]),d(!1),p(e=>e+1)}).catch(()=>{d(!1)}))},hasMore:!!r,endMessage:t(G,{plain:!0,children:[g("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:e(te,{indicator:MO}),children:r.map((n,r)=>t("div",{className:mO,onClick:()=>_(n.urls,n.links,n.id),children:[e("img",{className:w===n.id?bO:"",width:"310px",src:`${n.urls.raw}&w=644&q=96`,alt:n.description,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(vO)}}),t("p",{className:yO,onClick:e=>e.stopPropagation(),children:[g("Photo by")," ",e("a",{target:"_blank",href:`${n.user.links.html}?utm_source=${null==v?void 0:v.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:n.user.name})," ",g("on")," ",e("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==v?void 0:v.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),w===n.id&&e(te,{className:"ant-spin",indicator:e(Ie,{spin:!0})})]},n.id+r))})})})]})},FO=()=>{const{options:e}=Br(),t=e.config;return c((e,n)=>{!1!==(null==t?void 0:t.pushToGTM)&&((e,t)=>{const n=()=>{try{const t=Object.assign(Object.assign({},e),{appLabel:"blocks_app"});window.dataLayer&&"function"==typeof window.dataLayer.push?window.dataLayer.push(t):console.log("Attempting to add to the dataLayer:",e)}catch(e){console.error("Ошибка при вызове GTM:",e)}};t?setTimeout(n,t):n()})(e,n)},[null==t?void 0:t.pushToGTM])};var RO="slideshowContainer",DO="slideshowImage";const LO=({images:t,transitionDuration:n=1e3,frameHeight:r})=>{const[i,s]=o([]),l=()=>{s(e=>e.map((t,n)=>n===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return a(()=>{if(t.length>0){const e=t[t.length-1];s(t=>[...t,{src:e,opacity:0}]),setTimeout(l,1e3)}else s([])},[t]),e("div",{className:RO,style:{height:r,minHeight:130},children:i.map((t,r)=>e("img",{src:`data:image/jpeg;base64, ${t.src}`,alt:`Slide ${r+1}`,className:DO,style:{opacity:t.opacity,transition:`opacity ${n}ms linear`,display:"block"}},r))})};const NO=t=>{var{className:n,style:r,color:i,text:o,bordered:a}=t,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["className","style","color","text","bordered"]);const l=o||"";return e(ie,Object.assign({style:r,color:i,bordered:a,className:n},s,{children:l}))},zO=({text:n,counter:r,limits:i,wrapperStyles:o})=>{const{t:a}=gr(),{options:s}=Br(),l=s.config,{token:c}=T.useToken(),u=+i>0,h=!u||r<+i,d=(null==l?void 0:l.billingPageUrl)||"/billing",f=r+" "+a("of")+" "+(u?i:"∞")+" "+(n||a("tests",{count:i}))+" "+a("was used",{count:r});return t("div",{className:"limits-couter-wrapper",style:o,children:[e(NO,{bordered:!1,text:f,className:"limit-counter",style:{color:h?c.colorText:"white"},color:h?c.colorFillSecondary:"rgb(255, 77, 79)"}),u&&e("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(d),children:a("Need more?")})]})};var BO={imageAi:"imageAi",imageItem:"imageItem",textAreaInputHybrid:"textAreaInputHybrid",loading:"loading",carousel:"carousel",arrow:"arrow",arrowNext:"arrowNext",arrowPrev:"arrowPrev",arrowBtn:"arrowBtn",arrowBtnNext:"arrowBtnNext",arrowBtnPrev:"arrowBtnPrev",row:"row",inputAffixWrapper:"inputAffixWrapper",textarea:"textarea",inputIcon:"inputIcon"};const VO=f(({className:t,onClick:n})=>e("div",{className:`${BO.arrow} ${BO.arrowNext} ${t||""}`,onClick:n,children:e(X,{className:`${BO.arrowBtn} ${BO.arrowBtnNext}`,size:"large",icon:e(Oe,{})})}));VO.displayName="SampleNextArrow";const UO=f(({className:t,onClick:n})=>e("div",{className:`${BO.arrow} ${BO.arrowPrev} ${t||""}`,onClick:n,children:e(X,{className:`${BO.arrowBtn} ${BO.arrowBtnPrev}`,size:"large",icon:e(Ee,{})})}));UO.displayName="SamplePrevArrow";const HO=({customRequest:n,aiTabRef:r,inputAiRef:i,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:u,setAiImageRequest:d,imageAiList:f,setImageAiList:p,isLoadingAi:g,setIsLoadingAi:m})=>{const[v,b]=o("auto"),{aiImageCounter:y,currentAiImgLimits:w,loadingDuringGeneration:x,requestStatus:_,handleGenerate:C,convertBase64ToFile:S,isShiftPressed:A,setIsShiftPressed:k,limitsInPlugin:T}=function({setFrameHeight:e,customRequest:t,aiTabRef:n,isImageUploaded:r,setIsImageUploaded:i,aiImageRequest:s,imageAiList:l,setImageAiList:u,isLoadingAi:d,setIsLoadingAi:f}){const{t:p}=gr(),{options:g}=Br(),m=g.config,v=Jr(),b=FO(),{messages:y}=g.config,[w,x]=o([]),[_,C]=o(0),[S,A]=o(null),[k,T]=o(!1),[I,O]=o(p("Evaluating the task")),[E,P]=o(!1);a(()=>{x(y)},[y]),a(()=>{l.length||S||x([])},[l,S]);const M=h(()=>(console.log("sendAIImageRequest"),m&&"function"==typeof(null==m?void 0:m.sendAIImageRequest)?null==m?void 0:m.sendAIImageRequest:()=>Promise.resolve({})),[m]),j=c(e=>{"error"!==e.status&&"Canceled"!==e.status?e.images?(O(String(e.status)),100===e.progress&&(f(!1),u(e.images),A(null),P(!1))):(u([String(e.data)]),100===e.progress&&f(!1)):(f(!1),P(!1),v.error({message:p("Something went wrong, please try again"),placement:"bottomRight",description:String(S)||void 0}))},[u,O,p,f,S,v,P]);a(()=>{w.length>1&&j(w[w.length-1])},[j,w]);const F=h(()=>{if(m&&"function"==typeof(null==m?void 0:m.sseQuery)){const e=null==m?void 0:m.sseQuery;return t=>e(t)}return e=>{}},[m]),R=h(()=>m&&"object"==typeof(null==m?void 0:m.handleLimitUsageEmitter)?null==m?void 0:m.handleLimitUsageEmitter:{fire:()=>{}},[m]),D=null==m?void 0:m.elementId,{projectId:L}=m,{limits:N}=(null==m?void 0:m.limits)?m:{limits:{ai_img_limit:0}},{ai_img_limit:z}=N,B=z>0&&_>=z,V=!(!(null==m?void 0:m.limits)||!m.counters)&&Dr,U=c(()=>{R.fire({name:"AiImgCount",count:_+1})},[R,_]),H=h(()=>!B&&!V,[B,V,_,z]),W=c(async()=>{console.log("generateImage"),O(p("Evaluating the task")),""===s||d||(f(!0),P(!0),u([]),b({event:"submit_form",action:"ai_image_generation",entity_id:D,project_id:L}),M({body:{project_id:L,request:"create-image",connection:"midjourney",message:s}}).then(e=>{var t,n,r;const{data:i,error:o}=e||{};if(o)throw o;const a=i;if(401===(null==a?void 0:a.status)||401===(null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.status))throw new Error("ERROR");if(200===(null==a?void 0:a.status)||200===(null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.status)){const e=(null==a?void 0:a.task)||(null===(r=null==a?void 0:a.data)||void 0===r?void 0:r.task);(null==e?void 0:e.id)&&(O(e.message),A(e.id)),(null==a?void 0:a.message)&&v.success({message:a.message,placement:"bottomRight",description:s}),F({task_id:null==e?void 0:e.id,entity_id:D})}else f(!1),P(!1),v.error({message:(null==a?void 0:a.message)||p("Something went wrong, please try again"),placement:"bottomRight",description:s})}).catch(e=>{f(!1),P(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&(null==v||v.error({message:p("Something went wrong, please try again"),placement:"bottomRight",description:s})),t}))},[s,d,f,P,u,b,D,L,M,v,F,p]),Y=c(()=>{H&&W()},[H,V,C,U,W,v,p]);a(()=>{},[m,V]);const $=c(e=>{if(!r){i(!0);const n=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!n)return;const r=n[1],o=n[2],a=atob(o),s=new Array(a.length);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);const l=new Uint8Array(s),c=new Blob([l],{type:`image/${r}`}),u=new File([c],"image.jpeg",{type:c.type,lastModified:Date.now()});t({file:u})}},[r,i,t]);return a(()=>{(d||l.length>0)&&setTimeout(()=>{let t=350;n.current&&(t=n.current.offsetHeight),e(t)},0)},[n,l.length,d,e]),{aiImageCounter:_,setAiImageCounter:C,currentAiImgLimits:z,isFieldsDisabled:B,canGenerateImage:H,aiImageRequest:s,imageAiList:l,setImageAiList:u,isLoadingAi:d,setIsLoadingAi:f,loadingDuringGeneration:E,setLoadingDuringGeneration:P,requestStatus:I,setRequestStatus:O,handleGenerate:Y,handleLimitAiImgCount:U,convertBase64ToFile:$,isShiftPressed:k,setIsShiftPressed:T,currentReqId:S,setCurrentReqId:A,limitsInPlugin:V}}({setFrameHeight:b,customRequest:n,aiTabRef:r,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:u,imageAiList:f,setImageAiList:p,isLoadingAi:g,setIsLoadingAi:m}),[I,O]=o(!1),M=c(()=>O(!0),[]),j=c(()=>O(!1),[]),F=c(e=>d(e.target.value),[d]),R=c(e=>{"Shift"===e.key?k(!0):"Enter"!==e.key||A||(e.preventDefault(),C())},[A,C,k]),D=c(e=>{"Shift"===e.key&&k(!1)},[k]);return t("div",{className:BO.imageAi,children:[T&&e(zO,{text:"images",counter:y,limits:w,wrapperStyles:{marginTop:-25}}),e(B,{gutter:24,className:BO.row,children:e(V,{span:24,children:e(P.Item,{children:t("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${BO.inputAffixWrapper}${I?" ant-input-affix-wrapper-focused":""}`,children:[e(E.TextArea,{ref:i,onKeyDown:R,onKeyUp:D,onFocus:M,onBlur:j,autoSize:!0,allowClear:!0,className:`${BO.textAreaInputHybrid} ${BO.textarea}`,placeholder:"Generate image",value:u,onChange:F,spellCheck:"false"}),e("span",{className:`ant-input-suffix ${BO.inputSuffix}`,children:g||x?e(Ie,{className:`${BO.inputIcon} input-icon`,spin:!0}):e(wi,{className:`${BO.inputIcon} input-icon`,onClick:C})})]})})})}),(g||f.length>0)&&t(oe,{dotPosition:"top",arrows:!0,nextArrow:e(VO,{}),prevArrow:e(UO,{}),className:BO.carousel,children:[g&&!f.length&&e("div",{className:BO.loading,children:t("div",{className:"spin",children:[e(Ie,{style:{fontSize:48},spin:!0}),e("p",{className:"status",children:_})]})}),f.length>0&&f.map((n,r)=>t("div",{className:BO.imageItem,children:[e(LO,{images:f,frameHeight:v}),e("div",{className:"buttons",children:f.length>0&&!g&&e(X,{onClick:()=>S(`data:image/jpeg;base64, ${n}`),icon:e(Pe,{}),children:"Use this variant"})})]},r))]})]})};let WO=!1;const YO=()=>{if(WO)return;window.addEventListener("error",e=>!(!e.message||!e.message.includes("ResizeObserver loop completed with undelivered notifications"))&&(e.stopImmediatePropagation(),e.preventDefault(),!0),!0);const e=window.onerror;window.onerror=(t,n,r,i,o)=>!("string"!=typeof t||!t.includes("ResizeObserver loop completed with undelivered notifications"))||!!e&&e(t,n,r,i,o),window.addEventListener("unhandledrejection",e=>{var t,n;(null===(n=null===(t=e.reason)||void 0===t?void 0:t.message)||void 0===n?void 0:n.includes("ResizeObserver loop completed with undelivered notifications"))&&e.preventDefault()});const t=console.error;if(console.error=(...e)=>{var n;((null===(n=e[0])||void 0===n?void 0:n.toString())||"").includes("ResizeObserver loop completed with undelivered notifications")||t.apply(console,e)},"undefined"!=typeof window){const e=()=>{try{["webpackHotUpdate","__webpack_require__","__webpack_hash__"].forEach(e=>{if(window[e]){const e=window.__webpack_require__;e&&"object"==typeof e&&null!==e&&"cache"in e&&console.warn("✅ Webpack обнаружен, активирована дополнительная защита от ResizeObserver ошибок")}})}catch(e){console.warn("Ошибка при поиске webpack объектов:",e)}};e(),setTimeout(e,1e3)}WO=!0},$O=()=>{WO=!1},GO=e=>{(null==e?void 0:e.customTheme)&&((e={})=>{const t=document.querySelector("head");if(!t)return;const n=document.createElement("style");if(n.type="text/css",n.dataset.themeVariablesFm="true",n.setAttribute("data-file-manager","true"),Object.entries(e).length){let r="";Object.entries(e).forEach(([e,t])=>{"object"!=typeof t&&(r+=`\t--${e}: ${t};\n`)}),r=`.em-filemanager {\n${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-theme-variables-fm="true"]');i?t.replaceChild(n,i):t.insertBefore(n,t.firstChild)}})(null==e?void 0:e.customTheme)},{Sider:XO,Content:KO}=ee,qO={keywords:"",color:"",orientation:""},ZO={keywords:""},JO=()=>{const s=Yr(),l=Zr(),h=(()=>{const{state:e,actions:t,options:n}=Br(),{selectedFolder:r,pathHistory:i,folders:o}=e,{t:a}=gr(),{setSelectedFolder:s,setPathHistory:l}=t,u=c((e,t=new Set)=>{if(t.has(e))return console.warn(`Обнаружен цикл в пути к папке с id=${e}`),[];const n=(Array.isArray(o)?o:[]).find(t=>t.id===e);if(!n)return[];const r=new Set(t);return r.add(e),n.parentId?n.parentId===n.id?(console.warn(`Обнаружена циклическая зависимость: папка ${n.id} является родителем самой себя`),[{id:n.id,name:n.name+" (ошибка)"}]):[...u(n.parentId,r),{id:n.id,name:n.name}]:[{id:n.id,name:n.name}]},[o]),h=c(e=>{console.log("🎯 handleFolderSelect:",e);const t="folders"===e?null:e;if(t!==r)if(null==s||s(t),"folders"===e){const e=[{id:"folders",name:a("Folders")}];null==l||l(e),n.onPathChange&&n.onPathChange([])}else if((Array.isArray(o)?o:[]).find(t=>t.id===e)){const t=u(e),r=[{id:"folders",name:a("Folders")},...t];null==l||l(r),n.onPathChange&&n.onPathChange(r.map(e=>e.name))}else console.warn("⚠️ Папка не найдена:",e);else console.log("🚫 Папка уже выбрана, пропускаем обновление:",e)},[n,l,s,a,o,u,r]),d=c(e=>{if(console.log("handleBreadcrumbClick вызван с index:",e),-1===e)null==s||s(null),null==l||l([{id:"folders",name:a("Folders")}]),n.onPathChange&&n.onPathChange([]);else{const t=i.slice(0,e+1),r=t[t.length-1],o="folders"===r.id?void 0:r.id;null==s||s(o||null),null==l||l(t),n.onPathChange&&n.onPathChange(t.map(e=>e.name))}},[n,i,l,s,a]),f=c(e=>{if(!e.isFolder)return;null==s||s(e.id);const t={id:e.id,name:e.name};if(l){const e=[...i,t];l(e)}if(n.onPathChange){const t=[...i.map(e=>e.name),e.name];n.onPathChange(t)}},[n,i,l,s]);return{state:{selectedFolder:r,pathHistory:i},actions:{handleFolderSelect:h,handleBreadcrumbClick:d,handleItemClick:f},selectedFolder:r,pathHistory:i,handleFolderSelect:h,handleBreadcrumbClick:d,handleItemClick:f}})(),d=(()=>{const{state:e,actions:t}=Br(),{pagination:n}=e,{setPagination:r}=t,i=c((e,t)=>{const i=t||n.pageSize;null==r||r({current:e,pageSize:i,total:n.total})},[n.pageSize,n.total,r]);return{state:{pagination:n},actions:{handlePaginationChange:i}}})(),f=(()=>{const[e,t]=r.useState(()=>{const e=localStorage.getItem(Qr);return e?Math.max(200,parseInt(e,10)):298}),[n,i]=r.useState(!1),[o,a]=r.useState(!1),[s,l]=r.useState(0),c=r.useCallback(()=>{console.log("Double click: Resetting to default width"),t(298),localStorage.setItem(Qr,298..toString())},[]),u=r.useCallback(n=>{n.preventDefault(),n.stopPropagation(),i(!0),document.body.classList.add("resizing");const r=n.clientX,o=e;let s=o;const c=e=>{e.preventDefault();const n=Math.max(Math.min(o+e.clientX-r,600),200);s=n,t(n),l(e.clientX),a(!0)},u=()=>{i(!1),document.body.classList.remove("resizing"),a(!1),localStorage.setItem(Qr,s.toString()),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)},[e]);return r.useEffect(()=>()=>{document.body.classList.remove("resizing")},[]),{sidebarWidth:e,isResizing:n,showResizeGuide:o,resizeGuidePosition:s,handleResizeStart:u,handleDoubleClick:c}})(),p=(()=>{const[e,t]=o([]),[n,r]=o(!1),[i,a]=o(!1),s=u(0),l=c(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),h=c(e=>`${(e.size/1024).toFixed(2)} КБ`,[]),d=c(e=>{const n=e.map(e=>({id:l(),name:e.name,size:h(e),status:"uploading",progress:0}));return t(n),r(!0),a(!1),n.map(e=>e.id)},[l,h]),f=c((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,n))}):t))},[]),p=c(e=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"success",progress:100}):t))},[]),g=c((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:n}):t))},[]),m=c(()=>{r(!1),a(!1),setTimeout(()=>{t([])},300)},[]),v=c(()=>{a(e=>!e)},[]),b=c(e=>{t(t=>t.filter(t=>t.id!==e)),t(t=>(t.length<=1&&setTimeout(()=>{r(!1),a(!1)},100),t.filter(t=>t.id!==e)))},[]),y=e.length,w=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:n,isUploadMinimized:i,totalFiles:y,completedFiles:w,startUpload:d,updateProgress:f,markAsSuccess:p,markAsError:g,closeUpload:m,minimizeUpload:v,insertFile:b}})(),g=Wr(),m=i.useRef(null),{folders:v,loading:b}=s.state,{fetchFolders:y,handleCreateFolder:w,handleModalOk:x,handleModalCancel:_,generateMenuItems:C}=s.actions,S=oi(y),{files:A,selectedFiles:k,loading:T,isRenamingFile:I,fileToRename:O}=l.state,{fetchFiles:E,handleDeleteFile:P,handleDeleteFolder:M,handleAddFile:j,handleAddFileByUrl:F,uploadFileWithProvider:R,toggleFileSelection:D,showRenameModal:L,handleRenameCancel:N,handleRenameOk:z,handleDroppedFiles:B,showMoveModal:V,handleMoveCancel:U,handleMoveOk:H,showDeleteConfirm:W,handleDeleteConfirmCancel:Y,handleDeleteConfirmOk:$}=l.actions,{selectedFolder:X,pathHistory:K}=h.state,{handleFolderSelect:q,handleBreadcrumbClick:Z,handleItemClick:J}=h.actions,{pagination:Q}=d.state,te=(e=>{const{state:t,actions:n}=Br(),{searchTerm:r,sortBy:i,sortOrder:o,selectedFolder:s,pagination:l}=t,{setSearchTerm:h,setSortBy:d,setSortOrder:f,setPagination:p}=n,g=e||n.fetchFiles,m=u(null),v=u(Ir.debounce(e=>{const t=JSON.stringify(e);m.current!==t?(m.current=t,console.log("✅ Выполняется запрос:",e),null==g||g(e)):console.log("🚫 Дублированный запрос пропущен:",e)},150)).current,b=c(()=>({folderId:null===s?"root":s||void 0,search:(null==r?void 0:r.trim())||void 0,page:l.current,limit:l.pageSize,sortBy:i,sortOrder:o}),[s,r,l.current,l.pageSize,i,o]),y=c(e=>{if(console.log("🔎 useSortAndFilter: handleSearch вызван с:",e),h&&(console.log("🔎 useSortAndFilter: Обновляем searchTerm в стейте"),h(e)),p&&(console.log("🔎 useSortAndFilter: Сбрасываем пагинацию"),p({current:1,pageSize:l.pageSize,total:0})),console.log("🔎 useSortAndFilter: Проверяем fetchFiles:",!!g),g){console.log("🔎 useSortAndFilter: Вызываем fetchFiles с параметрами поиска");const t={folderId:null===s?"root":s||void 0,search:(null==e?void 0:e.trim())||void 0,page:1,limit:l.pageSize,sortBy:i,sortOrder:o};console.log("🔎 useSortAndFilter: Параметры запроса:",t),g(t),console.log("🔎 useSortAndFilter: fetchFiles вызван!")}else console.error("🔎 useSortAndFilter: fetchFiles НЕ ОПРЕДЕЛЕНА!")},[h,p,l.pageSize,g,s,i,o]),w=c((e,t)=>{null==d||d(e),null==f||f(t),g&&v({folderId:null===s?"root":s||void 0,search:(null==r?void 0:r.trim())||void 0,page:l.current,limit:l.pageSize,sortBy:e,sortOrder:t})},[d,f,v,s,r,l.current,l.pageSize]),x=c((e,t)=>{p&&p({current:e,pageSize:t||l.pageSize,total:l.total}),g&&v({folderId:null===s?"root":s||void 0,search:(null==r?void 0:r.trim())||void 0,page:e,limit:t||l.pageSize,sortBy:i,sortOrder:o})},[p,l.pageSize,l.total,v,s,r,i,o]);return a(()=>{if(g){console.log("🔄 useSortAndFilter: изменение selectedFolder, загрузка файлов для папки:",s);const e=b();v(Object.assign(Object.assign({},e),{page:1}))}},[s]),a(()=>{g&&(console.log("🔄 useSortAndFilter: начальная загрузка файлов, selectedFolder:",s),v(b()))},[]),a(()=>()=>{var e;null===(e=v.cancel)||void 0===e||e.call(v)},[v]),{state:{searchTerm:r||"",sortBy:i||"name",sortOrder:o||"asc"},actions:{setSearchTerm:h||(()=>{}),setSortBy:d||(()=>{}),setSortOrder:f||(()=>{}),handleSearch:y,handleSort:w,handlePaginationChange:x,getCurrentQueryParams:b}}})(E),{searchTerm:ne,sortBy:re,sortOrder:ie}=te.state,{handleSearch:oe,handleSort:ae,handlePaginationChange:se}=te.actions,le=(({files:e,selectedFiles:t,fetchFiles:n,selectedFolder:i})=>{const o=Jr(),{options:a,actions:s,state:l}=r.useContext(zr),{setActiveLibraryItem:c}=s,{activeLibraryItem:u}=l,[h,d]=r.useState(!1),[f,p]=r.useState(null);r.useEffect(()=>{console.log(h)},[h]);const g=r.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return Lr.includes(t)}const n=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!n&&Lr.includes(n)},[]),m=r.useCallback(async e=>{const{dataProviders:t}=a;if(console.log("🔧 saveFileToServer: dataProviders доступны:",{hasUpdateFile:!!(null==t?void 0:t.updateFile),hasUploadFile:!!(null==t?void 0:t.uploadFile),hasThumbnail:!!e.thumbnail,fileId:e.id}),(null==t?void 0:t.updateFile)&&e.thumbnail)try{let n=e.type||"image/png";if(e.thumbnail.startsWith("data:")){const t=e.thumbnail.match(/^data:([^;]+)/);t&&t[1].startsWith("image/")&&(n=t[1])}const r=e.thumbnail.split(",")[1],i=atob(r),o=new Array(i.length);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);const a=new Uint8Array(o),s=new Blob([a],{type:n});return console.log("Using updateFile method with:",{fileId:e.id,mimeType:n,blobType:s.type}),await t.updateFile(e.id,{name:e.name,type:n,data:s,thumbnail:e.thumbnail,extension:e.extension})}catch(e){return console.error("Ошибка при обновлении файла через updateFile:",e),null}else if((null==t?void 0:t.uploadFile)&&e.thumbnail)try{let n=e.type||"image/png";if(e.thumbnail.startsWith("data:")){const t=e.thumbnail.match(/^data:([^;]+)/);t&&t[1].startsWith("image/")&&(n=t[1])}const r=e.thumbnail.split(",")[1],i=atob(r),o=new Array(i.length);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);const a=new Uint8Array(o),s=new Blob([a],{type:n});console.log("Using uploadFile method as fallback with:",{mimeType:n,blobType:s.type}),await t.uploadFile(Object.assign(Object.assign({},e),{type:n,data:s}))}catch(e){return console.error("Ошибка при сохранении файла через uploadFile:",e),null}else if(null==t?void 0:t.renameFile)try{return await t.renameFile(e.id,e.name)}catch(e){return console.error("Ошибка при переименовании файла:",e),null}return console.warn("DataProvider для обновления файлов не настроен"),null},[a]),v=r.useCallback(n=>{let r;if(console.log("🎨 handleEdit ВЫЗВАНА!",{fileForEdit:n,selectedFilesSize:t.size}),n)r=n;else{if(1!==t.size)return;const n=Array.from(t)[0];if(r=e.find(e=>e.id===n),!r||r.isFolder||!g(r))return}console.log("🎨 usePixieEditor: Открываем редактор для файла:",r),c&&c(Rr),console.log("🎨 usePixieEditor: Устанавливаем editingFile"),p(r),console.log("🎨 usePixieEditor: Устанавливаем isPixieEditorVisible = true"),d(!0),console.log("🎨 usePixieEditor: Редактор должен открыться")},[t,e,g,d,c]),b=r.useCallback(()=>{console.log("🎨 usePixieEditor: Закрываем редактор"),c&&u===Rr&&c(Pr),d(!1),p(null),console.log("🎨 usePixieEditor: Редактор закрыт")},[u,c]),y=r.useCallback(async e=>{console.log("Файл обновлен:",e);try{const t=await m(e);if(t)return await n({folderId:i||void 0}),o.success({message:"Успех",description:"Изображение успешно обновлено"}),b(),a.onEditorOk&&a.onEditorOk(t),t}catch(e){console.error("Ошибка при сохранении файла:",e),o.error({message:"Ошибка",description:`Не удалось сохранить изменения: ${e instanceof Error?e.message:"Неизвестная ошибка"}`})}},[m,n,i,o,b]);return{isPixieEditorVisible:h,editingFile:f,handleEdit:v,handlePixieEditorSave:y,handlePixieEditorClose:b}})({files:A||[],selectedFiles:k||new Set,fetchFiles:E,selectedFolder:X||null}),ce=i.useCallback(async()=>{var e;let t=null;await j({onStart:e=>{const n=p.startUpload([e]);t=n[0],console.log("🚀 onStart: файл запущен",{fileName:e.name,fileId:t})},onProgress:(e,n)=>{t&&(p.updateProgress(t,n),console.log("🔍 onProgress:",{fileName:e,fileId:t,progress:n}))},onComplete:e=>{t?(p.markAsSuccess(t),console.log("✅ onComplete: markAsSuccess вызван",{fileName:e,fileId:t})):console.error("❌ currentFileId отсутствует для onComplete:",e)},onError:(e,n)=>{t&&(p.markAsError(t,n),console.log("❌ onError: markAsError вызван",{fileName:e,fileId:t,error:n}))}}),await(null===(e=m.current)||void 0===e?void 0:e.refreshFileCounts())},[j,p]),ue=i.useCallback(async()=>{var e;await F(),await(null===(e=m.current)||void 0===e?void 0:e.refreshFileCounts())},[F]),he=i.useCallback(async e=>{var t;await P(e),await(null===(t=m.current)||void 0===t?void 0:t.refreshFileCounts())},[P]),de=i.useCallback(async e=>{var t;if(B){const n=p.startUpload(e);console.log("🚀 Drag&Drop: файлы запущены",{fileCount:e.length,fileIds:n}),e.forEach(async(e,t)=>{const r=n[t];if(!r)return;let i=0;const o=setInterval(()=>{i=Math.min(i+10+Math.floor(Date.now()%10),85),p.updateProgress(r,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await B(e),n.forEach(e=>{p.updateProgress(e,100),p.markAsSuccess(e)}),await(null===(t=m.current)||void 0===t?void 0:t.refreshFileCounts())}},[B,p]),fe=i.useCallback(async e=>{var t;await M(e),await y(),await(null===(t=m.current)||void 0===t?void 0:t.refreshFileCounts())},[M,y]),pe=(({files:e,selectedFiles:t,toggleFileSelection:n,showRenameModal:i,showMoveModal:o,showCopyModal:a,handleDeleteFile:s,handleDeleteFolder:l,showDeleteConfirm:c,onEdit:u})=>({handleClearSelection:r.useCallback(()=>{t&&t.size>0&&t.forEach(e=>{n(e)})},[t,n]),handleRename:r.useCallback(()=>{if(t&&1===t.size){const e=Array.from(t)[0];i(e)}},[t,i]),handleDeleteSelected:r.useCallback(()=>{if(t&&t.size>0){if(c)return void c();t.forEach(t=>{const n=e.find(e=>e.id===t);n?n.isFolder?l(t):s(t):console.warn(`Объект с ID ${t} не найден в списке файлов`)})}},[t,e,s,l,c]),handleCopy:r.useCallback(()=>{a()},[a]),handleMove:r.useCallback(()=>{o()},[o]),handleEdit:r.useCallback(()=>{u()},[u])}))({files:A||[],selectedFiles:k||new Set,toggleFileSelection:D,showRenameModal:L,showMoveModal:V,showCopyModal:l.actions.showCopyModal||(()=>{}),handleDeleteFile:P,handleDeleteFolder:fe,showDeleteConfirm:W,onEdit:le.handleEdit}),ge=b||T;a(()=>{YO(),y()},[y]),i.useEffect(()=>{!X&&q&&v.length>0&&(console.log("✅ Инициализация: автоматический выбор корневой папки"),q("folders"))},[X,q,v.length]);const{state:me,actions:ve,options:be}=i.useContext(zr),{form:ye,urlForm:we,renameForm:xe,moveForm:_e,renameFolderForm:Ce,copyForm:Se,isModalVisible:Ae,isUrlModalVisible:ke,isMoveModalVisible:Te,isRenameFolderModalVisible:Ie,isCopyModalVisible:Oe,isDeleteConfirmVisible:Ee,folderToRename:Pe,activeLibraryItem:Me}=me,{setIsUrlModalVisible:je,setSortField:Fe,setActiveLibraryItem:Re}=ve,{config:De}=be,{handleRenameFolderCancel:Le,handleRenameFolderOk:Ne}=S.actions,ze=c(e=>{se(e.current||Q.current,e.pageSize||Q.pageSize)},[se,Q.current,Q.pageSize]),Be=i.useCallback(e=>{const{sortBy:t,sortOrder:n}=(e=>{const[t,n]=e.split("-");return{sortBy:t,sortOrder:n}})(e);ae(t,n)},[ae]),[Ve,Ue]=o(ZO),[He,We]=o([]),Ye=u(null),[$e,Ge]=o(qO),[Xe,Ke]=o([]),qe=u(null),[Ze,Je]=o(""),[Qe,et]=o([]),tt=i.useRef(void 0),[nt,rt]=o(!1),[it,ot]=o(!1),at=i.useRef(null),st=i.useRef(null);return a(()=>{(async()=>{const e=null==De?void 0:De.fileForEdit;if(tt.current!==e)try{if(tt.current=e,Me===Rr&&e&&!le.editingFile&&"string"==typeof e)if(e.startsWith("data:"))null==le||le.handleEdit({thumbnail:e});else{const t=await g.handleAddFileByUrl(e,!0);if(!t)throw new Error("Не удалось загрузить файл");tt.current===e&&(null==le||le.handleEdit(t))}}finally{tt.current===e&&(tt.current=null)}})()},[Me,null==De?void 0:De.fileForEdit]),a(()=>{var e,t,n;Me===Pr?(console.log("reset requests"),We([]),Ue(ZO),Ke([]),Ge(qO),et([]),Je(""),ot(!1),rt(!1)):Me===Fr?null===(e=st.current)||void 0===e||e.focus():Me===Mr?null===(t=Ye.current)||void 0===t||t.focus():Me===jr&&(null===(n=qe.current)||void 0===n||n.focus())},[Me]),t(ee,{className:"file-manager__layout",children:[f.showResizeGuide&&e("div",{className:"resize-guide",style:{left:`${f.resizeGuidePosition}px`}}),e(eO,{selectedFiles:k||new Set,onClearSelection:pe.handleClearSelection,onRename:pe.handleRename,onDelete:pe.handleDeleteSelected,onCopy:pe.handleCopy,onMove:pe.handleMove,onEdit:pe.handleEdit,files:A||[]}),e(G,{className:"zero-divider"}),t(ee,{className:"file-manager__content",children:[t(XO,{width:f.sidebarWidth,theme:"light",className:"file-manager-sider",children:[e(Ai,{ref:m,selectedFolder:X||null,generateMenuItems:C,onFolderSelect:e=>null==q?void 0:q(e),folders:v||[],fetchFolders:y,handleAddFile:ce,setIsUrlModalVisible:e=>null==je?void 0:je(e),handleDeleteFolder:fe,handleCreateFolder:w,activeLibraryItem:Me,setActiveLibraryItem:e=>null==Re?void 0:Re(e)}),e("div",{className:"sidebar-resizer "+(f.isResizing?"resizing":""),onMouseDown:f.handleResizeStart,onDoubleClick:f.handleDoubleClick,children:e("div",{className:"sidebar-resizer-indicator"})})]}),e(ee,{className:"file-manager__main-content",children:t(KO,{className:"main-content",ref:at,children:[Me===Pr&&e(ri,{searchTerm:ne,sortField:me.sortField||"name",setSortField:e=>null==Fe?void 0:Fe(e),pathHistory:K||[],handleBreadcrumbClick:e=>null==Z?void 0:Z(e),handleAddFile:ce,setIsUrlModalVisible:e=>null==je?void 0:je(e),files:A||[],handleSearch:oe,handleSort:ae,sortBy:re,sortOrder:ie,handleSortOptionChange:Be,pagination:Q,setPagination:ze,loading:ge,handleItemClick:e=>null==J?void 0:J(e),handleDeleteFile:he,selectedFiles:k||new Set,toggleFileSelection:e=>null==D?void 0:D(e),handleDroppedFiles:de,fileUpload:p}),Me===Mr&&e(uO,{imageGifList:He,setImageGifList:We,currentReqGif:Ve,setCurrentReqGif:Ue,inputRef:Ye,customRequest:F}),Me===jr&&e(jO,{imageStockList:Xe,setImageStockList:Ke,currentReq:$e,setCurrentReq:Ge,inputRef:qe,customRequest:F}),Me===Fr&&!!(null==De?void 0:De.sseQuery)&&e(HO,{imageAiList:Qe,setImageAiList:et,aiImageRequest:Ze,setAiImageRequest:Je,inputAiRef:st,customRequest:e=>R(e.file),isLoadingAi:nt,setIsLoadingAi:rt,isImageUploaded:it,setIsImageUploaded:ot,aiTabRef:at}),Me===Rr&&e(n,{})]})})]}),e(ii,{isModalVisible:Ae,handleModalOk:x,handleModalCancel:_,form:ye,selectedFolder:X||null,folders:v||[],isUrlModalVisible:ke,setIsUrlModalVisible:e=>null==je?void 0:je(e),handleAddFileByUrl:ue,urlForm:we,isRenameModalVisible:I,handleRenameOk:()=>null==z?void 0:z(),handleRenameCancel:()=>null==N?void 0:N(),renameForm:xe,fileToRename:O,files:A||[],isMoveModalVisible:Te,handleMoveOk:H,handleMoveCancel:U,moveForm:_e,selectedFiles:k||new Set,isRenameFolderModalVisible:Ie,handleRenameFolderOk:Ne,handleRenameFolderCancel:Le,renameFolderForm:Ce,folderToRename:Pe,isCopyModalVisible:Oe,handleCopyOk:l.actions.handleCopyOk||(()=>Promise.resolve()),handleCopyCancel:l.actions.handleCopyCancel||(()=>{}),copyForm:Se,isDeleteConfirmVisible:Ee,handleDeleteConfirmOk:async()=>{var e;await(null==$?void 0:$()),await(null===(e=m.current)||void 0===e?void 0:e.refreshFileCounts())},handleDeleteConfirmCancel:()=>null==Y?void 0:Y()}),e(FI,{visible:le.isPixieEditorVisible,onClose:le.handlePixieEditorClose,file:le.editingFile,onSave:le.handlePixieEditorSave}),e(qI,{files:p.uploadFiles,visible:p.isUploadVisible,minimized:p.isUploadMinimized,totalFiles:p.totalFiles,completedFiles:p.completedFiles,onClose:p.closeUpload,onMinimize:p.minimizeUpload,onInsert:p.insertFile})]})},QO=f(({config:r={},onPathChange:o,onChangeSelection:s,onEditorOk:l,searchQuery:c="",sortBySize:h="name",apiEndpoints:d={},customIcons:f,dragDropIcon:p,dataProviders:g,notification:m})=>{i.useEffect(()=>{r.theme&&(e=>{document.documentElement.setAttribute("data-theme",e)})(r.theme),GO(r)},[r]),a(()=>{let e;const t=r.locale||Jn.language;return r.customLocale&&t&&(e=Jn.getResourceBundle(t,"translation"),Jn.addResourceBundle(t,"translation",r.customLocale,!0,!0)),()=>{r.customLocale&&t&&e&&Jn.addResourceBundle(t,"translation",e,!0,!0)}},[r.customLocale,r.locale]);const v=u(null);return e(O,{className:"em-filemanager",children:t(n,{children:[e(I,{getPopupContainer:()=>v.current||document.body,children:e(Vr,{options:{apiEndpoints:d,searchQuery:c,sortBySize:h,onPathChange:o,onChangeSelection:s,onEditorOk:l,config:r,customIcons:f,dragDropIcon:p,dataProviders:g,notification:m},children:e(JO,{})})}),e("div",{ref:v,className:"file-manager-modal-root"})]})})});QO.displayName="FileManagerApp";const eE=t=>{var n,r,i;return e(mr,{i18n:Jn,children:e(cn,{externalTheme:null!==(r=null===(n=t.config)||void 0===n?void 0:n.theme)&&void 0!==r?r:"light",customThemeToken:null===(i=t.config)||void 0===i?void 0:i.customTheme,children:e(k,{children:e(QO,Object.assign({},t))})})})},tE=new Map,nE=(t,n)=>{var r;let i;YO();let o={};const a=e=>{const t=!e||"fileManager"!==e.mode&&"imageCenter"!==e.mode&&"plugin"!==e.mode?void 0:e.mode;return"imageCenter"===t?hn("imageCenter",e):hn(t)};if(t instanceof HTMLElement){i=t;o={config:a(n),apiEndpoints:null==n?void 0:n.apiEndpoints}}else{i=t.element;const e=a(t.config),n=Object.assign(Object.assign({},null===(r=t.config)||void 0===r?void 0:r.apiEndpoints),t.apiEndpoints);o={config:e,currentPath:t.currentPath,onPathChange:t.onPathChange,onChangeSelection:t.onChangeSelection,searchQuery:t.searchQuery,sortBySize:t.sortBySize,apiEndpoints:n,dataProviders:t.dataProviders,customIcons:t.customIcons,dragDropIcon:t.dragDropIcon}}const s=A(i);s.render(e(eE,Object.assign({},o))),tE.set(i.id||`container_${Date.now()}`,s)},rE=e=>{const t=e.id||Object.keys(tE).find(e=>e.startsWith("container_"));if(t&&tE.has(t)){const e=tE.get(t);null==e||e.unmount(),tE.delete(t)}else{console.warn("Не удалось найти корень для размонтирования");try{A(e).unmount()}catch(e){console.error("Ошибка при размонтировании компонента:",e)}}},iE=new Map,oE=r=>{const{onClose:o,onSave:a,dataProviders:s,theme:l}=r,c=i.useMemo(()=>{if(r.file)return r.file;const e=r.name||"edited-image",t=r.extension||(r.type?r.type.split("/")[1]:"png"),n=r.type||`image/${t}`;return{thumbnail:r.imageDataUrl||"",name:e,id:void 0,type:n,extension:t}},[r.file,r.imageDataUrl,r.name,r.extension,r.type]),h=i.useCallback(async e=>{if((null==s?void 0:s.updateFile)&&e.id&&e.thumbnail)try{let t=e.type||"image/png";if(e.thumbnail.startsWith("data:")){const n=e.thumbnail.match(/^data:([^;]+)/);n&&n[1].startsWith("image/")&&(t=n[1])}const n=e.thumbnail.split(",")[1],r=atob(n),i=new Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);const o=new Uint8Array(i),a=new Blob([o],{type:t});e=await s.updateFile(e.id,{name:e.name,type:t,data:a,thumbnail:e.thumbnail,extension:e.extension})}catch(e){console.error("Standalone Pixie: updateFile error",e)}return a&&await a(e),e},[a,s]),d=u(null);return e(O,{className:"em-filemanager",children:t(n,{children:[e(I,{getPopupContainer:()=>d.current||document.body,children:e(mr,{i18n:Jn,children:e(cn,{externalTheme:null!=l?l:"light",children:e(k,{children:e(Vr,{options:{dataProviders:s,config:{theme:null!=l?l:"light",locale:r.locale}},children:e(FI,{visible:!0,onClose:o,file:c,onSave:h})})})})})}),e("div",{ref:d,className:"file-manager-modal-root"})]})})},aE=t=>{YO();const n=t.element,r=A(n);r.render(e(oE,Object.assign({},t))),iE.set(n.id||`pixie_container_${Date.now()}`,r)},sE=e=>{const t=Array.from(iE.keys()).find(e=>e.startsWith("pixie_container_")),n=e.id||t;if(n&&iE.has(n)){const e=iE.get(n);null==e||e.unmount(),iE.delete(n)}else{console.warn("Не удалось найти корень Pixie для размонтирования");try{A(e).unmount()}catch(e){console.error("Ошибка при размонтировании Pixie:",e)}}},lE=e=>{var t,n;const{mode:r,element:i,fileManager:o,pixieEditor:a,theme:s,dataProviders:l}=e;let c,u;const h={unmount:()=>{c&&rE(c),u&&sE(u)},unmountFileManager:void 0,unmountPixieEditor:void 0};switch(r){case"fileManager":c=i,nE(i,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),h.unmountFileManager=()=>rE(c);break;case"pixieEditor":u=i,aE(Object.assign({element:i,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),h.unmountPixieEditor=()=>sE(u);break;case"both":{const e=document.createElement("div");e.id="file-manager-container",e.style.cssText="height: 50%; border-bottom: 1px solid #d9d9d9;";const t=document.createElement("div");t.id="pixie-editor-container",t.style.cssText="height: 50%;",i.appendChild(e),i.appendChild(t),c=e,u=t,nE(c,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(n=null==o?void 0:o.config)||void 0===n?void 0:n.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),aE(Object.assign({element:u,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),h.unmountFileManager=()=>rE(c),h.unmountPixieEditor=()=>sE(u);break}}return h};var cE={init:nE,unmount:rE,initPixieEditor:aE,unmountPixieEditor:sE,initFileManager:lE};export{ri as FileContent,QO as FileManagerApp,eE as FileManagerAppWithContext,ii as FileModals,Ai as FolderSidebar,oE as PixieOnlyApp,cE as default,nE as init,lE as initFileManager,aE as initPixieEditor,YO as installResizeObserverErrorHandler,$O as uninstallResizeObserverErrorHandler,rE as unmount,sE as unmountPixieEditor};
96
96
  //# sourceMappingURL=file-manager.esm.js.map