@emailmaker/emailmaker 1.0.105-alpha.2 → 1.0.105-alpha.4
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.
- package/README.md +1 -1
- package/asset-manifest.json +27 -27
- package/emailmaker-esm.js +1 -1
- package/emailmaker.d.ts +12 -0
- package/emailmaker.js +1 -1
- package/fm_notification.d.ts +7 -0
- package/iframe/429.js +1 -1
- package/iframe/766.js +1 -1
- package/iframe/iframe-eblock.8a89e322598692e0eeba.html +1 -0
- package/iframe/iframe.8a89e322598692e0eeba.html +1 -0
- package/iframe/index.html +1 -1
- package/iframe/js/174.095d961e.js +1 -0
- package/iframe/js/525.9e1b70bc.js +1 -0
- package/iframe/js/882.2d075402.js +1 -0
- package/iframe/sandbox-eblock.js +1 -1
- package/package.json +1 -1
- package/static/css/5102.197af245.chunk.css +2 -0
- package/static/js/3628.6018921f.js +3 -0
- package/static/js/5102.35699661.js +2 -0
- package/static/js/5255.9c7c7b3d.js +3 -0
- package/static/js/7126.41a40c3e.js +3 -0
- package/static/js/775.2051612f.js +2 -0
- package/static/js/{9162.ceffe13d.js → 9162.8b5b452e.js} +3 -3
- package/static/js/{9372.c2b9829b.js → 9372.5402055c.js} +2 -2
- package/static/js/{emailmaker_core.e1cbf346.js → emailmaker_core.2c8ad264.js} +3 -3
- package/iframe/iframe-eblock.a3b09251dd866fdeec56.html +0 -1
- package/iframe/iframe.a3b09251dd866fdeec56.html +0 -1
- package/iframe/js/174.c821d3c9.js +0 -1
- package/iframe/js/525.61f2133e.js +0 -1
- package/iframe/js/882.48297d32.js +0 -1
- package/static/css/5102.89f00fa4.chunk.css +0 -2
- package/static/js/3628.0408f9e7.js +0 -3
- package/static/js/5102.6c03b989.js +0 -2
- package/static/js/5255.c937525e.js +0 -3
- package/static/js/7126.9660446b.js +0 -3
- package/static/js/775.0c4c7dc7.js +0 -2
- /package/iframe/js/{174.c821d3c9.js.LICENSE.txt → 174.095d961e.js.LICENSE.txt} +0 -0
- /package/iframe/js/{525.61f2133e.js.LICENSE.txt → 525.9e1b70bc.js.LICENSE.txt} +0 -0
- /package/iframe/js/{882.48297d32.js.LICENSE.txt → 882.2d075402.js.LICENSE.txt} +0 -0
- /package/static/js/{3628.0408f9e7.js.LICENSE.txt → 3628.6018921f.js.LICENSE.txt} +0 -0
- /package/static/js/{5255.c937525e.js.LICENSE.txt → 5255.9c7c7b3d.js.LICENSE.txt} +0 -0
- /package/static/js/{7126.9660446b.js.LICENSE.txt → 7126.41a40c3e.js.LICENSE.txt} +0 -0
- /package/static/js/{9162.ceffe13d.js.LICENSE.txt → 9162.8b5b452e.js.LICENSE.txt} +0 -0
- /package/static/js/{emailmaker_core.e1cbf346.js.LICENSE.txt → emailmaker_core.2c8ad264.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 3628.6018921f.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[3628],{93628:(e,t,r)=>{var n;r.d(t,{BC:()=>JO,KG:()=>ZO});var i=r(81516),o=r(1936),a=r(55054),s=r(6691),l=r(18021),c=r(2938),u=r(32101),d=r(6143),h=r(84226),f=r(94035),p=r(84138),g=r(5464),m=r(77550),v=r(236),y=r(94533),b=r(60369),w=r(8900),x=r(14516),C=r(7494),_=r(32380),S=r(90176),A=r(88610),k=r(90947),E=r(62329),I=r(58986),j=r(51114),T=r(89773),F=r(76728),O=r(54760),P=r(3636),M=r(70906),R=r(41904),L=r(56893),N=r(16566),D=r(92828),z=r(88259),B=r(30130),U=r(41387),V=r(33486),H=r(86331),$=r(82026),W=r(24259),G=r(58937),q=r(63481),Y=r(8647),X=r(26281),K=r(21986),Z=r(5199),J=r(12471),Q=r(50295),ee=r(90669),te=r(77478),re=r(52853),ne=r(52433),ie=r(53082),oe=r(60222),ae=r(9438),se=r(78811),le=r(86588),ce=r(91796),ue=r(25228),de=r(18005),he=r(91691).Buffer;function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fe(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function me(e){var t=function(e,t){if("object"!=ge(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ge(t)?t:t+""}function ve(e,t,r){return(t=me(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(r),!0).forEach(function(t){ve(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var we={},xe=[];function Ce(e,t){}function _e(e,t){}function Se(e,t,r){t||we[r]||(e(!1,r),we[r]=!0)}function Ae(e,t){Se(Ce,e,t)}function ke(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new Set;return function e(t,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=n.has(t);if(Ae(!a,"Warning: There may be circular references"),a)return!1;if(t===i)return!0;if(r&&o>1)return!1;n.add(t);var s=o+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var l=0;l<t.length;l++)if(!e(t[l],i[l],s))return!1;return!0}if(t&&i&&"object"===ge(t)&&"object"===ge(i)){var c=Object.keys(t);return c.length===Object.keys(i).length&&c.every(function(r){return e(t[r],i[r],s)})}return!1}(e,t)}function Ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ie(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,me(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function je(e){return e.join("%")}Ae.preMessage=function(e){xe.push(e)},Ae.resetWarned=function(){we={}},Ae.noteOnce=function(e,t){Se(_e,e,t)};var Te=function(){function e(t){Ee(this,e),ve(this,"instanceId",void 0),ve(this,"cache",new Map),ve(this,"extracted",new Set),this.instanceId=t}return Ie(e,[{key:"get",value:function(e){return this.opGet(je(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(je(e),t)}},{key:"opUpdate",value:function(e,t){var r=t(this.cache.get(e));null===r?this.cache.delete(e):this.cache.set(e,r)}}]),e}(),Fe=["children"],Oe="data-css-hash",Pe="__cssinjs_instance__";function Me(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(Oe,"]"))||[],r=document.head.firstChild;Array.from(t).forEach(function(t){t[Pe]=t[Pe]||e,t[Pe]===e&&document.head.insertBefore(t,r)});var n={};Array.from(document.querySelectorAll("style[".concat(Oe,"]"))).forEach(function(t){var r,i=t.getAttribute(Oe);n[i]?t[Pe]===e&&(null===(r=t.parentNode)||void 0===r||r.removeChild(t)):n[i]=!0})}return new Te(e)}var Re=o.createContext({hashPriority:"low",cache:Me(),defaultCache:!0}),Le=function(e){var t,r,n,i,a=e.children,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Fe),l=o.useContext(Re),c=(t=function(){var e=be({},l);Object.keys(s).forEach(function(t){var r=s[t];void 0!==s[t]&&(e[t]=r)});var t=s.cache;return e.cache=e.cache||Me(),e.defaultCache=!t&&l.defaultCache,e},r=[l,s],n=function(e,t){return!ke(e[0],t[0],!0)||!ke(e[1],t[1],!0)},"value"in(i=o.useRef({})).current&&!n(i.current.condition,r)||(i.current.value=t(),i.current.condition=r),i.current.value);return o.createElement(Re.Provider,{value:c},a)},Ne=function(){function e(){Ee(this,e),ve(this,"cache",void 0),ve(this,"keys",void 0),ve(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Ie(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={map:this.cache};return e.forEach(function(e){var t;i=i?null===(t=i)||void 0===t||null===(t=t.map)||void 0===t?void 0:t.get(e):void 0}),null!==(t=i)&&void 0!==t&&t.value&&n&&(i.value[1]=this.cacheCallTimes++),null===(r=i)||void 0===r?void 0:r.value}},{key:"get",value:function(e){var t;return null===(t=this.internalGet(e,!0))||void 0===t?void 0:t[0]}},{key:"has",value:function(e){return!!this.internalGet(e)}},{key:"set",value:function(t,r){var n=this;if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var i=this.keys.reduce(function(e,t){var r=pe(e,2)[1];return n.internalGet(t)[1]<r?[t,n.internalGet(t)[1]]:e},[this.keys[0],this.cacheCallTimes]),o=pe(i,1)[0];this.delete(o)}this.keys.push(t)}var a=this.cache;t.forEach(function(e,i){if(i===t.length-1)a.set(e,{value:[r,n.cacheCallTimes++]});else{var o=a.get(e);o?o.map||(o.map=new Map):a.set(e,{map:new Map}),a=a.get(e).map}})}},{key:"deleteByPath",value:function(e,t){var r,n=e.get(t[0]);if(1===t.length)return n.map?e.set(t[0],{map:n.map}):e.delete(t[0]),null===(r=n.value)||void 0===r?void 0:r[0];var i=this.deleteByPath(n.map,t.slice(1));return n.map&&0!==n.map.size||n.value||e.delete(t[0]),i}},{key:"delete",value:function(e){if(this.has(e))return this.keys=this.keys.filter(function(t){return!function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(t,e)}),this.deleteByPath(this.cache,e)}}]),e}();function De(e,t,r){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4])return e;var n=be(be({},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),{},ve(ve({},"data-token-hash",t),Oe,r)),i=Object.keys(n).map(function(e){var t=n[e];return t?"".concat(e,'="').concat(t,'"'):null}).filter(function(e){return e}).join(" ");return"<style ".concat(i,">").concat(e,"</style>")}ve(Ne,"MAX_CACHE_SIZE",20),ve(Ne,"MAX_CACHE_OFFSET",5),new Ne,"undefined"!=typeof window&&window.document&&window.document.createElement?o.useLayoutEffect:o.useEffect,be({},n||(n=r.t(o,2))).useInsertionEffect,be({},n||(n=r.t(o,2))).useInsertionEffect;var ze="comm",Be="rule",Ue="decl",Ve=Math.abs,He=String.fromCharCode;function $e(e){return e.trim()}function We(e,t,r){return e.replace(t,r)}function Ge(e,t,r){return e.indexOf(t,r)}function qe(e,t){return 0|e.charCodeAt(t)}function Ye(e,t,r){return e.slice(t,r)}function Xe(e){return e.length}function Ke(e,t){return t.push(e),e}var Ze=1,Je=1,Qe=0,et=0,tt=0,rt="";function nt(e,t,r,n,i,o,a,s){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Ze,column:Je,length:a,return:"",siblings:s}}function it(){return tt=et>0?qe(rt,--et):0,Je--,10===tt&&(Je=1,Ze--),tt}function ot(){return tt=et<Qe?qe(rt,et++):0,Je++,10===tt&&(Je=1,Ze++),tt}function at(){return qe(rt,et)}function st(){return et}function lt(e,t){return Ye(rt,e,t)}function ct(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ut(e){return $e(lt(et-1,ft(91===e?e+2:40===e?e+1:e)))}function dt(e){for(;(tt=at())&&tt<33;)ot();return ct(e)>2||ct(tt)>3?"":" "}function ht(e,t){for(;--t&&ot()&&!(tt<48||tt>102||tt>57&&tt<65||tt>70&&tt<97););return lt(e,st()+(t<6&&32==at()&&32==ot()))}function ft(e){for(;ot();)switch(tt){case e:return et;case 34:case 39:34!==e&&39!==e&&ft(tt);break;case 40:41===e&&ft(e);break;case 92:ot()}return et}function pt(e,t){for(;ot()&&e+tt!==57&&(e+tt!==84||47!==at()););return"/*"+lt(t,et-1)+"*"+He(47===e?e:ot())}function gt(e){for(;!ct(at());)ot();return lt(e,et)}function mt(e){return function(e){return rt="",e}(vt("",null,null,null,[""],e=function(e){return Ze=Je=1,Qe=Xe(rt=e),et=0,[]}(e),0,[0],e))}function vt(e,t,r,n,i,o,a,s,l){for(var c=0,u=0,d=a,h=0,f=0,p=0,g=1,m=1,v=1,y=0,b="",w=i,x=o,C=n,_=b;m;)switch(p=y,y=ot()){case 40:if(108!=p&&58==qe(_,d-1)){-1!=Ge(_+=We(ut(y),"&","&\f"),"&\f",Ve(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:_+=ut(y);break;case 9:case 10:case 13:case 32:_+=dt(p);break;case 92:_+=ht(st()-1,7);continue;case 47:switch(at()){case 42:case 47:Ke(bt(pt(ot(),st()),t,r,l),l),5!=ct(p||1)&&5!=ct(at()||1)||!Xe(_)||" "===Ye(_,-1,void 0)||(_+=" ");break;default:_+="/"}break;case 123*g:s[c++]=Xe(_)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(_=We(_,/\f/g,"")),f>0&&(Xe(_)-d||0===g&&47===p)&&Ke(f>32?wt(_+";",n,r,d-1,l):wt(We(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(Ke(C=yt(_,t,r,c,u,i,s,b,w=[],x=[],d,o),o),123===y)if(0===u)vt(_,t,C,C,w,o,d,s,x);else{switch(h){case 99:if(110===qe(_,3))break;case 108:if(97===qe(_,2))break;default:u=0;case 100:case 109:case 115:}u?vt(e,C,C,n&&Ke(yt(e,C,C,0,0,i,s,b,i,w=[],d,x),x),i,x,d,s,n?w:x):vt(_,C,C,C,[""],x,0,s,x)}}c=u=f=0,g=v=1,b=_="",d=a;break;case 58:d=1+Xe(_),f=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==it())continue;switch(_+=He(y),y*g){case 38:v=u>0?1:(_+="\f",-1);break;case 44:s[c++]=(Xe(_)-1)*v,v=1;break;case 64:45===at()&&(_+=ut(ot())),h=at(),u=d=Xe(b=_+=gt(st())),y++;break;case 45:45===p&&2==Xe(_)&&(g=0)}}return o}function yt(e,t,r,n,i,o,a,s,l,c,u,d){for(var h=i-1,f=0===i?o:[""],p=function(e){return e.length}(f),g=0,m=0,v=0;g<n;++g)for(var y=0,b=Ye(e,h+1,h=Ve(m=a[g])),w=e;y<p;++y)(w=$e(m>0?f[y]+" "+b:We(b,/&\f/g,f[y])))&&(l[v++]=w);return nt(e,t,r,0===i?Be:s,l,c,u,d)}function bt(e,t,r,n){return nt(e,t,r,ze,He(tt),Ye(e,2,-2),0,n)}function wt(e,t,r,n,i){return nt(e,t,r,Ue,Ye(e,0,n),Ye(e,n+1,-1),n,i)}function xt(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function Ct(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case Ue:return e.return=e.return||e.value;case ze:return"";case"@keyframes":return e.return=e.value+"{"+xt(e.children,n)+"}";case Be:if(!Xe(e.value=e.props.join(",")))return""}return Xe(r=xt(e.children,n))?e.return=e.value+"{"+r+"}":""}function _t(e){return e.notSplit=!0,e}ve(ve(ve({},"style",function(e,t,r){var n=pe(e,6),i=n[0],o=n[1],a=n[2],s=n[3],l=n[4],c=n[5],u=(r||{}).plain;if(l)return null;var d=i,h={"data-rc-order":"prependQueue","data-rc-priority":"".concat(c)};return d=De(i,o,a,h,u),s&&Object.keys(s).forEach(function(e){if(!t[e]){t[e]=!0;var r=function(e){return xt(mt(e),Ct).replace(/\{%%%\:[^;];}/g,";")}(s[e]),n=De(r,o,"_effect-".concat(e),h,u);e.startsWith("@layer")?d=n+d:d+=n}}),[c,a,d]}),"token",function(e,t,r){var n=pe(e,5),i=n[2],o=n[3],a=n[4],s=(r||{}).plain;if(!o)return null;var l=i._tokenKey;return[-999,l,De(o,a,l,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]}),"cssVar",function(e,t,r){var n=pe(e,4),i=n[1],o=n[2],a=n[3],s=(r||{}).plain;return i?[-999,o,De(i,a,o,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]:null}),_t(["borderTop","borderBottom"]),_t(["borderTop"]),_t(["borderBottom"]),_t(["borderLeft","borderRight"]),_t(["borderLeft"]),_t(["borderRight"]);const St={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function At(e,t){return t}function kt(e,t){return e.filter(e=>void 0!==e)}var Et,It;function jt(e){return"object"!=typeof e||null===e?0:Array.isArray(e)?2:function(e){if(!Ot.includes(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(void 0===t)return!0;const r=t.prototype;return!(null===r||"object"!=typeof r||!Ot.includes(Object.prototype.toString.call(r)))&&!!r.hasOwnProperty("isPrototypeOf")}(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Tt(e,t){return"object"==typeof e&&Object.prototype.propertyIsEnumerable.call(e,t)}function Ft(e){let t=0,r=e[0]?.[Symbol.iterator]();return{[Symbol.iterator]:()=>({next(){for(;;){if(void 0===r)return{done:!0,value:void 0};const n=r.next();if(!0!==n.done)return{done:!1,value:n.value};t+=1,r=e[t]?.[Symbol.iterator]()}}})}}(It=Et||(Et={}))[It.NOT=0]="NOT",It[It.RECORD=1]="RECORD",It[It.ARRAY=2]="ARRAY",It[It.SET=3]="SET",It[It.MAP=4]="MAP",It[It.OTHER=5]="OTHER";const Ot=["[object Object]","[object Module]"],Pt={mergeRecords:function(e,t,r){const n={};for(const i of function(e){const t=new Set;for(const r of e)for(const e of[...Object.keys(r),...Object.getOwnPropertySymbols(r)])t.add(e);return t}(e)){const o=[];for(const t of e)Tt(t,i)&&o.push(t[i]);if(0===o.length)continue;const a=t.metaDataUpdater(r,{key:i,parents:e}),s=Mt(o,t,a);s!==St.skip&&("__proto__"===i?Object.defineProperty(n,i,{value:s,configurable:!0,enumerable:!0,writable:!0}):n[i]=s)}return n},mergeArrays:function(e){return e.flat()},mergeSets:function(e){return new Set(Ft(e))},mergeMaps:function(e){return new Map(Ft(e))},mergeOthers:function(e){return e.at(-1)}};function Mt(e,t,r){const n=t.filterValues?.(e,r)??e;if(0===n.length)return;if(1===n.length)return Rt(n,t,r);const i=jt(n[0]);if(0!==i&&5!==i)for(let o=1;o<n.length;o++)if(jt(n[o])!==i)return Rt(n,t,r);switch(i){case 1:return function(e,t,r){const n=t.mergeFunctions.mergeRecords(e,t,r);return n===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,r):n}(n,t,r);case 2:return function(e,t,r){const n=t.mergeFunctions.mergeArrays(e,t,r);return n===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):n}(n,t,r);case 3:return function(e,t,r){const n=t.mergeFunctions.mergeSets(e,t,r);return n===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):n}(n,t,r);case 4:return function(e,t,r){const n=t.mergeFunctions.mergeMaps(e,t,r);return n===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):n}(n,t,r);default:return Rt(n,t,r)}}function Rt(e,t,r){const n=t.mergeFunctions.mergeOthers(e,t,r);return n===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):n}const Lt="my_files",Nt="gif",Dt="stock_images",zt="icons",Bt="ai",Ut="editor",Vt="Trash",Ht="light",$t="dark",Wt="system",Gt="(prefers-color-scheme: dark)",qt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",Yt=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif"],Xt=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif","gif"],Kt="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==",Zt={keywords:"",color:"",orientation:""};s.A.setDefaultIndicator((0,i.jsx)(()=>(0,i.jsx)(H.A,{style:{fontSize:48,height:"100%"},spin:!0}),{}));const Jt={hashed:!1,algorithm:l.A.defaultAlgorithm,token:{colorLink:"#1677ff",colorInfo:"#722ed1",colorTextBase:"#000000",colorBgLayout:"#f0f2f5",borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,colorDarken1:"rgba(0, 0, 0, 0.08)",colorFillSecondaryDarken:"rgba(0, 0, 0, 0.1)",formControlHeight:34,borderWidth:1,borderColorHover:"#C5C5C5",formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:"63.92%",colorSecondaryL:"50%",colorSecondaryBgH:273,colorSecondaryBgS:"100%",colorSecondaryBgL:"93%",appZoom:1},components:{Progress:{colorFillSecondary:"#ffffff"},Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},Qt={hashed:!1,algorithm:l.A.darkAlgorithm,token:{colorBgBase:"#1F1F1F",colorInfo:"#9254de",colorLink:"#1890ff",colorLinkHover:"#69c0ff",wireframe:!1,borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,borderWidth:1,colorDarken1:"rgba(0, 0, 0, 0.9)",colorFillSecondaryDarken:"rgba(255, 255, 255, 0.16)",formControlHeight:34,borderColorHover:"rgba(255, 255, 255, 0.3)",formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},components:{Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},er=({externalTheme:e=Ht,children:t,customThemeToken:r})=>{const n=matchMedia(Gt).matches?$t:Ht,a=e===Wt?n:e,[s,l]=(0,o.useState)(a),[d,h]=(0,o.useState)("light"===s?Jt:Qt);return(0,o.useEffect)(()=>{l(a)},[a]),(0,o.useEffect)(()=>{const e="light"===s?Jt:Qt,t=r?function(...e){return function(){const e=function(e,t){return{defaultMergeFunctions:Pt,mergeFunctions:{...Pt,...Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(Pt,e)).map(([e,t])=>!1===t?[e,Pt.mergeOthers]:[e,t]))},metaDataUpdater:e.metaDataUpdater??At,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:!1===e.filterValues?void 0:e.filterValues??kt,actions:St}}({},t);function t(...t){return Mt(t,e,void 0)}return t}()(...e)}(e.token,r):e.token;h(Object.assign(Object.assign({},e),{token:t}))},[h,s,r]),(0,i.jsx)("div",{id:"file-manager-element-id",style:{height:"100%"},children:(0,i.jsx)(c.Ay,{theme:d,children:(0,i.jsx)(Le,{transformers:[],children:(0,i.jsx)(u.A,{style:{height:"100%"},children:t})})})})};let tr=!1;const rr=()=>{if(tr)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,r,n,i,o)=>!("string"!=typeof t||!t.includes("ResizeObserver loop completed with undelivered notifications"))||!!e&&e(t,r,n,i,o),window.addEventListener("unhandledrejection",e=>{var t,r;(null===(r=null===(t=e.reason)||void 0===t?void 0:t.message)||void 0===r?void 0:r.includes("ResizeObserver loop completed with undelivered notifications"))&&e.preventDefault()});const t=console.error;if(console.error=(...e)=>{var r;((null===(r=e[0])||void 0===r?void 0:r.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]){window.__webpack_require__}})}catch(e){}};e(),setTimeout(e,1e3)}tr=!0},nr=e=>{if(!e)return"image/png";const t=e.toLowerCase();return t.includes("jpeg")||t.includes("jpg")||t.includes("pjpeg")?"image/jpeg":t.includes("png")?"image/png":t.includes("gif")?"image/gif":t.includes("webp")?"image/webp":t.includes("svg")?"image/svg+xml":"image/png"},ir=e=>{if(!e.startsWith("data:"))return null;const t=e.match(/^data:([^;,]+)/);return t?t[1]:null},or=(e,t="image/png")=>{let r=t;if(e.startsWith("data:")){const t=ir(e);t&&t.startsWith("image/")&&(r=t)}return nr(r)},ar=e=>{const t=nr(e).split("/")[1];return"svg+xml"===t?"svg":t||"png"},sr=/^data:(.+?);base64,(.+)$/i,lr=(e,t)=>{const r=(e=>{const t=(e=>{if("function"!=typeof globalThis.atob)throw new Error("Base64 decoding is not supported in the current environment.");return globalThis.atob(e)})(e),r=t.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=t.charCodeAt(i);return n})(e.replace(/\s/g,"")),n=new ArrayBuffer(r.length);return new Uint8Array(n).set(r),new Blob([n],{type:t})},cr=(e,t="application/octet-stream")=>{if(e instanceof Blob)return e;if("string"==typeof e){const r=e.trim(),n=r.match(sr);if(n){const[,e,t]=n;return lr(t,e)}return lr(r,t)}throw new Error("Unsupported data type. Expected Blob or base64 string.")};var ur="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof r.g?r.g:"undefined"!=typeof self?self:{};const dr={},hr=(e,t,r,n)=>{mr(r)&&dr[r]||(mr(r)&&(dr[r]=new Date),((e,t,r,n)=>{const i=[r,{code:t,...n||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);mr(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console})(e,t,r,n))},fr=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},pr=(e,t,r)=>{e.loadNamespaces(t,fr(e,r))},gr=(e,t,r,n)=>{if(mr(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return pr(e,r,n);r.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,fr(e,n))},mr=e=>"string"==typeof e,vr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,yr={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xa9","©":"\xa9","®":"\xae","®":"\xae","…":"\u2026","…":"\u2026","/":"/","/":"/"},br=e=>yr[e];let wr,xr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(vr,br)};const Cr={type:"3rdParty",init(e){((e={})=>{xr={...xr,...e}})(e.options.react),(e=>{wr=e})(e)}},_r=(0,o.createContext)();class Sr{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Ar=(e,t,r,n)=>e.getFixedT(t,r,n),kr=(e,t={})=>{const{i18n:r}=t,{i18n:n,defaultNS:i}=(0,o.useContext)(_r)||{},a=r||n||wr;if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Sr),!a){hr(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return mr(t)?t:"object"==typeof(r=t)&&null!==r&&mr(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var r},t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}a.options.react?.wait&&hr(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...xr,...a.options.react,...t},{useSuspense:l,keyPrefix:c}=s;let u=i||a.options?.defaultNS;u=mr(u)?[u]:u||["translation"],a.reportNamespaces.addUsedNamespaces?.(u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(e=>((e,t,r={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:r.lng,precheck:(t,n)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):(hr(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,a,s)),h=((e,t,r,n)=>(0,o.useCallback)(Ar(e,t,r,n),[e,t,r,n]))(a,t.lng||null,"fallback"===s.nsMode?u:u[0],c),f=()=>h,p=()=>Ar(a,t.lng||null,"fallback"===s.nsMode?u:u[0],c),[g,m]=(0,o.useState)(f);let v=u.join();t.lng&&(v=`${t.lng}${v}`);const y=(e=>{const t=(0,o.useRef)();return(0,o.useEffect)(()=>{t.current=e},[e,void 0]),t.current})(v),b=(0,o.useRef)(!0);(0,o.useEffect)(()=>{const{bindI18n:e,bindI18nStore:r}=s;b.current=!0,d||l||(t.lng?gr(a,t.lng,u,()=>{b.current&&m(p)}):pr(a,u,()=>{b.current&&m(p)})),d&&y&&y!==v&&b.current&&m(p);const n=()=>{b.current&&m(p)};return e&&a?.on(e,n),r&&a?.store.on(r,n),()=>{b.current=!1,a&&e&&e?.split(" ").forEach(e=>a.off(e,n)),r&&a&&r.split(" ").forEach(e=>a.store.off(e,n))}},[a,v]),(0,o.useEffect)(()=>{b.current&&d&&m(f)},[a,c,d]);const w=[g,a,d];if(w.t=g,w.i18n=a,w.ready=d,d)return w;if(!d&&!l)return w;throw new Promise(e=>{t.lng?gr(a,t.lng,u,()=>e()):pr(a,u,()=>e())})};function Er({i18n:e,defaultNS:t,children:r}){const n=(0,o.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,o.createElement)(_r.Provider,{value:n},r)}const Ir=e=>"string"==typeof e,jr=()=>{let e,t;const r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},Tr=e=>null==e?"":""+e,Fr=/###/g,Or=e=>e&&e.indexOf("###")>-1?e.replace(Fr,"."):e,Pr=e=>!e||Ir(e),Mr=(e,t,r)=>{const n=Ir(t)?t.split("."):t;let i=0;for(;i<n.length-1;){if(Pr(e))return{};const t=Or(n[i]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Pr(e)?{}:{obj:e,k:Or(n[i])}},Rr=(e,t,r)=>{const{obj:n,k:i}=Mr(e,t,Object);if(void 0!==n||1===t.length)return void(n[i]=r);let o=t[t.length-1],a=t.slice(0,t.length-1),s=Mr(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=Mr(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=r},Lr=(e,t)=>{const{obj:r,k:n}=Mr(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Nr=(e,t,r)=>{for(const n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?Ir(e[n])||e[n]instanceof String||Ir(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):Nr(e[n],t[n],r):e[n]=t[n]);return e},Dr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var zr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Br=e=>Ir(e)?e.replace(/[&<>"'\/]/g,e=>zr[e]):e,Ur=[" ",",","?","!",";"],Vr=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20),Hr=(e,t,r=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const n=t.split(r);let i=e;for(let o=0;o<n.length;){if(!i||"object"!=typeof i)return;let e,t="";for(let a=o;a<n.length;++a)if(a!==o&&(t+=r),t+=n[a],e=i[t],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&a<n.length-1)continue;o+=a-o+1;break}i=e}return i},$r=e=>e?.replace("_","-"),Wr={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){}};class Gr{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Wr,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,r,n){return n&&!this.debug?null:(Ir(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Gr(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Gr(this.logger,e)}}var qr=new Gr;class Yr{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const r=this.observers[e].get(t)||0;this.observers[e].set(t,r+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,r])=>{for(let n=0;n<r;n++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let i=0;i<n;i++)r.apply(r,[e,...t])})}}class Xr extends Yr{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r,n={}){const i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],r&&(Array.isArray(r)?a.push(...r):Ir(r)&&i?a.push(...r.split(i)):a.push(r)));const s=Lr(this.data,a);return!s&&!t&&!r&&e.indexOf(".")>-1&&(e=a[0],t=a[1],r=a.slice(2).join(".")),!s&&o&&Ir(r)?Hr(this.data?.[e]?.[t],r,i):s}addResource(e,t,r,n,i={silent:!1}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),Rr(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(const i in r)(Ir(r[i])||Array.isArray(r[i]))&&this.addResource(e,t,i,r[i],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=r,r=t,t=a[1]),this.addNamespaces(t);let s=Lr(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?Nr(s,r,i):s={...s,...r},Rr(this.data,a,s),o.silent||this.emit("added",e,t,r)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Kr={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(e=>{t=this.processors[e]?.process(t,r,n,i)??t}),t}};const Zr=Symbol("i18next/PATH_KEY");function Jr(e,t){const{[Zr]:r}=e(function(){const e=[],t=Object.create(null);let r;return t.get=(n,i)=>(r?.revoke?.(),i===Zr?e:(e.push(i),r=Proxy.revocable(n,t),r.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return r.join(t?.keySeparator??".")}const Qr={},en=e=>!Ir(e)&&"boolean"!=typeof e&&"number"!=typeof e;class tn extends Yr{constructor(e,t={}){super(),((e,t,r)=>{["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{t[e]&&(r[e]=t[e])})})(0,e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=qr.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const r={...t};if(null==e)return!1;const n=this.resolve(e,r);return void 0!==n?.res}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");const n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,r)=>{t=t||"",r=r||"";const n=Ur.filter(e=>t.indexOf(e)<0&&r.indexOf(e)<0);if(0===n.length)return!0;const i=Vr.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(r);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,r,n));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Ir(i)?[i]:i};const o=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(n)}return{key:e,namespaces:Ir(i)?[i]:i}}translate(e,t,r){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=Jr(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);const i=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1];let c=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return d?i?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${c}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a;const h=this.resolve(e,n);let f=h?.res;const p=h?.usedKey||a,g=h?.exactUsedKey||a,m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=void 0!==n.count&&!Ir(n.count),b=tn.hasDefaultValue(n),w=y?this.pluralResolver.getSuffix(u,n.count,n):"",x=n.ordinal&&y?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",C=y&&!n.ordinal&&0===n.count,_=C&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${w}`]||n[`defaultValue${x}`]||n.defaultValue;let S=f;v&&!f&&b&&(S=_);const A=en(S),k=Object.prototype.toString.apply(S);if(!(v&&S&&A&&["[object Number]","[object Function]","[object RegExp]"].indexOf(k)<0)||Ir(m)&&Array.isArray(S))if(v&&Ir(m)&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,e,n,r));else{let t=!1,i=!1;!this.isValidLookup(f)&&b&&(t=!0,f=_),this.isValidLookup(f)||(i=!0,f=a);const s=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:f,d=b&&_!==f&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,a,d?_:f),o){const e=this.resolve(a,{...n,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);const r=(e,t,r)=>{const i=b&&r!==f?r:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,n),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,n);C&&n[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],a+t,n[`defaultValue${t}`]||_)})}):r(e,a,_))}f=this.extendTranslation(f,e,n,h,r),i&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}${c}${a}`),(i||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,t?f:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,S,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=e,h.usedParams=this.getUsedParamsDetails(n),h):e}if(o){const e=Array.isArray(S),t=e?[]:{},r=e?g:p;for(const i in S)if(Object.prototype.hasOwnProperty.call(S,i)){const e=`${r}${o}${i}`;t[i]=b&&!f?this.translate(e,{...n,defaultValue:en(_)?_[i]:void 0,joinArrays:!1,ns:s}):this.translate(e,{...n,joinArrays:!1,ns:s}),t[i]===e&&(t[i]=S[i])}f=t}}return i?(h.res=f,h.usedParams=this.getUsedParamsDetails(n),h):f}extendTranslation(e,t,r,n,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const o=Ir(e)&&(void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=r.replace&&!Ir(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,r.lng||this.language||n.usedLng,r),o){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||r.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,a=Ir(o)?[o]:o;return null!=e&&a?.length&&!1!==r.applyPostProcessor&&(e=Kr.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,n,i,o,a;return Ir(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(r))return;const s=this.extractFromKey(e,t),l=s.key;n=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!Ir(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Ir(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(r)||(a=e,Qr[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(Qr[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(n=>{if(this.isValidLookup(r))return;o=n;const a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,n,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(n,t.count,t));const r=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(i)&&a.push(l+e.replace(i,this.options.pluralSeparator)),a.push(l+e),d&&a.push(l+r)),h){const n=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(n),u&&(t.ordinal&&0===e.indexOf(i)&&a.push(n+e.replace(i,this.options.pluralSeparator)),a.push(n+e),d&&a.push(n+r))}}let s;for(;s=a.pop();)this.isValidLookup(r)||(i=s,r=this.getResource(n,e,s,t))}))})}),{res:r,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!Ir(e.replace);let n=r?e.replace:e;if(r&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!r){n={...n};for(const e of t)delete n[e]}return n}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class rn{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qr.create("languageUtils")}getScriptPartFromCode(e){if(!(e=$r(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=$r(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Ir(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const r=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(r)||(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const r=this.getScriptPartFromCode(e);if(this.isSupportedCode(r))return t=r;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Ir(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){const r=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),n=[],i=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Ir(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):Ir(e)&&i(this.formatLanguageCode(e)),r.forEach(e=>{n.indexOf(e)<0&&i(this.formatLanguageCode(e))}),n}}const nn={zero:0,one:1,two:2,few:3,many:4,other:5},on={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class an{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=qr.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const r=$r("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:n});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:n})}catch(r){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),on;if(!e.match(/-|_/))return on;const n=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(n,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,r={}){return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?r.resolvedOptions().pluralCategories.sort((e,t)=>nn[e]-nn[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,r={}){const n=this.getRule(e,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}const sn=(e,t,r,n=".",i=!0)=>{let o=((e,t,r)=>{const n=Lr(e,r);return void 0!==n?n:Lr(t,r)})(e,t,r);return!o&&i&&Ir(r)&&(o=Hr(e,r,n),void 0===o&&(o=Hr(t,r,n))),o},ln=e=>e.replace(/\$/g,"$$$$");class cn{constructor(e={}){this.logger=qr.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:r,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:Br,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?Dr(i):o||"{{",this.suffix=a?Dr(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Dr(d):h||Dr("$t("),this.nestingSuffix=f?Dr(f):p||Dr(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,r,n){let i,o,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=sn(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,r,{...n,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(sn(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,r,{...n,...t,interpolationkey:o})};this.resetRegExp();const c=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>ln(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?ln(this.escape(e)):ln(e)}].forEach(t=>{for(a=0;i=t.regex.exec(e);){const r=i[1].trim();if(o=l(r),void 0===o)if("function"==typeof c){const t=c(e,i,n);o=Ir(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))o="";else{if(u){o=i[0];continue}this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),o=""}else Ir(o)||this.useRawValueToEscape||(o=Tr(o));const s=t.safeValue(o);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,r={}){let n,i,o;const a=(e,t)=>{const r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;const n=e.split(new RegExp(`${r}[ ]*{`));let i=`{${n[1]}`;e=n[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);((a?.length??0)%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];o={...r},o=o.replace&&!Ir(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const l=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==l&&(s=n[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,l)),i=t(a.call(this,n[1].trim(),o),o),i&&n[0]===e&&!Ir(i))return i;Ir(i)||(i=Tr(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}const un=e=>{const t={};return(r,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=n+JSON.stringify(o);let s=t[a];return s||(s=e($r(n),i),t[a]=s),s(r)}},dn=e=>(t,r,n)=>e($r(r),n)(t);class hn{constructor(e={}){this.logger=qr.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const r=t.cacheInBuiltFormats?un:dn;this.formats={number:r((e,t)=>{const r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)}),currency:r((e,t)=>{const r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)}),datetime:r((e,t)=>{const r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)}),relativetime:r((e,t)=>{const r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")}),list:r((e,t)=>{const r=new Intl.ListFormat(e,{...t});return e=>r.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=un(t)}format(e,t,r,n={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(e=>e.indexOf(")")>-1)){const e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}const o=i.reduce((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);"currency"===t&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(e=>{if(e){const[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();r[o]||(r[o]=i),"false"===i&&(r[o]=!1),"true"===i&&(r[o]=!0),isNaN(i)||(r[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:r}})(t);if(this.formats[i]){let t=e;try{const a=n?.formatParams?.[n.interpolationkey]||{},s=a.locale||a.lng||n.locale||n.lng||r;t=this.formats[i](e,s,{...o,...n,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e);return o}}class fn extends Yr{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=qr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n)}queueLoad(e,t,r,n){const i={},o={},a={},s={};return e.forEach(e=>{let n=!0;t.forEach(t=>{const a=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,n=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),n||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,r){const n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);const a={};this.queue.forEach(r=>{((e,t,r)=>{const{obj:n,k:i}=Mr(e,t,Object);n[i]=n[i]||[],n[i].push(r)})(r.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{a[e]||(a[e]={});const t=r.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:i,callback:o});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&n<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,r,n+1,2*i,o)},i):o(a,s)},s=this.backend[r].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const r=s(e,t);r&&"function"==typeof r.then?r.then(e=>a(null,e)).catch(a):a(null,r)}catch(e){a(e)}}prepareLoading(e,t,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();Ir(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ir(t)&&(t=[t]);const i=this.queueLoad(e,t,r,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e,t=""){const r=e.split("|"),n=r[0],i=r[1];this.read(n,i,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,r),!r&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,r,o)})}saveMissing(e,t,r,n,i,o={},a=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=r&&""!==r){if(this.backend?.create){const s={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,r,n,s):l(e,t,r,n),i&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,r,n,a,s)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}else this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const pn=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Ir(e[1])&&(t.defaultValue=e[1]),Ir(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),gn=e=>(Ir(e.ns)&&(e.ns=[e.ns]),Ir(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ir(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),mn=()=>{};class vn extends Yr{constructor(e={},t){var r;if(super(),this.options=gn(e),this.services={},this.logger=qr,this.modules={external:[]},r=this,Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(e=>{"function"==typeof r[e]&&(r[e]=r[e].bind(r))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Ir(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=pn();this.options={...r,...this.options,...gn(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?qr.init(n(this.modules.logger),this.options):qr.init(null,this.options),e=this.modules.formatter?this.modules.formatter:hn;const t=new rn(this.options);this.store=new Xr(this.options.resources,this.options);const i=this.services;i.logger=qr,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new an(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=n(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new cn(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new fn(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new tn(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=mn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=jr(),o=()=>{const e=(e,r)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(r),t(e,r)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),i}loadResources(e,t=mn){let r=t;const n=Ir(e)?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return r();const e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};n?t(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),r(e)})}else r(null)}reloadResources(e,t,r){const n=jr();return"function"==typeof e&&(r=e,e=void 0),"function"==typeof t&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=mn),this.services.backendConnector.reload(e,t,e=>{n.resolve(),r(e)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Kr.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const r=jr();this.emit("languageChanging",e);const n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(n(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,r.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const r=Ir(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(Ir(t)?[t]:t);o&&(this.language||n(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{i(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}getFixedT(e,t,r){const n=(e,t,...i)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},o.lng=o.lng||n.lng,o.lngs=o.lngs||n.lngs,o.ns=o.ns||n.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||r||n.keyPrefix);const a=this.options.keySeparator||".";let s;return o.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=Jr(e,{...this.options,...t})),`${o.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=Jr(e,{...this.options,...t})),s=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(s,o)};return Ir(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=r,n}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;const o=(e,t)=>{const r=this.services.backendConnector.state[`${e}|${t}`];return-1===r||0===r||2===r};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!!this.hasResourceBundle(r,e)||!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(r,e)||n&&!o(i,e))}loadNamespaces(e,t){const r=jr();return this.options.ns?(Ir(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){const r=jr();Ir(e)&&(e=[e]);const n=this.options.preload||[],i=e.filter(e=>n.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=n.concat(i),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new rn(pn());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new vn(e,t)}cloneInstance(e={},t=mn){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new vn(n);if(void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((r,n)=>(r[n]={...e[t][n]},r),e[t]),e),{});i.store=new Xr(e,n),i.services.resourceStore=i.store}return i.translator=new tn(i.services,n),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const yn=vn.createInstance();yn.createInstance=vn.createInstance,yn.createInstance,yn.dir,yn.init,yn.loadResources,yn.reloadResources,yn.use,yn.changeLanguage,yn.getFixedT,yn.t,yn.exists,yn.setDefaultNamespace,yn.hasLoadedNamespace,yn.loadNamespaces,yn.loadLanguages;var bn,wn,xn,Cn,_n,Sn={};!function(){if(_n)return Sn;_n=1;var e=function(){if(Cn)return xn;function e(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}Cn=1;var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(function(){if(wn)return bn;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function n(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,o(e,t,"get"))}function i(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,o(e,t,"set"),r),r}function o(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function a(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}wn=1;var s=function(t){if(!t)return[];Array.isArray(t)||(t=[t]);for(var r={},n=0;n<t.length;++n){var i,o=t[n];if(o&&"object"===e(o)&&(o=String(o)),"string"!=typeof o){var a="Locales should be strings, ".concat(JSON.stringify(o)," isn't.");throw new TypeError(a)}var s=o.split("-");if(!s.every(function(e){return/[a-z0-9]+/i.test(e)})){var l=JSON.stringify(o),c="The locale ".concat(l," is not a structurally valid BCP 47 language tag.");throw new RangeError(c)}var u=s[0].toLowerCase();s[0]=null!==(i={in:"id",iw:"he",ji:"yi"}[u])&&void 0!==i?i:u,r[s.join("-")]=!0}return Object.keys(r)};function l(t){switch(e(t)){case"number":return t;case"bigint":throw new TypeError("Cannot convert a BigInt value to a number");default:return Number(t)}}return bn=function(e,r,o,c){var u=function(e){do{if(r(e))return e;e=e.replace(/-?[^-]*$/,"")}while(e);return null},d=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,m=function(){function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),a(this,d,{writable:!0,value:void 0}),a(this,h,{writable:!0,value:void 0}),a(this,f,{writable:!0,value:void 0}),a(this,p,{writable:!0,value:void 0}),a(this,g,{writable:!0,value:void 0}),i(this,d,function(t){for(var r=s(t),n=0;n<r.length;++n){var i=u(r[n]);if(i)return i}var o=(new e).resolvedOptions().locale;return u(o)}(t)),i(this,f,r(n(this,d))),i(this,h,c(n(this,d))),i(this,p,function(e){var t=Object.prototype.hasOwnProperty.call(e,"type")&&e.type;if(!t)return"cardinal";if("cardinal"===t||"ordinal"===t)return t;throw new RangeError("Not a valid plural type: "+JSON.stringify(t))}(o)),i(this,g,new e("en",o))}var v,y,b;return v=m,b=[{key:"supportedLocalesOf",value:function(e){return s(e).filter(u)}}],(y=[{key:"resolvedOptions",value:function(){var e=n(this,g).resolvedOptions(),t=e.minimumIntegerDigits,r=e.minimumFractionDigits,i=e.maximumFractionDigits,a=e.minimumSignificantDigits,s=e.maximumSignificantDigits,l=e.roundingPriority,c={locale:n(this,d),type:n(this,p),minimumIntegerDigits:t,minimumFractionDigits:r,maximumFractionDigits:i};return"number"==typeof a&&(c.minimumSignificantDigits=a,c.maximumSignificantDigits=s),c.pluralCategories=o(n(this,d),"ordinal"===n(this,p)).slice(0),c.roundingPriority=l||"auto",c}},{key:"select",value:function(e){if(!(this instanceof m))throw new TypeError("select() called on incompatible ".concat(this));if("number"!=typeof e&&(e=Number(e)),!isFinite(e))return"other";var t=n(this,g).format(Math.abs(e));return n(this,f).call(this,t,"ordinal"===n(this,p))}},{key:"selectRange",value:function(e,t){if(!(this instanceof m))throw new TypeError("selectRange() called on incompatible ".concat(this));if(void 0===e)throw new TypeError("start is undefined");if(void 0===t)throw new TypeError("end is undefined");var r=l(e),i=l(t);if(!isFinite(r))throw new RangeError("start must be finite");if(!isFinite(i))throw new RangeError("end must be finite");return n(this,h).call(this,this.select(r),this.select(i))}}])&&t(v.prototype,y),b&&t(v,b),Object.defineProperty(v,"prototype",{writable:!1}),m}();return"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(m.prototype,Symbol.toStringTag,{value:"Intl.PluralRules",writable:!1,configurable:!0}),Object.defineProperty(m,"prototype",{writable:!1}),m},bn}());function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==ur||"undefined"!=typeof self&&self;var n={exports:{}};!function(e){var t=function(e,t){return t?"other":1==e?"one":"other"},r=function(e,t){return t?"other":0==e||1==e?"one":"other"},n=function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},i=function(e,t){var r=!String(e).split(".")[1];return t?"other":1==e&&r?"one":"other"},o=function(e,t){return"other"},a=function(e,t){return t?"other":1==e?"one":2==e?"two":"other"};!function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),e.exports=r}(0,{af:t,ak:r,am:n,an:t,ar:function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},ars:function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},as:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},asa:t,ast:i,az:function(e,t){var r=String(e).split(".")[0],n=r.slice(-1),i=r.slice(-2),o=r.slice(-3);return t?1==n||2==n||5==n||7==n||8==n||20==i||50==i||70==i||80==i?"one":3==n||4==n||100==o||200==o||300==o||400==o||500==o||600==o||700==o||800==o||900==o?"few":0==r||6==n||40==i||60==i||90==i?"many":"other":1==e?"one":"other"},bal:function(e,t){return 1==e?"one":"other"},be:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-1),o=n&&r[0].slice(-2);return t?2!=i&&3!=i||12==o||13==o?"other":"few":1==i&&11!=o?"one":i>=2&&i<=4&&(o<12||o>14)?"few":n&&0==i||i>=5&&i<=9||o>=11&&o<=14?"many":"other"},bem:t,bez:t,bg:t,bho:r,bm:o,bn:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},bo:o,br:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-1),o=n&&r[0].slice(-2),a=n&&r[0].slice(-6);return t?"other":1==i&&11!=o&&71!=o&&91!=o?"one":2==i&&12!=o&&72!=o&&92!=o?"two":(3==i||4==i||9==i)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=e&&n&&0==a?"many":"other"},brx:t,bs:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ca:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&i?"one":0!=n&&0==o&&i?"many":"other"},ce:t,ceb:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=i.slice(-1);return t?"other":o&&(1==n||2==n||3==n)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},cgg:t,chr:t,ckb:t,cs:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1];return t?"other":1==e&&i?"one":n>=2&&n<=4&&i?"few":i?"other":"many"},cy:function(e,t){return t?0==e||7==e||8==e||9==e?"zero":1==e?"one":2==e?"two":3==e||4==e?"few":5==e||6==e?"many":"other":0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e,t){var r=String(e).split("."),n=r[0],i=Number(r[0])==e;return t||1!=e&&(i||0!=n&&1!=n)?"other":"one"},de:i,doi:n,dsb:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-2),s=i.slice(-2);return t?"other":o&&1==a||1==s?"one":o&&2==a||2==s?"two":o&&(3==a||4==a)||3==s||4==s?"few":"other"},dv:t,dz:o,ee:t,el:t,en:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2);return t?1==o&&11!=a?"one":2==o&&12!=a?"two":3==o&&13!=a?"few":"other":1==e&&n?"one":"other"},eo:t,es:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?"other":1==e?"one":0!=n&&0==o&&i?"many":"other"},et:i,eu:t,fa:n,ff:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},fi:i,fil:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=i.slice(-1);return t?1==e?"one":"other":o&&(1==n||2==n||3==n)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},fo:t,fr:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?1==e?"one":"other":e>=0&&e<2?"one":0!=n&&0==o&&i?"many":"other"},fur:t,fy:i,ga:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"},gd:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?1==e||11==e?"one":2==e||12==e?"two":3==e||13==e?"few":"other":1==e||11==e?"one":2==e||12==e?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"},gl:i,gsw:t,gu:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},guw:r,gv:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-1),a=n.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":!i||0!=a&&20!=a&&40!=a&&60!=a&&80!=a?i?"other":"many":"few"},ha:t,haw:t,he:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1];return t?"other":1==n&&i||0==n&&!i?"one":2==n&&i?"two":"other"},hi:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},hnj:o,hr:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},hsb:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-2),s=i.slice(-2);return t?"other":o&&1==a||1==s?"one":o&&2==a||2==s?"two":o&&(3==a||4==a)||3==s||4==s?"few":"other"},hu:function(e,t){return t?1==e||5==e?"one":"other":1==e?"one":"other"},hy:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},ia:i,id:o,ig:o,ii:o,io:i,is:function(e,t){var r=String(e).split("."),n=r[0],i=(r[1]||"").replace(/0+$/,""),o=Number(r[0])==e,a=n.slice(-1),s=n.slice(-2);return t?"other":o&&1==a&&11!=s||i%10==1&&i%100!=11?"one":"other"},it:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":0!=n&&0==o&&i?"many":"other"},iu:a,ja:o,jbo:o,jgo:t,jmc:t,jv:o,jw:o,ka:function(e,t){var r=String(e).split(".")[0],n=r.slice(-2);return t?1==r?"one":0==r||n>=2&&n<=20||40==n||60==n||80==n?"many":"other":1==e?"one":"other"},kab:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},kaj:t,kcg:t,kde:o,kea:o,kk:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-1);return t?6==i||9==i||n&&0==i&&0!=e?"many":"other":1==e?"one":"other"},kkj:t,kl:t,km:o,kn:n,ko:o,ks:t,ksb:t,ksh:function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},ku:t,kw:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-2),o=n&&r[0].slice(-3),a=n&&r[0].slice(-5),s=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||i>=1&&i<=4||i>=21&&i<=24||i>=41&&i<=44||i>=61&&i<=64||i>=81&&i<=84?"one":5==e||5==i?"many":"other":0==e?"zero":1==e?"one":2==i||22==i||42==i||62==i||82==i||n&&0==o&&(a>=1e3&&a<=2e4||4e4==a||6e4==a||8e4==a)||0!=e&&1e5==s?"two":3==i||23==i||43==i||63==i||83==i?"few":1==e||1!=i&&21!=i&&41!=i&&61!=i&&81!=i?"other":"many"},ky:t,lag:function(e,t){var r=String(e).split(".")[0];return t?"other":0==e?"zero":0!=r&&1!=r||0==e?"other":"one"},lb:t,lg:t,lij:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e;return t?11==e||8==e||i&&e>=80&&e<=89||i&&e>=800&&e<=899?"many":"other":1==e&&n?"one":"other"},lkt:o,ln:r,lo:function(e,t){return t&&1==e?"one":"other"},lt:function(e,t){var r=String(e).split("."),n=r[1]||"",i=Number(r[0])==e,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2);return t?"other":1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=n?"many":"other"},lv:function(e,t){var r=String(e).split("."),n=r[1]||"",i=n.length,o=Number(r[0])==e,a=o&&r[0].slice(-1),s=o&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":o&&0==a||s>=11&&s<=19||2==i&&l>=11&&l<=19?"zero":1==a&&11!=s||2==i&&1==c&&11!=l||2!=i&&1==c?"one":"other"},mas:t,mg:r,mgo:t,mk:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":7!=a&&8!=a||17==s||18==s?"other":"many":o&&1==a&&11!=s||1==l&&11!=c?"one":"other"},ml:t,mn:t,mo:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e&&r[0].slice(-2);return t?1==e?"one":"other":1==e&&n?"one":!n||0==e||1!=e&&i>=1&&i<=19?"few":"other"},mr:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":"other":1==e?"one":"other"},ms:function(e,t){return t&&1==e?"one":"other"},mt:function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-2);return t?"other":1==e?"one":2==e?"two":0==e||n>=3&&n<=10?"few":n>=11&&n<=19?"many":"other"},my:o,nah:t,naq:a,nb:t,nd:t,ne:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?n&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},nl:i,nn:t,nnh:t,no:t,nqo:o,nr:t,nso:r,ny:t,nyn:t,om:t,or:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?1==e||5==e||n&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},os:t,osa:o,pa:r,pap:t,pcm:n,pl:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-1),a=n.slice(-2);return t?"other":1==e&&i?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&1!=n&&(0==o||1==o)||i&&o>=5&&o<=9||i&&a>=12&&a<=14?"many":"other"},prg:function(e,t){var r=String(e).split("."),n=r[1]||"",i=n.length,o=Number(r[0])==e,a=o&&r[0].slice(-1),s=o&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":o&&0==a||s>=11&&s<=19||2==i&&l>=11&&l<=19?"zero":1==a&&11!=s||2==i&&1==c&&11!=l||2!=i&&1==c?"one":"other"},ps:t,pt:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?"other":0==n||1==n?"one":0!=n&&0==o&&i?"many":"other"},pt_PT:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?"other":1==e&&i?"one":0!=n&&0==o&&i?"many":"other"},rm:t,ro:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e&&r[0].slice(-2);return t?1==e?"one":"other":1==e&&n?"one":!n||0==e||1!=e&&i>=1&&i<=19?"few":"other"},rof:t,ru:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-1),a=n.slice(-2);return t?"other":i&&1==o&&11!=a?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&0==o||i&&o>=5&&o<=9||i&&a>=11&&a<=14?"many":"other"},rwk:t,sah:o,saq:t,sat:a,sc:function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},scn:function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},sd:t,sdh:t,se:a,seh:t,ses:o,sg:o,sh:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},shi:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"},si:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"";return t?"other":0==e||1==e||0==n&&1==i?"one":"other"},sk:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1];return t?"other":1==e&&i?"one":n>=2&&n<=4&&i?"few":i?"other":"many"},sl:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":i&&(3==o||4==o)||!i?"few":"other"},sma:a,smi:a,smj:a,smn:a,sms:a,sn:t,so:t,sq:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-1),o=n&&r[0].slice(-2);return t?1==e?"one":4==i&&14!=o?"many":"other":1==e?"one":"other"},sr:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ss:t,ssy:t,st:t,su:o,sv:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2);return t?1!=o&&2!=o||11==a||12==a?"other":"one":1==e&&n?"one":"other"},sw:i,syr:t,ta:t,te:t,teo:t,th:o,ti:r,tig:t,tk:function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-1);return t?6==n||9==n||10==e?"few":"other":1==e?"one":"other"},tl:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=i.slice(-1);return t?1==e?"one":"other":o&&(1==n||2==n||3==n)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},tn:t,to:o,tpi:o,tr:t,ts:t,tzm:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":0==e||1==e||n&&e>=11&&e<=99?"one":"other"},ug:t,uk:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=Number(r[0])==e,a=o&&r[0].slice(-1),s=o&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?3==a&&13!=s?"few":"other":i&&1==l&&11!=c?"one":i&&l>=2&&l<=4&&(c<12||c>14)?"few":i&&0==l||i&&l>=5&&l<=9||i&&c>=11&&c<=14?"many":"other"},und:o,ur:i,uz:t,ve:t,vec:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":0!=n&&0==o&&i?"many":"other"},vi:function(e,t){return t&&1==e?"one":"other"},vo:t,vun:t,wa:r,wae:t,wo:o,xh:t,xog:t,yi:i,yo:o,yue:o,zh:o,zu:n})}(n);var i=r(n.exports),o=e({__proto__:null,default:i},[n.exports]),a={exports:{}};!function(e){var t="zero",r="one",n="two",i="few",o="many",a="other",s={cardinal:[r,a],ordinal:[a]},l={cardinal:[r,a],ordinal:[r,a]},c={cardinal:[a],ordinal:[a]},u={cardinal:[r,n,a],ordinal:[a]};!function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),e.exports=r}(0,{af:s,ak:s,am:s,an:s,ar:{cardinal:[t,r,n,i,o,a],ordinal:[a]},ars:{cardinal:[t,r,n,i,o,a],ordinal:[a]},as:{cardinal:[r,a],ordinal:[r,n,i,o,a]},asa:s,ast:s,az:{cardinal:[r,a],ordinal:[r,i,o,a]},bal:l,be:{cardinal:[r,i,o,a],ordinal:[i,a]},bem:s,bez:s,bg:s,bho:s,bm:c,bn:{cardinal:[r,a],ordinal:[r,n,i,o,a]},bo:c,br:{cardinal:[r,n,i,o,a],ordinal:[a]},brx:s,bs:{cardinal:[r,i,a],ordinal:[a]},ca:{cardinal:[r,o,a],ordinal:[r,n,i,a]},ce:s,ceb:s,cgg:s,chr:s,ckb:s,cs:{cardinal:[r,i,o,a],ordinal:[a]},cy:{cardinal:[t,r,n,i,o,a],ordinal:[t,r,n,i,o,a]},da:s,de:s,doi:s,dsb:{cardinal:[r,n,i,a],ordinal:[a]},dv:s,dz:c,ee:s,el:s,en:{cardinal:[r,a],ordinal:[r,n,i,a]},eo:s,es:{cardinal:[r,o,a],ordinal:[a]},et:s,eu:s,fa:s,ff:s,fi:s,fil:l,fo:s,fr:{cardinal:[r,o,a],ordinal:[r,a]},fur:s,fy:s,ga:{cardinal:[r,n,i,o,a],ordinal:[r,a]},gd:{cardinal:[r,n,i,a],ordinal:[r,n,i,a]},gl:s,gsw:s,gu:{cardinal:[r,a],ordinal:[r,n,i,o,a]},guw:s,gv:{cardinal:[r,n,i,o,a],ordinal:[a]},ha:s,haw:s,he:u,hi:{cardinal:[r,a],ordinal:[r,n,i,o,a]},hnj:c,hr:{cardinal:[r,i,a],ordinal:[a]},hsb:{cardinal:[r,n,i,a],ordinal:[a]},hu:l,hy:l,ia:s,id:c,ig:c,ii:c,io:s,is:s,it:{cardinal:[r,o,a],ordinal:[o,a]},iu:u,ja:c,jbo:c,jgo:s,jmc:s,jv:c,jw:c,ka:{cardinal:[r,a],ordinal:[r,o,a]},kab:s,kaj:s,kcg:s,kde:c,kea:c,kk:{cardinal:[r,a],ordinal:[o,a]},kkj:s,kl:s,km:c,kn:s,ko:c,ks:s,ksb:s,ksh:{cardinal:[t,r,a],ordinal:[a]},ku:s,kw:{cardinal:[t,r,n,i,o,a],ordinal:[r,o,a]},ky:s,lag:{cardinal:[t,r,a],ordinal:[a]},lb:s,lg:s,lij:{cardinal:[r,a],ordinal:[o,a]},lkt:c,ln:s,lo:{cardinal:[a],ordinal:[r,a]},lt:{cardinal:[r,i,o,a],ordinal:[a]},lv:{cardinal:[t,r,a],ordinal:[a]},mas:s,mg:s,mgo:s,mk:{cardinal:[r,a],ordinal:[r,n,o,a]},ml:s,mn:s,mo:{cardinal:[r,i,a],ordinal:[r,a]},mr:{cardinal:[r,a],ordinal:[r,n,i,a]},ms:{cardinal:[a],ordinal:[r,a]},mt:{cardinal:[r,n,i,o,a],ordinal:[a]},my:c,nah:s,naq:u,nb:s,nd:s,ne:l,nl:s,nn:s,nnh:s,no:s,nqo:c,nr:s,nso:s,ny:s,nyn:s,om:s,or:{cardinal:[r,a],ordinal:[r,n,i,o,a]},os:s,osa:c,pa:s,pap:s,pcm:s,pl:{cardinal:[r,i,o,a],ordinal:[a]},prg:{cardinal:[t,r,a],ordinal:[a]},ps:s,pt:{cardinal:[r,o,a],ordinal:[a]},pt_PT:{cardinal:[r,o,a],ordinal:[a]},rm:s,ro:{cardinal:[r,i,a],ordinal:[r,a]},rof:s,ru:{cardinal:[r,i,o,a],ordinal:[a]},rwk:s,sah:c,saq:s,sat:u,sc:{cardinal:[r,a],ordinal:[o,a]},scn:{cardinal:[r,a],ordinal:[o,a]},sd:s,sdh:s,se:u,seh:s,ses:c,sg:c,sh:{cardinal:[r,i,a],ordinal:[a]},shi:{cardinal:[r,i,a],ordinal:[a]},si:s,sk:{cardinal:[r,i,o,a],ordinal:[a]},sl:{cardinal:[r,n,i,a],ordinal:[a]},sma:u,smi:u,smj:u,smn:u,sms:u,sn:s,so:s,sq:{cardinal:[r,a],ordinal:[r,o,a]},sr:{cardinal:[r,i,a],ordinal:[a]},ss:s,ssy:s,st:s,su:c,sv:l,sw:s,syr:s,ta:s,te:s,teo:s,th:c,ti:s,tig:s,tk:{cardinal:[r,a],ordinal:[i,a]},tl:l,tn:s,to:c,tpi:c,tr:s,ts:s,tzm:s,ug:s,uk:{cardinal:[r,i,o,a],ordinal:[i,a]},und:c,ur:s,uz:s,ve:s,vec:{cardinal:[r,o,a],ordinal:[o,a]},vi:{cardinal:[a],ordinal:[r,a]},vo:s,vun:s,wa:s,wae:s,wo:c,xh:s,xog:s,yi:s,yo:c,yue:c,zh:c,zu:s})}(a);var s=r(a.exports),l=e({__proto__:null,default:s},[a.exports]),c={exports:{}};!function(e){var t,r=function(e,t){return"other"},n=function(e,t){return"other"===e&&"one"===t?"one":"other"},i=function(e,t){return t||"other"};t={af:r,ak:n,am:i,an:r,ar:function(e,t){return"few"===t?"few":"many"===t?"many":"zero"===e&&"one"===t||"zero"===e&&"two"===t?"zero":"other"},as:i,az:i,be:i,bg:r,bn:i,bs:i,ca:r,cs:i,cy:i,da:i,de:i,el:i,en:r,es:r,et:r,eu:r,fa:n,fi:r,fil:i,fr:i,ga:i,gl:i,gsw:i,gu:i,he:r,hi:i,hr:i,hu:i,hy:i,ia:r,id:r,io:r,is:i,it:i,ja:r,ka:function(e,t){return e||"other"},kk:i,km:r,kn:i,ko:r,ky:i,lij:i,lo:r,lt:i,lv:function(e,t){return"one"===t?"one":"other"},mk:r,ml:i,mn:i,mr:i,ms:r,my:r,nb:r,ne:i,nl:i,no:r,or:n,pa:i,pcm:r,pl:i,ps:i,pt:i,ro:function(e,t){return"few"===t||"one"===t?"few":"other"},ru:i,sc:i,scn:i,sd:n,si:function(e,t){return"one"===e&&"one"===t?"one":"other"},sk:i,sl:function(e,t){return"few"===t||"one"===t?"few":"two"===t?"two":"other"},sq:i,sr:i,sv:r,sw:i,ta:i,te:i,th:r,tk:i,tr:i,ug:i,uk:i,ur:r,uz:i,vi:r,yue:r,zh:r,zu:i},Object.defineProperty(t,"__esModule",{value:!0}),e.exports=t}(c);var u=r(c.exports),d=i||o,h=s||l,f=u||e({__proto__:null,default:u},[c.exports]),p=function(e){return"pt-PT"===e?"pt_PT":e},g=t.default(Intl.NumberFormat,function(e){return d[p(e)]},function(e,t){return h[p(e)][t?"ordinal":"cardinal"]},function(e){return f[p(e)]});return xn=g}();var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(e);if("undefined"==typeof Intl)void 0!==ur?ur.Intl={PluralRules:t.default}:"undefined"!=typeof window?window.Intl={PluralRules:t.default}:Sn.Intl={PluralRules:t.default},t.default.polyfill=!0;else if(Intl.PluralRules&&Intl.PluralRules.prototype.selectRange){var r=["en","es","ru","zh"];Intl.PluralRules.supportedLocalesOf(r).length<r.length&&(Intl.PluralRules=t.default,t.default.polyfill=!0)}else Intl.PluralRules=t.default,t.default.polyfill=!0}();var An={Files:"Arquivos",selected:"selecionado(s)",Deselected:"Desmarcar",Refresh:"Atualizar","Select all":"Selecionar tudo",Rename:"Renomear","Rename file":"Renomear arquivo {{currentFileName}}","Select the destination folder":"Selecionar a pasta de destino","Selected files:":"Arquivos selecionados:","Selected files":"Arquivos selecionados: {{count}}",selected_files_one:"{{count}} arquivo selecionado",selected_files_few:"{{count}} arquivos selecionados",selected_files_many:"{{count}} arquivos selecionados",selected_files_other:"{{count}} arquivos selecionados",Copy:"Duplicar",Edit:"Editar",Move:"Mover","Move to":"Mover para",Delete:"Excluir","New folder":"Nova pasta","Image search...":"Busca de imagens...","Search icons":"Encontrar \xedcones","By name":"Por nome","By size":"Por tamanho","By date":"Por data",List:"Lista",Grid:"Grade",Main:"Principal",Folders:"Pastas","total pages":"Total de {{total}} itens",Name:"Nome",Untitled:"Sem t\xedtulo",Size:"Tamanho",Dimensions:"Dimens\xf5es",Date:"Data",error:"erro",Folder:"Pasta",created:"criada","Failed to create folder":"Falha ao criar pasta","File deleted":"Arquivo exclu\xeddo","Error when deleting a file":"Erro ao excluir arquivo","Folder deleted":"Pasta exclu\xedda","Error when deleting a folder":"Erro ao excluir pasta","Delete folder":"Excluir pasta","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Tem certeza que deseja excluir esta pasta? Esta a\xe7\xe3o tamb\xe9m excluir\xe1 todos os arquivos e subpastas.","API-endpoint for file upload is not configured":"Endpoint da API para upload de arquivos n\xe3o est\xe1 configurado","Please select an image file":"Por favor, selecione um arquivo de imagem",File:"Arquivo","has been successfully uploaded":"foi carregado com sucesso","The URL must point to an image":"A URL deve apontar para uma imagem","Image upload...":"Carregando imagem...",Unknown:"Desconhecido","Error downloading file by URL":"Erro ao baixar arquivo por URL","successfully uploaded":"carregado com sucesso","Error when downloading a file by URL":"Erro ao baixar arquivo por URL","Error when uploading a file":"Erro ao enviar arquivo","Error loading files":"Erro ao carregar arquivos","File not found":"Arquivo n\xe3o encontrado","File renamed to":"Arquivo renomeado para","Failed to rename the file":"Falha ao renomear o arquivo","Folder renamed to":"Pasta renomeada para","Rename folder":"Renomear pasta","New folder name":"Novo nome da pasta","Enter a new folder name":"Digite um novo nome para a pasta","Please drag and drop image files only":"Por favor, arraste e solte apenas arquivos de imagem","Upload file by URL":"Carregar arquivo por URL","Upload file":"Carregar arquivo","Creating a new folder":"Criando uma nova pasta",Create:"Criar",Cancel:"Cancelar","Folder name":"Nome da pasta","Enter the name of the folder":"Digite o nome da pasta","Enter the name":"Digite o nome","A folder will be created inside:":"A pasta ser\xe1 criada dentro de:","selected folder":"pasta selecionada","The folder will be created in the root directory":"A pasta ser\xe1 criada no diret\xf3rio raiz","Failed to load folders":"N\xe3o foi poss\xedvel carregar as pastas","Folder name cannot be empty":"O nome da pasta n\xe3o pode estar vazio","Folder creation provider is not configured":"O provedor de cria\xe7\xe3o de pastas n\xe3o est\xe1 configurado","Folder created":"Pasta criada","Folder rename is disabled by config":"Renomear pastas est\xe1 desabilitado pela configura\xe7\xe3o","Folder rename provider is not configured":"O provedor de renomea\xe7\xe3o de pastas n\xe3o est\xe1 configurado","Unexpected response when renaming folder":"Resposta inesperada ao renomear a pasta","Folder renamed":"Pasta renomeada","Failed to rename folder":"N\xe3o foi poss\xedvel renomear a pasta","Failed to load folder items count":"N\xe3o foi poss\xedvel obter a contagem de itens da pasta","Failed to load subfolders":"N\xe3o foi poss\xedvel carregar as subpastas",Download:"Baixar","image URL":"URL da imagem","Enter the URL of the image":"Digite a URL da imagem","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Formatos suportados: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Novo nome do arquivo","Enter a new file name":"Digite um novo nome para o arquivo","Copy to folder":"Copiar para pasta",Added:"Adicionado em {{date}}","File uploaded successfully":"Arquivo {{fileName}} carregado com sucesso","Successfully uploaded":"{{successCount}} de {{count}} arquivo carregado com sucesso","Successfully uploaded files":"{{successCount}} de {{count}} arquivos carregados com sucesso",uploads_success_summary:"Enviados {{successCount}} de {{totalCount}} arquivos",uploads_fail_summary:"Falhou ao enviar {{failCount}} de {{totalCount}} arquivos","File with this name already exists.":"J\xe1 existe um arquivo com esse nome.","File not found or no longer available.":"O arquivo n\xe3o foi encontrado ou j\xe1 foi exclu\xeddo.","You don't have permission to access this file.":"Voc\xea n\xe3o tem permiss\xe3o para acessar este arquivo.","File is too large to upload.":"O arquivo \xe9 grande demais para ser enviado.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"O arquivo \xe9 grande demais ({{fileSize}}). Tamanho m\xe1ximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"N\xfamero m\xe1ximo de arquivos excedido. Permitido: {{allowed}}, recebido: {{received}}","This file type is not allowed.":"Este tipo de arquivo n\xe3o \xe9 permitido.","File name is not valid.":"O nome do arquivo n\xe3o \xe9 v\xe1lido.","File name is not valid. Allowed characters: {{allowedChars}}":"O nome do arquivo n\xe3o \xe9 v\xe1lido. Caracteres permitidos: {{allowedChars}}","Failed to read the file.":"N\xe3o foi poss\xedvel ler o arquivo.","Failed to write the file.":"N\xe3o foi poss\xedvel gravar o arquivo.","The file appears to be corrupted.":"O arquivo parece estar corrompido.","File integrity check failed.":"A verifica\xe7\xe3o de integridade do arquivo falhou.","Folder not found or no longer available.":"A pasta n\xe3o foi encontrada ou j\xe1 foi exclu\xedda.","Folder with this name already exists.":"J\xe1 existe uma pasta com esse nome.","A folder with that name already exists. Please enter a different folder name.":"J\xe1 existe uma pasta com esse nome. Digite um nome diferente para a pasta.","You don't have permission to access this folder.":"Voc\xea n\xe3o tem permiss\xe3o para acessar esta pasta.","Folder name is not valid.":"O nome da pasta n\xe3o \xe9 v\xe1lido.","Folder name is not valid. Allowed characters: {{allowedChars}}":"N\xe3o foi poss\xedvel criar a pasta. Caracteres permitidos no nome: {{allowedChars}}","Failed to read the folder contents.":"N\xe3o foi poss\xedvel ler o conte\xfado da pasta.","Failed to write to the folder.":"N\xe3o foi poss\xedvel gravar na pasta.","Folder storage quota exceeded.":"A cota de armazenamento da pasta foi excedida.","Folder is not empty.":"A pasta n\xe3o est\xe1 vazia.","Server error while processing the folder.":"Erro do servidor ao processar a pasta.","Folder operation took too long.":"A opera\xe7\xe3o com a pasta demorou demais.","Network error. Please check your connection and try again.":"Erro de rede. Verifique sua conex\xe3o e tente novamente.","The operation took too long. Please try again.":"A opera\xe7\xe3o demorou demais. Tente novamente.","Server error. Please try again later.":"Erro no servidor. Tente novamente mais tarde.","Service is temporarily unavailable. Please try again later.":"O servi\xe7o est\xe1 temporariamente indispon\xedvel. Tente novamente mais tarde.","Too many requests. Please try again a bit later.":"Muitas solicita\xe7\xf5es. Tente novamente mais tarde.","Authentication failed. Please sign in again.":"Falha na autentica\xe7\xe3o. Fa\xe7a login novamente.","You are not allowed to perform this action.":"Voc\xea n\xe3o tem permiss\xe3o para executar esta a\xe7\xe3o.","Some of the provided data is invalid.":"Alguns dos dados fornecidos s\xe3o inv\xe1lidos.","This operation is not supported.":"Esta opera\xe7\xe3o n\xe3o \xe9 suportada.","Request payload is too large.":"O corpo da requisi\xe7\xe3o \xe9 grande demais.","This media type is not supported.":"Este tipo de m\xeddia n\xe3o \xe9 suportado.","You have exceeded the upload quota.":"Voc\xea excedeu a cota de upload de arquivos.","Network error while uploading the file.":"Erro de rede ao enviar o arquivo.","File upload took too long.":"O envio do arquivo demorou demais.","Server error while uploading the file.":"Erro do servidor ao enviar o arquivo.","The specified URL is not valid.":"A URL especificada n\xe3o \xe9 v\xe1lida.","The specified URL is not reachable.":"A URL especificada n\xe3o est\xe1 acess\xedvel.","Content type at the URL is not allowed.":"O tipo de conte\xfado na URL n\xe3o \xe9 permitido.","Failed to download file from the URL.":"N\xe3o foi poss\xedvel baixar o arquivo da URL.","Network error while downloading the file.":"Erro de rede ao baixar o arquivo.","File download took too long.":"O download do arquivo demorou demais.","Server error while downloading the file.":"Erro do servidor ao baixar o arquivo.","Some items could not be processed.":"Nem todos os itens foram processados com sucesso.","Failed to process all items in the batch.":"Nenhum item do lote p\xf4de ser processado.","Some items in the batch are in a conflicting state.":"Alguns itens do lote est\xe3o em estado de conflito.","Some items in the batch did not pass validation.":"Alguns itens do lote n\xe3o passaram na valida\xe7\xe3o.","AI service returned an invalid response.":"O servi\xe7o de IA retornou uma resposta inv\xe1lida.","Failed to generate image using AI.":"Falha ao gerar imagem usando IA.","You have reached the AI image generation limit.":"Voc\xea atingiu o limite de gera\xe7\xe3o de imagens por IA.","Error in external integration.":"Erro em uma integra\xe7\xe3o externa.","Error in a third-party service.":"Erro em um servi\xe7o de terceiros.","An unknown error occurred.":"Ocorreu um erro desconhecido.","Renaming is not allowed for this item.":"Renomear n\xe3o \xe9 permitido para este item.","Moving is not allowed for this item.":"Mover n\xe3o \xe9 permitido para este item.","Copying is not allowed for this item.":"Copiar n\xe3o \xe9 permitido para este item.","Deleting is not allowed for this item.":"Excluir n\xe3o \xe9 permitido para este item.","Cannot move an item into itself.":"N\xe3o \xe9 poss\xedvel mover um item para dentro de si mesmo.","Cannot move an item into its descendant folder.":"N\xe3o \xe9 poss\xedvel mover um item para sua pasta descendente.","Cannot copy an item into itself.":"N\xe3o \xe9 poss\xedvel copiar um item para dentro de si mesmo.","Configuration error occurred.":"Ocorreu um erro de configura\xe7\xe3o.","Storage quota exceeded. Please free up space.":"Cota de armazenamento excedida. Libere espa\xe7o.","File is locked by another process or user.":"O arquivo est\xe1 bloqueado por outro processo ou usu\xe1rio.","File version conflict. Please refresh and try again.":"Conflito de vers\xe3o do arquivo. Atualize a p\xe1gina e tente novamente.","Batch operation exceeds the maximum number of items allowed.":"A opera\xe7\xe3o em lote excede o n\xfamero m\xe1ximo de itens permitidos.",Moved:"Movidos: {{names}}",move_success_summary:"Movidos {{successCount}} de {{totalCount}} itens",move_fail_summary:"Falhou ao mover {{failCount}} de {{totalCount}} itens",Copied:"Copiados: {{names}}",copy_success_summary:"Copiados {{successCount}} de {{totalCount}} itens",copy_fail_summary:"Falhou ao copiar {{failCount}} de {{totalCount}} itens",Uploaded:"Arquivos enviados: {{names}}",Failed:"Falha ao enviar: {{names}}","Failed to upload":"Falha ao carregar {{failCount}} de {{count}} arquivo","Failed to upload files":"Falha ao carregar {{failCount}} de {{count}} arquivos",months:{january:"janeiro",february:"fevereiro",march:"mar\xe7o",april:"abril",may:"maio",june:"junho",july:"julho",august:"agosto",september:"setembro",october:"outubro",november:"novembro",december:"dezembro"},files:"arquivos","No available folders":"Nenhuma pasta dispon\xedvel","My files":"Meus arquivos",GIF:"GIF","Stock images":"Imagens de stock",AI:"IA","AI image generation":"Gera\xe7\xe3o de imagens por IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Isso \xe9 tudo que conseguimos encontrar.","Search image":"Buscar imagem",All:"Todos",Landscape:"Paisagem",Portrait:"Retrato",Squarish:"Quadrados",Black:"Preto","Black and White":"Preto e branco",White:"Branco",Orange:"Laranja",Red:"Vermelho",Purple:"Roxo",Magenta:"Magenta",Green:"Verde",Teal:"Verde-azulado",Blue:"Azul","Photo by":"Foto por",on:"em","File Manager":"Gerenciador de arquivos","File Manager not configured":"Gerenciador de arquivos n\xe3o configurado","Filter by type":"Filtrar por tipo","All types":"Todos os tipos","File name":"Nome do arquivo",Actions:"A\xe7\xf5es","Add file":"Adicionar arquivo","Add folder":"Adicionar pasta","Add file by URL":"Adicionar arquivo por URL","File moved":"Arquivo movido","Error when moving a file":"Erro ao mover arquivo","Failed to download file":"N\xe3o foi poss\xedvel baixar o arquivo","Failed to load JSON data":"N\xe3o foi poss\xedvel carregar os dados JSON","Invalid file URL":"URL de arquivo inv\xe1lida","Unable to validate file URL":"N\xe3o foi poss\xedvel validar a URL do arquivo","Type to search...":"Digite para buscar...",Submit:"Enviar","No folders yet":"Nenhuma pasta ainda","Drag files to upload":"Arraste arquivos para carregar","Drop files here to upload":"Solte os arquivos aqui para carreg\xe1-los","Newest first":"Mais recentes primeiro","Oldest first":"Mais antigos primeiro","Largest first":"Maiores primeiro","Smallest first":"Menores primeiro","A-Z":"A-Z","Z-A":"Z-A","By type":"Por tipo","Evaluating the task":"Avaliando a tarefa","Something went wrong, please try again":"Algo deu errado, por favor tente novamente","Sort by":"Ordenar por","preview text":"Carregando imagem...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar exclus\xe3o","Are you sure you want to delete the selected items?":"Tem certeza que deseja excluir os itens selecionados?","Move to Trash":"Mover para lixeira","Are you sure you want to move the selected items to the Trash?":"Tem certeza que deseja mover os itens selecionados para a lixeira?","Permanently delete":"Exclus\xe3o permanente","Delete permanently":"Excluir permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Tem certeza que deseja excluir permanentemente os itens selecionados? Esta a\xe7\xe3o n\xe3o pode ser desfeita.",Clear:"Limpar","Clear Trash":"Limpar lixeira","Are you sure you want to permanently delete all items from Trash?":"Tem certeza que deseja excluir permanentemente todos os itens da lixeira?","Trash cleared successfully":"Lixeira limpa com sucesso","{{count}} items permanently deleted":"{{count}} itens exclu\xeddos permanentemente","Trash partially cleared":"Lixeira parcialmente limpa","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} itens exclu\xeddos, {{failed}} falharam","Failed to clear trash":"Falha ao limpar lixeira","Error clearing trash":"Erro ao limpar lixeira","Deleting items...":"Excluindo itens...",delete_files_permanent_one:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivo",delete_files_permanent_few:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_files_permanent_many:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_files_permanent_other:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_folder_permanent:"Esta a\xe7\xe3o excluir\xe1 permanentemente a pasta \xab{{name}}\xbb e todo seu conte\xfado, incluindo {{count}} itens.",delete_mixed_permanent:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{total}} itens selecionados, incluindo {{folders}} pastas e todas as {{images}} imagens dentro delas.",permanent_delete_warning:"Excluir arquivos que foram usados em e-mails causar\xe1 problemas na exibi\xe7\xe3o de imagens em e-mails antigos. Tem certeza de que deseja excluir permanentemente a sele\xe7\xe3o?",move_files_to_trash_one:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivo para a lixeira.",move_files_to_trash_few:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_files_to_trash_many:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_files_to_trash_other:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_folder_to_trash:"Esta a\xe7\xe3o mover\xe1 a pasta \xab{{name}}\xbb e todo seu conte\xfado ({{count}} itens) para a lixeira.",move_mixed_to_trash:"Esta a\xe7\xe3o mover\xe1 {{total}} itens selecionados para a lixeira, incluindo {{folders}} pastas e {{images}} imagens.",delete_count_confirm_trash_one:"Mover {{count}} arquivo para a lixeira?",delete_count_confirm_trash_few:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_trash_many:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_trash_other:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_permanent_one:"Excluir permanentemente {{count}} arquivo?",delete_count_confirm_permanent_few:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_permanent_many:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_permanent_other:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_one:"Excluir {{count}} arquivo?",delete_count_confirm_few:"Excluir {{count}} arquivos?",delete_count_confirm_many:"Excluir {{count}} arquivos?",delete_count_confirm_other:"Excluir {{count}} arquivos?",item:"arquivo",items:"arquivos",Trash:"Lixeira",Choose:"Escolher",Stock:"Banco de imagens","Select an image from our library":"Selecione uma imagem da nossa biblioteca","AI generation":"Gera\xe7\xe3o por IA","Creating an image on demand":"Criando uma imagem sob demanda","Search file or folder":"Buscar arquivo ou pasta","Click here to select a file":"Clique aqui para selecionar um arquivo","Supported files:":"Arquivos suportados:","Create folder":"Criar pasta",Done:"Conclu\xeddo","Move here":"Mover aqui","Copy here":"Copiar aqui","File URL":"URL do arquivo","There's nothing here":"N\xe3o h\xe1 nada aqui","Try using a different search query.":"Tente usar uma consulta de pesquisa diferente.","Millions of free stock images":"Milh\xf5es de imagens de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Digite uma consulta de busca e encontraremos a imagem perfeita para voc\xea","Millions of icons":"Milh\xf5es de \xedcones","Enter a search query and we'll find the perfect icon for you":"Digite uma consulta de busca e encontraremos o \xedcone perfeito para voc\xea","Enter your query and we will find the right one for you":"Digite sua consulta e n\xf3s encontraremos a ideal para voc\xea","Over 350,000 live images":"Mais de 350.000 imagens ao vivo","The folder will be created in the root directory.":"A pasta ser\xe1 criada no diret\xf3rio raiz.",undo:"DESFAZER",moved_to_trash_one:"{{count}} item movido para a lixeira",moved_to_trash_few:"{{count}} itens movidos para a lixeira",moved_to_trash_many:"{{count}} itens movidos para a lixeira",moved_to_trash_other:"{{count}} itens movidos para a lixeira",restored_items_one:"{{count}} item restaurado",restored_items_few:"{{count}} itens restaurados",restored_items_many:"{{count}} itens restaurados",restored_items_other:"{{count}} itens restaurados",Type:"Tipo","Generate image":"Gerar imagem","A beautiful image of a sunset over a calm ocean.":"Uma imagem bonita de um p\xf4r do sol sobre um oceano tranquilo.","For example:":"Por exemplo:",Insert:"Inserir",Error:"Erro","Upload progress":"Enviando {{completed}}/{{total}}","Uploading files":"Enviando {{completed}}/{{total}} arquivos","Uploaded files":"Enviados {{success}} de {{total}} arquivos","Upload error files":"Erro ao enviar {{errorCount}} arquivos","Applies to all {{count}} files":"(aplica-se a todos os {{count}} arquivos)","Some files failed to upload":"Alguns arquivos n\xe3o puderam ser enviados. Verifique o tamanho e o formato dos arquivos.",upload_error_hint_invalid_name:"Renomeie o arquivo: use apenas letras, n\xfameros, h\xedfens e sublinhados.",upload_error_hint_size:"Reduza o tamanho do arquivo ou escolha outro.",upload_error_hint_format:"Use um formato permitido: JPG, PNG ou GIF.",upload_error_hint_exists:"J\xe1 existe um arquivo com este nome na pasta. Renomeie o arquivo.","Images generated successfully":"Imagens geradas com sucesso","Choose for template":"Selecionar para carregar no modelo","Trash is empty":"A lixeira est\xe1 vazia","Deleted files will be displayed here":"Os arquivos exclu\xeddos ser\xe3o exibidos aqui","Editing: {{name}}":"Editando: {{name}}","Editing image":"Editando imagem",Save:"Salvar","Loading editor...":"Carregando editor...","Error loading image":"Erro ao carregar a imagem","Error saving image":"Erro ao salvar a imagem","Error initializing editor":"Erro ao inicializar o editor","Close File Manager":"Fechar gerenciador de arquivos","Are you sure you want to close? Unsaved changes will be lost.":"Tem certeza de que deseja fechar? As altera\xe7\xf5es n\xe3o salvas ser\xe3o perdidas.","Are you sure you want to close the file manager?":"Tem certeza de que deseja fechar o gerenciador de arquivos?",Close:"Fechar",KB:"KB","No files":"Nenhum arquivo","Folder is empty or files not found":"A pasta est\xe1 vazia ou os arquivos n\xe3o foram encontrados","Search files...":"Buscar arquivos...",Success:"Sucesso","Image updated successfully":"Imagem atualizada com sucesso","Failed to save changes":"Falha ao salvar altera\xe7\xf5es: {{error}}","Unknown error":"Erro desconhecido","Select destination folder":"Selecione a pasta de destino","Error moving":"Erro ao mover","Error deleting":"Erro ao excluir","Error copying":"Erro ao copiar","Error renaming":"Erro ao renomear","Failed to refresh folder tree":"Falha ao atualizar a \xe1rvore de pastas","Failed to refresh file list":"Falha ao atualizar a lista de arquivos","Errors occurred while moving":"Ocorreram erros ao mover","Errors occurred while copying":"Ocorreram erros ao copiar","(error)":"(erro)","(circular reference)":"(refer\xeancia circular)","File too large. Maximum size: {{size}}":"Arquivo muito grande. Tamanho m\xe1ximo: {{size}}","File too small. Minimum size: {{size}}":"Arquivo muito pequeno. Tamanho m\xednimo: {{size}}","Unsupported file type":"Tipo de arquivo n\xe3o suportado","Unsupported file type: {{type}}":"Tipo de arquivo n\xe3o suportado: {{type}}",unknown:"desconhecido","Failed to load files":"Falha ao carregar arquivos","DataProvider for folder deletion is not configured":"DataProvider para exclus\xe3o de pastas n\xe3o est\xe1 configurado","DataProvider for file upload is not configured":"DataProvider para upload de arquivos n\xe3o est\xe1 configurado","Error uploading file {{fileName}}":"Erro ao carregar o arquivo {{fileName}}","Error uploading file":"Erro ao carregar o arquivo","Cannot upload files to Trash":"N\xe3o \xe9 poss\xedvel carregar arquivos para a lixeira","Please fill in all fields":"Por favor, preencha todos os campos","URL too long":"URL muito longa","Only http and https URLs are supported":"Apenas URLs com protocolo http e https s\xe3o suportadas","Private and local URLs are not allowed":"URLs locais e privadas n\xe3o s\xe3o permitidas","Upload by URL is not supported":"Upload por URL n\xe3o \xe9 suportado","File name is too long. Maximum {{max}} characters":"O nome do arquivo \xe9 muito longo. M\xe1ximo de {{max}} caracteres","File name contains invalid characters":"O nome do arquivo cont\xe9m caracteres inv\xe1lidos","Large file may take a long time to upload":"Um arquivo grande pode demorar muito para ser carregado","File unavailable: {{status}} {{statusText}}":"Arquivo indispon\xedvel: {{status}} {{statusText}}","File too large: {{size}}":"Arquivo muito grande: {{size}}","Unsupported file type: {{contentType}}":"Tipo de arquivo n\xe3o suportado: {{contentType}}","Invalid server response: folder ID is missing":"Resposta do servidor inv\xe1lida: ID da pasta ausente","Error: folder cannot be its own parent":"Erro: a pasta n\xe3o pode ser seu pr\xf3prio pai","Upload to Trash is forbidden":"Enviar para a lixeira \xe9 proibido","renameFolder is not implemented in dataProviders":"renameFolder n\xe3o est\xe1 implementado em dataProviders","renameFile is not implemented in dataProviders":"renameFile n\xe3o est\xe1 implementado em dataProviders",Clean:"Limpar","Circular dependency detected: folder cannot be its own parent":"Depend\xeancia circular detectada: a pasta n\xe3o pode ser seu pr\xf3prio pai",pixie:{"added drawing":"Desenho adicionado","added frame":"Moldura adicionada","added image":"Imagem adicionada","added shape":"Forma adicionada","added sticker":"Adesivo adicionado","added text":"Texto adicionado","applied filters":"Filtros aplicados",apply:"Aplicar",background:"Fundo","background color":"Cor de fundo",beach:"Praia","brush color":"Cor do pincel","brush size":"Tamanho do pincel","brush type":"Tipo de pincel",bubbles:"Bolhas",Cancel:"Cancelar","changed style":"Estilo alterado","Circle Brush":"C\xedrculo",close:"Fechar",color:"Cor",corners:"Cantos",crop:"Cortar",Custom:"Personalizado","deleted object":"Objeto exclu\xeddo","Diamond Brush":"Diamante",doodles:"Rabiscos",draw:"Desenhar",emoticons:"Emoticons","Eraser Brush":"Borracha",filter:"Filtro",font:"Fonte","font size":"Tamanho da fonte",frame:"Moldura",gradient:"Gradiente",height:"Altura",history:"Hist\xf3rico","H Line Brush":"Linha H",image:"Imagem",initial:"Inicial",landmarks:"Pontos tur\xedsticos","loaded state":"Estado carregado","loading canvas":"Carregando tela","loading image":"Carregando imagem","loading state":"Carregando estado","maintain aspect ratio":"Manter propor\xe7\xe3o",merge:"Mesclar","merged objects":"Objetos mesclados","new text":"Novo texto",objects:"Objetos",opacity:"Opacidade",outline:"Contorno","outline color":"Cor do contorno","Pencil Brush":"L\xe1pis","processing image":"Processando imagem",quality:"Qualidade",radius:"Raio","replace image":"Substituir imagem","replaced background image":"Imagem de fundo substitu\xedda",resize:"Redimensionar","resized image":"Imagem redimensionada","rounded corner":"Canto arredondado",save:"Salvar",shadow:"Sombra","shadow color":"Cor da sombra",shapes:"Formas","Spray Brush":"Spray",square:"Quadrado","Square Brush":"Quadrado",stickers:"Adesivos",text:"Texto",texture:"Textura",transportation:"Transporte","V Line Brush":"Linha V",width:"Largura",grayscale:"Tons de cinza","black & White":"Preto e branco",sharpen:"Nitidez",invert:"Inverter",vintage:"Vintage",polaroid:"Polaroid",kodachrome:"Kodachrome",technicolor:"Technicolor",brownie:"S\xe9pia quente",sepia:"S\xe9pia","remove Color":"Remover cor",brightness:"Brilho",gamma:"Gamma",noise:"Ru\xeddo",pixelate:"Pixelar",blur:"Desfocar",emboss:"Relevo","blend Color":"Misturar cor",distance:"Dist\xe2ncia",red:"Vermelho",green:"Verde",blue:"Azul",blocksize:"Tamanho do bloco",alpha:"Alfa",add:"Adicionar",multiply:"Multiplicar",subtract:"Subtrair",diff:"Diferen\xe7a",screen:"Tela",lighten:"Clarear",darken:"Escurecer","select an option...":"Selecione uma op\xe7\xe3o..."}};const kn={en:{translation:{Folder:"Folder",Folders:"Folders",Files:"Files",File:"File","Select the destination folder":"Select the destination folder","Filter by type":"Filter by type","All types":"All types","File name":"File name",Size:"Size",Date:"Date",Actions:"Actions",Delete:"Delete",Move:"Move",Copy:"Copy",Refresh:"Refresh","Add folder":"Add folder","Add file":"Add file","Add file by URL":"Add file by URL","Please select an image file":"Please select an image file","File deleted":"File deleted","Error when deleting a file":"Error when deleting a file","Folder deleted":"Folder deleted","Error when deleting a folder":"Error when deleting a folder","Delete folder":"Delete folder","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Are you sure you want to delete this folder? This action will also delete all files and subfolders.","File moved":"File moved","Error when moving a file":"Error when moving a file","has been successfully uploaded":"has been successfully uploaded","Failed to download file":"Failed to download file","Failed to load JSON data":"Failed to load JSON data","Invalid file URL":"Invalid file URL","Unable to validate file URL":"Unable to validate file URL","Error when uploading a file":"Error when uploading a file","successfully uploaded":"successfully uploaded","Error when downloading a file by URL":"Error when downloading a file by URL","Error loading files":"Error loading files","File Manager not configured":"File Manager not configured","Type to search...":"Type to search...","Failed to create folder":"Failed to create folder",Cancel:"Cancel",Submit:"Submit",months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},files:"files","No available folders":"No available folders","My files":"My files",GIF:"GIF","Stock images":"Stock images",Icons:"Icons",AI:"AI","AI image generation":"AI image generation","Search GIFs":"Search GIFs","That`s all we could find.":"That`s all we could find.","Search image":"Search image",All:"All",Landscape:"Landscape",Portrait:"Portrait",Squarish:"Squarish",Black:"Black","Black and White":"Black and White",White:"White",Orange:"Orange",Red:"Red",Purple:"Purple",Magenta:"Magenta",Green:"Green",Teal:"Teal",Blue:"Blue","Photo by":"Photo by",on:"on",selected:"selected",Deselected:"Deselected","Select all":"Select all",Rename:"Rename","Rename file":"Rename file {{currentFileName}}","Selected files":"Selected files: {{count}}",selected_files_one:"Selected {{count}} file",selected_files_other:"Selected {{count}} files",Edit:"Edit","Move to":"Move to","New folder":"New folder","Image search...":"Image search...","Search icons":"Search icons","By name":"By name","By size":"By size","By date":"By date",List:"List",Grid:"Grid",Main:"Main","total pages":"Total {{total}} items",Name:"Name",Untitled:"Untitled",Dimensions:"Dimensions",error:"error",created:"created","API-endpoint for file upload is not configured":"API-endpoint for file upload is not configured","The URL must point to an image":"The URL must point to an image","Image upload...":"Image upload...",Unknown:"Unknown","Error downloading file by URL":"Error downloading file by URL","File not found":"File not found","File renamed to":"File renamed to ","Failed to rename the file":"Failed to rename the file","Folder renamed to":"Folder renamed to","Rename folder":"Rename folder","New folder name":"New folder name","Enter a new folder name":"Enter a new folder name","Please drag and drop image files only":"Please drag and drop image files only","Upload file by URL":"Upload file by URL","Upload file":"Upload file","Creating a new folder":"Creating a new folder",Create:"Create","Folder name":"Folder name","Enter the name of the folder":"Enter the name of the folder","Enter the name":"Enter the name","A folder will be created inside:":"A folder will be created inside:","selected folder":"selected folder","The folder will be created in the root directory":"The folder will be created in the root directory","Failed to load folders":"Failed to load folders","Folder name cannot be empty":"Folder name cannot be empty","Folder creation provider is not configured":"Folder creation provider is not configured","Folder created":"Folder created","Folder rename is disabled by config":"Folder rename is disabled by config","Folder rename provider is not configured":"Folder rename provider is not configured","Unexpected response when renaming folder":"Unexpected response when renaming folder","Folder renamed":"Folder renamed","Failed to rename folder":"Failed to rename folder","Failed to load folder items count":"Failed to load folder items count","Failed to load subfolders":"Failed to load subfolders",Download:"Download","image URL":"image URL","Enter the URL of the image":"Enter the URL of the image","URL too long":"URL is too long","Only http and https URLs are supported":"Only http and https URLs are supported","Private and local URLs are not allowed":"Private and local URLs are not allowed","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"New file name","Enter a new file name":"Enter a new file name","Copy to folder":"Copy to folder",Added:"Added {{date}}","File uploaded successfully":"File {{fileName}} uploaded successfully","Successfully uploaded":"Successfully uploaded {{successCount}} of {{count}} file","Successfully uploaded files":"Successfully uploaded {{successCount}} of {{count}} files",Uploaded:"Uploaded: {{names}}",uploads_success_summary:"Uploaded {{successCount}} of {{totalCount}} files",Failed:"Failed: {{names}}",uploads_fail_summary:"Failed to upload {{failCount}} of {{totalCount}} files","File with this name already exists.":"File with this name already exists.","File not found or no longer available.":"File not found or no longer available.","You don't have permission to access this file.":"You don't have permission to access this file.","File is too large to upload.":"File is too large to upload.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}","This file type is not allowed.":"This file type is not allowed.","File name is not valid.":"File name is not valid.","File name is not valid. Allowed characters: {{allowedChars}}":"File name is not valid. Allowed characters: {{allowedChars}}","Failed to read the file.":"Failed to read the file.","Failed to write the file.":"Failed to write the file.","The file appears to be corrupted.":"The file appears to be corrupted.","File integrity check failed.":"File integrity check failed.","Folder not found or no longer available.":"Folder not found or no longer available.","Folder with this name already exists.":"Folder with this name already exists.","A folder with that name already exists. Please enter a different folder name.":"A folder with that name already exists. Please enter a different folder name.","You don't have permission to access this folder.":"You don't have permission to access this folder.","Folder name is not valid.":"Folder name is not valid.","Folder name is not valid. Allowed characters: {{allowedChars}}":"Folder name is not valid. Allowed characters: {{allowedChars}}","Failed to read the folder contents.":"Failed to read the folder contents.","Failed to write to the folder.":"Failed to write to the folder.","Folder storage quota exceeded.":"Folder storage quota exceeded.","Folder is not empty.":"Folder is not empty.","Server error while processing the folder.":"Server error while processing the folder.","Folder operation took too long.":"Folder operation took too long.","Network error. Please check your connection and try again.":"Network error. Please check your connection and try again.","The operation took too long. Please try again.":"The operation took too long. Please try again.","Server error. Please try again later.":"Server error. Please try again later.","Service is temporarily unavailable. Please try again later.":"Service is temporarily unavailable. Please try again later.","Too many requests. Please try again a bit later.":"Too many requests. Please try again a bit later.","Authentication failed. Please sign in again.":"Authentication failed. Please sign in again.","You are not allowed to perform this action.":"You are not allowed to perform this action.","Some of the provided data is invalid.":"Some of the provided data is invalid.","This operation is not supported.":"This operation is not supported.","Request payload is too large.":"Request payload is too large.","This media type is not supported.":"This media type is not supported.","You have exceeded the upload quota.":"You have exceeded the upload quota.","Network error while uploading the file.":"Network error while uploading the file.","File upload took too long.":"File upload took too long.","Server error while uploading the file.":"Server error while uploading the file.","The specified URL is not valid.":"The specified URL is not valid.","The specified URL is not reachable.":"The specified URL is not reachable.","Content type at the URL is not allowed.":"Content type at the URL is not allowed.","Failed to download file from the URL.":"Failed to download file from the URL.","Network error while downloading the file.":"Network error while downloading the file.","File download took too long.":"File download took too long.","Server error while downloading the file.":"Server error while downloading the file.","Some items could not be processed.":"Some items could not be processed.","Failed to process all items in the batch.":"Failed to process all items in the batch.","Some items in the batch are in a conflicting state.":"Some items in the batch are in a conflicting state.","Some items in the batch did not pass validation.":"Some items in the batch did not pass validation.","AI service returned an invalid response.":"AI service returned an invalid response.","Failed to generate image using AI.":"Failed to generate image using AI.","You have reached the AI image generation limit.":"You have reached the AI image generation limit.","Error in external integration.":"Error in external integration.","Error in a third-party service.":"Error in a third-party service.","An unknown error occurred.":"An unknown error occurred.","Renaming is not allowed for this item.":"Renaming is not allowed for this item.","Moving is not allowed for this item.":"Moving is not allowed for this item.","Copying is not allowed for this item.":"Copying is not allowed for this item.","Deleting is not allowed for this item.":"Deleting is not allowed for this item.","Cannot move an item into itself.":"Cannot move an item into itself.","Cannot move an item into its descendant folder.":"Cannot move an item into its descendant folder.","Cannot copy an item into itself.":"Cannot copy an item into itself.","Configuration error occurred.":"Configuration error occurred.","Storage quota exceeded. Please free up space.":"Storage quota exceeded. Please free up space.","File is locked by another process or user.":"File is locked by another process or user.","File version conflict. Please refresh and try again.":"File version conflict. Please refresh and try again.","Batch operation exceeds the maximum number of items allowed.":"Batch operation exceeds the maximum number of items allowed.",Moved:"Moved: {{names}}",move_success_summary:"Moved {{successCount}} of {{totalCount}} items",move_fail_summary:"Failed to move {{failCount}} of {{totalCount}} items",Copied:"Copied: {{names}}",copy_success_summary:"Copied {{successCount}} of {{totalCount}} items",copy_fail_summary:"Failed to copy {{failCount}} of {{totalCount}} items","Failed to upload":"Failed to upload {{failCount}} of {{count}} file","Failed to upload files":"Failed to upload {{failCount}} of {{count}} files","No folders yet":"No folders yet","Drag files to upload":"Drag files to upload","Drop files here to upload":"Drop files here to upload","Newest first":"Newest first","Oldest first":"Oldest first","Largest first":"Largest first","Smallest first":"Smallest first","A-Z":"A-Z","Z-A":"Z-A","By type":"By type","Evaluating the task":"Evaluating the task","Something went wrong, please try again":"Something went wrong, please try again","Sort by":"Sort by","preview text":"The image preview is trying to load ...","Use this variant":"Use this variant","Confirm deletion":"Confirm deletion","Are you sure you want to delete the selected items?":"Are you sure you want to delete the selected items?","Move to Trash":"Move to Trash","Are you sure you want to move the selected items to the Trash?":"Are you sure you want to move the selected items to the Trash?","Permanently delete":"Permanently delete","Delete permanently":"Delete permanently","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Are you sure you want to permanently delete the selected items? This action cannot be undone.",Clear:"Clear","Clear Trash":"Clear Trash","Are you sure you want to permanently delete all items from Trash?":"Are you sure you want to permanently delete all items from Trash?","Trash cleared successfully":"Trash cleared successfully","{{count}} items permanently deleted":"{{count}} items permanently deleted","Trash partially cleared":"Trash partially cleared","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} items deleted, {{failed}} items failed","Failed to clear trash":"Failed to clear trash","Error clearing trash":"Error clearing trash","Deleting items...":"Deleting items...",delete_files_permanent_one:"This action will permanently delete {{count}} file",delete_files_permanent_other:"This action will permanently delete {{count}} files",delete_folder_permanent:"This action will permanently delete the folder '{{name}}' and all its contents, including {{count}} items.",delete_mixed_permanent:"This action will permanently delete {{total}} selected items, including {{folders}} folders and all {{images}} images within them.",permanent_delete_warning:"Deleting files that were used in emails will cause problems with displaying images in old emails. Are you sure you want to permanently delete the selection?",move_files_to_trash_one:"This will move {{count}} file to the Trash.",move_files_to_trash_other:"This will move {{count}} files to the Trash.",move_folder_to_trash:"This will move the folder '{{name}}' and all its contents ({{count}} items) to the Trash.",move_mixed_to_trash:"This will move {{total}} selected items to the Trash, including {{folders}} folders and {{images}} images.",delete_count_confirm_trash_one:"Move {{count}} file to Trash?",delete_count_confirm_trash_other:"Move {{count}} files to Trash?",delete_count_confirm_permanent_one:"Permanently delete {{count}} file?",delete_count_confirm_permanent_other:"Permanently delete {{count}} files?",delete_count_confirm_one:"Delete {{count}} file?",delete_count_confirm_other:"Delete {{count}} files?",item:"item",items:"items",Trash:"Deleted",Choose:"Choose",Stock:"Stock","Select an image from our library":"Select an image from our library","AI generation":"AI generation","Creating an image on demand":"Creating an image on demand","Search file or folder":"Search file or folder","Click here to select a file":"Click here to select a file","Create folder":"Create folder",Done:"Done","Move here":"Move here","Copy here":"Copy here","File URL":"File URL","There's nothing here":"There's nothing here","Try using a different search query.":"Try using a different search query.","Millions of free stock images":"Millions of free stock images","Enter a search query and we'll find the perfect image for you":"Enter a search query and we'll find the perfect image for you","Millions of icons":"Millions of icons","Enter a search query and we'll find the perfect icon for you":"Enter a search query and we'll find the perfect icon for you","Enter your query and we will find the right one for you":"Enter your query and we will find the right one for you","Over 350,000 live images":"Over 350,000 live images","The folder will be created in the root directory.":"The folder will be created in the root directory.",undo:"UNDO",moved_to_trash_one:"Moved {{count}} item to Trash",moved_to_trash_other:"Moved {{count}} items to Trash",restored_items_one:"Restored {{count}} item",restored_items_other:"Restored {{count}} items",Type:"Type","Generate image":"Generate image","For example:":"For example:","A beautiful image of a sunset over a calm ocean.":"A beautiful image of a sunset over a calm ocean.",Insert:"Insert",Error:"Error","Upload progress":"Upload {{completed}}/{{total}}","Uploading files":"Uploading {{completed}}/{{total}} files","Uploaded files":"Uploaded {{success}} of {{total}} files","Upload error files":"Upload error {{errorCount}} files","Applies to all {{count}} files":"(applies to all {{count}} files)","Some files failed to upload":"Some files failed to upload. Please check file size and format.",upload_error_hint_invalid_name:"Rename the file: use only letters, numbers, hyphens and underscores.",upload_error_hint_size:"Reduce the file size or choose a different file.",upload_error_hint_format:"Use an allowed format: JPG, PNG, or GIF.",upload_error_hint_exists:"A file with this name already exists in the folder. Rename the file.","Images generated successfully":"Images generated successfully","Trash is empty":"Trash is empty","Deleted files will be displayed here":"Deleted files will be displayed here","Supported files:":"Supported files:","Stroke width":"Stroke thickness:",Color1:"Color1:",Color2:"Color2:",Color3:"Color3: ","Global search":"Global search","Family search":"Family search","Choose for template":"Choose for template",Back:"Back","Editing: {{name}}":"Editing: {{name}}","Editing image":"Editing image",Save:"Save","Loading editor...":"Loading editor...","Error loading image":"Error loading image","Error saving image":"Error saving image","Error initializing editor":"Error initializing editor","Close File Manager":"Close File Manager","Are you sure you want to close? Unsaved changes will be lost.":"Are you sure you want to close? Unsaved changes will be lost.","Are you sure you want to close the file manager?":"Are you sure you want to close the file manager?",Close:"Close",KB:"KB","No files":"No files","Folder is empty or files not found":"Folder is empty or files not found","Search files...":"Search files...",Success:"Success","Image updated successfully":"Image updated successfully","Failed to save changes":"Failed to save changes: {{error}}","Unknown error":"Unknown error","Select destination folder":"Select destination folder","Error moving":"Error moving","Error deleting":"Error deleting","Error copying":"Error copying","Error renaming":"Error renaming","Failed to refresh folder tree":"Failed to refresh folder tree","Failed to refresh file list":"Failed to refresh file list","Errors occurred while moving":"Errors occurred while moving","Errors occurred while copying":"Errors occurred while copying","(error)":"(error)","(circular reference)":"(circular reference)","File too large. Maximum size: {{size}}":"File too large. Maximum size: {{size}}","File too small. Minimum size: {{size}}":"File too small. Minimum size: {{size}}","Unsupported file type":"Unsupported file type","Unsupported file type: {{type}}":"Unsupported file type: {{type}}",unknown:"unknown","Failed to load files":"Failed to load files","DataProvider for folder deletion is not configured":"DataProvider for folder deletion is not configured","DataProvider for file upload is not configured":"DataProvider for file upload is not configured","Error uploading file {{fileName}}":"Error uploading file {{fileName}}","Error uploading file":"Error uploading file","Cannot upload files to Trash":"Cannot upload files to Trash","Please fill in all fields":"Please fill in all fields","Upload by URL is not supported":"Upload by URL is not supported","File name is too long. Maximum {{max}} characters":"File name is too long. Maximum {{max}} characters","File name contains invalid characters":"File name contains invalid characters","Large file may take a long time to upload":"Large file may take a long time to upload","File unavailable: {{status}} {{statusText}}":"File unavailable: {{status}} {{statusText}}","File too large: {{size}}":"File too large: {{size}}","Unsupported file type: {{contentType}}":"Unsupported file type: {{contentType}}","Invalid server response: folder ID is missing":"Invalid server response: folder ID is missing","Error: folder cannot be its own parent":"Error: folder cannot be its own parent","Upload to Trash is forbidden":"Upload to Trash is forbidden","renameFolder is not implemented in dataProviders":"renameFolder is not implemented in dataProviders","renameFile is not implemented in dataProviders":"renameFile is not implemented in dataProviders",Deleted:"Deleted",Clean:"Clean","Circular dependency detected: folder cannot be its own parent":"Circular dependency detected: folder cannot be its own parent",pixie:{"added drawing":"Added Drawing","added frame":"Added Frame","added image":"Added Image","added shape":"Added Shape","added sticker":"Added Sticker","added text":"Added Text","applied filters":"Applied Filters",apply:"Apply",background:"Background","background color":"Background color",beach:"Beach","brush color":"Brush Color","brush size":"Brush Size","brush type":"Brush Type",bubbles:"Bubbles",Cancel:"Cancel","changed style":"Changed Style","Circle Brush":"Circle Brush",close:"Close",color:"Color",corners:"Corners",crop:"Crop",Custom:"Custom","deleted object":"Deleted object","Diamond Brush":"Diamond Brush",doodles:"Doodles",draw:"Draw",emoticons:"Emoticons","Eraser Brush":"Eraser Brush",filter:"Filter",font:"Font","font size":"Font Size",frame:"Frame",gradient:"Gradient",height:"Height",history:"History","H Line Brush":"H Line Brush",image:"Image",initial:"Initial",landmarks:"Landmarks","loaded state":"Loaded State","loading canvas":"Loading Canvas","loading image":"Loading Image","loading state":"Loading State","maintain aspect ratio":"Maintain aspect ratio",merge:"Merge","merged objects":"Merged Objects","new text":"New Text",objects:"Objects",opacity:"Opacity",outline:"Outline","outline color":"Outline Color","Pencil Brush":"Pencil Brush","processing image":"Processing Image",quality:"Quality",radius:"Radius","replace image":"Replace Image","replaced background image":"Replaced Background Image",resize:"Resize","resized image":"Resized Image","rounded corner":"Rounded Corner",save:"Save",shadow:"Shadow","shadow color":"Shadow Color",shapes:"Shapes","Spray Brush":"Spray Brush",square:"Square","Square Brush":"Square Brush",stickers:"Stickers",text:"Text",texture:"Texture",transportation:"Transportation","V Line Brush":"V Line Brush",width:"Width",grayscale:"Grayscale","black & White":"Black & White",sharpen:"Sharpen",invert:"Invert",vintage:"Vintage",polaroid:"Polaroid",kodachrome:"Kodachrome",technicolor:"Technicolor",brownie:"Brownie",sepia:"Sepia","remove Color":"Remove Color",brightness:"Brightness",gamma:"Gamma",noise:"Noise",pixelate:"Pixelate",blur:"Blur",emboss:"Emboss","blend Color":"Blend Color",distance:"Distance",red:"Red",green:"Green",blue:"Blue",blocksize:"Blocksize",alpha:"Alpha",add:"Add",multiply:"Multiply",subtract:"Subtract",diff:"Diff",screen:"Screen",lighten:"Lighten",darken:"Darken","select an option...":"Select an option..."}}},ru:{translation:{Files:"\u0424\u0430\u0439\u043b\u044b",selected:"\u0432\u044b\u0431\u0440\u0430\u043d\u043e",Deselected:"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u044b\u0431\u043e\u0440",Refresh:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c","Select all":"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435",Rename:"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c","Rename file":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b {{currentFileName}}","Select the destination folder":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f","Selected files:":"\u0412\u044b\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u043e\u0432:","Selected files":"\u0412\u044b\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u043e\u0432: {{count}}",selected_files_one:"\u0412\u044b\u0431\u0440\u0430\u043d {{count}} \u0444\u0430\u0439\u043b",selected_files_few:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0430",selected_files_many:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",selected_files_other:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",Copy:"\u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c",Edit:"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c",Move:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c","Move to":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c",Delete:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c","New folder":"\u041d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430","Image search...":"\u041f\u043e\u0438\u0441\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439...","Search icons":"\u041d\u0430\u0439\u0442\u0438 \u0438\u043a\u043e\u043d\u043a\u0438","By name":"\u041f\u043e \u0438\u043c\u0435\u043d\u0438","By size":"\u041f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443","By date":"\u041f\u043e \u0434\u0430\u0442\u0435",List:"\u0421\u043f\u0438\u0441\u043e\u043a",Grid:"\u041f\u043b\u0438\u0442\u043a\u0438",Main:"\u0413\u043b\u0430\u0432\u043d\u0430\u044f",Folders:"\u041f\u0430\u043f\u043a\u0438","total pages":"\u0412\u0441\u0435\u0433\u043e {{total}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",Name:"\u0418\u043c\u044f",Untitled:"\u0411\u0435\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f",Size:"\u0420\u0430\u0437\u043c\u0435\u0440",Dimensions:"\u0420\u0430\u0437\u043c\u0435\u0440",Date:"\u0414\u0430\u0442\u0430",error:"\u043e\u0448\u0438\u0431\u043a\u0430",Folder:"\u041f\u0430\u043f\u043a\u0430",created:"\u0441\u043e\u0437\u0434\u0430\u043d\u0430","Failed to create folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","File deleted":"\u0424\u0430\u0439\u043b \u0443\u0434\u0430\u043b\u0435\u043d","Files deleted":"\u0424\u0430\u0439\u043b\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u044b","Error when deleting a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430","Folder deleted":"\u041f\u0430\u043f\u043a\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430","Error when deleting a folder":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438","Delete folder":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443? \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438.","API-endpoint for file upload is not configured":"API-endpoint \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Please select an image file":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",File:"\u0424\u0430\u0439\u043b","has been successfully uploaded":"\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","The URL must point to an image":"URL \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","Image upload...":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f...",Unknown:"\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e","Error downloading file by URL":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e URL","successfully uploaded":"\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","Error when downloading a file by URL":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e URL","Error when uploading a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430","Error loading files":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432","File not found":"\u0424\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d","File renamed to":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d \u043d\u0430 ","Failed to rename the file":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Folder renamed to":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430","Rename folder":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","New folder name":"\u041d\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter a new folder name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Please drag and drop image files only":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Upload file by URL":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","Upload file":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b","Creating a new folder":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438",Create:"\u0421\u043e\u0437\u0434\u0430\u0442\u044c",Cancel:"\u041e\u0442\u043c\u0435\u043d\u0430","Folder name":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter the name of the folder":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter the name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435","A folder will be created inside:":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438:","selected folder":"\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438","The folder will be created in the root directory":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435","Failed to load folders":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0438","Folder name cannot be empty":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c","Folder creation provider is not configured":"\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Folder created":"\u041f\u0430\u043f\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430","Folder rename is disabled by config":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043e\u043a \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439","Folder rename provider is not configured":"\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Unexpected response when renaming folder":"\u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438","Folder renamed":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430","Failed to rename folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Failed to load folder items count":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435","Failed to load subfolders":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438",Download:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c","image URL":"URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Enter the URL of the image":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"\u041d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430","Enter a new file name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430","Copy to folder":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443",Added:"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e {{date}}","File uploaded successfully":"\u0424\u0430\u0439\u043b {{fileName}} \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","Successfully uploaded":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u0430","Successfully uploaded files":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",uploads_success_summary:"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u043e\u0432",uploads_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u043e\u0432","File with this name already exists.":"\u0424\u0430\u0439\u043b \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","File not found or no longer available.":"\u0424\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0438\u043b\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0451\u043d.","You don't have permission to access this file.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443.","File is too large to upload.":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 ({{fileSize}}). \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u2014 {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e: {{allowed}}, \u0432\u044b\u0431\u0440\u0430\u043d\u043e: {{received}}","This file type is not allowed.":"\u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","File name is not valid.":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430.","File name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b: {{allowedChars}}","Failed to read the file.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b.","Failed to write the file.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b.","The file appears to be corrupted.":"\u0424\u0430\u0439\u043b \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0451\u043d \u0438\u043b\u0438 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.","File integrity check failed.":"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0444\u0430\u0439\u043b\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e.","Folder not found or no longer available.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0438\u043b\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430.","Folder with this name already exists.":"\u041f\u0430\u043f\u043a\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","A folder with that name already exists. Please enter a different folder name.":"\u041f\u0430\u043f\u043a\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438.","You don't have permission to access this folder.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435.","Folder name is not valid.":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438: {{allowedChars}}","Failed to read the folder contents.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043f\u043a\u0438.","Failed to write to the folder.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441 \u043f\u0430\u043f\u043a\u043e\u0439.","Folder storage quota exceeded.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438.","Folder is not empty.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043f\u0443\u0441\u0442\u0430.","Server error while processing the folder.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u043f\u043a\u0438.","Folder operation took too long.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441 \u043f\u0430\u043f\u043a\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Network error. Please check your connection and try again.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0442\u0438. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443.","The operation took too long. Please try again.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437.","Server error. Please try again later.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435.","Service is temporarily unavailable. Please try again later.":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435.","Too many requests. Please try again a bit later.":"\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0436\u0435.","Authentication failed. Please sign in again.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0441\u043d\u043e\u0432\u0430.","You are not allowed to perform this action.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.","Some of the provided data is invalid.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b.","This operation is not supported.":"\u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","Request payload is too large.":"\u0422\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435.","This media type is not supported.":"\u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","You have exceeded the upload quota.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432.","Network error while uploading the file.":"\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430.","File upload took too long.":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Server error while uploading the file.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430.","The specified URL is not valid.":"\u0423\u043a\u0430\u0437\u0430\u043d \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 URL.","The specified URL is not reachable.":"\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 URL \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.","Content type at the URL is not allowed.":"\u0422\u0438\u043f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 URL \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","Failed to download file from the URL.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 URL.","Network error while downloading the file.":"\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.","File download took too long.":"\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Server error while downloading the file.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.","Some items could not be processed.":"\u041d\u0435 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e.","Failed to process all items in the batch.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0438 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.","Some items in the batch are in a conflicting state.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.","Some items in the batch did not pass validation.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e.","AI service returned an invalid response.":"\u0421\u0435\u0440\u0432\u0438\u0441 AI \u0432\u0435\u0440\u043d\u0443\u043b \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.","Failed to generate image using AI.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AI.","You have reached the AI image generation limit.":"\u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442 \u043b\u0438\u043c\u0438\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 AI.","Error in external integration.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.","Error in a third-party service.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435.","An unknown error occurred.":"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430.","Renaming is not allowed for this item.":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Moving is not allowed for this item.":"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Copying is not allowed for this item.":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Deleting is not allowed for this item.":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Cannot move an item into itself.":"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f.","Cannot move an item into its descendant folder.":"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u043f\u0430\u043f\u043a\u0443.","Cannot copy an item into itself.":"\u041d\u0435\u043b\u044c\u0437\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f.","Configuration error occurred.":"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.","Storage quota exceeded. Please free up space.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u041e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u0435 \u043c\u0435\u0441\u0442\u043e.","File is locked by another process or user.":"\u0424\u0430\u0439\u043b \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.","File version conflict. Please refresh and try again.":"\u041a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0432\u0435\u0440\u0441\u0438\u0439 \u0444\u0430\u0439\u043b\u0430. \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043d\u043e\u0432\u0430.","Batch operation exceeds the maximum number of items allowed.":"\u041f\u0430\u043a\u0435\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.",Moved:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u044b: {{names}}",move_success_summary:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",move_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",Copied:"\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b: {{names}}",copy_success_summary:"\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",copy_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",Uploaded:"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b: {{names}}",Failed:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c: {{names}}","Failed to upload":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u0430","Failed to upload files":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",months:{january:"\u044f\u043d\u0432\u0430\u0440\u044f",february:"\u0444\u0435\u0432\u0440\u0430\u043b\u044f",march:"\u043c\u0430\u0440\u0442\u0430",april:"\u0430\u043f\u0440\u0435\u043b\u044f",may:"\u043c\u0430\u044f",june:"\u0438\u044e\u043d\u044f",july:"\u0438\u044e\u043b\u044f",august:"\u0430\u0432\u0433\u0443\u0441\u0442\u0430",september:"\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f",october:"\u043e\u043a\u0442\u044f\u0431\u0440\u044f",november:"\u043d\u043e\u044f\u0431\u0440\u044f",december:"\u0434\u0435\u043a\u0430\u0431\u0440\u044f"},files:"\u0444\u0430\u0439\u043b\u043e\u0432","No available folders":"\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0430\u043f\u043e\u043a","My files":"\u041c\u043e\u0438 \u0444\u0430\u0439\u043b\u044b",GIF:"GIF","Stock images":"\u0421\u0442\u043e\u043a\u043e\u0432\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",Icons:"\u0418\u043a\u043e\u043d\u043a\u0438",AI:"AI","AI image generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Search GIFs":"\u041d\u0430\u0439\u0442\u0438 GIF","That`s all we could find.":"\u042d\u0442\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0439\u0442\u0438.","Search image":"\u041d\u0430\u0439\u0442\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",All:"\u0412\u0441\u0435",Landscape:"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435",Portrait:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435",Squarish:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0435",Black:"\u0427\u0435\u0440\u043d\u044b\u0439","Black and White":"\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u044b\u0439",White:"\u0411\u0435\u043b\u044b\u0439",Orange:"\u041e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439",Red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439",Purple:"\u0424\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439",Magenta:"\u041f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439",Green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439",Teal:"\u0411\u0438\u0440\u044e\u0437\u043e\u0432\u044b\u0439",Blue:"\u0421\u0438\u043d\u0438\u0439","Photo by":"\u0424\u043e\u0442\u043e",on:"\u043d\u0430","File Manager":"\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","File Manager not configured":"\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Filter by type":"\u0424\u0438\u043b\u044c\u0442\u0440 \u043f\u043e \u0442\u0438\u043f\u0443","All types":"\u0412\u0441\u0435 \u0442\u0438\u043f\u044b","File name":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430",Actions:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f","Add file":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b","Add folder":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Add file by URL":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","File moved":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0451\u043d","Files moved":"\u0424\u0430\u0439\u043b\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u044b","Error when moving a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430","Files copied":"\u0424\u0430\u0439\u043b\u044b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b","Failed to download file":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Failed to load JSON data":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 JSON","Invalid file URL":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 URL \u0444\u0430\u0439\u043b\u0430","Unable to validate file URL":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","Type to search...":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430...",Submit:"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c","No folders yet":"\u041f\u0430\u043f\u043e\u043a \u043f\u043e\u043a\u0430 \u043d\u0435\u0442","Drag files to upload":"\u041f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438","Drop files here to upload":"\u041e\u0442\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0437\u0434\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0445","Newest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u043e\u0432\u044b\u0435","Oldest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0430\u0440\u044b\u0435","Largest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0435","Smallest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435","A-Z":"\u041f\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0443 \u0410-\u042f","Z-A":"\u041f\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0443 \u042f-\u0410","By type":"\u041f\u043e \u0442\u0438\u043f\u0443","Evaluating the task":"\u041e\u0446\u0435\u043d\u043a\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u044f","Something went wrong, please try again":"\u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437","Sort by":"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e","preview text":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f ...","Use this variant":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442","Confirm deletion":"\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435","Are you sure you want to delete the selected items?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b?","Move to Trash":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Are you sure you want to move the selected items to the Trash?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443?","Permanently delete":"\u041f\u043e\u043b\u043d\u043e\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435","Delete permanently":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b? \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c.",Clear:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c","Clear Trash":"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Are you sure you want to permanently delete all items from Trash?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u043a\u043e\u0440\u0437\u0438\u043d\u044b?","Trash cleared successfully":"\u041a\u043e\u0440\u0437\u0438\u043d\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u0430","{{count}} items permanently deleted":"{{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043e","Trash partially cleared":"\u041a\u043e\u0440\u0437\u0438\u043d\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u0430","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043e, {{failed}} \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c","Failed to clear trash":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Error clearing trash":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u043a\u043e\u0440\u0437\u0438\u043d\u044b","Deleting items...":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432...",delete_files_permanent_one:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b",delete_files_permanent_few:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u0430",delete_files_permanent_many:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",delete_files_permanent_other:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",delete_folder_permanent:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0438 \u0432\u0441\u0451 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.",delete_mixed_permanent:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{total}} \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{folders}} \u043f\u0430\u043f\u043e\u043a \u0438 \u0432\u0441\u0435 {{images}} \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445.",permanent_delete_warning:"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u0438\u0441\u044c\u043c\u0430\u0445, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0432 \u0441\u0442\u0430\u0440\u044b\u0445 \u043f\u0438\u0441\u044c\u043c\u0430\u0445. \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435?",move_files_to_trash_one:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b.",move_files_to_trash_few:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u0430.",move_files_to_trash_many:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432.",move_files_to_trash_other:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432.",move_folder_to_trash:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0438 \u0432\u0441\u0451 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 ({{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432).",move_mixed_to_trash:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{total}} \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{folders}} \u043f\u0430\u043f\u043e\u043a \u0438 {{images}} \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.",delete_count_confirm_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_permanent_one:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_permanent_few:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_permanent_many:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_permanent_other:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_one:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_few:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_many:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_other:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",item:"\u0444\u0430\u0439\u043b",items:"\u0444\u0430\u0439\u043b\u043e\u0432",Trash:"\u041a\u043e\u0440\u0437\u0438\u043d\u0430",Choose:"\u0412\u044b\u0431\u0440\u0430\u0442\u044c",Stock:"\u0424\u043e\u0442\u043e\u0441\u0442\u043e\u043a","Select an image from our library":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438","AI generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f","Creating an image on demand":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443","Search file or folder":"\u041d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043f\u0430\u043f\u043a\u0443","Click here to select a file":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0437\u0434\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Supported files:":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b:","Create folder":"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443",Done:"\u0413\u043e\u0442\u043e\u0432\u043e","Move here":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u044e\u0434\u0430","Copy here":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u044e\u0434\u0430","File URL":"URL \u0444\u0430\u0439\u043b\u0430","There's nothing here":"\u0417\u0434\u0435\u0441\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442","Try using a different search query.":"\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.","Millions of free stock images":"\u041c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0441\u0442\u043e\u043a\u043e\u0432\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Enter a search query and we'll find the perfect image for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","Millions of icons":"\u041c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0438\u043a\u043e\u043d\u043e\u043a","Enter a search query and we'll find the perfect icon for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043a\u043e\u043d\u043a\u0443","Enter your query and we will find the right one for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435","Over 350,000 live images":"\u0411\u043e\u043b\u0435\u0435 350 000 \u0436\u0438\u0432\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","The folder will be created in the root directory.":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435.",undo:"\u041e\u0422\u041c\u0415\u041d\u0410",moved_to_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0451\u043d {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",restored_items_one:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0451\u043d {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442",restored_items_few:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430",restored_items_many:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",restored_items_other:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",Type:"\u0422\u0438\u043f","Generate image":"C\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","A beautiful image of a sunset over a calm ocean.":"\u041a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0442\u0430 \u043d\u0430\u0434 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u044b\u043c \u043e\u043a\u0435\u0430\u043d\u043e\u043c.","For example:":"\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:",Insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c",Error:"\u041e\u0448\u0438\u0431\u043a\u0430","Upload progress":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 {{completed}}/{{total}}","Uploading files":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 {{completed}}/{{total}} \u0444\u0430\u0439\u043b\u043e\u0432","Uploaded files":"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{success}} \u0438\u0437 {{total}} \u0444\u0430\u0439\u043b\u043e\u0432","Upload error files":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 {{errorCount}} \u0444\u0430\u0439\u043b\u043e\u0432","Applies to all {{count}} files":"(\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e \u0432\u0441\u0435\u043c {{count}} \u0444\u0430\u0439\u043b\u0430\u043c)","Some files failed to upload":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u043e\u0432.",upload_error_hint_invalid_name:"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u043a\u0432\u044b, \u0446\u0438\u0444\u0440\u044b, \u0434\u0435\u0444\u0438\u0441 \u0438 \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435.",upload_error_hint_size:"\u0423\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u043e\u0439.",upload_error_hint_format:"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: JPG, PNG \u0438\u043b\u0438 GIF.",upload_error_hint_exists:"\u0424\u0430\u0439\u043b \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b.","Images generated successfully":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b","Trash is empty":"\u041a\u043e\u0440\u0437\u0438\u043d\u0430 \u043f\u0443\u0441\u0442\u0430","Deleted files will be displayed here":"\u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b","Stroke width":"\u0422\u043e\u043b\u0449\u0438\u043d\u0430:",Style:"\u0421\u0442\u0438\u043b\u044c",Color1:"\u0426\u0432\u0435\u0442 1:",Color2:"\u0426\u0432\u0435\u0442 2:",Color3:"\u0426\u0432\u0435\u0442 3: ","Global search":"\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a","Family search":"\u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0443","Choose for template":"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d",Back:"\u041d\u0430\u0437\u0430\u0434","Editing: {{name}}":"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435: {{name}}","Editing image":"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",Save:"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c","Loading editor...":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u2026","Error loading image":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Error saving image":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Error initializing editor":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430","Close File Manager":"\u0417\u0430\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","Are you sure you want to close? Unsaved changes will be lost.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c? \u041d\u0435\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u044b.","Are you sure you want to close the file manager?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440?",Close:"\u0417\u0430\u043a\u0440\u044b\u0442\u044c",KB:"\u041a\u0411","No files":"\u041d\u0435\u0442 \u0444\u0430\u0439\u043b\u043e\u0432","Folder is empty or files not found":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0443\u0441\u0442\u0430 \u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b","Search files...":"\u041f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432...",Success:"\u0423\u0441\u043f\u0435\u0445","Image updated successfully":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043e","Failed to save changes":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: {{error}}","Unknown error":"\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430","Select destination folder":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f","Error moving":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438","Error deleting":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438","Error copying":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438","Error renaming":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438","Failed to refresh folder tree":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0430\u043f\u043e\u043a","Failed to refresh file list":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432","Errors occurred while moving":"\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438","Errors occurred while copying":"\u041f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438","(error)":"(\u043e\u0448\u0438\u0431\u043a\u0430)","(circular reference)":"(\u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430)","File too large. Maximum size: {{size}}":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440: {{size}}","File too small. Minimum size: {{size}}":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440: {{size}}","Unsupported file type":"\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430","Unsupported file type: {{type}}":"\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430: {{type}}",unknown:"\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439","Failed to load files":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b","DataProvider for folder deletion is not configured":"DataProvider \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","DataProvider for file upload is not configured":"DataProvider \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Error uploading file {{fileName}}":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 {{fileName}}","Error uploading file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430","Cannot upload files to Trash":"\u041d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Please fill in all fields":"\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f","URL too long":"URL \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439","Only http and https URLs are supported":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e URL \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c http \u0438 https","Private and local URLs are not allowed":"\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 URL \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u044b","Upload by URL is not supported":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e URL \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f","File name is too long. Maximum {{max}} characters":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u043e\u0435. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c {{max}} \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432","File name contains invalid characters":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b","Large file may take a long time to upload":"\u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u043b\u0433\u043e","File unavailable: {{status}} {{statusText}}":"\u0424\u0430\u0439\u043b \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d: {{status}} {{statusText}}","File too large: {{size}}":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439: {{size}}","Unsupported file type: {{contentType}}":"\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430: {{contentType}}","Invalid server response: folder ID is missing":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043f\u0430\u043f\u043a\u0438","Error: folder cannot be its own parent":"\u041e\u0448\u0438\u0431\u043a\u0430: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0431\u044f","Upload to Trash is forbidden":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u0430","renameFolder is not implemented in dataProviders":"renameFolder \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders","renameFile is not implemented in dataProviders":"renameFile \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders",Deleted:"\u0423\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b",Clean:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c","Circular dependency detected: folder cannot be its own parent":"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0431\u044f",pixie:{"added drawing":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0438\u0441\u0443\u043d\u043a\u0430","added frame":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u043c\u043a\u0438","added image":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","added shape":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b","added sticker":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043a\u0435\u0440\u0430","added text":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430","applied filters":"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440",apply:"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c",background:"\u0424\u043e\u043d","background color":"\u0424\u043e\u043d\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442",beach:"\u041f\u043b\u044f\u0436","brush color":"\u0426\u0432\u0435\u0442 \u043a\u0438\u0441\u0442\u0438","brush size":"\u0420\u0430\u0437\u043c\u0435\u0440 \u043a\u0438\u0441\u0442\u0438","brush type":"\u0422\u0438\u043f \u043a\u0438\u0441\u0442\u0438",bubbles:"\u041f\u0443\u0437\u044b\u0440\u044c\u043a\u0438",Cancel:"\u041e\u0442\u043c\u0435\u043d\u0430","changed style":"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f","Circle Brush":"\u041a\u0440\u0443\u0433\u0438",close:"\u0417\u0430\u043a\u0440\u044b\u0442\u044c",color:"\u0426\u0432\u0435\u0442",corners:"\u0423\u0433\u043b\u044b",crop:"\u041e\u0431\u0440\u0435\u0437\u0430\u0442\u044c",Custom:"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439","deleted object":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430","Diamond Brush":"\u0410\u043b\u043c\u0430\u0437",doodles:"\u0426\u0432\u0435\u0442\u043d\u044b\u0435",draw:"\u0420\u0438\u0441\u0443\u043d\u043e\u043a",emoticons:"\u0421\u043c\u0430\u0439\u043b\u0438\u043a\u0438","Eraser Brush":"\u041b\u0430\u0441\u0442\u0438\u043a",filter:"\u0424\u0438\u043b\u044c\u0442\u0440",font:"\u0428\u0440\u0438\u0444\u0442","font size":"\u0420\u0430\u0437\u043c\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430",frame:"\u0420\u0430\u043c\u043a\u0430",gradient:"\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442",height:"\u0412\u044b\u0441\u043e\u0442\u0430",history:"\u0418\u0441\u0442\u043e\u0440\u0438\u044f","H Line Brush":"\u041d-\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f",image:"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",initial:"\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439",landmarks:"\u0414\u043e\u0441\u0442\u043e\u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438","loaded state":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f","loading canvas":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","loading image":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","loading state":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","maintain aspect ratio":"Maintain aspect ratio",merge:"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435","merged objects":"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432","new text":"\u041d\u043e\u0432\u0430\u044f \u043d\u0430\u0434\u043f\u0438\u0441\u044c",objects:"\u041e\u0431\u044a\u0435\u043a\u0442",opacity:"\u041f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c",outline:"\u041a\u043e\u043d\u0442\u0443\u0440","outline color":"\u0426\u0432\u0435\u0442 \u043a\u043e\u043d\u0442\u0443\u0440\u0430","Pencil Brush":"\u041a\u0430\u0440\u0430\u043d\u0434\u0430\u0448","processing image":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430",quality:"\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e",radius:"\u0420\u0430\u0434\u0438\u0443\u0441","replace image":"Replace Image","replaced background image":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",resize:"\u0420\u0430\u0437\u043c\u0435\u0440","resized image":"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430","rounded corner":"\u0417\u0430\u0433\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0435 \u0443\u0433\u043b\u043e\u0432",save:"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c",shadow:"\u0422\u0435\u043d\u044c","shadow color":"\u0426\u0432\u0435\u0442 \u0442\u0435\u043d\u0438",shapes:"\u0424\u0438\u0433\u0443\u0440\u044b","Spray Brush":"\u0421\u043f\u0440\u0435\u0439",square:"\u041a\u0432\u0430\u0440\u0434\u0440\u0430\u0442","Square Brush":"\u041a\u0432\u0430\u0440\u0434\u0440\u0430\u0442",stickers:"\u0421\u0442\u0438\u043a\u0435\u0440\u044b",text:"\u041d\u0430\u0434\u043f\u0438\u0441\u044c",texture:"\u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0430",transportation:"\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442","V Line Brush":"V-\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f",width:"\u0428\u0438\u0440\u0438\u043d\u0430",grayscale:"\u041e\u0442\u0442\u0435\u043d\u043a\u0438 \u0441\u0435\u0440\u043e\u0433\u043e","black & White":"\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u044b\u0439",sharpen:"\u0420\u0435\u0437\u043a\u043e\u0441\u0442\u044c",invert:"\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f",vintage:"\u0412\u0438\u043d\u0442\u0430\u0436",polaroid:"\u041f\u043e\u043b\u0430\u0440\u043e\u0438\u0434",kodachrome:"\u041a\u043e\u0434\u0430\u0445\u0440\u043e\u043c",technicolor:"\u0422\u0435\u0445\u043d\u0438\u043a\u043e\u043b\u043e\u0440",brownie:"\u041a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439",sepia:"\u0421\u0435\u043f\u0438\u044f","remove Color":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0446\u0432\u0435\u0442",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442\u044c",gamma:"\u0413\u0430\u043c\u043c\u0430",noise:"\u0428\u0443\u043c",pixelate:"\u041f\u0438\u043a\u0441\u0435\u043b\u044c\u0438\u0437\u0430\u0446\u0438\u044f",blur:"\u0420\u0430\u0437\u043c\u044b\u0442\u0438\u0435",emboss:"\u0422\u0438\u0441\u043d\u0435\u043d\u0438\u0435","blend Color":"\u0421\u043c\u0435\u0448\u0430\u0442\u044c \u0446\u0432\u0435\u0442",distance:"\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435",red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439",blue:"\u0421\u0438\u043d\u0438\u0439",blocksize:"\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430",alpha:"\u0410\u043b\u044c\u0444\u0430",add:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c",multiply:"\u0423\u043c\u043d\u043e\u0436\u0438\u0442\u044c",subtract:"\u0412\u044b\u0447\u0435\u0441\u0442\u044c",diff:"\u0420\u0430\u0437\u043d\u0438\u0446\u0430",screen:"\u042d\u043a\u0440\u0430\u043d",lighten:"\u041e\u0441\u0432\u0435\u0442\u043b\u0438\u0442\u044c",darken:"\u0417\u0430\u0442\u0435\u043c\u043d\u0438\u0442\u044c","select an option...":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u043f\u0446\u0438\u044e..."}}},es:{translation:{Files:"Archivos",selected:"seleccionado(s)",Deselected:"Deseleccionar",Refresh:"Actualizar","Select all":"Seleccionar todo",Rename:"Renombrar","Rename file":"Renombrar archivo {{currentFileName}}","Select the destination folder":"Seleccionar la carpeta de destino","Selected files:":"Archivos seleccionados:","Selected files":"Archivos seleccionados: {{count}}",selected_files_one:"{{count}} archivo seleccionado",selected_files_few:"{{count}} archivos seleccionados",selected_files_many:"{{count}} archivos seleccionados",selected_files_other:"{{count}} archivos seleccionados",Copy:"Duplicar",Edit:"Editar",Move:"Mover","Move to":"Mover a",Delete:"Eliminar","New folder":"Nueva carpeta","Image search...":"B\xfasqueda de im\xe1genes...","Search icons":"Buscar iconos","By name":"Por nombre","By size":"Por tama\xf1o","By date":"Por fecha",List:"Lista",Grid:"Cuadr\xedcula",Main:"Principal",Folders:"Carpetas","total pages":"{{total}} elementos en total",Name:"Nombre",Untitled:"Sin t\xedtulo",Size:"Tama\xf1o",Dimensions:"Dimensiones",Date:"Fecha",error:"error",Folder:"Carpeta",created:"creada","Failed to create folder":"Error al crear la carpeta","File deleted":"Archivo eliminado","Error when deleting a file":"Error al eliminar el archivo","Folder deleted":"Carpeta eliminada","Error when deleting a folder":"Error al eliminar la carpeta","Delete folder":"Eliminar carpeta","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\xbfEst\xe1 seguro de que desea eliminar esta carpeta? Esta acci\xf3n tambi\xe9n eliminar\xe1 todos los archivos y subcarpetas.","API-endpoint for file upload is not configured":"El endpoint API para la carga de archivos no est\xe1 configurado","Please select an image file":"Por favor, seleccione un archivo de imagen",File:"Archivo","has been successfully uploaded":"se ha cargado exitosamente","The URL must point to an image":"La URL debe apuntar a una imagen","Image upload...":"Cargando imagen...",Unknown:"Desconocido","Error downloading file by URL":"Error al descargar el archivo por URL","successfully uploaded":"cargado exitosamente","Error when downloading a file by URL":"Error al descargar un archivo por URL","Error when uploading a file":"Error al cargar el archivo","Error loading files":"Error al cargar archivos","File not found":"Archivo no encontrado","File renamed to":"Archivo renombrado a","Failed to rename the file":"Error al renombrar el archivo","Folder renamed to":"Carpeta renombrada a","Rename folder":"Renombrar carpeta","New folder name":"Nuevo nombre de la carpeta","Enter a new folder name":"Ingrese un nuevo nombre para la carpeta","Please drag and drop image files only":"Por favor, arrastre y suelte solo archivos de imagen","Upload file by URL":"Cargar archivo por URL","Upload file":"Cargar archivo","Creating a new folder":"Creando una nueva carpeta",Create:"Crear",Cancel:"Cancelar","Folder name":"Nombre de la carpeta","Enter the name of the folder":"Ingrese el nombre de la carpeta","Enter the name":"Ingrese el nombre","A folder will be created inside:":"La carpeta se crear\xe1 dentro de:","selected folder":"carpeta seleccionada","The folder will be created in the root directory":"La carpeta se crear\xe1 en el directorio ra\xedz","Failed to load folders":"No se pudieron cargar las carpetas","Folder name cannot be empty":"El nombre de la carpeta no puede estar vac\xedo","Folder creation provider is not configured":"El proveedor de creaci\xf3n de carpetas no est\xe1 configurado","Folder created":"Carpeta creada","Folder rename is disabled by config":"El renombrado de carpetas est\xe1 deshabilitado por la configuraci\xf3n","Folder rename provider is not configured":"El proveedor para renombrar carpetas no est\xe1 configurado","Unexpected response when renaming folder":"Respuesta inesperada al renombrar la carpeta","Folder renamed":"Carpeta renombrada","Failed to rename folder":"No se pudo renombrar la carpeta","Failed to load folder items count":"No se pudo obtener la cantidad de elementos de la carpeta","Failed to load subfolders":"No se pudieron cargar las subcarpetas",Download:"Descargar","image URL":"URL de la imagen","Enter the URL of the image":"Ingrese la URL de la imagen","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Formatos admitidos: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Nuevo nombre del archivo","Enter a new file name":"Ingrese un nuevo nombre para el archivo","Copy to folder":"Copiar a carpeta",Added:"A\xf1adido el {{date}}","File uploaded successfully":"Archivo {{fileName}} cargado exitosamente","Successfully uploaded":"{{successCount}} de {{count}} archivo cargado exitosamente","Successfully uploaded files":"{{successCount}} de {{count}} archivos cargados exitosamente",uploads_success_summary:"Se cargaron {{successCount}} de {{totalCount}} archivos",uploads_fail_summary:"No se pudieron cargar {{failCount}} de {{totalCount}} archivos","File with this name already exists.":"Ya existe un archivo con este nombre.","File not found or no longer available.":"El archivo no se encontr\xf3 o ya fue eliminado.","You don't have permission to access this file.":"No tiene permisos para acceder a este archivo.","File is too large to upload.":"El archivo es demasiado grande para subir.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"El archivo es demasiado grande ({{fileSize}}). Tama\xf1o m\xe1ximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Se ha superado el n\xfamero m\xe1ximo de archivos. Permitido: {{allowed}}, recibido: {{received}}","This file type is not allowed.":"Este tipo de archivo no est\xe1 permitido.","File name is not valid.":"El nombre del archivo no es v\xe1lido.","File name is not valid. Allowed characters: {{allowedChars}}":"El nombre del archivo no es v\xe1lido. Caracteres permitidos: {{allowedChars}}","Failed to read the file.":"No se pudo leer el archivo.","Failed to write the file.":"No se pudo escribir el archivo.","The file appears to be corrupted.":"El archivo parece estar da\xf1ado.","File integrity check failed.":"La verificaci\xf3n de integridad del archivo fall\xf3.","Folder not found or no longer available.":"La carpeta no se encontr\xf3 o ya fue eliminada.","Folder with this name already exists.":"Ya existe una carpeta con este nombre.","A folder with that name already exists. Please enter a different folder name.":"Ya existe una carpeta con ese nombre. Introduzca un nombre de carpeta diferente.","You don't have permission to access this folder.":"No tiene permisos para acceder a esta carpeta.","Folder name is not valid.":"El nombre de la carpeta no es v\xe1lido.","Folder name is not valid. Allowed characters: {{allowedChars}}":"No se pudo crear la carpeta. Caracteres permitidos en el nombre: {{allowedChars}}","Failed to read the folder contents.":"No se pudo leer el contenido de la carpeta.","Failed to write to the folder.":"No se pudo escribir en la carpeta.","Folder storage quota exceeded.":"Se super\xf3 la cuota de almacenamiento de la carpeta.","Folder is not empty.":"La carpeta no est\xe1 vac\xeda.","Server error while processing the folder.":"Error del servidor al procesar la carpeta.","Folder operation took too long.":"La operaci\xf3n con la carpeta tard\xf3 demasiado.","Network error. Please check your connection and try again.":"Error de red. Compruebe su conexi\xf3n e int\xe9ntelo de nuevo.","The operation took too long. Please try again.":"La operaci\xf3n tard\xf3 demasiado. Int\xe9ntelo de nuevo.","Server error. Please try again later.":"Error del servidor. Int\xe9ntelo de nuevo m\xe1s tarde.","Service is temporarily unavailable. Please try again later.":"El servicio no est\xe1 disponible temporalmente. Int\xe9ntelo de nuevo m\xe1s tarde.","Too many requests. Please try again a bit later.":"Demasiadas solicitudes. Int\xe9ntelo de nuevo m\xe1s tarde.","Authentication failed. Please sign in again.":"Error de autenticaci\xf3n. Inicie sesi\xf3n de nuevo.","You are not allowed to perform this action.":"No tiene permisos para realizar esta acci\xf3n.","Some of the provided data is invalid.":"Algunos de los datos proporcionados no son v\xe1lidos.","This operation is not supported.":"Esta operaci\xf3n no est\xe1 soportada.","Request payload is too large.":"El cuerpo de la solicitud es demasiado grande.","This media type is not supported.":"Este tipo de contenido no est\xe1 soportado.","You have exceeded the upload quota.":"Se ha superado la cuota de subida de archivos.","Network error while uploading the file.":"Error de red al subir el archivo.","File upload took too long.":"La subida del archivo tard\xf3 demasiado.","Server error while uploading the file.":"Error del servidor al subir el archivo.","The specified URL is not valid.":"La URL especificada no es v\xe1lida.","The specified URL is not reachable.":"La URL especificada no es accesible.","Content type at the URL is not allowed.":"El tipo de contenido en la URL no est\xe1 permitido.","Failed to download file from the URL.":"No se pudo descargar el archivo desde la URL.","Network error while downloading the file.":"Error de red al descargar el archivo.","File download took too long.":"La descarga del archivo tard\xf3 demasiado.","Server error while downloading the file.":"Error del servidor al descargar el archivo.","Some items could not be processed.":"No todos los elementos se procesaron correctamente.","Failed to process all items in the batch.":"No se pudo procesar ning\xfan elemento del lote.","Some items in the batch are in a conflicting state.":"Algunos elementos del lote est\xe1n en estado de conflicto.","Some items in the batch did not pass validation.":"Algunos elementos del lote no pasaron la validaci\xf3n.","AI service returned an invalid response.":"El servicio de IA devolvi\xf3 una respuesta no v\xe1lida.","Failed to generate image using AI.":"No se pudo generar la imagen usando IA.","You have reached the AI image generation limit.":"Se alcanz\xf3 el l\xedmite de generaci\xf3n de im\xe1genes con IA.","Error in external integration.":"Error en la integraci\xf3n externa.","Error in a third-party service.":"Error en un servicio de terceros.","An unknown error occurred.":"Se ha producido un error desconocido.","Renaming is not allowed for this item.":"No se permite renombrar este elemento.","Moving is not allowed for this item.":"No se permite mover este elemento.","Copying is not allowed for this item.":"No se permite copiar este elemento.","Deleting is not allowed for this item.":"No se permite eliminar este elemento.","Cannot move an item into itself.":"No se puede mover un elemento dentro de s\xed mismo.","Cannot move an item into its descendant folder.":"No se puede mover un elemento a su carpeta descendiente.","Cannot copy an item into itself.":"No se puede copiar un elemento dentro de s\xed mismo.","Configuration error occurred.":"Se produjo un error de configuraci\xf3n.","Storage quota exceeded. Please free up space.":"Se super\xf3 la cuota de almacenamiento. Libere espacio.","File is locked by another process or user.":"El archivo est\xe1 bloqueado por otro proceso o usuario.","File version conflict. Please refresh and try again.":"Conflicto de versi\xf3n del archivo. Actualice la p\xe1gina e int\xe9ntelo de nuevo.","Batch operation exceeds the maximum number of items allowed.":"La operaci\xf3n por lotes excede el n\xfamero m\xe1ximo de elementos permitidos.",Moved:"Movidos: {{names}}",move_success_summary:"Se movieron {{successCount}} de {{totalCount}} elementos",move_fail_summary:"No se pudieron mover {{failCount}} de {{totalCount}} elementos",Copied:"Copiados: {{names}}",copy_success_summary:"Se copiaron {{successCount}} de {{totalCount}} elementos",copy_fail_summary:"No se pudieron copiar {{failCount}} de {{totalCount}} elementos",Uploaded:"Archivos cargados: {{names}}",Failed:"No se pudieron cargar: {{names}}","Failed to upload":"Error al cargar {{failCount}} de {{count}} archivo","Failed to upload files":"Error al cargar {{failCount}} de {{count}} archivos",months:{january:"enero",february:"febrero",march:"marzo",april:"abril",may:"mayo",june:"junio",july:"julio",august:"agosto",september:"septiembre",october:"octubre",november:"noviembre",december:"diciembre"},files:"archivos","No available folders":"No hay carpetas disponibles","My files":"Mis archivos",GIF:"GIF","Stock images":"Im\xe1genes de stock",AI:"IA","AI image generation":"Generaci\xf3n de im\xe1genes con IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Es todo lo que pudimos encontrar.","Search image":"Buscar imagen",All:"Todos",Landscape:"Horizontal",Portrait:"Vertical",Squarish:"Cuadrado",Black:"Negro","Black and White":"Blanco y negro",White:"Blanco",Orange:"Naranja",Red:"Rojo",Purple:"Morado",Magenta:"Magenta",Green:"Verde",Teal:"Verde azulado",Blue:"Azul","Photo by":"Foto de",on:"en","File Manager":"Administrador de archivos","File Manager not configured":"Administrador de archivos no configurado","Filter by type":"Filtrar por tipo","All types":"Todos los tipos","File name":"Nombre del archivo",Actions:"Acciones","Add file":"A\xf1adir archivo","Add folder":"A\xf1adir carpeta","Add file by URL":"A\xf1adir archivo por URL","File moved":"Archivo movido","Error when moving a file":"Error al mover el archivo","Failed to download file":"No se pudo descargar el archivo","Failed to load JSON data":"No se pudieron cargar los datos JSON","Invalid file URL":"URL de archivo inv\xe1lida","Unable to validate file URL":"No se pudo validar la URL del archivo","Type to search...":"Escriba para buscar...",Submit:"Enviar","No folders yet":"A\xfan no hay carpetas","Drag files to upload":"Arrastre archivos para cargarlos","Drop files here to upload":"Suelte los archivos aqu\xed para cargarlos","Newest first":"Los m\xe1s nuevos primero","Oldest first":"Los m\xe1s antiguos primero","Largest first":"Los m\xe1s grandes primero","Smallest first":"Los m\xe1s peque\xf1os primero","A-Z":"A-Z","Z-A":"Z-A","By type":"Por tipo","Evaluating the task":"Evaluando la tarea","Something went wrong, please try again":"Algo sali\xf3 mal, por favor intente nuevamente","Sort by":"Ordenar por","preview text":"Cargando imagen...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar eliminaci\xf3n","Are you sure you want to delete the selected items?":"\xbfEst\xe1 seguro de que desea eliminar los elementos seleccionados?","Move to Trash":"Mover a la papelera","Are you sure you want to move the selected items to the Trash?":"\xbfEst\xe1 seguro de que desea mover los elementos seleccionados a la papelera?","Permanently delete":"Eliminaci\xf3n permanente","Delete permanently":"Eliminar permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\xbfEst\xe1 seguro de que desea eliminar permanentemente los elementos seleccionados? Esta acci\xf3n no se puede deshacer.",Clear:"Limpiar","Clear Trash":"Vaciar papelera","Are you sure you want to permanently delete all items from Trash?":"\xbfEst\xe1 seguro de que desea eliminar permanentemente todos los elementos de la papelera?","Trash cleared successfully":"Papelera vaciada con \xe9xito","{{count}} items permanently deleted":"{{count}} elementos eliminados permanentemente","Trash partially cleared":"Papelera parcialmente vaciada","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} elementos eliminados, {{failed}} fallaron","Failed to clear trash":"Error al vaciar papelera","Error clearing trash":"Error al vaciar papelera","Deleting items...":"Eliminando elementos...",delete_files_permanent_one:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivo",delete_files_permanent_few:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_files_permanent_many:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_files_permanent_other:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_folder_permanent:"Esta acci\xf3n eliminar\xe1 permanentemente la carpeta \xab{{name}}\xbb y todo su contenido, incluyendo {{count}} elementos.",delete_mixed_permanent:"Esta acci\xf3n eliminar\xe1 permanentemente {{total}} elementos seleccionados, incluyendo {{folders}} carpetas y todas las {{images}} im\xe1genes dentro de ellas.",permanent_delete_warning:"Eliminar archivos que se usaron en correos provocar\xe1 problemas para mostrar im\xe1genes en correos antiguos. \xbfEst\xe1 seguro de que desea eliminar permanentemente la selecci\xf3n?",move_files_to_trash_one:"Esta acci\xf3n mover\xe1 {{count}} archivo a la papelera.",move_files_to_trash_few:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_files_to_trash_many:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_files_to_trash_other:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_folder_to_trash:"Esta acci\xf3n mover\xe1 la carpeta \xab{{name}}\xbb y todo su contenido ({{count}} elementos) a la papelera.",move_mixed_to_trash:"Esta acci\xf3n mover\xe1 {{total}} elementos seleccionados a la papelera, incluyendo {{folders}} carpetas y {{images}} im\xe1genes.",delete_count_confirm_trash_one:"\xbfMover {{count}} archivo a la papelera?",delete_count_confirm_trash_few:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_trash_many:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_trash_other:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_permanent_one:"\xbfEliminar permanentemente {{count}} archivo?",delete_count_confirm_permanent_few:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_many:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_other:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_one:"\xbfEliminar {{count}} archivo?",delete_count_confirm_few:"\xbfEliminar {{count}} archivos?",delete_count_confirm_many:"\xbfEliminar {{count}} archivos?",delete_count_confirm_other:"\xbfEliminar {{count}} archivos?",item:"archivo",items:"archivos",Trash:"Papelera",Choose:"Elegir",Stock:"Banco de im\xe1genes","Select an image from our library":"Seleccione una imagen de nuestra biblioteca","AI generation":"Generaci\xf3n con IA","Creating an image on demand":"Creando una imagen bajo demanda","Search file or folder":"Buscar archivo o carpeta","Click here to select a file":"Haz clic aqu\xed para seleccionar un archivo","Supported files:":"Archivos admitidos:","Create folder":"Crear carpeta",Done:"Hecho","Move here":"Mover aqu\xed","Copy here":"Copiar aqu\xed","File URL":"URL del archivo","There's nothing here":"Aqu\xed no hay nada","Try using a different search query.":"Prueba a utilizar una consulta de b\xfasqueda diferente.","Millions of free stock images":"Millones de im\xe1genes de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Ingrese una consulta de b\xfasqueda y encontraremos la imagen perfecta para usted","Millions of icons":"Millones de iconos","Enter a search query and we'll find the perfect icon for you":"Ingrese una consulta de b\xfasqueda y encontraremos el \xedcono perfecto para usted","Enter your query and we will find the right one for you":"Ingrese su consulta y nosotros encontraremos la adecuada para usted","Over 350,000 live images":"M\xe1s de 350,000 im\xe1genes en vivo","The folder will be created in the root directory.":"La carpeta se crear\xe1 en el directorio ra\xedz.",undo:"DESHACER",moved_to_trash_one:"{{count}} elemento movido a la papelera",moved_to_trash_few:"{{count}} elementos movidos a la papelera",moved_to_trash_many:"{{count}} elementos movidos a la papelera",moved_to_trash_other:"{{count}} elementos movidos a la papelera",restored_items_one:"{{count}} elemento restaurado",restored_items_few:"{{count}} elementos restaurados",restored_items_many:"{{count}} elementos restaurados",restored_items_other:"{{count}} elementos restaurados",Type:"Tipo","Generate image":"Generar imagen","A beautiful image of a sunset over a calm ocean.":"Una imagen hermosa de un atardecer sobre un oc\xe9ano tranquilo.","For example:":"Por ejemplo:",Insert:"Insertar",Error:"Error","Upload progress":"Cargando {{completed}}/{{total}}","Uploading files":"Cargando {{completed}}/{{total}} archivos","Uploaded files":"Cargados {{success}} de {{total}} archivos","Upload error files":"Error al cargar {{errorCount}} archivos","Applies to all {{count}} files":"(se aplica a todos los {{count}} archivos)","Some files failed to upload":"Algunos archivos no se pudieron cargar. Verifique el tama\xf1o y el formato de los archivos.",upload_error_hint_invalid_name:"Renombre el archivo: use solo letras, n\xfameros, guiones y guiones bajos.",upload_error_hint_size:"Reduzca el tama\xf1o del archivo o elija otro.",upload_error_hint_format:"Use un formato permitido: JPG, PNG o GIF.",upload_error_hint_exists:"Ya existe un archivo con este nombre en la carpeta. Renombre el archivo.","Images generated successfully":"Im\xe1genes generadas correctamente","Choose for template":"Seleccionar para cargar en la plantilla","Trash is empty":"La papelera est\xe1 vac\xeda","Deleted files will be displayed here":"Los archivos eliminados se mostrar\xe1n aqu\xed","Editing: {{name}}":"Editando: {{name}}","Editing image":"Editando imagen",Save:"Guardar","Loading editor...":"Cargando editor...","Error loading image":"Error al cargar la imagen","Error saving image":"Error al guardar la imagen","Error initializing editor":"Error al inicializar el editor","Close File Manager":"Cerrar administrador de archivos","Are you sure you want to close? Unsaved changes will be lost.":"\xbfEst\xe1 seguro de que desea cerrar? Los cambios no guardados se perder\xe1n.","Are you sure you want to close the file manager?":"\xbfEst\xe1 seguro de que desea cerrar el administrador de archivos?",Close:"Cerrar",KB:"KB","No files":"No hay archivos","Folder is empty or files not found":"La carpeta est\xe1 vac\xeda o no se encontraron archivos","Search files...":"Buscar archivos...",Success:"\xc9xito","Image updated successfully":"Imagen actualizada exitosamente","Failed to save changes":"Error al guardar los cambios: {{error}}","Unknown error":"Error desconocido","Select destination folder":"Seleccione la carpeta de destino","Error moving":"Error al mover","Error deleting":"Error al eliminar","Error copying":"Error al copiar","Error renaming":"Error al renombrar","Failed to refresh folder tree":"Error al actualizar el \xe1rbol de carpetas","Failed to refresh file list":"Error al actualizar la lista de archivos","Errors occurred while moving":"Ocurrieron errores al mover","Errors occurred while copying":"Ocurrieron errores al copiar","(error)":"(error)","(circular reference)":"(referencia circular)","File too large. Maximum size: {{size}}":"El archivo es demasiado grande. Tama\xf1o m\xe1ximo: {{size}}","File too small. Minimum size: {{size}}":"El archivo es demasiado peque\xf1o. Tama\xf1o m\xednimo: {{size}}","Unsupported file type":"Tipo de archivo no admitido","Unsupported file type: {{type}}":"Tipo de archivo no admitido: {{type}}",unknown:"desconocido","Failed to load files":"Error al cargar archivos","DataProvider for folder deletion is not configured":"DataProvider para eliminar carpetas no est\xe1 configurado","DataProvider for file upload is not configured":"DataProvider para cargar archivos no est\xe1 configurado","Error uploading file {{fileName}}":"Error al cargar el archivo {{fileName}}","Error uploading file":"Error al cargar el archivo","Cannot upload files to Trash":"No se pueden cargar archivos a la papelera","Please fill in all fields":"Por favor, complete todos los campos","URL too long":"La URL es demasiado larga","Only http and https URLs are supported":"Solo se admiten URLs con protocolo http y https","Private and local URLs are not allowed":"No se permiten URLs locales ni privadas","Upload by URL is not supported":"La carga por URL no est\xe1 admitida","File name is too long. Maximum {{max}} characters":"El nombre del archivo es demasiado largo. M\xe1ximo {{max}} caracteres","File name contains invalid characters":"El nombre del archivo contiene caracteres no v\xe1lidos","Large file may take a long time to upload":"Un archivo grande puede tardar mucho en cargarse","File unavailable: {{status}} {{statusText}}":"Archivo no disponible: {{status}} {{statusText}}","File too large: {{size}}":"Archivo demasiado grande: {{size}}","Unsupported file type: {{contentType}}":"Tipo de archivo no admitido: {{contentType}}","Invalid server response: folder ID is missing":"Respuesta del servidor inv\xe1lida: falta el ID de la carpeta","Error: folder cannot be its own parent":"Error: la carpeta no puede ser su propio padre","Upload to Trash is forbidden":"Cargar a la papelera est\xe1 prohibido","renameFolder is not implemented in dataProviders":"renameFolder no est\xe1 implementado en dataProviders","renameFile is not implemented in dataProviders":"renameFile no est\xe1 implementado en dataProviders",Clean:"Limpiar","Circular dependency detected: folder cannot be its own parent":"Dependencia circular detectada: la carpeta no puede ser su propio padre",pixie:{"added drawing":"Dibujo a\xf1adido","added frame":"Marco a\xf1adido","added image":"Imagen a\xf1adida","added shape":"Forma a\xf1adida","added sticker":"Pegatina a\xf1adida","added text":"Texto a\xf1adido","applied filters":"Filtros aplicados",apply:"Aplicar",background:"Fondo","background color":"Color de fondo",beach:"Playa","brush color":"Color del pincel","brush size":"Tama\xf1o del pincel","brush type":"Tipo de pincel",bubbles:"Burbujas",Cancel:"Cancelar","changed style":"Estilo cambiado","Circle Brush":"C\xedrculo",close:"Cerrar",color:"Color",corners:"Esquinas",crop:"Recortar",Custom:"Personalizado","deleted object":"Objeto eliminado","Diamond Brush":"Diamante",doodles:"Garabatos",draw:"Dibujar",emoticons:"Emoticonos","Eraser Brush":"Borrador",filter:"Filtro",font:"Fuente","font size":"Tama\xf1o de fuente",frame:"Marco",gradient:"Gradiente",height:"Alto",history:"Historial","H Line Brush":"L\xednea H",image:"Imagen",initial:"Inicial",landmarks:"Monumentos","loaded state":"Estado cargado","loading canvas":"Cargando lienzo","loading image":"Cargando imagen","loading state":"Cargando estado","maintain aspect ratio":"Mantener proporci\xf3n",merge:"Fusionar","merged objects":"Objetos fusionados","new text":"Nuevo texto",objects:"Objetos",opacity:"Opacidad",outline:"Contorno","outline color":"Color del contorno","Pencil Brush":"L\xe1piz","processing image":"Procesando imagen",quality:"Calidad",radius:"Radio","replace image":"Reemplazar imagen","replaced background image":"Imagen de fondo reemplazada",resize:"Redimensionar","resized image":"Imagen redimensionada","rounded corner":"Esquina redondeada",save:"Guardar",shadow:"Sombra","shadow color":"Color de la sombra",shapes:"Formas","Spray Brush":"Spray",square:"Cuadrado","Square Brush":"Cuadrado",stickers:"Pegatinas",text:"Texto",texture:"Textura",transportation:"Transporte","V Line Brush":"L\xednea V",width:"Ancho",grayscale:"Escala de grises","black & White":"Blanco y negro",sharpen:"Enfocar",invert:"Invertir",vintage:"Vintage",polaroid:"Polaroid",kodachrome:"Kodachrome",technicolor:"Technicolor",brownie:"Sepia c\xe1lido",sepia:"Sepia","remove Color":"Eliminar color",brightness:"Brillo",gamma:"Gamma",noise:"Ruido",pixelate:"Pixelar",blur:"Desenfocar",emboss:"Relieve","blend Color":"Mezclar color",distance:"Distancia",red:"Rojo",green:"Verde",blue:"Azul",blocksize:"Tama\xf1o de bloque",alpha:"Alfa",add:"A\xf1adir",multiply:"Multiplicar",subtract:"Restar",diff:"Diferencia",screen:"Pantalla",lighten:"Aclarar",darken:"Oscurecer","select an option...":"Seleccione una opci\xf3n..."}}},uk:{translation:{Files:"\u0424\u0430\u0439\u043b\u0438",selected:"\u043e\u0431\u0440\u0430\u043d\u043e",Deselected:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438 \u0432\u0438\u0431\u0456\u0440",Refresh:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438","Select all":"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0432\u0441\u0435",Rename:"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438","Rename file":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b {{currentFileName}}","Select the destination folder":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f","Selected files:":"\u041e\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u0456\u0432:","Selected files":"\u041e\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u0456\u0432: {{count}}",selected_files_one:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b",selected_files_few:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0438",selected_files_many:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",selected_files_other:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",Copy:"\u0414\u0443\u0431\u043b\u044e\u0432\u0430\u0442\u0438",Edit:"\u0417\u043c\u0456\u043d\u0438\u0442\u0438",Move:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438","Move to":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438",Delete:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438","New folder":"\u041d\u043e\u0432\u0430 \u043f\u0430\u043f\u043a\u0430","Image search...":"\u041f\u043e\u0448\u0443\u043a \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c...","Search icons":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0456\u043a\u043e\u043d\u043a\u0438","By name":"\u0417\u0430 \u043d\u0430\u0437\u0432\u043e\u044e","By size":"\u0417\u0430 \u0440\u043e\u0437\u043c\u0456\u0440\u043e\u043c","By date":"\u0417\u0430 \u0434\u0430\u0442\u043e\u044e",List:"\u0421\u043f\u0438\u0441\u043e\u043a",Grid:"\u041f\u043b\u0438\u0442\u043a\u0438",Main:"\u0413\u043e\u043b\u043e\u0432\u043d\u0430",Folders:"\u041f\u0430\u043f\u043a\u0438","total pages":"\u0412\u0441\u044c\u043e\u0433\u043e {{total}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Name:"\u041d\u0430\u0437\u0432\u0430",Untitled:"\u0411\u0435\u0437 \u043d\u0430\u0437\u0432\u0438",Size:"\u0420\u043e\u0437\u043c\u0456\u0440",Dimensions:"\u0420\u043e\u0437\u043c\u0456\u0440",Date:"\u0414\u0430\u0442\u0430",error:"\u043f\u043e\u043c\u0438\u043b\u043a\u0430",Folder:"\u041f\u0430\u043f\u043a\u0430",created:"\u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430","Failed to create folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","File deleted":"\u0424\u0430\u0439\u043b \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Error when deleting a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Folder deleted":"\u041f\u0430\u043f\u043a\u0443 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Error when deleting a folder":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456 \u043f\u0430\u043f\u043a\u0438","Delete folder":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0446\u044e \u043f\u0430\u043f\u043a\u0443? \u0426\u044f \u0434\u0456\u044f \u0442\u0430\u043a\u043e\u0436 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c \u0443\u0441\u0456 \u0444\u0430\u0439\u043b\u0438 \u0442\u0430 \u043f\u0456\u0434\u043f\u0430\u043f\u043a\u0438.","API-endpoint for file upload is not configured":"API-endpoint \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Please select an image file":"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0444\u0430\u0439\u043b \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",File:"\u0424\u0430\u0439\u043b","has been successfully uploaded":"\u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","The URL must point to an image":"URL \u043f\u043e\u0432\u0438\u043d\u0435\u043d \u0432\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043d\u0430 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Image upload...":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f...",Unknown:"\u041d\u0435\u0432\u0456\u0434\u043e\u043c\u043e","Error downloading file by URL":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0437\u0430 URL","successfully uploaded":"\u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","Error when downloading a file by URL":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443 \u0437\u0430 URL","Error when uploading a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Error loading files":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432","File not found":"\u0424\u0430\u0439\u043b \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e","File renamed to":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 ","Failed to rename the file":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Folder renamed to":"\u041f\u0430\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430","Rename folder":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","New folder name":"\u041d\u043e\u0432\u0430 \u043d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438","Enter a new folder name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u043e\u0432\u0443 \u043d\u0430\u0437\u0432\u0443 \u043f\u0430\u043f\u043a\u0438","Please drag and drop image files only":"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u043f\u0435\u0440\u0435\u0442\u044f\u0433\u0443\u0439\u0442\u0435 \u043b\u0438\u0448\u0435 \u0444\u0430\u0439\u043b\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Upload file by URL":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","Upload file":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b","Creating a new folder":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043d\u043e\u0432\u043e\u0457 \u043f\u0430\u043f\u043a\u0438",Create:"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438",Cancel:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438","Folder name":"\u041d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438","Enter the name of the folder":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u0430\u0437\u0432\u0443 \u043f\u0430\u043f\u043a\u0438","Enter the name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u0430\u0437\u0432\u0443","A folder will be created inside:":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456:","selected folder":"\u043e\u0431\u0440\u0430\u043d\u043e\u0457 \u043f\u0430\u043f\u043a\u0438","The folder will be created in the root directory":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432 \u043a\u043e\u0440\u0435\u043d\u0435\u0432\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0437\u0456","Failed to load folders":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0438","Folder name cannot be empty":"\u041d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u043f\u043e\u0440\u043e\u0436\u043d\u044c\u043e\u044e","Folder creation provider is not configured":"\u041f\u043e\u0441\u0442\u0430\u0447\u0430\u043b\u044c\u043d\u0438\u043a \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u0438\u0439","Folder created":"\u041f\u0430\u043f\u043a\u0443 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043e","Folder rename is disabled by config":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u0432\u0438\u043c\u043a\u043d\u0435\u043d\u043e \u0432 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f\u0445","Folder rename provider is not configured":"\u041f\u043e\u0441\u0442\u0430\u0447\u0430\u043b\u044c\u043d\u0438\u043a \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u0438\u0439","Unexpected response when renaming folder":"\u041d\u0435\u043e\u0447\u0456\u043a\u0443\u0432\u0430\u043d\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c \u043f\u0456\u0434 \u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043a\u0438","Folder renamed":"\u041f\u0430\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e","Failed to rename folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Failed to load folder items count":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043f\u0430\u043f\u0446\u0456","Failed to load subfolders":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u043f\u0456\u0434\u043f\u0430\u043f\u043a\u0438",Download:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438","image URL":"URL \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Enter the URL of the image":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c URL \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0444\u043e\u0440\u043c\u0430\u0442\u0438: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"\u041d\u043e\u0432\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443","Enter a new file name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u043e\u0432\u0443 \u043d\u0430\u0437\u0432\u0443 \u0444\u0430\u0439\u043b\u0443","Copy to folder":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443",Added:"\u0414\u043e\u0434\u0430\u043d\u043e {{date}}","File uploaded successfully":"\u0424\u0430\u0439\u043b {{fileName}} \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","Successfully uploaded":"\u0423\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0443","Successfully uploaded files":"\u0423\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",uploads_success_summary:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u0456\u0432",uploads_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u0456\u0432","File with this name already exists.":"\u0424\u0430\u0439\u043b \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454.","File not found or no longer available.":"\u0424\u0430\u0439\u043b \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u0431\u043e \u0439\u043e\u0433\u043e \u0432\u0436\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e.","You don't have permission to access this file.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0446\u044c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0443.","File is too large to upload.":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439 ({{fileSize}}). \u0414\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u043e\u0437\u043c\u0456\u0440 \u2014 {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u0456\u0432. \u0414\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e: {{allowed}}, \u043e\u0431\u0440\u0430\u043d\u043e: {{received}}","This file type is not allowed.":"\u0426\u0435\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443 \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","File name is not valid.":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443.","File name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0438: {{allowedChars}}","Failed to read the file.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u0444\u0430\u0439\u043b.","Failed to write the file.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u0438 \u0444\u0430\u0439\u043b.","The file appears to be corrupted.":"\u0424\u0430\u0439\u043b \u043f\u043e\u0448\u043a\u043e\u0434\u0436\u0435\u043d\u0438\u0439 \u0430\u0431\u043e \u043c\u0430\u0454 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.","File integrity check failed.":"\u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0446\u0456\u043b\u0456\u0441\u043d\u043e\u0441\u0442\u0456 \u0444\u0430\u0439\u043b\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0432\u0434\u0430\u043b\u043e.","Folder not found or no longer available.":"\u041f\u0430\u043f\u043a\u0443 \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u0431\u043e \u0457\u0457 \u0432\u0436\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e.","Folder with this name already exists.":"\u041f\u0430\u043f\u043a\u0430 \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454.","A folder with that name already exists. Please enter a different folder name.":"\u041f\u0430\u043f\u043a\u0430 \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454. \u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0456\u043d\u0448\u0435 \u0456\u043c'\u044f \u043f\u0430\u043f\u043a\u0438.","You don't have permission to access this folder.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0446\u0456\u0454\u0457 \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid.":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0438 \u0432 \u043d\u0430\u0437\u0432\u0456 \u043f\u0430\u043f\u043a\u0438: {{allowedChars}}","Failed to read the folder contents.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u0432\u043c\u0456\u0441\u0442 \u043f\u0430\u043f\u043a\u0438.","Failed to write to the folder.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044e \u0437 \u043f\u0430\u043f\u043a\u043e\u044e.","Folder storage quota exceeded.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u043d\u043d\u044f \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438.","Folder is not empty.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043f\u043e\u0440\u043e\u0436\u043d\u044f.","Server error while processing the folder.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u043e\u0431\u0440\u043e\u0431\u043a\u0438 \u043f\u0430\u043f\u043a\u0438.","Folder operation took too long.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u0437 \u043f\u0430\u043f\u043a\u043e\u044e \u0437\u0430\u0439\u043d\u044f\u043b\u0430 \u043d\u0430\u0434\u0442\u043e \u0431\u0430\u0433\u0430\u0442\u043e \u0447\u0430\u0441\u0443.","Network error. Please check your connection and try again.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456. \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044f \u0434\u043e \u0456\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0442\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443.","The operation took too long. Please try again.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u043b\u0430\u0441\u044f \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e. \u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437.","Server error. Please try again later.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0456. \u041f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Service is temporarily unavailable. Please try again later.":"\u0421\u0435\u0440\u0432\u0456\u0441 \u0442\u0438\u043c\u0447\u0430\u0441\u043e\u0432\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0439. \u041f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Too many requests. Please try again a bit later.":"\u0417\u0430\u043d\u0430\u0434\u0442\u043e \u0431\u0430\u0433\u0430\u0442\u043e \u0437\u0430\u043f\u0438\u0442\u0456\u0432. \u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Authentication failed. Please sign in again.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044e. \u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0443\u0432\u0456\u0439\u0434\u0456\u0442\u044c \u0437\u043d\u043e\u0432\u0443.","You are not allowed to perform this action.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0446\u0456\u0454\u0457 \u0434\u0456\u0457.","Some of the provided data is invalid.":"\u0414\u0435\u044f\u043a\u0456 \u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0438\u0445 \u0434\u0430\u043d\u0438\u0445 \u0454 \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0438\u043c\u0438.","This operation is not supported.":"\u0426\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","Request payload is too large.":"\u0422\u0456\u043b\u043e \u0437\u0430\u043f\u0438\u0442\u0443 \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0435.","This media type is not supported.":"\u0426\u0435\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u0438\u0445 \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","You have exceeded the upload quota.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u043d\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432.","Network error while uploading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","File upload took too long.":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0442\u0440\u0438\u0432\u0430\u043b\u043e \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e.","Server error while uploading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","The specified URL is not valid.":"\u0412\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0443 URL-\u0430\u0434\u0440\u0435\u0441\u0443.","The specified URL is not reachable.":"\u0412\u043a\u0430\u0437\u0430\u043d\u0430 URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430.","Content type at the URL is not allowed.":"\u0422\u0438\u043f \u0432\u043c\u0456\u0441\u0442\u0443 \u0437\u0430 \u0432\u043a\u0430\u0437\u0430\u043d\u043e\u044e URL-\u0430\u0434\u0440\u0435\u0441\u043e\u044e \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","Failed to download file from the URL.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 \u0432\u043a\u0430\u0437\u0430\u043d\u043e\u044e URL-\u0430\u0434\u0440\u0435\u0441\u043e\u044e.","Network error while downloading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","File download took too long.":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0442\u0440\u0438\u0432\u0430\u043b\u043e \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e.","Server error while downloading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","Some items could not be processed.":"\u041d\u0435 \u0432\u0441\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0431\u0443\u043b\u0438 \u043e\u0431\u0440\u043e\u0431\u043b\u0435\u043d\u0456 \u0443\u0441\u043f\u0456\u0448\u043d\u043e.","Failed to process all items in the batch.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0431\u0440\u043e\u0431\u0438\u0442\u0438 \u0436\u043e\u0434\u0435\u043d \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457.","Some items in the batch are in a conflicting state.":"\u0414\u0435\u044f\u043a\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457 \u043f\u0435\u0440\u0435\u0431\u0443\u0432\u0430\u044e\u0442\u044c \u0443 \u043a\u043e\u043d\u0444\u043b\u0456\u043a\u0442\u043d\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u0456.","Some items in the batch did not pass validation.":"\u0414\u0435\u044f\u043a\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457 \u043d\u0435 \u043f\u0440\u043e\u0439\u0448\u043b\u0438 \u0432\u0430\u043b\u0456\u0434\u0430\u0446\u0456\u044e.","AI service returned an invalid response.":"\u0421\u0435\u0440\u0432\u0456\u0441 \u0428\u0406 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0432 \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c.","Failed to generate image using AI.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0428\u0406.","You have reached the AI image generation limit.":"\u0414\u043e\u0441\u044f\u0433\u043d\u0443\u0442\u043e \u043b\u0456\u043c\u0456\u0442\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u0457 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0428\u0406.","Error in external integration.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0443 \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u0456\u0439 \u0456\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0456\u0457.","Error in a third-party service.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0443 \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u044c\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0456\u0441\u0456.","An unknown error occurred.":"\u0421\u0442\u0430\u043b\u0430\u0441\u044f \u043d\u0435\u0432\u0456\u0434\u043e\u043c\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430.","Renaming is not allowed for this item.":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Moving is not allowed for this item.":"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Copying is not allowed for this item.":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Deleting is not allowed for this item.":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Cannot move an item into itself.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u0435.","Cannot move an item into its descendant folder.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0434\u043e\u0447\u0456\u0440\u043d\u044e \u043f\u0430\u043f\u043a\u0443.","Cannot copy an item into itself.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0441\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u0435.","Configuration error occurred.":"\u0421\u0442\u0430\u043b\u0430\u0441\u044f \u043f\u043e\u043c\u0438\u043b\u043a\u0430 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0457.","Storage quota exceeded. Please free up space.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u0441\u0445\u043e\u0432\u0438\u0449\u0430. \u0417\u0432\u0456\u043b\u044c\u043d\u0456\u0442\u044c \u043c\u0456\u0441\u0446\u0435.","File is locked by another process or user.":"\u0424\u0430\u0439\u043b \u0437\u0430\u0431\u043b\u043e\u043a\u043e\u0432\u0430\u043d\u043e \u0456\u043d\u0448\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u043e\u043c \u0430\u0431\u043e \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0435\u043c.","File version conflict. Please refresh and try again.":"\u041a\u043e\u043d\u0444\u043b\u0456\u043a\u0442 \u0432\u0435\u0440\u0441\u0456\u0439 \u0444\u0430\u0439\u043b\u0443. \u041e\u043d\u043e\u0432\u0456\u0442\u044c \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0443 \u0442\u0430 \u0441\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437.","Batch operation exceeds the maximum number of items allowed.":"\u041f\u0430\u043a\u0435\u0442\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u043f\u0435\u0440\u0435\u0432\u0438\u0449\u0443\u0454 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0443 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432.",Moved:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e: {{names}}",move_success_summary:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",move_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Copied:"\u0421\u043a\u043e\u043f\u0456\u0439\u043e\u0432\u0430\u043d\u043e: {{names}}",copy_success_summary:"\u0421\u043a\u043e\u043f\u0456\u0439\u043e\u0432\u0430\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",copy_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Uploaded:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e: {{names}}",Failed:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438: {{names}}","Failed to upload":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0443","Failed to upload files":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",months:{january:"\u0441\u0456\u0447\u043d\u044f",february:"\u043b\u044e\u0442\u043e\u0433\u043e",march:"\u0431\u0435\u0440\u0435\u0437\u043d\u044f",april:"\u043a\u0432\u0456\u0442\u043d\u044f",may:"\u0442\u0440\u0430\u0432\u043d\u044f",june:"\u0447\u0435\u0440\u0432\u043d\u044f",july:"\u043b\u0438\u043f\u043d\u044f",august:"\u0441\u0435\u0440\u043f\u043d\u044f",september:"\u0432\u0435\u0440\u0435\u0441\u043d\u044f",october:"\u0436\u043e\u0432\u0442\u043d\u044f",november:"\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430",december:"\u0433\u0440\u0443\u0434\u043d\u044f"},files:"\u0444\u0430\u0439\u043b\u0456\u0432","No available folders":"\u041d\u0435\u043c\u0430\u0454 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0445 \u043f\u0430\u043f\u043e\u043a","My files":"\u041c\u043e\u0457 \u0444\u0430\u0439\u043b\u0438",GIF:"GIF","Stock images":"\u0421\u0442\u043e\u043a\u043e\u0432\u0456 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",AI:"AI","AI image generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Search GIFs":"\u0417\u043d\u0430\u0439\u0442\u0438 GIF","That`s all we could find.":"\u0426\u0435 \u0432\u0441\u0435, \u0449\u043e \u043c\u0438 \u0437\u043c\u043e\u0433\u043b\u0438 \u0437\u043d\u0430\u0439\u0442\u0438.","Search image":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",All:"\u0412\u0441\u0456",Landscape:"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0456",Portrait:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0456",Squarish:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0456",Black:"\u0427\u043e\u0440\u043d\u0438\u0439","Black and White":"\u0427\u043e\u0440\u043d\u043e-\u0431\u0456\u043b\u0438\u0439",White:"\u0411\u0456\u043b\u0438\u0439",Orange:"\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439",Red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439",Purple:"\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439",Magenta:"\u041f\u0443\u0440\u043f\u0443\u0440\u043d\u0438\u0439",Green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439",Teal:"\u0411\u0456\u0440\u044e\u0437\u043e\u0432\u0438\u0439",Blue:"\u0421\u0438\u043d\u0456\u0439","Photo by":"\u0424\u043e\u0442\u043e",on:"\u043d\u0430","File Manager":"\u0424\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","File Manager not configured":"\u0424\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Filter by type":"\u0424\u0456\u043b\u044c\u0442\u0440 \u0437\u0430 \u0442\u0438\u043f\u043e\u043c","All types":"\u0412\u0441\u0456 \u0442\u0438\u043f\u0438","File name":"\u041d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443",Actions:"\u0414\u0456\u0457","Add file":"\u0414\u043e\u0434\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Add folder":"\u0414\u043e\u0434\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Add file by URL":"\u0414\u043e\u0434\u0430\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","File moved":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e","Error when moving a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Failed to download file":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b","Failed to load JSON data":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0434\u0430\u043d\u0456 JSON","Invalid file URL":"\u041d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0438\u0439 URL \u0444\u0430\u0439\u043b\u0443","Unable to validate file URL":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","Type to search...":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0448\u0443\u043a\u0443...",Submit:"\u041d\u0430\u0434\u0456\u0441\u043b\u0430\u0442\u0438","No folders yet":"\u041f\u0430\u043f\u043e\u043a \u043f\u043e\u043a\u0438 \u043d\u0435\u043c\u0430\u0454","Drag files to upload":"\u041f\u0435\u0440\u0435\u0442\u044f\u0433\u043d\u0456\u0442\u044c \u0444\u0430\u0439\u043b\u0438 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","Drop files here to upload":"\u0412\u0456\u0434\u043f\u0443\u0441\u0442\u0456\u0442\u044c \u0444\u0430\u0439\u043b\u0438 \u0442\u0443\u0442, \u0449\u043e\u0431 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0457\u0445","Newest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u043d\u043e\u0432\u0456","Oldest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0441\u0442\u0430\u0440\u0456","Largest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0432\u0435\u043b\u0438\u043a\u0456","Smallest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0456","A-Z":"\u0417\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u0410-\u042f","Z-A":"\u0417\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u042f-\u0410","By type":"\u0417\u0430 \u0442\u0438\u043f\u043e\u043c","Evaluating the task":"\u041e\u0446\u0456\u043d\u043a\u0430 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f","Something went wrong, please try again":"\u0429\u043e\u0441\u044c \u043f\u0456\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u0431\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0441\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437","Sort by":"\u0421\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u0437\u0430","preview text":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0454\u0442\u044c\u0441\u044f ...","Use this variant":"\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u0446\u0435\u0439 \u0432\u0430\u0440\u0456\u0430\u043d\u0442","Confirm deletion":"\u041f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f","Are you sure you want to delete the selected items?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438?","Move to Trash":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a","Are you sure you want to move the selected items to the Trash?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a?","Permanently delete":"\u041f\u043e\u0432\u043d\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f","Delete permanently":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438? \u0426\u044e \u0434\u0456\u044e \u043d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0441\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438.",Clear:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438","Clear Trash":"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u043a\u043e\u0448\u0438\u043a","Are you sure you want to permanently delete all items from Trash?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0432\u0441\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0437 \u043a\u043e\u0448\u0438\u043a\u0430?","Trash cleared successfully":"\u041a\u043e\u0448\u0438\u043a \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u043e","{{count}} items permanently deleted":"{{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Trash partially cleared":"\u041a\u043e\u0448\u0438\u043a \u0447\u0430\u0441\u0442\u043a\u043e\u0432\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u043e","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e, {{failed}} \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438","Failed to clear trash":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u043a\u043e\u0448\u0438\u043a","Error clearing trash":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u0456 \u043a\u043e\u0448\u0438\u043a\u0430","Deleting items...":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432...",delete_files_permanent_one:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b",delete_files_permanent_few:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0438",delete_files_permanent_many:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",delete_files_permanent_other:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",delete_folder_permanent:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0456 \u0432\u0441\u0435 \u0457\u0457 \u0432\u043c\u0456\u0441\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432.",delete_mixed_permanent:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{total}} \u043e\u0431\u0440\u0430\u043d\u0438\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{folders}} \u043f\u0430\u043f\u043e\u043a \u0456 \u0432\u0441\u0456 {{images}} \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 \u043d\u0438\u0445.",permanent_delete_warning:"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432, \u044f\u043a\u0456 \u0431\u0443\u043b\u0438 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u0456 \u0432 \u043b\u0438\u0441\u0442\u0430\u0445, \u043f\u0440\u0438\u0437\u0432\u0435\u0434\u0435 \u0434\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0437 \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f\u043c \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0443 \u0441\u0442\u0430\u0440\u0438\u0445 \u043b\u0438\u0441\u0442\u0430\u0445. \u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u043e\u0432\u043d\u0456\u0441\u0442\u044e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0435?",move_files_to_trash_one:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b.",move_files_to_trash_few:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0438.",move_files_to_trash_many:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432.",move_files_to_trash_other:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432.",move_folder_to_trash:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0456 \u0432\u0441\u0435 \u0457\u0457 \u0432\u043c\u0456\u0441\u0442 ({{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432).",move_mixed_to_trash:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{total}} \u043e\u0431\u0440\u0430\u043d\u0438\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{folders}} \u043f\u0430\u043f\u043e\u043a \u0456 {{images}} \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c.",delete_count_confirm_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_permanent_one:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_permanent_few:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_permanent_many:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_permanent_other:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_one:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_few:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_many:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_other:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",item:"\u0444\u0430\u0439\u043b",items:"\u0444\u0430\u0439\u043b\u0456\u0432",Trash:"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u0456",Choose:"\u041e\u0431\u0440\u0430\u0442\u0438",Stock:"\u0424\u043e\u0442\u043e\u0441\u0442\u043e\u043a","Select an image from our library":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437 \u043d\u0430\u0448\u043e\u0457 \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0438","AI generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u044f","Creating an image on demand":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u043d\u0430 \u0437\u0430\u043c\u043e\u0432\u043b\u0435\u043d\u043d\u044f","Search file or folder":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b \u0430\u0431\u043e \u043f\u0430\u043f\u043a\u0443","Click here to select a file":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0442\u0443\u0442, \u0449\u043e\u0431 \u0432\u0438\u0431\u0440\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Supported files:":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0444\u0430\u0439\u043b\u0438:","Create folder":"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443",Done:"\u0413\u043e\u0442\u043e\u0432\u043e","Move here":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0441\u044e\u0434\u0438","Copy here":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0441\u044e\u0434\u0438","File URL":"URL \u0444\u0430\u0439\u043b\u0443","There's nothing here":"\u0422\u0443\u0442 \u043d\u0456\u0447\u043e\u0433\u043e \u043d\u0435\u043c\u0430\u0454","Try using a different search query.":"\u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0456\u043d\u0448\u0438\u0439 \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442.","Millions of free stock images":"\u041c\u0456\u043b\u044c\u0439\u043e\u043d\u0438 \u0431\u0435\u0437\u043a\u043e\u0448\u0442\u043e\u0432\u043d\u0438\u0445 \u0441\u0442\u043e\u043a\u043e\u0432\u0438\u0445 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Enter a search query and we'll find the perfect image for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442, \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0456\u0434\u0435\u0430\u043b\u044c\u043d\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Millions of icons":"\u041c\u0456\u043b\u044c\u0439\u043e\u043d\u0438 \u0456\u043a\u043e\u043d\u043e\u043a","Enter a search query and we'll find the perfect icon for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442, \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0456\u0434\u0435\u0430\u043b\u044c\u043d\u0443 \u0456\u043a\u043e\u043d\u043a\u0443","Enter your query and we will find the right one for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0437\u0430\u043f\u0438\u0442 \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0435","Over 350,000 live images":"\u041f\u043e\u043d\u0430\u0434 350 000 \u0436\u0438\u0432\u0438\u0445 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","The folder will be created in the root directory.":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432 \u043a\u043e\u0440\u0435\u043d\u0435\u0432\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0437\u0456.",undo:"\u0421\u041a\u0410\u0421\u0423\u0412\u0410\u0422\u0418",moved_to_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043a\u043e\u0448\u0438\u043a",restored_items_one:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442",restored_items_few:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438",restored_items_many:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",restored_items_other:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Type:"\u0422\u0438\u043f","Generate image":"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","A beautiful image of a sunset over a calm ocean.":"\u041a\u0440\u0430\u0441\u0438\u0432\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u0445\u043e\u0434\u0443 \u0441\u043e\u043d\u0446\u044f \u043d\u0430\u0434 \u0441\u043f\u043e\u043a\u0456\u0439\u043d\u0438\u043c \u043e\u043a\u0435\u0430\u043d\u043e\u043c.","For example:":"\u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434:",Insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438",Error:"\u041f\u043e\u043c\u0438\u043b\u043a\u0430","Upload progress":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f {{completed}}/{{total}}","Uploading files":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f {{completed}}/{{total}} \u0444\u0430\u0439\u043b\u0456\u0432","Uploaded files":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{success}} \u0437 {{total}} \u0444\u0430\u0439\u043b\u0456\u0432","Upload error files":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f {{errorCount}} \u0444\u0430\u0439\u043b\u0456\u0432","Applies to all {{count}} files":"(\u0441\u0442\u043e\u0441\u0443\u0454\u0442\u044c\u0441\u044f \u0432\u0441\u0456\u0445 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432)","Some files failed to upload":"\u0414\u0435\u044f\u043a\u0456 \u0444\u0430\u0439\u043b\u0438 \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438. \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0440\u043e\u0437\u043c\u0456\u0440 \u0442\u0430 \u0444\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0456\u0432.",upload_error_hint_invalid_name:"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b: \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0439\u0442\u0435 \u043b\u0438\u0448\u0435 \u043b\u0456\u0442\u0435\u0440\u0438, \u0446\u0438\u0444\u0440\u0438, \u0434\u0435\u0444\u0456\u0441 \u0442\u0430 \u043f\u0456\u0434\u043a\u0440\u0435\u0441\u043b\u0435\u043d\u043d\u044f.",upload_error_hint_size:"\u0417\u043c\u0435\u043d\u0448\u0456\u0442\u044c \u0440\u043e\u0437\u043c\u0456\u0440 \u0444\u0430\u0439\u043b\u0443 \u0430\u0431\u043e \u043e\u0431\u0435\u0440\u0456\u0442\u044c \u0456\u043d\u0448\u0438\u0439.",upload_error_hint_format:"\u041e\u0431\u0435\u0440\u0456\u0442\u044c \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: JPG, PNG \u0430\u0431\u043e GIF.",upload_error_hint_exists:"\u0424\u0430\u0439\u043b \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0454 \u0432 \u043f\u0430\u043f\u0446\u0456. \u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b.","Images generated successfully":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043e","Choose for template":"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d","Trash is empty":"\u041a\u043e\u0448\u0438\u043a \u043f\u043e\u0440\u043e\u0436\u043d\u0456\u0439","Deleted files will be displayed here":"\u0422\u0443\u0442 \u0431\u0443\u0434\u0443\u0442\u044c \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u0438\u0441\u044f \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u0456 \u0444\u0430\u0439\u043b\u0438","Editing: {{name}}":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043d\u043d\u044f: {{name}}","Editing image":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",Save:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438","Loading editor...":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u2026","Error loading image":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Error saving image":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043d\u0456 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Error initializing editor":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430","Close File Manager":"\u0417\u0430\u043a\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","Are you sure you want to close? Unsaved changes will be lost.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0437\u0430\u043a\u0440\u0438\u0442\u0438? \u041d\u0435\u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u0456 \u0437\u043c\u0456\u043d\u0438 \u0431\u0443\u0434\u0443\u0442\u044c \u0432\u0442\u0440\u0430\u0447\u0435\u043d\u0456.","Are you sure you want to close the file manager?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0437\u0430\u043a\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440?",Close:"\u0417\u0430\u043a\u0440\u0438\u0442\u0438",KB:"\u041a\u0411","No files":"\u041d\u0435\u043c\u0430\u0454 \u0444\u0430\u0439\u043b\u0456\u0432","Folder is empty or files not found":"\u041f\u0430\u043f\u043a\u0430 \u043f\u043e\u0440\u043e\u0436\u043d\u044f \u0430\u0431\u043e \u0444\u0430\u0439\u043b\u0438 \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u0456","Search files...":"\u041f\u043e\u0448\u0443\u043a \u0444\u0430\u0439\u043b\u0456\u0432...",Success:"\u0423\u0441\u043f\u0456\u0445","Image updated successfully":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043e\u043d\u043e\u0432\u043b\u0435\u043d\u043e","Failed to save changes":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0437\u043c\u0456\u043d\u0438: {{error}}","Unknown error":"\u041d\u0435\u0432\u0456\u0434\u043e\u043c\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430","Select destination folder":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f","Error moving":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u0456","Error deleting":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456","Error copying":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u0456","Error renaming":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u0456","Failed to refresh folder tree":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u043d\u043e\u0432\u0438\u0442\u0438 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0430\u043f\u043e\u043a","Failed to refresh file list":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u043d\u043e\u0432\u0438\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u0456\u0432","Errors occurred while moving":"\u041f\u0456\u0434 \u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u0432\u0438\u043d\u0438\u043a\u043b\u0438 \u043f\u043e\u043c\u0438\u043b\u043a\u0438","Errors occurred while copying":"\u041f\u0456\u0434 \u0447\u0430\u0441 \u043a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u044f \u0432\u0438\u043d\u0438\u043a\u043b\u0438 \u043f\u043e\u043c\u0438\u043b\u043a\u0438","(error)":"(\u043f\u043e\u043c\u0438\u043b\u043a\u0430)","(circular reference)":"(\u0446\u0438\u043a\u043b\u0456\u0447\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f)","File too large. Maximum size: {{size}}":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u043e\u0437\u043c\u0456\u0440: {{size}}","File too small. Minimum size: {{size}}":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439. \u041c\u0456\u043d\u0456\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u043e\u0437\u043c\u0456\u0440: {{size}}","Unsupported file type":"\u041d\u0435\u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0438\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443","Unsupported file type: {{type}}":"\u041d\u0435\u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0438\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443: {{type}}",unknown:"\u043d\u0435\u0432\u0456\u0434\u043e\u043c\u0438\u0439","Failed to load files":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b\u0438","DataProvider for folder deletion is not configured":"DataProvider \u0434\u043b\u044f \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","DataProvider for file upload is not configured":"DataProvider \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Error uploading file {{fileName}}":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443 {{fileName}}","Error uploading file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Cannot upload files to Trash":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a","Please fill in all fields":"\u0417\u0430\u043f\u043e\u0432\u043d\u0456\u0442\u044c \u0443\u0441\u0456 \u043f\u043e\u043b\u044f","URL too long":"URL \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u0438\u0439","Only http and https URLs are supported":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u044e\u0442\u044c\u0441\u044f \u043b\u0438\u0448\u0435 URL \u0437 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c http \u0442\u0430 https","Private and local URLs are not allowed":"\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0456 \u0442\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0456 URL \u0437\u0430\u0431\u043e\u0440\u043e\u043d\u0435\u043d\u0456","Upload by URL is not supported":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430 URL \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f","File name is too long. Maximum {{max}} characters":"\u0406\u043c'\u044f \u0444\u0430\u0439\u043b\u0443 \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u0435. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c {{max}} \u0441\u0438\u043c\u0432\u043e\u043b\u0456\u0432","File name contains invalid characters":"\u0406\u043c'\u044f \u0444\u0430\u0439\u043b\u0443 \u043c\u0456\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0438","Large file may take a long time to upload":"\u0412\u0435\u043b\u0438\u043a\u0438\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0432\u0430\u0442\u0438\u0441\u044f \u0434\u043e\u0432\u0433\u043e","File unavailable: {{status}} {{statusText}}":"\u0424\u0430\u0439\u043b \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0439: {{status}} {{statusText}}","File too large: {{size}}":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439: {{size}}","Unsupported file type: {{contentType}}":"\u041d\u0435\u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0438\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443: {{contentType}}","Invalid server response: folder ID is missing":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u0432\u0456\u0434\u0441\u0443\u0442\u043d\u0456\u0439 ID \u043f\u0430\u043f\u043a\u0438","Error: folder cannot be its own parent":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0431\u0430\u0442\u044c\u043a\u043e\u043c \u0441\u0430\u043c\u043e\u0457 \u0441\u0435\u0431\u0435","Upload to Trash is forbidden":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0432 \u043a\u043e\u0448\u0438\u043a \u0437\u0430\u0431\u043e\u0440\u043e\u043d\u0435\u043d\u043e","renameFolder is not implemented in dataProviders":"renameFolder \u043d\u0435 \u0440\u0435\u0430\u043b\u0456\u0437\u043e\u0432\u0430\u043d\u043e \u0432 dataProviders","renameFile is not implemented in dataProviders":"renameFile \u043d\u0435 \u0440\u0435\u0430\u043b\u0456\u0437\u043e\u0432\u0430\u043d\u043e \u0432 dataProviders",Clean:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438","Circular dependency detected: folder cannot be its own parent":"\u0412\u0438\u044f\u0432\u043b\u0435\u043d\u043e \u0446\u0438\u043a\u043b\u0456\u0447\u043d\u0443 \u0437\u0430\u043b\u0435\u0436\u043d\u0456\u0441\u0442\u044c: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0431\u0430\u0442\u044c\u043a\u043e\u043c \u0441\u0430\u043c\u043e\u0457 \u0441\u0435\u0431\u0435",pixie:{"added drawing":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u043c\u0430\u043b\u044e\u043d\u043a\u0430","added frame":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0440\u0430\u043c\u043a\u0438","added image":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","added shape":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0444\u0456\u0433\u0443\u0440\u0438","added sticker":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0441\u0442\u0456\u043a\u0435\u0440\u0430","added text":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0442\u0435\u043a\u0441\u0442\u0443","applied filters":"\u0417\u0430\u0441\u0442\u043e\u0441\u0443\u0432\u0430\u043d\u043d\u044f \u0444\u0456\u043b\u044c\u0442\u0440",apply:"\u0417\u0430\u0441\u0442\u043e\u0441\u0443\u0432\u0430\u0442\u0438",background:"\u0424\u043e\u043d","background color":"\u0424\u043e\u043d\u043e\u0432\u0438\u0439 \u043a\u043e\u043b\u0456\u0440",beach:"\u041f\u043b\u044f\u0436","brush color":"\u041a\u043e\u043b\u0456\u0440 \u043a\u0438\u0441\u0442\u0456","brush size":"\u0420\u043e\u0437\u043c\u0456\u0440 \u043a\u0438\u0441\u0442\u0456","brush type":"\u0422\u0438\u043f \u043a\u0438\u0441\u0442\u0456",bubbles:"\u041f\u0443\u0437\u0438\u0440\u0446\u0456",Cancel:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438","changed style":"\u0417\u043c\u0456\u043d\u0430 \u0441\u0442\u0438\u043b\u044e","Circle Brush":"\u041a\u043e\u043b\u0430",close:"\u0417\u0430\u043a\u0440\u0438\u0442\u0438",color:"\u041a\u043e\u043b\u0456\u0440",corners:"\u041a\u0443\u0442\u0438",crop:"\u041e\u0431\u0440\u0456\u0437\u0430\u0442\u0438",Custom:"\u041a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044c\u043a\u0438\u0439","deleted object":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043e\u0431'\u0454\u043a\u0442\u0430","Diamond Brush":"\u0410\u043b\u043c\u0430\u0437",doodles:"\u041a\u043e\u043b\u044c\u043e\u0440\u043e\u0432\u0456",draw:"\u041c\u0430\u043b\u044e\u043d\u043e\u043a",emoticons:"\u0421\u043c\u0430\u0439\u043b\u0438\u043a\u0438","Eraser Brush":"\u0413\u0443\u043c\u043a\u0430",filter:"\u0424\u0456\u043b\u044c\u0442\u0440",font:"\u0428\u0440\u0438\u0444\u0442","font size":"\u0420\u043e\u0437\u043c\u0456\u0440 \u0448\u0440\u0438\u0444\u0442\u0443",frame:"\u0420\u0430\u043c\u043a\u0430",gradient:"\u0413\u0440\u0430\u0434\u0456\u0454\u043d\u0442",height:"\u0412\u0438\u0441\u043e\u0442\u0430",history:"\u0406\u0441\u0442\u043e\u0440\u0456\u044f","H Line Brush":"\u041d-\u043f\u043e\u0434\u0456\u0431\u043d\u0430",image:"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",initial:"\u041f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0438\u0439",landmarks:"\u041f\u0430\u043c'\u044f\u0442\u043a\u0438","loaded state":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0441\u0442\u0430\u043d\u0443","loading canvas":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","loading image":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","loading state":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","maintain aspect ratio":"Maintain aspect ratio",merge:"\u041e\u0431'\u0454\u0434\u043d\u0430\u043d\u043d\u044f","merged objects":"\u041e\u0431'\u0454\u0434\u043d\u0430\u043d\u043d\u044f \u043e\u0431'\u0454\u043a\u0442\u0456\u0432","new text":"\u041d\u043e\u0432\u0438\u0439 \u043d\u0430\u043f\u0438\u0441",objects:"\u041e\u0431'\u0454\u043a\u0442",opacity:"\u041f\u0440\u043e\u0437\u043e\u0440\u0456\u0441\u0442\u044c",outline:"\u041a\u043e\u043d\u0442\u0443\u0440","outline color":"\u041a\u043e\u043b\u0456\u0440 \u043a\u043e\u043d\u0442\u0443\u0440\u0443","Pencil Brush":"\u041e\u043b\u0456\u0432\u0435\u0446\u044c","processing image":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f",quality:"\u042f\u043a\u0456\u0441\u0442\u044c",radius:"\u0420\u0430\u0434\u0456\u0443\u0441","replace image":"Replace Image","replaced background image":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",resize:"\u0420\u043e\u0437\u043c\u0456\u0440","resized image":"\u0417\u043c\u0456\u043d\u0430 \u0440\u043e\u0437\u043c\u0456\u0440\u0443","rounded corner":"\u0417\u0430\u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044f \u043a\u0443\u0442\u0456\u0432",save:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438",shadow:"\u0422\u0456\u043d\u044c","shadow color":"\u041a\u043e\u043b\u0456\u0440 \u0442\u0456\u043d\u0456",shapes:"\u0424\u0456\u0433\u0443\u0440\u0438","Spray Brush":"\u0421\u043f\u0440\u0435\u0439",square:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442","Square Brush":"\u041a\u0432\u0430\u0434\u0440\u0430\u0442",stickers:"\u0421\u0442\u0456\u043a\u0435\u0440\u0438",text:"\u041d\u0430\u043f\u0438\u0441",texture:"\u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0430",transportation:"\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442","V Line Brush":"V-\u043f\u043e\u0434\u0456\u0431\u043d\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",grayscale:"\u0412\u0456\u0434\u0442\u0456\u043d\u043a\u0438 \u0441\u0456\u0440\u043e\u0433\u043e","black & White":"\u0427\u043e\u0440\u043d\u043e-\u0431\u0456\u043b\u0438\u0439",sharpen:"\u0420\u0456\u0437\u043a\u0456\u0441\u0442\u044c",invert:"\u0406\u043d\u0432\u0435\u0440\u0441\u0456\u044f",vintage:"\u0412\u0456\u043d\u0442\u0430\u0436",polaroid:"\u041f\u043e\u043b\u0430\u0440\u043e\u0457\u0434",kodachrome:"\u041a\u043e\u0434\u0430\u0445\u0440\u043e\u043c",technicolor:"\u0422\u0435\u0445\u043d\u0456\u043a\u043e\u043b\u043e\u0440",brownie:"\u041a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u0438\u0439",sepia:"\u0421\u0435\u043f\u0456\u044f","remove Color":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043a\u043e\u043b\u0456\u0440",brightness:"\u042f\u0441\u043a\u0440\u0430\u0432\u0456\u0441\u0442\u044c",gamma:"\u0413\u0430\u043c\u043c\u0430",noise:"\u0428\u0443\u043c",pixelate:"\u041f\u0456\u043a\u0441\u0435\u043b\u0456\u0437\u0430\u0446\u0456\u044f",blur:"\u0420\u043e\u0437\u043c\u0438\u0442\u0442\u044f",emboss:"\u0422\u0438\u0441\u043d\u0435\u043d\u043d\u044f","blend Color":"\u0417\u043c\u0456\u0448\u0430\u0442\u0438 \u043a\u043e\u043b\u0456\u0440",distance:"\u0412\u0456\u0434\u0441\u0442\u0430\u043d\u044c",red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439",blue:"\u0421\u0438\u043d\u0456\u0439",blocksize:"\u0420\u043e\u0437\u043c\u0456\u0440 \u0431\u043b\u043e\u043a\u0443",alpha:"\u0410\u043b\u044c\u0444\u0430",add:"\u0414\u043e\u0434\u0430\u0442\u0438",multiply:"\u041f\u043e\u043c\u043d\u043e\u0436\u0438\u0442\u0438",subtract:"\u0412\u0456\u0434\u043d\u044f\u0442\u0438",diff:"\u0420\u0456\u0437\u043d\u0438\u0446\u044f",screen:"\u0415\u043a\u0440\u0430\u043d",lighten:"\u041e\u0441\u0432\u0456\u0442\u043b\u0438\u0442\u0438",darken:"\u0417\u0430\u0442\u0435\u043c\u043d\u0438\u0442\u0438","select an option...":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043e\u043f\u0446\u0456\u044e..."}}},"pt-br":{translation:An},pt:{translation:An},br:{translation:An},"pt-BR":{translation:An}};yn.use(Cr).init({resources:kn,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const En=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m6 9 6 6 6-6"}));En.displayName="ChevronDown";const In=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M12 20.472a6 6 0 1 0 5.58-10.262m-11.16 0a6 6 0 1 0 7.16 3.58M18 8A6 6 0 1 1 6 8a6 6 0 0 1 12 0Z"}));In.displayName="Colors";const jn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M16 16v2.8c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C14.48 22 13.92 22 12.8 22H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 20.48 2 19.92 2 18.8v-7.6c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 8 4.08 8 5.2 8H8m3.2 8h7.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 14.48 22 13.92 22 12.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2h-7.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C8 3.52 8 4.08 8 5.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C9.52 16 10.08 16 11.2 16Z"}));jn.displayName="Copy04";const Tn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M10 6h4.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C18 7.52 18 8.08 18 9.2V14M2 6h4m12 12v4m4-4H9.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C6 16.48 6 15.92 6 14.8V2"}));Tn.displayName="Crop02";const Fn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0-7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Fn.displayName="DotsVertical";const On=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7 3 3m0 0 3-3m-3 3v-6"}));On.displayName="FolderDownload";const Pn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7h6"}));Pn.displayName="FolderMinus";const Mn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Mn.displayName="FolderPlus";const Rn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm13.5 10.5L14 16m1-2.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));Rn.displayName="FolderSearch";const Ln=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3Zm11 0h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3Zm0 11h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 14.76 14 15.04 14 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 21 15.04 21 15.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 20.24 21 19.96 21 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 14 19.96 14 19.4 14Zm-11 0H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14Z"}));Ln.displayName="Grid01";const Nn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m4.272 20.728 6.597-6.597c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668l6.553 6.553M14 15l2.869-2.869c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L22 15M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM6.8 21h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 18.72 22 17.88 22 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 21 5.12 21 6.8 21Z"}));Nn.displayName="Image03";const Dn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m12.708 18.364-1.415 1.414a5 5 0 1 1-7.07-7.07l1.413-1.415m12.728 1.414 1.415-1.414a5 5 0 0 0-7.071-7.071l-1.415 1.414M8.5 15.5l7-7"}));Dn.displayName="Link01";const zn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));zn.displayName="List";const Bn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z"}),o.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));Bn.displayName="PlaySquare";const Un=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M12 8v8m-4-4h8m6 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Un.displayName="PlusCircle";const Vn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M20.453 12.893A8.5 8.5 0 0 1 4.638 16.25l-.25-.433m-.842-4.71A8.5 8.5 0 0 1 19.361 7.75l.25.433M3.493 18.066l.732-2.732 2.732.732m10.085-8.132 2.732.732.732-2.732"}));Vn.displayName="RefreshCw05";const Hn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M14 22H6.8m0 0c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 19.72 2 18.88 2 17.2M6.8 22h.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C12 19.72 12 18.88 12 17.2v-.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C9.72 12 8.88 12 7.2 12h-.4c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 14.28 2 15.12 2 16.8v.4m0 0V10m8-8h4m8 8v4m-4 8c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C22 19.395 22 18.93 22 18m0-12c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.122-2.122C19.395 2 18.93 2 18 2M6 2c-.93 0-1.395 0-1.776.102a3 3 0 0 0-2.122 2.122C2 4.605 2 5.07 2 6"}));Hn.displayName="Scale01";const $n=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m21 21-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"}));$n.displayName="SearchMd";const Wn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M4.5 22v-5m0-10V2M2 4.5h5m-5 15h5M13 3l-1.734 4.509c-.282.733-.423 1.1-.643 1.408a3 3 0 0 1-.706.707c-.308.219-.675.36-1.408.642L4 12l4.509 1.734c.733.282 1.1.423 1.408.643.273.194.512.433.707.706.219.308.36.675.642 1.408L13 21l1.734-4.509c.282-.733.423-1.1.643-1.408.194-.273.433-.512.706-.707.308-.219.675-.36 1.408-.642L22 12l-4.509-1.734c-.733-.282-1.1-.423-1.408-.642a3 3 0 0 1-.706-.707c-.22-.308-.36-.675-.643-1.408L13 3Z"}));Wn.displayName="Stars02";const Gn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M13 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v3.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 17 4.08 17 5.2 17H13m4-10h1.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 8.52 22 9.08 22 10.2v3.6c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C20.48 17 19.92 17 18.8 17H17m0 4V3m2.5 0h-5m5 18h-5"}));Gn.displayName="TextInput";const qn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M7 22V11m-5 2v7a2 2 0 0 0 2 2h13.426a3 3 0 0 0 2.965-2.544l1.077-7A3 3 0 0 0 18.503 9H15a1 1 0 0 1-1-1V4.466A2.466 2.466 0 0 0 11.534 2a.822.822 0 0 0-.75.488l-3.52 7.918A1 1 0 0 1 6.35 11H4a2 2 0 0 0-2 2Z"}));qn.displayName="ThumbsUp";const Yn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6m5 4.5v5m4-5v5"}));Yn.displayName="Trash03";const Xn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6"}));Xn.displayName="Trash04";var Kn,Zn={exports:{}},Jn=Zn.exports,Qn=(Kn||(Kn=1,function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=1/0,c=9007199254740991,u=NaN,d=4294967295,h=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],f="[object Arguments]",p="[object Array]",g="[object Boolean]",m="[object Date]",v="[object Error]",y="[object Function]",b="[object GeneratorFunction]",w="[object Map]",x="[object Number]",C="[object Object]",_="[object Promise]",S="[object RegExp]",A="[object Set]",k="[object String]",E="[object Symbol]",I="[object WeakMap]",j="[object ArrayBuffer]",T="[object DataView]",F="[object Float32Array]",O="[object Float64Array]",P="[object Int8Array]",M="[object Int16Array]",R="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",D="[object Uint16Array]",z="[object Uint32Array]",B=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,W=RegExp(H.source),G=RegExp($.source),q=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,ee=RegExp(Q.source),te=/^\s+/,re=/\s/,ne=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,oe=/,? & /,ae=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,se=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,pe=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",_e="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Ae="\\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",ke="["+be+"]",Ee="["+Ae+"]",Ie="["+we+"]",je="\\d+",Te="["+xe+"]",Fe="["+Ce+"]",Oe="[^"+be+Ae+je+xe+Ce+_e+"]",Pe="\\ud83c[\\udffb-\\udfff]",Me="[^"+be+"]",Re="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",Ne="["+_e+"]",De="\\u200d",ze="(?:"+Fe+"|"+Oe+")",Be="(?:"+Ne+"|"+Oe+")",Ue="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ve="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Ie+"|"+Pe+")?",$e="["+Se+"]?",We=$e+He+"(?:"+De+"(?:"+[Me,Re,Le].join("|")+")"+$e+He+")*",Ge="(?:"+[Te,Re,Le].join("|")+")"+We,qe="(?:"+[Me+Ie+"?",Ie,Re,Le,ke].join("|")+")",Ye=RegExp("['\u2019]","g"),Xe=RegExp(Ie,"g"),Ke=RegExp(Pe+"(?="+Pe+")|"+qe+We,"g"),Ze=RegExp([Ne+"?"+Fe+"+"+Ue+"(?="+[Ee,Ne,"$"].join("|")+")",Be+"+"+Ve+"(?="+[Ee,Ne+ze,"$"].join("|")+")",Ne+"?"+ze+"+"+Ue,Ne+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",je,Ge].join("|"),"g"),Je=RegExp("["+De+be+we+Se+"]"),Qe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["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"],tt=-1,rt={};rt[F]=rt[O]=rt[P]=rt[M]=rt[R]=rt[L]=rt[N]=rt[D]=rt[z]=!0,rt[f]=rt[p]=rt[j]=rt[g]=rt[T]=rt[m]=rt[v]=rt[y]=rt[w]=rt[x]=rt[C]=rt[S]=rt[A]=rt[k]=rt[I]=!1;var nt={};nt[f]=nt[p]=nt[j]=nt[T]=nt[g]=nt[m]=nt[F]=nt[O]=nt[P]=nt[M]=nt[R]=nt[w]=nt[x]=nt[C]=nt[S]=nt[A]=nt[k]=nt[E]=nt[L]=nt[N]=nt[D]=nt[z]=!0,nt[v]=nt[y]=nt[I]=!1;var it={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,at=parseInt,st="object"==typeof ur&&ur&&ur.Object===Object&&ur,lt="object"==typeof self&&self&&self.Object===Object&&self,ct=st||lt||Function("return this")(),ut=t&&!t.nodeType&&t,dt=ut&&e&&!e.nodeType&&e,ht=dt&&dt.exports===ut,ft=ht&&st.process,pt=function(){try{return dt&&dt.require&&dt.require("util").types||ft&&ft.binding&&ft.binding("util")}catch(e){}}(),gt=pt&&pt.isArrayBuffer,mt=pt&&pt.isDate,vt=pt&&pt.isMap,yt=pt&&pt.isRegExp,bt=pt&&pt.isSet,wt=pt&&pt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Ct(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function _t(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function St(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function At(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function kt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function Et(e,t){return!(null==e||!e.length)&&Nt(e,t,0)>-1}function It(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function jt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Tt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Ft(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Ot(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Pt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Mt=Ut("length");function Rt(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function Lt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Nt(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Lt(e,zt,r)}function Dt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function zt(e){return e!=e}function Bt(e,t){var r=null==e?0:e.length;return r?$t(e,t)/r:u}function Ut(e){return function(t){return null==t?r:t[e]}}function Vt(e){return function(t){return null==e?r:e[t]}}function Ht(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}function $t(e,t){for(var n,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==r&&(n=n===r?a:n+a)}return n}function Wt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Gt(e){return e?e.slice(0,lr(e)+1).replace(te,""):e}function qt(e){return function(t){return e(t)}}function Yt(e,t){return jt(t,function(t){return e[t]})}function Xt(e,t){return e.has(t)}function Kt(e,t){for(var r=-1,n=e.length;++r<n&&Nt(t,e[r],0)>-1;);return r}function Zt(e,t){for(var r=e.length;r--&&Nt(t,e[r],0)>-1;);return r}var Jt=Vt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Qt=Vt({"&":"&","<":"<",">":">",'"':""","'":"'"});function er(e){return"\\"+it[e]}function tr(e){return Je.test(e)}function rr(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function nr(e,t){return function(r){return e(t(r))}}function ir(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var s=e[r];s!==t&&s!==o||(e[r]=o,a[i++]=r)}return a}function or(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function ar(e){return tr(e)?function(e){for(var t=Ke.lastIndex=0;Ke.test(e);)++t;return t}(e):Mt(e)}function sr(e){return tr(e)?function(e){return e.match(Ke)||[]}(e):function(e){return e.split("")}(e)}function lr(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var cr=Vt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),dr=function e(t){var re,be=(t=null==t?ct:dr.defaults(ct.Object(),t,dr.pick(ct,et))).Array,we=t.Date,xe=t.Error,Ce=t.Function,_e=t.Math,Se=t.Object,Ae=t.RegExp,ke=t.String,Ee=t.TypeError,Ie=be.prototype,je=Ce.prototype,Te=Se.prototype,Fe=t["__core-js_shared__"],Oe=je.toString,Pe=Te.hasOwnProperty,Me=0,Re=(re=/[^.]+$/.exec(Fe&&Fe.keys&&Fe.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"",Le=Te.toString,Ne=Oe.call(Se),De=ct._,ze=Ae("^"+Oe.call(Pe).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ht?t.Buffer:r,Ue=t.Symbol,Ve=t.Uint8Array,He=Be?Be.allocUnsafe:r,$e=nr(Se.getPrototypeOf,Se),We=Se.create,Ge=Te.propertyIsEnumerable,qe=Ie.splice,Ke=Ue?Ue.isConcatSpreadable:r,Je=Ue?Ue.iterator:r,it=Ue?Ue.toStringTag:r,st=function(){try{var e=so(Se,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==ct.clearTimeout&&t.clearTimeout,ut=we&&we.now!==ct.Date.now&&we.now,dt=t.setTimeout!==ct.setTimeout&&t.setTimeout,ft=_e.ceil,pt=_e.floor,Mt=Se.getOwnPropertySymbols,Vt=Be?Be.isBuffer:r,ur=t.isFinite,hr=Ie.join,fr=nr(Se.keys,Se),pr=_e.max,gr=_e.min,mr=we.now,vr=t.parseInt,yr=_e.random,br=Ie.reverse,wr=so(t,"DataView"),xr=so(t,"Map"),Cr=so(t,"Promise"),_r=so(t,"Set"),Sr=so(t,"WeakMap"),Ar=so(Se,"create"),kr=Sr&&new Sr,Er={},Ir=Mo(wr),jr=Mo(xr),Tr=Mo(Cr),Fr=Mo(_r),Or=Mo(Sr),Pr=Ue?Ue.prototype:r,Mr=Pr?Pr.valueOf:r,Rr=Pr?Pr.toString:r;function Lr(e){if(Za(e)&&!Ba(e)&&!(e instanceof Br)){if(e instanceof zr)return e;if(Pe.call(e,"__wrapped__"))return Ro(e)}return new zr(e)}var Nr=function(){function e(){}return function(t){if(!Ka(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Dr(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Br(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Ur(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function $r(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Hr;++t<r;)this.add(e[t])}function Wr(e){var t=this.__data__=new Vr(e);this.size=t.size}function Gr(e,t){var r=Ba(e),n=!r&&za(e),i=!r&&!n&&$a(e),o=!r&&!n&&!i&&os(e),a=r||n||i||o,s=a?Wt(e.length,ke):[],l=s.length;for(var c in e)!t&&!Pe.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||go(c,l))||s.push(c);return s}function qr(e){var t=e.length;return t?e[$n(0,t-1)]:r}function Yr(e,t){return Fo(Ai(e),nn(t,0,e.length))}function Xr(e){return Fo(Ai(e))}function Kr(e,t,n){(n!==r&&!La(e[t],n)||n===r&&!(t in e))&&tn(e,t,n)}function Zr(e,t,n){var i=e[t];Pe.call(e,t)&&La(i,n)&&(n!==r||t in e)||tn(e,t,n)}function Jr(e,t){for(var r=e.length;r--;)if(La(e[r][0],t))return r;return-1}function Qr(e,t,r,n){return cn(e,function(e,i,o){t(n,e,r(e),o)}),n}function en(e,t){return e&&ki(t,Es(t),e)}function tn(e,t,r){"__proto__"==t&&st?st(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function rn(e,t){for(var n=-1,i=t.length,o=be(i),a=null==e;++n<i;)o[n]=a?r:Cs(e,t[n]);return o}function nn(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function on(e,t,n,i,o,a){var s,l=1&t,c=2&t,u=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!Ka(e))return e;var d=Ba(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Pe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Ai(e,s)}else{var h=uo(e),p=h==y||h==b;if($a(e))return bi(e,l);if(h==C||h==f||p&&!o){if(s=c||p?{}:fo(e),!l)return c?function(e,t){return ki(e,co(e),t)}(e,function(e,t){return e&&ki(t,Is(t),e)}(s,e)):function(e,t){return ki(e,lo(e),t)}(e,en(s,e))}else{if(!nt[h])return o?e:{};s=function(e,t,r){var n,i=e.constructor;switch(t){case j:return wi(e);case g:case m:return new i(+e);case T:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case F:case O:case P:case M:case R:case L:case N:case D:case z:return xi(e,r);case w:return new i;case x:case k:return new i(e);case S:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new i;case E:return n=e,Mr?Se(Mr.call(n)):{}}}(e,h,l)}}a||(a=new Wr);var v=a.get(e);if(v)return v;a.set(e,s),rs(e)?e.forEach(function(r){s.add(on(r,t,n,r,e,a))}):Ja(e)&&e.forEach(function(r,i){s.set(i,on(r,t,n,i,e,a))});var _=d?r:(u?c?eo:Qi:c?Is:Es)(e);return _t(_||e,function(r,i){_&&(r=e[i=r]),Zr(s,i,on(r,t,n,i,e,a))}),s}function an(e,t,n){var i=n.length;if(null==e)return!i;for(e=Se(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function sn(e,t,i){if("function"!=typeof e)throw new Ee(n);return Eo(function(){e.apply(r,i)},t)}function ln(e,t,r,n){var i=-1,o=Et,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=jt(t,qt(r))),n?(o=It,a=!1):t.length>=200&&(o=Xt,a=!1,t=new $r(t));e:for(;++i<s;){var u=e[i],d=null==r?u:r(u);if(u=n||0!==u?u:0,a&&d==d){for(var h=c;h--;)if(t[h]===d)continue e;l.push(u)}else o(t,d,n)||l.push(u)}return l}Lr.templateSettings={escape:q,evaluate:Y,interpolate:X,variable:"",imports:{_:Lr}},Lr.prototype=Dr.prototype,Lr.prototype.constructor=Lr,zr.prototype=Nr(Dr.prototype),zr.prototype.constructor=zr,Br.prototype=Nr(Dr.prototype),Br.prototype.constructor=Br,Ur.prototype.clear=function(){this.__data__=Ar?Ar(null):{},this.size=0},Ur.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ur.prototype.get=function(e){var t=this.__data__;if(Ar){var n=t[e];return n===i?r:n}return Pe.call(t,e)?t[e]:r},Ur.prototype.has=function(e){var t=this.__data__;return Ar?t[e]!==r:Pe.call(t,e)},Ur.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ar&&t===r?i:t,this},Vr.prototype.clear=function(){this.__data__=[],this.size=0},Vr.prototype.delete=function(e){var t=this.__data__,r=Jr(t,e);return!(r<0||(r==t.length-1?t.pop():qe.call(t,r,1),--this.size,0))},Vr.prototype.get=function(e){var t=this.__data__,n=Jr(t,e);return n<0?r:t[n][1]},Vr.prototype.has=function(e){return Jr(this.__data__,e)>-1},Vr.prototype.set=function(e,t){var r=this.__data__,n=Jr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Hr.prototype.clear=function(){this.size=0,this.__data__={hash:new Ur,map:new(xr||Vr),string:new Ur}},Hr.prototype.delete=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},Hr.prototype.get=function(e){return oo(this,e).get(e)},Hr.prototype.has=function(e){return oo(this,e).has(e)},Hr.prototype.set=function(e,t){var r=oo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},$r.prototype.add=$r.prototype.push=function(e){return this.__data__.set(e,i),this},$r.prototype.has=function(e){return this.__data__.has(e)},Wr.prototype.clear=function(){this.__data__=new Vr,this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Wr.prototype.get=function(e){return this.__data__.get(e)},Wr.prototype.has=function(e){return this.__data__.has(e)},Wr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Vr){var n=r.__data__;if(!xr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Hr(n)}return r.set(e,t),this.size=r.size,this};var cn=ji(vn),un=ji(yn,!0);function dn(e,t){var r=!0;return cn(e,function(e,n,i){return r=!!t(e,n,i)}),r}function hn(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(l===r?s==s&&!is(s):n(s,l)))var l=s,c=a}return c}function fn(e,t){var r=[];return cn(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function pn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=po),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?pn(s,t-1,r,n,i):Tt(i,s):n||(i[i.length]=s)}return i}var gn=Ti(),mn=Ti(!0);function vn(e,t){return e&&gn(e,t,Es)}function yn(e,t){return e&&mn(e,t,Es)}function bn(e,t){return kt(t,function(t){return qa(e[t])})}function wn(e,t){for(var n=0,i=(t=gi(t,e)).length;null!=e&&n<i;)e=e[Po(t[n++])];return n&&n==i?e:r}function xn(e,t,r){var n=t(e);return Ba(e)?n:Tt(n,r(e))}function Cn(e){return null==e?e===r?"[object Undefined]":"[object Null]":it&&it in Se(e)?function(e){var t=Pe.call(e,it),n=e[it];try{e[it]=r;var i=!0}catch(e){}var o=Le.call(e);return i&&(t?e[it]=n:delete e[it]),o}(e):function(e){return Le.call(e)}(e)}function _n(e,t){return e>t}function Sn(e,t){return null!=e&&Pe.call(e,t)}function An(e,t){return null!=e&&t in Se(e)}function kn(e,t,n){for(var i=n?It:Et,o=e[0].length,a=e.length,s=a,l=be(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=jt(d,qt(t))),c=gr(d.length,c),l[s]=!n&&(t||o>=120&&d.length>=120)?new $r(s&&d):r}d=e[0];var h=-1,f=l[0];e:for(;++h<o&&u.length<c;){var p=d[h],g=t?t(p):p;if(p=n||0!==p?p:0,!(f?Xt(f,g):i(u,g,n))){for(s=a;--s;){var m=l[s];if(!(m?Xt(m,g):i(e[s],g,n)))continue e}f&&f.push(g),u.push(p)}}return u}function En(e,t,n){var i=null==(e=So(e,t=gi(t,e)))?e:e[Po(Go(t))];return null==i?r:xt(i,e,n)}function In(e){return Za(e)&&Cn(e)==f}function jn(e,t,n,i,o){return e===t||(null==e||null==t||!Za(e)&&!Za(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=Ba(e),l=Ba(t),c=s?p:uo(e),u=l?p:uo(t),d=(c=c==f?C:c)==C,h=(u=u==f?C:u)==C,y=c==u;if(y&&$a(e)){if(!$a(t))return!1;s=!0,d=!1}if(y&&!d)return a||(a=new Wr),s||os(e)?Zi(e,t,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case g:case m:case x:return La(+e,+t);case v:return e.name==t.name&&e.message==t.message;case S:case k:return e==t+"";case w:var s=rr;case A:var l=1&n;if(s||(s=or),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var u=Zi(s(e),s(t),n,i,o,a);return a.delete(e),u;case E:if(Mr)return Mr.call(e)==Mr.call(t)}return!1}(e,t,c,n,i,o,a);if(!(1&n)){var b=d&&Pe.call(e,"__wrapped__"),_=h&&Pe.call(t,"__wrapped__");if(b||_){var I=b?e.value():e,F=_?t.value():t;return a||(a=new Wr),o(I,F,n,i,a)}}return!!y&&(a||(a=new Wr),function(e,t,n,i,o,a){var s=1&n,l=Qi(e),c=l.length;if(c!=Qi(t).length&&!s)return!1;for(var u=c;u--;){var d=l[u];if(!(s?d in t:Pe.call(t,d)))return!1}var h=a.get(e),f=a.get(t);if(h&&f)return h==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var g=s;++u<c;){var m=e[d=l[u]],v=t[d];if(i)var y=s?i(v,m,d,t,e,a):i(m,v,d,e,t,a);if(!(y===r?m===v||o(m,v,n,i,a):y)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(p=!1)}return a.delete(e),a.delete(t),p}(e,t,n,i,o,a))}(e,t,n,i,jn,o))}function Tn(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=Se(e);o--;){var l=n[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=n[o])[0],u=e[c],d=l[1];if(s&&l[2]){if(u===r&&!(c in e))return!1}else{var h=new Wr;if(i)var f=i(u,d,c,e,t,h);if(!(f===r?jn(d,u,3,i,h):f))return!1}}return!0}function Fn(e){return!(!Ka(e)||(t=e,Re&&Re in t))&&(qa(e)?ze:fe).test(Mo(e));var t}function On(e){return"function"==typeof e?e:null==e?Qs:"object"==typeof e?Ba(e)?Nn(e[0],e[1]):Ln(e):ll(e)}function Pn(e){if(!wo(e))return fr(e);var t=[];for(var r in Se(e))Pe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Mn(e,t){return e<t}function Rn(e,t){var r=-1,n=Va(e)?be(e.length):[];return cn(e,function(e,i,o){n[++r]=t(e,i,o)}),n}function Ln(e){var t=ao(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(r){return r===e||Tn(r,e,t)}}function Nn(e,t){return vo(e)&&xo(t)?Co(Po(e),t):function(n){var i=Cs(n,e);return i===r&&i===t?_s(n,e):jn(t,i,3)}}function Dn(e,t,n,i,o){e!==t&&gn(t,function(a,s){if(o||(o=new Wr),Ka(a))!function(e,t,n,i,o,a,s){var l=Ao(e,n),c=Ao(t,n),u=s.get(c);if(u)Kr(e,n,u);else{var d=a?a(l,c,n+"",e,t,s):r,h=d===r;if(h){var f=Ba(c),p=!f&&$a(c),g=!f&&!p&&os(c);d=c,f||p||g?Ba(l)?d=l:Ha(l)?d=Ai(l):p?(h=!1,d=bi(c,!0)):g?(h=!1,d=xi(c,!0)):d=[]:es(c)||za(c)?(d=l,za(l)?d=fs(l):Ka(l)&&!qa(l)||(d=fo(c))):h=!1}h&&(s.set(c,d),o(d,c,i,a,s),s.delete(c)),Kr(e,n,d)}}(e,t,s,n,Dn,i,o);else{var l=i?i(Ao(e,s),a,s+"",e,t,o):r;l===r&&(l=a),Kr(e,s,l)}},Is)}function zn(e,t){var n=e.length;if(n)return go(t+=t<0?n:0,n)?e[t]:r}function Bn(e,t,r){t=t.length?jt(t,function(e){return Ba(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e}):[Qs];var n=-1;t=jt(t,qt(io()));var i=Rn(e,function(e,r,i){var o=jt(t,function(t){return t(e)});return{criteria:o,index:++n,value:e}});return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;++n<a;){var l=Ci(i[n],o[n]);if(l)return n>=s?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)})}function Un(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=wn(e,a);r(s,a)&&Xn(o,gi(a,e),s)}return o}function Vn(e,t,r,n){var i=n?Dt:Nt,o=-1,a=t.length,s=e;for(e===t&&(t=Ai(t)),r&&(s=jt(e,qt(r)));++o<a;)for(var l=0,c=t[o],u=r?r(c):c;(l=i(s,u,l,n))>-1;)s!==e&&qe.call(s,l,1),qe.call(e,l,1);return e}function Hn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;go(i)?qe.call(e,i,1):si(e,i)}}return e}function $n(e,t){return e+pt(yr()*(t-e+1))}function Wn(e,t){var r="";if(!e||t<1||t>c)return r;do{t%2&&(r+=e),(t=pt(t/2))&&(e+=e)}while(t);return r}function Gn(e,t){return Io(_o(e,t,Qs),e+"")}function qn(e){return qr(Ls(e))}function Yn(e,t){var r=Ls(e);return Fo(r,nn(t,0,r.length))}function Xn(e,t,n,i){if(!Ka(e))return e;for(var o=-1,a=(t=gi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Po(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var d=l[c];(u=i?i(d,c,l):r)===r&&(u=Ka(d)?d:go(t[o+1])?[]:{})}Zr(l,c,u),l=l[c]}return e}var Kn=kr?function(e,t){return kr.set(e,t),e}:Qs,Zn=st?function(e,t){return st(e,"toString",{configurable:!0,enumerable:!1,value:Ks(t),writable:!0})}:Qs;function Jn(e){return Fo(Ls(e))}function Qn(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=be(i);++n<i;)o[n]=e[n+t];return o}function ei(e,t){var r;return cn(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function ti(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!is(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return ri(e,t,Qs,r)}function ri(e,t,n,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,c=is(t),u=t===r;o<a;){var d=pt((o+a)/2),h=n(e[d]),f=h!==r,p=null===h,g=h==h,m=is(h);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?h<=t:h<t);v?o=d+1:a=d}return gr(a,4294967294)}function ni(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!La(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function ii(e){return"number"==typeof e?e:is(e)?u:+e}function oi(e){if("string"==typeof e)return e;if(Ba(e))return jt(e,oi)+"";if(is(e))return Rr?Rr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,r){var n=-1,i=Et,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=It;else if(o>=200){var c=t?null:Wi(e);if(c)return or(c);a=!1,i=Xt,l=new $r}else l=t?[]:s;e:for(;++n<o;){var u=e[n],d=t?t(u):u;if(u=r||0!==u?u:0,a&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),s.push(u)}else i(l,d,r)||(l!==s&&l.push(d),s.push(u))}return s}function si(e,t){return null==(e=So(e,t=gi(t,e)))||delete e[Po(Go(t))]}function li(e,t,r,n){return Xn(e,t,r(wn(e,t)),n)}function ci(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?Qn(e,n?0:o,n?o+1:i):Qn(e,n?o+1:0,n?i:o)}function ui(e,t){var r=e;return r instanceof Br&&(r=r.value()),Ft(t,function(e,t){return t.func.apply(t.thisArg,Tt([e],t.args))},r)}function di(e,t,r){var n=e.length;if(n<2)return n?ai(e[0]):[];for(var i=-1,o=be(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=ln(o[i]||a,e[s],t,r));return ai(pn(o,1),t,r)}function hi(e,t,n){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var l=i<a?t[i]:r;n(s,e[i],l)}return s}function fi(e){return Ha(e)?e:[]}function pi(e){return"function"==typeof e?e:Qs}function gi(e,t){return Ba(e)?e:vo(e,t)?[e]:Oo(ps(e))}var mi=Gn;function vi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:Qn(e,t,n)}var yi=lt||function(e){return ct.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var r=e.length,n=He?He(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function xi(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=is(e),s=t!==r,l=null===t,c=t==t,u=is(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&n&&o&&!i&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}function _i(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,l=t.length,c=pr(o-a,0),u=be(l+c),d=!n;++s<l;)u[s]=t[s];for(;++i<a;)(d||i<o)&&(u[r[i]]=e[i]);for(;c--;)u[s++]=e[i++];return u}function Si(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,l=-1,c=t.length,u=pr(o-s,0),d=be(u+c),h=!n;++i<u;)d[i]=e[i];for(var f=i;++l<c;)d[f+l]=t[l];for(;++a<s;)(h||i<o)&&(d[f+r[a]]=e[i++]);return d}function Ai(e,t){var r=-1,n=e.length;for(t||(t=be(n));++r<n;)t[r]=e[r];return t}function ki(e,t,n,i){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=i?i(n[l],e[l],l,n,e):r;c===r&&(c=e[l]),o?tn(n,l,c):Zr(n,l,c)}return n}function Ei(e,t){return function(r,n){var i=Ba(r)?Ct:Qr,o=t?t():{};return i(r,e,io(n,2),o)}}function Ii(e){return Gn(function(t,n){var i=-1,o=n.length,a=o>1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&mo(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=Se(t);++i<o;){var l=n[i];l&&e(t,l,i,a)}return t})}function ji(e,t){return function(r,n){if(null==r)return r;if(!Va(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Se(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Ti(e){return function(t,r,n){for(var i=-1,o=Se(t),a=n(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===r(o[l],l,o))break}return t}}function Fi(e){return function(t){var n=tr(t=ps(t))?sr(t):r,i=n?n[0]:t.charAt(0),o=n?vi(n,1).join(""):t.slice(1);return i[e]()+o}}function Oi(e){return function(t){return Ft(qs(zs(t).replace(Ye,"")),e,"")}}function Pi(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 r=Nr(e.prototype),n=e.apply(r,t);return Ka(n)?n:r}}function Mi(e){return function(t,n,i){var o=Se(t);if(!Va(t)){var a=io(n,3);t=Es(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,i);return s>-1?o[a?t[s]:s]:r}}function Ri(e){return Ji(function(t){var i=t.length,o=i,a=zr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ee(n);if(a&&!l&&"wrapper"==ro(s))var l=new zr([],!0)}for(o=l?o:i;++o<i;){var c=ro(s=t[o]),u="wrapper"==c?to(s):r;l=u&&yo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ro(u[0])].apply(l,u[3]):1==s.length&&yo(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ba(r))return l.plant(r).value();for(var n=0,o=i?t[n].apply(this,e):r;++n<i;)o=t[n].call(this,o);return o}})}function Li(e,t,n,i,o,a,l,c,u,d){var h=t&s,f=1&t,p=2&t,g=24&t,m=512&t,v=p?r:Pi(e);return function s(){for(var y=arguments.length,b=be(y),w=y;w--;)b[w]=arguments[w];if(g)var x=no(s),C=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,x);if(i&&(b=_i(b,i,o,g)),a&&(b=Si(b,a,l,g)),y-=C,g&&y<d){var _=ir(b,x);return Hi(e,t,Li,s.placeholder,n,b,_,c,u,d-y)}var S=f?n:this,A=p?S[e]:e;return y=b.length,c?b=function(e,t){for(var n=e.length,i=gr(t.length,n),o=Ai(e);i--;){var a=t[i];e[i]=go(a,n)?o[a]:r}return e}(b,c):m&&y>1&&b.reverse(),h&&u<y&&(b.length=u),this&&this!==ct&&this instanceof s&&(A=v||Pi(A)),A.apply(S,b)}}function Ni(e,t){return function(r,n){return function(e,t,r,n){return vn(e,function(e,i,o){t(n,r(e),i,o)}),n}(r,e,t(n),{})}}function Di(e,t){return function(n,i){var o;if(n===r&&i===r)return t;if(n!==r&&(o=n),i!==r){if(o===r)return i;"string"==typeof n||"string"==typeof i?(n=oi(n),i=oi(i)):(n=ii(n),i=ii(i)),o=e(n,i)}return o}}function zi(e){return Ji(function(t){return t=jt(t,qt(io())),Gn(function(r){var n=this;return e(t,function(e){return xt(e,n,r)})})})}function Bi(e,t){var n=(t=t===r?" ":oi(t)).length;if(n<2)return n?Wn(t,e):t;var i=Wn(t,ft(e/ar(t)));return tr(t)?vi(sr(i),0,e).join(""):i.slice(0,e)}function Ui(e){return function(t,n,i){return i&&"number"!=typeof i&&mo(t,n,i)&&(n=i=r),t=cs(t),n===r?(n=t,t=0):n=cs(n),function(e,t,r,n){for(var i=-1,o=pr(ft((t-e)/(r||1)),0),a=be(o);o--;)a[n?o:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:cs(i),e)}}function Vi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=hs(t),r=hs(r)),e(t,r)}}function Hi(e,t,n,i,o,s,l,c,u,d){var h=8&t;t|=h?a:64,4&(t&=~(h?64:a))||(t&=-4);var f=[e,t,o,h?s:r,h?l:r,h?r:s,h?r:l,c,u,d],p=n.apply(r,f);return yo(e)&&ko(p,f),p.placeholder=i,jo(p,e,t)}function $i(e){var t=_e[e];return function(e,r){if(e=hs(e),(r=null==r?0:gr(us(r),292))&&ur(e)){var n=(ps(e)+"e").split("e");return+((n=(ps(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Wi=_r&&1/or(new _r([,-0]))[1]==l?function(e){return new _r(e)}:il;function Gi(e){return function(t){var r=uo(t);return r==w?rr(t):r==A?function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}(t):function(e,t){return jt(t,function(t){return[t,e[t]]})}(t,e(t))}}function qi(e,t,i,l,c,u,d,h){var f=2&t;if(!f&&"function"!=typeof e)throw new Ee(n);var p=l?l.length:0;if(p||(t&=-97,l=c=r),d=d===r?d:pr(us(d),0),h=h===r?h:us(h),p-=c?c.length:0,64&t){var g=l,m=c;l=c=r}var v=f?r:to(e),y=[e,t,i,l,c,g,m,u,d,h];if(v&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,l=n==s&&8==r||n==s&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!l)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var u=e[3];e[3]=u?_i(u,c,t[4]):c,e[4]=u?ir(e[3],o):t[4]}(c=t[5])&&(u=e[5],e[5]=u?Si(u,c,t[6]):c,e[6]=u?ir(e[5],o):t[6]),(c=t[7])&&(e[7]=c),n&s&&(e[8]=null==e[8]?t[8]:gr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(y,v),e=y[0],t=y[1],i=y[2],l=y[3],c=y[4],!(h=y[9]=y[9]===r?f?0:e.length:pr(y[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,n){var i=Pi(e);return function o(){for(var a=arguments.length,s=be(a),l=a,c=no(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:ir(s,c);return(a-=u.length)<n?Hi(e,t,Li,o.placeholder,r,s,u,r,r,n-a):xt(this&&this!==ct&&this instanceof o?i:e,this,s)}}(e,t,h):t!=a&&33!=t||c.length?Li.apply(r,y):function(e,t,r,n){var i=1&t,o=Pi(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=n.length,u=be(c+s),d=this&&this!==ct&&this instanceof t?o:e;++l<c;)u[l]=n[l];for(;s--;)u[l++]=arguments[++a];return xt(d,i?r:this,u)}}(e,t,i,l);else var b=function(e,t,r){var n=1&t,i=Pi(e);return function t(){return(this&&this!==ct&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return jo((v?Kn:ko)(b,y),e,t)}function Yi(e,t,n,i){return e===r||La(e,Te[n])&&!Pe.call(i,n)?t:e}function Xi(e,t,n,i,o,a){return Ka(e)&&Ka(t)&&(a.set(t,e),Dn(e,t,r,Xi,a),a.delete(t)),e}function Ki(e){return es(e)?r:e}function Zi(e,t,n,i,o,a){var s=1&n,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&n?new $r:r;for(a.set(e,t),a.set(t,e);++h<l;){var g=e[h],m=t[h];if(i)var v=s?i(m,g,h,t,e,a):i(g,m,h,e,t,a);if(v!==r){if(v)continue;f=!1;break}if(p){if(!Pt(t,function(e,t){if(!Xt(p,t)&&(g===e||o(g,e,n,i,a)))return p.push(t)})){f=!1;break}}else if(g!==m&&!o(g,m,n,i,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function Ji(e){return Io(_o(e,r,Uo),e+"")}function Qi(e){return xn(e,Es,lo)}function eo(e){return xn(e,Is,co)}var to=kr?function(e){return kr.get(e)}:il;function ro(e){for(var t=e.name+"",r=Er[t],n=Pe.call(Er,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function no(e){return(Pe.call(Lr,"placeholder")?Lr:e).placeholder}function io(){var e=Lr.iteratee||el;return e=e===el?On:e,arguments.length?e(arguments[0],arguments[1]):e}function oo(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Es(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,xo(i)]}return t}function so(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Fn(n)?n:r}var lo=Mt?function(e){return null==e?[]:(e=Se(e),kt(Mt(e),function(t){return Ge.call(e,t)}))}:dl,co=Mt?function(e){for(var t=[];e;)Tt(t,lo(e)),e=$e(e);return t}:dl,uo=Cn;function ho(e,t,r){for(var n=-1,i=(t=gi(t,e)).length,o=!1;++n<i;){var a=Po(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Xa(i)&&go(a,i)&&(Ba(e)||za(e))}function fo(e){return"function"!=typeof e.constructor||wo(e)?{}:Nr($e(e))}function po(e){return Ba(e)||za(e)||!!(Ke&&e&&e[Ke])}function go(e,t){var r=typeof e;return!!(t=null==t?c:t)&&("number"==r||"symbol"!=r&&ge.test(e))&&e>-1&&e%1==0&&e<t}function mo(e,t,r){if(!Ka(r))return!1;var n=typeof t;return!!("number"==n?Va(r)&&go(t,r.length):"string"==n&&t in r)&&La(r[t],e)}function vo(e,t){if(Ba(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!is(e))||Z.test(e)||!K.test(e)||null!=t&&e in Se(t)}function yo(e){var t=ro(e),r=Lr[t];if("function"!=typeof r||!(t in Br.prototype))return!1;if(e===r)return!0;var n=to(r);return!!n&&e===n[0]}(wr&&uo(new wr(new ArrayBuffer(1)))!=T||xr&&uo(new xr)!=w||Cr&&uo(Cr.resolve())!=_||_r&&uo(new _r)!=A||Sr&&uo(new Sr)!=I)&&(uo=function(e){var t=Cn(e),n=t==C?e.constructor:r,i=n?Mo(n):"";if(i)switch(i){case Ir:return T;case jr:return w;case Tr:return _;case Fr:return A;case Or:return I}return t});var bo=Fe?qa:hl;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Te)}function xo(e){return e==e&&!Ka(e)}function Co(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in Se(n))}}function _o(e,t,n){return t=pr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=pr(r.length-t,0),a=be(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=be(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),xt(e,this,s)}}function So(e,t){return t.length<2?e:wn(e,Qn(t,0,-1))}function Ao(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ko=To(Kn),Eo=dt||function(e,t){return ct.setTimeout(e,t)},Io=To(Zn);function jo(e,t,r){var n=t+"";return Io(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ne,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return _t(h,function(r){var n="_."+r[0];t&r[1]&&!Et(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(oe):[]}(n),r)))}function To(e){var t=0,n=0;return function(){var i=mr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Fo(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=$n(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Oo=function(){var e=Ta(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(J,function(e,r,n,i){t.push(n?i.replace(le,"$1"):r||e)}),t},function(e){return 500===t.size&&t.clear(),e}),t=e.cache;return e}();function Po(e){if("string"==typeof e||is(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mo(e){if(null!=e){try{return Oe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof Br)return e.clone();var t=new zr(e.__wrapped__,e.__chain__);return t.__actions__=Ai(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=Gn(function(e,t){return Ha(e)?ln(e,pn(t,1,Ha,!0)):[]}),No=Gn(function(e,t){var n=Go(t);return Ha(n)&&(n=r),Ha(e)?ln(e,pn(t,1,Ha,!0),io(n,2)):[]}),Do=Gn(function(e,t){var n=Go(t);return Ha(n)&&(n=r),Ha(e)?ln(e,pn(t,1,Ha,!0),r,n):[]});function zo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:us(r);return i<0&&(i=pr(n+i,0)),Lt(e,io(t,3),i)}function Bo(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=us(n),o=n<0?pr(i+o,0):gr(o,i-1)),Lt(e,io(t,3),o,!0)}function Uo(e){return null!=e&&e.length?pn(e,1):[]}function Vo(e){return e&&e.length?e[0]:r}var Ho=Gn(function(e){var t=jt(e,fi);return t.length&&t[0]===e[0]?kn(t):[]}),$o=Gn(function(e){var t=Go(e),n=jt(e,fi);return t===Go(n)?t=r:n.pop(),n.length&&n[0]===e[0]?kn(n,io(t,2)):[]}),Wo=Gn(function(e){var t=Go(e),n=jt(e,fi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?kn(n,r,t):[]});function Go(e){var t=null==e?0:e.length;return t?e[t-1]:r}var qo=Gn(Yo);function Yo(e,t){return e&&e.length&&t&&t.length?Vn(e,t):e}var Xo=Ji(function(e,t){var r=null==e?0:e.length,n=rn(e,t);return Hn(e,jt(t,function(e){return go(e,r)?+e:e}).sort(Ci)),n});function Ko(e){return null==e?e:br.call(e)}var Zo=Gn(function(e){return ai(pn(e,1,Ha,!0))}),Jo=Gn(function(e){var t=Go(e);return Ha(t)&&(t=r),ai(pn(e,1,Ha,!0),io(t,2))}),Qo=Gn(function(e){var t=Go(e);return t="function"==typeof t?t:r,ai(pn(e,1,Ha,!0),r,t)});function ea(e){if(!e||!e.length)return[];var t=0;return e=kt(e,function(e){if(Ha(e))return t=pr(e.length,t),!0}),Wt(t,function(t){return jt(e,Ut(t))})}function ta(e,t){if(!e||!e.length)return[];var n=ea(e);return null==t?n:jt(n,function(e){return xt(t,r,e)})}var ra=Gn(function(e,t){return Ha(e)?ln(e,t):[]}),na=Gn(function(e){return di(kt(e,Ha))}),ia=Gn(function(e){var t=Go(e);return Ha(t)&&(t=r),di(kt(e,Ha),io(t,2))}),oa=Gn(function(e){var t=Go(e);return t="function"==typeof t?t:r,di(kt(e,Ha),r,t)}),aa=Gn(ea),sa=Gn(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ta(e,n)});function la(e){var t=Lr(e);return t.__chain__=!0,t}function ca(e,t){return t(e)}var ua=Ji(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return rn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Br&&go(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ca,args:[o],thisArg:r}),new zr(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),da=Ei(function(e,t,r){Pe.call(e,r)?++e[r]:tn(e,r,1)}),ha=Mi(zo),fa=Mi(Bo);function pa(e,t){return(Ba(e)?_t:cn)(e,io(t,3))}function ga(e,t){return(Ba(e)?St:un)(e,io(t,3))}var ma=Ei(function(e,t,r){Pe.call(e,r)?e[r].push(t):tn(e,r,[t])}),va=Gn(function(e,t,r){var n=-1,i="function"==typeof t,o=Va(e)?be(e.length):[];return cn(e,function(e){o[++n]=i?xt(t,e,r):En(e,t,r)}),o}),ya=Ei(function(e,t,r){tn(e,r,t)});function ba(e,t){return(Ba(e)?jt:Rn)(e,io(t,3))}var wa=Ei(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),xa=Gn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&mo(e,t[0],t[1])?t=[]:r>2&&mo(t[0],t[1],t[2])&&(t=[t[0]]),Bn(e,pn(t,1),[])}),Ca=ut||function(){return ct.Date.now()};function _a(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,qi(e,s,r,r,r,r,t)}function Sa(e,t){var i;if("function"!=typeof t)throw new Ee(n);return e=us(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Aa=Gn(function(e,t,r){var n=1;if(r.length){var i=ir(r,no(Aa));n|=a}return qi(e,n,t,r,i)}),ka=Gn(function(e,t,r){var n=3;if(r.length){var i=ir(r,no(ka));n|=a}return qi(t,n,e,r,i)});function Ea(e,t,i){var o,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ee(n);function g(t){var n=o,i=a;return o=a=r,d=t,l=e.apply(i,n)}function m(e){var n=e-u;return u===r||n>=t||n<0||f&&e-d>=s}function v(){var e=Ca();if(m(e))return y(e);c=Eo(v,function(e){var r=t-(e-u);return f?gr(r,s-(e-d)):r}(e))}function y(e){return c=r,p&&o?g(e):(o=a=r,l)}function b(){var e=Ca(),n=m(e);if(o=arguments,a=this,u=e,n){if(c===r)return function(e){return d=e,c=Eo(v,t),h?g(e):l}(u);if(f)return yi(c),c=Eo(v,t),g(u)}return c===r&&(c=Eo(v,t)),l}return t=hs(t)||0,Ka(i)&&(h=!!i.leading,s=(f="maxWait"in i)?pr(hs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),b.cancel=function(){c!==r&&yi(c),d=0,o=u=a=c=r},b.flush=function(){return c===r?l:y(Ca())},b}var Ia=Gn(function(e,t){return sn(e,1,t)}),ja=Gn(function(e,t,r){return sn(e,hs(t)||0,r)});function Ta(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ta.Cache||Hr),r}function Fa(e){if("function"!=typeof e)throw new Ee(n);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)}}Ta.Cache=Hr;var Oa=mi(function(e,t){var r=(t=1==t.length&&Ba(t[0])?jt(t[0],qt(io())):jt(pn(t,1),qt(io()))).length;return Gn(function(n){for(var i=-1,o=gr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return xt(e,this,n)})}),Pa=Gn(function(e,t){var n=ir(t,no(Pa));return qi(e,a,r,t,n)}),Ma=Gn(function(e,t){var n=ir(t,no(Ma));return qi(e,64,r,t,n)}),Ra=Ji(function(e,t){return qi(e,256,r,r,r,t)});function La(e,t){return e===t||e!=e&&t!=t}var Na=Vi(_n),Da=Vi(function(e,t){return e>=t}),za=In(function(){return arguments}())?In:function(e){return Za(e)&&Pe.call(e,"callee")&&!Ge.call(e,"callee")},Ba=be.isArray,Ua=gt?qt(gt):function(e){return Za(e)&&Cn(e)==j};function Va(e){return null!=e&&Xa(e.length)&&!qa(e)}function Ha(e){return Za(e)&&Va(e)}var $a=Vt||hl,Wa=mt?qt(mt):function(e){return Za(e)&&Cn(e)==m};function Ga(e){if(!Za(e))return!1;var t=Cn(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!es(e)}function qa(e){if(!Ka(e))return!1;var t=Cn(e);return t==y||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ya(e){return"number"==typeof e&&e==us(e)}function Xa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function Ka(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Za(e){return null!=e&&"object"==typeof e}var Ja=vt?qt(vt):function(e){return Za(e)&&uo(e)==w};function Qa(e){return"number"==typeof e||Za(e)&&Cn(e)==x}function es(e){if(!Za(e)||Cn(e)!=C)return!1;var t=$e(e);if(null===t)return!0;var r=Pe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Oe.call(r)==Ne}var ts=yt?qt(yt):function(e){return Za(e)&&Cn(e)==S},rs=bt?qt(bt):function(e){return Za(e)&&uo(e)==A};function ns(e){return"string"==typeof e||!Ba(e)&&Za(e)&&Cn(e)==k}function is(e){return"symbol"==typeof e||Za(e)&&Cn(e)==E}var os=wt?qt(wt):function(e){return Za(e)&&Xa(e.length)&&!!rt[Cn(e)]},as=Vi(Mn),ss=Vi(function(e,t){return e<=t});function ls(e){if(!e)return[];if(Va(e))return ns(e)?sr(e):Ai(e);if(Je&&e[Je])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Je]());var t=uo(e);return(t==w?rr:t==A?or:Ls)(e)}function cs(e){return e?(e=hs(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function us(e){var t=cs(e),r=t%1;return t==t?r?t-r:t:0}function ds(e){return e?nn(us(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(is(e))return u;if(Ka(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ka(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var r=he.test(e);return r||pe.test(e)?at(e.slice(2),r?2:8):de.test(e)?u:+e}function fs(e){return ki(e,Is(e))}function ps(e){return null==e?"":oi(e)}var gs=Ii(function(e,t){if(wo(t)||Va(t))ki(t,Es(t),e);else for(var r in t)Pe.call(t,r)&&Zr(e,r,t[r])}),ms=Ii(function(e,t){ki(t,Is(t),e)}),vs=Ii(function(e,t,r,n){ki(t,Is(t),e,n)}),ys=Ii(function(e,t,r,n){ki(t,Es(t),e,n)}),bs=Ji(rn),ws=Gn(function(e,t){e=Se(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&mo(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=Is(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===r||La(d,Te[u])&&!Pe.call(e,u))&&(e[u]=a[u])}return e}),xs=Gn(function(e){return e.push(r,Xi),xt(Ts,r,e)});function Cs(e,t,n){var i=null==e?r:wn(e,t);return i===r?n:i}function _s(e,t){return null!=e&&ho(e,t,An)}var Ss=Ni(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),e[t]=r},Ks(Qs)),As=Ni(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),Pe.call(e,t)?e[t].push(r):e[t]=[r]},io),ks=Gn(En);function Es(e){return Va(e)?Gr(e):Pn(e)}function Is(e){return Va(e)?Gr(e,!0):function(e){if(!Ka(e))return function(e){var t=[];if(null!=e)for(var r in Se(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&Pe.call(e,n))&&r.push(n);return r}(e)}var js=Ii(function(e,t,r){Dn(e,t,r)}),Ts=Ii(function(e,t,r,n){Dn(e,t,r,n)}),Fs=Ji(function(e,t){var r={};if(null==e)return r;var n=!1;t=jt(t,function(t){return t=gi(t,e),n||(n=t.length>1),t}),ki(e,eo(e),r),n&&(r=on(r,7,Ki));for(var i=t.length;i--;)si(r,t[i]);return r}),Os=Ji(function(e,t){return null==e?{}:function(e,t){return Un(e,t,function(t,r){return _s(e,r)})}(e,t)});function Ps(e,t){if(null==e)return{};var r=jt(eo(e),function(e){return[e]});return t=io(t),Un(e,r,function(e,r){return t(e,r[0])})}var Ms=Gi(Es),Rs=Gi(Is);function Ls(e){return null==e?[]:Yt(e,Es(e))}var Ns=Oi(function(e,t,r){return t=t.toLowerCase(),e+(r?Ds(t):t)});function Ds(e){return Gs(ps(e).toLowerCase())}function zs(e){return(e=ps(e))&&e.replace(me,Jt).replace(Xe,"")}var Bs=Oi(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Us=Oi(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),Vs=Fi("toLowerCase"),Hs=Oi(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),$s=Oi(function(e,t,r){return e+(r?" ":"")+Gs(t)}),Ws=Oi(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Gs=Fi("toUpperCase");function qs(e,t,n){return e=ps(e),(t=n?r:t)===r?function(e){return Qe.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(ae)||[]}(e):e.match(t)||[]}var Ys=Gn(function(e,t){try{return xt(e,r,t)}catch(e){return Ga(e)?e:new xe(e)}}),Xs=Ji(function(e,t){return _t(t,function(t){t=Po(t),tn(e,t,Aa(e[t],e))}),e});function Ks(e){return function(){return e}}var Zs=Ri(),Js=Ri(!0);function Qs(e){return e}function el(e){return On("function"==typeof e?e:on(e,1))}var tl=Gn(function(e,t){return function(r){return En(r,e,t)}}),rl=Gn(function(e,t){return function(r){return En(e,r,t)}});function nl(e,t,r){var n=Es(t),i=bn(t,n);null!=r||Ka(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=bn(t,Es(t)));var o=!(Ka(r)&&"chain"in r&&!r.chain),a=qa(e);return _t(i,function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ai(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Tt([this.value()],arguments))})}),e}function il(){}var ol=zi(jt),al=zi(At),sl=zi(Pt);function ll(e){return vo(e)?Ut(Po(e)):function(e){return function(t){return wn(t,e)}}(e)}var cl=Ui(),ul=Ui(!0);function dl(){return[]}function hl(){return!1}var fl,pl=Di(function(e,t){return e+t},0),gl=$i("ceil"),ml=Di(function(e,t){return e/t},1),vl=$i("floor"),yl=Di(function(e,t){return e*t},1),bl=$i("round"),wl=Di(function(e,t){return e-t},0);return Lr.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=us(e),function(){if(--e<1)return t.apply(this,arguments)}},Lr.ary=_a,Lr.assign=gs,Lr.assignIn=ms,Lr.assignInWith=vs,Lr.assignWith=ys,Lr.at=bs,Lr.before=Sa,Lr.bind=Aa,Lr.bindAll=Xs,Lr.bindKey=ka,Lr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ba(e)?e:[e]},Lr.chain=la,Lr.chunk=function(e,t,n){t=(n?mo(e,t,n):t===r)?1:pr(us(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=be(ft(i/t));o<i;)s[a++]=Qn(e,o,o+=t);return s},Lr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Lr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=be(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Tt(Ba(r)?Ai(r):[r],pn(t,1))},Lr.cond=function(e){var t=null==e?0:e.length,r=io();return e=t?jt(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[r(e[0]),e[1]]}):[],Gn(function(r){for(var n=-1;++n<t;){var i=e[n];if(xt(i[0],this,r))return xt(i[1],this,r)}})},Lr.conforms=function(e){return function(e){var t=Es(e);return function(r){return an(r,e,t)}}(on(e,1))},Lr.constant=Ks,Lr.countBy=da,Lr.create=function(e,t){var r=Nr(e);return null==t?r:en(r,t)},Lr.curry=function e(t,n,i){var o=qi(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Lr.curryRight=function e(t,n,i){var o=qi(t,16,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Lr.debounce=Ea,Lr.defaults=ws,Lr.defaultsDeep=xs,Lr.defer=Ia,Lr.delay=ja,Lr.difference=Lo,Lr.differenceBy=No,Lr.differenceWith=Do,Lr.drop=function(e,t,n){var i=null==e?0:e.length;return i?Qn(e,(t=n||t===r?1:us(t))<0?0:t,i):[]},Lr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?Qn(e,0,(t=i-(t=n||t===r?1:us(t)))<0?0:t):[]},Lr.dropRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!0,!0):[]},Lr.dropWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!0):[]},Lr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&mo(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=us(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:us(i))<0&&(i+=o),i=n>i?0:ds(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Lr.filter=function(e,t){return(Ba(e)?kt:fn)(e,io(t,3))},Lr.flatMap=function(e,t){return pn(ba(e,t),1)},Lr.flatMapDeep=function(e,t){return pn(ba(e,t),l)},Lr.flatMapDepth=function(e,t,n){return n=n===r?1:us(n),pn(ba(e,t),n)},Lr.flatten=Uo,Lr.flattenDeep=function(e){return null!=e&&e.length?pn(e,l):[]},Lr.flattenDepth=function(e,t){return null!=e&&e.length?pn(e,t=t===r?1:us(t)):[]},Lr.flip=function(e){return qi(e,512)},Lr.flow=Zs,Lr.flowRight=Js,Lr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Lr.functions=function(e){return null==e?[]:bn(e,Es(e))},Lr.functionsIn=function(e){return null==e?[]:bn(e,Is(e))},Lr.groupBy=ma,Lr.initial=function(e){return null!=e&&e.length?Qn(e,0,-1):[]},Lr.intersection=Ho,Lr.intersectionBy=$o,Lr.intersectionWith=Wo,Lr.invert=Ss,Lr.invertBy=As,Lr.invokeMap=va,Lr.iteratee=el,Lr.keyBy=ya,Lr.keys=Es,Lr.keysIn=Is,Lr.map=ba,Lr.mapKeys=function(e,t){var r={};return t=io(t,3),vn(e,function(e,n,i){tn(r,t(e,n,i),e)}),r},Lr.mapValues=function(e,t){var r={};return t=io(t,3),vn(e,function(e,n,i){tn(r,n,t(e,n,i))}),r},Lr.matches=function(e){return Ln(on(e,1))},Lr.matchesProperty=function(e,t){return Nn(e,on(t,1))},Lr.memoize=Ta,Lr.merge=js,Lr.mergeWith=Ts,Lr.method=tl,Lr.methodOf=rl,Lr.mixin=nl,Lr.negate=Fa,Lr.nthArg=function(e){return e=us(e),Gn(function(t){return zn(t,e)})},Lr.omit=Fs,Lr.omitBy=function(e,t){return Ps(e,Fa(io(t)))},Lr.once=function(e){return Sa(2,e)},Lr.orderBy=function(e,t,n,i){return null==e?[]:(Ba(t)||(t=null==t?[]:[t]),Ba(n=i?r:n)||(n=null==n?[]:[n]),Bn(e,t,n))},Lr.over=ol,Lr.overArgs=Oa,Lr.overEvery=al,Lr.overSome=sl,Lr.partial=Pa,Lr.partialRight=Ma,Lr.partition=wa,Lr.pick=Os,Lr.pickBy=Ps,Lr.property=ll,Lr.propertyOf=function(e){return function(t){return null==e?r:wn(e,t)}},Lr.pull=qo,Lr.pullAll=Yo,Lr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Vn(e,t,io(r,2)):e},Lr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Vn(e,t,r,n):e},Lr.pullAt=Xo,Lr.range=cl,Lr.rangeRight=ul,Lr.rearg=Ra,Lr.reject=function(e,t){return(Ba(e)?kt:fn)(e,Fa(io(t,3)))},Lr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=io(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Hn(e,i),r},Lr.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Gn(e,t=t===r?t:us(t))},Lr.reverse=Ko,Lr.sampleSize=function(e,t,n){return t=(n?mo(e,t,n):t===r)?1:us(t),(Ba(e)?Yr:Yn)(e,t)},Lr.set=function(e,t,r){return null==e?e:Xn(e,t,r)},Lr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Xn(e,t,n,i)},Lr.shuffle=function(e){return(Ba(e)?Xr:Jn)(e)},Lr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&mo(e,t,n)?(t=0,n=i):(t=null==t?0:us(t),n=n===r?i:us(n)),Qn(e,t,n)):[]},Lr.sortBy=xa,Lr.sortedUniq=function(e){return e&&e.length?ni(e):[]},Lr.sortedUniqBy=function(e,t){return e&&e.length?ni(e,io(t,2)):[]},Lr.split=function(e,t,n){return n&&"number"!=typeof n&&mo(e,t,n)&&(t=n=r),(n=n===r?d:n>>>0)?(e=ps(e))&&("string"==typeof t||null!=t&&!ts(t))&&!(t=oi(t))&&tr(e)?vi(sr(e),0,n):e.split(t,n):[]},Lr.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:pr(us(t),0),Gn(function(r){var n=r[t],i=vi(r,0,t);return n&&Tt(i,n),xt(e,this,i)})},Lr.tail=function(e){var t=null==e?0:e.length;return t?Qn(e,1,t):[]},Lr.take=function(e,t,n){return e&&e.length?Qn(e,0,(t=n||t===r?1:us(t))<0?0:t):[]},Lr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?Qn(e,(t=i-(t=n||t===r?1:us(t)))<0?0:t,i):[]},Lr.takeRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!1,!0):[]},Lr.takeWhile=function(e,t){return e&&e.length?ci(e,io(t,3)):[]},Lr.tap=function(e,t){return t(e),e},Lr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return Ka(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Ea(e,t,{leading:i,maxWait:t,trailing:o})},Lr.thru=ca,Lr.toArray=ls,Lr.toPairs=Ms,Lr.toPairsIn=Rs,Lr.toPath=function(e){return Ba(e)?jt(e,Po):is(e)?[e]:Ai(Oo(ps(e)))},Lr.toPlainObject=fs,Lr.transform=function(e,t,r){var n=Ba(e),i=n||$a(e)||os(e);if(t=io(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Ka(e)&&qa(o)?Nr($e(e)):{}}return(i?_t:vn)(e,function(e,n,i){return t(r,e,n,i)}),r},Lr.unary=function(e){return _a(e,1)},Lr.union=Zo,Lr.unionBy=Jo,Lr.unionWith=Qo,Lr.uniq=function(e){return e&&e.length?ai(e):[]},Lr.uniqBy=function(e,t){return e&&e.length?ai(e,io(t,2)):[]},Lr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ai(e,r,t):[]},Lr.unset=function(e,t){return null==e||si(e,t)},Lr.unzip=ea,Lr.unzipWith=ta,Lr.update=function(e,t,r){return null==e?e:li(e,t,pi(r))},Lr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:li(e,t,pi(n),i)},Lr.values=Ls,Lr.valuesIn=function(e){return null==e?[]:Yt(e,Is(e))},Lr.without=ra,Lr.words=qs,Lr.wrap=function(e,t){return Pa(pi(t),e)},Lr.xor=na,Lr.xorBy=ia,Lr.xorWith=oa,Lr.zip=aa,Lr.zipObject=function(e,t){return hi(e||[],t||[],Zr)},Lr.zipObjectDeep=function(e,t){return hi(e||[],t||[],Xn)},Lr.zipWith=sa,Lr.entries=Ms,Lr.entriesIn=Rs,Lr.extend=ms,Lr.extendWith=vs,nl(Lr,Lr),Lr.add=pl,Lr.attempt=Ys,Lr.camelCase=Ns,Lr.capitalize=Ds,Lr.ceil=gl,Lr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=hs(n))==n?n:0),t!==r&&(t=(t=hs(t))==t?t:0),nn(hs(e),t,n)},Lr.clone=function(e){return on(e,4)},Lr.cloneDeep=function(e){return on(e,5)},Lr.cloneDeepWith=function(e,t){return on(e,5,t="function"==typeof t?t:r)},Lr.cloneWith=function(e,t){return on(e,4,t="function"==typeof t?t:r)},Lr.conformsTo=function(e,t){return null==t||an(e,t,Es(t))},Lr.deburr=zs,Lr.defaultTo=function(e,t){return null==e||e!=e?t:e},Lr.divide=ml,Lr.endsWith=function(e,t,n){e=ps(e),t=oi(t);var i=e.length,o=n=n===r?i:nn(us(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Lr.eq=La,Lr.escape=function(e){return(e=ps(e))&&G.test(e)?e.replace($,Qt):e},Lr.escapeRegExp=function(e){return(e=ps(e))&&ee.test(e)?e.replace(Q,"\\$&"):e},Lr.every=function(e,t,n){var i=Ba(e)?At:dn;return n&&mo(e,t,n)&&(t=r),i(e,io(t,3))},Lr.find=ha,Lr.findIndex=zo,Lr.findKey=function(e,t){return Rt(e,io(t,3),vn)},Lr.findLast=fa,Lr.findLastIndex=Bo,Lr.findLastKey=function(e,t){return Rt(e,io(t,3),yn)},Lr.floor=vl,Lr.forEach=pa,Lr.forEachRight=ga,Lr.forIn=function(e,t){return null==e?e:gn(e,io(t,3),Is)},Lr.forInRight=function(e,t){return null==e?e:mn(e,io(t,3),Is)},Lr.forOwn=function(e,t){return e&&vn(e,io(t,3))},Lr.forOwnRight=function(e,t){return e&&yn(e,io(t,3))},Lr.get=Cs,Lr.gt=Na,Lr.gte=Da,Lr.has=function(e,t){return null!=e&&ho(e,t,Sn)},Lr.hasIn=_s,Lr.head=Vo,Lr.identity=Qs,Lr.includes=function(e,t,r,n){e=Va(e)?e:Ls(e),r=r&&!n?us(r):0;var i=e.length;return r<0&&(r=pr(i+r,0)),ns(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Nt(e,t,r)>-1},Lr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:us(r);return i<0&&(i=pr(n+i,0)),Nt(e,t,i)},Lr.inRange=function(e,t,n){return t=cs(t),n===r?(n=t,t=0):n=cs(n),function(e,t,r){return e>=gr(t,r)&&e<pr(t,r)}(e=hs(e),t,n)},Lr.invoke=ks,Lr.isArguments=za,Lr.isArray=Ba,Lr.isArrayBuffer=Ua,Lr.isArrayLike=Va,Lr.isArrayLikeObject=Ha,Lr.isBoolean=function(e){return!0===e||!1===e||Za(e)&&Cn(e)==g},Lr.isBuffer=$a,Lr.isDate=Wa,Lr.isElement=function(e){return Za(e)&&1===e.nodeType&&!es(e)},Lr.isEmpty=function(e){if(null==e)return!0;if(Va(e)&&(Ba(e)||"string"==typeof e||"function"==typeof e.splice||$a(e)||os(e)||za(e)))return!e.length;var t=uo(e);if(t==w||t==A)return!e.size;if(wo(e))return!Pn(e).length;for(var r in e)if(Pe.call(e,r))return!1;return!0},Lr.isEqual=function(e,t){return jn(e,t)},Lr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?jn(e,t,r,n):!!i},Lr.isError=Ga,Lr.isFinite=function(e){return"number"==typeof e&&ur(e)},Lr.isFunction=qa,Lr.isInteger=Ya,Lr.isLength=Xa,Lr.isMap=Ja,Lr.isMatch=function(e,t){return e===t||Tn(e,t,ao(t))},Lr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Tn(e,t,ao(t),n)},Lr.isNaN=function(e){return Qa(e)&&e!=+e},Lr.isNative=function(e){if(bo(e))throw new xe("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fn(e)},Lr.isNil=function(e){return null==e},Lr.isNull=function(e){return null===e},Lr.isNumber=Qa,Lr.isObject=Ka,Lr.isObjectLike=Za,Lr.isPlainObject=es,Lr.isRegExp=ts,Lr.isSafeInteger=function(e){return Ya(e)&&e>=-9007199254740991&&e<=c},Lr.isSet=rs,Lr.isString=ns,Lr.isSymbol=is,Lr.isTypedArray=os,Lr.isUndefined=function(e){return e===r},Lr.isWeakMap=function(e){return Za(e)&&uo(e)==I},Lr.isWeakSet=function(e){return Za(e)&&"[object WeakSet]"==Cn(e)},Lr.join=function(e,t){return null==e?"":hr.call(e,t)},Lr.kebabCase=Bs,Lr.last=Go,Lr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=us(n))<0?pr(i+o,0):gr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Lt(e,zt,o,!0)},Lr.lowerCase=Us,Lr.lowerFirst=Vs,Lr.lt=as,Lr.lte=ss,Lr.max=function(e){return e&&e.length?hn(e,Qs,_n):r},Lr.maxBy=function(e,t){return e&&e.length?hn(e,io(t,2),_n):r},Lr.mean=function(e){return Bt(e,Qs)},Lr.meanBy=function(e,t){return Bt(e,io(t,2))},Lr.min=function(e){return e&&e.length?hn(e,Qs,Mn):r},Lr.minBy=function(e,t){return e&&e.length?hn(e,io(t,2),Mn):r},Lr.stubArray=dl,Lr.stubFalse=hl,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=yl,Lr.nth=function(e,t){return e&&e.length?zn(e,us(t)):r},Lr.noConflict=function(){return ct._===this&&(ct._=De),this},Lr.noop=il,Lr.now=Ca,Lr.pad=function(e,t,r){e=ps(e);var n=(t=us(t))?ar(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Bi(pt(i),r)+e+Bi(ft(i),r)},Lr.padEnd=function(e,t,r){e=ps(e);var n=(t=us(t))?ar(e):0;return t&&n<t?e+Bi(t-n,r):e},Lr.padStart=function(e,t,r){e=ps(e);var n=(t=us(t))?ar(e):0;return t&&n<t?Bi(t-n,r)+e:e},Lr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),vr(ps(e).replace(te,""),t||0)},Lr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&mo(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=cs(e),t===r?(t=e,e=0):t=cs(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=yr();return gr(e+o*(t-e+ot("1e-"+((o+"").length-1))),t)}return $n(e,t)},Lr.reduce=function(e,t,r){var n=Ba(e)?Ft:Ht,i=arguments.length<3;return n(e,io(t,4),r,i,cn)},Lr.reduceRight=function(e,t,r){var n=Ba(e)?Ot:Ht,i=arguments.length<3;return n(e,io(t,4),r,i,un)},Lr.repeat=function(e,t,n){return t=(n?mo(e,t,n):t===r)?1:us(t),Wn(ps(e),t)},Lr.replace=function(){var e=arguments,t=ps(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Lr.result=function(e,t,n){var i=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[Po(t[i])];a===r&&(i=o,a=n),e=qa(a)?a.call(e):a}return e},Lr.round=bl,Lr.runInContext=e,Lr.sample=function(e){return(Ba(e)?qr:qn)(e)},Lr.size=function(e){if(null==e)return 0;if(Va(e))return ns(e)?ar(e):e.length;var t=uo(e);return t==w||t==A?e.size:Pn(e).length},Lr.snakeCase=Hs,Lr.some=function(e,t,n){var i=Ba(e)?Pt:ei;return n&&mo(e,t,n)&&(t=r),i(e,io(t,3))},Lr.sortedIndex=function(e,t){return ti(e,t)},Lr.sortedIndexBy=function(e,t,r){return ri(e,t,io(r,2))},Lr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ti(e,t);if(n<r&&La(e[n],t))return n}return-1},Lr.sortedLastIndex=function(e,t){return ti(e,t,!0)},Lr.sortedLastIndexBy=function(e,t,r){return ri(e,t,io(r,2),!0)},Lr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ti(e,t,!0)-1;if(La(e[r],t))return r}return-1},Lr.startCase=$s,Lr.startsWith=function(e,t,r){return e=ps(e),r=null==r?0:nn(us(r),0,e.length),t=oi(t),e.slice(r,r+t.length)==t},Lr.subtract=wl,Lr.sum=function(e){return e&&e.length?$t(e,Qs):0},Lr.sumBy=function(e,t){return e&&e.length?$t(e,io(t,2)):0},Lr.template=function(e,t,n){var i=Lr.templateSettings;n&&mo(e,t,n)&&(t=r),e=ps(e),t=vs({},t,i,Yi);var o,a,s=vs({},t.imports,i.imports,Yi),l=Es(s),c=Yt(s,l),u=0,d=t.interpolate||ve,h="__p += '",f=Ae((t.escape||ve).source+"|"+d.source+"|"+(d===X?ce:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),p="//# sourceURL="+(Pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tt+"]")+"\n";e.replace(f,function(t,r,n,i,s,l){return n||(n=i),h+=e.slice(u,l).replace(ye,er),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=l+t.length,t}),h+="';\n";var g=Pe.call(t,"variable")&&t.variable;if(g){if(se.test(g))throw new xe("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(B,""):h).replace(U,"$1").replace(V,"$1;"),h="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")+h+"return __p\n}";var m=Ys(function(){return Ce(l,p+"return "+h).apply(r,c)});if(m.source=h,Ga(m))throw m;return m},Lr.times=function(e,t){if((e=us(e))<1||e>c)return[];var r=d,n=gr(e,d);t=io(t),e-=d;for(var i=Wt(n,t);++r<e;)t(r);return i},Lr.toFinite=cs,Lr.toInteger=us,Lr.toLength=ds,Lr.toLower=function(e){return ps(e).toLowerCase()},Lr.toNumber=hs,Lr.toSafeInteger=function(e){return e?nn(us(e),-9007199254740991,c):0===e?e:0},Lr.toString=ps,Lr.toUpper=function(e){return ps(e).toUpperCase()},Lr.trim=function(e,t,n){if((e=ps(e))&&(n||t===r))return Gt(e);if(!e||!(t=oi(t)))return e;var i=sr(e),o=sr(t);return vi(i,Kt(i,o),Zt(i,o)+1).join("")},Lr.trimEnd=function(e,t,n){if((e=ps(e))&&(n||t===r))return e.slice(0,lr(e)+1);if(!e||!(t=oi(t)))return e;var i=sr(e);return vi(i,0,Zt(i,sr(t))+1).join("")},Lr.trimStart=function(e,t,n){if((e=ps(e))&&(n||t===r))return e.replace(te,"");if(!e||!(t=oi(t)))return e;var i=sr(e);return vi(i,Kt(i,sr(t))).join("")},Lr.truncate=function(e,t){var n=30,i="...";if(Ka(t)){var o="separator"in t?t.separator:o;n="length"in t?us(t.length):n,i="omission"in t?oi(t.omission):i}var a=(e=ps(e)).length;if(tr(e)){var s=sr(e);a=s.length}if(n>=a)return e;var l=n-ar(i);if(l<1)return i;var c=s?vi(s,0,l).join(""):e.slice(0,l);if(o===r)return c+i;if(s&&(l+=c.length-l),ts(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Ae(o.source,ps(ue.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var h=u.index;c=c.slice(0,h===r?l:h)}}else if(e.indexOf(oi(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},Lr.unescape=function(e){return(e=ps(e))&&W.test(e)?e.replace(H,cr):e},Lr.uniqueId=function(e){var t=++Me;return ps(e)+t},Lr.upperCase=Ws,Lr.upperFirst=Gs,Lr.each=pa,Lr.eachRight=ga,Lr.first=Vo,nl(Lr,(fl={},vn(Lr,function(e,t){Pe.call(Lr.prototype,t)||(fl[t]=e)}),fl),{chain:!1}),Lr.VERSION="4.17.21",_t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Lr[e].placeholder=Lr}),_t(["drop","take"],function(e,t){Br.prototype[e]=function(n){n=n===r?1:pr(us(n),0);var i=this.__filtered__&&!t?new Br(this):this.clone();return i.__filtered__?i.__takeCount__=gr(n,i.__takeCount__):i.__views__.push({size:gr(n,d),type:e+(i.__dir__<0?"Right":"")}),i},Br.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),_t(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Br.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),_t(["head","last"],function(e,t){var r="take"+(t?"Right":"");Br.prototype[e]=function(){return this[r](1).value()[0]}}),_t(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Br.prototype[e]=function(){return this.__filtered__?new Br(this):this[r](1)}}),Br.prototype.compact=function(){return this.filter(Qs)},Br.prototype.find=function(e){return this.filter(e).head()},Br.prototype.findLast=function(e){return this.reverse().find(e)},Br.prototype.invokeMap=Gn(function(e,t){return"function"==typeof e?new Br(this):this.map(function(r){return En(r,e,t)})}),Br.prototype.reject=function(e){return this.filter(Fa(io(e)))},Br.prototype.slice=function(e,t){e=us(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Br(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=us(t))<0?n.dropRight(-t):n.take(t-e)),n)},Br.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Br.prototype.toArray=function(){return this.take(d)},vn(Br.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Lr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Lr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Br,c=s[0],u=l||Ba(t),d=function(e){var t=o.apply(Lr,Tt([e],s));return i&&h?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new Br(this);var m=e.apply(t,s);return m.__actions__.push({func:ca,args:[d],thisArg:r}),new zr(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ie[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Lr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ba(i)?i:[],e)}return this[r](function(r){return t.apply(Ba(r)?r:[],e)})}}),vn(Br.prototype,function(e,t){var r=Lr[t];if(r){var n=r.name+"";Pe.call(Er,n)||(Er[n]=[]),Er[n].push({name:t,func:r})}}),Er[Li(r,2).name]=[{name:"wrapper",func:r}],Br.prototype.clone=function(){var e=new Br(this.__wrapped__);return e.__actions__=Ai(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ai(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ai(this.__views__),e},Br.prototype.reverse=function(){if(this.__filtered__){var e=new Br(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Br.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ba(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=gr(t,e+a);break;case"takeRight":e=pr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=n?s:a-1,u=this.__iteratees__,d=u.length,h=0,f=gr(l,this.__takeCount__);if(!r||!n&&i==l&&f==l)return ui(e,this.__actions__);var p=[];e:for(;l--&&h<f;){for(var g=-1,m=e[c+=t];++g<d;){var v=u[g],y=v.iteratee,b=v.type,w=y(m);if(2==b)m=w;else if(!w){if(1==b)continue e;break e}}p[h++]=m}return p},Lr.prototype.at=ua,Lr.prototype.chain=function(){return la(this)},Lr.prototype.commit=function(){return new zr(this.value(),this.__chain__)},Lr.prototype.next=function(){this.__values__===r&&(this.__values__=ls(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Lr.prototype.plant=function(e){for(var t,n=this;n instanceof Dr;){var i=Ro(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Lr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Br){var t=e;return this.__actions__.length&&(t=new Br(this)),(t=t.reverse()).__actions__.push({func:ca,args:[Ko],thisArg:r}),new zr(t,this.__chain__)}return this.thru(Ko)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return ui(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Je&&(Lr.prototype[Je]=function(){return this}),Lr}();dt?((dt.exports=dr)._=dr,ut._=dr):ct._=dr}).call(Jn)}(Zn,Zn.exports)),Zn.exports);const ei=(0,o.createContext)({state:{},actions:{},options:{}}),ti=()=>(0,o.useContext)(ei),ri=({children:e,options:t})=>{var r;const[n,a]=(0,o.useState)([]),[s,l]=(0,o.useState)([]),[c,u]=(0,o.useState)(null),[h,f]=(0,o.useState)(t.searchQuery||""),[p,g]=(0,o.useState)(t.sortBySize||"name"),{config:m}=t,[v,y]=(0,o.useState)("date"),[b,w]=(0,o.useState)("desc"),[x,C]=(0,o.useState)([{id:"folders",name:"\u041f\u0430\u043f\u043a\u0438"}]),[_,S]=(0,o.useState)(new Set),[A,k]=(0,o.useState)("");o.useEffect(()=>{S(new Set)},[]);const E=o.useRef(null);o.useEffect(()=>{if(t.onChangeSelection&&E.current!==_){if(null!==E.current){const e=(Array.isArray(s)?s:[]).filter(e=>_.has(e.id));t.onChangeSelection(e)}E.current=_}},[s,_,t.onChangeSelection,t]);const[I,j]=(0,o.useState)(!1),[T,F]=(0,o.useState)(Lt);(0,o.useEffect)(()=>{(null==m?void 0:m.activeLibraryItem)&&F&&F(null==m?void 0:m.activeLibraryItem)},[null==m?void 0:m.activeLibraryItem,F]);const[O,P]=(0,o.useState)({current:1,pageSize:12,total:0}),[M]=d.A.useForm(),[R]=d.A.useForm(),[L]=d.A.useForm(),[N]=d.A.useForm(),[D]=d.A.useForm(),[z]=d.A.useForm(),[B,U]=(0,o.useState)(!1),[V,H]=(0,o.useState)(!1),[$,W]=(0,o.useState)(!1),[G,q]=(0,o.useState)(!1),[Y,X]=(0,o.useState)(!1),[K,Z]=(0,o.useState)(!1),[J,Q]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(null),[re,ne]=(0,o.useState)(null),[ie,oe]=(0,o.useState)(null),ae=(0,o.useCallback)(e=>{P(t=>Object.assign(Object.assign({},t),e))},[P]),se=(0,o.useCallback)(e=>{S(null!=e?e:new Set)},[S]);(0,o.useEffect)(()=>{se()},[T,se]);const le={folders:n,files:s,selectedFolder:c,searchTerm:h,sortField:p,sortBy:v,sortOrder:b,pathHistory:x,selectedFiles:_,currentMenuFile:A,loading:I,pagination:O,isModalVisible:B,isUrlModalVisible:V,isRenameModalVisible:$,isMoveModalVisible:G,isRenameFolderModalVisible:Y,isCopyModalVisible:K,isDeleteConfirmVisible:J,form:M,urlForm:R,renameForm:L,moveForm:N,renameFolderForm:D,copyForm:z,fileToRename:ee,folderToRename:re,activeLibraryItem:T,multiSelect:null===(r=null==m?void 0:m.multiSelect)||void 0===r||r,undoDeletion:ie},ce={setFolders:a,setFiles:l,setSelectedFolder:u,setSearchTerm:f,setSortField:g,setSortBy:y,setSortOrder:w,setPathHistory:C,setSelectedFiles:se,setLoading:j,setPagination:ae,setIsModalVisible:U,setIsUrlModalVisible:H,setIsRenameModalVisible:W,setIsMoveModalVisible:q,setIsRenameFolderModalVisible:X,setIsCopyModalVisible:Z,setIsDeleteConfirmVisible:Q,setFileToRename:te,setFolderToRename:ne,setUndoDeletion:oe,updatePathHistoryOnFolderRename:(e,t)=>{C(r=>r.map(r=>r.id===e?Object.assign(Object.assign({},r),{name:t}):r))},setActiveLibraryItem:F,setCurrentMenuFile:k},ue={state:le,actions:ce,options:t};return(0,i.jsx)(ei.Provider,{value:ue,children:e})},ni=e=>null===e.parentId||"null"===e.parentId||!e.parentId,ii=e=>{var t,r,n,i;const{state:a,actions:s,options:l}=ti(),{searchTerm:c,sortBy:u,sortOrder:d,selectedFolder:h,pagination:f}=a,{setSearchTerm:p,setSortBy:g,setSortOrder:m,setPagination:v}=s,y=e||s.fetchFiles,b=(0,o.useRef)(null),w=(0,o.useRef)(Qn.debounce(e=>{const t=JSON.stringify(e);b.current!==t&&(b.current=t,null==y||y(e))},150)).current,x=(0,o.useCallback)(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:h||"",search:(null==c?void 0:c.trim())||void 0,page:t?void 0:f.current,limit:t?void 0:f.pageSize,sortBy:u,sortOrder:d,itemType:"all"}},[h,c,f.current,f.pageSize,u,d,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),C=(0,o.useCallback)(e=>{var t,r;if(p&&p(e),v&&v({current:1,pageSize:f.pageSize,total:0}),y){const n={folderId:h||"",search:(null==e?void 0:e.trim())||void 0,page:(null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination)?void 0:1,limit:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:f.pageSize,sortBy:u,sortOrder:d,itemType:"all"};y(n)}},[p,v,f.pageSize,y,h,u,d,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),_=(0,o.useCallback)((e,t)=>{var r,n;null==g||g(e),null==m||m(t),y&&w({folderId:h||"",search:(null==c?void 0:c.trim())||void 0,page:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:f.current,limit:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:f.pageSize,sortBy:e,sortOrder:t,itemType:"all"})},[g,m,w,h,c,f.current,f.pageSize,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),S=(0,o.useCallback)((e,t)=>{var r;(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)||(v&&v({current:e,pageSize:t||f.pageSize,total:f.total}),y&&w({folderId:h||"",search:(null==c?void 0:c.trim())||void 0,page:e,limit:t||f.pageSize,sortBy:u,sortOrder:d,itemType:"all"}))},[v,f.pageSize,f.total,w,h,c,u,d,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return(0,o.useEffect)(()=>{if(y){const e=x();w(Object.assign(Object.assign({},e),{page:1}))}},[h]),(0,o.useEffect)(()=>{y&&w(x())},[]),(0,o.useEffect)(()=>()=>{var e;null===(e=w.cancel)||void 0===e||e.call(w)},[w]),{state:{searchTerm:c||"",sortBy:u||"name",sortOrder:d||"asc"},actions:{setSearchTerm:p||(()=>{}),setSortBy:g||(()=>{}),setSortOrder:m||(()=>{}),handleSearch:C,handleSort:_,handlePaginationChange:S,getCurrentQueryParams:x}}},oi=()=>{var e;const{notification:t}=u.A.useApp(),r=ti(),{options:n}=r,i=(0,o.useCallback)(async e=>{let t;if(n.handleNotify){try{t=await n.handleNotify(e)}catch(e){}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&n.handleError){try{t=await n.handleError(e)}catch(e){}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("success"===e.type&&n.handleSuccess){try{t=await n.handleSuccess(e)}catch(e){}if(t)return!1}return t},[n]),a=(0,o.useCallback)(async function(e,r=!1){var o;try{void 0===e.visibility&&(e.visibility=!r);const a=await i(e);if("object"==typeof a&&(e=a),!1===e.visibility||!1===a||!1===(null===(o=n.config)||void 0===o?void 0:o.showNotifications))return e;const s=t[e.type];"function"==typeof s&&s(e)}catch(e){}return e},[t,i,null===(e=n.config)||void 0===e?void 0:e.showNotifications]);return(0,o.useMemo)(()=>({error:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"error"}),t),success:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"success"}),t),warning:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"warning"}),t),notify:a}),[a])};Object.values({images:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/bmp","image/tiff"],documents:["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],archives:["application/zip","application/x-rar-compressed","application/x-7z-compressed"],videos:["video/mp4","video/avi","video/quicktime","video/x-msvideo"],audio:["audio/mpeg","audio/wav","audio/ogg"]}).flat();const ai=e=>{if(0===e)return"0 Bytes";const t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]},si=e=>{if(!e||e<=0)return"";const t=1048576;return e<t?`${Math.round(e/1024)} Kb`:`${(e/t).toFixed(2)} Mb`},li=e=>{if(null==e)return"";if("number"==typeof e)return si(e);const t=String(e).trim();if(!t)return"";const r=Number(t);return Number.isNaN(r)?t:si(r)},ci=(e,t)=>{const r=t.filter(e=>"string"==typeof e),n=new Set(r.map(e=>e.toLowerCase())),i="string"==typeof e?e:String(null!=e?e:"");if(!n.has(i.toLowerCase()))return i;const o=i.lastIndexOf("."),a=o>0?i.slice(0,o):i,s=o>0?i.slice(o):"";let l,c=1;do{l=`${a}_${c}${s}`,c++}while(n.has(l.toLowerCase()));return l},ui={FileNotFound:"File not found or no longer available.",FileAlreadyExists:"File with this name already exists.",FileInvalidName:"File name is not valid. Allowed characters: {{allowedChars}}",FileAccessDenied:"You don't have permission to access this file.",FileReadError:"Failed to read the file.",FileWriteError:"Failed to write the file.",FileTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",FileTypeNotAllowed:"This file type is not allowed.",FileCorrupted:"The file appears to be corrupted.",FileChecksumMismatch:"File integrity check failed.",FileStorageQuotaExceeded:"Storage quota exceeded. Please free up space.",FileLocked:"File is locked by another process or user.",FileVersionConflict:"File version conflict. Please refresh and try again.",FolderNotFound:"Folder not found or no longer available.",FolderAlreadyExists:"Folder with this name already exists.",FolderInvalidName:"Folder name is not valid. Allowed characters: {{allowedChars}}",FolderAccessDenied:"You don't have permission to access this folder.",FolderReadError:"Failed to read the folder contents.",FolderWriteError:"Failed to write to the folder.",FolderQuotaExceeded:"Folder storage quota exceeded.",FolderNotEmpty:"Folder is not empty.",FolderBackendError:"Server error while processing the folder.",FolderTimeout:"Folder operation took too long.",RenameNotAllowed:"Renaming is not allowed for this item.",MoveNotAllowed:"Moving is not allowed for this item.",CopyNotAllowed:"Copying is not allowed for this item.",DeleteNotAllowed:"Deleting is not allowed for this item.",MoveIntoSelf:"Cannot move an item into itself.",MoveIntoDescendant:"Cannot move an item into its descendant folder.",CopyIntoSelf:"Cannot copy an item into itself.",UnsupportedOperation:"This operation is not supported.",ConfigError:"Configuration error occurred.",FileUploadQuotaExceeded:"You have exceeded the upload quota.",FileUploadNetworkError:"Network error while uploading the file.",FileUploadTimeout:"File upload took too long.",FileUploadBackendError:"Server error while uploading the file.",UploadUrlInvalid:"The specified URL is not valid.",UploadUrlNotReachable:"The specified URL is not reachable.",UploadUrlContentTypeNotAllowed:"Content type at the URL is not allowed.",UploadUrlDownloadFailed:"Failed to download file from the URL.",FileLookupFailed:"Failed to find existing file by URL.",FileProxyFailed:"Failed to load file through proxy.",FileProxyNotConfigured:"File proxy is not configured.",FileDownloadNetworkError:"Network error while downloading the file.",FileDownloadTimeout:"File download took too long.",FileDownloadBackendError:"Server error while downloading the file.",BatchPartialFailure:"Some items could not be processed.",BatchAllFailed:"Failed to process all items in the batch.",BatchConflict:"Some items in the batch are in a conflicting state.",BatchValidationFailed:"Some items in the batch did not pass validation.",BatchItemLimitExceeded:"Batch operation exceeds the maximum number of items allowed.",ValidationError:"Some of the provided data is invalid.",PayloadTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",UnsupportedMediaType:"This media type is not supported.",NetworkError:"Network error. Please check your connection and try again.",BackendError:"Server error. Please try again later.",Timeout:"The operation took too long. Please try again.",AuthenticationFailed:"Authentication failed. Please sign in again.",AuthorizationFailed:"You are not allowed to perform this action.",RateLimitExceeded:"Too many requests. Please try again a bit later.",ServiceUnavailable:"Service is temporarily unavailable. Please try again later.",AIResponseInvalid:"AI service returned an invalid response.",AIImageGenerationFailed:"Failed to generate image using AI.",AIImageGenerationLimitExceeded:"You have reached the AI image generation limit.",IntegrationError:"Error in external integration.",ThirdPartyError:"Error in a third-party service.",UnknownError:"An unknown error occurred."},di={FileTooLarge:"File is too large to upload.",PayloadTooLarge:"File is too large to upload."},hi=(e,t,r)=>{var n,i,o;if(!e)return;const a=ui[e];if(!a)return;const s=null!==(n=null==r?void 0:r.fileSize)&&void 0!==n?n:"",l=null!==(i=null==r?void 0:r.maxSize)&&void 0!==i?i:"";if(("FileTooLarge"===e||"PayloadTooLarge"===e)&&(!s||!l)){const r=di[e];return r?t(r):t(a,{fileSize:"?",maxSize:"?"})}return t(a,{allowedChars:null!==(o=null==r?void 0:r.allowedChars)&&void 0!==o?o:"a-z A-Z 0-9 . _ -",fileSize:s,maxSize:l})},fi=e=>{if(!e||"string"!=typeof e)return;const t=e.toLowerCase();return(t.includes("maximum number of files")||t.includes("number of files exceeded"))&&(t.includes("allowed")||t.includes("received"))?"BatchItemLimitExceeded":t.includes("exceeds")||t.includes("maximum")||t.includes("too large")||t.includes("size limit")||t.includes("object size")||t.includes("\u0440\u0430\u0437\u043c\u0435\u0440")||t.includes("\u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d")?"PayloadTooLarge":t.includes("403")||t.includes("forbidden")||t.includes("access denied")||t.includes("\u0434\u043e\u0441\u0442\u0443\u043f \u0437\u0430\u043f\u0440\u0435\u0449\u0451\u043d")?"AuthorizationFailed":t.includes("404")||t.includes("not found")||t.includes("\u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d")?"UploadUrlNotReachable":t.includes("already exists")||t.includes("\u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442")||t.includes("\u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442")?"FileAlreadyExists":t.includes("invalid")&&(t.includes("name")||t.includes("\u0438\u043c\u044f")||t.includes("\u043d\u0430\u0437\u0432\u0430"))?"FileInvalidName":t.includes("type")&&(t.includes("not allowed")||t.includes("\u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f"))?"FileTypeNotAllowed":void 0},pi=e=>{var t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y;if(!e)return{message:"Unknown error",raw:e};if("string"==typeof e)return{message:e};if(e instanceof Error){const o=e;return{message:null!==(t=o.message)&&void 0!==t?t:e.message,code:o.code,status:null!==(r=o.status)&&void 0!==r?r:o.httpStatus,stack:null!==(n=o.stack)&&void 0!==n?n:e.stack,raw:null!==(i=o.raw)&&void 0!==i?i:e}}if("object"==typeof e){const t=e,r=null!==(o=t.data)&&void 0!==o?o:t,n=null!==(a=null==r?void 0:r.data)&&void 0!==a?a:r,i=null!==(c=null!==(l=null!==(s=t.message)&&void 0!==s?s:null==r?void 0:r.message)&&void 0!==l?l:t.error)&&void 0!==c?c:t.reason,b=null!==(h=null!==(d=null!==(u=t.status)&&void 0!==u?u:t.httpStatus)&&void 0!==d?d:null==n?void 0:n.status)&&void 0!==h?h:null==r?void 0:r.status,w=null!==(f=t.code)&&void 0!==f?f:null==r?void 0:r.code,x=t.stack,C=null!==(p=t.raw)&&void 0!==p?p:e,_=null!==(m=null!==(g=t.fileSize)&&void 0!==g?g:null==n?void 0:n.fileSize)&&void 0!==m?m:null==r?void 0:r.fileSize,S=null!==(y=null!==(v=t.maxSize)&&void 0!==v?v:null==n?void 0:n.maxSize)&&void 0!==y?y:null==r?void 0:r.maxSize;if(i||w||b||x||C)return Object.assign(Object.assign({message:i,code:w,status:b,stack:x,raw:C},null!=_&&{fileSize:_}),null!=S&&{maxSize:S})}return{message:String(e),raw:e}},gi=e=>{const t=pi(e);return"path_folder_not_found"===(null==t?void 0:t.code)},mi=["file_get_contents","open stream","failed to open stream","http request failed","curl_error"],vi=(e,t,r)=>{var n;if(!e)return t("Error when downloading a file by URL");const i=null!==(n=(e=>{const t=fi(e);if("AuthorizationFailed"===t){const t=(e||"").toLowerCase();if(t.includes("download")||t.includes("url")||t.includes("file_get_contents")||t.includes("failed to download"))return"UploadUrlNotReachable"}return t})(null==e?void 0:e.message))&&void 0!==n?n:null==e?void 0:e.code,o=hi(i,t,r);if(o)return o;const a=(null==e?void 0:e.message)&&"string"==typeof e.message?e.message.trim():null;return a&&function(e){if(!e||e.length>200)return!1;const t=e.toLowerCase();return!mi.some(e=>t.includes(e))}(a)?a:t("Failed to download file from the URL.")},yi=e=>Array.isArray(e)?e.filter(e=>(null==e?void 0:e.id)&&"folders"!==e.id).map(e=>e.name).filter(Boolean).join("/"):"",bi=e=>{const t=e.trim();if(!t)return"";const r=t.toLowerCase(),n=[r.indexOf(" and "),r.indexOf(" or "),t.indexOf(","),t.indexOf(";"),r.indexOf(". ")].filter(e=>e>=0);if(0===n.length)return t;const i=Math.min(...n);return t.slice(0,i).trim()||t},wi=(e,t)=>{const r=(e=>{var t,r,n,i;if(e&&"object"==typeof e){const o=e,a=null!==(n=null===(r=null===(t=o.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.path_folder)&&void 0!==n?n:null===(i=o.data)||void 0===i?void 0:i.path_folder;if("string"==typeof a&&a.trim())return bi(a)||null}const o=pi(e),a=null==o?void 0:o.message;if(!a)return null;const s=a.toLowerCase(),l=["\u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442:","not exists:","not exist:","not found:"];for(const u of l){const e=s.indexOf(u);if(e>=0){const t=a.slice(e+u.length).trim();return bi(t)||null}}const c=["not exists ","not exist ","not found "];for(const u of c){const e=s.indexOf(u);if(e>=0){const t=a.slice(e+u.length).trim();return bi(t)||null}}return null})(e);return r?(e=>{const t=e.split("/").filter(Boolean);return t.length<=1?"":(t.pop(),t.join("/"))})(r):yi(t)},xi=async e=>{var t;const{options:r,pathFolder:n,dataProviders:i}=e;if(null==i?void 0:i.clearCache)return void await i.clearCache(n||null);const o=null===(t=null==r?void 0:r.apiEndpoints)||void 0===t?void 0:t.clearCache;if(!o)return;const a=o.includes("?");let s=o;n&&n.length>0&&(s=`${o}${a?"&":"?"}path_folder=${encodeURIComponent(n)}`);const l=await fetch(s,{method:"POST"});if(!l.ok)throw new Error(`Cache clear failed: ${l.status}`)},Ci={"\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0451":"yo","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"y","\u043a":"k","\u043b":"l","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"ts","\u0447":"ch","\u0448":"sh","\u0449":"sch","\u044a":"","\u044b":"y","\u044c":"","\u044d":"e","\u044e":"yu","\u044f":"ya","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0401":"Yo","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"Y","\u041a":"K","\u041b":"L","\u041c":"M","\u041d":"N","\u041e":"O","\u041f":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"Ts","\u0427":"Ch","\u0428":"Sh","\u0429":"Sch","\u042a":"","\u042b":"Y","\u042c":"","\u042d":"E","\u042e":"Yu","\u042f":"Ya"},_i=/[<>:"/\\|?*\x00-\x1f]/g,Si={transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0};function Ai(e,t){let r=e;return t.transliterate&&(r=r.split("").map(e=>Ci[e]||e).join("")),t.removeForbiddenChars&&(r=r.replace(_i,"_")),t.replaceSpaces&&(r=r.replace(/\s+/g,"_")),t.toLowerCase&&(r=r.toLowerCase()),r=r.replace(/_{2,}/g,"_"),r=r.replace(/^_+|_+$/g,""),r.length>255&&(r=r.substring(0,255)),r}function ki(e,t){const r=Object.assign(Object.assign({},Si),null==t?void 0:t.fileNameProcessing),n=e.lastIndexOf(".");let i,o;return n>0?(i=e.substring(0,n),o=e.substring(n).toLowerCase()):(i=e,o=""),(Ai(i,r)||"unnamed_file")+o}function Ei(e,t){return Ai(e,Object.assign(Object.assign({},Si),null==t?void 0:t.folderNameProcessing))||"unnamed_folder"}const Ii=()=>{var e,t;const{state:r,actions:n,options:i}=ti(),{t:a}=kr(),s=oi(),{folders:l,selectedFolder:c,pathHistory:u,form:d,loading:h,isModalVisible:f}=r,{setFolders:p,setLoading:g,setIsModalVisible:m}=n,{dataProviders:v,config:y}=i,b=(0,o.useCallback)(e=>(Array.isArray(e)?e:[]).filter(e=>e&&e.id&&e.name).map(e=>({id:e.id,name:e.name,parentId:e.folderId?e.folderId:null})),[]),w=(0,o.useCallback)(async(e=!1)=>{null==g||g(!0);try{let e=[];const t="lazy"===(null==y?void 0:y.folderTreeLoading);if(!(null==v?void 0:v.getFolders)){if(null==v?void 0:v.getFiles){const e=async r=>{const{files:n}=await v.getFiles({itemType:"folder",folderId:r||void 0}),i=b(n);if(t)return i;const o=await Promise.all(i.map(t=>e(t.id)));return[...i,...o.flat()]},r=await e(null);return void(p&&p(e=>{const n=Array.isArray(e)?e:[];if(!t){const e=r;return e.filter(e=>e.id===e.parentId).length,e}const i=n.filter(e=>e.parentId),o=[...i,...r],a=o.filter(e=>e.id===e.parentId);return a.length,o}))}return}{const r=!t;e=await v.getFolders({parentId:null,deep:r})}const r=Array.isArray(e)?e:[];null==p||p(r);const n=r.filter(e=>e.id===e.parentId);n.length}catch(t){const n=pi(t);if(!e&&(404===(null==n?void 0:n.status)||"FileNotFound"===(null==n?void 0:n.code))){const n=wi(t,u||[]);try{return await xi({options:i,pathFolder:n,dataProviders:null==i?void 0:i.dataProviders}),void await w(!0)}catch(e){}}const o=hi(null==n?void 0:n.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=o?o:a("Failed to load folders"),placement:"bottomRight",innerException:t,data:{reason:t instanceof Error?t.message:String(t)}})}finally{null==g||g(!1)}},[null==v?void 0:v.getFiles,null==v?void 0:v.getFolders,p,g,null==y?void 0:y.folderTreeLoading,b,s,a,u,i]),x=(0,o.useCallback)(()=>w(),[w]),C=(0,o.useCallback)(async e=>{try{let t,r;if(null==v?void 0:v.getFolders){t=await v.getFolders({parentId:e,deep:!1});const n=Array.isArray(l)?l:[],i=new Set(t.map(e=>e.id)),o=n.filter(t=>t.parentId!==e||i.has(t.id));r=[...o,...t.filter(e=>!o.some(t=>t.id===e.id))]}else{if(!(null==v?void 0:v.getFiles))return[];{const{files:n}=await v.getFiles({itemType:"folder",folderId:e||void 0});t=b(n);const i=Array.isArray(l)?l:[],o=new Set(t.map(e=>e.id)),a=i.filter(t=>t.parentId!==e||o.has(t.id));r=[...a,...t.filter(e=>!a.some(t=>t.id===e.id))]}}let n=r,i=0;for(;i!==n.length;){i=n.length;const e=new Set(n.map(e=>e.id));n=n.filter(t=>!t.parentId||e.has(t.parentId))}return null==p||p(n),t}catch(e){return[]}},[v,l,p,b]),_=(0,o.useCallback)(()=>{var e;const t=null!==(e=null==y?void 0:y.defaultFolderName)&&void 0!==e?e:a("New folder");d.setFieldsValue({folderName:t}),null==m||m(!0)},[d,m,a,null==y?void 0:y.defaultFolderName]),S=(0,o.useCallback)(async(e,t)=>{const r=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==p||p(r),e.parentId&&(await C(e.parentId),await new Promise(e=>setTimeout(e,50))),!(null==t?void 0:t.preserveSelection)&&n.setSelectedFolder&&n.setSelectedFolder(e.id),!(null==t?void 0:t.preserveSelection)&&n.setPathHistory){const t=Array.isArray(r)?r:[],i=(e,r=new Set)=>{if(r.has(e))return[];const n=t.find(t=>t.id===e);if(!n)return[];const o=new Set(r);return o.add(e),n.parentId?[...i(n.parentId,o),{id:n.id,name:n.name}]:[{id:n.id,name:n.name}]},o=i(e.id),s=[{id:"folders",name:a("Folders")},...o];n.setPathHistory(s)}},[l,p,n,r.pathHistory,C,a]),A=(0,o.useCallback)(async e=>{try{if(null==v?void 0:v.getFolders){const t=await v.getFolders();return(Array.isArray(t)?t:[]).some(t=>t.id===e)}if(null==v?void 0:v.getFiles){const t=new Set,r=async n=>{const{files:i}=await v.getFiles({itemType:"folder",folderId:n||void 0}),o=b(i);for(const a of o)if(!t.has(a.id)){if(t.add(a.id),a.id===e)return!0;if(await r(a.id))return!0}return!1};return await r(null)}}catch(e){}return!1},[null==v?void 0:v.getFolders,null==v?void 0:v.getFiles,b]),k=(0,o.useCallback)(async e=>{var t;let r,n,i=null;try{const o=await(e?e.validateFields():d.validateFields());if(r=o.folderName.trim(),!r){const e=o.targetFolder||(c&&"folders"!==c?c:null);return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderName:r,folderId:null!=e?e:null,reason:"emptyName",is_force_create:!!o.is_force_create}})}n=Ei(r,y);const h=o.targetFolder;if(h)i="folders"!==h?h:null;else if(c&&"folders"!==c)i=c;else if(Array.isArray(u)&&u.length>1){const e=u[u.length-1];i=(null==e?void 0:e.id)&&"folders"!==e.id?e.id:null}if((!1===(null==y?void 0:y.paginationAvailable)||!1===(null==y?void 0:y.hasPagination)||!0===(null==y?void 0:y.disablePagination))&&(null==v?void 0:v.getFolders))try{const e=(await v.getFolders({parentId:i,deep:!1})||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean);if(e.includes(r.trim().toLowerCase()))return void s.error({id:"FOLDER_ALREADY_EXISTS",message:a("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,folderId:i}})}catch(e){}let f;if(!(null==v?void 0:v.createFolder))return void s.error({id:"FOLDER_CREATE_PROVIDER_NOT_CONFIGURED",message:a("Folder creation provider is not configured"),placement:"bottomRight",data:{folderName:n,folderId:null!=i?i:null,is_force_create:!!o.is_force_create}});f=await v.createFolder({name:n,parentId:i,is_force_create:!!o.is_force_create}),(e=>{if(!e||!e.id)throw new Error(a("Invalid server response: folder ID is missing"));if(e.id===e.parentId&&e.parentId)throw new Error(a("Error: folder cannot be its own parent"))})(f);const g={id:f.id,name:f.name,parentId:null!=i?i:null,childCount:f.childCount},b=[...(Array.isArray(l)?l:[]).filter(e=>e.id!==g.id),g];if(null==p||p(b),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[g.id],folderId:null!==(t=g.parentId)&&void 0!==t?t:null,folderName:g.name}}),e||null==m||m(!1),(async()=>{try{await S(g,{preserveSelection:Boolean(e)}),await x(),await new Promise(e=>setTimeout(e,200)),await A(f.id)}catch(e){}})(),e)return f}catch(e){const t=pi(e),o=hi(null==t?void 0:t.code,a);s.error({id:"FOLDER_CREATE_FAILED",message:null!=o?o:a("Failed to create folder"),placement:"bottomRight",innerException:e,data:{folderName:n||r,folderId:null!=i?i:null,reason:e instanceof Error?e.message:String(e)}})}},[d,c,v,S,x,A,m,s,a,l,p,y,u]),E=(0,o.useCallback)(()=>{null==m||m(!1)},[m]),I=(0,o.useCallback)((e,t=new Set)=>{const r=Array.isArray(l)?l:[];return e.map(e=>{if(t.has(e.id))return{key:e.id,label:e.name+" "+a("(error)"),icon:o.createElement($.A,{style:{color:"red"}})};const n=new Set(t);n.add(e.id);const i=r.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:i.length>0?I(i,n):void 0}})},[l]),j=(0,o.useCallback)(()=>{const e=Array.isArray(l)?l:[],t={key:"folders",label:a("Folders"),children:[]},r=e.filter(e=>null===e.parentId||!e.parentId);return t.children=I(r),[t]},[l,a,I]),T=(0,o.useCallback)(async(e,t)=>{var r,o,c,u;let d;try{const h=t.trim(),f=null==l?void 0:l.find(t=>t.id===e);if(!h)return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:e,folderName:t,reason:"emptyName"}});if(d=Ei(h,y),!1===(null===(r=null==y?void 0:y.features)||void 0===r?void 0:r.enableRenameFolder))return void s.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:a("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:e,itemName:null!==(o=null==f?void 0:f.name)&&void 0!==o?o:d}});if(!(null===(c=i.dataProviders)||void 0===c?void 0:c.renameFolder))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Folder rename provider is not configured"),placement:"bottomRight",data:{itemId:e,itemName:d,error:{message:"providerNotConfigured"}}});const p=await i.dataProviders.renameFolder(e,d);if(!(null==p?void 0:p.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:e,itemName:d,error:{message:"invalidResponse"}}});await x(),e!==p.id&&n.setSelectedFolder&&n.setSelectedFolder(p.id),s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:p.id,itemName:p.name,folderId:null!==(u=p.parentId)&&void 0!==u?u:null}})}catch(r){s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:r,data:{itemId:e,itemName:d||t,error:{message:r instanceof Error?r.message:String(r)}}})}},[x,l,null===(e=i.dataProviders)||void 0===e?void 0:e.renameFolder,null===(t=null==y?void 0:y.features)||void 0===t?void 0:t.enableRenameFolder,y,n.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:f,loading:h},actions:{fetchFolders:x,fetchChildFolders:C,handleCreateFolder:_,handleModalOk:k,handleModalCancel:E,generateMenuItems:j,renameFolder:T}}},ji=()=>{const{options:e,actions:t}=ti(),{dataProviders:r,config:n}=e,{setUndoDeletion:i}=t,{t:a}=kr(),s=oi(),l=(0,o.useCallback)(async({items:e,selectedFolder:t,getItemNameById:o,showNotifications:l=!1})=>{let c=0,u=0;const d=[],h=async t=>{if(null==r?void 0:r.deleteItems)try{const n=await r.deleteItems(e.map(e=>e.id),{permanent:t}),i=n.detailed;if(i){const e=i.filter(e=>e.success),t=i.filter(e=>!e.success),r=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return gi(r)}),n=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return!gi(r)});return c+=e.length+r.length,u+=n.length,void n.forEach(e=>{var t;const r=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),n=null!==(t=e.innerException)&&void 0!==t?t:e.error,i=pi(n);d.push({itemId:r,itemName:o(r),error:i})})}if(n.success)c+=e.length;else{const t=n.error;if(gi(t))c+=e.length;else if(t){u+=e.length;const r=pi(t);d.push({error:r})}else u+=e.length}return}catch(r){if(gi(r))c+=e.length;else{u+=e.length;const n=pi(r);d.push({error:n})}}},f=(null==n?void 0:n.enableTrashFolder)&&"Trash"===t;return(null==n?void 0:n.enableTrashFolder)&&!f?await h(!1):await h(!0),c>0&&(null==n?void 0:n.enableTrashFolder)&&!f&&(null==i||i({itemIds:e.map(e=>e.id),sourceFolderId:t||"folders"})),l&&(c>0&&s.success({id:"FILES_DELETE_SUCCESS",message:a("Files deleted"),placement:"bottomRight",data:{successCount:c,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:t||null}}),u>0&&s.error({id:"FILES_DELETE_ERROR",message:a("Error when deleting a file"),placement:"bottomRight",data:{failCount:u,totalCount:e.length,itemIds:e.map(e=>e.id),itemNames:e.map(e=>o(e.id)),folderId:t||null,errors:d}})),{successCount:c,failCount:u,errorDetails:d}},[r,n,i,a,s]);return{deleteItems:l}};class Ti extends Error{constructor(e,t,r,n){super(e),this.code=t,this.status=r,this.details=n,this.name="FileManagerApiError",Error.captureStackTrace&&Error.captureStackTrace(this,Ti)}}const Fi=/^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i,Oi=/^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;function Pi(e,t){const r=e.trim();if(!r)throw new Ti(t("Enter the URL of the image"),"UploadUrlInvalid");if(r.length>8192)throw new Ti(t("URL too long"),"UploadUrlInvalid");let n;try{n=new URL(r)}catch(e){throw new Ti(t("The specified URL is not valid."),"UploadUrlInvalid")}const i=n.protocol.toLowerCase();if("http:"!==i&&"https:"!==i)throw new Ti(t("Only http and https URLs are supported"),"UploadUrlInvalid");const o=n.hostname.toLowerCase();if(Fi.test(o))throw new Ti(t("Private and local URLs are not allowed"),"UploadUrlInvalid");if(Oi.test(o))throw new Ti(t("Private and local URLs are not allowed"),"UploadUrlInvalid")}function Mi(e,t){return new Promise(function(r,n){let i;return Ri(e).then(function(e){try{return i=e,r(new Blob([t.slice(0,2),i,t.slice(2)],{type:"image/jpeg"}))}catch(e){return n(e)}},n)})}const Ri=e=>new Promise((t,r)=>{const n=new FileReader;n.addEventListener("load",({target:{result:e}})=>{const n=new DataView(e);let i=0;if(65496!==n.getUint16(i))return r("not a valid JPEG");for(i+=2;;){const o=n.getUint16(i);if(65498===o)break;const a=n.getUint16(i+2);if(65505===o&&1165519206===n.getUint32(i+4)){const o=i+10;let s;switch(n.getUint16(o)){case 18761:s=!0;break;case 19789:s=!1;break;default:return r("TIFF header contains invalid endian")}if(42!==n.getUint16(o+2,s))return r("TIFF header contains invalid version");const l=n.getUint32(o+4,s),c=o+l+2+12*n.getUint16(o+l,s);for(let e=o+l+2;e<c;e+=12)if(274==n.getUint16(e,s)){if(3!==n.getUint16(e+2,s))return r("Orientation data type is invalid");if(1!==n.getUint32(e+4,s))return r("Orientation data count is invalid");n.setUint16(e+8,1,s);break}return t(e.slice(i,i+2+a))}i+=2+a}return t(new Blob)}),n.readAsArrayBuffer(e)});var Li={},Ni={get exports(){return Li},set exports(e){Li=e}};!function(){var e,t,r={};Ni.exports=r,r.parse=function(e,t){for(var n=r.bin.readUshort,i=r.bin.readUint,o=0,a={},s=new Uint8Array(e),l=s.length-4;101010256!=i(s,l);)l--;o=l,o+=4;var c=n(s,o+=4);n(s,o+=2);var u=i(s,o+=2),d=i(s,o+=4);o+=4,o=d;for(var h=0;h<c;h++){i(s,o),o+=4,o+=4,o+=4,i(s,o+=4),u=i(s,o+=4);var f=i(s,o+=4),p=n(s,o+=4),g=n(s,o+2),m=n(s,o+4);o+=6;var v=i(s,o+=8);o+=4,o+=p+g+m,r._readLocal(s,v,a,u,f,t)}return a},r._readLocal=function(e,t,n,i,o,a){var s=r.bin.readUshort,l=r.bin.readUint;l(e,t),s(e,t+=4),s(e,t+=2);var c=s(e,t+=2);l(e,t+=2),l(e,t+=4),t+=4;var u=s(e,t+=8),d=s(e,t+=2);t+=2;var h=r.bin.readUTF8(e,t,u);if(t+=u,t+=d,a)n[h]={size:o,csize:i};else{var f=new Uint8Array(e.buffer,t);if(0==c)n[h]=new Uint8Array(f.buffer.slice(t,t+i));else{if(8!=c)throw"unknown compression method: "+c;var p=new Uint8Array(o);r.inflateRaw(f,p),n[h]=p}}},r.inflateRaw=function(e,t){return r.F.inflate(e,t)},r.inflate=function(e,t){return e[0],e[1],r.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},r.deflate=function(e,t){null==t&&(t={level:6});var n=0,i=new Uint8Array(50+Math.floor(1.1*e.length));i[n]=120,i[n+1]=156,n+=2,n=r.F.deflateRaw(e,i,n,t.level);var o=r.adler(e,0,e.length);return i[n+0]=o>>>24&255,i[n+1]=o>>>16&255,i[n+2]=o>>>8&255,i[n+3]=o>>>0&255,new Uint8Array(i.buffer,0,n+4)},r.deflateRaw=function(e,t){null==t&&(t={level:6});var n=new Uint8Array(50+Math.floor(1.1*e.length)),i=r.F.deflateRaw(e,n,i,t.level);return new Uint8Array(n.buffer,0,i)},r.encode=function(e,t){null==t&&(t=!1);var n=0,i=r.bin.writeUint,o=r.bin.writeUshort,a={};for(var s in e){var l=!r._noNeed(s)&&!t,c=e[s],u=r.crc.crc(c,0,c.length);a[s]={cpr:l,usize:c.length,crc:u,file:l?r.deflateRaw(c):c}}for(var s in a)n+=a[s].file.length+30+46+2*r.bin.sizeUTF8(s);n+=22;var d=new Uint8Array(n),h=0,f=[];for(var s in a){var p=a[s];f.push(h),h=r._writeHeader(d,h,s,p,0)}var g=0,m=h;for(var s in a)p=a[s],f.push(h),h=r._writeHeader(d,h,s,p,1,f[g++]);var v=h-m;return i(d,h,101010256),h+=4,o(d,h+=4,g),o(d,h+=2,g),i(d,h+=2,v),i(d,h+=4,m),h+=4,h+=2,d.buffer},r._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(t)},r._writeHeader=function(e,t,n,i,o,a){var s=r.bin.writeUint,l=r.bin.writeUshort,c=i.file;return s(e,t,0==o?67324752:33639248),t+=4,1==o&&(t+=2),l(e,t,20),l(e,t+=2,0),l(e,t+=2,i.cpr?8:0),s(e,t+=2,0),s(e,t+=4,i.crc),s(e,t+=4,c.length),s(e,t+=4,i.usize),l(e,t+=4,r.bin.sizeUTF8(n)),l(e,t+=2,0),t+=2,1==o&&(t+=2,t+=2,s(e,t+=6,a),t+=4),t+=r.bin.writeUTF8(e,t,n),0==o&&(e.set(c,t),t+=c.length),t},r.crc={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var r=t,n=0;n<8;n++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update:function(e,t,n,i){for(var o=0;o<i;o++)e=r.crc.table[255&(e^t[n+o])]^e>>>8;return e},crc:function(e,t,n){return 4294967295^r.crc.update(4294967295,e,t,n)}},r.adler=function(e,t,r){for(var n=1,i=0,o=t,a=t+r;o<a;){for(var s=Math.min(o+5552,a);o<s;)i+=n+=e[o++];n%=65521,i%=65521}return i<<16|n},r.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,r){e[t]=255&r,e[t+1]=r>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,r){e[t]=255&r,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255},readASCII:function(e,t,r){for(var n="",i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII:function(e,t,r){for(var n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,n){for(var i,o="",a=0;a<n;a++)o+="%"+r.bin.pad(e[t+a].toString(16));try{i=decodeURIComponent(o)}catch(i){return r.bin.readASCII(e,t,n)}return i},writeUTF8:function(e,t,r){for(var n=r.length,i=0,o=0;o<n;o++){var a=r.charCodeAt(o);if(4294967168&a)if(4294965248&a)if(4294901760&a){if(4292870144&a)throw"e";e[t+i]=240|a>>18,e[t+i+1]=128|a>>12&63,e[t+i+2]=128|a>>6&63,e[t+i+3]=128|63&a,i+=4}else e[t+i]=224|a>>12,e[t+i+1]=128|a>>6&63,e[t+i+2]=128|63&a,i+=3;else e[t+i]=192|a>>6,e[t+i+1]=128|63&a,i+=2;else e[t+i]=a,i++}return i},sizeUTF8:function(e){for(var t=e.length,r=0,n=0;n<t;n++){var i=e.charCodeAt(n);if(4294967168&i)if(4294965248&i)if(4294901760&i){if(4292870144&i)throw"e";r+=4}else r+=3;else r+=2;else r++}return r}},r.F={},r.F.deflateRaw=function(e,t,n,i){var o=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][i],a=r.F.U,s=r.F._goodIndex;r.F._hash;var l=r.F._putsE,c=0,u=n<<3,d=0,h=e.length;if(0==i){for(;c<h;)l(t,u,c+(S=Math.min(65535,h-c))==h?1:0),u=r.F._copyExact(e,c,S,t,u+8),c+=S;return u>>>3}var f=a.lits,p=a.strt,g=a.prev,m=0,v=0,y=0,b=0,w=0,x=0;for(h>2&&(p[x=r.F._hash(e,0)]=0),c=0;c<h;c++){if(w=x,c+1<h-2){x=r.F._hash(e,c+1);var C=c+1&32767;g[C]=p[x],p[x]=C}if(d<=c){(m>14e3||v>26697)&&h-c>100&&(d<c&&(f[m]=c-d,m+=2,d=c),u=r.F._writeBlock(c==h-1||d==h?1:0,f,m,b,e,y,c-y,t,u),m=v=b=0,y=c);var _=0;c<h-2&&(_=r.F._bestMatch(e,c,g,w,Math.min(o[2],h-c),o[3]));var S=_>>>16,A=65535&_;if(0!=_){A=65535&_;var k=s(S=_>>>16,a.of0);a.lhst[257+k]++;var E=s(A,a.df0);a.dhst[E]++,b+=a.exb[k]+a.dxb[E],f[m]=S<<23|c-d,f[m+1]=A<<16|k<<8|E,m+=2,d=c+S}else a.lhst[e[c]]++;v++}}for(y==c&&0!=e.length||(d<c&&(f[m]=c-d,m+=2,d=c),u=r.F._writeBlock(1,f,m,b,e,y,c-y,t,u),m=0,v=0,m=v=b=0,y=c);7&u;)u++;return u>>>3},r.F._bestMatch=function(e,t,n,i,o,a){var s=32767&t,l=n[s],c=s-l+32768&32767;if(l==s||i!=r.F._hash(e,t-c))return 0;for(var u=0,d=0,h=Math.min(32767,t);c<=h&&0!=--a&&l!=s;){if(0==u||e[t+u]==e[t+u-c]){var f=r.F._howLong(e,t,c);if(f>u){if(d=c,(u=f)>=o)break;c+2<f&&(f=c+2);for(var p=0,g=0;g<f-2;g++){var m=t-c+g+32768&32767,v=m-n[m]+32768&32767;v>p&&(p=v,l=m)}}}c+=(s=l)-(l=n[s])+32768&32767}return u<<16|d},r.F._howLong=function(e,t,r){if(e[t]!=e[t-r]||e[t+1]!=e[t+1-r]||e[t+2]!=e[t+2-r])return 0;var n=t,i=Math.min(e.length,t+258);for(t+=3;t<i&&e[t]==e[t-r];)t++;return t-n},r.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(e,t,n,i,o,a,s,l,c){var u,d,h,f,p,g,m,v,y,b=r.F.U,w=r.F._putsF,x=r.F._putsE;b.lhst[256]++,d=(u=r.F.getTrees())[0],h=u[1],f=u[2],p=u[3],g=u[4],m=u[5],v=u[6],y=u[7];var C=32+(c+3&7?8-(c+3&7):0)+(s<<3),_=i+r.F.contSize(b.fltree,b.lhst)+r.F.contSize(b.fdtree,b.dhst),S=i+r.F.contSize(b.ltree,b.lhst)+r.F.contSize(b.dtree,b.dhst);S+=14+3*m+r.F.contSize(b.itree,b.ihst)+(2*b.ihst[16]+3*b.ihst[17]+7*b.ihst[18]);for(var A=0;A<286;A++)b.lhst[A]=0;for(A=0;A<30;A++)b.dhst[A]=0;for(A=0;A<19;A++)b.ihst[A]=0;var k=C<_&&C<S?0:_<S?1:2;if(w(l,c,e),w(l,c+1,k),c+=3,0==k){for(;7&c;)c++;c=r.F._copyExact(o,a,s,l,c)}else{var E,I;if(1==k&&(E=b.fltree,I=b.fdtree),2==k){r.F.makeCodes(b.ltree,d),r.F.revCodes(b.ltree,d),r.F.makeCodes(b.dtree,h),r.F.revCodes(b.dtree,h),r.F.makeCodes(b.itree,f),r.F.revCodes(b.itree,f),E=b.ltree,I=b.dtree,x(l,c,p-257),x(l,c+=5,g-1),x(l,c+=5,m-4),c+=4;for(var j=0;j<m;j++)x(l,c+3*j,b.itree[1+(b.ordr[j]<<1)]);c+=3*m,c=r.F._codeTiny(v,b.itree,l,c),c=r.F._codeTiny(y,b.itree,l,c)}for(var T=a,F=0;F<n;F+=2){for(var O=t[F],P=O>>>23,M=T+(8388607&O);T<M;)c=r.F._writeLit(o[T++],E,l,c);if(0!=P){var R=t[F+1],L=R>>16,N=R>>8&255,D=255&R;x(l,c=r.F._writeLit(257+N,E,l,c),P-b.of0[N]),c+=b.exb[N],w(l,c=r.F._writeLit(D,I,l,c),L-b.df0[D]),c+=b.dxb[D],T+=P}}c=r.F._writeLit(256,E,l,c)}return c},r.F._copyExact=function(e,t,r,n,i){var o=i>>>3;return n[o]=r,n[o+1]=r>>>8,n[o+2]=255-n[o],n[o+3]=255-n[o+1],o+=4,n.set(new Uint8Array(e.buffer,t,r),o),i+(r+4<<3)},r.F.getTrees=function(){for(var e=r.F.U,t=r.F._hufTree(e.lhst,e.ltree,15),n=r.F._hufTree(e.dhst,e.dtree,15),i=[],o=r.F._lenCodes(e.ltree,i),a=[],s=r.F._lenCodes(e.dtree,a),l=0;l<i.length;l+=2)e.ihst[i[l]]++;for(l=0;l<a.length;l+=2)e.ihst[a[l]]++;for(var c=r.F._hufTree(e.ihst,e.itree,7),u=19;u>4&&0==e.itree[1+(e.ordr[u-1]<<1)];)u--;return[t,n,c,o,s,u,i,a]},r.F.getSecond=function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(e[r+1]);return t},r.F.nonZero=function(e){for(var t="",r=0;r<e.length;r+=2)0!=e[r+1]&&(t+=(r>>1)+",");return t},r.F.contSize=function(e,t){for(var r=0,n=0;n<t.length;n++)r+=t[n]*e[1+(n<<1)];return r},r.F._codeTiny=function(e,t,n,i){for(var o=0;o<e.length;o+=2){var a=e[o],s=e[o+1];i=r.F._writeLit(a,t,n,i);var l=16==a?2:17==a?3:7;a>15&&(r.F._putsE(n,i,s,l),i+=l)}return i},r.F._lenCodes=function(e,t){for(var r=e.length;2!=r&&0==e[r-1];)r-=2;for(var n=0;n<r;n+=2){var i=e[n+1],o=n+3<r?e[n+3]:-1,a=n+5<r?e[n+5]:-1,s=0==n?-1:e[n-1];if(0==i&&o==i&&a==i){for(var l=n+5;l+2<r&&e[l+2]==i;)l+=2;(c=Math.min(l+1-n>>>1,138))<11?t.push(17,c-3):t.push(18,c-11),n+=2*c-2}else if(i==s&&o==i&&a==i){for(l=n+5;l+2<r&&e[l+2]==i;)l+=2;var c=Math.min(l+1-n>>>1,6);t.push(16,c-3),n+=2*c-2}else t.push(i,0)}return r>>>1},r.F._hufTree=function(e,t,n){var i=[],o=e.length,a=t.length,s=0;for(s=0;s<a;s+=2)t[s]=0,t[s+1]=0;for(s=0;s<o;s++)0!=e[s]&&i.push({lit:s,f:e[s]});var l=i.length,c=i.slice(0);if(0==l)return 0;if(1==l){var u=i[0].lit;return c=0==u?1:0,t[1+(u<<1)]=1,t[1+(c<<1)]=1,1}i.sort(function(e,t){return e.f-t.f});var d=i[0],h=i[1],f=0,p=1,g=2;for(i[0]={lit:-1,f:d.f+h.f,l:d,r:h,d:0};p!=l-1;)d=f!=p&&(g==l||i[f].f<i[g].f)?i[f++]:i[g++],h=f!=p&&(g==l||i[f].f<i[g].f)?i[f++]:i[g++],i[p++]={lit:-1,f:d.f+h.f,l:d,r:h};var m=r.F.setDepth(i[p-1],0);for(m>n&&(r.F.restrictDepth(c,n,m),m=n),s=0;s<l;s++)t[1+(c[s].lit<<1)]=c[s].d;return m},r.F.setDepth=function(e,t){return-1!=e.lit?(e.d=t,t):Math.max(r.F.setDepth(e.l,t+1),r.F.setDepth(e.r,t+1))},r.F.restrictDepth=function(e,t,r){var n=0,i=1<<r-t,o=0;for(e.sort(function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d}),n=0;n<e.length&&e[n].d>t;n++){var a=e[n].d;e[n].d=t,o+=i-(1<<r-a)}for(o>>>=r-t;o>0;)(a=e[n].d)<t?(e[n].d++,o-=1<<t-a-1):n++;for(;n>=0;n--)e[n].d==t&&o<0&&(e[n].d--,o++)},r.F._goodIndex=function(e,t){var r=0;return t[16|r]<=e&&(r|=16),t[8|r]<=e&&(r|=8),t[4|r]<=e&&(r|=4),t[2|r]<=e&&(r|=2),t[1|r]<=e&&(r|=1),r},r.F._writeLit=function(e,t,n,i){return r.F._putsF(n,i,t[e<<1]),i+t[1+(e<<1)]},r.F.inflate=function(e,t){var n=Uint8Array;if(3==e[0]&&0==e[1])return t||new n(0);var i=r.F,o=i._bitsF,a=i._bitsE,s=i._decodeTiny,l=i.makeCodes,c=i.codes2map,u=i._get17,d=i.U,h=null==t;h&&(t=new n(e.length>>>2<<3));for(var f,p,g=0,m=0,v=0,y=0,b=0,w=0,x=0,C=0,_=0;0==g;)if(g=o(e,_,1),m=o(e,_+1,2),_+=3,0!=m){if(h&&(t=r.F._check(t,C+(1<<17))),1==m&&(f=d.flmap,p=d.fdmap,w=511,x=31),2==m){v=a(e,_,5)+257,y=a(e,_+5,5)+1,b=a(e,_+10,4)+4,_+=14;for(var S=0;S<38;S+=2)d.itree[S]=0,d.itree[S+1]=0;var A=1;for(S=0;S<b;S++){var k=a(e,_+3*S,3);d.itree[1+(d.ordr[S]<<1)]=k,k>A&&(A=k)}_+=3*b,l(d.itree,A),c(d.itree,A,d.imap),f=d.lmap,p=d.dmap,_=s(d.imap,(1<<A)-1,v+y,e,_,d.ttree);var E=i._copyOut(d.ttree,0,v,d.ltree);w=(1<<E)-1;var I=i._copyOut(d.ttree,v,y,d.dtree);x=(1<<I)-1,l(d.ltree,E),c(d.ltree,E,f),l(d.dtree,I),c(d.dtree,I,p)}for(;;){var j=f[u(e,_)&w];_+=15&j;var T=j>>>4;if(T>>>8==0)t[C++]=T;else{if(256==T)break;var F=C+T-254;if(T>264){var O=d.ldef[T-257];F=C+(O>>>3)+a(e,_,7&O),_+=7&O}var P=p[u(e,_)&x];_+=15&P;var M=P>>>4,R=d.ddef[M],L=(R>>>4)+o(e,_,15&R);for(_+=15&R,h&&(t=r.F._check(t,C+(1<<17)));C<F;)t[C]=t[C++-L],t[C]=t[C++-L],t[C]=t[C++-L],t[C]=t[C++-L];C=F}}}else{7&_&&(_+=8-(7&_));var N=4+(_>>>3),D=e[N-4]|e[N-3]<<8;h&&(t=r.F._check(t,C+D)),t.set(new n(e.buffer,e.byteOffset+N,D),C),_=N+D<<3,C+=D}return t.length==C?t:t.slice(0,C)},r.F._check=function(e,t){var r=e.length;if(t<=r)return e;var n=new Uint8Array(Math.max(r<<1,t));return n.set(e,0),n},r.F._decodeTiny=function(e,t,n,i,o,a){for(var s=r.F._bitsE,l=r.F._get17,c=0;c<n;){var u=e[l(i,o)&t];o+=15&u;var d=u>>>4;if(d<=15)a[c]=d,c++;else{var h=0,f=0;16==d?(f=3+s(i,o,2),o+=2,h=a[c-1]):17==d?(f=3+s(i,o,3),o+=3):18==d&&(f=11+s(i,o,7),o+=7);for(var p=c+f;c<p;)a[c]=h,c++}}return o},r.F._copyOut=function(e,t,r,n){for(var i=0,o=0,a=n.length>>>1;o<r;){var s=e[o+t];n[o<<1]=0,n[1+(o<<1)]=s,s>i&&(i=s),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},r.F.makeCodes=function(e,t){for(var n,i,o,a,s=r.F.U,l=e.length,c=s.bl_count,u=0;u<=t;u++)c[u]=0;for(u=1;u<l;u+=2)c[e[u]]++;var d=s.next_code;for(n=0,c[0]=0,i=1;i<=t;i++)n=n+c[i-1]<<1,d[i]=n;for(o=0;o<l;o+=2)0!=(a=e[o+1])&&(e[o]=d[a],d[a]++)},r.F.codes2map=function(e,t,n){for(var i=e.length,o=r.F.U.rev15,a=0;a<i;a+=2)if(0!=e[a+1])for(var s=a>>1,l=e[a+1],c=s<<4|l,u=t-l,d=e[a]<<u,h=d+(1<<u);d!=h;)n[o[d]>>>15-t]=c,d++},r.F.revCodes=function(e,t){for(var n=r.F.U.rev15,i=15-t,o=0;o<e.length;o+=2){var a=e[o]<<t-e[o+1];e[o]=n[a]>>>i}},r.F._putsE=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},r.F._putsF=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},r.F._bitsE=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},r.F._bitsF=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},r.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.F.U=(e=Uint16Array,t=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}),function(){for(var e=r.F.U,t=0;t<32768;t++){var n=t;n=(4278255360&(n=(4042322160&(n=(3435973836&(n=(2863311530&n)>>>1|(1431655765&n)<<1))>>>2|(858993459&n)<<2))>>>4|(252645135&n)<<4))>>>8|(16711935&n)<<8,e.rev15[t]=(n>>>16|n<<16)>>>17}function i(e,t,r){for(;0!=t--;)e.push(0,r)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];i(e.fltree,144,8),i(e.fltree,112,9),i(e.fltree,24,7),i(e.fltree,8,8),r.F.makeCodes(e.fltree,9),r.F.codes2map(e.fltree,9,e.flmap),r.F.revCodes(e.fltree,9),i(e.fdtree,32,5),r.F.makeCodes(e.fdtree,5),r.F.codes2map(e.fdtree,5,e.fdmap),r.F.revCodes(e.fdtree,5),i(e.itree,19,0),i(e.ltree,286,0),i(e.dtree,30,0),i(e.ttree,320,0)}()}();var Di=function(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}({__proto__:null,default:Li},[Li]);const zi=function(){var e={nextZero(e,t){for(;0!=e[t];)t++;return t},readUshort:(e,t)=>e[t]<<8|e[t+1],writeUshort(e,t,r){e[t]=r>>8&255,e[t+1]=255&r},readUint:(e,t)=>16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]),writeUint(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},readASCII(e,t,r){let n="";for(let i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},readBytes(e,t,r){const n=[];for(let i=0;i<r;i++)n.push(e[t+i]);return n},pad:e=>e.length<2?`0${e}`:e,readUTF8(t,r,n){let i,o="";for(let a=0;a<n;a++)o+=`%${e.pad(t[r+a].toString(16))}`;try{i=decodeURIComponent(o)}catch(i){return e.readASCII(t,r,n)}return i}};function t(t,r,n,i){const a=r*n,s=o(i),l=Math.ceil(r*s/8),c=new Uint8Array(4*a),u=new Uint32Array(c.buffer),{ctype:d}=i,{depth:h}=i,f=e.readUshort;if(6==d){const e=a<<2;if(8==h)for(var p=0;p<e;p+=4)c[p]=t[p],c[p+1]=t[p+1],c[p+2]=t[p+2],c[p+3]=t[p+3];if(16==h)for(p=0;p<e;p++)c[p]=t[p<<1]}else if(2==d){const e=i.tabs.tRNS;if(null==e){if(8==h)for(p=0;p<a;p++){var g=3*p;u[p]=255<<24|t[g+2]<<16|t[g+1]<<8|t[g]}if(16==h)for(p=0;p<a;p++)g=6*p,u[p]=255<<24|t[g+4]<<16|t[g+2]<<8|t[g]}else{var m=e[0];const r=e[1],n=e[2];if(8==h)for(p=0;p<a;p++){var v=p<<2;g=3*p,u[p]=255<<24|t[g+2]<<16|t[g+1]<<8|t[g],t[g]==m&&t[g+1]==r&&t[g+2]==n&&(c[v+3]=0)}if(16==h)for(p=0;p<a;p++)v=p<<2,g=6*p,u[p]=255<<24|t[g+4]<<16|t[g+2]<<8|t[g],f(t,g)==m&&f(t,g+2)==r&&f(t,g+4)==n&&(c[v+3]=0)}}else if(3==d){const e=i.tabs.PLTE,o=i.tabs.tRNS,s=o?o.length:0;if(1==h)for(var y=0;y<n;y++){var b=y*l,w=y*r;for(p=0;p<r;p++){v=w+p<<2;var x=3*(C=t[b+(p>>3)]>>7-(7&p)&1);c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255}}if(2==h)for(y=0;y<n;y++)for(b=y*l,w=y*r,p=0;p<r;p++)v=w+p<<2,x=3*(C=t[b+(p>>2)]>>6-((3&p)<<1)&3),c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255;if(4==h)for(y=0;y<n;y++)for(b=y*l,w=y*r,p=0;p<r;p++)v=w+p<<2,x=3*(C=t[b+(p>>1)]>>4-((1&p)<<2)&15),c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255;if(8==h)for(p=0;p<a;p++){var C;v=p<<2,x=3*(C=t[p]),c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255}}else if(4==d){if(8==h)for(p=0;p<a;p++){v=p<<2;var _=t[S=p<<1];c[v]=_,c[v+1]=_,c[v+2]=_,c[v+3]=t[S+1]}if(16==h)for(p=0;p<a;p++){var S;v=p<<2,_=t[S=p<<2],c[v]=_,c[v+1]=_,c[v+2]=_,c[v+3]=t[S+2]}}else if(0==d)for(m=i.tabs.tRNS?i.tabs.tRNS:-1,y=0;y<n;y++){const e=y*l,n=y*r;if(1==h)for(var A=0;A<r;A++){var k=(_=255*(t[e+(A>>>3)]>>>7-(7&A)&1))==255*m?0:255;u[n+A]=k<<24|_<<16|_<<8|_}else if(2==h)for(A=0;A<r;A++)k=(_=85*(t[e+(A>>>2)]>>>6-((3&A)<<1)&3))==85*m?0:255,u[n+A]=k<<24|_<<16|_<<8|_;else if(4==h)for(A=0;A<r;A++)k=(_=17*(t[e+(A>>>1)]>>>4-((1&A)<<2)&15))==17*m?0:255,u[n+A]=k<<24|_<<16|_<<8|_;else if(8==h)for(A=0;A<r;A++)k=(_=t[e+A])==m?0:255,u[n+A]=k<<24|_<<16|_<<8|_;else if(16==h)for(A=0;A<r;A++)_=t[e+(A<<1)],k=f(t,e+(A<<1))==m?0:255,u[n+A]=k<<24|_<<16|_<<8|_}return c}function r(e,t,r,s){const l=o(e),c=Math.ceil(r*l/8),u=new Uint8Array((c+1+e.interlace)*s);return t=e.tabs.CgBI?i(t,u):n(t,u),0==e.interlace?t=a(t,e,0,r,s):1==e.interlace&&(t=function(e,t){const r=t.width,n=t.height,i=o(t),s=i>>3,l=Math.ceil(r*i/8),c=new Uint8Array(n*l);let u=0;const d=[0,0,4,0,2,0,1],h=[0,4,0,2,0,1,0],f=[8,8,8,4,4,2,2],p=[8,8,4,4,2,2,1];let g=0;for(;g<7;){const o=f[g],v=p[g];let y=0,b=0,w=d[g];for(;w<n;)w+=o,b++;let x=h[g];for(;x<r;)x+=v,y++;const C=Math.ceil(y*i/8);a(e,t,u,y,b);let _=0,S=d[g];for(;S<n;){let t=h[g],n=u+_*C<<3;for(;t<r;){var m;if(1==i&&(m=(m=e[n>>3])>>7-(7&n)&1,c[S*l+(t>>3)]|=m<<7-(7&t)),2==i&&(m=(m=e[n>>3])>>6-(7&n)&3,c[S*l+(t>>2)]|=m<<6-((3&t)<<1)),4==i&&(m=(m=e[n>>3])>>4-(7&n)&15,c[S*l+(t>>1)]|=m<<4-((1&t)<<2)),i>=8){const r=S*l+t*s;for(let t=0;t<s;t++)c[r+t]=e[(n>>3)+t]}n+=i,t+=v}_++,S+=o}y*b!=0&&(u+=b*(1+C)),g+=1}return c}(t,e)),t}function n(e,t){return i(new Uint8Array(e.buffer,2,e.length-6),t)}var i=function(){const e={H:{}};return e.H.N=function(t,r){const n=Uint8Array;let i,o,a=0,s=0,l=0,c=0,u=0,d=0,h=0,f=0,p=0;if(3==t[0]&&0==t[1])return r||new n(0);const g=e.H,m=g.b,v=g.e,y=g.R,b=g.n,w=g.A,x=g.Z,C=g.m,_=null==r;for(_&&(r=new n(t.length>>>2<<5));0==a;)if(a=m(t,p,1),s=m(t,p+1,2),p+=3,0!=s){if(_&&(r=e.H.W(r,f+(1<<17))),1==s&&(i=C.J,o=C.h,d=511,h=31),2==s){l=v(t,p,5)+257,c=v(t,p+5,5)+1,u=v(t,p+10,4)+4,p+=14;let e=1;for(var S=0;S<38;S+=2)C.Q[S]=0,C.Q[S+1]=0;for(S=0;S<u;S++){const r=v(t,p+3*S,3);C.Q[1+(C.X[S]<<1)]=r,r>e&&(e=r)}p+=3*u,b(C.Q,e),w(C.Q,e,C.u),i=C.w,o=C.d,p=y(C.u,(1<<e)-1,l+c,t,p,C.v);const r=g.V(C.v,0,l,C.C);d=(1<<r)-1;const n=g.V(C.v,l,c,C.D);h=(1<<n)-1,b(C.C,r),w(C.C,r,i),b(C.D,n),w(C.D,n,o)}for(;;){const e=i[x(t,p)&d];p+=15&e;const n=e>>>4;if(n>>>8==0)r[f++]=n;else{if(256==n)break;{let e=f+n-254;if(n>264){const r=C.q[n-257];e=f+(r>>>3)+v(t,p,7&r),p+=7&r}const i=o[x(t,p)&h];p+=15&i;const a=i>>>4,s=C.c[a],l=(s>>>4)+m(t,p,15&s);for(p+=15&s;f<e;)r[f]=r[f++-l],r[f]=r[f++-l],r[f]=r[f++-l],r[f]=r[f++-l];f=e}}}}else{7&p&&(p+=8-(7&p));const i=4+(p>>>3),o=t[i-4]|t[i-3]<<8;_&&(r=e.H.W(r,f+o)),r.set(new n(t.buffer,t.byteOffset+i,o),f),p=i+o<<3,f+=o}return r.length==f?r:r.slice(0,f)},e.H.W=function(e,t){const r=e.length;if(t<=r)return e;const n=new Uint8Array(r<<1);return n.set(e,0),n},e.H.R=function(t,r,n,i,o,a){const s=e.H.e,l=e.H.Z;let c=0;for(;c<n;){const e=t[l(i,o)&r];o+=15&e;const n=e>>>4;if(n<=15)a[c]=n,c++;else{let e=0,t=0;16==n?(t=3+s(i,o,2),o+=2,e=a[c-1]):17==n?(t=3+s(i,o,3),o+=3):18==n&&(t=11+s(i,o,7),o+=7);const r=c+t;for(;c<r;)a[c]=e,c++}}return o},e.H.V=function(e,t,r,n){let i=0,o=0;const a=n.length>>>1;for(;o<r;){const r=e[o+t];n[o<<1]=0,n[1+(o<<1)]=r,r>i&&(i=r),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},e.H.n=function(t,r){const n=e.H.m,i=t.length;let o,a,s,l;const c=n.j;for(var u=0;u<=r;u++)c[u]=0;for(u=1;u<i;u+=2)c[t[u]]++;const d=n.K;for(o=0,c[0]=0,a=1;a<=r;a++)o=o+c[a-1]<<1,d[a]=o;for(s=0;s<i;s+=2)l=t[s+1],0!=l&&(t[s]=d[l],d[l]++)},e.H.A=function(t,r,n){const i=t.length,o=e.H.m.r;for(let e=0;e<i;e+=2)if(0!=t[e+1]){const i=e>>1,a=t[e+1],s=i<<4|a,l=r-a;let c=t[e]<<l;const u=c+(1<<l);for(;c!=u;)n[o[c]>>>15-r]=s,c++}},e.H.l=function(t,r){const n=e.H.m.r,i=15-r;for(let e=0;e<t.length;e+=2){const o=t[e]<<r-t[e+1];t[e]=n[o]>>>i}},e.H.M=function(e,t,r){r<<=7&t;const n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},e.H.I=function(e,t,r){r<<=7&t;const n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},e.H.e=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},e.H.b=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},e.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},e.H.m=function(){const e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){const t=e.H.m;for(var r=0;r<32768;r++){let e=r;e=(2863311530&e)>>>1|(1431655765&e)<<1,e=(3435973836&e)>>>2|(858993459&e)<<2,e=(4042322160&e)>>>4|(252645135&e)<<4,e=(4278255360&e)>>>8|(16711935&e)<<8,t.r[r]=(e>>>16|e<<16)>>>17}function n(e,t,r){for(;0!=t--;)e.push(0,r)}for(r=0;r<32;r++)t.q[r]=t.S[r]<<3|t.T[r],t.c[r]=t.p[r]<<4|t.z[r];n(t._,144,8),n(t._,112,9),n(t._,24,7),n(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),n(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),n(t.Q,19,0),n(t.C,286,0),n(t.D,30,0),n(t.v,320,0)}(),e.H.N}();function o(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function a(e,t,r,n,i){let a=o(t);const l=Math.ceil(n*a/8);let c,u;a=Math.ceil(a/8);let d=e[r],h=0;if(d>1&&(e[r]=[0,0,1][d-2]),3==d)for(h=a;h<l;h++)e[h+1]=e[h+1]+(e[h+1-a]>>>1)&255;for(let o=0;o<i;o++)if(c=r+o*l,u=c+o+1,d=e[u-1],h=0,0==d)for(;h<l;h++)e[c+h]=e[u+h];else if(1==d){for(;h<a;h++)e[c+h]=e[u+h];for(;h<l;h++)e[c+h]=e[u+h]+e[c+h-a]}else if(2==d)for(;h<l;h++)e[c+h]=e[u+h]+e[c+h-l];else if(3==d){for(;h<a;h++)e[c+h]=e[u+h]+(e[c+h-l]>>>1);for(;h<l;h++)e[c+h]=e[u+h]+(e[c+h-l]+e[c+h-a]>>>1)}else{for(;h<a;h++)e[c+h]=e[u+h]+s(0,e[c+h-l],0);for(;h<l;h++)e[c+h]=e[u+h]+s(e[c+h-a],e[c+h-l],e[c+h-a-l])}return e}function s(e,t,r){const n=e+t-r,i=n-e,o=n-t,a=n-r;return i*i<=o*o&&i*i<=a*a?e:o*o<=a*a?t:r}function l(t,r,n){n.width=e.readUint(t,r),r+=4,n.height=e.readUint(t,r),r+=4,n.depth=t[r],r++,n.ctype=t[r],r++,n.compress=t[r],r++,n.filter=t[r],r++,n.interlace=t[r],r++}function c(e,t,r,n,i,o,a,s,l){const c=Math.min(t,i),u=Math.min(r,o);let d=0,h=0;for(let x=0;x<u;x++)for(let r=0;r<c;r++)if(a>=0&&s>=0?(d=x*t+r<<2,h=(s+x)*i+a+r<<2):(d=(-s+x)*t-a+r<<2,h=x*i+r<<2),0==l)n[h]=e[d],n[h+1]=e[d+1],n[h+2]=e[d+2],n[h+3]=e[d+3];else if(1==l){var f=e[d+3]*(1/255),p=e[d]*f,g=e[d+1]*f,m=e[d+2]*f,v=n[h+3]*(1/255),y=n[h]*v,b=n[h+1]*v,w=n[h+2]*v;const t=1-f,r=f+v*t,i=0==r?0:1/r;n[h+3]=255*r,n[h+0]=(p+y*t)*i,n[h+1]=(g+b*t)*i,n[h+2]=(m+w*t)*i}else if(2==l)f=e[d+3],p=e[d],g=e[d+1],m=e[d+2],v=n[h+3],y=n[h],b=n[h+1],w=n[h+2],f==v&&p==y&&g==b&&m==w?(n[h]=0,n[h+1]=0,n[h+2]=0,n[h+3]=0):(n[h]=p,n[h+1]=g,n[h+2]=m,n[h+3]=f);else if(3==l){if(f=e[d+3],p=e[d],g=e[d+1],m=e[d+2],v=n[h+3],y=n[h],b=n[h+1],w=n[h+2],f==v&&p==y&&g==b&&m==w)continue;if(f<220&&v>20)return!1}return!0}return{decode:function(t){const o=new Uint8Array(t);let a=8;const s=e,c=s.readUshort,u=s.readUint,d={tabs:{},frames:[]},h=new Uint8Array(o.length);let f,p=0,g=0;const m=[137,80,78,71,13,10,26,10];for(var v=0;v<8;v++)if(o[v]!=m[v])throw"The input is not a PNG file!";for(;a<o.length;){const t=s.readUint(o,a);a+=4;const m=s.readASCII(o,a,4);if(a+=4,"IHDR"==m)l(o,a,d);else if("iCCP"==m){for(var y=a;0!=o[y];)y++;s.readASCII(o,a,y-a),o[y+1];const r=o.slice(y+2,a+t);let l=null;try{l=n(r)}catch(e){l=i(r)}d.tabs[m]=l}else if("CgBI"==m)d.tabs[m]=o.slice(a,a+4);else if("IDAT"==m){for(v=0;v<t;v++)h[p+v]=o[a+v];p+=t}else if("acTL"==m)d.tabs[m]={num_frames:u(o,a),num_plays:u(o,a+4)},f=new Uint8Array(o.length);else if("fcTL"==m){0!=g&&((S=d.frames[d.frames.length-1]).data=r(d,f.slice(0,g),S.rect.width,S.rect.height),g=0);const e={x:u(o,a+12),y:u(o,a+16),width:u(o,a+4),height:u(o,a+8)};let t=c(o,a+22);t=c(o,a+20)/(0==t?100:t);const n={rect:e,delay:Math.round(1e3*t),dispose:o[a+24],blend:o[a+25]};d.frames.push(n)}else if("fdAT"==m){for(v=0;v<t-4;v++)f[g+v]=o[a+v+4];g+=t-4}else if("pHYs"==m)d.tabs[m]=[s.readUint(o,a),s.readUint(o,a+4),o[a+8]];else if("cHRM"==m)for(d.tabs[m]=[],v=0;v<8;v++)d.tabs[m].push(s.readUint(o,a+4*v));else if("tEXt"==m||"zTXt"==m){null==d.tabs[m]&&(d.tabs[m]={});var b=s.nextZero(o,a),w=s.readASCII(o,a,b-a),x=a+t-b-1;if("tEXt"==m)_=s.readASCII(o,b+1,x);else{var C=n(o.slice(b+2,b+2+x));_=s.readUTF8(C,0,C.length)}d.tabs[m][w]=_}else if("iTXt"==m){null==d.tabs[m]&&(d.tabs[m]={}),b=0,y=a,b=s.nextZero(o,y),w=s.readASCII(o,y,b-y);const e=o[y=b+1];var _;o[y+1],y+=2,b=s.nextZero(o,y),s.readASCII(o,y,b-y),y=b+1,b=s.nextZero(o,y),s.readUTF8(o,y,b-y),x=t-((y=b+1)-a),0==e?_=s.readUTF8(o,y,x):(C=n(o.slice(y,y+x)),_=s.readUTF8(C,0,C.length)),d.tabs[m][w]=_}else if("PLTE"==m)d.tabs[m]=s.readBytes(o,a,t);else if("hIST"==m){const e=d.tabs.PLTE.length/3;for(d.tabs[m]=[],v=0;v<e;v++)d.tabs[m].push(c(o,a+2*v))}else if("tRNS"==m)3==d.ctype?d.tabs[m]=s.readBytes(o,a,t):0==d.ctype?d.tabs[m]=c(o,a):2==d.ctype&&(d.tabs[m]=[c(o,a),c(o,a+2),c(o,a+4)]);else if("gAMA"==m)d.tabs[m]=s.readUint(o,a)/1e5;else if("sRGB"==m)d.tabs[m]=o[a];else if("bKGD"==m)0==d.ctype||4==d.ctype?d.tabs[m]=[c(o,a)]:2==d.ctype||6==d.ctype?d.tabs[m]=[c(o,a),c(o,a+2),c(o,a+4)]:3==d.ctype&&(d.tabs[m]=o[a]);else if("IEND"==m)break;a+=t,s.readUint(o,a),a+=4}var S;return 0!=g&&((S=d.frames[d.frames.length-1]).data=r(d,f.slice(0,g),S.rect.width,S.rect.height)),d.data=r(d,h,d.width,d.height),delete d.compress,delete d.interlace,delete d.filter,d},toRGBA8:function(e){const r=e.width,n=e.height;if(null==e.tabs.acTL)return[t(e.data,r,n,e).buffer];const i=[];null==e.frames[0].data&&(e.frames[0].data=e.data);const o=r*n*4,a=new Uint8Array(o),s=new Uint8Array(o),l=new Uint8Array(o);for(let d=0;d<e.frames.length;d++){const h=e.frames[d],f=h.rect.x,p=h.rect.y,g=h.rect.width,m=h.rect.height,v=t(h.data,g,m,e);if(0!=d)for(var u=0;u<o;u++)l[u]=a[u];if(0==h.blend?c(v,g,m,a,r,n,f,p,0):1==h.blend&&c(v,g,m,a,r,n,f,p,1),i.push(a.buffer.slice(0)),0==h.dispose);else if(1==h.dispose)c(s,g,m,a,r,n,f,p,0);else if(2==h.dispose)for(u=0;u<o;u++)a[u]=l[u]}return i},_paeth:s,_copyTile:c,_bin:e}}();!function(){const{_copyTile:e}=zi,{_bin:t}=zi,r=zi._paeth;var n={table:function(){const e=new Uint32Array(256);for(let t=0;t<256;t++){let r=t;for(let e=0;e<8;e++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update(e,t,r,i){for(let o=0;o<i;o++)e=n.table[255&(e^t[r+o])]^e>>>8;return e},crc:(e,t,r)=>4294967295^n.update(4294967295,e,t,r)};function i(e,t,r,n){t[r]+=e[0]*n>>4,t[r+1]+=e[1]*n>>4,t[r+2]+=e[2]*n>>4,t[r+3]+=e[3]*n>>4}function o(e){return Math.max(0,Math.min(255,e))}function a(e,t){const r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}function s(e,t,r,n,s,l,c){null==c&&(c=1);const u=n.length,d=[];for(var h=0;h<u;h++){const e=n[h];d.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(h=0;h<u;h++){let e=4294967295;for(var f=0,p=0;p<u;p++){var g=a(d[h],d[p]);p!=h&&g<e&&(e=g,f=p)}}const m=new Uint32Array(s.buffer),v=new Int16Array(t*r*4),y=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<y.length;h++)y[h]=255*((y[h]+.5)/16-.5);for(let w=0;w<r;w++)for(let s=0;s<t;s++){var b;h=4*(w*t+s),2!=c?b=[o(e[h]+v[h]),o(e[h+1]+v[h+1]),o(e[h+2]+v[h+2]),o(e[h+3]+v[h+3])]:(g=y[4*(3&w)+(3&s)],b=[o(e[h]+g),o(e[h+1]+g),o(e[h+2]+g),o(e[h+3]+g)]),f=0;let x=16777215;for(p=0;p<u;p++){const e=a(b,d[p]);e<x&&(x=e,f=p)}const C=d[f],_=[b[0]-C[0],b[1]-C[1],b[2]-C[2],b[3]-C[3]];1==c&&(s!=t-1&&i(_,v,h+4,7),w!=r-1&&(0!=s&&i(_,v,h+4*t-4,3),i(_,v,h+4*t,5),s!=t-1&&i(_,v,h+4*t+4,1))),l[h>>2]=f,m[h>>2]=n[f]}}function l(e,r,i,o,a){null==a&&(a={});const{crc:s}=n,l=t.writeUint,c=t.writeUshort,u=t.writeASCII;let d=8;const h=e.frames.length>1;let f,p=!1,g=33+(h?20:0);if(null!=a.sRGB&&(g+=13),null!=a.pHYs&&(g+=21),null!=a.iCCP&&(f=pako.deflate(a.iCCP),g+=21+f.length+4),3==e.ctype){for(var m=e.plte.length,v=0;v<m;v++)e.plte[v]>>>24!=255&&(p=!0);g+=8+3*m+4+(p?8+1*m+4:0)}for(var y=0;y<e.frames.length;y++)h&&(g+=38),g+=(C=e.frames[y]).cimg.length+12,0!=y&&(g+=4);g+=12;const b=new Uint8Array(g),w=[137,80,78,71,13,10,26,10];for(v=0;v<8;v++)b[v]=w[v];if(l(b,d,13),d+=4,u(b,d,"IHDR"),d+=4,l(b,d,r),d+=4,l(b,d,i),d+=4,b[d]=e.depth,d++,b[d]=e.ctype,d++,b[d]=0,d++,b[d]=0,d++,b[d]=0,d++,l(b,d,s(b,d-17,17)),d+=4,null!=a.sRGB&&(l(b,d,1),d+=4,u(b,d,"sRGB"),d+=4,b[d]=a.sRGB,d++,l(b,d,s(b,d-5,5)),d+=4),null!=a.iCCP){const e=13+f.length;l(b,d,e),d+=4,u(b,d,"iCCP"),d+=4,u(b,d,"ICC profile"),d+=11,d+=2,b.set(f,d),d+=f.length,l(b,d,s(b,d-(e+4),e+4)),d+=4}if(null!=a.pHYs&&(l(b,d,9),d+=4,u(b,d,"pHYs"),d+=4,l(b,d,a.pHYs[0]),d+=4,l(b,d,a.pHYs[1]),d+=4,b[d]=a.pHYs[2],d++,l(b,d,s(b,d-13,13)),d+=4),h&&(l(b,d,8),d+=4,u(b,d,"acTL"),d+=4,l(b,d,e.frames.length),d+=4,l(b,d,null!=a.loop?a.loop:0),d+=4,l(b,d,s(b,d-12,12)),d+=4),3==e.ctype){for(l(b,d,3*(m=e.plte.length)),d+=4,u(b,d,"PLTE"),d+=4,v=0;v<m;v++){const t=3*v,r=e.plte[v],n=255&r,i=r>>>8&255,o=r>>>16&255;b[d+t+0]=n,b[d+t+1]=i,b[d+t+2]=o}if(d+=3*m,l(b,d,s(b,d-3*m-4,3*m+4)),d+=4,p){for(l(b,d,m),d+=4,u(b,d,"tRNS"),d+=4,v=0;v<m;v++)b[d+v]=e.plte[v]>>>24&255;d+=m,l(b,d,s(b,d-m-4,m+4)),d+=4}}let x=0;for(y=0;y<e.frames.length;y++){var C=e.frames[y];h&&(l(b,d,26),d+=4,u(b,d,"fcTL"),d+=4,l(b,d,x++),d+=4,l(b,d,C.rect.width),d+=4,l(b,d,C.rect.height),d+=4,l(b,d,C.rect.x),d+=4,l(b,d,C.rect.y),d+=4,c(b,d,o[y]),d+=2,c(b,d,1e3),d+=2,b[d]=C.dispose,d++,b[d]=C.blend,d++,l(b,d,s(b,d-30,30)),d+=4);const t=C.cimg;l(b,d,(m=t.length)+(0==y?0:4)),d+=4;const r=d;u(b,d,0==y?"IDAT":"fdAT"),d+=4,0!=y&&(l(b,d,x++),d+=4),b.set(t,d),d+=m,l(b,d,s(b,r,d-r)),d+=4}return l(b,d,0),d+=4,u(b,d,"IEND"),d+=4,l(b,d,s(b,d-4,4)),d+=4,b.buffer}function c(e,t,r){for(let n=0;n<e.frames.length;n++){const i=e.frames[n];i.rect.width;const o=i.rect.height,a=new Uint8Array(o*i.bpl+o);i.cimg=f(i.img,o,i.bpp,i.bpl,a,t,r)}}function u(t,r,n,i,o){const a=o[0],l=o[1],c=o[2],u=o[3],f=o[4],p=o[5];let m=6,v=8,y=255;for(var b=0;b<t.length;b++){const e=new Uint8Array(t[b]);for(var w=e.length,x=0;x<w;x+=4)y&=e[x+3]}const C=255!=y,_=function(t,r,n,i,o,a){const s=[];for(var l=0;l<t.length;l++){const d=new Uint8Array(t[l]),f=new Uint32Array(d.buffer);var c;let g=0,m=0,v=r,y=n,b=i?1:0;if(0!=l){const w=a||i||1==l||0!=s[l-2].dispose?1:2;let x=0,C=1e9;for(let e=0;e<w;e++){var u=new Uint8Array(t[l-1-e]);const i=new Uint32Array(t[l-1-e]);let a=r,s=n,c=-1,d=-1;for(let e=0;e<n;e++)for(let t=0;t<r;t++)f[p=e*r+t]!=i[p]&&(t<a&&(a=t),t>c&&(c=t),e<s&&(s=e),e>d&&(d=e));-1==c&&(a=s=c=d=0),o&&(!(1&~a)&&a--,!(1&~s)&&s--);const h=(c-a+1)*(d-s+1);h<C&&(C=h,x=e,g=a,m=s,v=c-a+1,y=d-s+1)}u=new Uint8Array(t[l-1-x]),1==x&&(s[l-1].dispose=2),c=new Uint8Array(v*y*4),e(u,r,n,c,v,y,-g,-m,0),b=e(d,r,n,c,v,y,-g,-m,3)?1:0,1==b?h(d,r,n,c,{x:g,y:m,width:v,height:y}):e(d,r,n,c,v,y,-g,-m,0)}else c=d.slice(0);s.push({rect:{x:g,y:m,width:v,height:y},img:c,blend:b,dispose:0})}if(i)for(l=0;l<s.length;l++){if(1==(g=s[l]).blend)continue;const e=g.rect,i=s[l-1].rect,a=Math.min(e.x,i.x),c=Math.min(e.y,i.y),u={x:a,y:c,width:Math.max(e.x+e.width,i.x+i.width)-a,height:Math.max(e.y+e.height,i.y+i.height)-c};s[l-1].dispose=1,l-1!=0&&d(t,r,n,s,l-1,u,o),d(t,r,n,s,l,u,o)}let f=0;if(1!=t.length)for(var p=0;p<s.length;p++){var g;f+=(g=s[p]).rect.width*g.rect.height}return s}(t,r,n,a,l,c),S={},A=[],k=[];if(0!=i){const e=[];for(x=0;x<_.length;x++)e.push(_[x].img.buffer);const t=function(e){let t=0;for(var r=0;r<e.length;r++)t+=e[r].byteLength;const n=new Uint8Array(t);let i=0;for(r=0;r<e.length;r++){const t=new Uint8Array(e[r]),o=t.length;for(let e=0;e<o;e+=4){let r=t[e],o=t[e+1],a=t[e+2];const s=t[e+3];0==s&&(r=o=a=0),n[i+e]=r,n[i+e+1]=o,n[i+e+2]=a,n[i+e+3]=s}i+=o}return n.buffer}(e),r=g(t,i);for(x=0;x<r.plte.length;x++)A.push(r.plte[x].est.rgba);let n=0;for(x=0;x<_.length;x++){const e=(I=_[x]).img.length;var E=new Uint8Array(r.inds.buffer,n>>2,e>>2);k.push(E);const t=new Uint8Array(r.abuf,n,e);p&&s(I.img,I.rect.width,I.rect.height,A,t,E),I.img.set(t),n+=e}}else for(b=0;b<_.length;b++){var I=_[b];const e=new Uint32Array(I.img.buffer);var j=I.rect.width;for(w=e.length,E=new Uint8Array(w),k.push(E),x=0;x<w;x++){const t=e[x];if(0!=x&&t==e[x-1])E[x]=E[x-1];else if(x>j&&t==e[x-j])E[x]=E[x-j];else{let e=S[t];if(null==e&&(S[t]=e=A.length,A.push(t),A.length>=300))break;E[x]=e}}}const T=A.length;for(T<=256&&0==f&&(v=T<=2?1:T<=4?2:T<=16?4:8,v=Math.max(v,u)),b=0;b<_.length;b++){(I=_[b]).rect.x,I.rect.y,j=I.rect.width;const e=I.rect.height;let t=I.img;new Uint32Array(t.buffer);let r=4*j,n=4;if(T<=256&&0==f){r=Math.ceil(v*j/8);var F=new Uint8Array(r*e);const i=k[b];for(let t=0;t<e;t++){x=t*r;const e=t*j;if(8==v)for(var O=0;O<j;O++)F[x+O]=i[e+O];else if(4==v)for(O=0;O<j;O++)F[x+(O>>1)]|=i[e+O]<<4-4*(1&O);else if(2==v)for(O=0;O<j;O++)F[x+(O>>2)]|=i[e+O]<<6-2*(3&O);else if(1==v)for(O=0;O<j;O++)F[x+(O>>3)]|=i[e+O]<<7-1*(7&O)}t=F,m=3,n=1}else if(0==C&&1==_.length){F=new Uint8Array(j*e*3);const i=j*e;for(x=0;x<i;x++){const e=3*x,r=4*x;F[e]=t[r],F[e+1]=t[r+1],F[e+2]=t[r+2]}t=F,m=2,n=3,r=3*j}I.img=t,I.bpl=r,I.bpp=n}return{ctype:m,depth:v,plte:A,frames:_}}function d(t,r,n,i,o,a,s){const l=Uint8Array,c=Uint32Array,u=new l(t[o-1]),d=new c(t[o-1]),f=o+1<t.length?new l(t[o+1]):null,p=new l(t[o]),g=new c(p.buffer);let m=r,v=n,y=-1,b=-1;for(let e=0;e<a.height;e++)for(let t=0;t<a.width;t++){const n=a.x+t,s=a.y+e,l=s*r+n,c=g[l];0==c||0==i[o-1].dispose&&d[l]==c&&(null==f||0!=f[4*l+3])||(n<m&&(m=n),n>y&&(y=n),s<v&&(v=s),s>b&&(b=s))}-1==y&&(m=v=y=b=0),s&&(!(1&~m)&&m--,!(1&~v)&&v--),a={x:m,y:v,width:y-m+1,height:b-v+1};const w=i[o];w.rect=a,w.blend=1,w.img=new Uint8Array(a.width*a.height*4),0==i[o-1].dispose?(e(u,r,n,w.img,a.width,a.height,-a.x,-a.y,0),h(p,r,n,w.img,a)):e(p,r,n,w.img,a.width,a.height,-a.x,-a.y,0)}function h(t,r,n,i,o){e(t,r,n,i,o.width,o.height,-o.x,-o.y,2)}function f(e,t,r,n,i,o,a){const s=[];let l,c=[0,1,2,3,4];-1!=o?c=[o]:(t*n>5e5||1==r)&&(c=[0]),a&&(l={level:0});const u=Di;for(var d=0;d<c.length;d++){for(let o=0;o<t;o++)p(i,e,o,n,r,c[d]);s.push(u.deflate(i,l))}let h,f=1e9;for(d=0;d<s.length;d++)s[d].length<f&&(h=d,f=s[d].length);return s[h]}function p(e,t,n,i,o,a){const s=n*i;let l=s+n;if(e[l]=a,l++,0==a)if(i<500)for(var c=0;c<i;c++)e[l+c]=t[s+c];else e.set(new Uint8Array(t.buffer,s,i),l);else if(1==a){for(c=0;c<o;c++)e[l+c]=t[s+c];for(c=o;c<i;c++)e[l+c]=t[s+c]-t[s+c-o]+256&255}else if(0==n){for(c=0;c<o;c++)e[l+c]=t[s+c];if(2==a)for(c=o;c<i;c++)e[l+c]=t[s+c];if(3==a)for(c=o;c<i;c++)e[l+c]=t[s+c]-(t[s+c-o]>>1)+256&255;if(4==a)for(c=o;c<i;c++)e[l+c]=t[s+c]-r(t[s+c-o],0,0)+256&255}else{if(2==a)for(c=0;c<i;c++)e[l+c]=t[s+c]+256-t[s+c-i]&255;if(3==a){for(c=0;c<o;c++)e[l+c]=t[s+c]+256-(t[s+c-i]>>1)&255;for(c=o;c<i;c++)e[l+c]=t[s+c]+256-(t[s+c-i]+t[s+c-o]>>1)&255}if(4==a){for(c=0;c<o;c++)e[l+c]=t[s+c]+256-r(0,t[s+c-i],0)&255;for(c=o;c<i;c++)e[l+c]=t[s+c]+256-r(t[s+c-o],t[s+c-i],t[s+c-o-i])&255}}}function g(e,t){const r=new Uint8Array(e),n=r.slice(0),i=new Uint32Array(n.buffer),o=m(n,t),a=o[0],s=o[1],l=r.length,c=new Uint8Array(l>>2);let u;if(r.length<2e7)for(var d=0;d<l;d+=4)u=v(a,h=r[d]*(1/255),f=r[d+1]*(1/255),p=r[d+2]*(1/255),g=r[d+3]*(1/255)),c[d>>2]=u.ind,i[d>>2]=u.est.rgba;else for(d=0;d<l;d+=4){var h=r[d]*(1/255),f=r[d+1]*(1/255),p=r[d+2]*(1/255),g=r[d+3]*(1/255);for(u=a;u.left;)u=y(u.est,h,f,p,g)<=0?u.left:u.right;c[d>>2]=u.ind,i[d>>2]=u.est.rgba}return{abuf:n.buffer,inds:c,plte:s}}function m(e,t,r){null==r&&(r=1e-4);const n=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=x(e,i.i0,i.i1),i.est=C(i.bst);const o=[i];for(;o.length<t;){let t=0,i=0;for(var a=0;a<o.length;a++)o[a].est.L>t&&(t=o[a].est.L,i=a);if(t<r)break;const s=o[i],l=b(e,n,s.i0,s.i1,s.est.e,s.est.eMq255);if(s.i0>=l||s.i1<=l){s.est.L=0;continue}const c={i0:s.i0,i1:l,bst:null,est:null,tdst:0,left:null,right:null};c.bst=x(e,c.i0,c.i1),c.est=C(c.bst);const u={i0:l,i1:s.i1,bst:null,est:null,tdst:0,left:null,right:null};for(u.bst={R:[],m:[],N:s.bst.N-c.bst.N},a=0;a<16;a++)u.bst.R[a]=s.bst.R[a]-c.bst.R[a];for(a=0;a<4;a++)u.bst.m[a]=s.bst.m[a]-c.bst.m[a];u.est=C(u.bst),s.left=c,s.right=u,o[i]=c,o.push(u)}for(o.sort((e,t)=>t.bst.N-e.bst.N),a=0;a<o.length;a++)o[a].ind=a;return[i,o]}function v(e,t,r,n,i){if(null==e.left)return e.tdst=function(e,t,r,n,i){const o=t-e[0],a=r-e[1],s=n-e[2],l=i-e[3];return o*o+a*a+s*s+l*l}(e.est.q,t,r,n,i),e;const o=y(e.est,t,r,n,i);let a=e.left,s=e.right;o>0&&(a=e.right,s=e.left);const l=v(a,t,r,n,i);if(l.tdst<=o*o)return l;const c=v(s,t,r,n,i);return c.tdst<l.tdst?c:l}function y(e,t,r,n,i){const{e:o}=e;return o[0]*t+o[1]*r+o[2]*n+o[3]*i-e.eMq}function b(e,t,r,n,i,o){for(n-=4;r<n;){for(;w(e,r,i)<=o;)r+=4;for(;w(e,n,i)>o;)n-=4;if(r>=n)break;const a=t[r>>2];t[r>>2]=t[n>>2],t[n>>2]=a,r+=4,n-=4}for(;w(e,r,i)>o;)r-=4;return r+4}function w(e,t,r){return e[t]*r[0]+e[t+1]*r[1]+e[t+2]*r[2]+e[t+3]*r[3]}function x(e,t,r){const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],o=r-t>>2;for(let a=t;a<r;a+=4){const t=e[a]*(1/255),r=e[a+1]*(1/255),o=e[a+2]*(1/255),s=e[a+3]*(1/255);i[0]+=t,i[1]+=r,i[2]+=o,i[3]+=s,n[0]+=t*t,n[1]+=t*r,n[2]+=t*o,n[3]+=t*s,n[5]+=r*r,n[6]+=r*o,n[7]+=r*s,n[10]+=o*o,n[11]+=o*s,n[15]+=s*s}return n[4]=n[1],n[8]=n[2],n[9]=n[6],n[12]=n[3],n[13]=n[7],n[14]=n[11],{R:n,m:i,N:o}}function C(e){const{R:t}=e,{m:r}=e,{N:n}=e,i=r[0],o=r[1],a=r[2],s=r[3],l=0==n?0:1/n,c=[t[0]-i*i*l,t[1]-i*o*l,t[2]-i*a*l,t[3]-i*s*l,t[4]-o*i*l,t[5]-o*o*l,t[6]-o*a*l,t[7]-o*s*l,t[8]-a*i*l,t[9]-a*o*l,t[10]-a*a*l,t[11]-a*s*l,t[12]-s*i*l,t[13]-s*o*l,t[14]-s*a*l,t[15]-s*s*l],u=c,d=_;let h=[Math.random(),Math.random(),Math.random(),Math.random()],f=0,p=0;if(0!=n)for(let m=0;m<16&&(h=d.multVec(u,h),p=Math.sqrt(d.dot(h,h)),h=d.sml(1/p,h),!(0!=m&&Math.abs(p-f)<1e-9));m++)f=p;const g=[i*l,o*l,a*l,s*l];return{Cov:c,q:g,e:h,L:f,eMq255:d.dot(d.sml(255,g),h),eMq:d.dot(h,g),rgba:(Math.round(255*g[3])<<24|Math.round(255*g[2])<<16|Math.round(255*g[1])<<8|Math.round(255*g[0]))>>>0}}var _={multVec:(e,t)=>[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]],dot:(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],sml:(e,t)=>[e*t[0],e*t[1],e*t[2],e*t[3]]};zi.encode=function(e,t,r,n,i,o,a){null==n&&(n=0),null==a&&(a=!1);const s=u(e,t,r,n,[!1,!1,!1,0,a,!1]);return c(s,-1),l(s,t,r,i,o)},zi.encodeLL=function(e,t,r,n,i,o,a,s){const u={ctype:0+(1==n?0:2)+(0==i?0:4),depth:o,frames:[]},d=(n+i)*o,h=d*t;for(let l=0;l<e.length;l++)u.frames.push({rect:{x:0,y:0,width:t,height:r},img:new Uint8Array(e[l]),blend:0,dispose:1,bpp:Math.ceil(d/8),bpl:Math.ceil(h/8)});return c(u,0,!0),l(u,t,r,a,s)},zi.encode.compress=u,zi.encode.dither=s,zi.quantize=g,zi.quantize.getKDtree=m,zi.quantize.getNearest=v}();const Bi={toArrayBuffer(e,t){const r=e.width,n=e.height,i=r<<2,o=e.getContext("2d").getImageData(0,0,r,n),a=new Uint32Array(o.data.buffer),s=(32*r+31)/32<<2,l=s*n,c=122+l,u=new ArrayBuffer(c),d=new DataView(u),h=1<<20;let f,p,g,m,v=h,y=0,b=0,w=0;function x(e){d.setUint16(b,e,!0),b+=2}function C(e){d.setUint32(b,e,!0),b+=4}function _(e){b+=e}x(19778),C(c),_(4),C(122),C(108),C(r),C(-n>>>0),x(1),x(32),C(3),C(l),C(2835),C(2835),_(8),C(16711680),C(65280),C(255),C(4278190080),C(1466527264),function e(){for(;y<n&&v>0;){for(m=122+y*s,f=0;f<i;)v--,p=a[w++],g=p>>>24,d.setUint32(m+f,p<<8|g),f+=4;y++}w<a.length?(v=h,setTimeout(e,Bi._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var Ui={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Vi={[Ui.CHROME]:16384,[Ui.FIREFOX]:11180,[Ui.DESKTOP_SAFARI]:16384,[Ui.IE]:8192,[Ui.IOS]:4096,[Ui.ETC]:8192};const Hi="undefined"!=typeof window,$i="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Wi=Hi&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Gi=(Hi||$i)&&(Wi&&Wi.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),qi=(Hi||$i)&&(Wi&&Wi.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function Yi(e,t,r=Date.now()){return new Promise(n=>{const i=e.split(","),o=i[0].match(/:(.*?);/)[1],a=globalThis.atob(i[1]);let s=a.length;const l=new Uint8Array(s);for(;s--;)l[s]=a.charCodeAt(s);const c=new Blob([l],{type:o});c.name=t,c.lastModified=r,n(c)})}function Xi(e){return new Promise((t,r)=>{const n=new qi;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function Ki(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function Zi(){if(void 0!==Zi.cachedResult)return Zi.cachedResult;let e=Ui.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=Ui.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=Ui.IOS:/Safari/i.test(t)?e=Ui.DESKTOP_SAFARI:/Firefox/i.test(t)?e=Ui.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=Ui.IE),Zi.cachedResult=e,Zi.cachedResult}function Ji(e,t){const r=Zi(),n=Vi[r];let i=e,o=t,a=i*o;const s=i>o?o/i:i/o;for(;a>n*n;){const e=(n+i)/2,t=(n+o)/2;e<t?(o=t,i=t*s):(o=e*s,i=e),a=i*o}return{width:i,height:o}}function Qi(e,t){let r,n;try{if(r=new OffscreenCanvas(e,t),n=r.getContext("2d"),null===n)throw new Error("getContext of OffscreenCanvas returns null")}catch(e){r=document.createElement("canvas"),n=r.getContext("2d")}return r.width=e,r.height=t,[r,n]}function eo(e,t){const{width:r,height:n}=Ji(e.width,e.height),[i,o]=Qi(r,n);return t&&/jpe?g/.test(t)&&(o.fillStyle="white",o.fillRect(0,0,i.width,i.height)),o.drawImage(e,0,0,i.width,i.height),i}function to(){return void 0!==to.cachedResult||(to.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),to.cachedResult}function ro(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=eo(i,t.fileType||e.type),r([i,o])}catch(e){return n(e)}},s=function(t){try{var r=function(e){try{throw e}catch(e){return n(e)}};try{let t;return Xi(e).then(function(e){try{return t=e,Ki(t).then(function(e){try{return i=e,function(){try{return a()}catch(e){return n(e)}}()}catch(e){return r(e)}},r)}catch(e){return r(e)}},r)}catch(e){r(e)}}catch(e){return n(e)}};try{if(to()||[Ui.DESKTOP_SAFARI,Ui.MOBILE_SAFARI].includes(Zi()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then(function(e){try{return i=e,a()}catch(e){return s()}},s)}catch(e){s()}})}function no(e,t,r,n,i=1){return new Promise(function(o,a){let s;if("image/png"===t){let c,u,d;return c=e.getContext("2d"),({data:u}=c.getImageData(0,0,e.width,e.height)),d=zi.encode([u.buffer],e.width,e.height,4096*i),s=new Blob([d],{type:t}),s.name=r,s.lastModified=n,l.call(this)}{if("image/bmp"===t)return new Promise(t=>Bi.toBlob(e,t)).then(function(e){try{return s=e,s.name=r,s.lastModified=n,h.call(this)}catch(e){return a(e)}}.bind(this),a);{if("function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:i}).then(function(e){try{return s=e,s.name=r,s.lastModified=n,f.call(this)}catch(e){return a(e)}}.bind(this),a);{let p;return p=e.toDataURL(t,i),Yi(p,r,n).then(function(e){try{return s=e,f.call(this)}catch(e){return a(e)}}.bind(this),a)}function f(){return h.call(this)}}function h(){return l.call(this)}}function l(){return o(s)}})}function io(e){e.width=0,e.height=0}function oo(){return new Promise(function(e,t){let r,n,i,o;return void 0!==oo.cachedResult?e(oo.cachedResult):Yi("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,ro(r).then(function(a){try{return n=a[1],no(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,io(n),ro(i).then(function(r){try{return o=r[0],oo.cachedResult=1===o.width&&2===o.height,e(oo.cachedResult)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)})}function ao(e){return new Promise((t,r)=>{const n=new qi;n.onload=e=>{const r=new DataView(e.target.result);if(65496!=r.getUint16(0,!1))return t(-2);const n=r.byteLength;let i=2;for(;i<n;){if(r.getUint16(i+2,!1)<=8)return t(-1);const e=r.getUint16(i,!1);if(i+=2,65505==e){if(1165519206!=r.getUint32(i+=2,!1))return t(-1);const e=18761==r.getUint16(i+=6,!1);i+=r.getUint32(i+4,e);const n=r.getUint16(i,e);i+=2;for(let o=0;o<n;o++)if(274==r.getUint16(i+12*o,e))return t(r.getUint16(i+12*o+8,e))}else{if(65280&~e)break;i+=r.getUint16(i,!1)}}return t(-1)},n.onerror=e=>r(e),n.readAsArrayBuffer(e)})}function so(e,t){const{width:r}=e,{height:n}=e,{maxWidthOrHeight:i}=t;let o,a=e;return isFinite(i)&&(r>i||n>i)&&([a,o]=Qi(r,n),r>n?(a.width=i,a.height=n/r*i):(a.width=r/n*i,a.height=i),o.drawImage(e,0,0,a.width,a.height),io(e)),a}function lo(e,t){const{width:r}=e,{height:n}=e,[i,o]=Qi(r,n);switch(t>4&&t<9?(i.width=n,i.height=r):(i.width=r,i.height=n),t){case 2:o.transform(-1,0,0,1,r,0);break;case 3:o.transform(-1,0,0,-1,r,n);break;case 4:o.transform(1,0,0,-1,0,n);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,n,0);break;case 7:o.transform(0,-1,-1,0,n,r);break;case 8:o.transform(0,-1,1,0,0,r)}return o.drawImage(e,0,0,r,n),io(e),i}function co(e,t,r=0){return new Promise(function(n,i){let o,a,s,l,c,u,d,h,f,p,g,m,v,y,b,w,x,C,_,S;function A(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=e,t.onProgress(Math.min(o,100))}function k(e){if(t.signal&&t.signal.aborted)throw t.signal.reason;o=Math.min(Math.max(e,o),100),t.onProgress(o)}return o=r,a=t.maxIteration||10,s=1024*t.maxSizeMB*1024,A(),ro(e,t).then(function(r){try{return[,l]=r,A(),c=so(l,t),A(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return ao(e).then(function(e){try{return i=e,o.call(this)}catch(e){return n(e)}}.bind(this),n);function o(){return r(i)}return o.call(this)}).then(function(r){try{return u=r,A(),oo().then(function(r){try{return d=r?c:lo(c,u),A(),h=t.initialQuality||1,f=t.fileType||e.type,no(d,f,e.name,e.lastModified,h).then(function(r){try{{if(p=r,A(),g=p.size>s,m=p.size>e.size,!g&&!m)return k(100),n(p);var o;function E(){if(a--&&(b>s||b>v)){let t,r;return t=S?.95*_.width:_.width,r=S?.95*_.height:_.height,[x,C]=Qi(t,r),C.drawImage(_,0,0,t,r),h*="image/png"===f?.85:.95,no(x,f,e.name,e.lastModified,h).then(function(e){try{return w=e,io(_),_=x,b=w.size,k(Math.min(99,Math.floor((y-b)/(y-s)*100))),E}catch(e){return i(e)}},i)}return[1]}return v=e.size,y=p.size,b=y,_=d,S=!t.alwaysKeepResolution&&g,(o=function(e){for(;e;){if(e.then)return void e.then(o,i);try{if(e.pop){if(e.length)return e.pop()?I.call(this):e;e=E}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(E);function I(){return io(_),io(x),io(c),io(d),io(l),k(100),n(w)}}}catch(u){return i(u)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)})}let uo;function ho(e,t){return new Promise(function(r,n){let i,o,a,s,l,c;if(i={...t},a=0,({onProgress:s}=i),i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,l="boolean"!=typeof i.useWebWorker||i.useWebWorker,delete i.useWebWorker,i.onProgress=e=>{a=e,"function"==typeof s&&s(a)},!(e instanceof Blob||e instanceof Gi))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(c="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!l||"function"!=typeof Worker||c)return co(e,i).then(function(e){try{return o=e,h.call(this)}catch(e){return n(e)}}.bind(this),n);var u=function(){try{return h.call(this)}catch(e){return n(e)}}.bind(this),d=function(t){try{return co(e,i).then(function(e){try{return o=e,u()}catch(e){return n(e)}},n)}catch(e){return n(e)}};try{return i.libURL=i.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",function(e,t){return new Promise((r,n)=>{uo||(uo=function(){const e=[];return e.push("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"),URL.createObjectURL(new Blob(e))}());const i=new Worker(uo);i.addEventListener("message",function(e){if(t.signal&&t.signal.aborted)i.terminate();else if(void 0===e.data.progress){if(e.data.error)return n(new Error(e.data.error)),void i.terminate();r(e.data.file),i.terminate()}else t.onProgress(e.data.progress)}),i.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",()=>{n(t.signal.reason),i.terminate()}),i.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}(e,i).then(function(e){try{return o=e,u()}catch(e){return d()}},d)}catch(e){d()}function h(){try{o.name=e.name,o.lastModified=e.lastModified}catch(e){}try{i.preserveExif&&"image/jpeg"===e.type&&(!i.fileType||i.fileType&&i.fileType===e.type)&&(o=Mi(e,o))}catch(e){}return r(o)}})}function fo(e,t){var r;if(null==e?void 0:e.extension){const t=e.extension.toLowerCase(),r={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(r[t])return r[t]}if(null==e?void 0:e.type){const t=nr(e.type),r={"image/jpeg":{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},"image/png":{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},"image/gif":{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},"image/webp":{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},"image/svg+xml":{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(r[t])return r[t]}if(null==e?void 0:e.name){const t=null===(r=e.name.split(".").pop())||void 0===r?void 0:r.toLowerCase();if(t){const e={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(e[t])return e[t]}}if(t){const e=nr(t),r=ar(e);let n="jpeg";return"png"===r?n="png":"svg"===r?n="svg":"jpeg"===r&&(n="jpeg"),{extension:r,mimeType:e,format:r,pixieFormat:n}}return{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"}}ho.getDataUrlFromFile=Xi,ho.getFilefromDataUrl=Yi,ho.loadImage=Ki,ho.drawImageInCanvas=eo,ho.drawFileInCanvas=ro,ho.canvasToFile=no,ho.getExifOrientation=ao,ho.handleMaxWidthOrHeight=so,ho.followExifOrientation=lo,ho.cleanupCanvasMemory=io,ho.isAutoOrientationInBrowser=oo,ho.approximateBelowMaximumCanvasSizeOfBrowser=Ji,ho.copyExifWithoutOrientation=Mi,ho.getBrowserName=Zi,ho.version="2.0.2";const po={MAX_SIZE_MB:.5,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8},go=["gif","svg"];async function mo(e,t={}){const{maxSizeMB:r=po.MAX_SIZE_MB,maxWidthOrHeight:n=po.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:o}=t;if(!(e&&e instanceof File))return e;if(a=e.type.split("/")[1]||"",go.includes(a))return o&&o!==e.name?new File([e],o,{type:e.type,lastModified:e.lastModified}):e;var a;try{const t=nr(e.type||i||"image/jpeg"),a=await ho(e,{maxSizeMB:r,maxWidthOrHeight:n,useWebWorker:!0}),s=nr(a.type||t),l=null!=o?o:e.name;return a instanceof File?a.type!==s||o&&a.name!==o||a.lastModified!==e.lastModified||a.name!==l?new File([a],l,{type:s,lastModified:e.lastModified}):a:new File([a],l,{type:s,lastModified:e.lastModified})}catch(t){if(o&&o!==e.name)try{return new File([e],o,{type:e.type,lastModified:e.lastModified})}catch(e){}return e}}const vo=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function yo(e){const t=new URL(e.trim());t.hash="",t.hostname=t.hostname.toLowerCase(),("https:"===t.protocol&&"443"===t.port||"http:"===t.protocol&&"80"===t.port)&&(t.port="");const r=Array.from(t.searchParams.entries()).filter(([e])=>!vo.test(e)).sort(([e,t],[r,n])=>{const i=e.localeCompare(r);return 0!==i?i:t.localeCompare(n)});return t.search="",r.forEach(([e,r])=>t.searchParams.append(e,r)),t.toString()}function bo(e){return!!(null==e?void 0:e.startsWith("image/"))&&"image/gif"!==e}function wo(e,t){if(t===e.name)return e;try{return new File([e],t,{type:e.type,lastModified:e.lastModified})}catch(t){return e}}async function xo(e){const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Ti(`HTTP ${t.status}`,"UploadUrlDownloadFailed",t.status);return t.blob()}const Co=()=>{var e,t,r,n;const{state:i,actions:a,options:s}=ti(),l=ii(),{sortBy:c,sortOrder:u}=l.state,{actions:{fetchFolders:d}}=Ii(),{t:h}=kr(),f=oi(),{deleteItems:p}=ji(),{selectedFolder:g,urlForm:m,pagination:v,files:y,pathHistory:b}=i,w=o.useRef(null);w.current=v;const{setFiles:x,setLoading:C,setIsUrlModalVisible:_,setSelectedFiles:S,setActiveLibraryItem:A,setPagination:k,setSelectedFolder:E,setPathHistory:I}=a,{dataProviders:j}=s,T=(0,o.useCallback)(async e=>{var t,r,n;if(!(null==j?void 0:j.getFiles))return[];const i=null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.disablePagination,{files:o,pagination:a}=await j.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,search:(null===(r=null==e?void 0:e.search)||void 0===r?void 0:r.trim())||void 0,sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder,page:i||null==e?void 0:e.page,limit:i||null==e?void 0:e.limit,itemType:(null==e?void 0:e.itemType)||"all"});return k&&((null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.disablePagination)?k({current:1,pageSize:o.length||1,total:o.length||0}):a&&k({current:a.page,pageSize:a.limit,total:a.total})),o},[j,null===(e=null==s?void 0:s.config)||void 0===e?void 0:e.disablePagination,k]),F=(0,o.useCallback)(async(e,t=!1)=>{var r;try{null==C||C(!0);let t=[];if(!(null==j?void 0:j.getFiles))return;t=await T(e);const r=null!=e?e:{folderId:g||"",itemType:"all"};"file"!==r.itemType&&(t=await(async(e,t,r)=>{var n;if("file"===(null==t?void 0:t.itemType))return e;let i=[];if(!r)return e;{const e=await r({parentId:t.folderId});i=Array.isArray(e)?e:[]}let o=((e,t)=>{const r=Array.isArray(e)?e:[];return(n=t.folderId)&&"root"!==n&&"folders"!==n&&"null"!==n&&null!==n?r.filter(e=>e.parentId===t.folderId):r.filter(ni);var n})(i,t);if(null===(n=null==t?void 0:t.search)||void 0===n?void 0:n.trim()){const e=t.search.trim().toLowerCase();o=o.filter(t=>{var r;return null===(r=t.name)||void 0===r?void 0:r.toLowerCase().includes(e)})}if(0===o.length)return e;const a=o.map(e=>({id:e.id,name:e.name,size:void 0,date:"-",isFolder:!0,folderId:e.parentId||"",type:"",selected:!1,extension:"",childCount:e.childCount}));if("folder"===(null==t?void 0:t.itemType))return a;const s=e.filter(e=>!e.isFolder);return[...a,...s]})(t,r,null==j?void 0:j.getFolders)),"Trash"!==(g||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==x||x(t),null==S||S(new Set)}catch(n){if("StaleLoad"===(null==n?void 0:n.name))return;const o=pi(n),a=404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code);if(!t&&a){const t=wi(n,b||[]);try{return await xi({options:s,pathFolder:t,dataProviders:null==s?void 0:s.dataProviders}),void await F(e,!0)}catch(e){}}if(a&&E&&I){const t=Array.isArray(b)?b:[];if(t.length>1){const n=t.slice(0,-1),i=n[n.length-1],o=null!==(r=null==i?void 0:i.id)&&void 0!==r?r:"folders";return I(n),E(o),await d(),f.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:h("Folder not found"),description:h("Navigated to parent folder"),placement:"bottomRight"}),void await F(Object.assign(Object.assign({},e),{folderId:o}),!1)}return I([{id:"folders",name:h("Folders")}]),E("folders"),await d(),f.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:h("Folder not found"),description:h("Navigated to root folder"),placement:"bottomRight"}),void await F(Object.assign(Object.assign({},e),{folderId:"folders"}),!1)}const l=hi(null==o?void 0:o.code,h);f.error({id:"FILES_FETCH_FAILED",message:null!=l?l:h("Failed to load files"),placement:"bottomRight",innerException:n,data:{params:e}})}finally{null==C||C(!1)}},[j,x,C,S,E,I,T,d,g,f,h,b,s]),O=(0,o.useCallback)(e=>F(e),[F]),P=(0,o.useCallback)(async(e,t)=>{var r;if(!(null==j?void 0:j.findFileByUrl))return null;const n=yo(e);try{return null!==(r=await j.findFileByUrl(n))&&void 0!==r?r:null}catch(e){return null}},[j]),M=(0,o.useCallback)(async(e,t)=>{var r,n,i,o,a,l;Pi(e,h);const c=yo(e),u=await P(c,t);if(u)return u;try{let t,a;const l=null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.handleFileProxy,u=null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.handleProxyUrl;if(l)try{t=await Promise.resolve(l(c))}catch(e){a=e}if(!t&&u)try{const e=await Promise.resolve(u(c));t=await xo(e)}catch(e){a=e}if(!t)try{t=await xo(c)}catch(e){a=e}if(!(t instanceof Blob)||0===t.size)throw a instanceof Error?a:new Ti(h("Failed to load file through proxy."),"FileProxyFailed");const d=(null===(o=null===(i=t.type)||void 0===i?void 0:i.split(";")[0])||void 0===o?void 0:o.trim())||"image/png";if(!d.startsWith("image/"))throw new Ti(h("Content type at the URL is not allowed."),"UploadUrlContentTypeNotAllowed");const f=ar(d),g=function(e){try{const t=new URL(e).pathname.split("/").pop();return t?decodeURIComponent(t):void 0}catch(e){return}}(c)||"proxied-image",m=g.replace(/\.[^.]+$/,"")||"proxied-image",v=g.includes(".")?g:`${m}.${f}`,y=await(p=t,new Promise((e,t)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>{var e;return t(null!==(e=r.error)&&void 0!==e?e:new Error("Failed to read proxied file"))},r.readAsDataURL(p)}));return{thumbnail:y,name:ki(v,null==s?void 0:s.config),type:d,extension:f,size:t.size,sourceUrl:c,saveWithoutFolder:!0}}catch(e){const r=pi(e),n="string"==typeof(d=null==r?void 0:r.code)?d:"UploadUrlDownloadFailed",i=e instanceof Ti?e:new Ti(null!==(l=null!==(a=hi(n,h))&&void 0!==a?a:null==r?void 0:r.message)&&void 0!==l?l:h("Failed to load file through proxy."),n,null==r?void 0:r.status);throw i.notificationShown=!0,await f.error({id:"EDITOR_PROXY_FILE_FAILED",message:i.message,placement:"bottomRight",data:{url:c,folderId:g||null,error:r,eventSource:"pixie"},innerException:e},t),i}var d,p},[P,f,null==s?void 0:s.config,g,h]),R=(0,o.useCallback)(async e=>{const t=w.current;try{const r=y.find(t=>t.id===e),n=e=>{if(!e)return;const t=y.find(t=>t.id===e);return null==t?void 0:t.name};await p({items:[{id:e,isFolder:null==r?void 0:r.isFolder}],selectedFolder:g,getItemNameById:n,showNotifications:!0});const i=Object.assign({},t);let o=t.current;1===y.length&&(o=i.current>1?i.current-1:1),await O({folderId:g||"",page:o,limit:t.pageSize,sortBy:c,sortOrder:u})}catch(t){(null==t?void 0:t.notificationShown)||f.error({id:"FILES_DELETE_ERROR",message:h("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:g||null,errors:[{itemId:e,error:pi(t)}]}})}},[p,O,g,h,f,y,c,u]),L=(0,o.useCallback)(async e=>{try{const t=w.current;if(!(null==j?void 0:j.deleteFolder))return void f.error({id:"FOLDER_DELETE_ERROR",message:h("DataProvider for folder deletion is not configured"),placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await j.deleteFolder(e)){const e=new Error("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443");throw e.notificationShown=!1,e}f.success({id:"FOLDER_DELETE_SUCCESS",message:h("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}}),g===e?await O({page:t.current,limit:t.pageSize,sortBy:c,sortOrder:u}):await O({folderId:g||"",sortBy:c,sortOrder:u,page:t.current,limit:t.pageSize})}catch(t){(null==t?void 0:t.notificationShown)||f.error({id:"FOLDER_DELETE_ERROR",message:h("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:pi(t)}]}})}},[j,g,f,h,O,c,u]),N=(0,o.useCallback)(async(e,t)=>{var r,n;try{if(null==j?void 0:j.getFileData){const t=await j.getFileData(e);if(t)return t;throw new Error(h("Failed to download file"))}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error(h("Error loading image"));return await t.blob()}}catch(i){const o=y.find(t=>t.id===e);f.error({id:"FILE_DOWNLOAD_FAILED",message:h("Failed to download file"),placement:"bottomRight",description:(null==o?void 0:o.name)||e,innerException:i,data:{itemId:e,itemName:(null==o?void 0:o.name)||e,folderId:null!==(r=null==o?void 0:o.folderId)&&void 0!==r?r:null,thumbnail:null!==(n=null==o?void 0:o.thumbnail)&&void 0!==n?n:null}},t)}},[j,f,h,y]),D=(0,o.useCallback)(async(e,t,r,n)=>{var o,a,l,c,u,d,p,m,v,y,b,w;if("Trash"===(n?"":null!=t?t:g||""))throw new Error(h("Upload to Trash is forbidden"));const x=ki(e.name,null==s?void 0:s.config),C=x.split(".").pop()||"",_=n?"":null!=t?t:g||"";let S=e;try{if(bo(e.type)){const t=null!==(a=null===(o=null==s?void 0:s.config)||void 0===o?void 0:o.compressMaxSize)&&void 0!==a?a:.7,r=null!==(c=null===(l=null==s?void 0:s.config)||void 0===l?void 0:l.compressMaxWidthOrHeight)&&void 0!==c?c:2e3;S=await mo(e,{maxSizeMB:t,maxWidthOrHeight:r,mimeType:e.type,fileName:x})}else S=wo(e,x)}catch(t){S=wo(e,x)}let k=S.name;if((!1===(null===(u=null==s?void 0:s.config)||void 0===u?void 0:u.hasPagination)||!0===(null===(d=null==s?void 0:s.config)||void 0===d?void 0:d.disablePagination))&&(null==j?void 0:j.getFiles))try{const{files:e}=await j.getFiles({folderId:_||void 0,itemType:"file",page:1,limit:1e4});k=ci(k,(e||[]).map(e=>e.name))}catch(e){}try{if(null==j?void 0:j.uploadFiles)try{const t=await j.uploadFiles({items:[{name:k,size:S.size,type:S.type||e.type,folderId:_,data:S,extension:C,noFolder:n}],folderId:_});if(t.success&&t.detailed&&t.detailed.length>0){const n=t.detailed[0];if(!n.success||!n.data){if(!r){const e=(null==n?void 0:n.error)?String(n.error):h("Failed to upload file");f.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:x,innerException:null==n?void 0:n.error,data:{itemName:x,folderId:_||null,eventSource:"upload"}})}return void(A&&A(Lt))}{const t=n.data;if(t.id){const r=(null!==(p=t.folderId)&&void 0!==p?p:_)||void 0;await O({folderId:r});let n=i.files.find(e=>e.id===t.id);if(!n)try{n=(await T({folderId:r,itemType:"file"})).find(e=>e.id===t.id)}catch(e){}return A&&A(Lt),n||Object.assign(Object.assign({},t),{id:t.id,name:t.name||x,folderId:null!==(v=null!==(m=t.folderId)&&void 0!==m?m:_)&&void 0!==v?v:null,type:S.type||e.type,size:S.size,extension:C||x.split(".").pop()||"",thumbnail:null!==(y=t.thumbnail)&&void 0!==y?y:void 0,url:null!==(b=t.url)&&void 0!==b?b:void 0,thumbnailUrl:null!==(w=t.thumbnailUrl)&&void 0!==w?w:void 0,isFolder:!1,selected:!1})}}}else if(!t.success){if(!r){const e=t.error?String(t.error):h("Failed to upload file");f.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:x,innerException:t.error,data:{itemName:x,folderId:_||null,eventSource:"upload"}})}return void(A&&A(Lt))}return void(A&&A(Lt))}catch(e){throw e}if(null==j?void 0:j.uploadFile){const t=await j.uploadFile({name:k,size:S.size,type:S.type||e.type,folderId:_,noFolder:n,data:S,extension:C});return A&&A(Lt),t}return void(r||f.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:h("DataProvider for file upload is not configured"),placement:"bottomRight"}))}catch(e){const t=pi(e),n=hi(null==t?void 0:t.code,h);return r?void 0:void f.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=n?n:h("Failed to upload file"),placement:"bottomRight",description:x,innerException:e,data:{itemName:x,folderId:_||null,error:pi(e),eventSource:"upload"}})}},[j,g,A,i.files,O,T,f,h,null==s?void 0:s.config]),z=(0,o.useCallback)(async(e,t)=>{var r;if(!(null==j?void 0:j.getFolders)||!(null==j?void 0:j.createFolder))return e||"";try{const n=await j.getFolders(),i=Array.isArray(n)?n:[],o=(e,t)=>i.find(r=>{var n;return(null!==(n=r.parentId)&&void 0!==n?n:null)===(null!=e?e:null)&&r.name===t});let a=null!=e?e:"";for(const e of t){if(!e)continue;let t=o(a,e);if(!t){const r=await j.createFolder({name:e,parentId:null!=a?a:null});i.push(r),t=r}a=t.id}return null!==(r=a)&&void 0!==r?r:e||""}catch(t){return e||""}},[j]),B=(0,o.useCallback)(async(e,t)=>{var r,n,i,o;if(!(null===(n=null===(r=e.type)||void 0===r?void 0:r.startsWith)||void 0===n?void 0:n.call(r,"image/")))return null!=t?t:null;const a=null==e?void 0:e.webkitRelativePath;let s=t||"";if(a&&a.includes("/")){const e=a.split("/");e.pop();const r=e.filter(Boolean);r.length&&(s=await z(t||"",r)||t||"")}return null!==(o=null!==(i=s)&&void 0!==i?i:t)&&void 0!==o?o:null},[z]);(0,o.useCallback)(async e=>{var t,r,n,i,o,a,s,l,c,u,d,h;const{file:f,selectedFolderId:p,uploadFn:g,progressCallbacks:m}=e;if(!(null===(r=null===(t=f.type)||void 0===t?void 0:t.startsWith)||void 0===r?void 0:r.call(t,"image/")))return{success:!0,fileName:f.name,folderId:null!=p?p:null};const v=null!==(i=null!==(n=await B(f,p))&&void 0!==n?n:p)&&void 0!==i?i:null,y=null!==(o=null!=v?v:p)&&void 0!==o?o:null;let b;null===(a=null==m?void 0:m.onStart)||void 0===a||a.call(m,f);try{if(null==m?void 0:m.onProgress){let e=0;b=window.setInterval(()=>{var t;e=Math.min(e+10+Math.floor(Date.now()%10),90),null===(t=null==m?void 0:m.onProgress)||void 0===t||t.call(m,f.name,e)},200)}const e=await g(f,null!=y?y:void 0);return(null==m?void 0:m.onProgress)&&(null===(s=null==m?void 0:m.onProgress)||void 0===s||s.call(m,f.name,100)),null===(l=null==m?void 0:m.onComplete)||void 0===l||l.call(m,f.name),{success:!0,fileName:f.name,fileId:null==e?void 0:e.id,folderId:null!==(u=null!==(c=null==e?void 0:e.folderId)&&void 0!==c?c:y)&&void 0!==u?u:null}}catch(e){const t=e instanceof Error?e.message:String(e);return null===(d=null==m?void 0:m.onError)||void 0===d||d.call(m,f.name,t),{success:!1,fileName:f.name,folderId:null!==(h=null!=y?y:p)&&void 0!==h?h:null,error:t}}finally{void 0!==b&&clearInterval(b)}},[B]);const U=(0,o.useCallback)(async(e,t)=>{var r,n,i,o,a,l,c,u,d,p,m,v,y,b,w,x,C,_,S,k,E,I,T,F,O,P,M,R,L,N,D,z,U,V,H;if(0===e.length)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};null===(r=null==t?void 0:t.onStartBatch)||void 0===r||r.call(t,e);const $=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},W=[];for(let A=0;A<e.length;A++){const r=e[A];if(!(null===(i=null===(n=r.type)||void 0===n?void 0:n.startsWith)||void 0===i?void 0:i.call(n,"image/"))){const e=await f.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:h("Unsupported file type"),placement:"bottomRight",data:{itemName:r.name,fileType:r.type,folderId:g||null}});null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,r.name,e.message);continue}const p=ki(r.name,null==s?void 0:s.config);let m=r;try{if(bo(r.type)){const e=null!==(l=null===(a=null==s?void 0:s.config)||void 0===a?void 0:a.compressMaxSize)&&void 0!==l?l:.7,t=null!==(u=null===(c=null==s?void 0:s.config)||void 0===c?void 0:c.compressMaxWidthOrHeight)&&void 0!==u?u:2e3;m=await mo(r,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:r.type,fileName:p})}else m=wo(r,p)}catch(e){m=wo(r,p)}const v=`${Date.now()}-${A}-${Math.random().toString(36).slice(2,8)}`,y=await B(m,g);null===(d=null==t?void 0:t.onStart)||void 0===d||d.call(t,m),W.push({file:m,targetFolderId:y,requestId:v,originalFileName:r.name,originalIndex:A})}const G=W.length;if(0===G)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const q=!1===(null===(p=null==s?void 0:s.config)||void 0===p?void 0:p.hasPagination)||!0===(null===(m=null==s?void 0:s.config)||void 0===m?void 0:m.disablePagination),Y=new Map;if(q&&(null==j?void 0:j.getFiles)){const t=[...new Set(W.map(e=>{var t,r;return null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:g)&&void 0!==r?r:""}).filter(Boolean))];for(const r of t)try{const{files:e}=await j.getFiles({folderId:r||void 0,itemType:"file",page:1,limit:1e4});Y.set(r,(e||[]).map(e=>e.name))}catch(e){}}const X=new Map,K=!t,Z=1===G&&K,J=[],Q=[],ee=[],te=[],re=new Map;let ne=0,ie=0;const oe=null!==(y=null===(v=null==s?void 0:s.config)||void 0===v?void 0:v.maxFileSize)&&void 0!==y?y:52428800,ae=async(e,r,n,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};ne++,J.push(e),Q.push(null!=n?n:e),await((e,t,r,n)=>{var i;return f.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${h("File")} ${e} ${h("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:r,itemName:e,folderId:null!==(i=null!=t?t:g)&&void 0!==i?i:null,eventSource:"upload"}},n||!K)})(e,r,n,!l),s&&(null===(o=null==t?void 0:t.onProgress)||void 0===o||o.call(t,e,100),null===(a=null==t?void 0:t.onComplete)||void 0===a||a.call(t,e))},se=async(e,r,n,i)=>{var o;const{emitProgress:a=!0,emitNotification:s=!0,fileSize:l,progressCallbackName:c,progressCallbackIndex:u}=null!=i?i:{};ie++;const d=null!=l?{fileSize:l,maxSize:oe}:void 0,p=await((e,t,r,n,i)=>{var o,a,s,l,c,u,d;const p=pi(r),m=null!==(o=null==i?void 0:i.fileSize)&&void 0!==o?o:null==p?void 0:p.fileSize,v=null!==(s=null!==(a=null==i?void 0:i.maxSize)&&void 0!==a?a:null==p?void 0:p.maxSize)&&void 0!==s?s:oe,y={allowedChars:"a-z A-Z 0-9 . _ -",fileSize:null!=m?ai(Number(m)):void 0,maxSize:null!=v?ai(Number(v)):void 0},b=null==p?void 0:p.code,w="BatchItemLimitExceeded"===b||"exceeded_max_files"===b?b:null!==(l=fi(null==p?void 0:p.message))&&void 0!==l?l:b,x="BatchItemLimitExceeded"===w||"exceeded_max_files"===w?((e,t)=>{const r=pi(e),n=null==r?void 0:r.code;if(("BatchItemLimitExceeded"===n||"exceeded_max_files"===n)&&(null==r?void 0:r.message)){const{allowed:e,received:n}=function(e){const t=e.match(/Allowed:\s*(\d+)/i),r=e.match(/received:\s*(\d+)/i);return{allowed:t?parseInt(t[1],10):void 0,received:r?parseInt(r[1],10):void 0}}(r.message);if(null!=e&&null!=n)return t("Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}",{allowed:e,received:n})}if((null==r?void 0:r.message)&&"Unknown error"!==r.message)return r.message;const i=hi(n,t,void 0);return null!=i?i:t("Error uploading file")})(r,h):hi(w,h,y),C=(null==p?void 0:p.message)&&"string"==typeof p.message&&p.message.length>0?p.message:null,_=r instanceof Error?r.message:"string"==typeof r?r:null,S=_&&"[object Object]"!==_?_:null;return f.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!==(u=null!==(c=null!=C?C:x)&&void 0!==c?c:S)&&void 0!==u?u:h("Error uploading file {{fileName}}",{fileName:e}),placement:"bottomRight",data:{itemName:e,folderId:null!==(d=null!=t?t:g)&&void 0!==d?d:null,error:pi(r),eventSource:"upload"},innerException:r},n||!K)})(e,r,n,!s,d);a&&(null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,null!=c?c:e,p.message,u)),te.push({itemId:void 0,itemName:e,error:pi(n)}),ee.push({fileName:e,error:p.message})};if(!(null==j?void 0:j.uploadFiles))return f.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:h("DataProvider for file upload is not configured"),placement:"bottomRight"}),{successCount:0,failCount:G,successes:[],errors:[],totalCount:G};{const r=[];try{(null==t?void 0:t.onProgress)&&W.forEach(e=>{let n=0;const i=window.setInterval(()=>{var r;n=Math.min(n+10+Math.floor(Date.now()%10),90),null===(r=null==t?void 0:t.onProgress)||void 0===r||r.call(t,e.file.name,n)},200);r.push(i)});let e=await j.uploadFiles({items:W.map(e=>{var t,r;const n=q?((e,t)=>{const r=null!=e?e:"";let n=Y.get(r)||[],i=X.get(r);i||(i=new Set(n.map(e=>e.toLowerCase())),X.set(r,i));const o=ci(t,Array.from(i));return i.add(o.toLowerCase()),o})(e.targetFolderId,e.file.name):e.file.name;return{requestId:e.requestId,name:n,size:e.file.size,type:e.file.type,folderId:null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:g)&&void 0!==r?r:null,data:e.file,extension:e.file.name.split(".").pop()||""}}),folderId:null!=g?g:null});r.forEach(e=>window.clearInterval(e)),r.length=0;const n=null!==(b=e.detailed)&&void 0!==b?b:[],i=new Map(n.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(n.length>0)for(let t=0;t<W.length;t++){const e=W[t],r=null!==(w=e.requestId?i.get(e.requestId):void 0)&&void 0!==w?w:n[t];if(r&&r.success){const t=r.data,n=null!==(x=null==t?void 0:t.name)&&void 0!==x?x:ki(e.file.name,null==s?void 0:s.config),i=null!==(S=null!==(_=null!==(C=null==t?void 0:t.folderId)&&void 0!==C?C:e.targetFolderId)&&void 0!==_?_:g)&&void 0!==S?S:null,o=null==t?void 0:t.id;re.set(n,{id:o,name:n,folderId:i,size:null==t?void 0:t.size,originalFileName:e.originalFileName,originalIndex:e.originalIndex}),await ae(n,i,o,{emitNotification:Z})}else{const t=null==r?void 0:r.data,n=null!==(k=null==t?void 0:t.name)&&void 0!==k?k:ki(e.file.name,null==s?void 0:s.config),i=null!==(T=null!==(I=null!==(E=null==t?void 0:t.folderId)&&void 0!==E?E:e.targetFolderId)&&void 0!==I?I:g)&&void 0!==T?T:null;await se(n,i,null!==(F=null==r?void 0:r.error)&&void 0!==F?F:new Error(h("Error uploading file")),{emitNotification:Z,fileSize:e.file.size,progressCallbackName:e.originalFileName,progressCallbackIndex:e.originalIndex})}}else if(e.success)for(const t of W){const e=ki(t.file.name,null==s?void 0:s.config),r=null!==(P=null!==(O=t.targetFolderId)&&void 0!==O?O:g)&&void 0!==P?P:null;await ae(e,r,void 0,{emitNotification:Z})}else{const t=null!==(M=e.error)&&void 0!==M?M:new Error(h("Error uploading file"));for(const e of W){const r=ki(e.file.name,null==s?void 0:s.config),n=null!==(L=null!==(R=e.targetFolderId)&&void 0!==R?R:g)&&void 0!==L?L:null;await se(r,n,t,{emitNotification:Z,fileSize:e.file.size,progressCallbackName:e.originalFileName,progressCallbackIndex:e.originalIndex})}}}catch(e){for(const t of W){const r=ki(t.file.name,null==s?void 0:s.config),n=null!==(D=null!==(N=t.targetFolderId)&&void 0!==N?N:g)&&void 0!==D?D:null;await se(r,n,null!=e?e:new Error(h("Error uploading file")),{emitNotification:Z,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}finally{r.forEach(e=>window.clearInterval(e))}}if(ne>0&&(A&&A(Lt),G>1&&K)){const e=$(J),t=e?h("Uploaded",{names:e}):h("uploads_success_summary",{successCount:ne,totalCount:G});f.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:ne,totalCount:G,itemIds:Q,itemNames:J,folderId:null!=g?g:null,eventSource:"upload"}})}if(ie>0&&K&&!Z)if(G>1){const e=ee.map(e=>e.fileName),t=$(e),r=t?h("Failed",{names:t}):h("uploads_fail_summary",{failCount:ie,totalCount:G});f.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:ie,totalCount:G,itemNames:e,folderId:null!=g?g:null,errors:te,eventSource:"upload"}})}else if(1===G&&te.length>0&&(null===(z=te[0].error)||void 0===z?void 0:z.code)){const e=hi(null===(U=te[0].error)||void 0===U?void 0:U.code,h),t=null!==(H=null===(V=ee[0])||void 0===V?void 0:V.fileName)&&void 0!==H?H:"",r=null!=e?e:t?`${h("Failed to upload files")}: ${t}`:h("Failed to upload files");f.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:ie,totalCount:G,itemNames:[t],folderId:null!=g?g:null,errors:te,eventSource:"upload"}})}return{successCount:ne,failCount:ie,successes:J,errors:ee,totalCount:G,uploadedFiles:re.size>0?re:void 0}},[j,null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.hasPagination,null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.disablePagination,f,B,g,A,h,null==s?void 0:s.config]),V=(0,o.useCallback)(async e=>{var t;if(!(null==j?void 0:j.uploadFiles))return void f.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:h("DataProvider for file upload is not configured"),placement:"bottomRight"});if("Trash"===g)return void f.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:h("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:g||null,reason:"Upload to Trash is not allowed"}});const r=w.current,n=document.createElement("input");n.type="file",n.accept="image/*",n.multiple=!0;try{(null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.features)&&s.config.features.enableDirectoryUpload&&(n.webkitdirectory=!0)}catch(e){}n.onchange=async t=>{var n;const i=t.target.files;if(!i||0===i.length)return;const o=Array.from(i);try{null==C||C(!0);const{successes:t,errors:i,uploadedFiles:a}=await U(o,e);null===(n=null==e?void 0:e.onBatchComplete)||void 0===n||n.call(e,{files:o,successes:t,errors:i,uploadedFiles:a}),await d(),await O({folderId:g||"",sortBy:c,sortOrder:u,page:r.current,limit:r.pageSize})}catch(e){}finally{null==C||C(!1)}},n.click()},[null==j?void 0:j.uploadFiles,g,f,h,C,O,d,c,u,U,null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.features]),H=(0,o.useCallback)(async(e,t,r,n="uploadByUrl")=>{var i,o;const a=w.current;let l,d=null!=e?e:null;try{if(!t&&"Trash"===g)throw r||f.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:h("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:g||null,reason:"Upload to Trash is not allowed"}}),new Ti(h("Cannot upload files to Trash"),"UploadUrlDownloadFailed");let p,v;if(!d&&m&&(p=await m.validateFields(),d=null==p?void 0:p.fileUrl),!d)throw r||f.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:h("Please fill in all fields"),placement:"bottomRight",data:{url:null!=d?d:null,folderId:g||null,eventSource:n}}),new Ti(h("Please fill in all fields"),"UploadUrlInvalid");if(Pi(d,h),d=yo(d),null==C||C(!0),d){const e=d.split("?")[0].split("#")[0].split("/");v=e[e.length-1]||"uploaded-file",v=ki(v,null==s?void 0:s.config)}if("imageStock"===n&&((null==j?void 0:j.uploadFiles)||(null==j?void 0:j.uploadFile)))try{const e=await fetch(d,{mode:"cors"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const n=await e.blob(),a=(null===(o=null===(i=e.headers.get("content-type"))||void 0===i?void 0:i.split(";")[0])||void 0===o?void 0:o.trim())||"image/jpeg",c=ar(a),u=ki(`${(null==v?void 0:v.replace(/\.[^.]+$/,""))||"stock-image"}.${c}`,null==s?void 0:s.config),h=new File([n],u,{type:a}),f=t?"":g||"";l=await D(h,f,r)}catch(e){(null==j?void 0:j.uploadFileByUrl)&&(l=await j.uploadFileByUrl({url:d,folderId:g||"",noFolder:t,name:v,eventSource:n}))}else{if(!(null==j?void 0:j.uploadFileByUrl))throw r||f.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:h("Upload by URL is not supported"),placement:"bottomRight",data:{url:d,folderId:g||null,eventSource:n}}),new Ti(h("Upload by URL is not supported"),"UploadUrlDownloadFailed");l=await j.uploadFileByUrl({url:d,folderId:g||"",noFolder:t,name:v,eventSource:n})}const y=(null==p?void 0:p.name)||(null==l?void 0:l.name)||"unnamed file";return l&&f.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${h("File")} ${y} ${h("successfully uploaded")}`,placement:"bottomRight",data:{itemName:y,itemId:null==l?void 0:l.id,folderId:g||null,eventSource:n}},r),p&&(null==_||_(!1),null==m||m.resetFields()),A&&A(Lt),await O({folderId:g||"",sortBy:c,sortOrder:u,page:a.current,limit:a.pageSize}),l}catch(e){if(!r){const t=pi(e),r=vi(t,h);f.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:r,placement:"bottomRight",data:{url:null!=d?d:null,folderId:g||null,error:t,eventSource:n},innerException:e})}throw e}finally{null==C||C(!1)}},[m,C,j,f,h,_,A,O,g,c,u,D,null==s?void 0:s.config]),$=(0,o.useCallback)(async e=>{if(!e.length)return;const t=w.current;"Trash"!==g?(await U(e),await O({folderId:g||"",sortBy:c,sortOrder:u,page:t.current,limit:t.pageSize})):f.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:h("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:g||null,reason:"Upload to Trash is not allowed"}})},[O,g,c,u,U,f,h]);return{fetchFiles:O,handleDeleteFile:R,handleDeleteFolder:L,handleAddFile:V,handleAddFileByUrl:H,handleDroppedFiles:$,getFileData:N,findFileByUrl:P,resolveFileForEditByUrl:M,uploadFileWithProvider:D}},_o=e=>{const t=t=>{if(!t)return;const r=e.find(e=>e.id===t);return null==r?void 0:r.name};return{getItemNameById:t,getItemNamesByIds:e=>e.map(t).filter(e=>Boolean(e)),getNamesPreview:e=>e.length>0&&e.length<=5?e.join(", "):null}},So=(e,t,r,n,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:r,folderId:null!=n?n:null}),Ao=(e,t,r,n,i,o)=>({itemIds:e,itemNames:o&&o.length?o:void 0,failCount:t,totalCount:r,folderId:null!=n?n:null,errors:i}),ko=()=>{const e=oi(),{t:t}=kr(),{actions:{fetchFolders:r,fetchChildFolders:n}}=Ii();return{refreshFolders:(0,o.useCallback)(async({parentIds:i,selectedFolder:o})=>{try{if(await r(),i&&n)for(const e of i)e&&await n(e)}catch(r){e.error({id:"FILES_FETCH_FAILED",message:t("Failed to refresh folder tree"),placement:"bottomRight",innerException:r,data:{params:{folderId:o||void 0}}})}},[e,t]),refreshFiles:(0,o.useCallback)(async({fetchFiles:r,selectedFolder:n,page:i,limit:o})=>{try{await r({folderId:n||"",page:i,limit:o})}catch(r){e.error({id:"FILES_FETCH_FAILED",message:t("Failed to refresh file list"),placement:"bottomRight",innerException:r,data:{params:{folderId:n||void 0,page:i,limit:o}}})}},[e,t])}},Eo=e=>{const t=(e=>{var t,r,n,i;const{state:a,actions:s,options:l}=ti(),{t:c}=kr(),u=Ii(),d=oi(),{fetchFolders:h}=u.actions,{renameItem:f}=(()=>{const{options:e}=ti(),{dataProviders:t}=e,{t:r}=kr(),n=(0,o.useCallback)(async({itemId:n,newName:i,isFolder:o})=>{var a,s,l,c,u,d,h,f;try{if(o){if(!(null==t?void 0:t.renameFolder))throw new Error(r("renameFolder is not implemented in dataProviders"));const o=Ei(i.trim(),e.config),c=await t.renameFolder(n,o);return{success:!0,renamedItem:{id:c.id,name:null!==(a=c.name)&&void 0!==a?a:o,parentId:null!==(s=c.parentId)&&void 0!==s?s:null,folderId:null!==(l=c.parentId)&&void 0!==l?l:null}}}if(!(null==t?void 0:t.renameFile))throw new Error(r("renameFile is not implemented in dataProviders"));const p=ki(i,e.config),g=await t.renameFile(n,p);return{success:!0,renamedItem:{id:null!==(c=null==g?void 0:g.id)&&void 0!==c?c:n,name:null!==(u=null==g?void 0:g.name)&&void 0!==u?u:p,folderId:null!==(d=null==g?void 0:g.folderId)&&void 0!==d?d:null,parentId:null!==(f=null!==(h=null==g?void 0:g.parentId)&&void 0!==h?h:null==g?void 0:g.folderId)&&void 0!==f?f:null}}}catch(e){return{success:!1,error:pi(e)}}},[t,r,e.config]);return{renameItem:n}})(),{files:p,selectedFolder:g,fileToRename:m,renameForm:v,isRenameModalVisible:y,pagination:b}=a,{setFileToRename:w,setIsRenameModalVisible:x}=s,{dataProviders:C,config:_}=l,S=e=>{var t,r;if(!e)return null;const n=e;return null!==(r=null!==(t=n.folderId)&&void 0!==t?t:n.parentId)&&void 0!==r?r:null},A=(e,t)=>{var r;return{itemId:null!==(r=null==e?void 0:e.id)&&void 0!==r?r:t,itemName:null==e?void 0:e.name,folderId:S(e)}},k=(0,o.useCallback)(e=>{var t,r;const n=null==p?void 0:p.find(t=>t.id===e);if((null==n?void 0:n.isFolder)||e.startsWith("folder_")){if(!1===(null===(t=null==_?void 0:_.features)||void 0===t?void 0:t.enableRenameFolder))return void d.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:c("Folder rename is disabled by config"),placement:"bottomRight",data:A(n,e)});if(!(null==C?void 0:C.renameFolder))throw new Error(c("renameFolder is not implemented in dataProviders"))}else{if(!1===(null===(r=null==_?void 0:_.features)||void 0===r?void 0:r.enableRenameFile))return void d.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:c("File rename is disabled by config"),placement:"bottomRight",data:A(n,e)});if(!(null==C?void 0:C.renameFile))throw new Error(c("renameFile is not implemented in dataProviders"))}null==w||w(e),null==x||x(!0),n&&v&&v.setFieldsValue({newFileName:n.name})},[p,w,x,v,null===(t=null==_?void 0:_.features)||void 0===t?void 0:t.enableRenameFolder,null===(r=null==_?void 0:_.features)||void 0===r?void 0:r.enableRenameFile,null==C?void 0:C.renameFolder,null==C?void 0:C.renameFile,d,c]),E=(0,o.useCallback)(()=>{null==x||x(!1),null==w||w(null),null==v||v.resetFields()},[x,w,v]),I=(0,o.useCallback)(async()=>{var t,r,n,i,o,a,l,u,y,w,x,C;if(!m||!v)return;const S=null==p?void 0:p.find(e=>e.id===m);try{const p=await v.validateFields();if(!(null==p?void 0:p.newFileName))return;const k=(null==S?void 0:S.isFolder)||m.startsWith("folder_");if(k){if(!1===(null===(t=null==_?void 0:_.features)||void 0===t?void 0:t.enableRenameFolder))return void d.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:c("Folder rename is disabled by config"),placement:"bottomRight",data:A(S,m)})}else if(!1===(null===(r=null==_?void 0:_.features)||void 0===r?void 0:r.enableRenameFile))return void d.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:c("File rename is disabled by config"),placement:"bottomRight",data:A(S,m)});const I=await f({itemId:m,newName:p.newFileName,isFolder:k});if(!I.success){const e=hi(null===(n=I.error)||void 0===n?void 0:n.code,c);return void d.error({id:"ITEM_RENAME_FAILED",message:null!==(o=null!=e?e:null===(i=I.error)||void 0===i?void 0:i.message)&&void 0!==o?o:c("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(S,m)),{error:I.error}),innerException:I.error})}const j=I.renamedItem;k?(d.success({id:"FOLDER_RENAME_SUCCESS",message:c(`${c("Folder renamed to")} ${null!==(a=null==j?void 0:j.name)&&void 0!==a?a:p.newFileName}`),placement:"bottomRight",data:{itemId:null!==(l=null==j?void 0:j.id)&&void 0!==l?l:m,itemName:null!==(u=null==j?void 0:j.name)&&void 0!==u?u:p.newFileName,folderId:null!==(w=null!==(y=null==j?void 0:j.parentId)&&void 0!==y?y:null==j?void 0:j.folderId)&&void 0!==w?w:null}}),await h(),(null==j?void 0:j.id)&&j.id!==m&&s.setSelectedFolder&&s.setSelectedFolder(j.id)):d.success({id:"FILE_RENAME_SUCCESS",message:`${c("File renamed to")} ${null!==(x=null==j?void 0:j.name)&&void 0!==x?x:p.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},A(S,m)),{itemName:null!==(C=null==j?void 0:j.name)&&void 0!==C?C:p.newFileName})}),E(),await e({folderId:g||"",page:b.current,limit:b.pageSize})}catch(e){const r=pi(e),n=hi(null==r?void 0:r.code,c);d.error({id:"ITEM_RENAME_FAILED",message:null!=n?n:e instanceof Error?e.message:c("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(S,m)),{error:r}),innerException:e})}},[m,v,p,s,E,e,g,c,b,null===(n=null==_?void 0:_.features)||void 0===n?void 0:n.enableRenameFolder,null===(i=null==_?void 0:_.features)||void 0===i?void 0:i.enableRenameFile,d,h,f]);return{state:{isRenamingFile:y||!1,fileToRename:m},actions:{showRenameModal:k,handleRenameCancel:E,handleRenameOk:I}}})(e),r=(e=>{var t,r;const{state:n,actions:i,options:a}=ti(),{t:s}=kr(),l=oi(),{files:c,selectedFolder:u,selectedFiles:d,moveForm:h,pagination:f,currentMenuFile:p}=n,{setIsMoveModalVisible:g,setSelectedFiles:m,setPagination:v}=i,{dataProviders:y}=a,{moveItems:b}=(()=>{const{options:e}=ti(),{dataProviders:t}=e,{t:r}=kr(),n=oi(),i=(0,o.useCallback)(async({items:e,targetFolderId:i,getItemNameById:o,showNotifications:a=!1})=>{let s=0,l=0;const c=[];if(null==t?void 0:t.moveItems)try{const r=await t.moveItems("folders"===i?"":i,e.map(e=>e.id)),n=r.detailed;if(n){const e=n.filter(e=>e.success),t=n.filter(e=>!e.success);s+=e.length,l+=t.length,t.forEach(e=>{const t=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),r=e.error,n=pi(r);c.push({itemId:t,itemName:o(t),error:n})})}else if(r.success)s+=e.length;else{const t=r.error;if(t){l+=e.length;const r=pi(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const n=pi(t);c.push({error:n})}else l+=e.length,c.push({error:{message:"Move provider is not configured"}});return a&&(s>0&&n.success({id:"FILES_MOVE_SUCCESS",message:r("Files moved"),placement:"bottomRight",data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:"folders"===i?null:i}}),l>0&&n.error({id:"FILES_MOVE_ERROR",message:r("Errors occurred while moving"),placement:"bottomRight",innerException:c.length?c:void 0,data:{failCount:l,totalCount:e.length,itemIds:e.map(e=>e.id),errors:c.length?c:void 0}})),{successCount:s,failCount:l,errorDetails:c}},[t,n,r]);return{moveItems:i}})(),{refreshFolders:w,refreshFiles:x}=ko(),{getItemNameById:C,getItemNamesByIds:_,getNamesPreview:S}=_o(c),A=(0,o.useCallback)(()=>{null==g||g(!0)},[g]),k=(0,o.useCallback)(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),E=(0,o.useCallback)(async t=>{var r,n,i,o,g,A,E,I,j,T;if(!((null==p?void 0:p.length)||d&&0!==d.size))return;const F=c.length,O=Object.assign({},f),P=Array.from((null==p?void 0:p.length)?[p]:d),M=P.length;let R=0,L=0;const N=[],D=P.map(e=>c.find(t=>t.id===e)).filter(e=>Boolean(e)),z=D.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let c=t;if(!t){const e=await h.validateFields();c=null==e?void 0:e.targetFolder}if(!c)return void l.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:s("Select destination folder"),placement:"bottomRight"});const d="folders"===c?null:c,f=null!=d?d:u,p=!1===(null===(r=null==a?void 0:a.config)||void 0===r?void 0:r.paginationAvailable)||!1===(null===(n=null==a?void 0:a.config)||void 0===n?void 0:n.hasPagination)||!0===(null===(i=null==a?void 0:a.config)||void 0===i?void 0:i.disablePagination);if(p&&(null==y?void 0:y.getFolders))try{const e=await y.getFolders({parentId:d,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const r of D){if(!r.isFolder&&!(null===(g=(o=r.id).startsWith)||void 0===g?void 0:g.call(o,"folder_")))continue;const e=r.name||C(r.id)||"";if(e&&t.has(e.toLowerCase()))return void l.error({id:"FOLDER_ALREADY_EXISTS_MOVE",message:s("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:e,targetFolderId:c}})}}catch(e){}if(p&&(null==y?void 0:y.getFiles)&&(null==y?void 0:y.renameFile))try{let e=[];if(null==y?void 0:y.getFiles){const{files:t}=await y.getFiles({folderId:d||void 0,itemType:"all",page:1,limit:1e4});e=(t||[]).map(e=>e.name).filter(e=>!!e)}if(null==y?void 0:y.getFolders){const t=(await y.getFolders({parentId:d,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const t=new Set(e.map(e=>null==e?void 0:e.toLowerCase()).filter(Boolean));for(const r of D){if(r.isFolder||(null===(E=(A=r.id).startsWith)||void 0===E?void 0:E.call(A,"folder_")))continue;const e=r.name||C(r.id)||"";if(!e||!t.has(e.toLowerCase())){t.add(e.toLowerCase());continue}const n=ci(e,Array.from(t));await y.renameFile(r.id,n),t.add(n.toLowerCase())}}catch(e){}const B=await b({items:D,targetFolderId:c,getItemNameById:C,showNotifications:!1});if(R=B.successCount,L=B.failCount,N.push(...B.errorDetails),R>0){const e=_(P),t=S(e),r=t?s("Moved",{names:t}):s("move_success_summary",{successCount:R,totalCount:M});l.success({id:"FILES_MOVE_SUCCESS",message:r,placement:"bottomRight",data:So(P,R,M,d,e)})}if(L>0){const e=_(P),t=S(e);let r;if(1===M&&N.length>0&&(null===(I=N[0].error)||void 0===I?void 0:I.code)){const e=hi(null===(j=N[0].error)||void 0===j?void 0:j.code,s);r=null!=e?e:t?s("Failed",{names:t}):s("move_fail_summary",{failCount:L,totalCount:M})}else r=t?s("Failed",{names:t}):s("move_fail_summary",{failCount:L,totalCount:M});l.error({id:"FILES_MOVE_ERROR",message:r,placement:"bottomRight",innerException:N.length?N:void 0,data:Ao(P,L,M,d,N.length?N:void 0,e)})}k(),null==m||m(new Set);let U=O.current;if(R>0&&F>0&&R>=F&&O.current>1&&(U=O.current-1),R>0&&O.total>=R){const e=Math.max(0,(null!==(T=O.total)&&void 0!==T?T:0)-R);null==v||v({current:U,pageSize:O.pageSize,total:e})}z&&await w({parentIds:void 0,selectedFolder:f}),await x({fetchFiles:e,selectedFolder:u,page:U,limit:O.pageSize})}catch(e){const r=hi(pi(e).code,s);l.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=r?r:s("Error moving"),placement:"bottomRight",data:Ao(P,M,M,u||null,[{error:pi(e)}],_(P))})}},[p,d,h,m,e,u,f,c,l,v,s,b,g,null===(t=null==a?void 0:a.config)||void 0===t?void 0:t.hasPagination,null===(r=null==a?void 0:a.config)||void 0===r?void 0:r.disablePagination,null==y?void 0:y.getFiles,null==y?void 0:y.renameFile,C]);return{actions:{showMoveModal:A,handleMoveCancel:k,handleMoveOk:E}}})(e),n=(e=>{var t,r;const{state:n,actions:i,options:a}=ti(),{t:s}=kr(),l=oi(),{files:c,selectedFolder:u,selectedFiles:d,copyForm:h,pagination:f,currentMenuFile:p}=n,{setIsCopyModalVisible:g,setSelectedFiles:m}=i,{dataProviders:v}=a,{copyItems:y}=(()=>{const{options:e}=ti(),{dataProviders:t}=e,{t:r}=kr(),n=oi(),i=(0,o.useCallback)(async({items:e,targetFolderId:i,getItemNameById:o,showNotifications:a=!1})=>{let s=0,l=0;const c=[],u="folders"===i?"":i;if(null==t?void 0:t.copyItems)try{const r=await t.copyItems(u,e.map(e=>({id:e.id,newName:e.newName}))),n=r.detailed;if(n){const e=n.filter(e=>e.success),t=n.filter(e=>!e.success);s+=e.length,l+=t.length,t.forEach(e=>{const t=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),r=e.error,n=pi(r);c.push({itemId:t,itemName:o(t),error:n})})}else if(r.success)s+=e.length;else{const t=r.error;if(t){l+=e.length;const r=pi(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const n=pi(t);c.push({error:n})}else if(null==t?void 0:t.copyItem)for(const r of e)try{const e=(null==r?void 0:r.isFolder)||r.id.startsWith("folder_");await t.copyItem({itemId:r.id,targetFolderId:u,isFolder:e,newName:r.newName})?s++:l++}catch(e){l++;const t=pi(e);c.push({itemId:r.id,itemName:o(r.id),error:t})}else l+=e.length,c.push({error:{message:"Copy provider is not configured"}});return a&&(s>0&&n.success({id:"FILES_COPY_SUCCESS",message:r("Files copied"),placement:"bottomRight",data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:"folders"===i?null:i}}),l>0&&n.error({id:"FILES_COPY_ERROR",message:r("Errors occurred while copying"),placement:"bottomRight",innerException:c.length?c:void 0,data:{failCount:l,totalCount:e.length,itemIds:e.map(e=>e.id),errors:c.length?c:void 0}})),{successCount:s,failCount:l,errorDetails:c}},[t,n,r]);return{copyItems:i}})(),{refreshFolders:b,refreshFiles:w}=ko(),{getItemNameById:x,getItemNamesByIds:C,getNamesPreview:_}=_o(c),S=(0,o.useCallback)(()=>{null==g||g(!0)},[g]),A=(0,o.useCallback)(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),k=(0,o.useCallback)(async t=>{var r,n,i,o,g,S,k;if(!((null==p?void 0:p.length)||d&&0!==d.size))return;const E=Array.from((null==p?void 0:p.length)?[p]:d),I=E.length;let j=0,T=0;const F=[],O=E.map(e=>c.find(t=>t.id===e)).filter(e=>Boolean(e)),P=O.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let c=t;if(!t){const e=await h.validateFields();c=null==e?void 0:e.targetFolder}if(!c)return void l.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:s("Select destination folder"),placement:"bottomRight"});const d="folders"===c?null:c,p=null!=d?d:u;let M=O.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const R=!1===(null===(r=null==a?void 0:a.config)||void 0===r?void 0:r.paginationAvailable)||!1===(null===(n=null==a?void 0:a.config)||void 0===n?void 0:n.hasPagination)||!0===(null===(i=null==a?void 0:a.config)||void 0===i?void 0:i.disablePagination);if(R&&(null==v?void 0:v.getFolders))try{const e=await v.getFolders({parentId:d,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const r of O){if(!r.isFolder&&!(null===(g=(o=r.id).startsWith)||void 0===g?void 0:g.call(o,"folder_")))continue;const e=r.name||x(r.id)||"";if(e&&t.has(e.toLowerCase()))return void l.error({id:"FOLDER_ALREADY_EXISTS_COPY",message:s("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:e,targetFolderId:c}})}}catch(e){}if(R&&(null==v?void 0:v.getFiles))try{let e=[];const{files:t}=await v.getFiles({folderId:d||void 0,itemType:"all",page:1,limit:1e4});if(e=(t||[]).map(e=>e.name).filter(e=>!!e),null==v?void 0:v.getFolders){const t=(await v.getFolders({parentId:d,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const r=[...e];M=O.map(e=>{var t,n;if(e.isFolder||(null===(n=(t=e.id).startsWith)||void 0===n?void 0:n.call(t,"folder_")))return{id:e.id,isFolder:!0};const i=O.find(t=>t.id===e.id),o=(null==i?void 0:i.name)||x(e.id)||"",a=ci(o,r);return r.push(a),{id:e.id,isFolder:!1,newName:a!==o?a:void 0}})}catch(e){}else M=O.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const L=await y({items:M,targetFolderId:c,getItemNameById:x,showNotifications:!1});if(j=L.successCount,T=L.failCount,F.push(...L.errorDetails),j>0){const e=C(E),t=_(e),r=t?s("Copied",{names:t}):s("copy_success_summary",{successCount:j,totalCount:I});l.success({id:"FILES_COPY_SUCCESS",message:r,placement:"bottomRight",data:So(E,j,I,d,e)})}if(T>0){const e=C(E),t=_(e);let r;if(1===I&&F.length>0&&(null===(S=F[0].error)||void 0===S?void 0:S.code)){const e=hi(null===(k=F[0].error)||void 0===k?void 0:k.code,s);r=null!=e?e:t?s("Failed",{names:t}):s("copy_fail_summary",{failCount:T,totalCount:I})}else r=t?s("Failed",{names:t}):s("copy_fail_summary",{failCount:T,totalCount:I});l.error({id:"FILES_COPY_ERROR",message:r,placement:"bottomRight",innerException:F.length?F:void 0,data:Ao(E,T,I,d,F.length?F:void 0,e)})}A(),null==m||m(new Set),P&&await b({parentIds:void 0,selectedFolder:p}),await w({fetchFiles:e,selectedFolder:u,page:f.current,limit:f.pageSize})}catch(e){const r=hi(pi(e).code,s);l.error({id:"FILES_COPY_ERROR",message:null!=r?r:s("Error copying"),innerException:e,placement:"bottomRight",data:Ao(E,I,I,u||null,[{error:pi(e)}],C(E))})}},[p,d,h,m,e,u,f,c,l,s,y,g,null===(t=null==a?void 0:a.config)||void 0===t?void 0:t.hasPagination,null===(r=null==a?void 0:a.config)||void 0===r?void 0:r.disablePagination,null==v?void 0:v.getFiles,x]);return{actions:{showCopyModal:S,handleCopyCancel:A,handleCopyOk:k}}})(e),i=(e=>{const{state:t,actions:r,options:n}=ti(),{t:i}=kr(),a=oi(),{files:s,selectedFolder:l,selectedFiles:c,pagination:u,currentMenuFile:d}=t,{setSelectedFiles:h,setIsDeleteConfirmVisible:f,setUndoDeletion:p,setPagination:g}=r,{config:m}=n,{deleteItems:v}=ji(),{refreshFolders:y,refreshFiles:b}=ko(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=_o(s),_=(0,o.useCallback)(()=>{null==f||f(!0)},[f]),S=(0,o.useCallback)(()=>{null==f||f(!1)},[f]),A=(0,o.useCallback)(async()=>{var t,r,n;if(!((null==d?void 0:d.length)||c&&0!==c.size))return void(null==f||f(!1));const o=s.length,_=Object.assign({},u),S=Array.from(d?[d]:c),A=S.map(e=>s.find(t=>t.id===e)).filter(e=>Boolean(e)),k=new Set;A.forEach(e=>{(null==e?void 0:e.isFolder)&&k.add((e=>{var t,r;if(!e)return null;const n=e;return null!==(r=null!==(t=n.folderId)&&void 0!==t?t:n.parentId)&&void 0!==r?r:null})(e))});let E=0,I=0;const j=[];try{const s=await v({items:A,selectedFolder:l,getItemNameById:w,showNotifications:!1});E=s.successCount,I=s.failCount,j.push(...s.errorDetails);const c=(null==m?void 0:m.enableTrashFolder)&&"Trash"===l;if(E>0&&(null==m?void 0:m.enableTrashFolder)&&!c&&(null==p||p({itemIds:S,sourceFolderId:l||"folders"})),E>0){const e=S.length;(null==m?void 0:m.enableTrashFolder)&&!c?await a.success({id:"FILES_DELETE_SUCCESS",message:i("moved_to_trash",{count:E}),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:l||null}}):await a.success({id:"FILES_DELETE_SUCCESS",message:i("Files deleted"),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:l||null}})}if(I>0){const e=x(S),n=C(e),o=S.length,s=1===o&&j.length>0&&(null===(t=j[0].error)||void 0===t?void 0:t.code),l=(null==m?void 0:m.enableTrashFolder)&&!c,u=i(l?"\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438":"\u041f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438"),d=s?hi(null===(r=j[0].error)||void 0===r?void 0:r.code,i):void 0,h=null!=d?d:n?i("Failed",{names:n}):u;a.error({id:"FILES_DELETE_ERROR",message:h,placement:"bottomRight",innerException:j.length?j:void 0,data:{failCount:I,isTrashMove:l,totalCount:o,itemNames:e,errors:j.length?j:void 0}})}null==h||h(new Set),null==f||f(!1),await y({parentIds:Array.from(k),selectedFolder:l});let u=_.current;if(E>0&&o>0&&E>=o&&_.current>1&&(u=_.current-1),E>0&&_.total>=E){const e=Math.max(0,(null!==(n=_.total)&&void 0!==n?n:0)-E);null==g||g({current:u,pageSize:_.pageSize,total:e})}await b({fetchFiles:e,selectedFolder:l,page:u,limit:_.pageSize})}catch(e){a.error({id:"FILES_DELETE_ERROR",message:i("Error deleting"),placement:"bottomRight",innerException:e,data:{failCount:I,totalCount:A.length}})}},[d,c,f,e,l,u,p,g,s,i,a,v,null==m?void 0:m.enableTrashFolder]);return{actions:{showDeleteConfirm:_,handleDeleteConfirmCancel:S,handleDeleteConfirmOk:A}}})(e);return{state:t.state,actions:Object.assign(Object.assign(Object.assign(Object.assign({},t.actions),r.actions),n.actions),i.actions)}},Io="filemanager_sidebar_width",jo=({onSearch:e,placeholder:t,className:r})=>{const{t:n}=kr(),[a,s]=(0,o.useState)(""),l=(0,o.useRef)(null),{options:c}=ti(),{config:u}=c,d=t||n("Search files...");return(0,o.useEffect)(()=>(l.current=Qn.debounce(t=>{e(t)},500),()=>{var e;null===(e=l.current)||void 0===e||e.cancel()}),[e]),(0,i.jsx)(h.A,{value:a,onChange:e=>{var t;const r=e.target.value;s(r),null===(t=l.current)||void 0===t||t.call(l,r)},placeholder:d,prefix:(0,i.jsx)($n,{size:16,strokeWidth:null==u?void 0:u.iconStrokeWidth}),className:r,allowClear:!0,onClear:()=>{s(""),e("")}})},To=new Map,Fo=e=>{if(e.type&&e.type.startsWith("image/"))return!0;if(e.name){const t=e.name.toLowerCase().split(".").pop();return Yt.includes(t||"")}return!1},Oo=({thumbnailSrc:e,previewSrc:t,alt:r,className:n,width:a,height:s,preview:l=!1,file:c})=>{const{t:u}=kr(),d=Co(),[h,p]=(0,o.useState)(!1),g=null==c?void 0:c.id,m=null==c?void 0:c.type,v=null==c?void 0:c.name,[y,b]=(0,o.useState)(e),[w,x]=(0,o.useState)(t),[C,_]=(0,o.useState)(!1),[S,A]=(0,o.useState)(!1),k=o.useRef(!1),E=o.useRef(!1),I=o.useRef(!1),j=(0,o.useCallback)(async(e,t,r)=>{if((e=>To.has(e))(e))return(e=>To.get(e))(e);if(!e||t&&!Fo({type:t}))return Kt;try{const t=await d.getFileData(e,!0);if(!t)throw new Error(u("Error loading image"));return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>{const t=i.result;((e,t)=>{To.set(e,t),To.size>350&&Array.from(To.keys()).slice(0,50).forEach(e=>To.delete(e))})(e,t),r(t)},i.onerror=()=>n(new Error("\u041e\u0448\u0438\u0431\u043a\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430")),i.readAsDataURL(t)})}catch(e){throw e}},[d.getFileData,u]),T=(0,o.useCallback)(e=>{const t=e.split(",")[1];return!!(t&&t.length>20)},[]),F=(0,o.useCallback)(e=>{var t;if(e&&e!==Kt)return e.startsWith("data:image/")?T(e)?e:void 0:e.startsWith("blob:")?e:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?null!==(t=(e=>{if(e&&"string"==typeof e){if(e.startsWith("data:")||e.startsWith("blob:"))return e;try{if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")){const t=new URL(e.startsWith("/")?`https://x${e}`:e),r=e.startsWith("/")?"":`${t.protocol}//${t.host}`,n=t.pathname.split("/").map(e=>{if(!e)return"";try{return encodeURIComponent(decodeURIComponent(e))}catch(t){return encodeURIComponent(e)}}).join("/");return e.startsWith("/")?n+(t.search||"")+(t.hash||""):`${r}${n}${t.search}${t.hash}`}}catch(e){}return e}})(e))&&void 0!==t?t:e:void 0},[T]);(0,o.useEffect)(()=>{_(!1),p(!1),A(!1),k.current=!1,E.current=!1,I.current=!1;const r=F(e);r?b(r):g&&Fo({name:v,type:m})&&!I.current?(I.current=!0,A(!0),_(!0),j(g,m,v).then(e=>{b(e),_(!1)}).catch(()=>{b(Kt),p(!0),_(!1)}).finally(()=>A(!1))):(b(Kt),p(!0));const n=F(t);if(n)x(n);else{const t=F(e);t?x(t):g&&Fo({name:v,type:m})?j(g,m,v).then(e=>{x(e)}).catch(()=>{x(Kt)}):x(Kt)}},[e,t,g,m,v,j,F]);const O=(0,o.useCallback)((e,t)=>e&&e.toLowerCase().endsWith(".svg")||t&&(t.includes(".svg")||t.includes("image/svg+xml")),[]),P=(0,o.useCallback)(()=>{if(y!==Kt){if(k.current)return b(Kt),void p(!0);if(k.current=!0,O(v,y))return b(Kt),void p(!0);g&&Fo({name:v,type:m})&&!I.current?(I.current=!0,A(!0),_(!0),j(g,m,v).then(e=>{b(e),p(!1),_(!1)}).catch(()=>{b(Kt),p(!0),_(!1)}).finally(()=>A(!1))):(b(Kt),p(!0))}},[y,g,m,v,j,O]);(0,o.useCallback)(()=>{if(w===Kt)return;if(E.current)return void x(Kt);if(E.current=!0,O(v,w))return void x(Kt);const t=F(e);t&&!k.current?x(t):g&&Fo({name:v,type:m})?j(g,m,v).then(e=>{x(e)}).catch(()=>{x(Kt)}):x(Kt)},[w,e,g,m,v,j,F,O]);const M=(0,o.useCallback)(()=>{if(w&&w!==Kt&&!E.current)return w;const t=F(e);return t&&!k.current?t:qt},[w,e,F]),R=y===Kt?qt:y,L=M()||qt;return(0,i.jsx)(f.A,{className:n,src:R,alt:r,width:a,height:s,preview:l&&{src:L,toolbarRender:()=>null,destroyOnHidden:!0,mask:(0,i.jsx)(W.A,{style:{fontSize:"20px"}})},onError:P,fallback:qt,loading:C?"lazy":void 0})},Po=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),Mo=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),Ro=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),Lo=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),No=()=>(0,i.jsxs)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[(0,i.jsx)("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"}),(0,i.jsx)("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"}),(0,i.jsx)("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"}),(0,i.jsx)("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"})]}),Do=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"light-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M6 7.81819C6.50303 7.81819 6.93182 7.64092 7.28637 7.28637C7.64092 6.93182 7.81819 6.50303 7.81819 6C7.81819 5.49697 7.64092 5.06818 7.28637 4.71363C6.93182 4.35908 6.50303 4.18181 6 4.18181C5.49697 4.18181 5.06818 4.35908 4.71363 4.71363C4.35908 5.06818 4.18181 5.49697 4.18181 6C4.18181 6.50303 4.35908 6.93182 4.71363 7.28637C5.06818 7.64092 5.49697 7.81819 6 7.81819ZM6 8.72727C5.24545 8.72727 4.60227 8.46136 4.07045 7.92955C3.53864 7.39773 3.27273 6.75455 3.27273 6C3.27273 5.24545 3.53864 4.60227 4.07045 4.07045C4.60227 3.53864 5.24545 3.27273 6 3.27273C6.75455 3.27273 7.39773 3.53864 7.92955 4.07045C8.46136 4.60227 8.72727 5.24545 8.72727 6C8.72727 6.75455 8.46136 7.39773 7.92955 7.92955C7.39773 8.46136 6.75455 8.72727 6 8.72727ZM2.18182 6.45454H0V5.54546H2.18182V6.45454ZM12 6.45454H9.81818V5.54546H12V6.45454ZM5.54546 2.18182V0H6.45454V2.18182H5.54546ZM5.54546 12V9.81818H6.45454V12H5.54546ZM3 3.6091L1.63182 2.28637L2.28181 1.61819L3.5909 2.98182L3 3.6091ZM9.72727 10.3727L8.39546 9.00454L9.0091 8.38182L10.3682 9.71363L9.72727 10.3727ZM8.38182 2.9909L9.71363 1.63182L10.3818 2.27273L9.02727 3.6L8.38182 2.9909ZM1.62727 9.71819L2.98636 8.38636L3.61818 9.0091L2.28637 10.3682L1.62727 9.71819Z"})}),zo=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"dark-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M6 11C4.61111 11 3.43056 10.5139 2.45833 9.54167C1.48611 8.56944 1 7.38889 1 6C1 4.61111 1.48611 3.43056 2.45833 2.45833C3.43056 1.48611 4.61111 1 6 1C6.09259 1 6.1875 1.00309 6.28472 1.00926C6.38194 1.01543 6.49382 1.02469 6.62036 1.03704C6.2716 1.32408 5.99769 1.68442 5.79861 2.11806C5.59954 2.55169 5.5 3.01234 5.5 3.5C5.5 4.33333 5.79167 5.04167 6.375 5.625C6.95833 6.20833 7.66667 6.5 8.5 6.5C8.99074 6.5 9.45216 6.40509 9.88426 6.21528C10.3164 6.02546 10.6759 5.76544 10.963 5.43519C10.9753 5.54939 10.9846 5.65047 10.9907 5.73843C10.9969 5.82639 11 5.91358 11 6C11 7.38889 10.5139 8.56944 9.54167 9.54167C8.56944 10.5139 7.38889 11 6 11ZM6 10.0741C6.94444 10.0741 7.77469 9.7909 8.49075 9.22454C9.20681 8.65818 9.67594 7.97376 9.89815 7.17129C9.68211 7.25463 9.45474 7.3179 9.21606 7.36111C8.97737 7.40431 8.73869 7.42592 8.5 7.42592C7.41242 7.42592 6.4862 7.0435 5.72135 6.27865C4.9565 5.5138 4.57408 4.58758 4.57408 3.5C4.57408 3.29012 4.59414 3.06944 4.63426 2.83796C4.67438 2.60648 4.74229 2.35185 4.83797 2.07407C3.99229 2.3395 3.29552 2.83487 2.74768 3.56018C2.19984 4.28549 1.92592 5.09876 1.92592 6C1.92592 7.12963 2.32252 8.09105 3.11574 8.88426C3.90895 9.67748 4.87037 10.0741 6 10.0741Z"})}),Bo=()=>(0,i.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{opacity:"0.5",d:"M6 19H49C54.5229 19 59 23.4772 59 29V46C59 51.5228 54.5228 56 49 56H14C9.58172 56 6 52.4183 6 48V19Z",fill:"#91CAFF"}),(0,i.jsx)("path",{d:"M6 19L34.866 18.5L30.7172 11.0737C29.6569 9.17588 27.6531 8 25.4792 8H10C7.79086 8 6 9.79086 6 12V19Z",fill:"#2884FF"}),(0,i.jsx)("path",{d:"M34.6663 18.6667L31.6916 12.7171C30.8354 11.0048 30.4073 10.1486 29.7687 9.5231C29.2039 8.96995 28.5232 8.54926 27.7759 8.29149C26.9308 8 25.9736 8 24.0591 8H13.8663C10.8794 8 9.38592 8 8.24506 8.5813C7.24153 9.09262 6.42563 9.90852 5.91431 10.9121C5.33301 12.0529 5.33301 13.5464 5.33301 16.5333V18.6667M5.33301 18.6667H45.8663C50.3468 18.6667 52.587 18.6667 54.2983 19.5386C55.8036 20.3056 57.0274 21.5294 57.7944 23.0347C58.6663 24.746 58.6663 26.9862 58.6663 31.4667V43.2C58.6663 47.6804 58.6663 49.9206 57.7944 51.6319C57.0274 53.1372 55.8036 54.3611 54.2983 55.1281C52.587 56 50.3468 56 45.8663 56H18.133C13.6526 56 11.4124 56 9.70108 55.1281C8.19579 54.3611 6.97194 53.1372 6.20496 51.6319C5.33301 49.9206 5.33301 47.6804 5.33301 43.2V18.6667Z",stroke:"#2884FF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Uo=()=>(0,i.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{opacity:"0.5",d:"M6 19H49C54.5229 19 59 23.4772 59 29V46C59 51.5228 54.5228 56 49 56H14C9.58172 56 6 52.4183 6 48V19Z",fill:"#91CAFF"}),(0,i.jsx)("path",{d:"M6 19L34.866 18.5L30.7172 11.0737C29.6569 9.17588 27.6531 8 25.4792 8H10C7.79086 8 6 9.79086 6 12V19Z",stroke:"currentColor"}),(0,i.jsx)("path",{d:"M34.6663 18.6667L31.6916 12.7171C30.8354 11.0048 30.4073 10.1486 29.7687 9.5231C29.2039 8.96995 28.5232 8.54926 27.7759 8.29149C26.9308 8 25.9736 8 24.0591 8H13.8663C10.8794 8 9.38592 8 8.24506 8.5813C7.24153 9.09262 6.42563 9.90852 5.91431 10.9121C5.33301 12.0529 5.33301 13.5464 5.33301 16.5333V18.6667M5.33301 18.6667H45.8663C50.3468 18.6667 52.587 18.6667 54.2983 19.5386C55.8036 20.3056 57.0274 21.5294 57.7944 23.0347C58.6663 24.746 58.6663 26.9862 58.6663 31.4667V43.2C58.6663 47.6804 58.6663 49.9206 57.7944 51.6319C57.0274 53.1372 55.8036 54.3611 54.2983 55.1281C52.587 56 50.3468 56 45.8663 56H18.133C13.6526 56 11.4124 56 9.70108 55.1281C8.19579 54.3611 6.97194 53.1372 6.20496 51.6319C5.33301 49.9206 5.33301 47.6804 5.33301 43.2V18.6667Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Vo=()=>(0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M10.8337 5.83333L9.90404 3.9741C9.6365 3.439 9.50271 3.17144 9.30313 2.97597C9.12664 2.80311 8.91393 2.67164 8.68039 2.59109C8.4163 2.5 8.11716 2.5 7.5189 2.5H4.33366C3.40024 2.5 2.93353 2.5 2.57701 2.68166C2.2634 2.84144 2.00844 3.09641 1.84865 3.41002C1.66699 3.76654 1.66699 4.23325 1.66699 5.16667V5.83333M1.66699 5.83333H14.3337C15.7338 5.83333 16.4339 5.83333 16.9686 6.10582C17.439 6.3455 17.8215 6.72795 18.0612 7.19836C18.3337 7.73314 18.3337 8.4332 18.3337 9.83333V13.5C18.3337 14.9001 18.3337 15.6002 18.0612 16.135C17.8215 16.6054 17.439 16.9878 16.9686 17.2275C16.4339 17.5 15.7338 17.5 14.3337 17.5H5.66699C4.26686 17.5 3.5668 17.5 3.03202 17.2275C2.56161 16.9878 2.17916 16.6054 1.93948 16.135C1.66699 15.6002 1.66699 14.9001 1.66699 13.5V5.83333Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),Ho=()=>(0,i.jsx)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M32 24.5L24 16.5M24 16.5L16 24.5M24 16.5V34.9C24 37.6814 24 39.0721 25.101 40.6292C25.8326 41.6638 27.9388 42.9406 29.1944 43.1108C31.0842 43.3668 31.8019 42.9924 33.2371 42.2437C39.6333 38.9071 44 32.2135 44 24.5C44 13.4543 35.0457 4.5 24 4.5C12.9543 4.5 4 13.4543 4 24.5C4 31.9028 8.02199 38.3663 14 41.8244",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})}),$o=()=>(0,i.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{width:"56",height:"56",rx:"24",fill:"#8946FB"}),(0,i.jsx)("path",{d:"M28 36.4722C29.0615 37.4223 30.4633 38 32 38C35.3137 38 38 35.3137 38 32C38 29.2331 36.1271 26.9036 33.5798 26.2102M22.4202 26.2102C19.8729 26.9036 18 29.2331 18 32C18 35.3137 20.6863 38 24 38C27.3137 38 30 35.3137 30 32C30 31.2195 29.851 30.4738 29.5798 29.7898M34 24C34 27.3137 31.3137 30 28 30C24.6863 30 22 27.3137 22 24C22 20.6863 24.6863 18 28 18C31.3137 18 34 20.6863 34 24Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Wo=()=>(0,i.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{width:"56",height:"56",rx:"24",fill:"#7ED846"}),(0,i.jsx)("path",{d:"M20.5 38V33M20.5 23V18M18 20.5H23M18 35.5H23M29 19L27.2658 23.5089C26.9838 24.2421 26.8428 24.6087 26.6235 24.9171C26.4292 25.1904 26.1904 25.4292 25.9171 25.6235C25.6087 25.8428 25.2421 25.9838 24.5089 26.2658L20 28L24.5089 29.7342C25.2421 30.0162 25.6087 30.1572 25.9171 30.3765C26.1904 30.5708 26.4292 30.8096 26.6235 31.0829C26.8428 31.3913 26.9838 31.7579 27.2658 32.4911L29 37L30.7342 32.4911C31.0162 31.7579 31.1572 31.3913 31.3765 31.0829C31.5708 30.8096 31.8096 30.5708 32.0829 30.3765C32.3913 30.1572 32.7579 30.0162 33.4911 29.7342L38 28L33.4911 26.2658C32.7579 25.9838 32.3913 25.8428 32.0829 25.6235C31.8096 25.4292 31.5708 25.1904 31.3765 24.9171C31.1572 24.6087 31.0162 24.2421 30.7342 23.5089L29 19Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Go=()=>(0,i.jsxs)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M19 18.4307C19 17.4761 19 16.9988 19.1995 16.7324C19.3733 16.5001 19.6394 16.3549 19.9288 16.3342C20.2608 16.3105 20.6622 16.5686 21.4652 17.0848L30.9064 23.1541C31.6032 23.602 31.9516 23.826 32.0719 24.1108C32.177 24.3596 32.177 24.6404 32.0719 24.8892C31.9516 25.174 31.6032 25.398 30.9064 25.8459L21.4652 31.9152C20.6622 32.4314 20.2608 32.6895 19.9288 32.6658C19.6394 32.6451 19.3733 32.4998 19.1995 32.2676C19 32.0012 19 31.5239 19 30.5693V18.4307Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M6 16.1C6 12.7397 6 11.0595 6.65396 9.77606C7.2292 8.64708 8.14708 7.7292 9.27606 7.15396C10.5595 6.5 12.2397 6.5 15.6 6.5H32.4C35.7603 6.5 37.4405 6.5 38.7239 7.15396C39.8529 7.7292 40.7708 8.64708 41.346 9.77606C42 11.0595 42 12.7397 42 16.1V32.9C42 36.2603 42 37.9405 41.346 39.2239C40.7708 40.3529 39.8529 41.2708 38.7239 41.846C37.4405 42.5 35.7603 42.5 32.4 42.5H15.6C12.2397 42.5 10.5595 42.5 9.27606 41.846C8.14708 41.2708 7.2292 40.3529 6.65396 39.2239C6 37.9405 6 36.2603 6 32.9V16.1Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),qo=()=>(0,i.jsx)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M24 41.4444C26.123 43.3446 28.9266 44.5 32 44.5C38.6274 44.5 44 39.1274 44 32.5C44 26.9662 40.2541 22.3072 35.1596 20.9203M12.8404 20.9203C7.74587 22.3072 4 26.9661 4 32.5C4 39.1274 9.37258 44.5 16 44.5C22.6274 44.5 28 39.1274 28 32.5C28 30.939 27.7019 29.4476 27.1596 28.0797M36 16.5C36 23.1274 30.6274 28.5 24 28.5C17.3726 28.5 12 23.1274 12 16.5C12 9.87258 17.3726 4.5 24 4.5C30.6274 4.5 36 9.87258 36 16.5Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})}),Yo=e=>(0,i.jsx)(G.A,Object.assign({component:Po},e)),Xo=e=>(0,i.jsx)(G.A,Object.assign({component:Mo},e)),Ko=e=>(0,i.jsx)(G.A,Object.assign({component:Ro},e)),Zo=e=>(0,i.jsx)(G.A,Object.assign({component:Lo},e)),Jo=e=>(0,i.jsx)(G.A,Object.assign({component:No},e)),Qo=e=>(0,i.jsx)(G.A,Object.assign({component:Do},e)),ea=e=>(0,i.jsx)(G.A,Object.assign({component:zo},e)),ta=e=>(0,i.jsx)(G.A,Object.assign({component:Bo},e)),ra=e=>(0,i.jsx)(G.A,Object.assign({component:Uo},e)),na=e=>(0,i.jsx)(G.A,Object.assign({component:Vo},e)),ia=e=>(0,i.jsx)(G.A,Object.assign({component:Ho},e)),oa=e=>(0,i.jsx)(G.A,Object.assign({component:$o},e)),aa=e=>(0,i.jsx)(G.A,Object.assign({component:Wo},e)),sa=e=>(0,i.jsx)(G.A,Object.assign({component:Go},e)),la=e=>(0,i.jsx)(G.A,Object.assign({component:qo},e)),ca=()=>{const{options:e}=ti(),{customIcons:t}=e,r=(e,r,n)=>{const i=null==t?void 0:t[e];return i?o.createElement(i,n):o.createElement(r,n)};return{RootFolderIcon:e=>r("rootFolder",$.A,e),FolderIcon:e=>r("folder",ta,e),FolderOpenIcon:e=>r("folderOpen",q.A,e),AddFolderIcon:e=>r("addFolder",Y.A,e),FileIcon:e=>r("file",X.A,e),UploadIcon:e=>r("upload",K.A,e),UploadByUrlIcon:e=>r("uploadByUrl",Z.A,e),ExpandArrowIcon:e=>r("expandArrow",J.A,e),CollapseArrowIcon:e=>r("collapseArrow",Q.A,e),ExpandFolderIcon:e=>r("expandArrow",Mn,e),CollapseFolderIcon:e=>r("collapseArrow",Pn,e),FolderPreviewIcon:e=>r("folderPreview",ra,e),EmptyFolderIcon:e=>r("folderPreview",na,e),GridViewIcon:e=>r("gridView",ee.A,e),ListViewIcon:e=>r("listView",te.A,e),DropZoneFileIcon:e=>r("folderPreview",ia,e),BigStockIcon:e=>r("folderPreview",oa,e),BigAIIcon:e=>r("folderPreview",aa,e),GifPlayIcon:e=>r("folderPreview",sa,e),StockBigIcon:e=>r("folderPreview",la,e),MixedViewIcon:e=>r("mixedView",Yo,e),LandscapeViewIcon:e=>r("landscapeView",Xo,e),PortraitViewIcon:e=>r("portraitView",Ko,e),SquareViewIcon:e=>r("squareView",Zo,e),LightModeIcon:e=>r("lightMode",Qo,e),DarkModeIcon:e=>r("darkMode",ea,e),AiIcon_2:e=>r("aiIcon_2",Jo,e),NoFilesIcon:e=>r("noFiles",Rn,e),ThumbsUpIcon:e=>r("thumbsUp",qn,e),getCustomIcon:r}};const ua=()=>{const{t:e}=kr(),{NoFilesIcon:t}=ca();return(0,i.jsxs)("div",{className:"noFilesContainer",children:[(0,i.jsx)(t,{className:"noFilesImage",size:48,strokeWidth:1.4}),(0,i.jsx)("h2",{className:"noFilesTitle",children:e("There's nothing here")}),(0,i.jsx)("div",{className:"noFilesDescription",children:e("Try using a different search query.")})]})},da="filemanager_view_mode";var ha={headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",emptyStateWrapper:"emptyStateWrapper",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileNameCol:"fileNameCol",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableMenu:"tableMenu",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",buttonDeselected:"buttonDeselected",buttonSelectAll:"buttonSelectAll",gridRow:"gridRow",gridCard:"gridCard",selectedRow:"selectedRow",gridCardSelected:"gridCardSelected",gridCheckbox:"gridCheckbox",gridCardContent:"gridCardContent",gridPreviewContainer:"gridPreviewContainer",gridPreviewContainerFolder:"gridPreviewContainerFolder",gridFolderIcon:"gridFolderIcon",gridFolderIconImage:"gridFolderIconImage",gridFileName:"gridFileName",gridFileInfo:"gridFileInfo",gridFileMenu:"gridFileMenu",gridFileMenuButton:"gridFileMenuButton",actionsBox:"actionsBox",uploadContainer:"uploadContainer",uploadArea:"uploadArea",blockText:"blockText",textTitle:"textTitle",textDescription:"textDescription",buttons:"buttons",btnAi:"btnAi",btnPhoto:"btnPhoto",dragOverlay:"dragOverlay",dragOverlayInner:"dragOverlayInner",dragCaptureLayer:"dragCaptureLayer",dragOverlayGlobal:"dragOverlayGlobal",noFiles:"noFiles",noFilesIcon:"noFilesIcon",textTitle_trash:"textTitle_trash",textDescription_trash:"textDescription_trash"};const{Text:fa}=p.A,{Option:pa}=g.A,ga=({files:e,searchTerm:t,handleSearch:r,handleSort:n,sortBy:a,sortOrder:s,handleSortOptionChange:l,pagination:u,setPagination:d,loading:h,handleItemClick:f,selectedFiles:p,toggleFileSelection:I,handleDroppedFiles:j,onRename:T,onDelete:F,onCopy:O,onMove:P,onEdit:M,fileUpload:R,handleAddFile:L})=>{var N;const{t:D}=kr(),{DropZoneFileIcon:z,BigStockIcon:B,BigAIIcon:U,FolderIcon:V}=ca(),{options:H,actions:$,state:W}=ti(),{dataProviders:G,config:q}=H,Y=null==q?void 0:q.disablePagination,{setCurrentMenuFile:X,setSelectedFiles:K,setActiveLibraryItem:Z}=$,J="Trash"===(null==W?void 0:W.selectedFolder),{viewMode:Q,setViewMode:ee}=(()=>{const[e,t]=(0,o.useState)(()=>{try{return localStorage.getItem(da)||"table"}catch(e){return"table"}}),r=(0,o.useCallback)(e=>{t(e);try{localStorage.setItem(da,e)}catch(e){}},[]),n=(0,o.useCallback)(()=>{r("table"===e?"grid":"table")},[e,r]);return{viewMode:e,setViewMode:r,toggleViewMode:n}})(),[te,re]=(0,o.useState)({}),[ne,ie]=(0,o.useState)(null),[oe,ae]=(0,o.useState)(!1);(0,o.useEffect)(()=>{const e=()=>{ae(window.innerWidth<1200)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const se=p.size,le=e.length>0&&se===e.length,ce=(null==q?void 0:q.features)||{},ue=o.useMemo(()=>Array.from(p)[0],[p]),de=o.useMemo(()=>ue?e.find(e=>e.id===ue):void 0,[ue,e]),he=(null==de?void 0:de.isFolder)?!1!==(null==ce?void 0:ce.enableRenameFolder):!1!==(null==ce?void 0:ce.enableRenameFile),fe=null==q?void 0:q.iconStrokeWidth,pe=e=>{const t=e.extension?e.extension:e.name&&e.name.includes(".")?e.name.split(".").pop():e.type?(e=>{var t,r;if(e&&e.startsWith("image/"))return null===(r=null===(t=e.split("/")[1])||void 0===t?void 0:t.split(";")[0])||void 0===r?void 0:r.trim()})(e.type):void 0,r=(e=>!!e&&Yt.includes(e.toLowerCase()))(t);return r},ge=o.useMemo(()=>!(1!==se||!de||de.isFolder)&&pe(de),[se,de]),me=`${a}-${s}`,ve=o.useMemo(()=>Array.isArray(e)&&e.some(e=>(e=>{if(!e)return!1;const t=new Date(e);return!Number.isNaN(t.getTime())})(e.date)),[e]),ye=(0,o.useCallback)(async e=>{var t;try{if(null==G?void 0:G.getChildrenCount)return await G.getChildrenCount("folders"===e?void 0:e);if(null==G?void 0:G.getFiles){const{files:r,pagination:n}=await G.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:Y?void 0:1,limit:Y?void 0:1});return Y?Array.isArray(r)?r.length:0:null!==(t=null==n?void 0:n.total)&&void 0!==t?t:Array.isArray(r)?r.length:0}return 0}catch(t){return null==t||t.name,0}},[G,Y]),be=(0,o.useCallback)(async()=>{const t=e.filter(e=>e.isFolder);if(0===t.length)return;const r={},n=t.map(async e=>{"number"!=typeof e.childCount?r[e.id]=await ye(e.id):r[e.id]=e.childCount});await Promise.all(n),re(r)},[e,ye]);(0,o.useEffect)(()=>{be()},[be]);const we=(0,o.useCallback)((e=()=>{})=>{if(ne)return;const t=setTimeout(()=>{e(),ie(null)},300);ie(t)},[ne]),xe=(0,o.useCallback)(e=>{ne&&(clearTimeout(ne),ie(null)),e()},[ne]),Ce=(0,o.useCallback)(()=>{K&&K(new Set(e.map(e=>e.id)))},[e,K]),_e=(0,o.useCallback)(e=>{const t=[];return!e.isFolder&&!1!==(null==ce?void 0:ce.enableEdit)&&pe(e)&&t.push({key:"edit",label:D("Edit"),icon:(0,i.jsx)(Tn,{size:16,strokeWidth:fe})}),(e.isFolder?!1!==(null==ce?void 0:ce.enableMoveFolder):!1!==(null==ce?void 0:ce.enableMoveItem))&&t.push({key:"move",label:D("Move to"),icon:(0,i.jsx)(On,{size:16,strokeWidth:fe})}),(e.isFolder?!1!==(null==ce?void 0:ce.enableCopyFolder):!1!==(null==ce?void 0:ce.enableCopyItem))&&t.push({key:"copy",label:D("Copy"),icon:(0,i.jsx)(jn,{size:16,strokeWidth:fe})}),(e.isFolder?!1!==(null==ce?void 0:ce.enableRenameFolder):!1!==(null==ce?void 0:ce.enableRenameFile))&&t.push({key:"rename",label:D("Rename"),icon:(0,i.jsx)(Gn,{size:16,strokeWidth:fe})}),!1!==ce.enableDelete&&t.push({key:"delete",label:D("Delete"),icon:(0,i.jsx)(Yn,{size:16,strokeWidth:fe}),style:{color:"#ff4d4f"}}),t},[ce,D,fe]),Se=t=>({key:r})=>{const n=e.find(e=>e.id===t);switch(X&&(null==n?void 0:n.id)&&X(null==n?void 0:n.id),r){case"edit":M(n);break;case"move":P();break;case"copy":O();break;case"rename":T(t);break;case"delete":F(n);break;default:X&&X("")}},Ae=[{key:"selection",width:46,render:(e,t)=>(0,i.jsx)(m.A,{checked:p.has(t.id),onClick:e=>{e.stopPropagation(),I(t.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,forceToggle:!0})}})},{key:"preview",width:60,render:(e,t)=>t.isFolder?(0,i.jsx)("div",{className:ha.fileManagerTableFolder,children:(0,i.jsx)("div",{className:ha.fileManagerTableFolderInner,children:(0,i.jsx)(V,{className:ha.tableFolderIcon,style:{width:40,height:40}})})}):(0,i.jsx)(Oo,{className:`${ha.imagePreview} ${ha.tableImagePreview}`,thumbnailSrc:t.thumbnailUrl||t.thumbnail,previewSrc:t.url,alt:t.name,width:40,height:40,preview:!0,file:t})},{title:D("Name"),width:"calc(100% - 430px)",dataIndex:"name",key:"name",className:ha.fileNameCol,render:(e,t)=>{var r,n;const o=t.isFolder&&null!==(n=null!==(r=t.childCount)&&void 0!==r?r:te[t.id])&&void 0!==n?n:0,a=D(1===o?"item":"items");return(0,i.jsxs)("div",{className:ha.fileName,children:[e||D("No name"),t.isFolder&&(0,i.jsxs)("div",{className:ha.fileItemCount,children:[o," ",a]})]})}},{title:D("Dimensions"),key:"dimensions",width:100,render:(e,t)=>t.dimensions&&(0,i.jsx)("div",{className:ha.fileSize,children:t.dimensions})},{title:D("Size"),key:"size",width:90,render:(e,t)=>!(null==t?void 0:t.size)||t.isFolder?null:(0,i.jsx)("div",{className:ha.fileSize,children:li(t.size)})},{title:D("Type"),key:"type",width:90,render:(e,t)=>{var r,n,o;if(t.isFolder)return(0,i.jsx)("div",{className:ha.fileSize,children:D("Folder")});const a=t.extension||(null===(r=t.name.split(".").pop())||void 0===r?void 0:r.toLowerCase())||(t.url?null===(o=null===(n=t.url.split("?")[0].split("/").pop())||void 0===n?void 0:n.split(".").pop())||void 0===o?void 0:o.toLowerCase():"")||"";return(0,i.jsx)("div",{className:ha.fileSize,children:a})}},...ve?[{title:D("Date"),dataIndex:"date",key:"date",width:200,render:(e,t)=>{const r=t.date;if(!r)return null;const n=new Date(r);if(isNaN(n.getTime()))return null;const o=e=>`${e.getDate()} ${[D("months.january"),D("months.february"),D("months.march"),D("months.april"),D("months.may"),D("months.june"),D("months.july"),D("months.august"),D("months.september"),D("months.october"),D("months.november"),D("months.december")][e.getMonth()]} ${e.getFullYear()}`;return(0,i.jsx)(v.A,{title:D("Added",{date:o(n)}),placement:"bottom",className:ha.fileDate,children:D("Added",{date:o(n)})})}}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(e,t)=>(0,i.jsx)(y.A,{arrow:!0,placement:"bottom",menu:{items:_e(t),onClick:Se(t.id)},trigger:["hover"],children:(0,i.jsx)("span",{className:`${ha.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,i.jsx)(Fn,{size:16,strokeWidth:fe})})})}],ke="table"===Q?(0,i.jsx)(c.Ay,{renderEmpty:()=>(0,i.jsx)(b.A,{image:(0,i.jsx)(i.Fragment,{}),description:""}),children:(0,i.jsx)(w.A,{dataSource:e,columns:Ae,rowKey:"id",pagination:!1,loading:h,rowClassName:e=>(null==p?void 0:p.has(e.id))?ha.selectedRow:"",tableLayout:"fixed",onRow:e=>({onClick:t=>{const r=t.target;we(()=>{t.stopPropagation(),t.preventDefault();const n=!!r.closest(".ant-image")||!!r.closest(".ant-image-preview-wrap"),i=!!r.closest(".tableMenuButton"),o=!!r.closest(".ant-dropdown-menu");n||i||o||I(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{xe(()=>{t.stopPropagation(),t.preventDefault();const r=t.target;r.closest(".ant-checkbox-wrapper")||r.closest(".tableMenu")||(e.isFolder?f(e):r.closest(".ant-image")||r.closest(".ant-image-preview-wrap")||!H.onEditorOk||H.onEditorOk(e))})}}),showHeader:!1})}):(0,i.jsx)(x.A,{gutter:[16,16],className:ha.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:e.map(e=>(0,i.jsx)(C.A,{className:ha.gridCard_col,style:{padding:0},children:(0,i.jsxs)(_.A,{hoverable:!0,cover:(0,i.jsx)("div",{className:e.isFolder?ha.gridPreviewContainerFolder:ha.gridPreviewContainer,onClick:t=>{t.stopPropagation(),e.isFolder&&we(()=>{I(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{t.stopPropagation(),xe(()=>{e.isFolder&&f(e)})},children:e.isFolder?(0,i.jsx)("div",{className:ha.gridFolderIcon,children:(0,i.jsx)(V,{className:ha.gridFolderIconImage})}):(0,i.jsx)(Oo,{thumbnailSrc:e.thumbnailUrl||e.thumbnail,previewSrc:e.url,alt:e.name,className:ha.gridImagePreview,preview:!0,file:e})}),className:`${ha.gridCard} ${(null==p?void 0:p.has(e.id))?ha.gridCardSelected:""}`,onClick:t=>{t.stopPropagation(),t.preventDefault();const r=t.target;r.closest(".gridFileMenuButton")||r.closest(".ant-dropdown-menu")||we(()=>I(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey}))},onDoubleClick:t=>{t.stopPropagation(),xe(()=>{e.isFolder&&f(e)})},children:[(0,i.jsxs)("div",{className:ha.gridCardContent,onDoubleClick:t=>{t.stopPropagation(),t.preventDefault(),xe(()=>{e.isFolder?f(e):H.onEditorOk&&H.onEditorOk(e)})},onClick:t=>{t.stopPropagation(),t.preventDefault();const r=t.target;r.closest(".gridFileMenuButton")||r.closest(".ant-dropdown-menu")||we(()=>I(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey}))},children:[(0,i.jsx)("div",{className:ha.gridFileName,children:e.name||D("Untitled")}),(0,i.jsx)("div",{className:ha.gridFileInfo,children:e.isFolder?(()=>{var t,r;const n=null!==(r=null!==(t=e.childCount)&&void 0!==t?t:te[e.id])&&void 0!==r?r:0;return`${n} ${D(1===n?"item":"items")}`})():(0,i.jsxs)(i.Fragment,{children:[e.dimensions&&`${e.dimensions} \u2022 `,e.size&&`${li(e.size)} \u2022 `,(()=>{var t,r,n;return e.extension||(null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase())||(e.url?null===(n=null===(r=e.url.split("?")[0].split("/").pop())||void 0===r?void 0:r.split(".").pop())||void 0===n?void 0:n.toLowerCase():"")||""})()]})})]}),(0,i.jsx)("div",{className:ha.gridFileMenu,children:(0,i.jsx)(y.A,{menu:{items:_e(e),onClick:Se(e.id)},arrow:!0,placement:"bottom",trigger:["hover"],children:(0,i.jsx)(S.Ay,{type:"default",className:`${ha.gridFileMenuButton} gridFileMenuButton`,onClick:()=>{},children:(0,i.jsx)(Fn,{size:16,strokeWidth:fe})})},e.id)}),(0,i.jsx)("div",{onClick:e=>{e.stopPropagation()},className:ha.gridCheckbox,children:(0,i.jsx)(m.A,{checked:p.has(e.id),style:{height:20},onClick:t=>{t.stopPropagation(),I(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,forceToggle:!0})}})})]})},e.id))}),Ee=null===(N=null==q?void 0:q.availableImageExtensions)||void 0===N?void 0:N.map(e=>"."+e).join(", "),Ie=(0,i.jsxs)("div",J?{className:`${ha.noFiles} ant-layout-sider-light`,children:[(0,i.jsx)(Xn,{size:48,className:ha.noFilesIcon}),(0,i.jsx)("div",{className:`${ha.textTitle_trash} ant-menu-submenu-title`,children:D("Trash is empty")}),(0,i.jsx)("div",{className:`${ha.textDescription_trash} ant-menu-submenu-title`,children:D("Deleted files will be displayed here")})]}:{className:ha.uploadContainer,children:[(0,i.jsxs)("div",{className:`${ha.uploadArea} `,onClick:L,children:[(0,i.jsx)("div",{className:ha.uploadIcon,children:(0,i.jsx)(z,{})}),(0,i.jsx)("div",{className:ha.textTitle,children:D("Click here to select a file")}),(0,i.jsx)("div",{className:ha.textDescription,children:D("Supported files:")+" "+(Ee||"jpeg, .svg, .png")})]}),(0,i.jsxs)("div",{className:ha.buttons,children:[(0,i.jsxs)("button",{className:ha.btnPhoto,onClick:()=>{Z&&Z(Dt)},children:[(0,i.jsx)("div",{className:ha.icon,children:(0,i.jsx)(B,{})}),(0,i.jsxs)("div",{className:ha.blockText,children:[(0,i.jsx)("div",{className:ha.textTitle,children:D("Stock")}),(0,i.jsx)("div",{className:ha.textDescription,children:D("Select an image from our library")})]})]}),(0,i.jsxs)("button",{className:ha.btnAi,onClick:()=>{Z&&Z(Bt)},children:[(0,i.jsx)("div",{className:ha.icon,children:(0,i.jsx)(U,{})}),(0,i.jsxs)("div",{className:ha.blockText,children:[(0,i.jsx)("div",{className:ha.textTitle,children:D("AI generation")}),(0,i.jsx)("div",{className:ha.textDescription,children:D("Creating an image on demand")})]})]})]})]});return(0,i.jsx)("div",{className:"content-layout",children:h||0!==(null==e?void 0:e.length)||t?(0,i.jsxs)("div",{className:ha.tableContainer,children:[(0,i.jsxs)("div",se?{className:`header-container ${ha.headerContainer}`,children:[(0,i.jsxs)(fa,{type:"secondary",className:"selected-text",children:[(0,i.jsxs)("div",{children:[se," ",D("selected")]}),(0,i.jsx)(v.A,{title:oe?D("Select all"):null,children:(0,i.jsx)(S.Ay,{className:ha.buttonSelectAll,onClick:Ce,disabled:le||0===e.length,children:D("Select all")})}),(0,i.jsx)(v.A,{title:oe?D("Deselected"):null,children:(0,i.jsx)(S.Ay,{className:ha.buttonDeselected,icon:(0,i.jsx)(Hn,{size:16,strokeWidth:fe}),onClick:()=>K&&K(new Set),children:D("Deselected")})})]}),(0,i.jsxs)(A.A,{children:[ge&&!1!==(null==ce?void 0:ce.enableEdit)&&(0,i.jsx)(v.A,{title:oe?D("Edit"):null,children:(0,i.jsx)(S.Ay,{icon:(0,i.jsx)(Tn,{size:16,strokeWidth:fe}),onClick:()=>{M(de)},disabled:!ge,children:D("Edit")})}),Array.from(p).every(t=>{const r=e.find(e=>e.id===t);return!!r&&(r.isFolder?!1!==(null==ce?void 0:ce.enableMoveFolder):!1!==(null==ce?void 0:ce.enableMoveItem))})&&(0,i.jsx)(v.A,{title:oe?D("Move to"):null,children:(0,i.jsx)(S.Ay,{icon:(0,i.jsx)(On,{size:16,strokeWidth:fe}),onClick:P,children:D("Move to")})}),Array.from(p).every(t=>{const r=e.find(e=>e.id===t);return!!r&&(r.isFolder?!1!==(null==ce?void 0:ce.enableCopyFolder):!1!==(null==ce?void 0:ce.enableCopyItem))})&&(0,i.jsx)(v.A,{title:oe?D("Copy"):null,children:(0,i.jsx)(S.Ay,{icon:(0,i.jsx)(jn,{size:16,strokeWidth:fe}),onClick:O,children:D("Copy")})}),1===se&&he&&(0,i.jsx)(v.A,{title:oe?D("Rename"):null,children:(0,i.jsx)(S.Ay,{icon:(0,i.jsx)(Gn,{size:16,strokeWidth:fe}),onClick:()=>T(),disabled:1!==se||!he,children:D("Rename")})}),!1!==(null==ce?void 0:ce.enableDelete)&&(0,i.jsx)(v.A,{title:oe?D("Delete"):null,children:(0,i.jsx)(S.Ay,{danger:!0,icon:(0,i.jsx)(Yn,{size:16,strokeWidth:fe}),onClick:e=>{e.stopPropagation(),e.preventDefault(),F()},children:D("Delete")})})]})]}:{className:ha.headerContainer,children:[(0,i.jsx)("div",{className:"search-container",children:(0,i.jsx)(jo,{placeholder:D("Search file or folder"),onSearch:r,className:ha.searchInput})}),(0,i.jsxs)("div",{className:ha.actionsBox,children:[(0,i.jsx)("div",{className:"sort-container",children:(0,i.jsxs)(g.A,{value:me,onChange:l,className:ha.sortSelect,popupMatchSelectWidth:!1,suffixIcon:(0,i.jsx)(En,{size:16,strokeWidth:fe}),children:[(0,i.jsx)(pa,{value:"date-desc",children:D("Newest first")}),(0,i.jsx)(pa,{value:"date-asc",children:D("Oldest first")}),(0,i.jsx)(pa,{value:"size-desc",children:D("Largest first")}),(0,i.jsx)(pa,{value:"size-asc",children:D("Smallest first")}),(0,i.jsx)(pa,{value:"name-asc",children:D("A-Z")}),(0,i.jsx)(pa,{value:"name-desc",children:D("Z-A")}),(0,i.jsx)(pa,{value:"type-asc",children:D("By type")})]})}),(0,i.jsx)("div",{className:ha.actionsContainer,children:(0,i.jsx)(k.A,{options:[{value:"grid",icon:(0,i.jsx)(Ln,{size:16,strokeWidth:fe})},{value:"table",icon:(0,i.jsx)(zn,{size:20,strokeWidth:fe})}],value:Q,onChange:e=>ee(e)})})]})]}),t&&!e.length?(0,i.jsx)(ua,{}):ke,!Y&&u.total>u.pageSize&&(0,i.jsx)("div",{className:ha.paginationContainer,children:(0,i.jsx)(E.A,{current:u.current,pageSize:u.pageSize,total:u.total,onChange:(e,t)=>d({current:e,pageSize:t,total:u.total}),showSizeChanger:!0,showTotal:e=>D("total pages",{total:e})})})]}):(0,i.jsx)("div",{className:ha.emptyStateWrapper,children:Ie})})};var ma="folderLabelItem",va="foldersTitle",ya="foldersTitleItem";const ba=({selectedFolder:e,onSelect:t,onExpand:r,generateMenuItems:n,fetchChildFolders:a,disabledFolders:s=[],showFileCounts:l=!1,folderFileCounts:c={},className:u="",expandedKeys:d,setExpandedKeys:h,showTrashFolder:f=!1,mode:p="navigation",defaultExpandAll:g=!1})=>{const{t:m}=kr(),{options:v}=ti(),{config:y}=v,{ExpandArrowIcon:b,CollapseArrowIcon:w,CollapseFolderIcon:x,ExpandFolderIcon:C,EmptyFolderIcon:_}=ca(),S=(0,o.useCallback)(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[A,k]=(0,o.useState)(()=>{if(g||"selection"===p&&g){const e=n();return S(e)}return[]}),E=void 0!==d?d:A,j=void 0!==h?h:k;(0,o.useEffect)(()=>{if(g||"selection"===p&&g){const e=n(),t=S(e);void 0===d&&k(t)}},[g,p,n,S,d]);const T=(0,o.useCallback)(async e=>{const r=e[0];r&&"empty"!==r&&!r.endsWith("_input")&&(null==t||t(e),await(null==a?void 0:a("folders"===r?null:r)))},[t,a]),F=(0,o.useCallback)(async(e,t)=>{var n;if(j(e),null==r||r(e,t),"lazy"!==(null==y?void 0:y.folderTreeLoading))return;const i=(null===(n=null==t?void 0:t.node)||void 0===n?void 0:n.key)||void 0;if(i&&"folders"!==i)try{await(null==a?void 0:a(i))}catch(e){}},[null==y?void 0:y.folderTreeLoading,a,r,j]),O=(0,o.useCallback)(()=>{var t,r;const o=n(),a=e=>e.filter(e=>"Trash"!==e.key).map(e=>Object.assign(Object.assign({},e),{children:e.children?a(e.children):void 0})),u=f?a(o):o,d=t=>{"selection"!==p?(E.includes(t)&&e===t?j(E.filter(e=>e!==t)):E.includes(t)||j([...E,t]),T([t])):T([t])},h=0===u.length||1===u.length&&(!u[0].children||0===u[0].children.length),g=e=>{var t;const r=l&&c[e.key]||0,n=E.includes(e.key),o=s.includes(e.key),a=(()=>{var t;return(null===(t=e.children)||void 0===t?void 0:t.length)?(0,i.jsx)(n?x:C,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}):(0,i.jsx)(_,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth})})(),u=(0,i.jsxs)("div",{className:"folderItemContainer folder-item-container",onClick:()=>!o&&d(e.key),style:{opacity:o?.5:1,cursor:o?"not-allowed":"pointer"},children:[(0,i.jsxs)("div",{className:"folderLabel",children:[void 0!==e.icon?e.icon:a,(0,i.jsx)("span",{className:ma,children:e.label})]}),l&&(0,i.jsx)("div",{className:"fileCount",title:`${r} ${1===r?"file":"files"}`,children:r})]});return{key:e.key,title:u,children:null===(t=e.children)||void 0===t?void 0:t.map(g),disabled:o}},v=E.includes("folders"),b=(0,i.jsx)("div",{className:va,onClick:()=>d("folders"),children:(0,i.jsxs)("div",{className:ya,children:[(0,i.jsx)(v?x:C,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}),(0,i.jsx)("span",{className:`${ma} folder-label-item`,children:"folders"===(null===(t=u[0])||void 0===t?void 0:t.key)?u[0].label:m("Folders")})]})}),w=()=>({key:"Trash",title:(0,i.jsx)("div",{className:va,onClick:()=>d("Trash"),children:(0,i.jsxs)("div",{className:ya,children:[(0,i.jsx)(Yn,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}),(0,i.jsx)("span",{className:ma,children:m("Trash")})]})}),children:void 0});if(h){if(!f)return[{key:"empty",title:(0,i.jsx)("div",{className:"emptyFolderContainer",children:m("No folders yet")}),disabled:!0}];const e=[];return u.length>0&&"folders"===u[0].key&&e.push({key:"folders",title:b,children:[]}),e.push(w()),e}if(u.length>0&&"folders"===u[0].key){const e=[{key:"folders",title:b,children:null===(r=u[0].children)||void 0===r?void 0:r.map(g)}];return f&&e.push(w()),e}return u.map(g)},[n,E,x,null==y?void 0:y.iconStrokeWidth,C,m,e,T,l,c,_,s,f,p,j]),P=(0,o.useMemo)(()=>O(),[O]);return(0,i.jsx)(I.A,{className:`folderTree folderMenu ${u}`,selectedKeys:e?[e]:[],expandedKeys:E,onSelect:T,onExpand:F,treeData:P,switcherIcon:({expanded:e})=>(0,i.jsx)(e?w:b,{}),showLine:!1})},wa=({style:e={},wrap:t=!1})=>{const r=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},e);return(0,i.jsx)(A.A,{size:"large",style:r,wrap:t,children:(0,i.jsx)(s.A,{})})};var xa={formFooter:"formFooter",folderButton:"folderButton",foldersWrapper:"foldersWrapper",formItem:"formItem",folderToolsField:"folderToolsField",inputButtonOk:"inputButtonOk",permanentDeleteWarning:"permanentDeleteWarning",clearTrashProgress:"clearTrashProgress",progressText:"progressText",closeIcon:"closeIcon",modalContentWithLoader:"modalContentWithLoader",modalLoaderOverlay:"modalLoaderOverlay"};const Ca=({folderId:e,activeFormField:t,EmptyFolderIcon:r,targetForm:n,handleModalOk:o,onComplete:a,setIsLoading:s,t:l})=>(0,i.jsx)(d.A.Item,{className:"form-item form-item-moveto "+(t===e?"form-item_active":""),name:"folderName",initialValue:l("New folder"),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(l("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{className:"form-input",autoFocus:!0,prefix:(0,i.jsx)(r,{style:{marginRight:6}}),suffix:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v.A,{placement:"top",title:"Clean",children:(0,i.jsx)(S.Ay,{icon:(0,i.jsx)(re.A,{style:{fontSize:10}}),className:xa.inputButtonClose,type:"text",onClick:()=>{n.setFieldsValue({folderName:""})}})}),(0,i.jsx)(S.Ay,{className:xa.inputButtonOk,type:"text",onClick:()=>{s(!0),o(n).then(e=>{const t=null==e?void 0:e.id;a(t)}).finally(()=>s(!1))},children:l("Create")})]})})});function _a({folders:e,selectedFolder:t,EmptyFolderIcon:r,handleCreateFolderModalOk:n,setIsLoading:a,t:s}){const[l,c]=o.useState(""),u=o.useCallback((e,t)=>o=>(0,i.jsx)(Ca,{folderId:o,activeFormField:l,EmptyFolderIcon:r,targetForm:e,handleModalOk:n,onComplete:t,setIsLoading:a,t:s},o),[r,l,n,a,s]),d=o.useCallback(e=>{const{folderId:t,targetForm:r,onTreeSelect:n,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),c(t),r.setFieldsValue({folderName:s("New folder"),targetFolder:t})},handleSelectFolder:e=>{e.preventDefault(),e.stopPropagation(),n([t]).then(()=>i(t))}}},[s]),h=o.useCallback(r=>{const{targetForm:n,onTreeSelect:o,onComplete:a,actionButtonText:c}=r,h=u(n,a),f=Array.isArray(e)?e:[],p=(e=null,r=new Set)=>f.filter(t=>{const r=null===e&&!t.parentId,n=t.parentId===e;return r||n}).map(e=>{if(r.has(e.id))return{key:e.id,label:`${e.name} (\u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430)`};const s=new Set(r);s.add(e.id);const u=p(e.id,s),{handleAddFolder:f,handleSelectFolder:g}=d({folderId:e.id,targetForm:n,onTreeSelect:o,onComplete:a}),m=l===e.id?[{key:`${e.id}_input`,label:h(e.id),icon:null},...u]:u;return{key:e.id,label:(0,i.jsxs)(i.Fragment,{children:[e.name,t!==e.id&&(0,i.jsxs)("div",{className:`${xa.folderToolsField} folder-tools-field`,children:[(0,i.jsx)(S.Ay,{onClick:f,children:"+"}),(0,i.jsx)(S.Ay,{onClick:g,children:c})]})]}),children:m}}),g=p(),{handleAddFolder:m,handleSelectFolder:v}=d({folderId:"folders",targetForm:n,onTreeSelect:o,onComplete:a}),y="folders"===l?[{key:"folders_input",label:h("folders"),icon:null},...g]:g;return[{key:"folders",label:(0,i.jsxs)(i.Fragment,{children:[s("Folders"),"folders"!==t&&null!==t&&(0,i.jsxs)("div",{className:`${xa.folderToolsField} folder-tools-field`,children:[(0,i.jsx)(S.Ay,{onClick:m,children:"+"}),(0,i.jsx)(S.Ay,{onClick:v,children:c})]})]}),children:y}]},[l,u,d,e,t,s]);return{activeFormField:l,setActiveFormField:c,generateMenuItemsFromFolders:h}}const Sa=(0,o.memo)(({folderId:e,activeFormField:t,EmptyFolderIcon:r,targetForm:n,handleModalOk:a,onComplete:s,t:l,setIsLoading:c,defaultFolderName:u})=>{const f=(0,o.useCallback)(()=>{c(!0),a(n).then(e=>s(null==e?void 0:e.id)).finally(()=>c(!1))},[a,n,s,c]);return(0,i.jsx)(d.A.Item,{className:"form-item form-item-moveto "+(t===e?"form-item_active":""),name:"folderName",initialValue:u,rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(l("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{className:"form-input",autoFocus:!0,prefix:(0,i.jsx)(r,{style:{marginRight:6}}),suffix:(0,i.jsx)(S.Ay,{className:xa.inputButtonOk,type:"text",onClick:()=>{c(!0),f()},children:l("Create")})})})});Sa.displayName="CustomFolderInput";const Aa=({isModalVisible:e,handleModalOk:t,handleModalCancel:r,form:n,selectedFolder:a,folders:s,isUrlModalVisible:l,setIsUrlModalVisible:c,handleAddFileByUrl:u,urlForm:f,isRenameModalVisible:p,handleRenameOk:g,handleRenameCancel:m,renameForm:v,fileToRename:y,files:b,isMoveModalVisible:w,handleMoveOk:x,handleMoveCancel:C,moveForm:_,selectedFiles:A,isRenameFolderModalVisible:k,handleRenameFolderOk:E,handleRenameFolderCancel:I,renameFolderForm:F,folderToRename:O,isCopyModalVisible:P,handleCopyOk:M,handleCopyCancel:R,copyForm:L,isDeleteConfirmVisible:N,handleDeleteConfirmOk:D,handleDeleteConfirmCancel:z,isClearTrashConfirmVisible:B,handleClearTrashConfirm:U,handleClearTrashCancel:V,fetchChildFolders:H})=>{var $,W,G;const{t:q}=kr(),{state:Y,actions:X,options:K}=ti(),{setCurrentMenuFile:Z}=X,{config:J}=K,{currentMenuFile:Q}=Y,ee=d.A.useWatch("folderName",n),{EmptyFolderIcon:te}=ca(),[ne,ie]=(0,o.useState)(!1),oe=(0,o.useMemo)(()=>{var e;return(null===(e=null==J?void 0:J.defaultFolderName)||void 0===e?void 0:e.trim())||q("New folder")},[null==J?void 0:J.defaultFolderName,q]),ae=!ee||0===String(ee).trim().length,se=(0,o.useMemo)(()=>Array.isArray(b)?b:[],[b]),le=y?null===($=se.find(e=>e.id===y))||void 0===$?void 0:$.name:"",ce=Array.isArray(s)?s:[],ue=O?null===(W=ce.find(e=>e.id===O))||void 0===W?void 0:W.name:"",{activeFormField:de,setActiveFormField:he,generateMenuItemsFromFolders:fe}=_a({folders:ce,selectedFolder:a,EmptyFolderIcon:te,handleCreateFolderModalOk:t,setIsLoading:e=>ie(Boolean(e)),t:q});(0,o.useEffect)(()=>{if(N){const e=setTimeout(()=>{const e=document.querySelector(".deleteModal");if(e){const t=e.querySelector(".ant-modal-footer");if(t){const e=t.querySelector(".ant-btn-primary");e&&e.focus()}}},100);return()=>clearTimeout(e)}},[N]);const pe=y?se.find(e=>e.id===y):null,ge=(null==pe?void 0:pe.isFolder)||(null==y?void 0:y.startsWith("folder_")),me=(0,o.useCallback)(async e=>{e.length>0&&(_.setFieldsValue({targetFolder:e[0]}),de!==e[0].toString()&&he(""))},[_,de,he]),ve=(0,o.useCallback)(async e=>{e.length>0&&(L.setFieldsValue({targetFolder:e[0]}),de!==e[0].toString()&&he(""))},[de,L,he]),ye=(0,o.useCallback)(async e=>{ie(!0);try{await x(e)}finally{ie(!1)}},[x]),be=(0,o.useCallback)(async e=>{ie(!0);try{await M(e)}finally{ie(!1)}},[M]),we=(0,o.useMemo)(()=>{const e=Array.from(A).filter(e=>{const t=se.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||s.some(t=>t.id===e)});return a&&"folders"!==a?e.push(a):a&&"folders"!==a||e.push("folders"),e},[A,se,s,a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:q("Creating a new folder")}),open:e,onOk:()=>t(),onCancel:r,okText:q("Create"),cancelText:q("Cancel"),okButtonProps:{disabled:ae,loading:ne},cancelButtonProps:{disabled:ne},afterClose:()=>ie(!1),children:(0,i.jsxs)(d.A,{form:n,layout:"vertical",children:[(0,i.jsx)(d.A.Item,{name:"folderName",label:(0,i.jsx)("div",{className:"form-label",children:q("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(q("Enter the name of the folder"))):Promise.resolve()}],initialValue:oe,className:"form-item",style:{marginBottom:5},children:(0,i.jsx)(h.A,{autoFocus:!0,className:"form-input",disabled:ne,placeholder:q("Enter the name"),onPressEnter:async()=>{ie(!0);try{await n.validateFields(),ae||await t()}catch(It){ie(!1)}}})}),(0,i.jsx)("div",{children:a&&"folders"!==a?(0,i.jsxs)("p",{className:"fm-note",children:[q("A folder will be created inside:")," ",(null===(G=ce.find(e=>e.id===a))||void 0===G?void 0:G.name)||q("selected folder"),"."]}):(0,i.jsx)("p",{className:"fm-note",children:q("The folder will be created in the root directory.")})})]})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:q("Upload file by URL")}),open:l,onOk:async()=>{ie(!0);try{await f.validateFields(),await u(null,void 0,void 0,"uploadByUrl")||ie(!1)}catch(It){ie(!1)}},onCancel:()=>c(!1),okText:q("Download"),okButtonProps:{loading:ne},cancelText:q("Cancel"),cancelButtonProps:{disabled:ne},afterClose:()=>ie(!1),children:(0,i.jsx)(d.A,{form:f,layout:"vertical",children:(0,i.jsx)(d.A.Item,{name:"fileUrl",label:(0,i.jsx)("div",{className:"form-label",children:q("File URL")}),rules:[{required:!0,message:q("Enter the URL of the image")},{validator:(e,t)=>{if(!t||!String(t).trim())return Promise.resolve();try{return Pi(String(t),q),Promise.resolve()}catch(e){return Promise.reject(new Error(e instanceof Error?e.message:q("The specified URL is not valid.")))}}}],validateTrigger:"onBlur",className:"form-item",children:(0,i.jsx)(h.A,{className:"form-input",placeholder:"https://example.com/image.jpg",autoFocus:!0,disabled:ne,onPressEnter:async()=>{ie(!0);try{await f.validateFields(),await u(null,void 0,void 0,"uploadByUrl")||ie(!1)}catch(It){ie(!1)}}})})})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:ge?`${q("Rename folder")} ${le}`:q("Rename file",{currentFileName:le})}),open:p,onOk:g,okText:q("Rename"),okButtonProps:{loading:ne},onCancel:m,cancelText:q("Cancel"),cancelButtonProps:{disabled:ne},afterClose:()=>{ie(!1),Z&&Z("")},children:(0,i.jsx)(d.A,{form:v,layout:"vertical",children:(0,i.jsx)(d.A.Item,{name:"newFileName",label:(0,i.jsx)("div",{className:"form-label",children:q(ge?"New folder name":"New file name")}),rules:[{required:!0,message:q(ge?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:(0,i.jsx)(h.A,{autoFocus:!0,className:"form-input",disabled:ne,onPressEnter:async()=>{ie(!0);try{await v.validateFields(),g()}catch(It){ie(!1)}}})})})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:q("Move to")}),open:w,onCancel:C,footer:(0,i.jsxs)("div",{className:xa.formFooter,children:[(0,i.jsxs)(S.Ay,{className:xa.folderButton,onClick:()=>{const e=null!=a?a:"folders";he(e),_.setFieldsValue({folderName:oe,targetFolder:e})},loading:ne,children:[(0,i.jsx)(Mn,{size:18,strokeWidth:null==J?void 0:J.iconStrokeWidth}),q("Create folder")]}),(0,i.jsx)(S.Ay,{type:"primary",className:xa.folderButton,onClick:C,loading:ne,children:q("Done")})]}),afterClose:()=>{Z&&Z(""),he(""),ie(!1)},loading:ne,children:(0,i.jsxs)("div",{className:xa.modalContentWithLoader,children:[ne&&(0,i.jsx)("div",{className:xa.modalLoaderOverlay,children:(0,i.jsx)(wa,{})}),(0,i.jsx)(d.A,{form:_,layout:"vertical",initialValues:{targetFolder:"folders",folderName:oe,is_force_create:!1},children:(0,i.jsxs)("div",{className:xa.foldersWrapper,children:[(0,i.jsx)(d.A.Item,{name:"targetFolder",rules:[{required:!0,message:q("Select the destination folder")}],className:xa.formItem,children:(0,i.jsx)(ba,{onSelect:me,generateMenuItems:()=>fe({targetForm:_,onTreeSelect:me,onComplete:ye,actionButtonText:q("Move here")}),fetchChildFolders:H,disabledFolders:we,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),(0,i.jsx)(d.A.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(q("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{})}),(0,i.jsx)(d.A.Item,{name:"is_force_create",style:{display:"none"},children:(0,i.jsx)(h.A,{})})]})})]})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:q("Copy to folder")}),open:P,onCancel:R,footer:(0,i.jsxs)("div",{className:xa.formFooter,children:[(0,i.jsxs)(S.Ay,{className:xa.folderButton,onClick:()=>{const e=null!=a?a:"folders";he(e),L.setFieldsValue({folderName:oe,targetFolder:e})},loading:ne,children:[(0,i.jsx)(Mn,{size:18,strokeWidth:null==J?void 0:J.iconStrokeWidth}),q("Create folder")]}),(0,i.jsx)(S.Ay,{type:"primary",className:xa.folderButton,onClick:R,loading:ne,children:q("Done")})]}),afterClose:()=>{Z&&Z(""),he(""),ie(!1)},loading:ne,children:(0,i.jsxs)("div",{className:xa.modalContentWithLoader,children:[ne&&(0,i.jsx)("div",{className:xa.modalLoaderOverlay,children:(0,i.jsx)(wa,{})}),(0,i.jsx)(d.A,{form:L,layout:"vertical",initialValues:{targetFolder:"folders",folderName:oe,is_force_create:!1},children:(0,i.jsxs)("div",{className:xa.foldersWrapper,children:[(0,i.jsx)(d.A.Item,{name:"targetFolder",rules:[{required:!0,message:q("Select the destination folder")}],className:xa.formItem,children:(0,i.jsx)(ba,{onSelect:ve,generateMenuItems:()=>fe({targetForm:L,onTreeSelect:ve,onComplete:be,actionButtonText:q("Copy here")}),fetchChildFolders:H,disabledFolders:we,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),(0,i.jsx)(d.A.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(q("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{})}),(0,i.jsx)(d.A.Item,{name:"is_force_create",style:{display:"none"},children:(0,i.jsx)(h.A,{})})]})})]})}),(0,i.jsx)(j.A,{title:(0,i.jsxs)("div",{className:"modal-title",children:[q("Rename folder")," ",ue]}),open:k,onOk:E,onCancel:I,okText:q("Rename"),cancelText:q("Cancel"),okButtonProps:{loading:ne},cancelButtonProps:{disabled:ne},afterClose:()=>{ie(!1),Z&&Z("")},children:(0,i.jsx)(d.A,{form:F,layout:"vertical",children:(0,i.jsx)(d.A.Item,{name:"newFolderName",label:(0,i.jsx)("div",{className:"form-label",children:q("New folder name")}),rules:[{required:!0,message:q("Enter a new folder name")}],className:"form-item",children:(0,i.jsx)(h.A,{autoFocus:!0,className:"form-input",disabled:ne,onPressEnter:async()=>{ie(!0);try{await F.validateFields(),E()}catch(It){ie(!1)}}})})})}),(0,i.jsx)(j.A,{className:`${xa.deleteModal} deleteModal`,title:(()=>{const e=!!(null==J?void 0:J.enableTrashFolder)&&"Trash"===a||!(null==J?void 0:J.enableTrashFolder),t=q(e?"Permanently delete":"Move to Trash");return(0,i.jsx)("div",{className:"modal-title",children:t})})(),open:!!N,onOk:()=>{ie(!0);try{D&&D()}catch(It){ie(!1)}},onCancel:()=>z&&z(),okText:(null==J?void 0:J.enableTrashFolder)&&"Trash"===a?q("Delete permanently"):(null==J?void 0:J.enableTrashFolder)?q("Move to Trash"):q("Delete"),cancelText:q("Cancel"),okButtonProps:{danger:!(null==J?void 0:J.enableTrashFolder)||"Trash"===a,loading:ne},cancelButtonProps:{disabled:ne},afterClose:()=>{ie(!1),Z&&Z("")},closeIcon:(0,i.jsx)(re.A,{className:xa.closeIcon}),children:(()=>{var e,t;const r=(Q?[Q]:Array.from(A||[])).map(e=>se.find(t=>t.id===e)).filter(e=>!!e),n=r.filter(e=>e.isFolder||e.id.startsWith("folder_")),o=r.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),s=r.length,l=n.length,c=o.length,u=!!(null==J?void 0:J.enableTrashFolder);if(!u||u&&"Trash"===a){let t;if(1===s&&1===l){const r=n[0],i=(null==r?void 0:r.name)||"",o=null!==(e=null==r?void 0:r.childCount)&&void 0!==e?e:0;t=q("delete_folder_permanent",{name:i,count:o})}else t=0===l&&c>0?q("delete_files_permanent",{count:c}):q("delete_mixed_permanent",{total:s,folders:l,images:c});return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:t}),(0,i.jsx)("p",{className:xa.permanentDeleteWarning,children:q("permanent_delete_warning")})]})}if(1===s&&1===l){const e=n[0],r=(null==e?void 0:e.name)||"",o=null!==(t=null==e?void 0:e.childCount)&&void 0!==t?t:0;return(0,i.jsx)("div",{children:q("move_folder_to_trash",{name:r,count:o})})}return(0,i.jsx)("div",0===l&&c>0?{children:q("move_files_to_trash",{count:c})}:{children:q("move_mixed_to_trash",{total:s,folders:l,images:c})})})()}),(0,i.jsxs)(j.A,{className:`${xa.deleteModal} deleteModal`,title:(0,i.jsx)("div",{className:"modal-title",children:q("Clear Trash")}),open:!!B,onOk:async()=>{ie(!0),U&&await U(),ie(!1)},onCancel:()=>V&&V(),okText:q("Delete permanently"),cancelText:q("Cancel"),okButtonProps:{danger:!0,loading:ne},cancelButtonProps:{disabled:ne},afterClose:()=>{ie(!1)},closeIcon:(0,i.jsx)(re.A,{className:xa.closeIcon}),children:[(0,i.jsx)("div",{children:q("Are you sure you want to permanently delete all items from Trash?")}),ne&&(0,i.jsxs)("div",{className:xa.clearTrashProgress,children:[(0,i.jsx)(T.A,{percent:99,status:"active",showInfo:!1}),(0,i.jsx)("div",{className:xa.progressText,children:q("Deleting items...")})]})]})]})};var ka={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const Ea=(0,o.memo)((0,o.forwardRef)(({selectedFolder:e,generateMenuItems:t,onFolderSelect:r,folders:n,fetchChildFolders:a,handleAddFile:s,setIsUrlModalVisible:l,handleCreateFolder:c,activeLibraryItem:u,setActiveLibraryItem:d},h)=>{const f=(0,o.useMemo)(()=>Array.isArray(n)?n:[],[n]),{t:p}=kr(),g=oi(),[m,v]=(0,o.useState)({}),{options:y}=ti(),{dataProviders:b,config:w}=y,x=(0,o.useCallback)(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[C,_]=(0,o.useState)(()=>{if(!0===(null==w?void 0:w.expandAllFoldersOnInit)&&"lazy"!==(null==w?void 0:w.folderTreeLoading)){const e=t();return x(e)}return!0===(null==w?void 0:w.expandRootFolderOnInit)?["folders"]:[]}),A=(0,o.useRef)(!1),k=(0,o.useRef)(!1);(0,o.useEffect)(()=>{A.current||"lazy"===(null==w?void 0:w.folderTreeLoading)&&!0===(null==w?void 0:w.expandRootFolderOnInit)&&(A.current=!0,(async()=>{try{await(null==a?void 0:a(null))}catch(It){}})())},[null==w?void 0:w.folderTreeLoading,null==w?void 0:w.expandRootFolderOnInit,a]),(0,o.useEffect)(()=>{!0===(null==w?void 0:w.expandRootFolderOnInit)&&Array.isArray(f)&&f.length>0&&(k.current||C&&0!==C.length||(k.current=!0,_(["folders"])))},[null==w?void 0:w.expandRootFolderOnInit,f,C]),(0,o.useEffect)(()=>{if(!0===(null==w?void 0:w.expandAllFoldersOnInit)&&"lazy"!==(null==w?void 0:w.folderTreeLoading)){const e=t(),r=x(e);return void _(r)}!0===(null==w?void 0:w.expandRootFolderOnInit)&&_(e=>e&&e.length>0?[...e]:["folders"])},[f,t,x,null==w?void 0:w.expandAllFoldersOnInit,null==w?void 0:w.folderTreeLoading,null==w?void 0:w.expandRootFolderOnInit]);const E=null==w?void 0:w.disablePagination,I=(0,o.useCallback)(async e=>{var t,r,n,i;try{if(null==b?void 0:b.getChildrenCount)return await b.getChildrenCount("folders"===e?void 0:e);if(null==b?void 0:b.getFiles){const{files:r,pagination:n}=await b.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:E?void 0:1,limit:E?void 0:1});return E?Array.isArray(r)?r.length:0:null!==(t=null==n?void 0:n.total)&&void 0!==t?t:Array.isArray(r)?r.length:0}return 0}catch(t){if("StaleLoad"===(null==t?void 0:t.name))return 0;const o=t;return 404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code)||"path_folder_not_found"===(null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.code)||404===(null===(i=null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.data)||void 0===i?void 0:i.status)||g.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:p("Failed to load folder items count"),placement:"bottomRight",innerException:t,data:{folderId:"folders"===e?null:e,reason:t instanceof Error?t.message:String(t)}}),0}},[b,g,p,E]),j=(0,o.useCallback)(async()=>{if(0===f.length)return;const e={};e.folders=await I("folders");const t=f.map(async t=>{"number"!=typeof t.childCount?e[t.id]=await I(t.id):e[t.id]=t.childCount});await Promise.all(t),v(e)},[f,I]),T=(0,o.useCallback)(async e=>{const t=await I(e);v(r=>Object.assign(Object.assign({},r),{[e]:t}))},[I]);(0,o.useImperativeHandle)(h,()=>({refreshFileCounts:j}),[j]),(0,o.useEffect)(()=>{j()},[j]),(0,o.useEffect)(()=>{if(!e||"folders"===e)return;const t=(e,r=new Set)=>{if(r.has(e))return[];const n=f.find(t=>t.id===e);if(!n)return[];if(!n.parentId)return[];const i=new Set(r);return i.add(e),[...t(n.parentId,i),n.parentId]},r=t(e);r.length>0?_(e=>{const t=new Set(e);return r.forEach(e=>t.add(e)),t.add("folders"),Array.from(t)}):_(e=>e.includes("folders")?e:[...e,"folders"])},[e,f]);const P=(0,o.useCallback)(async()=>{await s(),e?await T(e):await T("folders")},[s,e,T]),M=[{key:Lt,label:p("My files"),icon:(0,i.jsx)(Nn,{size:20,strokeWidth:null==w?void 0:w.iconStrokeWidth})},{key:Nt,label:p("GIF"),icon:(0,i.jsx)(Bn,{size:20,strokeWidth:null==w?void 0:w.iconStrokeWidth})},{key:Dt,label:p("Stock images"),icon:(0,i.jsx)(In,{size:20,strokeWidth:null==w?void 0:w.iconStrokeWidth})},{key:zt,label:p("Icons"),icon:(0,i.jsx)(ne.A,{size:20})},{key:Bt,label:p("AI"),icon:(0,i.jsx)(Wn,{size:20,strokeWidth:null==w?void 0:w.iconStrokeWidth}),disabled:!(null==w?void 0:w.sseQuery)}],R=(0,o.useCallback)(async e=>{const t=e[0];t&&"empty"!==t&&(u!==Lt&&d(Lt),null==r||r(t),await(null==a?void 0:a(t)))},[r,u,d,a]),L=(0,o.useCallback)(({key:e})=>{d(e)},[d]),N=(0,o.useCallback)(async(e,t)=>{var r;if(_(e),"lazy"!==(null==w?void 0:w.folderTreeLoading))return;const n=(null===(r=null==t?void 0:t.node)||void 0===r?void 0:r.key)||void 0;if(n&&"folders"!==n)try{await(null==a?void 0:a(n))}catch(e){g.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:p("Failed to load subfolders"),placement:"bottomRight",innerException:e,data:{folderId:n,reason:e instanceof Error?e.message:String(e)}})}},[null==w?void 0:w.folderTreeLoading,a,g,p]);return(0,i.jsxs)("div",{className:"sidebar-container",children:[(0,i.jsxs)("div",{className:ka.buttonWrapper,children:[(0,i.jsx)(S.Ay,{type:"primary",size:"large",icon:(0,i.jsx)(Un,{size:24,strokeWidth:null==w?void 0:w.iconStrokeWidth}),onClick:P,className:ka.uploadButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===e,children:(0,i.jsx)("span",{className:ka.uploadButtonTitle,children:p("Upload file")})}),(0,i.jsx)(S.Ay,{type:"primary",size:"large",icon:(0,i.jsx)(Dn,{size:24,strokeWidth:null==w?void 0:w.iconStrokeWidth}),onClick:()=>null==l?void 0:l(!0),className:ka.uploadByURLButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===e})]}),(0,i.jsx)(F.A,{className:"folder-menu",items:M,defaultSelectedKeys:[Lt],onSelect:({key:e})=>L({key:e}),selectedKeys:[u]}),(0,i.jsx)(O.A,{className:ka.divider}),(0,i.jsxs)("div",{className:ka.foldersContainer,children:[(0,i.jsx)(ba,{selectedFolder:e,onSelect:R,onExpand:N,generateMenuItems:t,fetchChildFolders:a,showFileCounts:!0,folderFileCounts:m,expandedKeys:C,setExpandedKeys:_,showTrashFolder:null==w?void 0:w.enableTrashFolder}),(0,i.jsx)("div",{className:ka.folderActions,children:(0,i.jsx)(S.Ay,{onClick:e=>{e.stopPropagation(),c()},className:ka.button,icon:(0,i.jsx)(Mn,{size:18,strokeWidth:null==w?void 0:w.iconStrokeWidth}),size:"middle"})})]})]})}));Ea.displayName="FolderSidebar";var Ia=Object.defineProperty,ja=(e,t,r)=>(((e,t,r)=>{t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);function Ta(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function Fa(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function Oa(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=Fa(e);return t>0?Ta(Number(e)*Math.pow(10,t)):Number(e)}function Pa(e){Na&&(e>Number.MAX_SAFE_INTEGER||Number.MIN_SAFE_INTEGER)}function Ma(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0];return t.slice(1).reduce(function(t,r){return e(t,r)},n)}}var Ra=Ma(function(e,t){var r=Oa(e),n=Oa(t),i=Fa(e)+Fa(t),o=r*n;return Pa(o),o/Math.pow(10,i)}),La=(Ma(function(e,t){var r=Math.pow(10,Math.max(Fa(e),Fa(t)));return(Ra(e,r)+Ra(t,r))/r}),Ma(function(e,t){var r=Math.pow(10,Math.max(Fa(e),Fa(t)));return(Ra(e,r)-Ra(t,r))/r}),Ma(function(e,t){var r=Oa(e),n=Oa(t);return Pa(r),Pa(n),Ra(r/n,Ta(Math.pow(10,Fa(t)-Fa(e))))})),Na=!0,Da=function(e,t){var r=Math.pow(10,t),n=La(Math.round(Math.abs(Ra(e,r))),r);return e<0&&0!==n&&(n=Ra(n,-1)),n},za=function(e){void 0===e&&(e=!0),Na=e};const Ba=Object.prototype.toString;function Ua(e){switch(Ba.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Za(e,Error)}}function Va(e,t){return Ba.call(e)===`[object ${t}]`}function Ha(e){return Va(e,"ErrorEvent")}function $a(e){return Va(e,"DOMError")}function Wa(e){return Va(e,"String")}function Ga(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function qa(e){return null===e||Ga(e)||"object"!=typeof e&&"function"!=typeof e}function Ya(e){return Va(e,"Object")}function Xa(e){return typeof Event<"u"&&Za(e,Event)}function Ka(e){return!(!e||!e.then||"function"!=typeof e.then)}function Za(e,t){try{return e instanceof t}catch{return!1}}function Ja(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function Qa(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function es(e,t){if(!Array.isArray(e))return"";const r=[];for(let n=0;n<e.length;n++){const t=e[n];try{Ja(t)?r.push("[VueViewModel]"):r.push(String(t))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function ts(e,t=[],r=!1){return t.some(t=>function(e,t,r=!1){return!!Wa(e)&&(function(e){return Va(e,"RegExp")}(t)?t.test(e):!!Wa(t)&&(r?e===t:e.includes(t)))}(e,t,r))}function rs(e,t,r=250,n,i,o,a){if(!(o.exception&&o.exception.values&&a&&Za(a.originalException,Error)))return;const s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=function(e,t){return e.map(e=>(e.value&&(e.value=Qa(e.value,t)),e))}(ns(e,t,i,a.originalException,n,o.exception.values,s,0),r))}function ns(e,t,r,n,i,o,a,s){if(o.length>=r+1)return o;let l=[...o];if(Za(n[i],Error)){is(a,s);const o=e(t,n[i]),c=l.length;os(o,i,c,s),l=ns(e,t,r,n[i],i,[o,...l],o,c)}return Array.isArray(n.errors)&&n.errors.forEach((n,o)=>{if(Za(n,Error)){is(a,s);const c=e(t,n),u=l.length;os(c,`errors[${o}]`,u,s),l=ns(e,t,r,n,i,[c,...l],c,u)}}),l}function is(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function os(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function as(e){return e&&e.Math==Math?e:void 0}const ss="object"==typeof globalThis&&as(globalThis)||"object"==typeof window&&as(window)||"object"==typeof self&&as(self)||"object"==typeof r.g&&as(r.g)||function(){return this}()||{};function ls(){return ss}function cs(e,t,r){const n=r||ss,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const us=ls();function ds(e,t={}){if(!e)return"<unknown>";try{let r=e;const n=5,i=[];let o=0,a=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;r&&o++<n&&(c=hs(r,u),!("html"===c||o>1&&a+i.length*l+c.length>=d));)i.push(c),a+=c.length,r=r.parentNode;return i.reverse().join(s)}catch{return"<unknown>"}}function hs(e,t){const r=e,n=[];let i,o,a,s,l;if(!r||!r.tagName)return"";if(us.HTMLElement&&r instanceof HTMLElement&&r.dataset&&r.dataset.sentryComponent)return r.dataset.sentryComponent;n.push(r.tagName.toLowerCase());const c=t&&t.length?t.filter(e=>r.getAttribute(e)).map(e=>[e,r.getAttribute(e)]):null;if(c&&c.length)c.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),i=r.className,i&&Wa(i))for(o=i.split(/\s+/),l=0;l<o.length;l++)n.push(`.${o[l]}`);const u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=r.getAttribute(a),s&&n.push(`[${a}="${s}"]`);return n.join("")}const fs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ps=["debug","info","warn","error","log","assert","trace"],gs={};function ms(e){if(!("console"in ss))return e();const t=ss.console,r={},n=Object.keys(gs);n.forEach(e=>{const n=gs[e];r[e]=t[e],t[e]=n});try{return e()}finally{n.forEach(e=>{t[e]=r[e]})}}const vs=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return fs?ps.forEach(r=>{t[r]=(...t)=>{e&&ms(()=>{ss.console[r](`Sentry Logger [${r}]:`,...t)})}}):ps.forEach(e=>{t[e]=()=>{}}),t}(),ys=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function bs(e,t=!1){const{host:r,path:n,pass:i,port:o,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${r}${o?`:${o}`:""}/${n&&`${n}/`}${a}`}function ws(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}class xs 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}}function Cs(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);"function"==typeof i&&Ss(i,n),e[t]=i}function _s(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{fs&&vs.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Ss(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,_s(e,"__sentry_original__",t)}catch{}}function As(e){return e.__sentry_original__}function ks(e){if(Ua(e))return{message:e.message,name:e.name,stack:e.stack,...Is(e)};if(Xa(e)){const t={type:e.type,target:Es(e.target),currentTarget:Es(e.currentTarget),...Is(e)};return typeof CustomEvent<"u"&&Za(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Es(e){try{return function(e){return typeof Element<"u"&&Za(e,Element)}(e)?ds(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Is(e){if("object"==typeof e&&null!==e){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}return{}}function js(e){return Ts(e,new Map)}function Ts(e,t){if(function(e){if(!Ya(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch{return!0}}(e)){const r=t.get(e);if(void 0!==r)return r;const n={};t.set(e,n);for(const i of Object.keys(e))typeof e[i]<"u"&&(n[i]=Ts(e[i],t));return n}if(Array.isArray(e)){const r=t.get(e);if(void 0!==r)return r;const n=[];return t.set(e,n),e.forEach(e=>{n.push(Ts(e,t))}),n}return e}const Fs=/\(error: (.*)\)/,Os=/captureMessage|captureException/;function Ps(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,r=0)=>{const n=[],i=e.split("\n");for(let o=r;o<i.length;o++){const e=i[o];if(e.length>1024)continue;const r=Fs.test(e)?e.replace(Fs,"$1"):e;if(!r.match(/\S*Error: /)){for(const e of t){const t=e(r);if(t){n.push(t);break}}if(n.length>=50)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),Os.test(t[t.length-1].function||"")&&(t.pop(),Os.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"}))}(n)}}function Ms(e){return Array.isArray(e)?Ps(...e):e}const Rs="<anonymous>";function Ls(e){try{return e&&"function"==typeof e&&e.name||Rs}catch{return Rs}}const Ns={},Ds={};function zs(e,t){Ns[e]=Ns[e]||[],Ns[e].push(t)}function Bs(e,t){Ds[e]||(t(),Ds[e]=!0)}function Us(e,t){const r=e&&Ns[e];if(r)for(const n of r)try{n(t)}catch(t){fs&&vs.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Ls(n)}\nError:`,t)}}function Vs(){"console"in ss&&ps.forEach(function(e){e in ss.console&&Cs(ss.console,e,function(t){return gs[e]=t,function(...t){Us("console",{args:t,level:e});const r=gs[e];r&&r.apply(ss.console,t)}})})}function Hs(){const e=ss,t=e.crypto||e.msCrypto;let r=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(r=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,e=>(e^(15&r())>>e/4).toString(16))}function $s(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Ws(e){const{message:t,event_id:r}=e;if(t)return t;const n=$s(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Gs(e,t,r){const n=e.exception=e.exception||{},i=n.values=n.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type="Error")}function qs(e,t){const r=$s(e);if(!r)return;const n=r.mechanism;if(r.mechanism={type:"generic",handled:!0,...n,...t},t&&"data"in t){const e={...n&&n.data,...t.data};r.mechanism.data=e}}function Ys(e){if(e&&e.__sentry_captured__)return!0;try{_s(e,"__sentry_captured__",!0)}catch{}return!1}function Xs(e){return Array.isArray(e)?e:[e]}const Ks=ss;let Zs,Js,Qs;function el(){if(!Ks.document)return;const e=Us.bind(null,"dom"),t=tl(e,!0);Ks.document.addEventListener("click",t,!1),Ks.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const r=Ks[t]&&Ks[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Cs(r,"addEventListener",function(t){return function(r,n,i){if("click"===r||"keypress"==r)try{const n=this,o=n.__sentry_instrumentation_handlers__=n.__sentry_instrumentation_handlers__||{},a=o[r]=o[r]||{refCount:0};if(!a.handler){const n=tl(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}}),Cs(r,"removeEventListener",function(e){return function(t,r,n){if("click"===t||"keypress"==t)try{const r=this,i=r.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,n),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete r.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,r,n)}}))})}function tl(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;const n=function(e){try{return e.target}catch{return null}}(r);if(function(e,t){return!("keypress"!==e||t&&t.tagName&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable))}(r.type,n))return;_s(r,"_sentryCaptured",!0),n&&!n._sentryId&&_s(n,"_sentryId",Hs());const i="keypress"===r.type?"input":r.type;(function(e){if(e.type!==Js)return!1;try{if(!e.target||e.target._sentryId!==Qs)return!1}catch{}return!0})(r)||(e({event:r,name:i,global:t}),Js=r.type,Qs=n?n._sentryId:void 0),clearTimeout(Zs),Zs=Ks.setTimeout(()=>{Qs=void 0,Js=void 0},1e3)}}const rl=ls();function nl(){if(!("fetch"in rl))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function il(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ol(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!nl())return!1;if(il(rl.fetch))return!0;let e=!1;const t=rl.document;if(t&&"function"==typeof t.createElement)try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=il(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){fs&&vs.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&Cs(ss,"fetch",function(e){return function(...t){const{method:r,url:n}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,r]=e;return{url:sl(t),method:al(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:sl(t),method:al(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return Us("fetch",{...i}),e.apply(ss,t).then(e=>(Us("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw Us("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function al(e,t){return!!e&&"object"==typeof e&&!!e[t]}function sl(e){return"string"==typeof e?e:e?al(e,"url")?e.url:e.toString?e.toString():"":""}let ll=null;function cl(){ll=ss.onerror,ss.onerror=function(e,t,r,n,i){return Us("error",{column:n,error:i,line:r,msg:e,url:t}),!(!ll||ll.__SENTRY_LOADER__)&&ll.apply(this,arguments)},ss.onerror.__SENTRY_INSTRUMENTED__=!0}let ul=null;function dl(){ul=ss.onunhandledrejection,ss.onunhandledrejection=function(e){return Us("unhandledrejection",e),!(ul&&!ul.__SENTRY_LOADER__)||ul.apply(this,arguments)},ss.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const hl=ls(),fl=ss;let pl;function gl(e){const t="history";zs(t,e),Bs(t,ml)}function ml(){if(!function(){const e=hl.chrome,t=e&&e.app&&e.app.runtime,r="history"in hl&&!!hl.history.pushState&&!!hl.history.replaceState;return!t&&r}())return;const e=fl.onpopstate;function t(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const e=pl,t=String(r);pl=t,Us("history",{from:e,to:t})}return e.apply(this,t)}}fl.onpopstate=function(...t){const r=fl.location.href,n=pl;if(pl=r,Us("history",{from:n,to:r}),e)try{return e.apply(this,t)}catch{}},Cs(fl.history,"pushState",t),Cs(fl.history,"replaceState",t)}const vl=ss,yl="__sentry_xhr_v3__";function bl(){if(!vl.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;Cs(e,"open",function(e){return function(...t){const r=Date.now(),n=Wa(t[0])?t[0].toUpperCase():void 0,i=function(e){if(Wa(e))return e;try{return e.toString()}catch{}}(t[1]);if(!n||!i)return e.apply(this,t);this[yl]={method:n,url:i,request_headers:{}},"POST"===n&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[yl];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}Us("xhr",{args:[n,i],endTimestamp:Date.now(),startTimestamp:r,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?Cs(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),Cs(this,"setRequestHeader",function(e){return function(...t){const[r,n]=t,i=this[yl];return i&&Wa(r)&&Wa(n)&&(i.request_headers[r.toLowerCase()]=n),e.apply(this,t)}}),e.apply(this,t)}}),Cs(e,"send",function(e){return function(...t){const r=this[yl];return r?(void 0!==t[0]&&(r.body=t[0]),Us("xhr",{args:[r.method,r.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)):e.apply(this,t)}})}function wl(e,t=100,r=1/0){try{return Cl("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function xl(e,t=3,r=102400){const n=wl(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(n)>r?xl(e,t-1,r):n}function Cl(e,t,n=1/0,i=1/0,o=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(r){if(e)return!!t.has(r)||(t.add(r),!1);for(let e=0;e<t.length;e++)if(t[e]===r)return!0;return t.push(r),!1},function(r){if(e)t.delete(r);else for(let e=0;e<t.length;e++)if(t[e]===r){t.splice(e,1);break}}]}()){const[a,s]=o;if(null==t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;const l=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(typeof r.g<"u"&&t===r.g)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Ja(t))return"[VueViewModel]";if(function(e){return Ya(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t))return"[SyntheticEvent]";if("number"==typeof t&&t!=t)return"[NaN]";if("function"==typeof t)return`[Function: ${Ls(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const n=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const c="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===c)return l.replace("object ","");if(a(t))return"[Circular ~]";const u=t;if(u&&"function"==typeof u.toJSON)try{return Cl("",u.toJSON(),c-1,i,o)}catch{}const d=Array.isArray(t)?[]:{};let h=0;const f=ks(t);for(const r in f){if(!Object.prototype.hasOwnProperty.call(f,r))continue;if(h>=i){d[r]="[MaxProperties ~]";break}const e=f[r];d[r]=Cl(r,e,c-1,i,o),h++}return s(t),d}var _l;function Sl(e){return new kl(t=>{t(e)})}function Al(e){return new kl((t,r)=>{r(e)})}!function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(_l||(_l={}));class kl{constructor(e){kl.prototype.__init.call(this),kl.prototype.__init2.call(this),kl.prototype.__init3.call(this),kl.prototype.__init4.call(this),this._state=_l.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new kl((r,n)=>{this._handlers.push([!1,t=>{if(e)try{r(e(t))}catch(e){n(e)}else r(t)},e=>{if(t)try{r(t(e))}catch(e){n(e)}else n(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new kl((t,r)=>{let n,i;return this.then(t=>{i=!1,n=t,e&&e()},t=>{i=!0,n=t,e&&e()}).then(()=>{i?r(n):t(n)})})}__init(){this._resolve=e=>{this._setResult(_l.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(_l.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===_l.PENDING){if(Ka(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===_l.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===_l.RESOLVED&&e[1](this._value),this._state===_l.REJECTED&&e[2](this._value),e[0]=!0)})}}}function El(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}const Il=["fatal","error","warning","log","info","debug"];function jl(e){return"warn"===e?"warning":Il.includes(e)?e:"log"}function Tl(){return Date.now()/1e3}const Fl=function(){const{performance:e}=ss;if(!e||!e.now)return Tl;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/1e3}();function Ol(e,t=[]){return[e,t]}function Pl(e,t){const[r,n]=e;return[r,[...n,t]]}function Ml(e,t){const r=e[1];for(const n of r)if(t(n,n[0].type))return!0;return!1}function Rl(e,t){return(t||new TextEncoder).encode(e)}function Ll(e,t){const[r,n]=e;let i=JSON.stringify(r);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[Rl(i,t),e]:i.push("string"==typeof e?Rl(e,t):e)}for(const a of n){const[e,t]=a;if(o(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch{e=JSON.stringify(wl(t))}o(e)}}return"string"==typeof i?i:function(e){const t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}(i)}function Nl(e,t){const r="string"==typeof e.data?Rl(e.data,t):e.data;return[js({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}(()=>{const{performance:e}=ss;if(!e||!e.now)return;const t=36e5,r=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+r-n):t,o=i<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+r-n):t;(o||s<t)&&i<=s&&e.timeOrigin})();const Dl={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function zl(e){return Dl[e]}function Bl(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}const Ul=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Vl="production";function Hl(){return cs("globalEventProcessors",()=>[])}function $l(e){Hl().push(e)}function Wl(e,t,r,n=0){return new kl((i,o)=>{const a=e[n];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},r);Ul&&a.id&&null===s&&vs.log(`Event processor "${a.id}" dropped event`),Ka(s)?s.then(t=>Wl(e,t,r,n+1).then(i)).then(null,o):Wl(e,s,r,n+1).then(i).then(null,o)}})}function Gl(e){const t=Fl(),r={sid:Hs(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return js({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,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(r)};return e&&ql(r,e),r}function ql(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||Fl(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Hs()),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{const t=e.timestamp-e.started;e.duration=t>=0?t: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)}function Yl(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),ql(e,r)}function Xl(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:o,status:a,tags:s,origin:l}=Kl(e);return js({data:n,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:r,origin:l})}function Kl(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}const Zl=new WeakMap;function Jl(e,t){return xc().captureEvent(e,t)}function Ql(e,t){xc().addBreadcrumb(e,t)}function ec(){return xc().getClient()}function tc(){return xc().getScope()}function rc(e){const t=ec(),r=Cc(),n=tc(),{release:i,environment:o=Vl}=t&&t.getOptions()||{},{userAgent:a}=ss.navigator||{},s=Gl({release:i,environment:o,user:n.getUser()||r.getUser(),...a&&{userAgent:a},...e}),l=r.getSession();return l&&"ok"===l.status&&ql(l,{status:"exited"}),nc(),r.setSession(s),n.setSession(s),s}function nc(){const e=Cc(),t=tc(),r=t.getSession()||e.getSession();r&&Yl(r),ic(),e.setSession(),t.setSession()}function ic(){const e=Cc(),t=tc(),r=ec(),n=t.getSession()||e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}function oc(e=!1){e?nc():ic()}function ac(e){return e.transaction}function sc(e,t,r){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=r&&r.getUser()||{},a=js({environment:n.environment||Vl,release:n.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function lc(e){const t=ec();if(!t)return{};const r=sc(Kl(e).trace_id||"",t,tc()),n=ac(e);if(!n)return r;const i=n&&n._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:o,source:a}=n.metadata;null!=o&&(r.sample_rate=`${o}`);const s=Kl(n);return a&&"url"!==a&&(r.transaction=s.description),r.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return!!(1&t)}(n)),t.emit&&t.emit("createDsc",r),r}function cc(e,t){const{fingerprint:r,span:n,breadcrumbs:i,sdkProcessingMetadata:o}=t;(function(e,t){const{extra:r,tags:n,user:i,contexts:o,level:a,transactionName:s}=t,l=js(r);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=js(n);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=js(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=js(o);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),a&&(e.level=a),s&&(e.transaction=s)})(e,t),n&&function(e,t){e.contexts={trace:Xl(t),...e.contexts};const r=ac(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:lc(t),...e.sdkProcessingMetadata};const n=Kl(r).description;n&&(e.tags={transaction:n,...e.tags})}}(e,n),function(e,t){e.fingerprint=e.fingerprint?Xs(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}(e,r),function(e,t){const r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}(e,i),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,o)}function uc(e,t){const{extra:r,tags:n,user:i,contexts:o,level:a,sdkProcessingMetadata:s,breadcrumbs:l,fingerprint:c,eventProcessors:u,attachments:d,propagationContext:h,transactionName:f,span:p}=t;dc(e,"extra",r),dc(e,"tags",n),dc(e,"user",i),dc(e,"contexts",o),dc(e,"sdkProcessingMetadata",s),a&&(e.level=a),f&&(e.transactionName=f),p&&(e.span=p),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),c.length&&(e.fingerprint=[...e.fingerprint,...c]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...h}}function dc(e,t,r){if(r&&Object.keys(r).length){e[t]={...e[t]};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[t][n]=r[n])}}let hc;class fc{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=pc()}static clone(e){return e?e.clone():new fc}clone(){const e=new fc;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&ql(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[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;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;const t="function"==typeof e?e(this):e;if(t instanceof fc){const e=t.getScopeData();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.length&&(this._fingerprint=e.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if(Ya(t)){const t=e;this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)}return 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._propagationContext=pc(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:100;if(r<=0)return this;const n={timestamp:Tl(),...e},i=this._breadcrumbs;return i.push(n),this._breadcrumbs=i.length>r?i.slice(-r):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:r,_tags:n,_extra:i,_user:o,_level:a,_fingerprint:s,_eventProcessors:l,_propagationContext:c,_sdkProcessingMetadata:u,_transactionName:d,_span:h}=this;return{breadcrumbs:e,attachments:t,contexts:r,tags:n,extra:i,user:o,level:a,fingerprint:s||[],eventProcessors:l,propagationContext:c,sdkProcessingMetadata:u,transactionName:d,span:h}}applyToEvent(e,t={},r=[]){return cc(e,this.getScopeData()),Wl([...r,...Hl(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t&&t.event_id?t.event_id:Hs();if(!this._client)return vs.warn("No client configured on scope - will not capture exception!"),r;const n=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},this),r}captureMessage(e,t,r){const n=r&&r.event_id?r.event_id:Hs();if(!this._client)return vs.warn("No client configured on scope - will not capture message!"),n;const i=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},this),n}captureEvent(e,t){const r=t&&t.event_id?t.event_id:Hs();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(vs.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function pc(){return{traceId:Hs(),spanId:Hs().substring(16)}}const gc="7.116.0",mc=parseFloat(gc),vc=100;class yc{constructor(e,t,r,n=mc){let i,o;this._version=n,t?i=t:(i=new fc,i.setClient(e)),r?o=r:(o=new fc,o.setClient(e)),this._stack=[{scope:i}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();let r;try{r=e(t)}catch(e){throw this.popScope(),e}return Ka(r)?r.then(e=>(this.popScope(),e),e=>{throw this.popScope(),e}):(this.popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const r=this._lastEventId=t&&t.event_id?t.event_id:Hs(),n=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:n,...t,event_id:r}),r}captureMessage(e,t,r){const n=this._lastEventId=r&&r.event_id?r.event_id:Hs(),i=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n}),n}captureEvent(e,t){const r=t&&t.event_id?t.event_id:Hs();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...t,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:r,client:n}=this.getStackTop();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=vc}=n.getOptions&&n.getOptions()||{};if(o<=0)return;const a={timestamp:Tl(),...e},s=i?ms(()=>i(a,t)):a;null!==s&&(n.emit&&n.emit("beforeAddBreadcrumb",s,t),r.addBreadcrumb(s,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:r}=this.getStackTop();r&&e(t)}run(e){const t=wc(this);try{e(this)}finally{wc(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return Ul&&vs.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const r=this._callExtensionMethod("startTransaction",e,t);return Ul&&!r&&(this.getClient()?vs.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):vs.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&Yl(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i=Vl}=r&&r.getOptions()||{},{userAgent:o}=ss.navigator||{},a=Gl({release:n,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&ql(s,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return!(!t||!t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}_callExtensionMethod(e,...t){const r=bc().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);Ul&&vs.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function bc(){return ss.__SENTRY__=ss.__SENTRY__||{extensions:{},hub:void 0},ss}function wc(e){const t=bc(),r=_c(t);return Sc(t,e),r}function xc(){const e=bc();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=bc()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||_c(e).isOlderThan(mc))&&Sc(e,new yc),_c(e)}(e)}function Cc(){return xc().getIsolationScope()}function _c(e){return cs("hub",()=>new yc,e)}function Sc(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}const Ac=[];function kc(e){const t=e.defaultIntegrations||[],r=e.integrations;let n;t.forEach(e=>{e.isDefaultInstance=!0}),n=Array.isArray(r)?[...t,...r]:"function"==typeof r?Xs(r(t)):t;const i=function(e){const t={};return e.forEach(e=>{const{name:r}=e,n=t[r];n&&!n.isDefaultInstance&&e.isDefaultInstance||(t[r]=e)}),Object.keys(t).map(e=>t[e])}(n),o=function(e,t){for(let r=0;r<e.length;r++)if(!0===t(e[r]))return r;return-1}(i,e=>"Debug"===e.name);if(-1!==o){const[e]=i.splice(o,1);i.push(e)}return i}function Ec(e,t){for(const r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function Ic(e,t,r){if(r[t.name])Ul&&vs.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,-1===Ac.indexOf(t.name)&&(t.setupOnce($l,xc),Ac.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),e.on&&"function"==typeof t.preprocessEvent){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,n)=>r(t,n,e))}if(e.addEventProcessor&&"function"==typeof t.processEvent){const r=t.processEvent.bind(t),n=Object.assign((t,n)=>r(t,n,e),{id:t.name});e.addEventProcessor(n)}Ul&&vs.log(`Integration installed: ${t.name}`)}}function jc(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}const Tc="Not capturing exception because it's already been captured.";class Fc{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=ys.exec(e);if(!t)return void ms(()=>{});const[r,n,i="",o,a="",s]=t.slice(1);let l="",c=s;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return ws({host:o,pass:i,path:l,projectId:c,port:a,protocol:r,publicKey:n})}(e):ws(e);if(t&&function(e){if(!fs)return!0;const{port:t,projectId:r,protocol:n}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(vs.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(r.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(n)?t&&isNaN(parseInt(t,10))&&(vs.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(vs.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),1):(vs.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),1)))}(t))return t}(e.dsn):Ul&&vs.warn("No DSN provided, client will not send events."),this._dsn){const t=function(e,t={}){const r="string"==typeof t?t:t.tunnel,n="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return r||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(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}`}})}(e,n)}`}(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,r){if(Ys(e))return void(Ul&&vs.log(Tc));let n=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,r)).then(e=>{n=e})),n}captureMessage(e,t,r,n){let i=r&&r.event_id;const o=Ga(e)?e:String(e),a=qa(e)?this.eventFromMessage(o,t,r):this.eventFromException(e,r);return this._process(a.then(e=>this._captureEvent(e,r,n)).then(e=>{i=e})),i}captureEvent(e,t,r){if(t&&t.originalException&&Ys(t.originalException))return void(Ul&&vs.log(Tc));let n=t&&t.event_id;const i=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,i||r).then(e=>{n=e})),n}captureSession(e){"string"!=typeof e.release?Ul&&vs.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),ql(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(r=>t.flush(e).then(e=>r&&e))):Sl(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return Ul&&vs.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];Ic(this,e,this._integrations),t||Ec(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=function(e,t,r,n){const i=Bl(r),o=e.type&&"replay_event"!==e.type?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,r&&r.sdk);const a=function(e,t,r,n){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!r&&n&&{dsn:bs(n)},...i&&{trace:js({...i})}}}(e,i,n,t);return delete e.sdkProcessingMetadata,Ol(a,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of t.attachments||[])r=Pl(r,Nl(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));const n=this._sendEnvelope(r);n&&n.then(t=>this.emit("afterSendEvent",e,t),null)}sendSession(e){const t=function(e,t,r,n){const i=Bl(r);return Ol({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:bs(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,r){if(this._options.sendClientReports){const r=`${e}:${t}`;Ul&&vs.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}captureAggregateMetrics(e){Ul&&vs.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=function(e,t,r,n){const i={sent_at:(new Date).toISOString()};r&&r.sdk&&(i.sdk={name:r.sdk.name,version:r.sdk.version}),n&&t&&(i.dsn=bs(t));const o=function(e){const t=function(e){let t="";for(const r of e){const e=Object.entries(r.tags),n=e.length>0?`|#${e.map(([e,t])=>`${e}:${t}`).join(",")}`:"";t+=`${r.name}@${r.unit}:${r.metric}|${r.metricType}${n}|T${r.timestamp}\n`}return t}(e);return[{type:"statsd",length:t.length},t]}(e);return Ol(i,[o])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(e=>e(...t))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const r={};return t.forEach(t=>{t&&Ic(e,t,r)}),r}(this,e),Ec(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let r=!1,n=!1;const i=t.exception&&t.exception.values;if(i){n=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){r=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&r)&&(ql(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new kl(t=>{let r=0;const n=setInterval(()=>{0==this._numProcessing?(clearInterval(n),t(!0)):(r+=1,e&&r>=e&&(clearInterval(n),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,r,n=Cc()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),function(e,t,r,n,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||Hs(),timestamp:t.timestamp||Tl()},c=r.integrations||e.integrations.map(e=>e.name);(function(e,t){const{environment:r,release:n,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?r:Vl),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=Qa(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Qa(a.value,o));const s=e.request;s&&s.url&&(s.url=Qa(s.url,o))})(l,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(l,c),void 0===t.type&&function(e,t){const r=ss._sentryDebugIds;if(!r)return;let n;const i=Zl.get(t);i?n=i:(n=new Map,Zl.set(t,n));const o=Object.keys(r).reduce((e,i)=>{let o;const a=n.get(i);a?o=a:(o=t(i),n.set(i,o));for(let t=o.length-1;t>=0;t--){const n=o[t];if(n.filename){e[n.filename]=r[i];break}}return e},{});try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.filename&&(e.debug_id=o[e.filename])})})}catch{}}(l,e.stackParser);const u=function(e,t){if(!t)return e;const r=e?e.clone():new fc;return r.update(t),r}(n,r.captureContext);r.mechanism&&qs(l,r.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(hc||(hc=new fc),hc).getScopeData();o&&uc(h,o.getScopeData()),u&&uc(h,u.getScopeData());const f=[...r.attachments||[],...h.attachments];return f.length&&(r.attachments=f),cc(l,h),Wl([...d,...Hl(),...h.eventProcessors],l,r).then(e=>(e&&function(e){const t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch{}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const r=e.debug_meta.images;Object.keys(t).forEach(e=>{r.push({type:"sourcemap",code_file:e,debug_id:t[e]})})}(e),"number"==typeof a&&a>0?function(e,t,r){if(!e)return null;const n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:wl(e.data,t,r)}}))},...e.user&&{user:wl(e.user,t,r)},...e.contexts&&{contexts:wl(e.contexts,t,r)},...e.extra&&{extra:wl(e.extra,t,r)}};return e.contexts&&e.contexts.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=wl(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(e=>{const n=Kl(e).data;return n&&(e.data=wl(n,t,r)),e})),n}(e,a,s):e))}(i,e,t,r,this,n).then(e=>{if(null===e)return e;const t={...n.getPropagationContext(),...r?r.getPropagationContext():void 0};if((!e.contexts||!e.contexts.trace)&&t){const{traceId:n,spanId:i,parentSpanId:o,dsc:a}=t;e.contexts={trace:{trace_id:n,span_id:i,parent_span_id:o},...e.contexts};const s=a||sc(n,this,r);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e})}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then(e=>e.event_id,e=>{if(Ul){const t=e;"log"===t.logLevel?vs.log(t.message):vs.warn(t)}})}_processEvent(e,t,r){const n=this.getOptions(),{sampleRate:i}=n,o=Pc(e),a=Oc(e),s=e.type||"error",l=`before send for type \`${s}\``;if(a&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),Al(new xs(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const c="replay_event"===s?"replay":s,u=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,r,u).then(r=>{if(null===r)throw this.recordDroppedEvent("event_processor",c,e),new xs("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return r;const i=function(e,t,r){const{beforeSend:n,beforeSendTransaction:i}=e;return Oc(t)&&n?n(t,r):Pc(t)&&i?i(t,r):t}(n,r,t);return function(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Ka(e))return e.then(e=>{if(!Ya(e)&&null!==e)throw new xs(r);return e},e=>{throw new xs(`${t} rejected with ${e}`)});if(!Ya(e)&&null!==e)throw new xs(r);return e}(i,l)}).then(n=>{if(null===n)throw this.recordDroppedEvent("before_send",c,e),new xs(`${l} returned \`null\`, will not send event.`,"log");const i=r&&r.getSession();!o&&i&&this._updateSessionFromEvent(i,n);const a=n.transaction_info;if(o&&a&&n.transaction!==e.transaction){const e="custom";n.transaction_info={...a,source:e}}return this.sendEvent(n,t),n}).then(null,e=>{throw e instanceof xs?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new xs(`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++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,e=>{Ul&&vs.error("Error while sending event:",e)});Ul&&vs.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[r,n]=t.split(":");return{reason:r,category:n,quantity:e[t]}})}}function Oc(e){return void 0===e.type}function Pc(e){return"transaction"===e.type}function Mc(e,t,r=function(e){const t=[];function r(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(n){if(!(void 0===e||t.length<e))return Al(new xs("Not adding Promise because buffer limit was reached."));const i=n();return-1===t.indexOf(i)&&t.push(i),i.then(()=>r(i)).then(null,()=>r(i).then(null,()=>{})),i},drain:function(e){return new kl((r,n)=>{let i=t.length;if(!i)return r(!0);const o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{Sl(e).then(()=>{--i||(clearTimeout(o),r(!0))},n)})})}}}(e.bufferSize||30)){let n={};function i(i){const o=[];if(Ml(i,(t,r)=>{const i=zl(r);if(function(e,t,r=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>r}(n,i)){const n=Rc(t,r);e.recordDroppedEvent("ratelimit_backoff",i,n)}else o.push(t)}),0===o.length)return Sl();const a=Ol(i[0],o),s=t=>{Ml(a,(r,n)=>{const i=Rc(r,n);e.recordDroppedEvent(t,zl(n),i)})};return r.add(()=>t({body:Ll(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Ul&&vs.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=function(e,{statusCode:t,headers:r},n=Date.now()){const i={...e},o=r&&r["x-sentry-rate-limits"],a=r&&r["retry-after"];if(o)for(const s of o.trim().split(",")){const[e,t,,,r]=s.split(":",5),o=parseInt(e,10),a=1e3*(isNaN(o)?60:o);if(t)for(const s of t.split(";"))"metric_bucket"===s?(!r||r.split(";").includes("custom"))&&(i[s]=n+a):i[s]=n+a;else i.all=n+a}else a?i.all=n+function(e,t=Date.now()){const r=parseInt(`${e}`,10);if(!isNaN(r))return 1e3*r;const n=Date.parse(`${e}`);return isNaN(n)?6e4:n-t}(a,n):429===t&&(i.all=n+6e4);return i}(n,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof xs)return Ul&&vs.error("Skipped sending event because buffer is full."),s("queue_overflow"),Sl();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>r.drain(e)}}function Rc(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function Lc(e,t,r=[t],n="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:r.map(e=>({name:`${n}:@sentry/${e}`,version:gc})),version:gc}),e._metadata=i}const Nc=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Dc=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],zc="InboundFilters",Bc=(e={})=>({name:zc,setupOnce(){},processEvent(t,r,n){const i=n.getOptions(),o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Nc],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Dc],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,i);return function(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch{}return!1}(e)?(Ul&&vs.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Ws(e)}`),!0):function(e,t){return!(e.type||!t||!t.length)&&function(e){const t=[];let r;e.message&&t.push(e.message);try{r=e.exception.values[e.exception.values.length-1]}catch{}return r&&r.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`)),Ul&&0===t.length&&vs.error(`Could not extract message for event ${Ws(e)}`),t}(e).some(e=>ts(e,t))}(e,t.ignoreErrors)?(Ul&&vs.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Ws(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const r=e.transaction;return!!r&&ts(r,t)}(e,t.ignoreTransactions)?(Ul&&vs.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Ws(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const r=Uc(e);return!!r&&ts(r,t)}(e,t.denyUrls)?(Ul&&vs.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Ws(e)}.\nUrl: ${Uc(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const r=Uc(e);return!r||ts(r,t)}(e,t.allowUrls)&&(Ul&&vs.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Ws(e)}.\nUrl: ${Uc(e)}`),!0)}(t,o)?null:t}});function Uc(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const r=e[t];if(r&&"<anonymous>"!==r.filename&&"[native code]"!==r.filename)return r.filename||null}return null}(t):null}catch{return Ul&&vs.error(`Cannot extract url for event ${Ws(e)}`),null}}let Vc;jc(zc,Bc);const Hc="FunctionToString",$c=new WeakMap,Wc=()=>({name:Hc,setupOnce(){Vc=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=As(this),r=$c.has(ec())&&void 0!==t?t:this;return Vc.apply(r,e)}}catch{}},setup(e){$c.set(e,!0)}});jc(Hc,Wc);const Gc=ss;let qc=0;function Yc(){return qc>0}function Xc(e,t={},r){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(As(e))return e}catch{return e}const n=function(){const n=Array.prototype.slice.call(arguments);try{r&&"function"==typeof r&&r.apply(this,arguments);const i=n.map(e=>Xc(e,t));return e.apply(this,i)}catch(e){throw qc++,setTimeout(()=>{qc--}),function(...e){const t=xc();if(2===e.length){const[r,n]=e;return r?t.withScope(()=>(t.getStackTop().scope=r,n(r))):t.withScope(n)}t.withScope(e[0])}(i=>{i.addEventProcessor(e=>(t.mechanism&&(Gs(e,void 0),qs(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),function(e){xc().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}Ss(n,e),_s(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}const Kc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Zc(e,t){const r=Qc(e,t),n={type:t&&t.name,value:tu(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function Jc(e,t){return{exception:{values:[Zc(e,t)]}}}function Qc(e,t){const r=t.stacktrace||t.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(eu.test(e.message))return 1}return 0}(t);try{return e(r,n)}catch{}return[]}const eu=/Minified React error #\d+;/i;function tu(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function ru(e,t,r,n,i){let o;if(Ha(t)&&t.error)return Jc(e,t.error);if($a(t)||function(e){return Va(e,"DOMException")}(t)){const i=t;if("stack"in t)o=Jc(e,t);else{const t=i.name||($a(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=nu(e,a,r,n),Gs(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return Ua(t)?Jc(e,t):Ya(t)||Xa(t)?(o=function(e,t,r,n){const i=ec(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:Xa(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:iu(t,{isUnhandledRejection:n})}]},extra:{__serialized__:xl(t,o)}};if(r){const t=Qc(e,r);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,r,i),qs(o,{synthetic:!0}),o):(o=nu(e,t,r,n),Gs(o,`${t}`),qs(o,{synthetic:!0}),o)}function nu(e,t,r,n){const i={};if(n&&r){const n=Qc(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]})}if(Ga(t)){const{__sentry_template_string__:e,__sentry_template_values__:r}=t;return i.logentry={message:e,params:r},i}return i.message=t,i}function iu(e,{isUnhandledRejection:t}){const r=function(e,t=40){const r=Object.keys(ks(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Qa(r[0],t);for(let n=r.length;n>0;n--){const e=r.slice(0,n).join(", ");if(!(e.length>t))return n===r.length?e:Qa(e,t)}return""}(e),n=t?"promise rejection":"exception";return Ha(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:Xa(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}class ou extends Fc{constructor(e){Lc(e,"browser",["browser"],Gc.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&Gc.document&&Gc.document.addEventListener("visibilitychange",()=>{"hidden"===Gc.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,r,n){const i=ru(e,t,r&&r.syntheticException||void 0,n);return qs(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),Sl(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return function(e,t,r="info",n,i){const o=nu(e,t,n&&n.syntheticException||void 0,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Sl(o)}(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(Kc&&vs.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:r,dsn:n}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!r&&!!n&&{dsn:bs(n)}},o=function(e){return[{type:"user_report"},e]}(e);return Ol(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(Kc&&vs.log("No outcomes to send"));if(!this._dsn)return void(Kc&&vs.log("No dsn provided, will not send outcomes"));Kc&&vs.log("Sending outcomes:",e);const t=function(e,t){return Ol(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:Tl(),discarded_events:e}]])}(e,this._options.tunnel&&bs(this._dsn));this._sendEnvelope(t)}}let au;function su(e,t=function(){if(au)return au;if(il(Gc.fetch))return au=Gc.fetch.bind(Gc);const e=Gc.document;let t=Gc.fetch;if(e&&"function"==typeof e.createElement)try{const r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r);const n=r.contentWindow;n&&n.fetch&&(t=n.fetch),e.head.removeChild(r)}catch(e){Kc&&vs.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return au=t.bind(Gc)}()){let r=0,n=0;return Mc(e,function(i){const o=i.body.length;r+=o,n++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15,...e.fetchOptions};try{return t(e.url,a).then(e=>(r-=o,n--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(e){return au=void 0,r-=o,n--,Al(e)}})}function lu(e){return Mc(e,function(t){return new kl((r,n)=>{const i=new XMLHttpRequest;i.onerror=n,i.onreadystatechange=()=>{4===i.readyState&&r({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);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)})})}const cu="?";function uu(e,t,r,n){const i={filename:e,function:t,in_app:!0};return void 0!==r&&(i.lineno=r),void 0!==n&&(i.colno=n),i}const du=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,hu=/\((\S*)(?::(\d+))(?::(\d+))\)/,fu=[30,e=>{const t=du.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=hu.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,r]=wu(t[1]||cu,t[2]);return uu(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],pu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,gu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,mu=[50,e=>{const t=pu.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=gu.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],r=t[1]||cu;return[r,e]=wu(r,e),uu(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],vu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,yu=[40,e=>{const t=vu.exec(e);return t?uu(t[2],t[1]||cu,+t[3],t[4]?+t[4]:void 0):void 0}],bu=Ps(fu,mu,yu),wu=(e,t)=>{const r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:cu,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},xu="Breadcrumbs",Cu=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:xu,setupOnce(){},setup(e){t.console&&function(e){const t="console";zs(t,e),Bs(t,Vs)}(function(e){return function(t){if(ec()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:jl(t.level),message:es(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${es(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}Ql(r,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){zs("dom",e),Bs("dom",el)}(function(e,t){return function(r){if(ec()!==e)return;let n,i,o="object"==typeof t?t.serializeAttribute:void 0,a="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;a&&a>1024&&(Kc&&vs.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=1024),"string"==typeof o&&(o=[o]);try{const e=r.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;n=ds(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!us.HTMLElement)return null;let t=e;for(let r=0;r<5;r++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}(t)}catch{n="<unknown>"}if(0===n.length)return;const s={category:`ui.${r.name}`,message:n};i&&(s.data={"ui.component_name":i}),Ql(s,{event:r.event,name:r.name,global:r.global})}}(e,t.dom)),t.xhr&&function(e){zs("xhr",e),Bs("xhr",bl)}(function(e){return function(t){if(ec()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[yl];if(!r||!n||!i)return;const{method:o,url:a,status_code:s,body:l}=i;Ql({category:"xhr",data:{method:o,url:a,status_code:s},type:"http"},{xhr:t.xhr,input:l,startTimestamp:r,endTimestamp:n})}}(e)),t.fetch&&function(e){const t="fetch";zs(t,e),Bs(t,ol)}(function(e){return function(t){if(ec()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error)Ql({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:r,endTimestamp:n});else{const e=t.response;Ql({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:r,endTimestamp:n})}}}(e)),t.history&&gl(function(e){return function(t){if(ec()!==e)return;let r=t.from,n=t.to;const i=El(Gc.location.href);let o=r?El(r):void 0;const a=El(n);(!o||!o.path)&&(o=i),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),Ql({category:"navigation",data:{from:r,to:n}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){ec()===e&&Ql({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:Ws(t)},{event:t})}}(e))}}};jc(xu,Cu);const _u="Dedupe",Su=()=>{let e;return{name:_u,setupOnce(){},processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&!(!function(e,t){const r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!ku(e,t)||!Au(e,t))}(e,t)&&!function(e,t){const r=Eu(t),n=Eu(e);return!!(r&&n&&r.type===n.type&&r.value===n.value&&ku(e,t)&&Au(e,t))}(e,t))}(t,e))return Kc&&vs.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function Au(e,t){let r=Iu(e),n=Iu(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const e=n[i],t=r[i];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function ku(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;try{return r.join("")===n.join("")}catch{return!1}}function Eu(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Iu(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}jc(_u,Su);const ju="GlobalHandlers",Tu=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:ju,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";zs(t,e),Bs(t,cl)}(t=>{const{stackParser:r,attachStacktrace:n}=Pu();if(ec()!==e||Yc())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&Wa(i)?function(e,t,r,n){let i=Ha(e)?e.message:e,o="Error";const a=i.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);return a&&(o=a[1],i=a[2]),Fu({exception:{values:[{type:o,value:i}]}},t,r,n)}(i,o,a,s):Fu(ru(r,l||i,void 0,n,!1),o,a,s);c.level="error",Jl(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),Ou("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";zs(t,e),Bs(t,dl)}(t=>{const{stackParser:r,attachStacktrace:n}=Pu();if(ec()!==e||Yc())return;const i=function(e){if(qa(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return e}(t),o=qa(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):ru(r,i,void 0,n,!0);o.level="error",Jl(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),Ou("onunhandledrejection"))}}};function Fu(e,t,r,n){const 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(n,10))?void 0:n,u=isNaN(parseInt(r,10))?void 0:r,d=Wa(t)&&t.length>0?t:function(){try{return us.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function Ou(e){Kc&&vs.log(`Global Handler attached: ${e}`)}function Pu(){const e=ec();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}jc(ju,Tu);const Mu="HttpContext",Ru=()=>({name:Mu,setupOnce(){},preprocessEvent(e){if(!Gc.navigator&&!Gc.location&&!Gc.document)return;const t=e.request&&e.request.url||Gc.location&&Gc.location.href,{referrer:r}=Gc.document||{},{userAgent:n}=Gc.navigator||{},i={...e.request&&e.request.headers,...r&&{Referer:r},...n&&{"User-Agent":n}},o={...e.request,...t&&{url:t},headers:i};e.request=o}});jc(Mu,Ru);const Lu="LinkedErrors",Nu=(e={})=>{const t=e.limit||5,r=e.key||"cause";return{name:Lu,setupOnce(){},preprocessEvent(e,n,i){const o=i.getOptions();rs(Zc,o.stackParser,o.maxValueLength,r,t,e,n)}}};jc(Lu,Nu);const Du=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],zu="TryCatch",Bu=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:zu,setupOnce(){t.setTimeout&&Cs(Gc,"setTimeout",Uu),t.setInterval&&Cs(Gc,"setInterval",Uu),t.requestAnimationFrame&&Cs(Gc,"requestAnimationFrame",Vu),t.XMLHttpRequest&&"XMLHttpRequest"in Gc&&Cs(XMLHttpRequest.prototype,"send",Hu);const e=t.eventTarget;e&&(Array.isArray(e)?e:Du).forEach($u)}}};function Uu(e){return function(...t){const r=t[0];return t[0]=Xc(r,{mechanism:{data:{function:Ls(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Vu(e){return function(t){return e.apply(this,[Xc(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Ls(e)},handled:!1,type:"instrument"}})])}}function Hu(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in r&&"function"==typeof r[e]&&Cs(r,e,function(t){const r={mechanism:{data:{function:e,handler:Ls(t)},handled:!1,type:"instrument"}},n=As(t);return n&&(r.mechanism.data.handler=Ls(n)),Xc(t,r)})}),e.apply(this,t)}}function $u(e){const t=Gc,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Cs(r,"addEventListener",function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=Xc(n.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ls(n),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[r,Xc(n,{mechanism:{data:{function:"addEventListener",handler:Ls(n),target:e},handled:!1,type:"instrument"}}),i])}}),Cs(r,"removeEventListener",function(e){return function(t,r,n){const i=r;try{const r=i&&i.__sentry_wrapped__;r&&e.call(this,t,r,n)}catch{}return e.call(this,t,i,n)}}))}jc(zu,Bu);const Wu=[Bc(),Wc(),Bu(),Cu(),Tu(),Nu(),Su(),Ru()];function Gu(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...Wu]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),Gc.SENTRY_RELEASE&&Gc.SENTRY_RELEASE.id&&(e.release=Gc.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:Ms(e.stackParser||bu),integrations:kc(e),transport:e.transport||(nl()?su:lu)};(function(e,t){!0===t.debug&&(Ul?vs.enable():ms(()=>{})),tc().update(t.initialScope);const r=new e(t);(function(e){const t=xc().getStackTop();t.client=e,t.scope.setClient(e)})(r),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(r)})(ou,t),e.autoSessionTracking&&(typeof Gc.document>"u"?Kc&&vs.warn("Session tracking in non-browser environment with @sentry/browser is not supported."):(rc({ignoreDuration:!0}),oc(),gl(({from:e,to:t})=>{void 0!==e&&e!==t&&(rc({ignoreDuration:!0}),oc())})))}var qu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{};function Yu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xu=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(Xu||{}),Ku=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(Ku||{});function Zu(e,t){return{...t,message:e}}const Ju={emoticons:Zu("Emoticons"),doodles:Zu("Doodles"),landmarks:Zu("Landmarks"),bubbles:Zu("Bubbles"),transportation:Zu("Transportation"),beach:Zu("Beach")},Qu={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},ed=[1,8,15,20,25];var td=(e=>(e.DARK="dark",e.LIGHT="light",e))(td||{});const rd=[{name:td.LIGHT,colors:{"--be-foreground-base":"0 0 0","--be-primary-light":"191 219 254","--be-primary":"59 130 246","--be-primary-dark":"37 99 235","--be-on-primary":"255 255 255","--be-danger":"179 38 30","--be-on-danger":"255 255 255","--be-background":"255 255 255","--be-background-alt":"250 250 250","--be-paper":"255 255 255","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"26%","--be-hover-opacity":"4%","--be-focus-opacity":"12%","--be-selected-opacity":"8%","--be-text-main-opacity":"87%","--be-text-muted-opacity":"60%","--be-divider-opacity":"12%"}},{name:td.DARK,isDark:!0,colors:{"--be-foreground-base":"255 255 255","--be-primary-light":"239 246 255","--be-primary":"191 219 254","--be-primary-dark":"147 197 253","--be-on-primary":"56 30 114","--be-danger":"242 184 181","--be-on-danger":"96 20 16","--be-background":"20 21 23","--be-background-alt":"26 27 30","--be-paper":"44 46 51","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"30%","--be-hover-opacity":"8%","--be-focus-opacity":"12%","--be-selected-opacity":"16%","--be-text-main-opacity":"100%","--be-text-muted-opacity":"70%","--be-divider-opacity":"12%"}}];var nd=(e=>(e.FILTER="filter",e.RESIZE="resize",e.CROP="crop",e.DRAW="draw",e.TEXT="text",e.SHAPES="shapes",e.STICKERS="stickers",e.FRAME="frame",e.CORNERS="corners",e.MERGE="merge",e))(nd||{});function id(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=id(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function od(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=id(e))&&(n&&(n+=" "),n+=t);return n}const ad=(0,o.forwardRef)((e,t)=>{const{attr:r,size:n,title:o,className:a,color:s,style:l,children:c,viewBox:u,width:d,height:h,...f}=e;return(0,i.jsxs)("svg",{"aria-hidden":!o,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:u||"0 0 24 24",...r,...f,className:od("svg-icon",a,sd(n)),style:{color:s,...l},ref:t,height:h||"1em",width:d||"1em",children:[o&&(0,i.jsx)("title",{children:o}),c]})});function sd(e){switch(e){case"2xs":return"icon-2xs";case"xs":return"icon-xs";case"sm":return"icon-sm";case"md":return"icon-md";case"lg":return"icon-lg";case"xl":return"icon-xl";default:return e}}function ld(e,t="",r){return o.memo(o.forwardRef((n,o)=>(0,i.jsx)(ad,{"data-testid":`${t}Icon`,ref:o,viewBox:r,...n,size:n.size||"md",children:e})))}function cd(e,t=""){return ld(ud(e),t)}function ud(e){return(null==e?void 0:e.map)&&e.map((e,t)=>o.createElement(e.tag,{key:t,...e.attr},ud(e.child)))}const dd=ld((0,i.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),hd=ld((0,i.jsx)("path",{d:"M21 15h2v2h-2v-2zm0-4h2v2h-2v-2zm2 8h-2v2c1 0 2-1 2-2zM13 3h2v2h-2V3zm8 4h2v2h-2V7zm0-4v2h2c0-1-1-2-2-2zM1 7h2v2H1V7zm16-4h2v2h-2V3zm0 16h2v2h-2v-2zM3 3C2 3 1 4 1 5h2V3zm6 0h2v2H9V3zM5 3h2v2H5V3zm-4 8v8c0 1.1.9 2 2 2h12V11H1zm2 8 2.5-3.21 1.79 2.15 2.5-3.22L13 19H3z"}),"PhotoSizeSelectLargeOutlined"),fd=ld((0,i.jsx)("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),pd=ld((0,i.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),gd=ld((0,i.jsx)("path",{d:"M10.5 4.5c.28 0 .5.22.5.5v2h6v6h2c.28 0 .5.22.5.5s-.22.5-.5.5h-2v6h-2.12c-.68-1.75-2.39-3-4.38-3s-3.7 1.25-4.38 3H4v-2.12c1.75-.68 3-2.39 3-4.38 0-1.99-1.24-3.7-2.99-4.38L4 7h6V5c0-.28.22-.5.5-.5m0-2C9.12 2.5 8 3.62 8 5H4c-1.1 0-1.99.9-1.99 2v3.8h.29c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-.3c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7v.3H17c1.1 0 2-.9 2-2v-4c1.38 0 2.5-1.12 2.5-2.5S20.38 11 19 11V7c0-1.1-.9-2-2-2h-4c0-1.38-1.12-2.5-2.5-2.5z"}),"ExtensionOutlined"),md=ld((0,i.jsx)("path",{d:"M10.25 13c0 .69-.56 1.25-1.25 1.25S7.75 13.69 7.75 13s.56-1.25 1.25-1.25 1.25.56 1.25 1.25zM15 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm7 .25c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10zM10.66 4.12C12.06 6.44 14.6 8 17.5 8c.46 0 .91-.05 1.34-.12C17.44 5.56 14.9 4 12 4c-.46 0-.91.05-1.34.12zM4.42 9.47c1.71-.97 3.03-2.55 3.66-4.44C6.37 6 5.05 7.58 4.42 9.47zM20 12c0-.78-.12-1.53-.33-2.24-.7.15-1.42.24-2.17.24-3.13 0-5.92-1.44-7.76-3.69C8.69 8.87 6.6 10.88 4 11.86c.01.04 0 .09 0 .14 0 4.41 3.59 8 8 8s8-3.59 8-8z"}),"FaceOutlined"),vd=ld((0,i.jsx)("path",{d:"M20 4h-4l-4-4-4 4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H4V6h4.52l3.52-3.5L15.52 6H20v14zM6 18h12V8H6v10zm2-8h8v6H8v-6z"}),"FilterFramesOutlined"),yd=ld((0,i.jsx)("path",{d:"M6.41 21 5 19.59l4.83-4.83c.75-.75 1.17-1.77 1.17-2.83v-5.1L9.41 8.41 8 7l4-4 4 4-1.41 1.41L13 6.83v5.1c0 1.06.42 2.08 1.17 2.83L19 19.59 17.59 21 12 15.41 6.41 21z"}),"MergeOutlined"),bd=ld((0,i.jsx)("path",{d:"M19 19h2v2h-2v-2zm0-2h2v-2h-2v2zM3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm0-4h2V3H3v2zm4 0h2V3H7v2zm8 16h2v-2h-2v2zm-4 0h2v-2h-2v2zm4 0h2v-2h-2v2zm-8 0h2v-2H7v2zm-4 0h2v-2H3v2zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2V8z"}),"RoundedCornerOutlined"),wd=ld((0,i.jsx)("path",{d:"M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}),"PhotoLibraryOutlined"),xd=ld((0,i.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"}),"HistoryOutlined"),Cd=ld([(0,i.jsx)("path",{d:"m2.53 19.65 1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zm-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95-7.35 3.05z"},"0"),(0,i.jsx)("circle",{cx:"11",cy:"9",r:"1"},"1"),(0,i.jsx)("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"},"2")],"StyleOutlined"),_d=ld((0,i.jsx)("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}),"DeleteOutlined"),Sd=ld((0,i.jsx)("path",{d:"M18.85,10.39l1.06-1.06c0.78-0.78,0.78-2.05,0-2.83L18.5,5.09c-0.78-0.78-2.05-0.78-2.83,0l-1.06,1.06L18.85,10.39z M14.61,11.81L7.41,19H6v-1.41l7.19-7.19L14.61,11.81z M13.19,7.56L4,16.76V21h4.24l9.19-9.19L13.19,7.56L13.19,7.56z M19,17.5 c0,2.19-2.54,3.5-5,3.5c-0.55,0-1-0.45-1-1s0.45-1,1-1c1.54,0,3-0.73,3-1.5c0-0.47-0.48-0.87-1.23-1.2l1.48-1.48 C18.32,15.45,19,16.29,19,17.5z M4.58,13.35C3.61,12.79,3,12.06,3,11c0-1.8,1.89-2.63,3.56-3.36C7.59,7.18,9,6.56,9,6 c0-0.41-0.78-1-2-1C5.74,5,5.2,5.61,5.17,5.64C4.82,6.05,4.19,6.1,3.77,5.76C3.36,5.42,3.28,4.81,3.62,4.38C3.73,4.24,4.76,3,7,3 c2.24,0,4,1.32,4,3c0,1.87-1.93,2.72-3.64,3.47C6.42,9.88,5,10.5,5,11c0,0.31,0.43,0.6,1.07,0.86L4.58,13.35z"}),"Draw"),Ad=ld((0,i.jsx)("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),kd={[nd.FILTER]:{name:Zu("Applied Filters"),icon:dd},[nd.RESIZE]:{name:Zu("Resized Image"),icon:hd},[nd.CROP]:{name:Zu("Cropped Image"),icon:fd},[nd.DRAW]:{name:Zu("Added Drawing"),icon:Sd},[nd.TEXT]:{name:Zu("Added Text"),icon:pd},[nd.SHAPES]:{name:Zu("Added Shape"),icon:gd},[nd.STICKERS]:{name:Zu("Added Sticker"),icon:md},[nd.FRAME]:{name:Zu("Added Frame"),icon:vd},[nd.MERGE]:{name:Zu("Merged Objects"),icon:yd},[nd.CORNERS]:{name:Zu("Rounded Corner"),icon:bd},bgImage:{name:Zu("Replaced Background Image"),icon:wd},overlayImage:{name:Zu("Added Image"),icon:wd},initial:{name:Zu("Initial"),icon:Ad},loadedState:{name:Zu("Loaded State"),icon:xd},objectStyle:{name:Zu("Changed Style"),icon:Cd},deletedObject:{name:Zu("Deleted object"),icon:_d}},Ed=Object.values(nd).map(e=>({name:e,icon:kd[e].icon,action:e===nd.MERGE?e=>{e.tools.merge.apply()}:e})),Id={filter:Zu("filter"),resize:Zu("resize"),crop:Zu("crop"),draw:Zu("draw"),text:Zu("text"),shapes:Zu("shapes"),stickers:Zu("stickers"),frame:Zu("frame"),corners:Zu("corners"),merge:Zu("merge")},jd=ld((0,i.jsx)("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}),"FileDownloadOutlined"),Td={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:Xu.INLINE,forceOverlayModeOnMobile:!0,activeTheme:td.LIGHT,themes:rd,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:xd,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:jd,label:Zu("Done"),align:"right",action:e=>{var t;null!=(t=e.state.config.ui)&&t.showExportPanel?e.state.togglePanel("export",!0):e.tools.export.save()}}]},nav:{position:Ku.BOTTOM,items:[...Ed]},openImageDialog:{show:!0,sampleImages:[{url:"images/samples/sample1.jpg",thumbnail:"images/samples/sample1_thumbnail.jpg"},{url:"images/samples/sample2.jpg",thumbnail:"images/samples/sample2_thumbnail.jpg"},{url:"images/samples/sample3.jpg",thumbnail:"images/samples/sample3_thumbnail.jpg"}]},colorPresets:{items:["rgb(0,0,0)","rgb(255, 255, 255)","rgb(242, 38, 19)","rgb(249, 105, 14)","rgb(253, 227, 167)","rgb(4, 147, 114)","rgb(30, 139, 195)","rgb(142, 68, 173)"]}},objectDefaults:{global:{...Qu},sticker:{fill:void 0},text:{textAlign:"initial",underline:!1,linethrough:!1,fontStyle:"normal",fontFamily:"Times New Roman",fontWeight:"normal",stroke:void 0,fontSize:40}},tools:{filter:{items:["grayscale","blackWhite","sharpen","invert","vintage","polaroid","kodachrome","technicolor","brownie","sepia","removeColor","brightness","gamma","noise","pixelate","blur","emboss","blendColor"]},zoom:{allowUserZoom:!0,fitImageToScreen:!0},crop:{allowCustomRatio:!0,defaultRatio:"1:1",presets:[{ratio:null,name:"Custom"},{ratio:"1:1",name:"Square"},{ratio:"4:3"},{ratio:"16:9"},{ratio:"5:3"},{ratio:"5:4"},{ratio:"6:4"},{ratio:"7:5"},{ratio:"10:8"}]},text:{defaultText:"Double click to edit",controlsPadding:6,items:[{family:"Roboto",src:"fonts/open-sans-v27-latin-ext_latin-regular.woff2"},{family:"Fuzzy Bubbles",src:"fonts/fuzzy-bubbles-v3-latin-700.woff2",descriptors:{weight:"700"}},{family:"Aleo Bold",src:"fonts/aleo-v4-latin-ext_latin-700.woff2",descriptors:{weight:"700"}},{family:"Amatic SC",src:"fonts/amatic-sc-v16-latin-ext_latin-regular.woff2"},{family:"Corinthia Bold",src:"fonts/corinthia-v7-latin-ext_latin-700.woff2"},{family:"Bungee Inline",src:"fonts/bungee-inline-v6-latin-ext_latin-regular.woff2"},{family:"Robot Slab Bold",src:"fonts/roboto-slab-v16-latin-ext_latin-500.woff2"},{family:"Carter One",src:"fonts/carter-one-v12-latin-regular.woff2"},{family:"Cody Star",src:"fonts/codystar-v10-latin-ext_latin-regular.woff2"},{family:"Fira Sans",src:"fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"},{family:"Krona One",src:"fonts/krona-one-v9-latin-ext_latin-regular.woff2"},{family:"Kumar One Outline",src:"fonts/kumar-one-outline-v8-latin-ext_latin-regular.woff2"},{family:"Lobster Two",src:"fonts/lobster-two-v13-latin-regular.woff2"},{family:"Molle Italic",src:"fonts/molle-v11-latin-ext_latin-italic.woff2"},{family:"Monoton",src:"fonts/monoton-v10-latin-regular.woff2"},{family:"Nixie One",src:"fonts/nixie-one-v11-latin-regular.woff2"},{family:"Permanent Marker",src:"fonts/permanent-marker-v10-latin-regular.woff2"},{family:"Sancreek",src:"fonts/sancreek-v13-latin-ext_latin-regular.woff2"},{family:"Stint Ultra Expanded",src:"fonts/stint-ultra-expanded-v10-latin-regular.woff2"},{family:"VT323",src:"fonts/vt323-v12-latin-ext_latin-regular.woff2"},{family:"Trash Hand",src:"fonts/TrashHand.ttf"}]},draw:{brushSizes:ed,brushTypes:["PencilBrush","EraserBrush","SprayBrush","CircleBrush","DiamondBrush","VLineBrush","HLineBrush","SquareBrush"]},shapes:{items:[{name:"circle",type:"Circle"},{name:"square",type:"Rect",options:{lockUniScaling:!1}},{name:"triangle",type:"Triangle"},{name:"ellipse",type:"Ellipse",options:{lockUniScaling:!1}},{name:"Arrow #1",type:"Path",options:{path:"M 294.9 16.4 l 15.7 42.2 c -171.4 70.3 -294 242.3 -289.1 437.4 l 14.7 -1 c 9.1 -0.6 18.1 -1.2 27.1 -1.9 l 14.7 -1 c -4.3 -170.1 102.5 -320 252 -381.3 l 15.7 42.2 c 34.7 -40.5 83.1 -76.6 144.8 -99.8 c -58.1 -26.2 -124.9 -39.6 -195.6 -36.8 z"}},{name:"Arrow #2",type:"Path",options:{path:"M 16 248.4 v 14.9 h 447.5 l -93.2 82.5 l 11.9 10.5 l 113.8 -100.2 l -113.6 -100.4 l -11.8 10.5 l 92.9 82.2 z"}},{name:"Arrow #3",type:"Path",options:{path:"M 496 256 l -118.6 -66 v 40.8 h -361.4 v 50.4 h 361.4 v 40.8 l 118.6 -66 z"}},{name:"Line",type:"Path",options:{path:"M 16 256 h 480",strokeWidth:10,stroke:"#000",padding:10}},{name:"Star",type:"Path",options:{path:"M 256 406.3 l 148.3 78 l -28.3 -165.2 l 120 -117 l -165.8 -24.1 l -74.2 -150.3 l -74.2 150.3 l -165.8 24.1 l 120 117 l -28.3 165.2 z"}},{name:"Polygon",type:"Path",options:{path:"M 256 19.6 l 156.6 57.1 l 83.4 144.3 l -28.9 164.2 l -127.7 107.2 h -166.8 l -127.7 -107.2 l -28.9 -164.2 l 83.4 -144.3 z"}},{name:"Badge",type:"Path",options:{path:"M 257.3 16.2 s -148 58.2 -204.4 81.4 c 0 75.7 -16.8 303.5 204.4 398.2 c 218.7 -94.6 201.9 -322.4 201.9 -398.2 c -62.1 -23.6 -201.9 -81.4 -201.9 -81.4 z"}}].slice()},stickers:{items:[{name:"emoticons",list:["afro-1","afro","agent","alien-1","alien","angel","angry-1","angry-2","angry-3","angry-4","angry-5","angry","arguing","arrogant","asian-1","asian","avatar","baby-1","baby-2","baby","bully","burglar","businessman","cheeky-1","cheeky","clown","confused-1","confused-2","confused-3","confused","creepy","crying-1","crying-2","crying-3","crying","dazed-1","dazed-2","dazed-3","dazed","dead-1","dead-2","dead-3","dead-4","dead-5","dead-6","dead","desperate-1","desperate","detective","dissapointment","doctor","drunk","dumb","emo-1","emo-2","emo","emoticon","evil","faint-1","faint","flirt-1","flirt-2","flirt","flirty","gangster","geek-1","geek","gentleman-1","gentleman-2","gentleman-3","gentleman-4","gentleman","ginger","girl-1","girl","goofy-1","goofy-2","goofy-3","goofy-4","goofy","grubby-1","grubby","happy-1","happy-10","happy-11","happy-12","happy-13","happy-14","happy-15","happy-16","happy-2","happy-3","happy-4","happy-5","happy-6","happy-7","happy-8","happy-9","happy","harry-potter","heisenberg","hipster-1","hipster-2","hipster","in-love-1","in-love-2","in-love-3","in-love-4","in-love-5","in-love-6","in-love","japan","jew","joyful-1","joyful-2","joyful","kiss-1","kiss-2","kiss-3","kiss-4","kiss","laughing-1","laughing-2","laughing-3","laughing","listening","love","manly","miserly-1","miserly","nerd-1","nerd-2","nerd-3","nerd-4","nerd","ninja","pirate-1","pirate-2","pirate","punk-1","punk-2","punk","rapper","relieved","rich-1","rich-2","rich","rockstar","sad-1","sad-2","sad-3","sad-4","sad-5","sad-6","sad","scared-1","scared-2","scared-3","scared","sceptic-1","sceptic-2","sceptic-3","sceptic-4","sceptic-5","sceptic-6","sceptic-7","sceptic","secret","shocked-1","shocked-2","shocked-3","shocked","sick-1","sick-2","sick-3","sick-4","sick","silent","skeleton","smile","smiling-1","smiling","smoked","smug-1","smug-2","smug-3","smug-4","smug-5","smug-6","smug","sporty","stunned","superhero-1","superhero-2","superhero-3","superhero-4","superhero","surprised-1","surprised","thinking","tired-1","tired-2","tired-3","tired","tough-1","tough","trendy","vampire-1","vampire","wink-1","wink-2","wink","winking-1","winking","yawning-1","yawning-2","yawning-3","yawning","yelling","zombie"],type:"svg",thumbnailUrl:"images/stickers/categories/emoticon.svg"},{name:"doodles",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/doodles.svg"},{name:"landmarks",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/landmark.svg",invertPreview:!0},{name:"bubbles",items:104,type:"png",thumbnailUrl:"images/stickers/categories/speech-bubble.svg"},{name:"transportation",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/transportation.svg",invertPreview:!0},{name:"beach",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/beach.svg",invertPreview:!0}]},import:{validImgExtensions:["png","jpg","jpeg","svg","gif"],fitOverlayToScreen:!0,openDroppedImageAsBackground:!1},export:{defaultFormat:"png",defaultQuality:.8,defaultName:"image"},frame:{items:[{name:"basic",mode:"basic",size:{min:1,max:35,default:10}},{name:"pine",mode:"stretch",size:{min:1,max:35,default:15}},{name:"oak",mode:"stretch",size:{min:1,max:35,default:15}},{name:"rainbow",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge1",display_name:"grunge #1",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge2",display_name:"grunge #2",mode:"stretch",size:{min:1,max:35,default:20}},{name:"ebony",mode:"stretch",size:{min:1,max:35,default:15}},{name:"art1",display_name:"Art #1",mode:"repeat",size:{min:10,max:70,default:55}},{name:"art2",display_name:"Art #2",mode:"repeat",size:{min:10,max:70,default:55}}]}}},Fd=e=>{let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=n??("object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e)),destroy:()=>{r.clear()}},a=t=e(n,i,o);return o};var Od={exports:{}},Pd={},Md={exports:{}},Rd={},Ld=o,Nd="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Dd=Ld.useState,zd=Ld.useEffect,Bd=Ld.useLayoutEffect,Ud=Ld.useDebugValue;function Vd(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Nd(e,r)}catch{return!0}}var Hd=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?function(e,t){return t()}:function(e,t){var r=t(),n=Dd({inst:{value:r,getSnapshot:t}}),i=n[0].inst,o=n[1];return Bd(function(){i.value=r,i.getSnapshot=t,Vd(i)&&o({inst:i})},[e,r,t]),zd(function(){return Vd(i)&&o({inst:i}),e(function(){Vd(i)&&o({inst:i})})},[e]),Ud(r),r};Rd.useSyncExternalStore=void 0!==Ld.useSyncExternalStore?Ld.useSyncExternalStore:Hd,Md.exports=Rd;var $d=Md.exports,Wd=o,Gd=$d,qd="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Yd=Gd.useSyncExternalStore,Xd=Wd.useRef,Kd=Wd.useEffect,Zd=Wd.useMemo,Jd=Wd.useDebugValue;Pd.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var o=Xd(null);if(null===o.current){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=Zd(function(){function e(e){if(!l){if(l=!0,o=e,e=n(e),void 0!==i&&a.hasValue){var t=a.value;if(i(t,e))return s=t}return s=e}if(t=s,qd(o,e))return t;var r=n(e);return void 0!==i&&i(t,r)?t:(o=e,s=r)}var o,s,l=!1,c=void 0===r?null:r;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,r,n,i]);var s=Yd(e,o[0],o[1]);return Kd(function(){a.hasValue=!0,a.value=s},[s]),Jd(s),s},Od.exports=Pd;const Qd=Yu(Od.exports),{useDebugValue:eh}=o,{useSyncExternalStoreWithSelector:th}=Qd,rh=e=>e,nh=e=>{const t="function"==typeof e?(e=>e?Fd(e):Fd)(e):e,r=(e,r)=>function(e,t=rh,r){const n=th(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return eh(n),n}(t,e,r);return Object.assign(r,t),r},ih=e=>nh;var oh=Symbol.for("immer-nothing"),ah=Symbol.for("immer-draftable"),sh=Symbol.for("immer-state");function lh(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ch=Object.getPrototypeOf;function uh(e){return!!e&&!!e[sh]}function dh(e){var t;return!!e&&(fh(e)||Array.isArray(e)||!!e[ah]||!(null==(t=e.constructor)||!t[ah])||yh(e)||bh(e))}var hh=Object.prototype.constructor.toString();function fh(e){if(!e||"object"!=typeof e)return!1;const t=ch(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===hh}function ph(e,t){0===gh(e)?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function gh(e){const t=e[sh];return t?t.type_:Array.isArray(e)?1:yh(e)?2:bh(e)?3:0}function mh(e,t){return 2===gh(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vh(e,t,r){const n=gh(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function yh(e){return e instanceof Map}function bh(e){return e instanceof Set}function wh(e){return e.copy_||e.base_}function xh(e,t){if(yh(e))return new Map(e);if(bh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=fh(e);if(!0===t||"class_only"===t&&!r){const t=Object.getOwnPropertyDescriptors(e);delete t[sh];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){const i=r[n],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(ch(e),t)}{const t=ch(e);if(null!==t&&r)return{...e};const n=Object.create(t);return Object.assign(n,e)}}function Ch(e,t=!1){return Sh(e)||uh(e)||!dh(e)||(gh(e)>1&&(e.set=e.add=e.clear=e.delete=_h),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>Ch(t,!0))),e}function _h(){lh(2)}function Sh(e){return Object.isFrozen(e)}var Ah,kh={};function Eh(e){const t=kh[e];return t||lh(0),t}function Ih(){return Ah}function jh(e,t){t&&(Eh("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Th(e){Fh(e),e.drafts_.forEach(Ph),e.drafts_=null}function Fh(e){e===Ah&&(Ah=e.parent_)}function Oh(e){return Ah=function(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}(Ah,e)}function Ph(e){const t=e[sh];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Mh(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[sh].modified_&&(Th(t),lh(4)),dh(e)&&(e=Rh(t,e),t.parent_||Nh(t,e)),t.patches_&&Eh("Patches").generateReplacementPatches_(r[sh].base_,e,t.patches_,t.inversePatches_)):e=Rh(t,r,[]),Th(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==oh?e:void 0}function Rh(e,t,r){if(Sh(t))return t;const n=t[sh];if(!n)return ph(t,(i,o)=>Lh(e,n,t,i,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Nh(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let i=t,o=!1;3===n.type_&&(i=new Set(t),t.clear(),o=!0),ph(i,(i,a)=>Lh(e,n,t,i,a,r,o)),Nh(e,t,!1),r&&e.patches_&&Eh("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Lh(e,t,r,n,i,o,a){if(uh(i)){const a=Rh(e,i,o&&t&&3!==t.type_&&!mh(t.assigned_,n)?o.concat(n):void 0);if(vh(r,n,a),!uh(a))return;e.canAutoFreeze_=!1}else a&&r.add(i);if(dh(i)&&!Sh(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Rh(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof n&&Object.prototype.propertyIsEnumerable.call(r,n)&&Nh(e,i)}}function Nh(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ch(t,r)}var Dh={get(e,t){if(t===sh)return e;const r=wh(e);if(!mh(r,t))return function(e,t,r){var n;const i=Uh(t,r);return i?"value"in i?i.value:null==(n=i.get)?void 0:n.call(e.draft_):void 0}(e,r,t);const n=r[t];return e.finalized_||!dh(n)?n:n===Bh(e.base_,t)?(Hh(e),e.copy_[t]=$h(n,e)):n},has:(e,t)=>t in wh(e),ownKeys:e=>Reflect.ownKeys(wh(e)),set(e,t,r){const n=Uh(wh(e),t);if(null!=n&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=Bh(wh(e),t),i=null==n?void 0:n[sh];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(r,n)&&(void 0!==r||mh(e.base_,t)))return!0;Hh(e),Vh(e)}return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Bh(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Hh(e),Vh(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=wh(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}},defineProperty(){lh(11)},getPrototypeOf:e=>ch(e.base_),setPrototypeOf(){lh(12)}},zh={};function Bh(e,t){const r=e[sh];return(r?wh(r):e)[t]}function Uh(e,t){if(!(t in e))return;let r=ch(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=ch(r)}}function Vh(e){e.modified_||(e.modified_=!0,e.parent_&&Vh(e.parent_))}function Hh(e){e.copy_||(e.copy_=xh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function $h(e,t){const r=yh(e)?Eh("MapSet").proxyMap_(e,t):bh(e)?Eh("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Ih(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,o=Dh;r&&(i=[n],o=zh);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return n.draft_=s,n.revoke_=a,s}(e,t);return(t?t.scope_:Ih()).drafts_.push(r),r}function Wh(e){if(!dh(e)||Sh(e))return e;const t=e[sh];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=xh(e,t.scope_.immer_.useStrictShallowCopy_)}else r=xh(e,!0);return ph(r,(e,t)=>{vh(r,e,Wh(t))}),t&&(t.finalized_=!1),r}ph(Dh,(e,t)=>{zh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),zh.deleteProperty=function(e,t){return zh.set.call(this,e,t,void 0)},zh.set=function(e,t,r){return Dh.set.call(this,e[0],t,r,e[0])};var Gh=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}let n;if("function"!=typeof t&&lh(6),void 0!==r&&"function"!=typeof r&&lh(7),dh(e)){const i=Oh(this),o=$h(e,void 0);let a=!0;try{n=t(o),a=!1}finally{a?Th(i):Fh(i)}return jh(i,r),Mh(n,i)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===oh&&(n=void 0),this.autoFreeze_&&Ch(n,!0),r){const t=[],i=[];Eh("Patches").generateReplacementPatches_(e,n,t,i),r(t,i)}return n}lh(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,t=>e(t,...r));let r,n;return[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof(null==e?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){dh(e)||lh(8),uh(e)&&(e=function(e){return uh(e)||lh(10),Wh(e)}(e));const t=Oh(this),r=$h(e,void 0);return r[sh].isManual_=!0,Fh(t),r}finishDraft(e,t){const r=e&&e[sh];(!r||!r.isManual_)&&lh(9);const{scope_:n}=r;return jh(n,t),Mh(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=Eh("Patches").applyPatches_;return uh(e)?n(e,t):this.produce(e,e=>n(e,t))}},qh=Gh.produce;Gh.produceWithPatches.bind(Gh),Gh.setAutoFreeze.bind(Gh),Gh.setUseStrictShallowCopy.bind(Gh),Gh.applyPatches.bind(Gh),Gh.createDraft.bind(Gh),Gh.finishDraft.bind(Gh);var Yh=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Xh}(e)}(e)},Xh="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Kh(e,t){return!1!==t.clone&&t.isMergeableObject(e)?ef(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function Zh(e,t,r){return e.concat(t).map(function(e){return Kh(e,r)})}function Jh(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function Qh(e,t){try{return t in e}catch{return!1}}function ef(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||Zh,r.isMergeableObject=r.isMergeableObject||Yh,r.cloneUnlessOtherwiseSpecified=Kh;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):function(e,t,r){var n={};return r.isMergeableObject(e)&&Jh(e).forEach(function(t){n[t]=Kh(e[t],r)}),Jh(t).forEach(function(i){(function(e,t){return Qh(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(Qh(e,i)&&r.isMergeableObject(t[i])?n[i]=function(e,t){if(!t.customMerge)return ef;var r=t.customMerge(e);return"function"==typeof r?r:ef}(i,r)(e[i],t[i],r):n[i]=Kh(t[i],r))}),n}(e,t,r):Kh(t,r)}ef.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return ef(e,r,t)},{})};const tf=Yu(ef);function rf(e,t){return nf(tf(t,e),e)}function nf(e,t){return Object.keys(e).forEach(r=>{if(r.startsWith("replaceDefault")&&e[r]){const n=function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(r.replace("replaceDefault","")||"items");e[n]=t?t[n]:[],delete e[r]}else"object"==typeof e[r]&&null!==e[r]&&nf(e[r],null==t?void 0:t[r])}),e}const of=(e,t)=>({history:{...af,updatePointerById:e=>{const r=t().history.items.findIndex(t=>t.id===e);t().history.update(r)},update:(t,r)=>{e(e=>{e.history.pointer=t,r&&(e.history.items=r),e.history.canUndo=e.history.pointer>0,e.history.canRedo=e.history.items.length>e.history.pointer+1})},reset:r=>{e({history:{...t().history,...r??af}})}}}),af={items:[],pointer:0,canUndo:!1,canRedo:!1};var sf=(e=>(e.Filter="filter",e.Frame="frame",e.ActiveObject="activeObj",e.Text="text",e))(sf||{});const lf=(e,t)=>({filter:{...cf,select(t,r=!1){e(e=>{e.filter.selected=t,e.activeToolOverlay=r?sf.Filter:null,e.dirty=!0})},deselect(r){t().filter.selected===r&&e(e=>{e.filter.selected=null,e.activeToolOverlay=null,e.dirty=!0})},reset(){e({filter:{...t().filter,...cf}})}}}),cf={selected:null,applied:[]},uf=(e,t)=>({crop:{...df,setCropzoneRect:t=>{e(e=>{e.crop.zoneRect=t})},setAspectRatio:t=>{e(e=>{e.crop.selectedAspectRatio=t})},setTransformAngle:t=>{e(e=>{e.crop.straightenAngle=t})},apply:async()=>{const e=t().crop.zoneRect;if(e){const r={width:Math.ceil(e.width/t().zoom),height:Math.ceil(e.height/t().zoom),left:Math.ceil(e.left/t().zoom),top:Math.ceil(e.top/t().zoom)};await t().editor.tools.crop.apply(r)}},reset:()=>{e({crop:{...t().crop,...df}})}}}),df={zoneRect:null,selectedAspectRatio:null,straightenAngle:0};function hf(e){return"i-text"===(null==e?void 0:e.type)}var ff=(e=>(e.Text="text",e.Shape="shape",e.Sticker="sticker",e.Drawing="drawing",e.Image="image",e.MainImage="mainImage",e.StraightenAnchor="straightenHelper",e))(ff||{});const pf={text:{name:Zu("Text"),icon:kd.text.icon},shape:{name:Zu("Shape"),icon:kd.shapes.icon},sticker:{name:Zu("Sticker"),icon:kd.stickers.icon},drawing:{name:Zu("Drawing"),icon:kd.draw.icon},image:{name:Zu("Image"),icon:kd.overlayImage.icon},mainImage:{name:Zu("Background Image"),icon:kd.bgImage.icon}},gf={isMoving:!1,editableProps:{},id:null,isText:!1,isImage:!1,name:null},mf=(e,t)=>({objects:{...vf,setActiveIsMoving:t=>{e(e=>{e.objects.active.isMoving=t})},setIsEditingText:t=>{e(e=>{e.objects.isEditingText=t})},setActive:r=>{e(r?e=>{e.objects.active.editableProps=function(e){if(!e)return{};const t={fill:e.fill,opacity:e.opacity,backgroundColor:e.backgroundColor,stroke:e.stroke,strokeWidth:e.strokeWidth},r=e.shadow;return r&&(t.shadow={color:r.color,blur:r.blur,offsetX:r.offsetX,offsetY:r.offsetY}),hf(e)&&(t.textAlign=e.textAlign,t.underline=e.underline,t.linethrough=e.linethrough,t.fontStyle=e.fontStyle,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize),t}(r),e.objects.active.id=r.data.id,e.objects.active.name=r.name??null,e.objects.active.isText=hf(r),e.objects.active.isImage=function(e){return e.name===ff.Image}(r)}:e=>{var r,n,i,o,a;const s={...null==(r=t().config.objectDefaults)?void 0:r.global,fontFamily:null==(i=null==(n=t().config.objectDefaults)?void 0:n.text)?void 0:i.fontFamily,fontSize:null==(a=null==(o=t().config.objectDefaults)?void 0:o.text)?void 0:a.fontSize};e.objects.active={...gf,editableProps:s}})},reset(){e({objects:{...t().objects,...vf}})}}}),vf={all:[],isEditingText:!1,active:gf},yf=(e,t)=>({frame:{...bf,select:r=>{e(e=>{e.frame.active=r}),t().frame.showOptionsPanel()},deselect:()=>{e(e=>{e.frame.active=null,e.activeToolOverlay=null})},showOptionsPanel:()=>{t().activeTool===nd.FRAME&&e(e=>{e.activeToolOverlay=sf.Frame})},reset(){e({frame:{...t().frame,...bf}})}}}),bf={active:null},wf=(e,t)=>({resize:{...xf,setFormValue:t=>{e(e=>{Object.entries(t).forEach(([t,r])=>{e.resize.formValue[t]=r})})},apply(){const e=t().resize.formValue,r=t().original;if(e.width===r.width&&e.height===r.height)return!1;t().editor.tools.resize.apply(e)},reset(){e({resize:{...t().resize,...xf}})}}}),xf={formValue:{width:1,height:1,maintainAspect:!0,usePercentages:!1}},Cf=(e,t)=>({corners:{..._f,setRadius:t=>{e(e=>{e.corners.radius=t})},apply:()=>t().editor.tools.corners.apply(t().corners.radius),reset(){e({corners:{...t().corners,..._f}})}}}),_f={radius:50},Sf=e=>(t,r,n)=>(n.setState=(e,r,...n)=>{const i="function"==typeof e?qh(e):e;return t(i,r,...n)},e(n.setState,r,n));var Af={exports:{}},kf={exports:{}},Ef=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},If=Array.prototype.concat,jf=Array.prototype.slice,Tf=kf.exports=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r];Ef(i)?t=If.call(t,jf.call(i)):t.push(i)}return t};Tf.wrap=function(e){return function(){return e(Tf(arguments))}};var Ff=kf.exports,Of={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Pf=Ff,Mf=Object.hasOwnProperty,Rf=Object.create(null);for(var Lf in Of)Mf.call(Of,Lf)&&(Rf[Of[Lf]]=Lf);var Nf=Af.exports={to:{},get:{}};function Df(e,t,r){return Math.min(Math.max(t,e),r)}function zf(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}Nf.get=function(e){var t,r;switch(e.substring(0,3).toLowerCase()){case"hsl":t=Nf.get.hsl(e),r="hsl";break;case"hwb":t=Nf.get.hwb(e),r="hwb";break;default:t=Nf.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},Nf.get.rgb=function(e){if(!e)return null;var t,r,n,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(n=t[2],t=t[1],r=0;r<3;r++){var o=2*r;i[r]=parseInt(t.slice(o,o+2),16)}n&&(i[3]=parseInt(n,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(n=(t=t[1])[3],r=0;r<3;r++)i[r]=parseInt(t[r]+t[r],16);n&&(i[3]=parseInt(n+n,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(t[r+1],0);t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:Mf.call(Of,t[1])?((i=Of[t[1]])[3]=1,i):null:null;for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(t[r+1]));t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}for(r=0;r<3;r++)i[r]=Df(i[r],0,255);return i[3]=Df(i[3],0,1),i},Nf.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,Df(parseFloat(t[2]),0,100),Df(parseFloat(t[3]),0,100),Df(isNaN(r)?1:r,0,1)]}return null},Nf.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,Df(parseFloat(t[2]),0,100),Df(parseFloat(t[3]),0,100),Df(isNaN(r)?1:r,0,1)]}return null},Nf.to.hex=function(){var e=Pf(arguments);return"#"+zf(e[0])+zf(e[1])+zf(e[2])+(e[3]<1?zf(Math.round(255*e[3])):"")},Nf.to.rgb=function(){var e=Pf(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Nf.to.rgb.percent=function(){var e=Pf(arguments),t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},Nf.to.hsl=function(){var e=Pf(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Nf.to.hwb=function(){var e=Pf(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},Nf.to.keyword=function(e){return Rf[e.slice(0,3)]};var Bf=Af.exports;const Uf={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Vf={};for(const QO of Object.keys(Uf))Vf[Uf[QO]]=QO;const Hf={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var $f=Hf;for(const QO of Object.keys(Hf)){if(!("channels"in Hf[QO]))throw new Error("missing channels property: "+QO);if(!("labels"in Hf[QO]))throw new Error("missing channel labels property: "+QO);if(Hf[QO].labels.length!==Hf[QO].channels)throw new Error("channel and label counts mismatch: "+QO);const{channels:e,labels:t}=Hf[QO];delete Hf[QO].channels,delete Hf[QO].labels,Object.defineProperty(Hf[QO],"channels",{value:e}),Object.defineProperty(Hf[QO],"labels",{value:t})}function Wf(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}Hf.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=o-i;let s,l;o===i?s=0:t===o?s=(r-n)/a:r===o?s=2+(n-t)/a:n===o&&(s=4+(t-r)/a),s=Math.min(60*s,360),s<0&&(s+=360);const c=(i+o)/2;return l=o===i?0:c<=.5?a/(o+i):a/(2-o-i),[s,100*l,100*c]},Hf.rgb.hsv=function(e){let t,r,n,i,o;const a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),d=function(e){return(c-e)/6/u+.5};return 0===u?(i=0,o=0):(o=u/c,t=d(a),r=d(s),n=d(l),a===c?i=n-r:s===c?i=1/3+t-n:l===c&&(i=2/3+r-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},Hf.rgb.hwb=function(e){const t=e[0],r=e[1];let n=e[2];const i=Hf.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[i,100*o,100*n]},Hf.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n);return[100*((1-t-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*i]},Hf.rgb.keyword=function(e){const t=Vf[e];if(t)return t;let r,n=1/0;for(const i of Object.keys(Uf)){const t=Wf(e,Uf[i]);t<n&&(n=t,r=i)}return r},Hf.keyword.rgb=function(e){return Uf[e]},Hf.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;return t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,[100*(.4124*t+.3576*r+.1805*n),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},Hf.rgb.lab=function(e){const t=Hf.rgb.xyz(e);let r=t[0],n=t[1],i=t[2];return r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*n-16,500*(r-n),200*(n-i)]},Hf.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let i,o,a;if(0===r)return a=255*n,[a,a,a];i=n<.5?n*(1+r):n+r-n*r;const s=2*n-i,l=[0,0,0];for(let c=0;c<3;c++)o=t+1/3*-(c-1),o<0&&o++,o>1&&o--,a=6*o<1?s+6*(i-s)*o:2*o<1?i:3*o<2?s+(i-s)*(2/3-o)*6:s,l[c]=255*a;return l},Hf.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,i=r;const o=Math.max(n,.01);return n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o,[t,100*(0===n?2*i/(o+i):2*r/(n+r)),(n+r)/2*100]},Hf.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const i=Math.floor(t)%6,o=t-Math.floor(t),a=255*n*(1-r),s=255*n*(1-r*o),l=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,l,a];case 1:return[s,n,a];case 2:return[a,n,l];case 3:return[a,s,n];case 4:return[l,a,n];case 5:return[n,a,s]}},Hf.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,.01);let o,a;a=(2-r)*n;const s=(2-r)*i;return o=r*i,o/=s<=1?s:2-s,o=o||0,a/=2,[t,100*o,100*a]},Hf.hwb.rgb=function(e){const t=e[0]/360;let r=e[1]/100,n=e[2]/100;const i=r+n;let o;i>1&&(r/=i,n/=i);const a=Math.floor(6*t),s=1-n;o=6*t-a,1&a&&(o=1-o);const l=r+o*(s-r);let c,u,d;switch(a){default:case 6:case 0:c=s,u=l,d=r;break;case 1:c=l,u=s,d=r;break;case 2:c=r,u=s,d=l;break;case 3:c=r,u=l,d=s;break;case 4:c=l,u=r,d=s;break;case 5:c=s,u=r,d=l}return[255*c,255*u,255*d]},Hf.cmyk.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},Hf.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let i,o,a;return i=3.2406*t+-1.5372*r+-.4986*n,o=-.9689*t+1.8758*r+.0415*n,a=.0557*t+-.204*r+1.057*n,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[255*i,255*o,255*a]},Hf.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];return t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*r-16,500*(t-r),200*(r-n)]},Hf.lab.xyz=function(e){let t,r,n;r=(e[0]+16)/116,t=e[1]/500+r,n=r-e[2]/200;const i=r**3,o=t**3,a=n**3;return r=i>.008856?i:(r-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,n=a>.008856?a:(n-16/116)/7.787,t*=95.047,r*=100,n*=108.883,[t,r,n]},Hf.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let i;return i=360*Math.atan2(n,r)/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(r*r+n*n),i]},Hf.lch.lab=function(e){const t=e[0],r=e[1],n=e[2]/360*2*Math.PI;return[t,r*Math.cos(n),r*Math.sin(n)]},Hf.rgb.ansi16=function(e,t=null){const[r,n,i]=e;let o=null===t?Hf.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let a=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return 2===o&&(a+=60),a},Hf.hsv.ansi16=function(e){return Hf.rgb.ansi16(Hf.hsv.rgb(e),e[2])},Hf.rgb.ansi256=function(e){const t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},Hf.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},Hf.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},Hf.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},Hf.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split("").map(e=>e+e).join(""));const n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},Hf.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),o=Math.min(Math.min(t,r),n),a=i-o;let s,l;return s=a<1?o/(1-a):0,l=a<=0?0:i===t?(r-n)/a%6:i===r?2+(n-t)/a:4+(t-r)/a,l/=6,l%=1,[360*l,100*a,100*s]},Hf.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let i=0;return n<1&&(i=(r-.5*n)/(1-n)),[e[0],100*n,100*i]},Hf.hsv.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=t*r;let i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},Hf.hcg.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];const i=[0,0,0],o=t%1*6,a=o%1,s=1-a;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-r)*n,[255*(r*i[0]+l),255*(r*i[1]+l),255*(r*i[2]+l)]},Hf.hcg.hsv=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);let n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},Hf.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},Hf.hcg.hwb=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},Hf.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,n=r-t;let i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},Hf.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},Hf.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},Hf.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},Hf.gray.hsl=function(e){return[0,0,e[0]]},Hf.gray.hsv=Hf.gray.hsl,Hf.gray.hwb=function(e){return[0,100,e[0]]},Hf.gray.cmyk=function(e){return[0,0,0,e[0]]},Hf.gray.lab=function(e){return[e[0],0,0]},Hf.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},Hf.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const Gf=$f;function qf(e,t){return function(r){return t(e(r))}}function Yf(e,t){const r=[t[e].parent,e];let n=Gf[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)r.unshift(t[i].parent),n=qf(Gf[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}const Xf=$f,Kf=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(Gf);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;){const e=r.pop(),n=Object.keys(Gf[e]);for(let i=n.length,o=0;o<i;o++){const i=n[o],a=t[i];-1===a.distance&&(a.distance=t[e].distance+1,a.parent=e,r.unshift(i))}}return t}(e),r={},n=Object.keys(t);for(let i=n.length,o=0;o<i;o++){const e=n[o];null!==t[e].parent&&(r[e]=Yf(e,t))}return r},Zf={};Object.keys(Xf).forEach(e=>{Zf[e]={},Object.defineProperty(Zf[e],"channels",{value:Xf[e].channels}),Object.defineProperty(Zf[e],"labels",{value:Xf[e].labels});const t=Kf(e);Object.keys(t).forEach(r=>{const n=t[r];Zf[e][r]=function(e){const t=function(...t){const r=t[0];if(null==r)return r;r.length>1&&(t=r);const n=e(t);if("object"==typeof n)for(let e=n.length,i=0;i<e;i++)n[i]=Math.round(n[i]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(n),Zf[e][r].raw=function(e){const t=function(...t){const r=t[0];return null==r?r:(r.length>1&&(t=r),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)})});const Jf=Bf,Qf=Zf,ep=["keyword","gray","hex"],tp={};for(const QO of Object.keys(Qf))tp[[...Qf[QO].labels].sort().join("")]=QO;const rp={};function np(e,t){if(!(this instanceof np))return new np(e,t);if(t&&t in ep&&(t=null),t&&!(t in Qf))throw new Error("Unknown model: "+t);let r,n;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof np)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=Jf.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,n=Qf[this.model].channels,this.color=t.value.slice(0,n),this.valpha="number"==typeof t.value[n]?t.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=Qf[this.model].channels;const r=Array.prototype.slice.call(e,0,n);this.color=lp(r,n),this.valpha="number"==typeof e[n]?e[n]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const n=t.sort().join("");if(!(n in tp))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=tp[n];const{labels:i}=Qf[this.model],o=[];for(r=0;r<i.length;r++)o.push(e[i[r]]);this.color=lp(o)}if(rp[this.model])for(n=Qf[this.model].channels,r=0;r<n;r++){const e=rp[this.model][r];e&&(this.color[r]=e(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}np.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in Jf.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const r=1===t.valpha?t.color:[...t.color,this.valpha];return Jf.to[t.model](r)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),r=1===t.valpha?t.color:[...t.color,this.valpha];return Jf.to.rgb.percent(r)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=Qf[this.model],{labels:r}=Qf[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new np([...this.color.map(ip(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new np([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:op("rgb",0,ap(255)),green:op("rgb",1,ap(255)),blue:op("rgb",2,ap(255)),hue:op(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:op("hsl",1,ap(100)),lightness:op("hsl",2,ap(100)),saturationv:op("hsv",1,ap(100)),value:op("hsv",2,ap(100)),chroma:op("hcg",1,ap(100)),gray:op("hcg",2,ap(100)),white:op("hwb",1,ap(100)),wblack:op("hwb",2,ap(100)),cyan:op("cmyk",0,ap(100)),magenta:op("cmyk",1,ap(100)),yellow:op("cmyk",2,ap(100)),black:op("cmyk",3,ap(100)),x:op("xyz",0,ap(95.047)),y:op("xyz",1,ap(100)),z:op("xyz",2,ap(108.833)),l:op("lab",0,ap(100)),a:op("lab",1),b:op("lab",2),keyword(e){return void 0!==e?new np(e):Qf[this.model].keyword(this.color)},hex(e){return void 0!==e?new np(e):Jf.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new np(e);const t=this.rgb().round().color;let r=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===r.length&&(r="0"+r),Jf.to.hex(t)+r},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[r,n]of e.entries()){const e=n/255;t[r]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return np.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const r=e.rgb(),n=this.rgb(),i=void 0===t?.5:t,o=2*i-1,a=r.alpha()-n.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return np.rgb(s*r.red()+l*n.red(),s*r.green()+l*n.green(),s*r.blue()+l*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(const QO of Object.keys(Qf)){if(ep.includes(QO))continue;const{channels:e}=Qf[QO];np.prototype[QO]=function(...e){return this.model===QO?new np(this):e.length>0?new np(e,QO):new np([...sp(Qf[this.model][QO].raw(this.color)),this.valpha],QO)},np[QO]=function(...t){let r=t[0];return"number"==typeof r&&(r=lp(t,e)),new np(r,QO)}}function ip(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function op(e,t,r){e=Array.isArray(e)?e:[e];for(const n of e)(rp[n]||(rp[n]=[]))[t]=r;return e=e[0],function(n){let i;return void 0!==n?(r&&(n=r(n)),i=this[e](),i.color[t]=n,i):(i=this[e]().color[t],r&&(i=r(i)),i)}}function ap(e){return function(t){return Math.max(0,Math.min(e,t))}}function sp(e){return Array.isArray(e)?e:[e]}function lp(e,t){for(let r=0;r<t;r++)"number"!=typeof e[r]&&(e[r]=0);return e}const cp=Yu(np);function up(e){return e.endsWith("%")||3===e.split(" ").length?e:cp(e).rgb().array().slice(0,3).join(" ")}let dp=typeof document<"u"?document.getElementById("root")??document.body:void 0,hp=typeof document<"u"?document.documentElement:void 0;const fp=ih()(e=>({data:typeof window<"u"&&window.bootstrapData?gp(window.bootstrapData):null,setData:t=>{const r="string"==typeof t?gp(t):t;e({data:r})},mergeData:t=>{e(e=>({data:{...e.data,...t}}))}}));fp.getState().setData;const pp=fp.getState().mergeData;function gp(e){return"string"==typeof e?JSON.parse(e):e}const mp={top:0,right:0,bottom:0,left:0,width:0,height:0},vp=ih()((e=>(t,r,n)=>{const i=n.subscribe;return n.subscribe=(e,t,r)=>{let o=e;if(t){const i=(null==r?void 0:r.equalityFn)||Object.is;let a=e(n.getState());o=r=>{const n=e(r);if(!i(a,n)){const e=a;t(a=n,e)}},null!=r&&r.fireImmediately&&t(a,a)}return i(o)},e(t,r,n)})(Sf((e,t)=>({editor:null,fabric:null,config:Td,zoom:1,dirty:!1,original:{width:1,height:1},stageSize:mp,canvasSize:mp,canvasRef:null,activeTool:null,activeToolOverlay:null,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1},...of(e,t),...mf(e,t),...lf(e,t),...uf(e,t),...yf(e,t),...wf(e,t),...Cf(e,t),setZoom:t=>e(e=>{e.zoom=t}),setOriginal:(t,r)=>e(e=>{e.original={width:t,height:r}}),setDirty:t=>e(e=>{e.dirty=t}),toggleLoading:t=>e(e=>{e.loading=t}),setStageSize:t=>e(e=>{e.stageSize=t}),setCanvasSize:t=>e(e=>{e.canvasSize=t}),setActiveTool:(t,r)=>{e(e=>{e.activeTool=t,e.activeToolOverlay=r})},setConfig:r=>e(e=>{var n,i;const o=rf(r,t().config);e.config=o;const a=o.activeLanguage||"en",s=null==(n=o.languages)?void 0:n[a],l=((null==(i=o.ui)?void 0:i.themes)||[]).map(e=>function(e){const t=e.isDark?rd.find(e=>e.isDark):rd.find(e=>!e.isDark),r={...t,...e,colors:{...null==t?void 0:t.colors,...e.colors}},n=Object.entries(r.colors).map(([e,t])=>[e,up(t)]);return{id:r.name,name:r.name,values:Object.fromEntries(n),is_dark:r.isDark}}(e)),c=l.find(e=>{var t;return e.id===(null==(t=o.ui)?void 0:t.activeTheme)});c&&function(e){Object.entries(e.values).forEach(([e,t])=>{!function(e,t){null==hp||hp.style.setProperty(e,t)}(e,t)}),e.is_dark?hp.classList.add("dark"):hp.classList.remove("dark")}(c),pp({i18n:{language:a,name:a,id:0,lines:s},themes:{all:l}})}),togglePanel:(t,r)=>e(e=>{e.openPanels[t]=r??!e.openPanels[t]}),applyChanges:async()=>{var r;const n=t().activeTool;if(!n)return;const i=t()[n],o=await(null==(r=null==i?void 0:i.apply)?void 0:r.call(i));e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),!1!==o&&t().editor.tools.history.addHistoryItem({name:n}),null==i||i.reset()},cancelChanges:async()=>{const r=t().activeTool;if(!r)return;const n=t().dirty;e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),n&&await t().editor.tools.history.reload();const i=t()[r];null==i||i.reset()},reset:()=>{t().editor.tools.transform.resetStraightenAnchor(),e({activeTool:null,activeToolOverlay:null,zoom:1,dirty:!1,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1}}),t().history.reset(),t().objects.reset(),t().filter.reset(),t().crop.reset(),t().frame.reset(),t().resize.reset(),t().corners.reset()}}))));function yp(){return vp.getState()}function bp(){return yp().editor.tools}function wp(){return yp().fabric}function xp(e){var t,r,n,i,o;bp().canvas.clear(),bp().frame.remove();const a=!(null!=(t=yp().config.ui)&&t.visible);return yp().setConfig({image:void 0,blankCanvasSize:void 0,...e}),yp().reset(),null!=(r=yp().config.ui)&&r.defaultTool&&yp().setActiveTool(null==(n=yp().config.ui)?void 0:n.defaultTool,null),a&&(null==(o=(i=yp().config).onOpen)||o.call(i)),new Promise(e=>setTimeout(e))}async function Cp(e){return(await fetch(e)).json()}const _p={selectable:!1,evented:!1,lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0,hasControls:!1,hasBorders:!1,hasRotatingPoint:!1,strokeWidth:0};function Sp(e=[]){var t;e=[...Object.keys(_p),"crossOrigin","name","displayName","data",...e];const r=wp().toJSON(e);return r.objects=r.objects.filter(e=>!e.data.pixieInternal).map(e=>("image"===e.type&&yp().config.crossOrigin&&(e.crossOrigin="anonymous"),hf(e)&&(e.selectable=!0,e.lockMovementX=!1,e.lockMovementY=!1,e.lockUniScaling=!1),{...e,data:e.data?{...e.data}:{}})),{canvas:r,editor:{frame:bp().frame.active.config?{name:bp().frame.active.config.name,sizePercent:bp().frame.active.currentSizeInPercent}:null,zoom:yp().zoom,activeObjectId:(null==(t=yp().objects.active)?void 0:t.id)||null},canvasWidth:yp().original.width,canvasHeight:yp().original.height}}function Ap(e=null){if(yp().dirty)return;bp().zoom.fitToScreen();const[t,r]=kp(wp().getActiveObject());e?yp().setActiveTool(e,t===e?r:null):yp().setActiveTool(t,r)}function kp(e){switch(null==e?void 0:e.name){case ff.Text:return[nd.TEXT,sf.Text];case ff.Sticker:return[nd.STICKERS,sf.ActiveObject];case ff.Image:return[null,sf.ActiveObject];case ff.Shape:return[nd.SHAPES,sf.ActiveObject];default:return[null,null]}}let Ep=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&r[e]];return t};class Ip{constructor(e,t){ja(this,"timerId"),ja(this,"createdAt",0),this.callback=e,this.remaining=t,this.resume()}pause(){clearTimeout(this.timerId),this.remaining-=Date.now()-this.createdAt}resume(){this.createdAt=Date.now(),this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remaining)}clear(){clearTimeout(this.timerId)}}const jp=ih()(Sf((e,t)=>({toasts:[],add:(r,n)=>{const i=t().toasts.length+1-1;i>0&&e(e=>{e.toasts.splice(0,i)});const o=(null==n?void 0:n.id)||Ep(6),a=(null==n?void 0:n.type)||"positive",s=(null==n?void 0:n.duration)??function(e){switch(e){case"danger":return 8e3;case"loading":return 0;default:return 3e3}}(a),l={timer:s>0?new Ip(()=>t().remove(o),s):null,message:r,...n,id:o,type:a,position:(null==n?void 0:n.position)||"bottom-center",duration:s,disableExitAnimation:null==n?void 0:n.disableExitAnimation,disableEnterAnimation:null==n?void 0:n.disableEnterAnimation},c=t().toasts.findIndex(e=>e.id===l.id);e(c>-1?e=>{e.toasts[c]=l}:e=>{e.toasts.push(l)})},remove:r=>{const n=t().toasts.filter(e=>{var t;return r!==e.id||(null==(t=e.timer)||t.clear(),!1)});e(e=>{e.toasts=n})}})));function Tp(){return jp.getState()}function Fp(e,t){Tp().add(e,t)}Fp.danger=(e,t)=>{Tp().add(e,{...t,type:"danger"})},Fp.positive=(e,t)=>{Tp().add(e,{...t,type:"positive"})},Fp.loading=(e,t)=>{Tp().add(e,{...t,type:"loading"})};const Op=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Pp=(0,o.createContext)({}),Mp=(0,o.createContext)(null),Rp=typeof document<"u",Lp=Rp?o.useLayoutEffect:o.useEffect,Np=(0,o.createContext)({strict:!1}),Dp=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),zp="data-"+Dp("framerAppearId");function Bp(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Up(e){return"string"==typeof e||Array.isArray(e)}function Vp(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Hp=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$p=["initial",...Hp];function Wp(e){return Vp(e.animate)||$p.some(t=>Up(e[t]))}function Gp(e){return!(!Wp(e)&&!e.variants)}function qp(e){return Array.isArray(e)?e.join(" "):e}const Yp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Xp={};for(const QO in Yp)Xp[QO]={isEnabled:e=>Yp[QO].some(t=>!!e[t])};function Kp(e){for(const t in e)Xp[t]={...Xp[t],...e[t]}}const Zp=(0,o.createContext)({}),Jp=(0,o.createContext)({}),Qp=Symbol.for("motionComponentSymbol");function eg({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:i}){e&&Kp(e);const a=(0,o.forwardRef)(function(a,s){let l;const c={...(0,o.useContext)(Op),...a,layoutId:tg(a)},{isStatic:u}=c,d=function(e){const{initial:t,animate:r}=function(e,t){if(Wp(e)){const{initial:t,animate:r}=e;return{initial:!1===t||Up(t)?t:void 0,animate:Up(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(Pp));return(0,o.useMemo)(()=>({initial:t,animate:r}),[qp(t),qp(r)])}(a),h=n(a,u);if(!u&&Rp){d.visualElement=function(e,t,r,n){const{visualElement:i}=(0,o.useContext)(Pp),a=(0,o.useContext)(Np),s=(0,o.useContext)(Mp),l=(0,o.useContext)(Op).reducedMotion,c=(0,o.useRef)();n=n||a.renderer,!c.current&&n&&(c.current=n(e,{visualState:t,parent:i,props:r,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:l}));const u=c.current;(0,o.useInsertionEffect)(()=>{u&&u.update(r,s)});const d=(0,o.useRef)(!(!r[zp]||window.HandoffComplete));return Lp(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,o.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(i,h,c,t);const r=(0,o.useContext)(Jp),n=(0,o.useContext)(Np).strict;d.visualElement&&(l=d.visualElement.loadFeatures(c,n,e,r))}return o.createElement(Pp.Provider,{value:d},l&&d.visualElement?o.createElement(l,{visualElement:d.visualElement,...c}):null,r(i,a,function(e,t,r){return(0,o.useCallback)(n=>{n&&e.mount&&e.mount(n),t&&(n?t.mount(n):t.unmount()),r&&("function"==typeof r?r(n):Bp(r)&&(r.current=n))},[t])}(h,d.visualElement,s),h,u,d.visualElement))});return a[Qp]=i,a}function tg({layoutId:e}){const t=(0,o.useContext)(Zp).id;return t&&void 0!==e?t+"-"+e:e}const rg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ng(e){return"string"==typeof e&&!e.includes("-")&&!!(rg.indexOf(e)>-1||/[A-Z]/.test(e))}const ig={},og=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ag=new Set(og);function sg(e,{layout:t,layoutId:r}){return ag.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!ig[e]||"opacity"===e)}const lg=e=>!(!e||!e.getVelocity),cg={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ug=og.length,dg=e=>t=>"string"==typeof t&&t.startsWith(e),hg=dg("--"),fg=dg("var(--"),pg=(e,t)=>t&&"number"==typeof e?t.transform(e):e,gg=(e,t,r)=>Math.min(Math.max(r,e),t),mg={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},vg={...mg,transform:e=>gg(0,1,e)},yg={...mg,default:1},bg=e=>Math.round(1e5*e)/1e5,wg=/(-)?([\d]*\.?[\d])+/g,xg=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Cg=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function _g(e){return"string"==typeof e}const Sg=e=>({test:t=>_g(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Ag=Sg("deg"),kg=Sg("%"),Eg=Sg("px"),Ig=Sg("vh"),jg=Sg("vw"),Tg={...kg,parse:e=>kg.parse(e)/100,transform:e=>kg.transform(100*e)},Fg={...mg,transform:Math.round},Og={borderWidth:Eg,borderTopWidth:Eg,borderRightWidth:Eg,borderBottomWidth:Eg,borderLeftWidth:Eg,borderRadius:Eg,radius:Eg,borderTopLeftRadius:Eg,borderTopRightRadius:Eg,borderBottomRightRadius:Eg,borderBottomLeftRadius:Eg,width:Eg,maxWidth:Eg,height:Eg,maxHeight:Eg,size:Eg,top:Eg,right:Eg,bottom:Eg,left:Eg,padding:Eg,paddingTop:Eg,paddingRight:Eg,paddingBottom:Eg,paddingLeft:Eg,margin:Eg,marginTop:Eg,marginRight:Eg,marginBottom:Eg,marginLeft:Eg,rotate:Ag,rotateX:Ag,rotateY:Ag,rotateZ:Ag,scale:yg,scaleX:yg,scaleY:yg,scaleZ:yg,skew:Ag,skewX:Ag,skewY:Ag,distance:Eg,translateX:Eg,translateY:Eg,translateZ:Eg,x:Eg,y:Eg,z:Eg,perspective:Eg,transformPerspective:Eg,opacity:vg,originX:Tg,originY:Tg,originZ:Eg,zIndex:Fg,fillOpacity:vg,strokeOpacity:vg,numOctaves:Fg};function Pg(e,t,r,n){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,c=!1,u=!0;for(const d in t){const e=t[d];if(hg(d)){o[d]=e;continue}const r=Og[d],n=pg(e,r);if(ag.has(d)){if(l=!0,a[d]=n,!u)continue;e!==(r.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,s[d]=n):i[d]=n}if(t.transform||(l||n?i.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:r=!0},n,i){let o="";for(let a=0;a<ug;a++){const t=og[a];void 0!==e[t]&&(o+=`${cg[t]||t}(${e[t]}) `)}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,n?"":o):r&&n&&(o="none"),o}(e.transform,r,u,n):i.transform&&(i.transform="none")),c){const{originX:e="50%",originY:t="50%",originZ:r=0}=s;i.transformOrigin=`${e} ${t} ${r}`}}function Mg(e,t,r){for(const n in t)!lg(t[n])&&!sg(n,r)&&(e[n]=t[n])}function Rg(e,t,r){const n={},i=function(e,t,r){const n={};return Mg(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t,r){return(0,o.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Pg(n,t,{enableHardwareAcceleration:!r},e),Object.assign({},n.vars,n.style)},[t])}(e,t,r)),e.transformValues?e.transformValues(n):n}(e,t,r);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}const Lg=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ng(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Lg.has(e)}let Dg=e=>!Ng(e);try{!function(e){e&&(Dg=t=>t.startsWith("on")?!Ng(t):e(t))}(r(36118).A)}catch{}function zg(e,t,r){const n={};for(const i in e)"values"===i&&"object"==typeof e.values||(Dg(i)||!0===r&&Ng(i)||!t&&!Ng(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}function Bg(e,t,r){return"string"==typeof e?e:Eg.transform(t+r*e)}const Ug={offset:"stroke-dashoffset",array:"stroke-dasharray"},Vg={offset:"strokeDashoffset",array:"strokeDasharray"};function Hg(e,{attrX:t,attrY:r,attrScale:n,originX:i,originY:o,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...c},u,d,h){if(Pg(e,c,u,h),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:g}=e;f.transform&&(g&&(p.transform=f.transform),delete f.transform),g&&(void 0!==i||void 0!==o||p.transform)&&(p.transformOrigin=function(e,t,r){return`${Bg(t,e.x,e.width)} ${Bg(r,e.y,e.height)}`}(g,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==t&&(f.x=t),void 0!==r&&(f.y=r),void 0!==n&&(f.scale=n),void 0!==a&&function(e,t,r=1,n=0,i=!0){e.pathLength=1;const o=i?Ug:Vg;e[o.offset]=Eg.transform(-n);const a=Eg.transform(t),s=Eg.transform(r);e[o.array]=`${a} ${s}`}(f,a,s,l,!1)}const $g=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Wg(e,t,r,n){const i=(0,o.useMemo)(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Hg(r,t,{enableHardwareAcceleration:!1},$g(n),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const t={};Mg(t,e.style,e),i.style={...t,...i.style}}return i}function Gg(e=!1){return(t,r,n,{latestValues:i},a)=>{const s=(ng(t)?Wg:Rg)(r,i,a,t),l={...zg(r,"string"==typeof t,e),...s,ref:n},{children:c}=r,u=(0,o.useMemo)(()=>lg(c)?c.get():c,[c]);return(0,o.createElement)(t,{...l,children:u})}}function qg(e,{style:t,vars:r},n,i){Object.assign(e.style,t,i&&i.getProjectionStyles(n));for(const o in r)e.style.setProperty(o,r[o])}const Yg=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Xg(e,t,r,n){qg(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(Yg.has(i)?i:Dp(i),t.attrs[i])}function Kg(e,t){const{style:r}=e,n={};for(const i in r)(lg(r[i])||t.style&&lg(t.style[i])||sg(i,e))&&(n[i]=r[i]);return n}function Zg(e,t){const r=Kg(e,t);for(const n in e)(lg(e[n])||lg(t[n]))&&(r[-1!==og.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function Jg(e,t,r,n={},i={}){return"function"==typeof t&&(t=t(void 0!==r?r:e.custom,n,i)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==r?r:e.custom,n,i)),t}function Qg(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const em=e=>Array.isArray(e),tm=e=>em(e)?e[e.length-1]||0:e;function rm(e){const t=lg(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const nm=e=>(t,r)=>{const n=(0,o.useContext)(Pp),i=(0,o.useContext)(Mp),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,i,o){const a={latestValues:im(n,i,o,e),renderState:t()};return r&&(a.mount=e=>r(n,e,a)),a}(e,t,n,i);return r?a():Qg(a)};function im(e,t,r,n){const i={},o=n(e,{});for(const h in o)i[h]=rm(o[h]);let{initial:a,animate:s}=e;const l=Wp(e),c=Gp(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===s&&(s=t.animate));let u=!!r&&!1===r.initial;u=u||!1===a;const d=u?s:a;return d&&"boolean"!=typeof d&&!Vp(d)&&(Array.isArray(d)?d:[d]).forEach(t=>{const r=Jg(e,t);if(!r)return;const{transitionEnd:n,transition:o,...a}=r;for(const e in a){let t=a[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(i[e]=t)}for(const e in n)i[e]=n[e]}),i}const om=e=>e;class am{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const sm=["prepare","read","update","preRender","render","postRender"],{schedule:lm,cancel:cm,state:um}=function(e){let t=!1,r=!0;const n={delta:0,timestamp:0,isProcessing:!1},i=sm.reduce((e,r)=>(e[r]=function(e){let t=new am,r=new am,n=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(e,o=!1,s=!1)=>{const l=s&&i,c=l?t:r;return o&&a.add(e),c.add(e)&&l&&i&&(n=t.order.length),e},cancel:e=>{r.remove(e),a.delete(e)},process:l=>{if(i)o=!0;else{if(i=!0,[t,r]=[r,t],r.clear(),n=t.order.length,n)for(let r=0;r<n;r++){const n=t.order[r];n(l),a.has(n)&&(s.schedule(n),e())}i=!1,o&&(o=!1,s.process(l))}}};return s}(()=>t=!0),e),{}),o=e=>i[e].process(n),a=()=>{const i=performance.now();t=!1,n.delta=r?1e3/60:Math.max(Math.min(i-n.timestamp,40),1),n.timestamp=i,n.isProcessing=!0,sm.forEach(o),n.isProcessing=!1,t&&(r=!1,e(a))};return{schedule:sm.reduce((o,s)=>{const l=i[s];return o[s]=(i,o=!1,s=!1)=>(t||(t=!0,r=!0,n.isProcessing||e(a)),l.schedule(i,o,s)),o},{}),cancel:e=>sm.forEach(t=>i[t].cancel(e)),state:n,steps:i}}(typeof requestAnimationFrame<"u"?requestAnimationFrame:om),dm={useVisualState:nm({scrapeMotionValuesFromProps:Zg,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onMount:(e,t,{renderState:r,latestValues:n})=>{lm.read(()=>{try{r.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),lm.render(()=>{Hg(r,n,{enableHardwareAcceleration:!1},$g(t.tagName),e.transformTemplate),Xg(t,r)})}})},hm={useVisualState:nm({scrapeMotionValuesFromProps:Kg,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function fm(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function pm(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}function gm(e,t,r,n){return fm(e,t,(e=>t=>(e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary)(t)&&e(t,pm(t)))(r),n)}const mm=(e,t)=>r=>t(e(r)),vm=(...e)=>e.reduce(mm);function ym(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const bm=ym("dragHorizontal"),wm=ym("dragVertical");function xm(){const e=function(){let e=!1;{const t=bm(),r=wm();t&&r?e=()=>{t(),r()}:(t&&t(),r&&r())}return e}();return!e||(e(),!1)}class Cm{constructor(e){this.isMounted=!1,this.node=e}update(){}}function _m(e,t){const r="pointer"+(t?"enter":"leave"),n="onHover"+(t?"Start":"End");return gm(e.current,r,(r,i)=>{if("touch"===r.pointerType||xm())return;const o=e.getProps();e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",t),o[n]&&lm.update(()=>o[n](r,i))},{passive:!e.getProps()[n]})}const Sm=(e,t)=>!!t&&(e===t||Sm(e,t.parentElement));function Am(e,t){if(!t)return;const r=new PointerEvent("pointer"+e);t(r,pm(r))}const km=new WeakMap,Em=new WeakMap,Im=e=>{const t=km.get(e.target);t&&t(e)},jm=e=>{e.forEach(Im)};const Tm={some:0,all:1},Fm={inView:{Feature:class extends Cm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:i}=e,o={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:Tm[n]};return function(e,t,r){const n=function({root:e,...t}){const r=e||document;Em.has(r)||Em.set(r,{});const n=Em.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(jm,{root:e,...t})),n[i]}(t);return km.set(e,r),n.observe(e),()=>{km.delete(e),n.unobserve(e)}}(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),o=t?r:n;o&&o(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Cm{constructor(){super(...arguments),this.removeStartListeners=om,this.removeEndListeners=om,this.removeAccessibleListeners=om,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),n=gm(window,"pointerup",(e,t)=>{if(!this.checkPressEnd())return;const{onTap:r,onTapCancel:n,globalTapTarget:i}=this.node.getProps();lm.update(()=>{i||Sm(this.node.current,e.target)?r&&r(e,t):n&&n(e,t)})},{passive:!(r.onTap||r.onPointerUp)}),i=gm(window,"pointercancel",(e,t)=>this.cancelPress(e,t),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=vm(n,i),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=fm(this.node.current,"keydown",e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=fm(this.node.current,"keyup",e=>{"Enter"!==e.key||!this.checkPressEnd()||Am("up",(e,t)=>{const{onTap:r}=this.node.getProps();r&&lm.update(()=>r(e,t))})}),Am("down",(e,t)=>{this.startPress(e,t)}))}),t=fm(this.node.current,"blur",()=>{this.isPressing&&Am("cancel",(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=vm(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:r,whileTap:n}=this.node.getProps();n&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&lm.update(()=>r(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!xm()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&lm.update(()=>r(e,t))}mount(){const e=this.node.getProps(),t=gm(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=fm(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=vm(t,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Cm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=vm(fm(this.node.current,"focus",()=>this.onFocus()),fm(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Cm{mount(){this.unmount=vm(_m(this.node,!0),_m(this.node,!1))}unmount(){}}}};function Om(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Pm(e,t,r){const n=e.getProps();return Jg(n,t,void 0!==r?r:n.custom,function(e){const t={};return e.values.forEach((e,r)=>t[r]=e.get()),t}(e),function(e){const t={};return e.values.forEach((e,r)=>t[r]=e.getVelocity()),t}(e))}let Mm=om;const Rm=e=>1e3*e,Lm=e=>e/1e3,Nm=e=>Array.isArray(e)&&"number"==typeof e[0];function Dm(e){return!!(!e||"string"==typeof e&&Bm[e]||Nm(e)||Array.isArray(e)&&e.every(Dm))}const zm=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Bm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zm([0,.65,.55,1]),circOut:zm([.55,0,1,.45]),backIn:zm([.31,.01,.66,-.59]),backOut:zm([.33,1.53,.69,.99])};function Um(e){if(e)return Nm(e)?zm(e):Array.isArray(e)?e.map(Um):Bm[e]}const Vm=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function Hm(e,t,r,n){if(e===t&&r===n)return om;const i=t=>function(e,t,r,n,i){let o,a,s=0;do{a=t+(r-t)/2,o=Vm(a,n,i)-e,o>0?r=a:t=a}while(Math.abs(o)>1e-7&&++s<12);return a}(t,0,1,e,r);return e=>0===e||1===e?e:Vm(i(e),t,n)}const $m=Hm(.42,0,1,1),Wm=Hm(0,0,.58,1),Gm=Hm(.42,0,.58,1),qm=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ym=e=>t=>1-e(1-t),Xm=e=>1-Math.sin(Math.acos(e)),Km=Ym(Xm),Zm=qm(Xm),Jm=Hm(.33,1.53,.69,.99),Qm=Ym(Jm),ev=qm(Qm),tv={linear:om,easeIn:$m,easeInOut:Gm,easeOut:Wm,circIn:Xm,circInOut:Zm,circOut:Km,backIn:Qm,backInOut:ev,backOut:Jm,anticipate:e=>(e*=2)<1?.5*Qm(e):.5*(2-Math.pow(2,-10*(e-1)))},rv=e=>{if(Array.isArray(e)){Mm(4===e.length);const[t,r,n,i]=e;return Hm(t,r,n,i)}return"string"==typeof e?tv[e]:e},nv=(e,t)=>r=>!!(_g(r)&&Cg.test(r)&&r.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(r,t)),iv=(e,t,r)=>n=>{if(!_g(n))return n;const[i,o,a,s]=n.match(wg);return{[e]:parseFloat(i),[t]:parseFloat(o),[r]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},ov={...mg,transform:e=>Math.round((e=>gg(0,255,e))(e))},av={test:nv("rgb","red"),parse:iv("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ov.transform(e)+", "+ov.transform(t)+", "+ov.transform(r)+", "+bg(vg.transform(n))+")"},sv={test:nv("#"),parse:function(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:av.transform},lv={test:nv("hsl","hue"),parse:iv("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+kg.transform(bg(t))+", "+kg.transform(bg(r))+", "+bg(vg.transform(n))+")"},cv={test:e=>av.test(e)||sv.test(e)||lv.test(e),parse:e=>av.test(e)?av.parse(e):lv.test(e)?lv.parse(e):sv.parse(e),transform:e=>_g(e)?e:e.hasOwnProperty("red")?av.transform(e):lv.transform(e)},uv=(e,t,r)=>-r*e+r*t+e;function dv(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}const hv=(e,t,r)=>{const n=e*e;return Math.sqrt(Math.max(0,r*(t*t-n)+n))},fv=[sv,av,lv];function pv(e){const t=(e=>fv.find(t=>t.test(e)))(e);let r=t.parse(e);return t===lv&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let i=0,o=0,a=0;if(t/=100){const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n;i=dv(s,n,e+1/3),o=dv(s,n,e),a=dv(s,n,e-1/3)}else i=o=a=r;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*a),alpha:n}}(r)),r}const gv=(e,t)=>{const r=pv(e),n=pv(t),i={...r};return e=>(i.red=hv(r.red,n.red,e),i.green=hv(r.green,n.green,e),i.blue=hv(r.blue,n.blue,e),i.alpha=uv(r.alpha,n.alpha,e),av.transform(i))},mv={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:om},vv={regex:xg,countKey:"Colors",token:"${c}",parse:cv.parse},yv={regex:wg,countKey:"Numbers",token:"${n}",parse:mg.parse};function bv(e,{regex:t,countKey:r,token:n,parse:i}){const o=e.tokenised.match(t);o&&(e["num"+r]=o.length,e.tokenised=e.tokenised.replace(t,n),e.values.push(...o.map(i)))}function wv(e){const t=e.toString(),r={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return r.value.includes("var(--")&&bv(r,mv),bv(r,vv),bv(r,yv),r}function xv(e){return wv(e).values}function Cv(e){const{values:t,numColors:r,numVars:n,tokenised:i}=wv(e),o=t.length;return e=>{let t=i;for(let i=0;i<o;i++)t=i<n?t.replace(mv.token,e[i]):i<n+r?t.replace(vv.token,cv.transform(e[i])):t.replace(yv.token,bg(e[i]));return t}}const _v=e=>"number"==typeof e?0:e,Sv={test:function(e){var t,r;return isNaN(e)&&_g(e)&&((null===(t=e.match(wg))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(xg))||void 0===r?void 0:r.length)||0)>0},parse:xv,createTransformer:Cv,getAnimatableNone:function(e){const t=xv(e);return Cv(e)(t.map(_v))}},Av=(e,t)=>r=>`${r>0?t:e}`;function kv(e,t){return"number"==typeof e?r=>uv(e,t,r):cv.test(e)?gv(e,t):e.startsWith("var(")?Av(e,t):jv(e,t)}const Ev=(e,t)=>{const r=[...e],n=r.length,i=e.map((e,r)=>kv(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=i[t](e);return r}},Iv=(e,t)=>{const r={...e,...t},n={};for(const i in r)void 0!==e[i]&&void 0!==t[i]&&(n[i]=kv(e[i],t[i]));return e=>{for(const t in n)r[t]=n[t](e);return r}},jv=(e,t)=>{const r=Sv.createTransformer(t),n=wv(e),i=wv(t);return n.numVars===i.numVars&&n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?vm(Ev(n.values,i.values),r):Av(e,t)},Tv=(e,t,r)=>{const n=t-e;return 0===n?1:(r-e)/n},Fv=(e,t)=>r=>uv(e,t,r);function Ov(e,t,{clamp:r=!0,ease:n,mixer:i}={}){const o=e.length;if(Mm(o===t.length),1===o)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,r){const n=[],i=r||function(e){return"number"==typeof e?Fv:"string"==typeof e?cv.test(e)?gv:jv:Array.isArray(e)?Ev:"object"==typeof e?Iv:Fv}(e[0]),o=e.length-1;for(let a=0;a<o;a++){let r=i(e[a],e[a+1]);if(t){const e=Array.isArray(t)?t[a]||om:t;r=vm(e,r)}n.push(r)}return n}(t,n,i),s=a.length,l=t=>{let r=0;if(s>1)for(;r<e.length-2&&!(t<e[r+1]);r++);const n=Tv(e[r],e[r+1],t);return a[r](n)};return r?t=>l(gg(e[0],e[o-1],t)):l}function Pv(e,t){return e.map(()=>t||Gm).splice(0,e.length-1)}function Mv({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(n)?n.map(rv):rv(n),o={done:!1,value:t[0]},a=function(e,t){return e.map(e=>e*t)}(r&&r.length===t.length?r:function(e){const t=[0];return function(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=Tv(0,t,n);e.push(uv(r,1,i))}}(t,e.length-1),t}(t),e),s=Ov(a,t,{ease:Array.isArray(i)?i:Pv(t,i)});return{calculatedDuration:e,next:t=>(o.value=s(t),o.done=t>=e,o)}}function Rv(e,t){return t?e*(1e3/t):0}function Lv(e,t,r){const n=Math.max(t-5,0);return Rv(r-e(n),t-n)}const Nv=.001;const Dv=12;function zv(e,t){return e*Math.sqrt(1-t*t)}const Bv=["duration","bounce"],Uv=["stiffness","damping","mass"];function Vv(e,t){return t.some(t=>void 0!==e[t])}function Hv({keyframes:e,restDelta:t,restSpeed:r,...n}){const i=e[0],o=e[e.length-1],a={done:!1,value:i},{stiffness:s,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Vv(e,Uv)&&Vv(e,Bv)){const r=function({duration:e=800,bounce:t=.25,velocity:r=0,mass:n=1}){let i,o,a=1-t;a=gg(.05,1,a),e=gg(.01,10,Lm(e)),a<1?(i=t=>{const n=t*a,i=n*e,o=n-r,s=zv(t,a),l=Math.exp(-i);return Nv-o/s*l},o=t=>{const n=t*a*e,o=n*r+r,s=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=zv(Math.pow(t,2),a);return(-i(t)+Nv>0?-1:1)*((o-s)*l)/c}):(i=t=>Math.exp(-t*e)*((t-r)*e+1)-Nv,o=t=>Math.exp(-t*e)*(e*e*(r-t)));const s=function(e,t,r){let n=r;for(let i=1;i<Dv;i++)n-=e(n)/t(n);return n}(i,o,5/e);if(e=Rm(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*n;return{stiffness:t,damping:2*a*Math.sqrt(n*t),duration:e}}}(e);t={...t,...r,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-Lm(n.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(s*c)),g=o-i,m=Lm(Math.sqrt(s/c)),v=Math.abs(g)<5;let y;if(r||(r=v?.01:2),t||(t=v?.005:.5),p<1){const e=zv(m,p);y=t=>{const r=Math.exp(-p*m*t);return o-r*((f+p*m*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===p)y=e=>o-Math.exp(-m*e)*(g+(f+m*g)*e);else{const e=m*Math.sqrt(p*p-1);y=t=>{const r=Math.exp(-p*m*t),n=Math.min(e*t,300);return o-r*((f+p*m*g)*Math.sinh(n)+e*g*Math.cosh(n))/e}}return{calculatedDuration:h&&u||null,next:e=>{const n=y(e);if(h)a.done=e>=u;else{let i=f;0!==e&&(i=p<1?Lv(y,e,n):0);const s=Math.abs(i)<=r,l=Math.abs(o-n)<=t;a.done=s&&l}return a.value=a.done?o:n,a}}}function $v({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let p=r*t;const g=d+p,m=void 0===a?g:a(g);m!==g&&(p=m-d);const v=e=>-p*Math.exp(-e/n),y=e=>m+v(e),b=e=>{const t=v(e),r=y(e);h.done=Math.abs(t)<=c,h.value=h.done?m:r};let w,x;const C=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(h.value)&&(w=e,x=Hv({keyframes:[h.value,f(h.value)],velocity:Lv(y,e,h.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&void 0===w&&(t=!0,b(e),C(e)),void 0!==w&&e>w?x.next(e-w):(!t&&b(e),h)}}}const Wv=e=>{const t=({timestamp:t})=>e(t);return{start:()=>lm.update(t,!0),stop:()=>cm(t),now:()=>um.isProcessing?um.timestamp:performance.now()}};function Gv(e){let t=0,r=e.next(t);for(;!r.done&&t<2e4;)t+=50,r=e.next(t);return t>=2e4?1/0:t}const qv={decay:$v,inertia:$v,tween:Mv,keyframes:Mv,spring:Hv};function Yv({autoplay:e=!0,delay:t=0,driver:r=Wv,keyframes:n,type:i="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f,p,g=1,m=!1;const v=()=>{p=new Promise(e=>{f=e})};let y;v();const b=qv[i]||Mv;let w;b!==Mv&&"number"!=typeof n[0]&&(w=Ov([0,100],n,{clamp:!1}),n=[0,100]);const x=b({...h,keyframes:n});let C;"mirror"===s&&(C=b({...h,keyframes:[...n].reverse(),velocity:-(h.velocity||0)}));let _="idle",S=null,A=null,k=null;null===x.calculatedDuration&&o&&(x.calculatedDuration=Gv(x));const{calculatedDuration:E}=x;let I=1/0,j=1/0;null!==E&&(I=E+a,j=I*(o+1)-a);let T=0;const F=e=>{if(null===A)return;g>0&&(A=Math.min(A,e)),g<0&&(A=Math.min(e-j/g,A)),T=null!==S?S:Math.round(e-A)*g;const r=T-t*(g>=0?1:-1),i=g>=0?r<0:r>j;T=Math.max(r,0),"finished"===_&&null===S&&(T=j);let l=T,c=x;if(o){const e=Math.min(T,j)/I;let t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,t=Math.min(t,o+1),!!(t%2)&&("reverse"===s?(r=1-r,a&&(r-=a/I)):"mirror"===s&&(c=C)),l=gg(0,1,r)*I}const u=i?{done:!1,value:n[0]}:c.next(l);w&&(u.value=w(u.value));let{done:h}=u;!i&&null!==E&&(h=g>=0?T>=j:T<=0);const f=null===S&&("finished"===_||"running"===_&&h);return d&&d(u.value),f&&M(),u},O=()=>{y&&y.stop(),y=void 0},P=()=>{_="idle",O(),f(),v(),A=k=null},M=()=>{_="finished",u&&u(),O(),f()},R=()=>{if(m)return;y||(y=r(F));const e=y.now();l&&l(),null!==S?A=e-S:(!A||"finished"===_)&&(A=e),"finished"===_&&v(),k=A,S=null,_="running",y.start()};e&&R();const L={then:(e,t)=>p.then(e,t),get time(){return Lm(T)},set time(e){e=Rm(e),T=e,null===S&&y&&0!==g?A=y.now()-e/g:S=e},get duration(){const e=null===x.calculatedDuration?Gv(x):x.calculatedDuration;return Lm(e)},get speed(){return g},set speed(e){e===g||!y||(g=e,L.time=Lm(T))},get state(){return _},play:R,pause:()=>{_="paused",S=T},stop:()=>{m=!0,"idle"!==_&&(_="idle",c&&c(),P())},cancel:()=>{null!==k&&F(k),P()},complete:()=>{_="finished"},sample:e=>(A=0,F(e))};return L}const Xv=function(){let e;return()=>(void 0===e&&(e=Object.hasOwnProperty.call(Element.prototype,"animate")),e)}(),Kv=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const Zv={type:"spring",stiffness:500,damping:25,restSpeed:10},Jv={type:"keyframes",duration:.8},Qv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ey=(e,{keyframes:t})=>t.length>2?Jv:ag.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):Zv:Qv,ty=(e,t)=>"zIndex"!==e&&!("number"!=typeof t&&!Array.isArray(t)&&("string"!=typeof t||!Sv.test(t)&&"0"!==t||t.startsWith("url("))),ry=new Set(["brightness","contrast","saturate","opacity"]);function ny(e){const[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[n]=r.match(wg)||[];if(!n)return e;const i=r.replace(n,"");let o=ry.has(t)?1:0;return n!==r&&(o*=100),t+"("+o+i+")"}const iy=/([a-z-]*)\(.*?\)/g,oy={...Sv,getAnimatableNone:e=>{const t=e.match(iy);return t?t.map(ny).join(" "):e}},ay={...Og,color:cv,backgroundColor:cv,outlineColor:cv,fill:cv,stroke:cv,borderColor:cv,borderTopColor:cv,borderRightColor:cv,borderBottomColor:cv,borderLeftColor:cv,filter:oy,WebkitFilter:oy},sy=e=>ay[e];function ly(e,t){let r=sy(e);return r!==oy&&(r=Sv),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const cy=e=>/^0[^.\s]+$/.test(e);function uy(e){return"number"==typeof e?0===e:null!==e?"none"===e||"0"===e||cy(e):void 0}function dy(e,t){return e[t]||e.default||e}const hy=(e,t,r,n={})=>i=>{const o=dy(n,e)||{},a=o.delay||n.delay||0;let{elapsed:s=0}=n;s-=Rm(a);const l=function(e,t,r,n){const i=ty(t,r);let o;o=Array.isArray(r)?[...r]:[null,r];const a=void 0!==n.from?n.from:e.get();let s;const l=[];for(let c=0;c<o.length;c++)null===o[c]&&(o[c]=0===c?a:o[c-1]),uy(o[c])&&l.push(c),"string"==typeof o[c]&&"none"!==o[c]&&"0"!==o[c]&&(s=o[c]);if(i&&l.length&&s)for(let c=0;c<l.length;c++)o[l[c]]=ly(t,s);return o}(t,e,r,o),c=l[0],u=l[l.length-1],d=ty(e,c),h=ty(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-s,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length}(o)||(f={...f,...ey(e,f)}),f.duration&&(f.duration=Rm(f.duration)),f.repeatDelay&&(f.repeatDelay=Rm(f.repeatDelay)),!d||!h||!1===o.type)return function({keyframes:e,delay:t,onUpdate:r,onComplete:n}){const i=()=>(r&&r(e[e.length-1]),n&&n(),{time:0,speed:1,duration:0,play:om,pause:om,stop:om,then:e=>(e(),Promise.resolve()),cancel:om,complete:om});return t?Yv({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}(f);if(!n.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const r=function(e,t,{onUpdate:r,onComplete:n,...i}){if(!Xv()||!Kv.has(t)||i.repeatDelay||"mirror"===i.repeatType||0===i.damping||"inertia"===i.type)return!1;let o,a,s=!1,l=!1;const c=()=>{a=new Promise(e=>{o=e})};c();let{keyframes:u,duration:d=300,ease:h,times:f}=i;if(((e,t)=>"spring"===t.type||"backgroundColor"===e||!Dm(t.ease))(t,i)){const e=Yv({...i,repeat:0,delay:0});let t={done:!1,value:u[0]};const r=[];let n=0;for(;!t.done&&n<2e4;)t=e.sample(n),r.push(t.value),n+=10;f=void 0,u=r,d=n-10,h="linear"}const p=function(e,t,r,{delay:n=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){const c={[t]:r};l&&(c.offset=l);const u=Um(s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"})}(e.owner.current,t,u,{...i,duration:d,ease:h,times:f}),g=()=>{l=!1,p.cancel()},m=()=>{l=!0,lm.update(g),o(),c()};return p.onfinish=()=>{l||(e.set(function(e,{repeat:t,repeatType:r="loop"}){return e[t&&"loop"!==r&&t%2==1?0:e.length-1]}(u,i)),n&&n(),m())},{then:(e,t)=>a.then(e,t),attachTimeline:e=>(p.timeline=e,p.onfinish=null,om),get time(){return Lm(p.currentTime||0)},set time(e){p.currentTime=Rm(e)},get speed(){return p.playbackRate},set speed(e){p.playbackRate=e},get duration(){return Lm(d)},play:()=>{s||(p.play(),cm(g))},pause:()=>p.pause(),stop:()=>{if(s=!0,"idle"===p.playState)return;const{currentTime:t}=p;if(t){const r=Yv({...i,autoplay:!1});e.setWithVelocity(r.sample(t-10).value,r.sample(t).value,10)}m()},complete:()=>{l||p.finish()},cancel:m}}(t,e,f);if(r)return r}return Yv(f)};function fy(e){return!(!lg(e)||!e.add)}const py=e=>/^\-?\d*\.?\d+$/.test(e);class gy{constructor(){this.subscriptions=[]}add(e){return function(e,t){-1===e.indexOf(t)&&e.push(t)}(this.subscriptions,e),()=>function(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}(this.subscriptions,e)}notify(e,t,r){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class my{constructor(e,t={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{this.prev=this.current,this.current=e;const{delta:r,timestamp:n}=um;this.lastUpdated!==n&&(this.timeDelta=r,this.lastUpdated=n,lm.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>lm.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new gy);const r=this.events[e].add(t);return"change"===e?()=>{r(),lm.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,r){this.set(t),this.prev=e,this.timeDelta=r}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Rv(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function vy(e,t){return new my(e,t)}const yy=e=>t=>t.test(e),by=[mg,Eg,kg,Ag,jg,Ig,{test:e=>"auto"===e,parse:e=>e}],wy=e=>by.find(yy(e)),xy=[...by,cv,Sv],Cy=e=>xy.find(yy(e));function _y(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,vy(r))}function Sy(e,t){return t?(t[e]||t.default||t).from:void 0}function Ay({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}function ky(e,t){const r=e.get();if(!Array.isArray(t))return r!==t;for(let n=0;n<t.length;n++)if(t[n]!==r)return!0}function Ey(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");n&&(o=n);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in s){const t=e.getValue(d),n=s[d];if(!t||void 0===n||u&&Ay(u,d))continue;const i={delay:r,elapsed:0,...dy(o||{},d)};if(window.HandoffAppearAnimations){const r=e.getProps()[zp];if(r){const e=window.HandoffAppearAnimations(r,d,t,lm);null!==e&&(i.elapsed=e,i.isHandoff=!0)}}let a=!i.isHandoff&&!ky(t,n);if("spring"===i.type&&(t.getVelocity()||i.velocity)&&(a=!1),t.animation&&(a=!1),a)continue;t.start(hy(d,t,n,e.shouldReduceMotion&&ag.has(d)?{type:!1}:i));const h=t.animation;fy(l)&&(l.add(d),h.then(()=>l.remove(d))),c.push(h)}return a&&Promise.all(c).then(()=>{a&&function(e,t){const r=Pm(e,t);let{transitionEnd:n={},transition:i={},...o}=r?e.makeTargetAnimatable(r,!1):{};o={...o,...n};for(const a in o)_y(e,a,tm(o[a]))}(e,a)}),c}function Iy(e,t,r={}){const n=Pm(e,t,r.custom);let{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);const o=n?()=>Promise.all(Ey(e,n,r)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:a,staggerDirection:s}=i;return function(e,t,r=0,n=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*n,l=1===i?(e=0)=>e*n:(e=0)=>s-e*n;return Array.from(e.variantChildren).sort(jy).forEach((e,n)=>{e.notify("AnimationStart",t),a.push(Iy(e,t,{...o,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(a)}(e,t,o+n,a,s,r)}:()=>Promise.resolve(),{when:s}=i;if(s){const[e,t]="beforeChildren"===s?[o,a]:[a,o];return e().then(()=>t())}return Promise.all([o(),a(r.delay)])}function jy(e,t){return e.sortNodePosition(t)}const Ty=[...Hp].reverse(),Fy=Hp.length;function Oy(e){let t=function(e){return t=>Promise.all(t.map(({animation:t,options:r})=>function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t)){const i=t.map(t=>Iy(e,t,r));n=Promise.all(i)}else if("string"==typeof t)n=Iy(e,t,r);else{const i="function"==typeof t?Pm(e,t,r.custom):t;n=Promise.all(Ey(e,i,r))}return n.then(()=>e.notify("AnimationComplete",t))}(e,t,r)))}(e);const r={animate:My(!0),whileInView:My(),whileHover:My(),whileTap:My(),whileDrag:My(),whileFocus:My(),exit:My()};let n=!0;const i=(t,r)=>{const n=Pm(e,r);if(n){const{transition:e,transitionEnd:r,...i}=n;t={...t,...i,...r}}return t};function o(o,a){const s=e.getProps(),l=e.getVariantContext(!0)||{},c=[],u=new Set;let d={},h=1/0;for(let t=0;t<Fy;t++){const f=Ty[t],p=r[f],g=void 0!==s[f]?s[f]:l[f],m=Up(g),v=f===a?p.isActive:null;!1===v&&(h=t);let y=g===l[f]&&g!==s[f]&&m;if(y&&n&&e.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...d},!p.isActive&&null===v||!g&&!p.prevProp||Vp(g)||"boolean"==typeof g)continue;let b=Py(p.prevProp,g)||f===a&&p.isActive&&!y&&m||t>h&&m,w=!1;const x=Array.isArray(g)?g:[g];let C=x.reduce(i,{});!1===v&&(C={});const{prevResolvedValues:_={}}=p,S={..._,...C},A=e=>{b=!0,u.has(e)&&(w=!0,u.delete(e)),p.needsAnimating[e]=!0};for(const e in S){const t=C[e],r=_[e];if(d.hasOwnProperty(e))continue;let n=!1;n=em(t)&&em(r)?!Om(t,r):t!==r,n?void 0!==t?A(e):u.add(e):void 0!==t&&u.has(e)?A(e):p.protectedKeys[e]=!0}p.prevProp=g,p.prevResolvedValues=C,p.isActive&&(d={...d,...C}),n&&e.blockInitialAnimation&&(b=!1),b&&(!y||w)&&c.push(...x.map(e=>({animation:e,options:{type:f,...o}})))}if(u.size){const t={};u.forEach(r=>{const n=e.getBaseTarget(r);void 0!==n&&(t[r]=n)}),c.push({animation:t})}let f=!!c.length;return n&&(!1===s.initial||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(f=!1),n=!1,f?t(c):Promise.resolve()}return{animateChanges:o,setActive:function(t,n,i){var a;if(r[t].isActive===n)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;const s=o(i,t);for(const e in r)r[e].protectedKeys={};return s},setAnimateFunction:function(r){t=r(e)},getState:()=>r}}function Py(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Om(t,e)}function My(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let Ry=0;const Ly={animation:{Feature:class extends Cm{constructor(e){super(e),e.animationState||(e.animationState=Oy(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Vp(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends Cm{constructor(){super(...arguments),this.id=Ry++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e,{custom:r??this.node.getProps().custom});t&&!e&&i.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Ny=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Dy(e,t,r=1){const[n,i]=function(e){const t=Ny.exec(e);if(!t)return[,];const[,r,n]=t;return[r,n]}(e);if(!n)return;const o=window.getComputedStyle(t).getPropertyValue(n);if(o){const e=o.trim();return py(e)?parseFloat(e):e}return fg(i)?Dy(i,t,r+1):i}const zy=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),By=e=>zy.has(e),Uy=e=>e===mg||e===Eg,Vy=(e,t)=>parseFloat(e.split(", ")[t]),Hy=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return Vy(i[1],t);{const t=n.match(/^matrix\((.+)\)$/);return t?Vy(t[1],e):0}},$y=new Set(["x","y","z"]),Wy=og.filter(e=>!$y.has(e)),Gy={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Hy(4,13),y:Hy(5,14)};Gy.translateX=Gy.x,Gy.translateY=Gy.y;function qy(e,t,r,n){return(e=>Object.keys(e).some(By))(t)?((e,t,r={},n={})=>{t={...t},n={...n};const i=Object.keys(t).filter(By);let o=[],a=!1;const s=[];if(i.forEach(i=>{const l=e.getValue(i);if(!e.hasValue(i))return;let c=r[i],u=wy(c);const d=t[i];let h;if(em(d)){const e=d.length,t=null===d[0]?1:0;c=d[t],u=wy(c);for(let r=t;r<e&&null!==d[r];r++)h?Mm(wy(d[r])===h):h=wy(d[r])}else h=wy(d);if(u!==h)if(Uy(u)&&Uy(h)){const e=l.get();"string"==typeof e&&l.set(parseFloat(e)),"string"==typeof d?t[i]=parseFloat(d):Array.isArray(d)&&h===Eg&&(t[i]=d.map(parseFloat))}else null!=u&&u.transform&&null!=h&&h.transform&&(0===c||0===d)?0===c?l.set(h.transform(c)):t[i]=u.transform(d):(a||(o=function(e){const t=[];return Wy.forEach(r=>{const n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),a=!0),s.push(i),n[i]=void 0!==n[i]?n[i]:t[i],l.jump(d))}),s.length){const r=s.indexOf("height")>=0?window.pageYOffset:null,i=((e,t,r)=>{const n=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),r.forEach(e=>{s[e]=Gy[e](n,o)}),t.render();const l=t.measureViewportBox();return r.forEach(r=>{const n=t.getValue(r);n&&n.jump(s[r]),e[r]=Gy[r](l,o)}),e})(t,e,s);return o.length&&o.forEach(([t,r])=>{e.getValue(t).set(r)}),e.render(),Rp&&null!==r&&window.scrollTo({top:r}),{target:i,transitionEnd:n}}return{target:t,transitionEnd:n}})(e,t,r,n):{target:t,transitionEnd:n}}const Yy={current:null},Xy={current:!1},Ky=new WeakMap,Zy=Object.keys(Xp),Jy=Zy.length,Qy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],eb=$p.length;class tb{constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>lm.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=s,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=Wp(t),this.isVariantNode=Gp(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:l,...c}=this.scrapeMotionValuesFromProps(t,{});for(const u in c){const e=c[u];void 0!==a[u]&&lg(e)&&(e.set(a[u],!1),fy(l)&&l.add(u))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,Ky.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),Xy.current||function(){if(Xy.current=!0,Rp)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Yy.current=e.matches;e.addListener(t),t()}else Yy.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Yy.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ky.delete(this.current),this.projection&&this.projection.unmount(),cm(this.notifyUpdate),cm(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const r=ag.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&lm.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{n(),i()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},r,n,i){let o,a;for(let s=0;s<Jy;s++){const e=Zy[s],{isEnabled:r,Feature:n,ProjectionNode:i,MeasureLayout:l}=Xp[e];i&&(o=i),r(t)&&(!this.features[e]&&n&&(this.features[e]=new n(this)),l&&(a=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:r,drag:n,dragConstraints:a,layoutScroll:s,layoutRoot:l}=t;this.projection.setOptions({layoutId:e,layout:r,alwaysMeasureLayout:!!n||a&&Bp(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof r?r:"both",initialPromotionConfig:i,layoutScroll:s,layoutRoot:l})}return a}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let r=0;r<Qy.length;r++){const t=Qy[r];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const n=e["on"+t];n&&(this.propEventSubscriptions[t]=this.on(t,n))}this.prevMotionValues=function(e,t,r){const{willChange:n}=t;for(const i in t){const o=t[i],a=r[i];if(lg(o))e.addValue(i,o),fy(n)&&n.add(i);else if(lg(a))e.addValue(i,vy(o,{owner:e})),fy(n)&&n.remove(i);else if(a!==o)if(e.hasValue(i)){const t=e.getValue(i);!t.hasAnimated&&t.set(o)}else{const t=e.getStaticValue(i);e.addValue(i,vy(void 0!==t?t:o,{owner:e}))}}for(const i in r)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}const t={};for(let r=0;r<eb;r++){const e=$p[r],n=this.props[e];(Up(n)||!1===n)&&(t[e]=n)}return t}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=vy(t,{owner:this}),this.addValue(e,r)),r}readValue(e){var t;return void 0===this.latestValues[e]&&this.current?null!==(t=this.getBaseTargetFromProps(this.props,e))&&void 0!==t?t:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:r}=this.props,n="string"==typeof r||"object"==typeof r?null===(t=Jg(this.props,r))||void 0===t?void 0:t[e]:void 0;if(r&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,e);return void 0===i||lg(i)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new gy),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class rb extends tb{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...r},{transformValues:n},i){let o=function(e,t,r){const n={};for(const i in e){const e=Sy(i,t);if(void 0!==e)n[i]=e;else{const e=r.getValue(i);e&&(n[i]=e.get())}}return n}(r,e||{},this);if(n&&(t&&(t=n(t)),r&&(r=n(r)),o&&(o=n(o))),i){!function(e,t,r){var n,i;const o=Object.keys(t).filter(t=>!e.hasValue(t)),a=o.length;if(a)for(let s=0;s<a;s++){const a=o[s],l=t[a];let c=null;Array.isArray(l)&&(c=l[0]),null===c&&(c=null!==(i=null!==(n=r[a])&&void 0!==n?n:e.readValue(a))&&void 0!==i?i:t[a]),null!=c&&("string"==typeof c&&(py(c)||cy(c))?c=parseFloat(c):!Cy(c)&&Sv.test(l)&&(c=ly(a,l)),e.addValue(a,vy(c,{owner:e})),void 0===r[a]&&(r[a]=c),null!==c&&e.setBaseTarget(a,c))}}(this,r,o);const e=((e,t,r,n)=>{const i=function(e,{...t},r){const n=e.current;if(!(n instanceof Element))return{target:t,transitionEnd:r};r&&(r={...r}),e.values.forEach(e=>{const t=e.get();if(!fg(t))return;const r=Dy(t,n);r&&e.set(r)});for(const i in t){const e=t[i];if(!fg(e))continue;const o=Dy(e,n);o&&(t[i]=o,r||(r={}),void 0===r[i]&&(r[i]=e))}return{target:t,transitionEnd:r}}(e,t,n);return qy(e,t=i.target,r,n=i.transitionEnd)})(this,r,o,t);t=e.transitionEnd,r=e.target}return{transition:e,transitionEnd:t,...r}}}class nb extends rb{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(ag.has(t)){const e=sy(t);return e&&e.default||0}{const r=function(e){return window.getComputedStyle(e)}(e),n=(hg(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return function(e,t){return function({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}(function(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}(e,t)}build(e,t,r,n){Pg(e,t,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,t){return Kg(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;lg(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}renderInstance(e,t,r,n){qg(e,t,r,n)}}class ib extends rb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ag.has(t)){const e=sy(t);return e&&e.default||0}return t=Yg.has(t)?t:Dp(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t){return Zg(e,t)}build(e,t,r,n){Hg(e,t,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,r,n){Xg(e,t,0,n)}mount(e){this.isSVGTag=$g(e.tagName),super.mount(e)}}const ob=function(){function e(e,t={}){return eg(function(e,{forwardMotionProps:t=!1},r,n){return{...ng(e)?dm:hm,preloadedFeatures:r,useRender:Gg(t),createVisualElement:n,Component:e}}(e,t))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(r,n)=>(t.has(n)||t.set(n,e(n)),t.get(n))})}();function ab(){const e=(0,o.useRef)(!1);return Lp(()=>(e.current=!0,()=>{e.current=!1}),[]),e}class sb extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function lb({children:e,isPresent:t}){const r=(0,o.useId)(),n=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0});return(0,o.useInsertionEffect)(()=>{const{width:e,height:o,top:a,left:s}=i.current;if(t||!n.current||!e||!o)return;n.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[t]),o.createElement(sb,{isPresent:t,childRef:n,sizeRef:i},o.cloneElement(e,{ref:n}))}const cb=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:s})=>{const l=Qg(ub),c=(0,o.useId)(),u=(0,o.useMemo)(()=>({id:c,initial:t,isPresent:r,custom:i,onExitComplete:e=>{l.set(e,!0);for(const t of l.values())if(!t)return;n&&n()},register:e=>(l.set(e,!1),()=>l.delete(e))}),a?void 0:[r]);return(0,o.useMemo)(()=>{l.forEach((e,t)=>l.set(t,!1))},[r]),o.useEffect(()=>{!r&&!l.size&&n&&n()},[r]),"popLayout"===s&&(e=o.createElement(lb,{isPresent:r},e)),o.createElement(Mp.Provider,{value:u},e)};function ub(){return new Map}const db=e=>e.key||"",hb=({children:e,custom:t,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:a=!0,mode:s="sync"})=>{const l=(0,o.useContext)(Zp).forceRender||function(){const e=ab(),[t,r]=(0,o.useState)(0),n=(0,o.useCallback)(()=>{e.current&&r(t+1)},[t]);return[(0,o.useCallback)(()=>lm.postRender(n),[n]),t]}()[0],c=ab(),u=function(e){const t=[];return o.Children.forEach(e,e=>{(0,o.isValidElement)(e)&&t.push(e)}),t}(e);let d=u;const h=(0,o.useRef)(new Map).current,f=(0,o.useRef)(d),p=(0,o.useRef)(new Map).current,g=(0,o.useRef)(!0);if(Lp(()=>{g.current=!1,function(e,t){e.forEach(e=>{const r=db(e);t.set(r,e)})}(u,p),f.current=d}),(0,o.useEffect)(()=>()=>(g.current=!0,p.clear(),void h.clear()),[]),g.current)return o.createElement(o.Fragment,null,d.map(e=>o.createElement(cb,{key:db(e),isPresent:!0,initial:!!r&&void 0,presenceAffectsLayout:a,mode:s},e)));d=[...d];const m=f.current.map(db),v=u.map(db),y=m.length;for(let o=0;o<y;o++){const e=m[o];-1===v.indexOf(e)&&!h.has(e)&&h.set(e,void 0)}return"wait"===s&&h.size&&(d=[]),h.forEach((e,r)=>{if(-1!==v.indexOf(r))return;const i=p.get(r);if(!i)return;const g=m.indexOf(r);let y=e;if(!y){const e=()=>{h.delete(r);const e=Array.from(p.keys()).filter(e=>!v.includes(e));if(e.forEach(e=>p.delete(e)),f.current=u.filter(t=>{const n=db(t);return n===r||e.includes(n)}),!h.size){if(!1===c.current)return;l(),n&&n()}};y=o.createElement(cb,{key:db(i),isPresent:!1,onExitComplete:e,custom:t,presenceAffectsLayout:a,mode:s},i),h.set(r,y)}d.splice(g,0,y)}),d=d.map(e=>{const t=e.key;return h.has(t)?e:o.createElement(cb,{key:db(e),isPresent:!0,presenceAffectsLayout:a,mode:s},e)}),o.createElement(o.Fragment,null,h.size?d:d.map(e=>(0,o.cloneElement)(e)))};function fb({children:e,features:t,strict:r=!1}){const[,n]=(0,o.useState)(!pb(t)),i=(0,o.useRef)(void 0);if(!pb(t)){const{renderer:e,...r}=t;i.current=e,Kp(r)}return(0,o.useEffect)(()=>{pb(t)&&t().then(({renderer:e,...t})=>{Kp(t),i.current=e,n(!0)})},[]),o.createElement(Np.Provider,{value:{renderer:i.current,strict:r}},e)}function pb(e){return"function"==typeof e}const gb={renderer:(e,t)=>ng(e)?new ib(t,{enableHardwareAcceleration:!1}):new nb(t,{enableHardwareAcceleration:!0}),...Ly,...Fm},mb=typeof document<"u"?o.useLayoutEffect:()=>{},vb=o.createContext(!1);function yb(){return!1}function bb(){return!0}function wb(e){return()=>{}}function xb(){return"function"==typeof o.useSyncExternalStore?o.useSyncExternalStore(wb,yb,bb):(0,o.useContext)(vb)}o.useId;let Cb=new Map;function _b(e,t){if(e===t)return e;let r=Cb.get(e);if(r)return r(t),t;let n=Cb.get(t);return n?(n(e),e):t}function Sb(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}const Ab=e=>{var t;return null!==(t=null==e?void 0:e.ownerDocument)&&void 0!==t?t:document},kb=e=>e&&"window"in e&&e.window===e?e:Ab(e).defaultView||window;function Eb(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let e in n){let r=t[e],i=n[e];"function"==typeof r&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=Sb(r,i):"className"!==e&&"UNSAFE_className"!==e||"string"!=typeof r||"string"!=typeof i?"id"===e&&r&&i?t.id=_b(r,i):t[e]=void 0!==i?i:r:t[e]=od(r,i)}}return t}function Ib(e){if(function(){if(null==jb){jb=!1;try{document.createElement("div").focus({get preventScroll(){return jb=!0,!0}})}catch{}}return jb}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}(e);e.focus(),function(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}(t)}}let jb=null;function Tb(){return function(){var e;return typeof window<"u"&&null!=window.navigator&&/^Mac/i.test((null===(e=window.navigator.userAgentData)||void 0===e?void 0:e.platform)||window.navigator.platform)}()}let Fb=new Map,Ob=new Set;function Pb(){if(typeof window>"u")return;function e(e){return"propertyName"in e}let t=r=>{if(!e(r)||!r.target)return;let n=Fb.get(r.target);if(n&&(n.delete(r.propertyName),0===n.size&&(r.target.removeEventListener("transitioncancel",t),Fb.delete(r.target)),0===Fb.size)){for(let e of Ob)e();Ob.clear()}};document.body.addEventListener("transitionrun",r=>{if(!e(r)||!r.target)return;let n=Fb.get(r.target);n||(n=new Set,Fb.set(r.target,n),r.target.addEventListener("transitioncancel",t,{once:!0})),n.add(r.propertyName)}),document.body.addEventListener("transitionend",t)}function Mb(){let e=(0,o.useRef)(new Map),t=(0,o.useCallback)((t,r,n,i)=>{let o=null!=i&&i.once?(...t)=>{e.current.delete(n),n(...t)}:n;e.current.set(n,{type:r,eventTarget:t,fn:o,options:i}),t.addEventListener(r,n,i)},[]),r=(0,o.useCallback)((t,r,n,i)=>{var o;let a=(null===(o=e.current.get(n))||void 0===o?void 0:o.fn)||n;t.removeEventListener(r,a,i),e.current.delete(n)},[]),n=(0,o.useCallback)(()=>{e.current.forEach((e,t)=>{r(e.eventTarget,e.type,t,e.options)})},[r]);return(0,o.useEffect)(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function Rb(e){const t=(0,o.useRef)(null);return(0,o.useMemo)(()=>({get current(){return t.current},set current(r){t.current=r,"function"==typeof e?e(r):e&&(e.current=r)}}),[e])}typeof document<"u"&&("loading"!==document.readyState?Pb():document.addEventListener("DOMContentLoaded",Pb));let Lb=typeof document<"u"&&window.visualViewport;function Nb(){return{width:Lb&&(null==Lb?void 0:Lb.width)||window.innerWidth,height:Lb&&(null==Lb?void 0:Lb.height)||window.innerHeight}}function Db(e,t,r){let[n,i]=(0,o.useState)(e||t),a=(0,o.useRef)(void 0!==e),s=void 0!==e;(0,o.useEffect)(()=>{a.current;a.current=s},[s]);let l=s?e:n,c=(0,o.useCallback)((e,...t)=>{let n=(e,...t)=>{r&&(Object.is(l,e)||r(e,...t)),s||(l=e)};"function"==typeof e?i((r,...i)=>{let o=e(s?l:r,...i);return n(o,...t),s?r:o}):(s||i(e),n(e,...t))},[s,l,r]);return[l,c]}function zb(e,t=-1/0,r=1/0){return Math.min(Math.max(e,t),r)}function Bb(e,t){let r=e,n=t.toString(),i=n.indexOf("."),o=i>=0?n.length-i:0;if(o>0){let e=Math.pow(10,o);r=Math.round(r*e)/e}return r}function Ub(e,t,r=10){const n=Math.pow(r,t);return Math.round(e*n)/n}var Vb={};const Hb=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));!function(e){var t=t||{version:"5.3.0"};if(e.fabric=t,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?t.document=document:t.document=document.implementation.createHTMLDocument(""),t.window=window;else{var r=new Hb.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;t.document=r.document,t.jsdomImplForWrapper=Hb.implForWrapper,t.nodeCanvas=Hb.Canvas,t.window=r,DOMParser=t.window.DOMParser}function n(e,t){var r=e.canvas,n=t.targetCanvas,i=n.getContext("2d");i.translate(0,n.height),i.scale(1,-1);var o=r.height-n.height;i.drawImage(r,0,o,n.width,n.height,0,0,n.width,n.height)}function i(e,t){var r=t.targetCanvas.getContext("2d"),n=t.destinationWidth,i=t.destinationHeight,o=n*i*4,a=new Uint8Array(this.imageBuffer,0,o),s=new Uint8ClampedArray(this.imageBuffer,0,o);e.readPixels(0,0,n,i,e.RGBA,e.UNSIGNED_BYTE,a);var l=new ImageData(s,n,i);r.putImageData(l,0,0)}t.isTouchSupported="ontouchstart"in t.window||"ontouchstart"in t.document||t.window&&t.window.navigator&&t.window.navigator.maxTouchPoints>0,t.isLikelyNode=typeof he<"u"&&typeof window>"u",t.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],t.DPI=96,t.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",t.commaWsp="(?:\\s+,?\\s*|,\\s*)",t.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,t.reNonWord=/[ \n\.,;!\?\-]/,t.fontPaths={},t.iMatrix=[1,0,0,1,0,0],t.svgNS="http://www.w3.org/2000/svg",t.perfLimitSizeTotal=2097152,t.maxCacheSideLimit=4096,t.minCacheSideLimit=256,t.charWidthsCache={},t.textureSize=2048,t.disableStyleCopyPaste=!1,t.enableGLFiltering=!0,t.devicePixelRatio=t.window.devicePixelRatio||t.window.webkitDevicePixelRatio||t.window.mozDevicePixelRatio||1,t.browserShadowBlurConstant=1,t.arcToSegmentsCache={},t.boundsOfCurveCache={},t.cachesBoundsOfCurve=!0,t.forceGLPutImageData=!1,t.initFilterBackend=function(){return t.enableGLFiltering&&t.isWebglSupported&&t.isWebglSupported(t.textureSize)?new t.WebglFilterBackend({tileSize:t.textureSize}):t.Canvas2dFilterBackend?new t.Canvas2dFilterBackend:void 0},typeof document<"u"&&typeof window<"u"&&(window.fabric=t),function(){function e(e,r){if(this.__eventListeners[e]){var n=this.__eventListeners[e];r?n[n.indexOf(r)]=!1:t.util.array.fill(n,!1)}}function r(e,t){var r=function(){t.apply(this,arguments),this.off(e,r)}.bind(this);this.on(e,r)}t.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var r=this.__eventListeners[e];if(!r)return this;for(var n=0,i=r.length;n<i;n++)r[n]&&r[n].call(this,t||{});return this.__eventListeners[e]=r.filter(function(e){return!1!==e}),this},on:function(e,t){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var r in e)this.on(r,e[r]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},once:function(e,t){if(1===arguments.length)for(var n in e)r.call(this,n,e[n]);else r.call(this,e,t);return this},off:function(t,r){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)e.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var n in t)e.call(this,n,t[n]);else e.call(this,t,r);return this}}}(),t.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,r){var n=this._objects;return r?n[t]=e:n.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,r=!1,n=0,i=arguments.length;n<i;n++)-1!==(e=t.indexOf(arguments[n]))&&(r=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[n]));return this.renderOnAddRemove&&r&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var r=this.getObjects(),n=0,i=r.length;n<i;n++)e.call(t,r[n],n,r);return this},getObjects:function(e){return typeof e>"u"?this._objects.concat():this._objects.filter(function(t){return t.type===e})},item:function(e){return this._objects[e]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e,t){return this._objects.indexOf(e)>-1||!!t&&this._objects.some(function(t){return"function"==typeof t.contains&&t.contains(e,!0)})},complexity:function(){return this._objects.reduce(function(e,t){return e+(t.complexity?t.complexity():0)},0)}},t.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,r){e&&e.colorStops&&!(e instanceof t.Gradient)&&this.set(r,new t.Gradient(e))},_initPattern:function(e,r,n){!e||!e.source||e instanceof t.Pattern?n&&n():this.set(r,new t.Pattern(e,n))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return"object"==typeof e?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return"boolean"==typeof t&&this.set(e,!t),this},get:function(e){return this[e]}},function(e){var r=Math.sqrt,n=Math.atan2,i=Math.pow,o=Math.PI/180,a=Math.PI/2;t.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/a){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(0===e)return 0;var t=1;switch(e<0&&(t=-1),e/a){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var r=e.indexOf(t);return-1!==r&&e.splice(r,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*o},radiansToDegrees:function(e){return e/o},rotatePoint:function(e,r,n){var i=new t.Point(e.x-r.x,e.y-r.y),o=t.util.rotateVector(i,n);return new t.Point(o.x,o.y).addEquals(r)},rotateVector:function(e,r){var n=t.util.sin(r),i=t.util.cos(r);return{x:e.x*i-e.y*n,y:e.x*n+e.y*i}},createVector:function(e,r){return new t.Point(r.x-e.x,r.y-e.y)},calcAngleBetweenVectors:function(e,t){return Math.acos((e.x*t.x+e.y*t.y)/(Math.hypot(e.x,e.y)*Math.hypot(t.x,t.y)))},getHatVector:function(e){return new t.Point(e.x,e.y).multiply(1/Math.hypot(e.x,e.y))},getBisector:function(e,r,n){var i=t.util.createVector(e,r),o=t.util.createVector(e,n),a=t.util.calcAngleBetweenVectors(i,o),s=a*(0===t.util.calcAngleBetweenVectors(t.util.rotateVector(i,a),o)?1:-1)/2;return{vector:t.util.getHatVector(t.util.rotateVector(i,s)),angle:a}},projectStrokeOnPoints:function(e,r,n){var i=[],o=r.strokeWidth/2,a=r.strokeUniform?new t.Point(1/r.scaleX,1/r.scaleY):new t.Point(1,1),s=function(e){var r=o/Math.hypot(e.x,e.y);return new t.Point(e.x*r*a.x,e.y*r*a.y)};return e.length<=1||e.forEach(function(l,c){var u,d,h=new t.Point(l.x,l.y);0===c?(d=e[c+1],u=n?s(t.util.createVector(d,h)).addEquals(h):e[e.length-1]):c===e.length-1?(u=e[c-1],d=n?s(t.util.createVector(u,h)).addEquals(h):e[0]):(u=e[c-1],d=e[c+1]);var f,p,g=t.util.getBisector(h,u,d),m=g.vector,v=g.angle;if("miter"===r.strokeLineJoin&&(f=-o/Math.sin(v/2),p=new t.Point(m.x*f*a.x,m.y*f*a.y),Math.hypot(p.x,p.y)/o<=r.strokeMiterLimit))return i.push(h.add(p)),void i.push(h.subtract(p));f=-o*Math.SQRT2,p=new t.Point(m.x*f*a.x,m.y*f*a.y),i.push(h.add(p)),i.push(h.subtract(p))}),i},transformPoint:function(e,r,n){return n?new t.Point(r[0]*e.x+r[2]*e.y,r[1]*e.x+r[3]*e.y):new t.Point(r[0]*e.x+r[2]*e.y+r[4],r[1]*e.x+r[3]*e.y+r[5])},makeBoundingBoxFromPoints:function(e,r){if(r)for(var n=0;n<e.length;n++)e[n]=t.util.transformPoint(e[n],r);var i=[e[0].x,e[1].x,e[2].x,e[3].x],o=t.util.array.min(i),a=t.util.array.max(i)-o,s=[e[0].y,e[1].y,e[2].y,e[3].y],l=t.util.array.min(s);return{left:o,top:l,width:a,height:t.util.array.max(s)-l}},invertTransform:function(e){var r=1/(e[0]*e[3]-e[1]*e[2]),n=[r*e[3],-r*e[1],-r*e[2],r*e[0]],i=t.util.transformPoint({x:e[4],y:e[5]},n,!0);return n[4]=-i.x,n[5]=-i.y,n},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,r){var n=/\D{0,2}$/.exec(e),i=parseFloat(e);switch(r||(r=t.Text.DEFAULT_SVG_FONT_SIZE),n[0]){case"mm":return i*t.DPI/25.4;case"cm":return i*t.DPI/2.54;case"in":return i*t.DPI;case"pt":return i*t.DPI/72;case"pc":return i*t.DPI/72*12;case"em":return i*r;default:return i}},falseFunction:function(){return!1},getKlass:function(e,r){return e=t.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),t.util.resolveNamespace(r)[e]},getSvgAttributes:function(e){var t=["instantiated_by_use","style","id","class"];switch(e){case"linearGradient":t=t.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":t=t.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":t=t.concat(["offset","stop-color","stop-opacity"])}return t},resolveNamespace:function(r){if(!r)return t;var n,i=r.split("."),o=i.length,a=e||t.window;for(n=0;n<o;++n)a=a[i[n]];return a},loadImage:function(e,r,n,i){if(e){var o=t.util.createImage(),a=function(){r&&r.call(n,o,!1),o=o.onload=o.onerror=null};o.onload=a,o.onerror=function(){t.log("Error loading "+o.src),r&&r.call(n,null,!0),o=o.onload=o.onerror=null},0!==e.indexOf("data")&&null!=i&&(o.crossOrigin=i),"data:image/svg"===e.substring(0,14)&&(o.onload=null,t.util.loadImageInDom(o,a)),o.src=e}else r&&r.call(n,e)},loadImageInDom:function(e,r){var n=t.document.createElement("div");n.style.width=n.style.height="1px",n.style.left=n.style.top="-100%",n.style.position="absolute",n.appendChild(e),t.document.querySelector("body").appendChild(n),e.onload=function(){r(),n.parentNode.removeChild(n),n=null}},enlivenObjects:function(e,r,n,i){var o=[],a=0,s=(e=e||[]).length;function l(){++a===s&&r&&r(o.filter(function(e){return e}))}s?e.forEach(function(e,r){e&&e.type?t.util.getKlass(e.type,n).fromObject(e,function(t,n){n||(o[r]=t),i&&i(e,t,n),l()}):l()}):r&&r(o)},enlivenObjectEnlivables:function(e,r,n){var i=t.Object.ENLIVEN_PROPS.filter(function(t){return!!e[t]});t.util.enlivenObjects(i.map(function(t){return e[t]}),function(e){var t={};i.forEach(function(n,i){t[n]=e[i],r&&(r[n]=e[i])}),n&&n(t)})},enlivenPatterns:function(e,r){function n(){++o===a&&r&&r(i)}var i=[],o=0,a=(e=e||[]).length;a?e.forEach(function(e,r){e&&e.source?new t.Pattern(e,function(e){i[r]=e,n()}):(i[r]=e,n())}):r&&r(i)},groupSVGElements:function(e,r,n){var i;return e&&1===e.length?(typeof n<"u"&&(e[0].sourcePath=n),e[0]):(r&&(r.width&&r.height?r.centerPoint={x:r.width/2,y:r.height/2}:(delete r.width,delete r.height)),i=new t.Group(e,r),typeof n<"u"&&(i.sourcePath=n),i)},populateWithProperties:function(e,t,r){if(r&&Array.isArray(r))for(var n=0,i=r.length;n<i;n++)r[n]in e&&(t[r[n]]=e[r[n]])},createCanvasElement:function(){return t.document.createElement("canvas")},copyCanvasElement:function(e){var r=t.util.createCanvasElement();return r.width=e.width,r.height=e.height,r.getContext("2d").drawImage(e,0,0),r},toDataURL:function(e,t,r){return e.toDataURL("image/"+t,r)},createImage:function(){return t.document.createElement("img")},multiplyTransformMatrices:function(e,t,r){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],r?0:e[0]*t[4]+e[2]*t[5]+e[4],r?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=n(e[1],e[0]),a=i(e[0],2)+i(e[1],2),s=r(a),l=(e[0]*e[3]-e[2]*e[1])/s,c=n(e[0]*e[2]+e[1]*e[3],a);return{angle:t/o,scaleX:s,scaleY:l,skewX:c/o,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return t.iMatrix.concat();var r=t.util.degreesToRadians(e.angle),n=t.util.cos(r),i=t.util.sin(r);return[n,i,-i,n,0,0]},calcDimensionsMatrix:function(e){var r=typeof e.scaleX>"u"?1:e.scaleX,n=typeof e.scaleY>"u"?1:e.scaleY,i=[e.flipX?-r:r,0,0,e.flipY?-n:n,0,0],o=t.util.multiplyTransformMatrices,a=t.util.degreesToRadians;return e.skewX&&(i=o(i,[1,0,Math.tan(a(e.skewX)),1],!0)),e.skewY&&(i=o(i,[1,Math.tan(a(e.skewY)),0,1],!0)),i},composeMatrix:function(e){var r=[1,0,0,1,e.translateX||0,e.translateY||0],n=t.util.multiplyTransformMatrices;return e.angle&&(r=n(r,t.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(r=n(r,t.util.calcDimensionsMatrix(e))),r},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,r,n){n>0&&(t>n?t-=n:t=0,r>n?r-=n:r=0);var i,o=!0,a=e.getImageData(t,r,2*n||1,2*n||1),s=a.data.length;for(i=3;i<s&&!1!==(o=a.data[i]<=0);i+=4);return a=null,o},parsePreserveAspectRatioAttribute:function(e){var t,r="meet",n=e.split(" ");return n&&n.length&&("meet"!==(r=n.pop())&&"slice"!==r?(t=r,r="meet"):n.length&&(t=n.pop())),{meetOrSlice:r,alignX:"none"!==t?t.slice(1,4):"none",alignY:"none"!==t?t.slice(5,8):"none"}},clearFabricFontCache:function(e){(e=(e||"").toLowerCase())?t.charWidthsCache[e]&&delete t.charWidthsCache[e]:t.charWidthsCache={}},limitDimsByArea:function(e,t){var r=Math.sqrt(t*e),n=Math.floor(t/r);return{x:Math.floor(r),y:n}},capValue:function(e,t,r){return Math.max(e,Math.min(t,r))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return"matrix("+e.map(function(e){return t.util.toFixed(e,t.Object.NUM_FRACTION_DIGITS)}).join(" ")+")"},removeTransformFromObject:function(e,r){var n=t.util.invertTransform(r),i=t.util.multiplyTransformMatrices(n,e.calcOwnMatrix());t.util.applyTransformToObject(e,i)},addTransformToObject:function(e,r){t.util.applyTransformToObject(e,t.util.multiplyTransformMatrices(r,e.calcOwnMatrix()))},applyTransformToObject:function(e,r){var n=t.util.qrDecompose(r),i=new t.Point(n.translateX,n.translateY);e.flipX=!1,e.flipY=!1,e.set("scaleX",n.scaleX),e.set("scaleY",n.scaleY),e.skewX=n.skewX,e.skewY=n.skewY,e.angle=n.angle,e.setPositionByOrigin(i,"center","center")},sizeAfterTransform:function(e,r,n){var i=e/2,o=r/2,a=[{x:-i,y:-o},{x:i,y:-o},{x:-i,y:o},{x:i,y:o}],s=t.util.calcDimensionsMatrix(n),l=t.util.makeBoundingBoxFromPoints(a,s);return{x:l.width,y:l.height}},mergeClipPaths:function(e,r){var n=e,i=r;n.inverted&&!i.inverted&&(n=r,i=e),t.util.applyTransformToObject(i,t.util.multiplyTransformMatrices(t.util.invertTransform(n.calcTransformMatrix()),i.calcTransformMatrix()));var o=n.inverted&&i.inverted;return o&&(n.inverted=i.inverted=!1),new t.Group([n],{clipPath:i,inverted:o})},hasStyleChanged:function(e,t,r){return r=r||!1,e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.textBackgroundColor!==t.textBackgroundColor||e.deltaY!==t.deltaY||r&&(e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough)},stylesToArray:function(e,r){e=t.util.object.clone(e,!0);for(var n=r.split("\n"),i=-1,o={},a=[],s=0;s<n.length;s++)if(e[s])for(var l=0;l<n[s].length;l++){i++;var c=e[s][l];c&&Object.keys(c).length>0&&(t.util.hasStyleChanged(o,c,!0)?a.push({start:i,end:i+1,style:c}):a[a.length-1].end++),o=c||{}}else i+=n[s].length;return a},stylesFromArray:function(e,t){if(!Array.isArray(e))return e;for(var r=t.split("\n"),n=-1,i=0,o={},a=0;a<r.length;a++)for(var s=0;s<r[a].length;s++)n++,e[i]&&e[i].start<=n&&n<e[i].end&&(o[a]=o[a]||{},o[a][s]=Object.assign({},e[i].style),n===e[i].end-1&&i++);return o}}}(e),function(){var e=Array.prototype.join,r={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},n={m:"l",M:"L"};function i(e,r,n,i,o,a,s,l,c,u,d){var h=t.util.cos(e),f=t.util.sin(e),p=t.util.cos(r),g=t.util.sin(r),m=n*o*p-i*a*g+s,v=i*o*p+n*a*g+l;return["C",u+c*(-n*o*f-i*a*h),d+c*(-i*o*f+n*a*h),m+c*(n*o*g+i*a*p),v+c*(i*o*g-n*a*p),m,v]}function o(e,t,r,n){var i=Math.atan2(t,e),o=Math.atan2(n,r);return o>=i?o-i:2*Math.PI-(i-o)}function a(e,r,n){for(var a=n[1],s=n[2],l=n[3],c=n[4],u=n[5],d=function(e,r,n,a,s,l,c){var u=Math.PI,d=c*u/180,h=t.util.sin(d),f=t.util.cos(d),p=0,g=0,m=-f*e*.5-h*r*.5,v=-f*r*.5+h*e*.5,y=(n=Math.abs(n))*n,b=(a=Math.abs(a))*a,w=v*v,x=m*m,C=y*b-y*w-b*x,_=0;if(C<0){var S=Math.sqrt(1-C/(y*b));n*=S,a*=S}else _=(s===l?-1:1)*Math.sqrt(C/(y*w+b*x));var A=_*n*v/a,k=-_*a*m/n,E=f*A-h*k+.5*e,I=h*A+f*k+.5*r,j=o(1,0,(m-A)/n,(v-k)/a),T=o((m-A)/n,(v-k)/a,(-m-A)/n,(-v-k)/a);0===l&&T>0?T-=2*u:1===l&&T<0&&(T+=2*u);for(var F=Math.ceil(Math.abs(T/u*2)),O=[],P=T/F,M=8/3*Math.sin(P/4)*Math.sin(P/4)/Math.sin(P/2),R=j+P,L=0;L<F;L++)O[L]=i(j,R,f,h,n,a,E,I,M,p,g),p=O[L][5],g=O[L][6],j=R,R+=P;return O}(n[6]-e,n[7]-r,a,s,c,u,l),h=0,f=d.length;h<f;h++)d[h][1]+=e,d[h][2]+=r,d[h][3]+=e,d[h][4]+=r,d[h][5]+=e,d[h][6]+=r;return d}function s(e,t,r,n){return Math.sqrt((r-e)*(r-e)+(n-t)*(n-t))}function l(e,t,r,n,i,o,a,s){return function(l){var c=function(e){return e*e*e}(l),u=function(e){return 3*e*e*(1-e)}(l),d=function(e){return 3*e*(1-e)*(1-e)}(l),h=function(e){return(1-e)*(1-e)*(1-e)}(l);return{x:a*c+i*u+r*d+e*h,y:s*c+o*u+n*d+t*h}}}function c(e,t,r,n,i,o,a,s){return function(l){var c=1-l,u=3*c*c*(r-e)+6*c*l*(i-r)+3*l*l*(a-i),d=3*c*c*(n-t)+6*c*l*(o-n)+3*l*l*(s-o);return Math.atan2(d,u)}}function u(e,t,r,n,i,o){return function(a){var s=function(e){return e*e}(a),l=function(e){return 2*e*(1-e)}(a),c=function(e){return(1-e)*(1-e)}(a);return{x:i*s+r*l+e*c,y:o*s+n*l+t*c}}}function d(e,t,r,n,i,o){return function(a){var s=1-a,l=2*s*(r-e)+2*a*(i-r),c=2*s*(n-t)+2*a*(o-n);return Math.atan2(c,l)}}function h(e,t,r){var n,i,o={x:t,y:r},a=0;for(i=1;i<=100;i+=1)n=e(i/100),a+=s(o.x,o.y,n.x,n.y),o=n;return a}function f(e,t){for(var r,n,i,o=0,a=0,l=e.iterator,c={x:e.x,y:e.y},u=.01,d=e.angleFinder;a<t&&u>1e-4;)r=l(o),i=o,(n=s(c.x,c.y,r.x,r.y))+a>t?(o-=u,u/=2):(c=r,o+=u,a+=n);return r.angle=d(i),r}function p(e){for(var t,r,n,i,o=0,a=e.length,f=0,p=0,g=0,m=0,v=[],y=0;y<a;y++){switch(n={x:f,y:p,command:(t=e[y])[0]},t[0]){case"M":n.length=0,g=f=t[1],m=p=t[2];break;case"L":n.length=s(f,p,t[1],t[2]),f=t[1],p=t[2];break;case"C":r=l(f,p,t[1],t[2],t[3],t[4],t[5],t[6]),i=c(f,p,t[1],t[2],t[3],t[4],t[5],t[6]),n.iterator=r,n.angleFinder=i,n.length=h(r,f,p),f=t[5],p=t[6];break;case"Q":r=u(f,p,t[1],t[2],t[3],t[4]),i=d(f,p,t[1],t[2],t[3],t[4]),n.iterator=r,n.angleFinder=i,n.length=h(r,f,p),f=t[3],p=t[4];break;case"Z":case"z":n.destX=g,n.destY=m,n.length=s(f,p,g,m),f=g,p=m}o+=n.length,v.push(n)}return v.push({length:o,x:f,y:p}),v}t.util.joinPath=function(e){return e.map(function(e){return e.join(" ")}).join(" ")},t.util.parsePath=function(e){var i,o,a,s,l,c=[],u=[],d=t.rePathCommand,h="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+h+")"+t.commaWsp,p="([01])"+t.commaWsp+"?",g=new RegExp(f+"?"+f+"?"+f+p+p+f+"?("+h+")","g");if(!e||!e.match)return c;for(var m,v=0,y=(l=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;v<y;v++){s=(i=l[v]).slice(1).trim(),u.length=0;var b=i.charAt(0);if(m=[b],"a"===b.toLowerCase())for(var w;w=g.exec(s);)for(var x=1;x<w.length;x++)u.push(w[x]);else for(;a=d.exec(s);)u.push(a[0]);x=0;for(var C=u.length;x<C;x++)o=parseFloat(u[x]),isNaN(o)||m.push(o);var _=r[b.toLowerCase()],S=n[b]||b;if(m.length-1>_)for(var A=1,k=m.length;A<k;A+=_)c.push([b].concat(m.slice(A,A+_))),b=S;else c.push(m)}return c},t.util.makePathSimpler=function(e){var t,r,n,i,o,s,l=0,c=0,u=e.length,d=0,h=0,f=[];for(r=0;r<u;++r){switch(n=!1,(t=e[r].slice(0))[0]){case"l":t[0]="L",t[1]+=l,t[2]+=c;case"L":l=t[1],c=t[2];break;case"h":t[1]+=l;case"H":t[0]="L",t[2]=c,l=t[1];break;case"v":t[1]+=c;case"V":t[0]="L",c=t[1],t[1]=l,t[2]=c;break;case"m":t[0]="M",t[1]+=l,t[2]+=c;case"M":l=t[1],c=t[2],d=t[1],h=t[2];break;case"c":t[0]="C",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c,t[5]+=l,t[6]+=c;case"C":o=t[3],s=t[4],l=t[5],c=t[6];break;case"s":t[0]="S",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"S":"C"===i?(o=2*l-o,s=2*c-s):(o=l,s=c),l=t[3],c=t[4],t[0]="C",t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=o,t[2]=s,o=t[3],s=t[4];break;case"q":t[0]="Q",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"Q":o=t[1],s=t[2],l=t[3],c=t[4];break;case"t":t[0]="T",t[1]+=l,t[2]+=c;case"T":"Q"===i?(o=2*l-o,s=2*c-s):(o=l,s=c),t[0]="Q",l=t[1],c=t[2],t[1]=o,t[2]=s,t[3]=l,t[4]=c;break;case"a":t[0]="A",t[6]+=l,t[7]+=c;case"A":n=!0,f=f.concat(a(l,c,t)),l=t[6],c=t[7];break;case"z":case"Z":l=d,c=h}n||f.push(t),i=t[0]}return f},t.util.getSmoothPathFromPoints=function(e,r){var n,i=[],o=new t.Point(e[0].x,e[0].y),a=new t.Point(e[1].x,e[1].y),s=e.length,l=1,c=0,u=s>2;for(r=r||0,u&&(l=e[2].x<a.x?-1:e[2].x===a.x?0:1,c=e[2].y<a.y?-1:e[2].y===a.y?0:1),i.push(["M",o.x-l*r,o.y-c*r]),n=1;n<s;n++){if(!o.eq(a)){var d=o.midPointFrom(a);i.push(["Q",o.x,o.y,d.x,d.y])}o=e[n],n+1<e.length&&(a=e[n+1])}return u&&(l=o.x>e[n-2].x?1:o.x===e[n-2].x?0:-1,c=o.y>e[n-2].y?1:o.y===e[n-2].y?0:-1),i.push(["L",o.x+l*r,o.y+c*r]),i},t.util.getPathSegmentsInfo=p,t.util.getBoundsOfCurve=function(r,n,i,o,a,s,l,c){var u;if(t.cachesBoundsOfCurve&&(u=e.call(arguments),t.boundsOfCurveCache[u]))return t.boundsOfCurveCache[u];var d,h,f,p,g,m,v,y,b=Math.sqrt,w=Math.min,x=Math.max,C=Math.abs,_=[],S=[[],[]];h=6*r-12*i+6*a,d=-3*r+9*i-9*a+3*l,f=3*i-3*r;for(var A=0;A<2;++A)if(A>0&&(h=6*n-12*o+6*s,d=-3*n+9*o-9*s+3*c,f=3*o-3*n),C(d)<1e-12){if(C(h)<1e-12)continue;0<(p=-f/h)&&p<1&&_.push(p)}else!((v=h*h-4*f*d)<0)&&(0<(g=(-h+(y=b(v)))/(2*d))&&g<1&&_.push(g),0<(m=(-h-y)/(2*d))&&m<1&&_.push(m));for(var k,E,I,j=_.length,T=j;j--;)k=(I=1-(p=_[j]))*I*I*r+3*I*I*p*i+3*I*p*p*a+p*p*p*l,S[0][j]=k,E=I*I*I*n+3*I*I*p*o+3*I*p*p*s+p*p*p*c,S[1][j]=E;S[0][T]=r,S[1][T]=n,S[0][T+1]=l,S[1][T+1]=c;var F=[{x:w.apply(null,S[0]),y:w.apply(null,S[1])},{x:x.apply(null,S[0]),y:x.apply(null,S[1])}];return t.cachesBoundsOfCurve&&(t.boundsOfCurveCache[u]=F),F},t.util.getPointOnPath=function(e,r,n){n||(n=p(e));for(var i=0;r-n[i].length>0&&i<n.length-2;)r-=n[i].length,i++;var o,a=n[i],s=r/a.length,l=a.command,c=e[i];switch(l){case"M":return{x:a.x,y:a.y,angle:0};case"Z":case"z":return(o=new t.Point(a.x,a.y).lerp(new t.Point(a.destX,a.destY),s)).angle=Math.atan2(a.destY-a.y,a.destX-a.x),o;case"L":return(o=new t.Point(a.x,a.y).lerp(new t.Point(c[1],c[2]),s)).angle=Math.atan2(c[2]-a.y,c[1]-a.x),o;case"C":case"Q":return f(a,r)}},t.util.transformPath=function(e,r,n){return n&&(r=t.util.multiplyTransformMatrices(r,[1,0,0,1,-n.x,-n.y])),e.map(function(e){for(var n=e.slice(0),i={},o=1;o<e.length-1;o+=2)i.x=e[o],i.y=e[o+1],i=t.util.transformPoint(i,r),n[o]=i.x,n[o+1]=i.y;return n})}}(),function(){var e=Array.prototype.slice;function r(e,t,r){if(e&&0!==e.length){var n=e.length-1,i=t?e[n][t]:e[n];if(t)for(;n--;)r(e[n][t],i)&&(i=e[n][t]);else for(;n--;)r(e[n],i)&&(i=e[n]);return i}}t.util.array={fill:function(e,t){for(var r=e.length;r--;)e[r]=t;return e},invoke:function(t,r){for(var n=e.call(arguments,2),i=[],o=0,a=t.length;o<a;o++)i[o]=n.length?t[o][r].apply(t[o],n):t[o][r].call(t[o]);return i},min:function(e,t){return r(e,t,function(e,t){return e<t})},max:function(e,t){return r(e,t,function(e,t){return e>=t})}}}(),function(){function e(r,n,i){if(i)if(!t.isLikelyNode&&n instanceof Element)r=n;else if(n instanceof Array){r=[];for(var o=0,a=n.length;o<a;o++)r[o]=e({},n[o],i)}else if(n&&"object"==typeof n)for(var s in n)"canvas"===s||"group"===s?r[s]=null:n.hasOwnProperty(s)&&(r[s]=e({},n[s],i));else r=n;else for(var s in n)r[s]=n[s];return r}t.util.object={extend:e,clone:function(t,r){return e({},t,r)}},t.util.object.extend(t.util,t.Observable)}(),function(){function e(e,t){var r=e.charCodeAt(t);if(isNaN(r))return"";if(r<55296||r>57343)return e.charAt(t);if(55296<=r&&r<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var n=e.charCodeAt(t+1);if(56320>n||n>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(0===t)throw"Low surrogate without preceding high surrogate";var i=e.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}t.util.string={camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},graphemeSplit:function(t){var r,n=0,i=[];for(n=0;n<t.length;n++)!1!==(r=e(t,n))&&i.push(r);return i}}}(),function(){var e=Array.prototype.slice,r=function(){},n=function(){for(var e in{toString:1})if("toString"===e)return!1;return!0}(),i=function(e,t,r){for(var i in t)i in e.prototype&&"function"==typeof e.prototype[i]&&(t[i]+"").indexOf("callSuper")>-1?e.prototype[i]=function(e){return function(){var n=this.constructor.superclass;this.constructor.superclass=r;var i=t[e].apply(this,arguments);if(this.constructor.superclass=n,"initialize"!==e)return i}}(i):e.prototype[i]=t[i],n&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function o(){}function a(t){for(var r=null,n=this;n.constructor.superclass;){var i=n.constructor.superclass.prototype[t];if(n[t]!==i){r=i;break}n=n.constructor.superclass.prototype}return r?arguments.length>1?r.apply(this,e.call(arguments,1)):r.call(this):void 0}t.util.createClass=function(){var t=null,n=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof n[0]&&(t=n.shift()),s.superclass=t,s.subclasses=[],t&&(o.prototype=t.prototype,s.prototype=new o,t.subclasses.push(s));for(var l=0,c=n.length;l<c;l++)i(s,n[l],t);return s.prototype.initialize||(s.prototype.initialize=r),s.prototype.constructor=s,s.prototype.callSuper=a,s}}(),function(){var e=!!t.document.createElement("div").attachEvent,r=["touchstart","touchmove","touchend"];t.util.addListener=function(t,r,n,i){t&&t.addEventListener(r,n,!e&&i)},t.util.removeListener=function(t,r,n,i){t&&t.removeEventListener(r,n,!e&&i)},t.util.getPointer=function(e){var r=e.target,n=t.util.getScrollLeftTop(r),i=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:i.clientX+n.left,y:i.clientY+n.top}},t.util.isTouchEvent=function(e){return r.indexOf(e.type)>-1||"touch"===e.pointerType}}(),function(){var e=t.document.createElement("div"),r="string"==typeof e.style.opacity,n="string"==typeof e.style.filter,i=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,o=function(e){return e};r?o=function(e,t){return e.style.opacity=t,e}:n&&(o=function(e,t){var r=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(r.zoom=1),i.test(r.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",r.filter=r.filter.replace(i,t)):r.filter+=" alpha(opacity="+100*t+")",e}),t.util.setStyle=function(e,t){var r=e.style;if(!r)return e;if("string"==typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?o(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var n in t)if("opacity"===n)o(e,t[n]);else{var i="float"===n||"cssFloat"===n?typeof r.styleFloat>"u"?"cssFloat":"styleFloat":n;r.setProperty(i,t[n])}return e}}(),function(){var e,r,n,i,o=Array.prototype.slice,a=function(e){return o.call(e,0)};try{e=a(t.document.childNodes)instanceof Array}catch{}function s(e,r){var n=t.document.createElement(e);for(var i in r)"class"===i?n.className=r[i]:"for"===i?n.htmlFor=r[i]:n.setAttribute(i,r[i]);return n}function l(e){for(var r=0,n=0,i=t.document.documentElement,o=t.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===t.document?(r=o.scrollLeft||i.scrollLeft||0,n=o.scrollTop||i.scrollTop||0):(r+=e.scrollLeft||0,n+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:r,top:n}}e||(a=function(e){for(var t=new Array(e.length),r=e.length;r--;)t[r]=e[r];return t}),r=t.document.defaultView&&t.document.defaultView.getComputedStyle?function(e,r){var n=t.document.defaultView.getComputedStyle(e,null);return n?n[r]:void 0}:function(e,t){var r=e.style[t];return!r&&e.currentStyle&&(r=e.currentStyle[t]),r},n=t.document.documentElement.style,i="userSelect"in n?"userSelect":"MozUserSelect"in n?"MozUserSelect":"WebkitUserSelect"in n?"WebkitUserSelect":"KhtmlUserSelect"in n?"KhtmlUserSelect":"",t.util.makeElementUnselectable=function(e){return typeof e.onselectstart<"u"&&(e.onselectstart=t.util.falseFunction),i?e.style[i]="none":"string"==typeof e.unselectable&&(e.unselectable="on"),e},t.util.makeElementSelectable=function(e){return typeof e.onselectstart<"u"&&(e.onselectstart=null),i?e.style[i]="":"string"==typeof e.unselectable&&(e.unselectable=""),e},t.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},t.util.getById=function(e){return"string"==typeof e?t.document.getElementById(e):e},t.util.toArray=a,t.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},t.util.makeElement=s,t.util.wrapElement=function(e,t,r){return"string"==typeof t&&(t=s(t,r)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},t.util.getScrollLeftTop=l,t.util.getElementOffset=function(e){var t,n,i=e&&e.ownerDocument,o={left:0,top:0},a={left:0,top:0},s={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!i)return a;for(var c in s)a[s[c]]+=parseInt(r(e,c),10)||0;return t=i.documentElement,typeof e.getBoundingClientRect<"u"&&(o=e.getBoundingClientRect()),n=l(e),{left:o.left+n.left-(t.clientLeft||0)+a.left,top:o.top+n.top-(t.clientTop||0)+a.top}},t.util.getNodeCanvas=function(e){var r=t.jsdomImplForWrapper(e);return r._canvas||r._image},t.util.cleanUpJsdomNode=function(e){if(t.isLikelyNode){var r=t.jsdomImplForWrapper(e);r&&(r._image=null,r._canvas=null,r._currentSrc=null,r._attributes=null,r._classList=null)}}}(),function(){function e(){}t.util.request=function(r,n){n||(n={});var i=n.method?n.method.toUpperCase():"GET",o=n.onComplete||function(){},a=new t.window.XMLHttpRequest,s=n.body||n.parameters;return a.onreadystatechange=function(){4===a.readyState&&(o(a),a.onreadystatechange=e)},"GET"===i&&(s=null,"string"==typeof n.parameters&&(r=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(r,n.parameters))),a.open(i,r,!0),("POST"===i||"PUT"===i)&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(s),a}}(),t.log=console.log,t.warn=console.warn,function(){var e=t.util.object.extend,r=t.util.object.clone,n=[];function i(){return!1}function o(e,t,r,n){return-r*Math.cos(e/n*(Math.PI/2))+r+t}t.util.object.extend(n,{cancelAll:function(){var e=this.splice(0);return e.forEach(function(e){e.cancel()}),e},cancelByCanvas:function(e){if(!e)return[];var t=this.filter(function(t){return"object"==typeof t.target&&t.target.canvas===e});return t.forEach(function(e){e.cancel()}),t},cancelByTarget:function(e){var t=this.findAnimationsByTarget(e);return t.forEach(function(e){e.cancel()}),t},findAnimationIndex:function(e){return this.indexOf(this.findAnimation(e))},findAnimation:function(e){return this.find(function(t){return t.cancel===e})},findAnimationsByTarget:function(e){return e?this.filter(function(t){return t.target===e}):[]}});var a=t.window.requestAnimationFrame||t.window.webkitRequestAnimationFrame||t.window.mozRequestAnimationFrame||t.window.oRequestAnimationFrame||t.window.msRequestAnimationFrame||function(e){return t.window.setTimeout(e,1e3/60)},s=t.window.cancelAnimationFrame||t.window.clearTimeout;function l(){return a.apply(t.window,arguments)}t.util.animate=function(n){n||(n={});var a,s=!1,c=function(){var e=t.runningAnimations.indexOf(a);return e>-1&&t.runningAnimations.splice(e,1)[0]};return a=e(r(n),{cancel:function(){return s=!0,c()},currentValue:"startValue"in n?n.startValue:0,completionRate:0,durationRate:0}),t.runningAnimations.push(a),l(function(e){var t,r=e||+new Date,u=n.duration||500,d=r+u,h=n.onChange||i,f=n.abort||i,p=n.onComplete||i,g=n.easing||o,m="startValue"in n&&n.startValue.length>0,v="startValue"in n?n.startValue:0,y="endValue"in n?n.endValue:100,b=n.byValue||(m?v.map(function(e,t){return y[t]-v[t]}):y-v);n.onStart&&n.onStart(),function e(n){var i=(t=n||+new Date)>d?u:t-r,o=i/u,w=m?v.map(function(e,t){return g(i,v[t],b[t],u)}):g(i,v,b,u),x=Math.abs(m?(w[0]-v[0])/b[0]:(w-v)/b);if(a.currentValue=m?w.slice():w,a.completionRate=x,a.durationRate=o,!s){if(f(w,x,o))return void c();if(t>d)return a.currentValue=m?y.slice():y,a.completionRate=1,a.durationRate=1,h(m?y.slice():y,1,1),p(y,1,1),void c();h(w,x,o),l(e)}}(r)}),a.cancel},t.util.requestAnimFrame=l,t.util.cancelAnimFrame=function(){return s.apply(t.window,arguments)},t.runningAnimations=n}(),function(){function e(e,t,r){var n="rgba("+parseInt(e[0]+r*(t[0]-e[0]),10)+","+parseInt(e[1]+r*(t[1]-e[1]),10)+","+parseInt(e[2]+r*(t[2]-e[2]),10);return(n+=","+(e&&t?parseFloat(e[3]+r*(t[3]-e[3])):1))+")"}t.util.animateColor=function(r,n,i,o){var a=new t.Color(r).getSource(),s=new t.Color(n).getSource(),l=o.onComplete,c=o.onChange;return o=o||{},t.util.animate(t.util.object.extend(o,{duration:i||500,startValue:a,endValue:s,byValue:s,easing:function(t,r,n,i){return e(r,n,o.colorEasing?o.colorEasing(t,i):1-Math.cos(t/i*(Math.PI/2)))},onComplete:function(t,r,n){if(l)return l(e(s,s,0),r,n)},onChange:function(t,r,n){if(c){if(Array.isArray(t))return c(e(t,t,0),r,n);c(t,r,n)}}}))}}(),function(){function e(e,t,r,n){return e<Math.abs(t)?(e=t,n=r/4):n=0===t&&0===e?r/(2*Math.PI)*Math.asin(1):r/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:r,s:n}}function r(e,t,r){return e.a*Math.pow(2,10*(t-=1))*Math.sin((t*r-e.s)*(2*Math.PI)/e.p)}function n(e,t,r,n){return r-i(n-e,0,r,n)+t}function i(e,t,r,n){return(e/=n)<1/2.75?r*(7.5625*e*e)+t:e<2/2.75?r*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?r*(7.5625*(e-=2.25/2.75)*e+.9375)+t:r*(7.5625*(e-=2.625/2.75)*e+.984375)+t}t.util.ease={easeInQuad:function(e,t,r,n){return r*(e/=n)*e+t},easeOutQuad:function(e,t,r,n){return-r*(e/=n)*(e-2)+t},easeInOutQuad:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e+t:-r/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,r,n){return r*(e/=n)*e*e+t},easeOutCubic:function(e,t,r,n){return r*((e=e/n-1)*e*e+1)+t},easeInOutCubic:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,r,n){return r*(e/=n)*e*e*e+t},easeOutQuart:function(e,t,r,n){return-r*((e=e/n-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e*e*e+t:-r/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,r,n){return r*(e/=n)*e*e*e*e+t},easeOutQuint:function(e,t,r,n){return r*((e=e/n-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e*e*e*e+t:r/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,r,n){return-r*Math.cos(e/n*(Math.PI/2))+r+t},easeOutSine:function(e,t,r,n){return r*Math.sin(e/n*(Math.PI/2))+t},easeInOutSine:function(e,t,r,n){return-r/2*(Math.cos(Math.PI*e/n)-1)+t},easeInExpo:function(e,t,r,n){return 0===e?t:r*Math.pow(2,10*(e/n-1))+t},easeOutExpo:function(e,t,r,n){return e===n?t+r:r*(1-Math.pow(2,-10*e/n))+t},easeInOutExpo:function(e,t,r,n){return 0===e?t:e===n?t+r:(e/=n/2)<1?r/2*Math.pow(2,10*(e-1))+t:r/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,r,n){return-r*(Math.sqrt(1-(e/=n)*e)-1)+t},easeOutCirc:function(e,t,r,n){return r*Math.sqrt(1-(e=e/n-1)*e)+t},easeInOutCirc:function(e,t,r,n){return(e/=n/2)<1?-r/2*(Math.sqrt(1-e*e)-1)+t:r/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(t,n,i,o){var a=0;return 0===t?n:1===(t/=o)?n+i:(a||(a=.3*o),-r(e(i,i,a,1.70158),t,o)+n)},easeOutElastic:function(t,r,n,i){var o=0;if(0===t)return r;if(1===(t/=i))return r+n;o||(o=.3*i);var a=e(n,n,o,1.70158);return a.a*Math.pow(2,-10*t)*Math.sin((t*i-a.s)*(2*Math.PI)/a.p)+a.c+r},easeInOutElastic:function(t,n,i,o){var a=0;if(0===t)return n;if(2===(t/=o/2))return n+i;a||(a=o*(.3*1.5));var s=e(i,i,a,1.70158);return t<1?-.5*r(s,t,o)+n:s.a*Math.pow(2,-10*(t-=1))*Math.sin((t*o-s.s)*(2*Math.PI)/s.p)*.5+s.c+n},easeInBack:function(e,t,r,n,i){return void 0===i&&(i=1.70158),r*(e/=n)*e*((i+1)*e-i)+t},easeOutBack:function(e,t,r,n,i){return void 0===i&&(i=1.70158),r*((e=e/n-1)*e*((i+1)*e+i)+1)+t},easeInOutBack:function(e,t,r,n,i){return void 0===i&&(i=1.70158),(e/=n/2)<1?r/2*(e*e*((1+(i*=1.525))*e-i))+t:r/2*((e-=2)*e*((1+(i*=1.525))*e+i)+2)+t},easeInBounce:n,easeOutBounce:i,easeInOutBounce:function(e,t,r,o){return e<o/2?.5*n(2*e,0,r,o)+t:.5*i(2*e-o,0,r,o)+.5*r+t}}}(),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.util.object.clone,i=t.util.toFixed,o=t.util.parseUnit,a=t.util.multiplyTransformMatrices,s={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},l={stroke:"strokeOpacity",fill:"fillOpacity"},c="font-size",u="clip-path";function d(e){return e in s?s[e]:e}function h(e,r,n,i){var s,l=Array.isArray(r);if("fill"!==e&&"stroke"!==e||"none"!==r){if("strokeUniform"===e)return"non-scaling-stroke"===r;if("strokeDashArray"===e)r="none"===r?null:r.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===e)r=n&&n.transformMatrix?a(n.transformMatrix,t.parseTransformAttribute(r)):t.parseTransformAttribute(r);else if("visible"===e)r="none"!==r&&"hidden"!==r,n&&!1===n.visible&&(r=!1);else if("opacity"===e)r=parseFloat(r),n&&typeof n.opacity<"u"&&(r*=n.opacity);else if("textAnchor"===e)r="start"===r?"left":"end"===r?"right":"center";else if("charSpacing"===e)s=o(r,i)/i*1e3;else if("paintFirst"===e){var c=r.indexOf("fill"),u=r.indexOf("stroke");r="fill",(c>-1&&u>-1&&u<c||-1===c&&u>-1)&&(r="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return r;if("imageSmoothing"===e)return"optimizeQuality"===r;s=l?r.map(o):o(r,i)}}else r="";return!l&&isNaN(s)?r:s}function f(e){return new RegExp("^("+e.join("|")+")\\b","i")}function p(e,t){var r,n,i,o,a=[];for(i=0,o=t.length;i<o;i++)r=t[i],n=e.getElementsByTagName(r),a=a.concat(Array.prototype.slice.call(n));return a}function g(e,t){var r,n=!0;return(r=m(e,t.pop()))&&t.length&&(n=function(e,t){for(var r,n=!0;e.parentNode&&1===e.parentNode.nodeType&&t.length;)n&&(r=t.pop()),n=m(e=e.parentNode,r);return 0===t.length}(e,t)),r&&n&&0===t.length}function m(e,t){var r,n,i=e.nodeName,o=e.getAttribute("class"),a=e.getAttribute("id");if(r=new RegExp("^"+i,"i"),t=t.replace(r,""),a&&t.length&&(r=new RegExp("#"+a+"(?![a-zA-Z\\-]+)","i"),t=t.replace(r,"")),o&&t.length)for(n=(o=o.split(" ")).length;n--;)r=new RegExp("\\."+o[n]+"(?![a-zA-Z\\-]+)","i"),t=t.replace(r,"");return 0===t.length}function v(e,t){var r;if(e.getElementById&&(r=e.getElementById(t)),r)return r;var n,i,o,a=e.getElementsByTagName("*");for(i=0,o=a.length;i<o;i++)if(t===(n=a[i]).getAttribute("id"))return n}t.svgValidTagNamesRegEx=f(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),t.svgViewBoxElementsRegEx=f(["symbol","image","marker","pattern","view","svg"]),t.svgInvalidAncestorsRegEx=f(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),t.svgValidParentsRegEx=f(["symbol","g","a","svg","clipPath","defs"]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,r,n){e[n]=Math.tan(t.util.degreesToRadians(r[0]))}var r=t.iMatrix,n=t.reNum,i=t.commaWsp,o="(?:(?:(matrix)\\s*\\(\\s*("+n+")"+i+"("+n+")"+i+"("+n+")"+i+"("+n+")"+i+"("+n+")"+i+"("+n+")\\s*\\))|(?:(translate)\\s*\\(\\s*("+n+")(?:"+i+"("+n+"))?\\s*\\))|(?:(scale)\\s*\\(\\s*("+n+")(?:"+i+"("+n+"))?\\s*\\))|(?:(rotate)\\s*\\(\\s*("+n+")(?:"+i+"("+n+")"+i+"("+n+"))?\\s*\\))|(?:(skewX)\\s*\\(\\s*("+n+")\\s*\\))|(?:(skewY)\\s*\\(\\s*("+n+")\\s*\\)))",a=new RegExp("^\\s*(?:(?:"+o+"(?:"+i+"*"+o+")*)?)\\s*$"),s=new RegExp(o,"g");return function(n){var i=r.concat(),l=[];if(!n||n&&!a.test(n))return i;n.replace(s,function(n){var a=new RegExp(o).exec(n).filter(function(e){return!!e}),s=a[1],c=a.slice(2).map(parseFloat);switch(s){case"translate":!function(e,t){e[4]=t[0],2===t.length&&(e[5]=t[1])}(i,c);break;case"rotate":c[0]=t.util.degreesToRadians(c[0]),function(e,r){var n=t.util.cos(r[0]),i=t.util.sin(r[0]),o=0,a=0;3===r.length&&(o=r[1],a=r[2]),e[0]=n,e[1]=i,e[2]=-i,e[3]=n,e[4]=o-(n*o-i*a),e[5]=a-(i*o+n*a)}(i,c);break;case"scale":!function(e,t){var r=t[0],n=2===t.length?t[1]:t[0];e[0]=r,e[3]=n}(i,c);break;case"skewX":e(i,c,2);break;case"skewY":e(i,c,1);break;case"matrix":i=c}l.push(i.concat()),i=r.concat()});for(var c=l[0];l.length>1;)l.shift(),c=t.util.multiplyTransformMatrices(c,l[0]);return c}}();var y=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function b(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var r,n,i,a,s,l,c=e.getAttribute("viewBox"),u=1,d=1,h=e.getAttribute("width"),f=e.getAttribute("height"),p=e.getAttribute("x")||0,g=e.getAttribute("y")||0,m=e.getAttribute("preserveAspectRatio")||"",v=!c||!(c=c.match(y)),b=!h||!f||"100%"===h||"100%"===f,w=v&&b,x={},C="",_=0,S=0;if(x.width=0,x.height=0,x.toBeParsed=w,v&&(p||g)&&e.parentNode&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") ",s=(e.getAttribute("transform")||"")+C,e.setAttribute("transform",s),e.removeAttribute("x"),e.removeAttribute("y")),w)return x;if(v)return x.width=o(h),x.height=o(f),x;if(r=-parseFloat(c[1]),n=-parseFloat(c[2]),i=parseFloat(c[3]),a=parseFloat(c[4]),x.minX=r,x.minY=n,x.viewBoxWidth=i,x.viewBoxHeight=a,b?(x.width=i,x.height=a):(x.width=o(h),x.height=o(f),u=x.width/i,d=x.height/a),"none"!==(m=t.util.parsePreserveAspectRatioAttribute(m)).alignX&&("meet"===m.meetOrSlice&&(d=u=u>d?d:u),"slice"===m.meetOrSlice&&(d=u=u>d?u:d),_=x.width-i*u,S=x.height-a*u,"Mid"===m.alignX&&(_/=2),"Mid"===m.alignY&&(S/=2),"Min"===m.alignX&&(_=0),"Min"===m.alignY&&(S=0)),1===u&&1===d&&0===r&&0===n&&0===p&&0===g)return x;if((p||g)&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") "),s=C+" matrix("+u+" 0 0 "+d+" "+(r*u+_)+" "+(n*d+S)+") ","svg"===e.nodeName){for(l=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}else(l=e).removeAttribute("x"),l.removeAttribute("y"),s=l.getAttribute("transform")+s;return l.setAttribute("transform",s),x}function w(e,t){var r="xlink:href",n=v(e,t.getAttribute(r).slice(1));if(n&&n.getAttribute(r)&&w(e,n),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach(function(e){n&&!t.hasAttribute(e)&&n.hasAttribute(e)&&t.setAttribute(e,n.getAttribute(e))}),!t.children.length)for(var i=n.cloneNode(!0);i.firstChild;)t.appendChild(i.firstChild);t.removeAttribute(r)}t.parseSVGDocument=function(e,r,i,o){if(e){!function(e){for(var r=p(e,["use","svg:use"]),n=0;r.length&&n<r.length;){var i=r[n],o=i.getAttribute("xlink:href")||i.getAttribute("href");if(null===o)return;var a,s,l,c,u=o.slice(1),d=i.getAttribute("x")||0,h=i.getAttribute("y")||0,f=v(e,u).cloneNode(!0),g=(f.getAttribute("transform")||"")+" translate("+d+", "+h+")",m=r.length,y=t.svgNS;if(b(f),/^svg$/i.test(f.nodeName)){var w=f.ownerDocument.createElementNS(y,"g");for(s=0,c=(l=f.attributes).length;s<c;s++)a=l.item(s),w.setAttributeNS(y,a.nodeName,a.nodeValue);for(;f.firstChild;)w.appendChild(f.firstChild);f=w}for(s=0,c=(l=i.attributes).length;s<c;s++)"x"!==(a=l.item(s)).nodeName&&"y"!==a.nodeName&&"xlink:href"!==a.nodeName&&"href"!==a.nodeName&&("transform"===a.nodeName?g=a.nodeValue+" "+g:f.setAttribute(a.nodeName,a.nodeValue));f.setAttribute("transform",g),f.setAttribute("instantiated_by_use","1"),f.removeAttribute("id"),i.parentNode.replaceChild(f,i),r.length===m&&n++}}(e);var a,s,l=t.Object.__uid++,c=b(e),u=t.util.toArray(e.getElementsByTagName("*"));if(c.crossOrigin=o&&o.crossOrigin,c.svgUid=l,0===u.length&&t.isLikelyNode){var d=[];for(a=0,s=(u=e.selectNodes('//*[name(.)!="svg"]')).length;a<s;a++)d[a]=u[a];u=d}var h=u.filter(function(e){return b(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))&&!function(e,t){for(;e&&(e=e.parentNode);)if(e.nodeName&&t.test(e.nodeName.replace("svg:",""))&&!e.getAttribute("instantiated_by_use"))return!0;return!1}(e,t.svgInvalidAncestorsRegEx)});if(!h||h&&!h.length)return void(r&&r([],{}));var f={};u.filter(function(e){return"clipPath"===e.nodeName.replace("svg:","")}).forEach(function(e){var r=e.getAttribute("id");f[r]=t.util.toArray(e.getElementsByTagName("*")).filter(function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))})}),t.gradientDefs[l]=t.getGradientDefs(e),t.cssRules[l]=t.getCSSRules(e),t.clipPaths[l]=f,t.parseElements(h,function(e,n){r&&(r(e,c,n,u),delete t.gradientDefs[l],delete t.cssRules[l],delete t.clipPaths[l])},n(c),i,o)}};var x=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+t.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+t.reNum+"))?\\s+(.*)");r(t,{parseFontDeclaration:function(e,t){var r=e.match(x);if(r){var n=r[1],i=r[3],a=r[4],s=r[5],l=r[6];n&&(t.fontStyle=n),i&&(t.fontWeight=isNaN(parseFloat(i))?i:parseFloat(i)),a&&(t.fontSize=o(a)),l&&(t.fontFamily=l),s&&(t.lineHeight="normal"===s?1:s)}},getGradientDefs:function(e){var t,r=p(e,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),n=0,i={};for(n=r.length;n--;)(t=r[n]).getAttribute("xlink:href")&&w(e,t),i[t.getAttribute("id")]=t;return i},parseAttributes:function(e,n,a){if(e){var s,f,p,m={};typeof a>"u"&&(a=e.getAttribute("svgUid")),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(m=t.parseAttributes(e.parentNode,n,a));var v=n.reduce(function(t,r){return(s=e.getAttribute(r))&&(t[r]=s),t},{}),y=r(function(e,r){var n={};for(var i in t.cssRules[r])if(g(e,i.split(" ")))for(var o in t.cssRules[r][i])n[o]=t.cssRules[r][i][o];return n}(e,a),t.parseStyleAttribute(e));v=r(v,y),y[u]&&e.setAttribute(u,y[u]),f=p=m.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,v[c]&&(v[c]=f=o(v[c],p));var b,w,x={};for(var C in v)w=h(b=d(C),v[C],m,f),x[b]=w;x&&x.font&&t.parseFontDeclaration(x.font,x);var _=r(m,x);return t.svgValidParentsRegEx.test(e.nodeName)?_:function(e){for(var r in l)if(!(typeof e[l[r]]>"u"||""===e[r])){if(typeof e[r]>"u"){if(!t.Object.prototype[r])continue;e[r]=t.Object.prototype[r]}if(0!==e[r].indexOf("url(")){var n=new t.Color(e[r]);e[r]=n.setAlpha(i(n.getAlpha()*e[l[r]],2)).toRgba()}}return e}(_)}},parseElements:function(e,r,n,i,o){new t.ElementsParser(e,r,n,i,o).parse()},parseStyleAttribute:function(e){var t={},r=e.getAttribute("style");return r&&("string"==typeof r?function(e,t){var r,n;e.replace(/;\s*$/,"").split(";").forEach(function(e){var i=e.split(":");r=i[0].trim().toLowerCase(),n=i[1].trim(),t[r]=n})}(r,t):function(e,t){var r,n;for(var i in e)typeof e[i]>"u"||(r=i.toLowerCase(),n=e[i],t[r]=n)}(r,t)),t},parsePointsAttribute:function(e){if(!e)return null;var t,r,n=[];for(t=0,r=(e=(e=e.replace(/,/g," ").trim()).split(/\s+/)).length;t<r;t+=2)n.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return n},getCSSRules:function(e){var r,n,i=e.getElementsByTagName("style"),o={};for(r=0,n=i.length;r<n;r++){var a=i[r].textContent;""!==(a=a.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&a.split("}").filter(function(e){return e.trim()}).forEach(function(e){var i=e.split("{"),a={},s=i[1].trim().split(";").filter(function(e){return e.trim()});for(r=0,n=s.length;r<n;r++){var l=s[r].split(":"),c=l[0].trim(),u=l[1].trim();a[c]=u}(e=i[0].trim()).split(",").forEach(function(e){""!==(e=e.replace(/^svg/i,"").trim())&&(o[e]?t.util.object.extend(o[e],a):o[e]=t.util.object.clone(a))})})}return o},loadSVGFromURL:function(e,r,n,i){e=e.replace(/^\n\s*/,"").trim(),new t.util.request(e,{method:"get",onComplete:function(e){var o=e.responseXML;if(!o||!o.documentElement)return r&&r(null),!1;t.parseSVGDocument(o.documentElement,function(e,t,n,i){r&&r(e,t,n,i)},n,i)}})},loadSVGFromString:function(e,r,n,i){var o=(new t.window.DOMParser).parseFromString(e.trim(),"text/xml");t.parseSVGDocument(o.documentElement,function(e,t,n,i){r(e,t,n,i)},n,i)}})}(e),t.ElementsParser=function(e,t,r,n,i,o){this.elements=e,this.callback=t,this.options=r,this.reviver=n,this.svgUid=r&&r.svgUid||0,this.parsingOptions=i,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=o},function(e){e.parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},e.createObjects=function(){var e=this;this.elements.forEach(function(t,r){t.setAttribute("svgUid",e.svgUid),e.createObject(t,r)})},e.findTag=function(e){return t[t.util.string.capitalize(e.tagName.replace("svg:",""))]},e.createObject=function(e,r){var n=this.findTag(e);if(n&&n.fromElement)try{n.fromElement(e,this.createCallback(r,e),this.options)}catch(e){t.log(e)}else this.checkIfDone()},e.createCallback=function(e,r){var n=this;return function(i){var o;n.resolveGradient(i,r,"fill"),n.resolveGradient(i,r,"stroke"),i instanceof t.Image&&i._originalElement&&(o=i.parsePreserveAspectRatioAttribute(r)),i._removeTransformMatrix(o),n.resolveClipPath(i,r),n.reviver&&n.reviver(r,i),n.instances[e]=i,n.checkIfDone()}},e.extractPropertyDefinition=function(e,r,n){var i=e[r],o=this.regexUrl;if(o.test(i)){o.lastIndex=0;var a=o.exec(i)[1];return o.lastIndex=0,t[n][this.svgUid][a]}},e.resolveGradient=function(e,r,n){var i=this.extractPropertyDefinition(e,n,"gradientDefs");if(i){var o=r.getAttribute(n+"-opacity"),a=t.Gradient.fromElement(i,e,o,this.options);e.set(n,a)}},e.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},e.resolveClipPath=function(e,r){var n,i,o,a,s=this.extractPropertyDefinition(e,"clipPath","clipPaths");if(s){o=[],i=t.util.invertTransform(e.calcTransformMatrix());for(var l=s[0].parentNode,c=r;c.parentNode&&c.getAttribute("clip-path")!==e.clipPath;)c=c.parentNode;c.parentNode.appendChild(l);for(var u=0;u<s.length;u++)n=s[u],this.findTag(n).fromElement(n,this.createClipPathCallback(e,o),this.options);s=1===o.length?o[0]:new t.Group(o),a=t.util.multiplyTransformMatrices(i,s.calcTransformMatrix()),s.clipPath&&this.resolveClipPath(s,c);var d=t.util.qrDecompose(a);s.flipX=!1,s.flipY=!1,s.set("scaleX",d.scaleX),s.set("scaleY",d.scaleY),s.angle=d.angle,s.skewX=d.skewX,s.skewY=0,s.setPositionByOrigin({x:d.translateX,y:d.translateY},"center","center"),e.clipPath=s}else delete e.clipPath},e.checkIfDone=function(){0===--this.numElements&&(this.instances=this.instances.filter(function(e){return null!=e}),this.callback(this.instances,this.elements))}}(t.ElementsParser.prototype),function(e){var t=e.fabric||(e.fabric={});function r(e,t){this.x=e,this.y=t}t.Point?t.warn("fabric.Point is already defined"):(t.Point=r,r.prototype={type:"point",constructor:r,add:function(e){return new r(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new r(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new r(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new r(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new r(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new r(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return typeof t>"u"&&(t=.5),t=Math.max(Math.min(1,t),0),new r(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new r(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new r(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,r=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=r},clone:function(){return new r(this.x,this.y)}})}(e),function(e){var t=e.fabric||(e.fabric={});function r(e){this.status=e,this.points=[]}t.Intersection?t.warn("fabric.Intersection is already defined"):(t.Intersection=r,t.Intersection.prototype={constructor:r,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,n,i,o){var a,s=(o.x-i.x)*(e.y-i.y)-(o.y-i.y)*(e.x-i.x),l=(n.x-e.x)*(e.y-i.y)-(n.y-e.y)*(e.x-i.x),c=(o.y-i.y)*(n.x-e.x)-(o.x-i.x)*(n.y-e.y);if(0!==c){var u=s/c,d=l/c;0<=u&&u<=1&&0<=d&&d<=1?(a=new r("Intersection")).appendPoint(new t.Point(e.x+u*(n.x-e.x),e.y+u*(n.y-e.y))):a=new r}else a=new r(0===s||0===l?"Coincident":"Parallel");return a},t.Intersection.intersectLinePolygon=function(e,t,n){var i,o,a,s,l=new r,c=n.length;for(s=0;s<c;s++)i=n[s],o=n[(s+1)%c],a=r.intersectLineLine(e,t,i,o),l.appendPoints(a.points);return l.points.length>0&&(l.status="Intersection"),l},t.Intersection.intersectPolygonPolygon=function(e,t){var n,i=new r,o=e.length;for(n=0;n<o;n++){var a=e[n],s=e[(n+1)%o],l=r.intersectLinePolygon(a,s,t);i.appendPoints(l.points)}return i.points.length>0&&(i.status="Intersection"),i},t.Intersection.intersectPolygonRectangle=function(e,n,i){var o=n.min(i),a=n.max(i),s=new t.Point(a.x,o.y),l=new t.Point(o.x,a.y),c=r.intersectLinePolygon(o,s,e),u=r.intersectLinePolygon(s,a,e),d=r.intersectLinePolygon(a,l,e),h=r.intersectLinePolygon(l,o,e),f=new r;return f.appendPoints(c.points),f.appendPoints(u.points),f.appendPoints(d.points),f.appendPoints(h.points),f.points.length>0&&(f.status="Intersection"),f})}(e),function(e){var t=e.fabric||(e.fabric={});function r(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function n(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}t.Color?t.warn("fabric.Color is already defined."):(t.Color=r,t.Color.prototype={_tryParsingColor:function(e){var t;e in r.colorNameMap&&(e=r.colorNameMap[e]),"transparent"===e&&(t=[255,255,255,0]),t||(t=r.sourceFromHex(e)),t||(t=r.sourceFromRgb(e)),t||(t=r.sourceFromHsl(e)),t||(t=[0,0,0,1]),t&&this.setSource(t)},_rgbToHsl:function(e,r,n){e/=255,r/=255,n/=255;var i,o,a,s=t.util.array.max([e,r,n]),l=t.util.array.min([e,r,n]);if(a=(s+l)/2,s===l)i=o=0;else{var c=s-l;switch(o=a>.5?c/(2-s-l):c/(s+l),s){case e:i=(r-n)/c+(r<n?6:0);break;case r:i=(n-e)/c+2;break;case n:i=(e-r)/c+4}i/=6}return[Math.round(360*i),Math.round(100*o),Math.round(100*a)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return"rgb("+e[0]+","+e[1]+","+e[2]+")"},toRgba:function(){var e=this.getSource();return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsl("+t[0]+","+t[1]+"%,"+t[2]+"%)"},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsla("+t[0]+","+t[1]+"%,"+t[2]+"%,"+e[3]+")"},toHex:function(){var e,t,r,n=this.getSource();return e=1===(e=n[0].toString(16)).length?"0"+e:e,t=1===(t=n[1].toString(16)).length?"0"+t:t,r=1===(r=n[2].toString(16)).length?"0"+r:r,e.toUpperCase()+t.toUpperCase()+r.toUpperCase()},toHexa:function(){var e,t=this.getSource();return e=1===(e=(e=Math.round(255*t[3])).toString(16)).length?"0"+e:e,this.toHex()+e.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),10),r=e[3];return this.setSource([t,t,t,r]),this},toBlackWhite:function(e){var t=this.getSource(),r=(.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),n=t[3];return e=e||127,r=Number(r)<Number(e)?0:255,this.setSource([r,r,r,n]),this},overlayWith:function(e){e instanceof r||(e=new r(e));var t,n=[],i=this.getAlpha(),o=this.getSource(),a=e.getSource();for(t=0;t<3;t++)n.push(Math.round(.5*o[t]+.5*a[t]));return n[3]=i,this.setSource(n),this}},t.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},t.Color.fromRgb=function(e){return r.fromSource(r.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(r.reRGBa);if(t){var n=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),i=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),o=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(n,10),parseInt(i,10),parseInt(o,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=r.fromRgb,t.Color.fromHsl=function(e){return r.fromSource(r.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(r.reHSLa);if(t){var i,o,a,s=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(0===l)i=o=a=c;else{var u=c<=.5?c*(l+1):c+l-c*l,d=2*c-u;i=n(d,u,s+1/3),o=n(d,u,s),a=n(d,u,s-1/3)}return[Math.round(255*i),Math.round(255*o),Math.round(255*a),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=r.fromHsl,t.Color.fromHex=function(e){return r.fromSource(r.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(r.reHex)){var t=e.slice(e.indexOf("#")+1),n=3===t.length||4===t.length,i=8===t.length||4===t.length,o=n?t.charAt(0)+t.charAt(0):t.substring(0,2),a=n?t.charAt(1)+t.charAt(1):t.substring(2,4),s=n?t.charAt(2)+t.charAt(2):t.substring(4,6),l=i?n?t.charAt(3)+t.charAt(3):t.substring(6,8):"FF";return[parseInt(o,16),parseInt(a,16),parseInt(s,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new r;return t.setSource(e),t})}(e),function(e){var t=e.fabric||(e.fabric={}),r=["e","se","s","sw","w","nw","n","ne","e"],n=["ns","nesw","ew","nwse"],i={},o="left",a="top",s="right",l="bottom",c="center",u={top:l,bottom:a,left:s,right:o,center:c},d=t.util.radiansToDegrees,h=Math.sign||function(e){return(e>0)-(e<0)||+e};function f(e,t){var r=e.angle+d(Math.atan2(t.y,t.x))+360;return Math.round(r%360/45)}function p(e,r){var n=r.transform.target,i=n.canvas,o=t.util.object.clone(r);o.target=n,i&&i.fire("object:"+e,o),n.fire(e,r)}function g(e,t){var r=t.canvas,n=e[r.uniScaleKey];return r.uniformScaling&&!n||!r.uniformScaling&&n}function m(e){return e.originX===c&&e.originY===c}function v(e,t,r){var n=e.lockScalingX,i=e.lockScalingY;return!!(n&&i||!t&&(n||i)&&r||n&&"x"===t||i&&"y"===t)}function y(e,t,r,n){return{e:e,transform:t,pointer:{x:r,y:n}}}function b(e){return function(t,r,n,i){var o=r.target,a=o.getCenterPoint(),s=o.translateToOriginPoint(a,r.originX,r.originY),l=e(t,r,n,i);return o.setPositionByOrigin(s,r.originX,r.originY),l}}function w(e,t){return function(r,n,i,o){var a=t(r,n,i,o);return a&&p(e,y(r,n,i,o)),a}}function x(e,r,n,i,o){var a=e.target,s=a.controls[e.corner],l=a.canvas.getZoom(),c=a.padding/l,u=a.toLocalPoint(new t.Point(i,o),r,n);return u.x>=c&&(u.x-=c),u.x<=-c&&(u.x+=c),u.y>=c&&(u.y-=c),u.y<=c&&(u.y+=c),u.x-=s.offsetX,u.y-=s.offsetY,u}function C(e){return e.flipX!==e.flipY}function _(e,t,r,n,i){if(0!==e[t]){var o=i/e._getTransformedDimensions()[n]*e[r];e.set(r,o)}}function S(e,t,r,n){var i,c=t.target,u=c._getTransformedDimensions(0,c.skewY),h=x(t,t.originX,t.originY,r,n),f=Math.abs(2*h.x)-u.x,p=c.skewX;f<2?i=0:(i=d(Math.atan2(f/c.scaleX,u.y/c.scaleY)),t.originX===o&&t.originY===l&&(i=-i),t.originX===s&&t.originY===a&&(i=-i),C(c)&&(i=-i));var g=p!==i;if(g){var m=c._getTransformedDimensions().y;c.set("skewX",i),_(c,"skewY","scaleY","y",m)}return g}function A(e,t,r,n){var i,c=t.target,u=c._getTransformedDimensions(c.skewX,0),h=x(t,t.originX,t.originY,r,n),f=Math.abs(2*h.y)-u.y,p=c.skewY;f<2?i=0:(i=d(Math.atan2(f/c.scaleY,u.x/c.scaleX)),t.originX===o&&t.originY===l&&(i=-i),t.originX===s&&t.originY===a&&(i=-i),C(c)&&(i=-i));var g=p!==i;if(g){var m=c._getTransformedDimensions().x;c.set("skewY",i),_(c,"skewX","scaleX","x",m)}return g}function k(e,t,r,n,i){i=i||{};var o,a,s,l,c,d,f=t.target,p=f.lockScalingX,y=f.lockScalingY,b=i.by,w=g(e,f),C=v(f,b,w),_=t.gestureScale;if(C)return!1;if(_)a=t.scaleX*_,s=t.scaleY*_;else{if(o=x(t,t.originX,t.originY,r,n),c="y"!==b?h(o.x):1,d="x"!==b?h(o.y):1,t.signX||(t.signX=c),t.signY||(t.signY=d),f.lockScalingFlip&&(t.signX!==c||t.signY!==d))return!1;if(l=f._getTransformedDimensions(),w&&!b){var S=Math.abs(o.x)+Math.abs(o.y),A=t.original,k=S/(Math.abs(l.x*A.scaleX/f.scaleX)+Math.abs(l.y*A.scaleY/f.scaleY));a=A.scaleX*k,s=A.scaleY*k}else a=Math.abs(o.x*f.scaleX/l.x),s=Math.abs(o.y*f.scaleY/l.y);m(t)&&(a*=2,s*=2),t.signX!==c&&"y"!==b&&(t.originX=u[t.originX],a*=-1,t.signX=c),t.signY!==d&&"x"!==b&&(t.originY=u[t.originY],s*=-1,t.signY=d)}var E=f.scaleX,I=f.scaleY;return b?("x"===b&&f.set("scaleX",a),"y"===b&&f.set("scaleY",s)):(!p&&f.set("scaleX",a),!y&&f.set("scaleY",s)),E!==f.scaleX||I!==f.scaleY}i.scaleCursorStyleHandler=function(e,t,n){var i=g(e,n),o="";if(0!==t.x&&0===t.y?o="x":0===t.x&&0!==t.y&&(o="y"),v(n,o,i))return"not-allowed";var a=f(n,t);return r[a]+"-resize"},i.skewCursorStyleHandler=function(e,t,r){if(0!==t.x&&r.lockSkewingY||0!==t.y&&r.lockSkewingX)return"not-allowed";var i=f(r,t)%4;return n[i]+"-resize"},i.scaleSkewCursorStyleHandler=function(e,t,r){return e[r.canvas.altActionKey]?i.skewCursorStyleHandler(e,t,r):i.scaleCursorStyleHandler(e,t,r)},i.rotationWithSnapping=w("rotating",b(function(e,t,r,n){var i=t,o=i.target,a=o.translateToOriginPoint(o.getCenterPoint(),i.originX,i.originY);if(o.lockRotation)return!1;var s,l=Math.atan2(i.ey-a.y,i.ex-a.x),c=Math.atan2(n-a.y,r-a.x),u=d(c-l+i.theta);if(o.snapAngle>0){var h=o.snapAngle,f=o.snapThreshold||h,p=Math.ceil(u/h)*h,g=Math.floor(u/h)*h;Math.abs(u-g)<f?u=g:Math.abs(u-p)<f&&(u=p)}return u<0&&(u=360+u),u%=360,s=o.angle!==u,o.angle=u,s})),i.scalingEqually=w("scaling",b(function(e,t,r,n){return k(e,t,r,n)})),i.scalingX=w("scaling",b(function(e,t,r,n){return k(e,t,r,n,{by:"x"})})),i.scalingY=w("scaling",b(function(e,t,r,n){return k(e,t,r,n,{by:"y"})})),i.scalingYOrSkewingX=function(e,t,r,n){return e[t.target.canvas.altActionKey]?i.skewHandlerX(e,t,r,n):i.scalingY(e,t,r,n)},i.scalingXOrSkewingY=function(e,t,r,n){return e[t.target.canvas.altActionKey]?i.skewHandlerY(e,t,r,n):i.scalingX(e,t,r,n)},i.changeWidth=w("resizing",b(function(e,t,r,n){var i=t.target,o=x(t,t.originX,t.originY,r,n),a=i.strokeWidth/(i.strokeUniform?i.scaleX:1),s=m(t)?2:1,l=i.width,c=Math.abs(o.x*s/i.scaleX)-a;return i.set("width",Math.max(c,0)),l!==c})),i.skewHandlerX=function(e,t,r,n){var i,l=t.target,u=l.skewX,d=t.originY;return!l.lockSkewingX&&(0===u?i=x(t,c,c,r,n).x>0?o:s:(u>0&&(i=d===a?o:s),u<0&&(i=d===a?s:o),C(l)&&(i=i===o?s:o)),t.originX=i,w("skewing",b(S))(e,t,r,n))},i.skewHandlerY=function(e,t,r,n){var i,s=t.target,u=s.skewY,d=t.originX;return!s.lockSkewingY&&(0===u?i=x(t,c,c,r,n).y>0?a:l:(u>0&&(i=d===o?a:l),u<0&&(i=d===o?l:a),C(s)&&(i=i===a?l:a)),t.originY=i,w("skewing",b(A))(e,t,r,n))},i.dragHandler=function(e,t,r,n){var i=t.target,o=r-t.offsetX,a=n-t.offsetY,s=!i.get("lockMovementX")&&i.left!==o,l=!i.get("lockMovementY")&&i.top!==a;return s&&i.set("left",o),l&&i.set("top",a),(s||l)&&p("moving",y(e,t,r,n)),s||l},i.scaleOrSkewActionName=function(e,t,r){var n=e[r.canvas.altActionKey];return 0===t.x?n?"skewX":"scaleY":0===t.y?n?"skewY":"scaleX":void 0},i.rotationStyleHandler=function(e,t,r){return r.lockRotation?"not-allowed":t.cursorStyle},i.fireEvent=p,i.wrapWithFixedAnchor=b,i.wrapWithFireEvent=w,i.getLocalPoint=x,t.controlsUtils=i}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.degreesToRadians,n=t.controlsUtils;n.renderCircleControl=function(e,t,r,n,i){n=n||{};var o,a=this.sizeX||n.cornerSize||i.cornerSize,s=this.sizeY||n.cornerSize||i.cornerSize,l=typeof n.transparentCorners<"u"?n.transparentCorners:i.transparentCorners,c=l?"stroke":"fill",u=!l&&(n.cornerStrokeColor||i.cornerStrokeColor),d=t,h=r;e.save(),e.fillStyle=n.cornerColor||i.cornerColor,e.strokeStyle=n.cornerStrokeColor||i.cornerStrokeColor,a>s?(o=a,e.scale(1,s/a),h=r*a/s):s>a?(o=s,e.scale(a/s,1),d=t*s/a):o=a,e.lineWidth=1,e.beginPath(),e.arc(d,h,o/2,0,2*Math.PI,!1),e[c](),u&&e.stroke(),e.restore()},n.renderSquareControl=function(e,t,n,i,o){i=i||{};var a=this.sizeX||i.cornerSize||o.cornerSize,s=this.sizeY||i.cornerSize||o.cornerSize,l=typeof i.transparentCorners<"u"?i.transparentCorners:o.transparentCorners,c=l?"stroke":"fill",u=!l&&(i.cornerStrokeColor||o.cornerStrokeColor),d=a/2,h=s/2;e.save(),e.fillStyle=i.cornerColor||o.cornerColor,e.strokeStyle=i.cornerStrokeColor||o.cornerStrokeColor,e.lineWidth=1,e.translate(t,n),e.rotate(r(o.angle)),e[c+"Rect"](-d,-h,a,s),u&&e.strokeRect(-d,-h,a,s),e.restore()}}(e),function(e){var t=e.fabric||(e.fabric={});t.Control=function(e){for(var t in e)this[t]=e[t]},t.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var r=e._controlsVisibility;return r&&typeof r[t]<"u"?r[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,r){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},r)},calcCornerCoords:function(e,r,n,i,o){var a,s,l,c,u=o?this.touchSizeX:this.sizeX,d=o?this.touchSizeY:this.sizeY;if(u&&d&&u!==d){var h=Math.atan2(d,u),f=Math.sqrt(u*u+d*d)/2,p=h-t.util.degreesToRadians(e),g=Math.PI/2-h-t.util.degreesToRadians(e);a=f*t.util.cos(p),s=f*t.util.sin(p),l=f*t.util.cos(g),c=f*t.util.sin(g)}else f=.7071067812*(u&&d?u:r),p=t.util.degreesToRadians(45-e),a=l=f*t.util.cos(p),s=c=f*t.util.sin(p);return{tl:{x:n-c,y:i-l},tr:{x:n+a,y:i-s},bl:{x:n-a,y:i+s},br:{x:n+c,y:i+l}}},render:function(e,r,n,i,o){"circle"===((i=i||{}).cornerStyle||o.cornerStyle)?t.controlsUtils.renderCircleControl.call(this,e,r,n,i,o):t.controlsUtils.renderSquareControl.call(this,e,r,n,i,o)}}}(e),function(){function e(e,r){var n,i,o,a,s=e.getAttribute("style"),l=e.getAttribute("offset")||0;if(l=(l=parseFloat(l)/(/%$/.test(l)?100:1))<0?0:l>1?1:l,s){var c=s.split(/\s*;\s*/);for(""===c[c.length-1]&&c.pop(),a=c.length;a--;){var u=c[a].split(/\s*:\s*/),d=u[0].trim(),h=u[1].trim();"stop-color"===d?n=h:"stop-opacity"===d&&(o=h)}}return n||(n=e.getAttribute("stop-color")||"rgb(0,0,0)"),o||(o=e.getAttribute("stop-opacity")),i=(n=new t.Color(n)).getAlpha(),o=isNaN(parseFloat(o))?1:parseFloat(o),o*=i*r,{offset:l,color:n.toRgb(),opacity:o}}var r=t.util.object.clone;t.Gradient=t.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var r,n=this;Object.keys(e).forEach(function(t){n[t]=e[t]}),this.id?this.id+="_"+t.Object.__uid++:this.id=t.Object.__uid++,r={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(r.r1=e.coords.r1||0,r.r2=e.coords.r2||0),this.coords=r,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var r in e){var n=new t.Color(e[r]);this.colorStops.push({offset:parseFloat(r),color:n.toRgb(),opacity:n.getAlpha()})}return this},toObject:function(e){var r={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return t.util.populateWithProperties(this,r,e),r},toSVG:function(e,n){var i,o,a,s,l=r(this.coords,!0),c=(n=n||{},r(this.colorStops,!0)),u=l.r1>l.r2,d=this.gradientTransform?this.gradientTransform.concat():t.iMatrix.concat(),h=-this.offsetX,f=-this.offsetY,p=!!n.additionalTransform,g="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(c.sort(function(e,t){return e.offset-t.offset}),"objectBoundingBox"===g?(h/=e.width,f/=e.height):(h+=e.width/2,f+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(h-=e.pathOffset.x,f-=e.pathOffset.y),d[4]-=h,d[5]-=f,s='id="SVGID_'+this.id+'" gradientUnits="'+g+'"',s+=' gradientTransform="'+(p?n.additionalTransform+" ":"")+t.util.matrixToSVG(d)+'" ',"linear"===this.type?a=["<linearGradient ",s,' x1="',l.x1,'" y1="',l.y1,'" x2="',l.x2,'" y2="',l.y2,'">\n']:"radial"===this.type&&(a=["<radialGradient ",s,' cx="',u?l.x1:l.x2,'" cy="',u?l.y1:l.y2,'" r="',u?l.r1:l.r2,'" fx="',u?l.x2:l.x1,'" fy="',u?l.y2:l.y1,'">\n']),"radial"===this.type){if(u)for((c=c.concat()).reverse(),i=0,o=c.length;i<o;i++)c[i].offset=1-c[i].offset;var m=Math.min(l.r1,l.r2);if(m>0){var v=m/Math.max(l.r1,l.r2);for(i=0,o=c.length;i<o;i++)c[i].offset+=v*(1-c[i].offset)}}for(i=0,o=c.length;i<o;i++){var y=c[i];a.push("<stop ",'offset="',100*y.offset+"%",'" style="stop-color:',y.color,typeof y.opacity<"u"?";stop-opacity: "+y.opacity:";",'"/>\n')}return a.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),a.join("")},toLive:function(e){var r,n,i,o=t.util.object.clone(this.coords);if(this.type){for("linear"===this.type?r=e.createLinearGradient(o.x1,o.y1,o.x2,o.y2):"radial"===this.type&&(r=e.createRadialGradient(o.x1,o.y1,o.r1,o.x2,o.y2,o.r2)),n=0,i=this.colorStops.length;n<i;n++){var a=this.colorStops[n].color,s=this.colorStops[n].opacity,l=this.colorStops[n].offset;typeof s<"u"&&(a=new t.Color(a).setAlpha(s).toRgba()),r.addColorStop(l,a)}return r}}}),t.util.object.extend(t.Gradient,{fromElement:function(r,n,i,o){var a=parseFloat(i)/(/%$/.test(i)?100:1);a=a<0?0:a>1?1:a,isNaN(a)&&(a=1);var s,l,c,u,d=r.getElementsByTagName("stop"),h="userSpaceOnUse"===r.getAttribute("gradientUnits")?"pixels":"percentage",f=r.getAttribute("gradientTransform")||"",p=[],g=0,m=0;for("linearGradient"===r.nodeName||"LINEARGRADIENT"===r.nodeName?(s="linear",l=function(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}(r)):(s="radial",l=function(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}(r)),c=d.length;c--;)p.push(e(d[c],a));return u=t.parseTransformAttribute(f),function(e,t,r,n){var i,o;Object.keys(t).forEach(function(e){"Infinity"===(i=t[e])?o=1:"-Infinity"===i?o=0:(o=parseFloat(t[e],10),"string"==typeof i&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(o*=.01,"pixels"===n&&(("x1"===e||"x2"===e||"r2"===e)&&(o*=r.viewBoxWidth||r.width),("y1"===e||"y2"===e)&&(o*=r.viewBoxHeight||r.height)))),t[e]=o})}(0,l,o,h),"pixels"===h&&(g=-n.left,m=-n.top),new t.Gradient({id:r.getAttribute("id"),type:s,coords:l,colorStops:p,gradientUnits:h,gradientTransform:u,offsetX:g,offsetY:m})}})}(),function(){var e=t.util.toFixed;t.Pattern=t.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(e,r){if(e||(e={}),this.id=t.Object.__uid++,this.setOptions(e),!e.source||e.source&&"string"!=typeof e.source)r&&r(this);else{var n=this;this.source=t.util.createImage(),t.util.loadImage(e.source,function(e,t){n.source=e,r&&r(n,t)},null,this.crossOrigin)}},toObject:function(r){var n,i,o=t.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?n=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(n=this.source.toDataURL()),i={type:"pattern",source:n,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,o),offsetY:e(this.offsetY,o),patternTransform:this.patternTransform?this.patternTransform.concat():null},t.util.populateWithProperties(this,i,r),i},toSVG:function(e){var t="function"==typeof this.source?this.source():this.source,r=t.width/e.width,n=t.height/e.height,i=this.offsetX/e.width,o=this.offsetY/e.height,a="";return("repeat-x"===this.repeat||"no-repeat"===this.repeat)&&(n=1,o&&(n+=Math.abs(o))),("repeat-y"===this.repeat||"no-repeat"===this.repeat)&&(r=1,i&&(r+=Math.abs(i))),t.src?a=t.src:t.toDataURL&&(a=t.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+i+'" y="'+o+'" width="'+r+'" height="'+n+'">\n<image x="0" y="0" width="'+t.width+'" height="'+t.height+'" xlink:href="'+a+'"></image>\n</pattern>\n'},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;return!t||typeof t.src<"u"&&(!t.complete||0===t.naturalWidth||0===t.naturalHeight)?"":e.createPattern(t,this.repeat)}})}(),function(e){var t=e.fabric||(e.fabric={}),r=t.util.toFixed;t.Shadow?t.warn("fabric.Shadow is already defined."):(t.Shadow=t.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var r in"string"==typeof e&&(e=this._parseShadow(e)),e)this[r]=e[r];this.id=t.Object.__uid++},_parseShadow:function(e){var r=e.trim(),n=t.Shadow.reOffsetsAndBlur.exec(r)||[];return{color:(r.replace(t.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(n[1],10)||0,offsetY:parseFloat(n[2],10)||0,blur:parseFloat(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(e){var n=40,i=40,o=t.Object.NUM_FRACTION_DIGITS,a=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=new t.Color(this.color);return e.width&&e.height&&(n=100*r((Math.abs(a.x)+this.blur)/e.width,o)+20,i=100*r((Math.abs(a.y)+this.blur)/e.height,o)+20),e.flipX&&(a.x*=-1),e.flipY&&(a.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+i+'%" height="'+(100+2*i)+'%" x="-'+n+'%" width="'+(100+2*n)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+r(this.blur?this.blur/2:0,o)+'"></feGaussianBlur>\n\t<feOffset dx="'+r(a.x,o)+'" dy="'+r(a.y,o)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+s.toRgb()+'" flood-opacity="'+s.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},r=t.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(t){this[t]!==r[t]&&(e[t]=this[t])},this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(e),function(){if(t.StaticCanvas)t.warn("fabric.StaticCanvas is already defined.");else{var e=t.util.object.extend,r=t.util.getElementOffset,n=t.util.removeFromArray,i=t.util.toFixed,o=t.util.transformPoint,a=t.util.invertTransform,s=t.util.getNodeCanvas,l=t.util.createCanvasElement,c=new Error("Could not initialize `canvas` element");t.StaticCanvas=t.util.createClass(t.CommonMethods,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:t.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var r=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,r),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,r),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,r),t.overlayColor&&this.setOverlayColor(t.overlayColor,r),this.calcOffset()},_isRetinaScaling:function(){return t.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,t.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=t.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,r){t.setAttribute("width",this.width*e),t.setAttribute("height",this.height*e),r.scale(e,e)},calcOffset:function(){return this._offset=r(this.lowerCanvasEl),this},setOverlayImage:function(e,t,r){return this.__setBgOverlayImage("overlayImage",e,t,r)},setBackgroundImage:function(e,t,r){return this.__setBgOverlayImage("backgroundImage",e,t,r)},setOverlayColor:function(e,t){return this.__setBgOverlayColor("overlayColor",e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor("backgroundColor",e,t)},__setBgOverlayImage:function(e,r,n,i){return"string"==typeof r?t.util.loadImage(r,function(r,o){if(r){var a=new t.Image(r,i);this[e]=a,a.canvas=this}n&&n(r,o)},this,i&&i.crossOrigin):(i&&r.setOptions(i),this[e]=r,r&&(r.canvas=this),n&&n(r,!1)),this},__setBgOverlayColor:function(e,t,r){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,r),this},_createCanvasElement:function(){var e=l();if(!e||(e.style||(e.style={}),typeof e.getContext>"u"))throw c;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+"px",t.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=t.util.getById(e)||this._createCanvasElement(),t.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var r;for(var n in t=t||{},e)r=e[n],t.cssOnly||(this._setBackstoreDimension(n,e[n]),r+="px",this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(n,r);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,r,n,i=this._activeObject,o=this.backgroundImage,a=this.overlayImage;for(this.viewportTransform=e,r=0,n=this._objects.length;r<n;r++)(t=this._objects[r]).group||t.setCoords(!0);return i&&i.setCoords(),o&&o.setCoords(!0),a&&a.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var r=e,n=this.viewportTransform.slice(0);e=o(e,a(this.viewportTransform)),n[0]=t,n[3]=t;var i=o(e,n);return n[4]+=r.x-i.x,n[5]+=r.y-i.y,this.setViewportTransform(n)},setZoom:function(e){return this.zoomToPoint(new t.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new t.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set("canvas",this),e.setCoords(),this.fire("object:added",{target:e}),e.fire("added")},_onObjectRemoved:function(e){this.fire("object:removed",{target:e}),e.fire("removed"),delete e.canvas},clearContext:function(e){return e.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=t.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var e={},r=this.width,n=this.height,i=a(this.viewportTransform);return e.tl=o({x:0,y:0},i),e.br=o({x:r,y:n},i),e.tr=new t.Point(e.br.x,e.tl.y),e.bl=new t.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&(t.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(e,r){var n=this.viewportTransform,i=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),t.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire("before:render",{ctx:e}),this._renderBackground(e),e.save(),e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this._renderObjects(e,r),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),i&&(i.canvas=this,i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire("after:render",{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,r=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation="destination-in",r.transform(e),e.scale(1/r.zoomX,1/r.zoomY),e.drawImage(r._cacheCanvas,-r.cacheTranslationX,-r.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var r,n;for(r=0,n=t.length;r<n;++r)t[r]&&t[r].render(e)},_renderBackgroundOrOverlay:function(e,t){var r=this[t+"Color"],n=this[t+"Image"],i=this.viewportTransform,o=this[t+"Vpt"];if(r||n){if(r){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=r.toLive?r.toLive(e,this):r,o&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.transform(1,0,0,1,r.offsetX||0,r.offsetY||0);var a=r.gradientTransform||r.patternTransform;a&&e.transform(a[0],a[1],a[2],a[3],a[4],a[5]),e.fill(),e.restore()}n&&(e.save(),o&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),n.render(e),e.restore())}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,"background")},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},getCenterPoint:function(){return new t.Point(this.width/2,this.height/2)},centerObjectH:function(e){return this._centerObject(e,new t.Point(this.getCenterPoint().x,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new t.Point(e.getCenterPoint().x,this.getCenterPoint().y))},centerObject:function(e){var t=this.getCenterPoint();return this._centerObject(e,t)},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var r=this.getVpCenter();return this._centerObject(e,new t.Point(r.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var r=this.getVpCenter();return this._centerObject(e,new t.Point(e.getCenterPoint().x,r.y))},getVpCenter:function(){var e=this.getCenterPoint(),t=a(this.viewportTransform);return o(e,t)},_centerObject:function(e,t){return e.setPositionByOrigin(t,"center","center"),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod("toObject",e)},toDatalessObject:function(e){return this._toObjectMethod("toDatalessObject",e)},_toObjectMethod:function(r,n){var i=this.clipPath,o={version:t.version,objects:this._toObjects(r,n)};return i&&!i.excludeFromExport&&(o.clipPath=this._toObject(this.clipPath,r,n)),e(o,this.__serializeBgOverlay(r,n)),t.util.populateWithProperties(this,o,n),o},_toObjects:function(e,t){return this._objects.filter(function(e){return!e.excludeFromExport}).map(function(r){return this._toObject(r,e,t)},this)},_toObject:function(e,t,r){var n;this.includeDefaultValues||(n=e.includeDefaultValues,e.includeDefaultValues=!1);var i=e[t](r);return this.includeDefaultValues||(e.includeDefaultValues=n),i},__serializeBgOverlay:function(e,t){var r={},n=this.backgroundImage,i=this.overlayImage,o=this.backgroundColor,a=this.overlayColor;return o&&o.toObject?o.excludeFromExport||(r.background=o.toObject(t)):o&&(r.background=o),a&&a.toObject?a.excludeFromExport||(r.overlay=a.toObject(t)):a&&(r.overlay=a),n&&!n.excludeFromExport&&(r.backgroundImage=this._toObject(n,e,t)),i&&!i.excludeFromExport&&(r.overlayImage=this._toObject(i,e,t)),r},svgViewportTransformation:!0,toSVG:function(e,t){e||(e={}),e.reviver=t;var r=[];return this._setSVGPreamble(r,e),this._setSVGHeader(r,e),this.clipPath&&r.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(r,"background"),this._setSVGBgOverlayImage(r,"backgroundImage",t),this._setSVGObjects(r,t),this.clipPath&&r.push("</g>\n"),this._setSVGBgOverlayColor(r,"overlay"),this._setSVGBgOverlayImage(r,"overlayImage",t),r.push("</svg>"),r.join("")},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push('<?xml version="1.0" encoding="',t.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(e,r){var n,o=r.width||this.width,a=r.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',l=t.Object.NUM_FRACTION_DIGITS;r.viewBox?s='viewBox="'+r.viewBox.x+" "+r.viewBox.y+" "+r.viewBox.width+" "+r.viewBox.height+'" ':this.svgViewportTransformation&&(n=this.viewportTransform,s='viewBox="'+i(-n[4]/n[0],l)+" "+i(-n[5]/n[3],l)+" "+i(this.width/n[0],l)+" "+i(this.height/n[3],l)+'" '),e.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',o,'" ','height="',a,'" ',s,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",t.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(r),"</defs>\n")},createSVGClipPathMarkup:function(e){var r=this.clipPath;return r?(r.clipPathId="CLIPPATH_"+t.Object.__uid++,'<clipPath id="'+r.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(e.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var e=this;return["background","overlay"].map(function(r){var n=e[r+"Color"];if(n&&n.toLive){var i=e[r+"Vpt"],o=e.viewportTransform,a={width:e.width/(i?o[0]:1),height:e.height/(i?o[3]:1)};return n.toSVG(a,{additionalTransform:i?t.util.matrixToSVG(o):""})}}).join("")},createSVGFontFacesMarkup:function(){var e,r,n,i,o,a,s,l,c="",u={},d=t.fontPaths,h=[];for(this._objects.forEach(function e(t){h.push(t),t._objects&&t._objects.forEach(e)}),s=0,l=h.length;s<l;s++)if(r=(e=h[s]).fontFamily,-1!==e.type.indexOf("text")&&!u[r]&&d[r]&&(u[r]=!0,e.styles))for(o in n=e.styles)for(a in i=n[o])!u[r=i[a].fontFamily]&&d[r]&&(u[r]=!0);for(var f in u)c+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",d[f],"');\n","\t\t}\n"].join("");return c&&(c=['\t<style type="text/css">',"<![CDATA[\n",c,"]]>","</style>\n"].join("")),c},_setSVGObjects:function(e,t){var r,n,i,o=this._objects;for(n=0,i=o.length;n<i;n++)!(r=o[n]).excludeFromExport&&this._setSVGObject(e,r,t)},_setSVGObject:function(e,t,r){e.push(t.toSVG(r))},_setSVGBgOverlayImage:function(e,t,r){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(r))},_setSVGBgOverlayColor:function(e,r){var n=this[r+"Color"],i=this.viewportTransform,o=this.width,a=this.height;if(n)if(n.toLive){var s=n.repeat,l=t.util.invertTransform(i),c=this[r+"Vpt"]?t.util.matrixToSVG(l):"";e.push('<rect transform="'+c+" translate(",o/2,",",a/2,')"',' x="',n.offsetX-o/2,'" y="',n.offsetY-a/2,'" ','width="',"repeat-y"===s||"no-repeat"===s?n.source.width:o,'" height="',"repeat-x"===s||"no-repeat"===s?n.source.height:a,'" fill="url(#SVGID_'+n.id+')"',"></rect>\n")}else e.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',n,'"',"></rect>\n")},sendToBack:function(e){if(!e)return this;var t,r,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(t=(i=o._objects).length;t--;)r=i[t],n(this._objects,r),this._objects.unshift(r);else n(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,r,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(i=o._objects,t=0;t<i.length;t++)r=i[t],n(this._objects,r),this._objects.push(r);else n(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var r,i,o,a,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(s=l._objects,r=0;r<s.length;r++)i=s[r],(o=this._objects.indexOf(i))>0+c&&(a=o-1,n(this._objects,i),this._objects.splice(a,0,i)),c++;else 0!==(o=this._objects.indexOf(e))&&(a=this._findNewLowerIndex(e,o,t),n(this._objects,e),this._objects.splice(a,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,r){var n,i;if(r){for(n=t,i=t-1;i>=0;--i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){n=i;break}}else n=t-1;return n},bringForward:function(e,t){if(!e)return this;var r,i,o,a,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(r=(s=l._objects).length;r--;)i=s[r],(o=this._objects.indexOf(i))<this._objects.length-1-c&&(a=o+1,n(this._objects,i),this._objects.splice(a,0,i)),c++;else(o=this._objects.indexOf(e))!==this._objects.length-1&&(a=this._findNewUpperIndex(e,o,t),n(this._objects,e),this._objects.splice(a,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,r){var n,i,o;if(r){for(n=t,i=t+1,o=this._objects.length;i<o;++i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){n=i;break}}else n=t+1;return n},moveTo:function(e,t){return n(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(t.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),t.util.setStyle(this.lowerCanvasEl,this._originalCanvasStyle),delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),t.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),e(t.StaticCanvas.prototype,t.Observable),e(t.StaticCanvas.prototype,t.Collection),e(t.StaticCanvas.prototype,t.DataURLExporter),e(t.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(e){var t=l();if(!t||!t.getContext)return null;var r=t.getContext("2d");return r&&"setLineDash"===e?typeof r.setLineDash<"u":null}}),t.StaticCanvas.prototype.toJSON=t.StaticCanvas.prototype.toObject,t.isLikelyNode&&(t.StaticCanvas.prototype.createPNGStream=function(){var e=s(this.lowerCanvasEl);return e&&e.createPNGStream()},t.StaticCanvas.prototype.createJPEGStream=function(e){var t=s(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),t.BaseBrush=t.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(e){e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,r=this.shadow,n=e.contextTop,i=e.getZoom();e&&e._isRetinaScaling()&&(i*=t.devicePixelRatio),n.shadowColor=r.color,n.shadowBlur=r.blur*i,n.shadowOffsetX=r.offsetX*i,n.shadowOffsetY=r.offsetY*i}},needsFullRender:function(){return new t.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),t.PencilBrush=t.util.createClass(t.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(e){this.canvas=e,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(e,t,r){var n=t.midPointFrom(r);return e.quadraticCurveTo(t.x,t.y,n.x,n.y),n},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var r=this._points,n=r.length,i=this.canvas.contextTop;this._saveAndTransform(i),this.oldEnd&&(i.beginPath(),i.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(i,r[n-2],r[n-1],!0),i.stroke(),i.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var r=new t.Point(e.x,e.y);this._reset(),this._addPoint(r),this.canvas.contextTop.moveTo(r.x,r.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1])||(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(e),0))},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(e){var r=new t.Point(e.x,e.y);return this._addPoint(r)},_render:function(e){var r,n,i=this._points[0],o=this._points[1];if(e=e||this.canvas.contextTop,this._saveAndTransform(e),e.beginPath(),2===this._points.length&&i.x===o.x&&i.y===o.y){var a=this.width/1e3;i=new t.Point(i.x,i.y),o=new t.Point(o.x,o.y),i.x-=a,o.x+=a}for(e.moveTo(i.x,i.y),r=1,n=this._points.length;r<n;r++)this._drawSegment(e,i,o),i=this._points[r],o=this._points[r+1];e.lineTo(i.x,i.y),e.stroke(),e.restore()},convertPointsToSVGPath:function(e){var r=this.width/1e3;return t.util.getSmoothPathFromPoints(e,r)},_isEmptySVGPath:function(e){return"M 0 0 Q 0 0 0 0 L 0 0"===t.util.joinPath(e)},createPath:function(e){var r=new t.Path(e,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,r.shadow=new t.Shadow(this.shadow)),r},decimatePoints:function(e,t){if(e.length<=2)return e;var r,n=this.canvas.getZoom(),i=Math.pow(t/n,2),o=e.length-1,a=e[0],s=[a];for(r=1;r<o-1;r++)Math.pow(a.x-e[r].x,2)+Math.pow(a.y-e[r].y,2)>=i&&(a=e[r],s.push(a));return s.push(e[o]),s},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t})}}}),t.CircleBrush=t.util.createClass(t.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),r=this.canvas.contextTop;this._saveAndTransform(r),this.dot(r,t),r.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,r=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(r),e=0,t=n.length;e<t;e++)this.dot(r,n[e]);r.restore()},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e,r,n=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var i=[];for(e=0,r=this.points.length;e<r;e++){var o=this.points[e],a=new t.Circle({radius:o.radius,left:o.x,top:o.y,originX:"center",originY:"center",fill:o.fill});this.shadow&&(a.shadow=new t.Shadow(this.shadow)),i.push(a)}var s=new t.Group(i);s.canvas=this.canvas,this.canvas.fire("before:path:created",{path:s}),this.canvas.add(s),this.canvas.fire("path:created",{path:s}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=n,this.canvas.requestRenderAll()},addPoint:function(e){var r=new t.Point(e.x,e.y),n=t.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,i=new t.Color(this.color).setAlpha(t.util.getRandomInt(0,100)/100).toRgba();return r.radius=n,r.fill=i,this.points.push(r),r}}),t.SprayBrush=t.util.createClass(t.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var r=[],n=0,i=this.sprayChunks.length;n<i;n++)for(var o=this.sprayChunks[n],a=0,s=o.length;a<s;a++){var l=new t.Rect({width:o[a].width,height:o[a].width,left:o[a].x+1,top:o[a].y+1,originX:"center",originY:"center",fill:this.color});r.push(l)}this.optimizeOverlapping&&(r=this._getOptimizedRects(r));var c=new t.Group(r);this.shadow&&c.set("shadow",new t.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:c}),this.canvas.add(c),this.canvas.fire("path:created",{path:c}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t,r,n,i={};for(r=0,n=e.length;r<n;r++)i[t=e[r].left+""+e[r].top]||(i[t]=e[r]);var o=[];for(t in i)o.push(i[t]);return o},render:function(e){var t,r,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),t=0,r=e.length;t<r;t++){var i=e[t];typeof i.opacity<"u"&&(n.globalAlpha=i.opacity),n.fillRect(i.x,i.y,i.width,i.width)}n.restore()},_render:function(){var e,t,r=this.canvas.contextTop;for(r.fillStyle=this.color,this._saveAndTransform(r),e=0,t=this.sprayChunks.length;e<t;e++)this.render(this.sprayChunks[e]);r.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var r,n,i,o,a=this.width/2;for(o=0;o<this.density;o++){r=t.util.getRandomInt(e.x-a,e.x+a),n=t.util.getRandomInt(e.y-a,e.y+a),i=this.dotWidthVariance?t.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var s=new t.Point(r,n);s.width=i,this.randomOpacity&&(s.opacity=t.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(s)}this.sprayChunks.push(this.sprayChunkPoints)}}),t.PatternBrush=t.util.createClass(t.PencilBrush,{getPatternSrc:function(){var e=t.util.createCanvasElement(),r=e.getContext("2d");return e.width=e.height=25,r.fillStyle=this.color,r.beginPath(),r.arc(10,10,10,0,2*Math.PI,!1),r.closePath(),r.fill(),e},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(e){return e.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(e){this.callSuper("_setBrushStyles",e),e.strokeStyle=this.getPattern(e)},createPath:function(e){var r=this.callSuper("createPath",e),n=r._getLeftTopCoords().scalarAdd(r.strokeWidth/2);return r.stroke=new t.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-n.x,offsetY:-n.y}),r}}),function(){var e=t.util.getPointer,r=t.util.degreesToRadians,n=t.util.isTouchEvent;for(var i in t.Canvas=t.util.createClass(t.StaticCanvas,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],enablePointerEvents:!1,_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=t.PencilBrush&&new t.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e,t,r,n=this.getActiveObjects();if(n.length>0&&!this.preserveObjectStacking){t=[],r=[];for(var i=0,o=this._objects.length;i<o;i++)e=this._objects[i],-1===n.indexOf(e)?t.push(e):r.push(e);n.length>1&&(this._activeObject._objects=r),t.push.apply(t,r)}else t=this._objects;return t},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,r){var n=e.calcTransformMatrix(),i=t.util.invertTransform(n),o=this.restorePointerVpt(r);return t.util.transformPoint(o,i)},isTargetTransparent:function(e,r,n){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var i=this._normalizePointer(e,{x:r,y:n}),o=Math.max(e.cacheTranslationX+i.x*e.zoomX,0),a=Math.max(e.cacheTranslationY+i.y*e.zoomY,0);return t.util.isTransparent(e._cacheContext,Math.round(o),Math.round(a),this.targetFindTolerance)}var s=this.contextCache,l=e.selectionBackgroundColor,c=this.viewportTransform;return e.selectionBackgroundColor="",this.clearContext(s),s.save(),s.transform(c[0],c[1],c[2],c[3],c[4],c[5]),e.render(s),s.restore(),e.selectionBackgroundColor=l,t.util.isTransparent(s,r,n,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return Array.isArray(this.selectionKey)?!!this.selectionKey.find(function(t){return!0===e[t]}):e[this.selectionKey]},_shouldClearSelection:function(e,t){var r=this.getActiveObjects(),n=this._activeObject;return!t||t&&n&&r.length>1&&-1===r.indexOf(t)&&n!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&n&&n!==t},_shouldCenterTransform:function(e,t,r){var n;if(e)return"scale"===t||"scaleX"===t||"scaleY"===t||"resizing"===t?n=this.centeredScaling||e.centeredScaling:"rotate"===t&&(n=this.centeredRotation||e.centeredRotation),n?!r:r},_getOriginFromCorner:function(e,t){var r={x:e.originX,y:e.originY};return"ml"===t||"tl"===t||"bl"===t?r.x="right":("mr"===t||"tr"===t||"br"===t)&&(r.x="left"),"tl"===t||"mt"===t||"tr"===t?r.y="bottom":("bl"===t||"mb"===t||"br"===t)&&(r.y="top"),r},_getActionFromCorner:function(e,t,r,n){if(!t||!e)return"drag";var i=n.controls[t];return i.getActionName(r,i,n)},_setupCurrentTransform:function(e,n,i){if(n){var o=this.getPointer(e),a=n.__corner,s=n.controls[a],l=i&&a?s.getActionHandler(e,n,s):t.controlsUtils.dragHandler,c=this._getActionFromCorner(i,a,e,n),u=this._getOriginFromCorner(n,a),d=e[this.centeredKey],h={target:n,action:c,actionHandler:l,corner:a,scaleX:n.scaleX,scaleY:n.scaleY,skewX:n.skewX,skewY:n.skewY,offsetX:o.x-n.left,offsetY:o.y-n.top,originX:u.x,originY:u.y,ex:o.x,ey:o.y,lastX:o.x,lastY:o.y,theta:r(n.angle),width:n.width*n.scaleX,shiftKey:e.shiftKey,altKey:d,original:t.util.saveObjectTransform(n)};this._shouldCenterTransform(n,c,d)&&(h.originX="center",h.originY="center"),h.original.originX=u.x,h.original.originY=u.y,this._currentTransform=h,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var r=this._groupSelector,n=new t.Point(r.ex,r.ey),i=t.util.transformPoint(n,this.viewportTransform),o=new t.Point(r.ex+r.left,r.ey+r.top),a=t.util.transformPoint(o,this.viewportTransform),s=Math.min(i.x,a.x),l=Math.min(i.y,a.y),c=Math.max(i.x,a.x),u=Math.max(i.y,a.y),d=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(s,l,c-s,u-l)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,s+=d,l+=d,c-=d,u-=d,t.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(s,l,c-s,u-l))},findTarget:function(e,t){if(!this.skipTargetFind){var r,i,o=this.getPointer(e,!0),a=this._activeObject,s=this.getActiveObjects(),l=n(e),c=s.length>1&&!t||1===s.length;if(this.targets=[],c&&a._findTargetCorner(o,l)||s.length>1&&!t&&a===this._searchPossibleTargets([a],o))return a;if(1===s.length&&a===this._searchPossibleTargets([a],o)){if(!this.preserveObjectStacking)return a;r=a,i=this.targets,this.targets=[]}var u=this._searchPossibleTargets(this._objects,o);return e[this.altSelectionKey]&&u&&r&&u!==r&&(u=r,this.targets=i),u}},_checkTarget:function(e,t,r){if(t&&t.visible&&t.evented&&t.containsPoint(e)){if(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)return!0;if(!this.isTargetTransparent(t,r.x,r.y))return!0}},_searchPossibleTargets:function(e,r){for(var n,i,o=e.length;o--;){var a=e[o],s=a.group?this._normalizePointer(a.group,r):r;if(this._checkTarget(s,a,r)){(n=e[o]).subTargetCheck&&n instanceof t.Group&&(i=this._searchPossibleTargets(n._objects,r))&&this.targets.push(i);break}}return n},restorePointerVpt:function(e){return t.util.transformPoint(e,t.util.invertTransform(this.viewportTransform))},getPointer:function(t,r){if(this._absolutePointer&&!r)return this._absolutePointer;if(this._pointer&&r)return this._pointer;var n,i=e(t),o=this.upperCanvasEl,a=o.getBoundingClientRect(),s=a.width||0,l=a.height||0;(!s||!l)&&("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(s=Math.abs(a.right-a.left))),this.calcOffset(),i.x=i.x-this._offset.left,i.y=i.y-this._offset.top,r||(i=this.restorePointerVpt(i));var c=this.getRetinaScaling();return 1!==c&&(i.x/=c,i.y/=c),n=0===s||0===l?{width:1,height:1}:{width:o.width/s,height:o.height/l},{x:i.x*n.width,y:i.y*n.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),r=this.lowerCanvasEl,n=this.upperCanvasEl;n?n.className="":(n=this._createCanvasElement(),this.upperCanvasEl=n),t.util.addClass(n,"upper-canvas "+e),this.wrapperEl.appendChild(n),this._copyCanvasStyle(r,n),this._applyCanvasStyle(n),this.contextTop=n.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=t.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),t.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),t.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var r=this.width||e.width,n=this.height||e.height;t.util.setStyle(e,{position:"absolute",width:r+"px",height:n+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=r,e.height=n,t.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?"activeSelection"===e.type&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,t){var r=!1,n=this.getActiveObjects(),i=[],o=[];e.forEach(function(e){-1===n.indexOf(e)&&(r=!0,e.fire("deselected",{e:t,target:e}),o.push(e))}),n.forEach(function(n){-1===e.indexOf(n)&&(r=!0,n.fire("selected",{e:t,target:n}),i.push(n))}),e.length>0&&n.length>0?r&&this.fire("selection:updated",{e:t,selected:i,deselected:o}):n.length>0?this.fire("selection:created",{e:t,selected:i}):e.length>0&&this.fire("selection:cleared",{e:t,deselected:o})},setActiveObject:function(e,t){var r=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(r,t),this},_setActiveObject:function(e,t){return!(this._activeObject===e||!this._discardActiveObject(t,e)||e.onSelect({e:t}))&&(this._activeObject=e,!0)},_discardActiveObject:function(e,t){var r=this._activeObject;if(r){if(r.onDeselect({e:e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),r=this.getActiveObject();return t.length&&this.fire("before:selection:cleared",{target:r,e:e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,t.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,r){var n=this._realizeGroupTransformOnObject(e),i=this.callSuper("_toObject",e,t,r);return this._unwindGroupTransformOnObject(e,n),i},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var r={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach(function(t){r[t]=e[t]}),t.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),r}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,r){var n=this._realizeGroupTransformOnObject(t);this.callSuper("_setSVGObject",e,t,r),this._unwindGroupTransformOnObject(t,n)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),t.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),t.StaticCanvas)"prototype"!==i&&(t.Canvas[i]=t.StaticCanvas[i])}(),function(){var e=t.util.addListener,r=t.util.removeListener,n={passive:!1};function i(e,t){return e.button&&e.button===t-1}t.util.object.extend(t.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(e,r){var i=this.upperCanvasEl,o=this._getEventPrefix();e(t.window,"resize",this._onResize),e(i,o+"down",this._onMouseDown),e(i,o+"move",this._onMouseMove,n),e(i,o+"out",this._onMouseOut),e(i,o+"enter",this._onMouseEnter),e(i,"wheel",this._onMouseWheel),e(i,"contextmenu",this._onContextMenu),e(i,"dblclick",this._onDoubleClick),e(i,"dragover",this._onDragOver),e(i,"dragenter",this._onDragEnter),e(i,"dragleave",this._onDragLeave),e(i,"drop",this._onDrop),this.enablePointerEvents||e(i,"touchstart",this._onTouchStart,n),typeof eventjs<"u"&&r in eventjs&&(eventjs[r](i,"gesture",this._onGesture),eventjs[r](i,"drag",this._onDrag),eventjs[r](i,"orientation",this._onOrientationChange),eventjs[r](i,"shake",this._onShake),eventjs[r](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(r,"remove");var e=this._getEventPrefix();r(t.document,e+"up",this._onMouseUp),r(t.document,"touchend",this._onTouchEnd,n),r(t.document,e+"move",this._onMouseMove,n),r(t.document,"touchmove",this._onMouseMove,n)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire("mouse:out",{target:t,e:e}),this._hoveredTarget=null,t&&t.fire("mouseout",{e:e});var r=this;this._hoveredTargets.forEach(function(n){r.fire("mouse:out",{target:t,e:e}),n&&t.fire("mouseout",{e:e})}),this._hoveredTargets=[]},_onMouseEnter:function(e){!this._currentTransform&&!this.findTarget(e)&&(this.fire("mouse:over",{target:null,e:e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler("dragover",e);this._fireEnterLeaveEvents(t,e)},_onDrop:function(e){return this._simpleEventHandler("drop:before",e),this._simpleEventHandler("drop",e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"dblclick"),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&("touchend"===e.type&&0===e.touches.length||!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId)},_onTouchStart:function(i){i.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(i)),this.__onMouseDown(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();e(t.document,"touchend",this._onTouchEnd,n),e(t.document,"touchmove",this._onMouseMove,n),r(o,a+"down",this._onMouseDown)},_onMouseDown:function(i){this.__onMouseDown(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();r(o,a+"move",this._onMouseMove,n),e(t.document,a+"up",this._onMouseUp),e(t.document,a+"move",this._onMouseMove,n)},_onTouchEnd:function(i){if(!(i.touches.length>0)){this.__onMouseUp(i),this._resetTransformEventData(),this.mainTouchId=null;var o=this._getEventPrefix();r(t.document,"touchend",this._onTouchEnd,n),r(t.document,"touchmove",this._onMouseMove,n);var a=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){e(a.upperCanvasEl,o+"down",a._onMouseDown),a._willAddMouseDown=0},400)}},_onMouseUp:function(i){this.__onMouseUp(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();this._isMainEvent(i)&&(r(t.document,a+"up",this._onMouseUp),r(t.document,a+"move",this._onMouseMove,n),e(o,a+"move",this._onMouseMove,n))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!=!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var r,n=this._currentTransform,o=this._groupSelector,a=!1,s=!o||0===o.left&&0===o.top;if(this._cacheTransformEventData(e),r=this._target,this._handleEvent(e,"up:before"),i(e,3))this.fireRightClick&&this._handleEvent(e,"up",3,s);else{if(i(e,2))return this.fireMiddleClick&&this._handleEvent(e,"up",2,s),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(n&&(this._finalizeCurrentTransform(e),a=n.actionPerformed),!s){var l=r===this._activeObject;this._maybeGroupObjects(e),a||(a=this._shouldRender(r)||!l&&r===this._activeObject)}var c,u;if(r){if(c=r._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e)),r.selectable&&r!==this._activeObject&&"up"===r.activeOn)this.setActiveObject(r,e),a=!0;else{var d=r.controls[c],h=d&&d.getMouseUpHandler(e,r,d);h&&h(e,n,(u=this.getPointer(e)).x,u.y)}r.isMoving=!1}if(n&&(n.target!==r||n.corner!==c)){var f=n.target&&n.target.controls[n.corner],p=f&&f.getMouseUpHandler(e,r,d);u=u||this.getPointer(e),p&&p(e,n,u.x,u.y)}this._setCursorFromEvent(e,r),this._handleEvent(e,"up",1,s),this._groupSelector=null,this._currentTransform=null,r&&(r.__corner=0),a?this.requestRenderAll():s||this.renderTop()}}},_simpleEventHandler:function(e,t){var r=this.findTarget(t),n=this.targets,i={e:t,target:r,subTargets:n};if(this.fire(e,i),r&&r.fire(e,i),!n)return r;for(var o=0;o<n.length;o++)n[o].fire(e,i);return r},_handleEvent:function(e,t,r,n){var i=this._target,o=this.targets||[],a={e:e,target:i,subTargets:o,button:r||1,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===t&&(a.currentTarget=this.findTarget(e),a.currentSubTargets=this.targets),this.fire("mouse:"+t,a),i&&i.fire("mouse"+t,a);for(var s=0;s<o.length;s++)o[s].fire("mouse"+t,a)},_finalizeCurrentTransform:function(e){var t=this._currentTransform,r=t.target,n={e:e,target:r,transform:t,action:t.action};r._scaling&&(r._scaling=!1),r.setCoords(),(t.actionPerformed||this.stateful&&r.hasStateChanged())&&this._fire("modified",n)},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e:e,pointer:t}),this._handleEvent(e,"down")},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e:e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,"move")},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:e,pointer:t}),this._handleEvent(e,"up")},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"down:before");var r=this._target;if(i(e,3))this.fireRightClick&&this._handleEvent(e,"down",3);else if(i(e,2))this.fireMiddleClick&&this._handleEvent(e,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(e);else if(this._isMainEvent(e)&&!this._currentTransform){var n=this._pointer;this._previousPointer=n;var o=this._shouldRender(r),a=this._shouldGroup(e,r);if(this._shouldClearSelection(e,r)?this.discardActiveObject(e):a&&(this._handleGrouping(e,r),r=this._activeObject),this.selection&&(!r||!r.selectable&&!r.isEditing&&r!==this._activeObject)&&(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),r){var s=r===this._activeObject;r.selectable&&"down"===r.activeOn&&this.setActiveObject(r,e);var l=r._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e));if(r.__corner=l,r===this._activeObject&&(l||!a)){this._setupCurrentTransform(e,r,s);var c=r.controls[l],u=(n=this.getPointer(e),c&&c.getMouseDownHandler(e,r,c));u&&u(e,this._currentTransform,n.x,n.y)}}this._handleEvent(e,"down"),(o||a)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire("before:transform",{e:e,transform:t})},__onMouseMove:function(e){var t,r;if(this._handleEvent(e,"move:before"),this._cacheTransformEventData(e),this.isDrawingMode)this._onMouseMoveInDrawingMode(e);else if(this._isMainEvent(e)){var n=this._groupSelector;n?(r=this._absolutePointer,n.left=r.x-n.ex,n.top=r.y-n.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var r=this._hoveredTarget,n=this._hoveredTargets,i=this.targets,o=Math.max(n.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:r,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(i[a],t,{oldTarget:n[a],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var r=this._draggedoverTarget,n=this._hoveredTargets,i=this.targets,o=Math.max(n.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:r,evtOut:"dragleave",evtIn:"dragenter"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(i[a],t,{oldTarget:n[a],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,r){var n,i,o,a=r.oldTarget,s=a!==e,l=r.canvasEvtIn,c=r.canvasEvtOut;s&&(n={e:t,target:e,previousTarget:a},i={e:t,target:a,nextTarget:e}),o=e&&s,a&&s&&(c&&this.fire(c,i),a.fire(r.evtOut,i)),o&&(l&&this.fire(l,n),e.fire(r.evtIn,n))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"wheel"),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),r=this._currentTransform;r.reset=!1,r.shiftKey=e.shiftKey,r.altKey=e[this.centeredKey],this._performTransformAction(e,r,t),r.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,r){var n=r.x,i=r.y,o=t.action,a=!1,s=t.actionHandler;s&&(a=s(e,t,n,i)),"drag"===o&&a&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||a},_fire:t.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;var r=t.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,i=(!n||!n.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));i?this.setCursor(this.getCornerCursor(i,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map(function(e){r=e.hoverCursor||r}),this.setCursor(r))},getCornerCursor:function(e,t,r){var n=t.controls[e];return n.cursorStyleHandler(r,n,t)}})}(),function(){var e=Math.min,r=Math.max;t.util.object.extend(t.Canvas.prototype,{_shouldGroup:function(e,t){var r=this._activeObject;return r&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(r!==t||"activeSelection"===r.type)&&!t.onSelect({e:e})},_handleGrouping:function(e,t){var r=this._activeObject;r.__corner||t===r&&(!(t=this.findTarget(e,!0))||!t.selectable)||(r&&"activeSelection"===r.type?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var r=this._activeObject,n=r._objects.slice(0);r.contains(e)?(r.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),1===r.size()&&this._setActiveObject(r.item(0),t)):(r.addWithUpdate(e),this._hoveredTarget=r,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(n,t)},_createActiveSelection:function(e,t){var r=this.getActiveObjects(),n=this._createGroup(e);this._hoveredTarget=n,this._setActiveObject(n,t),this._fireSelectionEvents(r,t)},_createGroup:function(e){var r=this._objects,n=r.indexOf(this._activeObject)<r.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new t.ActiveSelection(n,{canvas:this})},_groupSelectedObjects:function(e){var r,n=this._collectObjects(e);1===n.length?this.setActiveObject(n[0],e):n.length>1&&(r=new t.ActiveSelection(n.reverse(),{canvas:this}),this.setActiveObject(r,e))},_collectObjects:function(n){for(var i,o=[],a=this._groupSelector.ex,s=this._groupSelector.ey,l=a+this._groupSelector.left,c=s+this._groupSelector.top,u=new t.Point(e(a,l),e(s,c)),d=new t.Point(r(a,l),r(s,c)),h=!this.selectionFullyContained,f=a===l&&s===c,p=this._objects.length;p--&&!((i=this._objects[p])&&i.selectable&&i.visible&&(h&&i.intersectsWithRect(u,d,!0)||i.isContainedWithinRect(u,d,!0)||h&&i.containsPoint(u,null,!0)||h&&i.containsPoint(d,null,!0))&&(o.push(i),f)););return o.length>1&&(o=o.filter(function(e){return!e.onSelect({e:n})})),o},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),t.util.object.extend(t.StaticCanvas.prototype,{toDataURL:function(e){e||(e={});var r=e.format||"png",n=e.quality||1,i=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),o=this.toCanvasElement(i,e);return t.util.toDataURL(o,r,n)},toCanvasElement:function(e,r){e=e||1;var n=((r=r||{}).width||this.width)*e,i=(r.height||this.height)*e,o=this.getZoom(),a=this.width,s=this.height,l=o*e,c=this.viewportTransform,u=(c[4]-(r.left||0))*e,d=(c[5]-(r.top||0))*e,h=this.interactive,f=[l,0,0,l,u,d],p=this.enableRetinaScaling,g=t.util.createCanvasElement(),m=this.contextTop;return g.width=n,g.height=i,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=n,this.height=i,this.calcViewportBoundaries(),this.renderCanvas(g.getContext("2d"),this._objects),this.viewportTransform=c,this.width=a,this.height=s,this.calcViewportBoundaries(),this.interactive=h,this.enableRetinaScaling=p,this.contextTop=m,g}}),t.util.object.extend(t.StaticCanvas.prototype,{loadFromJSON:function(e,r,n){if(e){var i="string"==typeof e?JSON.parse(e):t.util.object.clone(e),o=this,a=i.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete i.clipPath,this._enlivenObjects(i.objects,function(e){o.clear(),o._setBgOverlay(i,function(){a?o._enlivenObjects([a],function(t){o.clipPath=t[0],o.__setupCanvas.call(o,i,e,s,r)}):o.__setupCanvas.call(o,i,e,s,r)})},n),this}},__setupCanvas:function(e,t,r,n){var i=this;t.forEach(function(e,t){i.insertAt(e,t)}),this.renderOnAddRemove=r,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),n&&n()},_setBgOverlay:function(e,t){var r={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var n=function(){r.backgroundImage&&r.overlayImage&&r.backgroundColor&&r.overlayColor&&t&&t()};this.__setBgOverlay("backgroundImage",e.backgroundImage,r,n),this.__setBgOverlay("overlayImage",e.overlayImage,r,n),this.__setBgOverlay("backgroundColor",e.background,r,n),this.__setBgOverlay("overlayColor",e.overlay,r,n)}else t&&t()},__setBgOverlay:function(e,r,n,i){var o=this;if(!r)return n[e]=!0,void(i&&i());"backgroundImage"===e||"overlayImage"===e?t.util.enlivenObjects([r],function(t){o[e]=t[0],n[e]=!0,i&&i()}):this["set"+t.util.string.capitalize(e,!0)](r,function(){n[e]=!0,i&&i()})},_enlivenObjects:function(e,r,n){e&&0!==e.length?t.util.enlivenObjects(e,function(e){r&&r(e)},null,n):r&&r([])},_toDataURL:function(e,t){this.clone(function(r){t(r.toDataURL(e))})},_toDataURLWithMultiplier:function(e,t,r){this.clone(function(n){r(n.toDataURLWithMultiplier(e,t))})},clone:function(e,t){var r=JSON.stringify(this.toJSON(t));this.cloneWithoutData(function(t){t.loadFromJSON(r,function(){e&&e(t)})})},cloneWithoutData:function(e){var r=t.util.createCanvasElement();r.width=this.width,r.height=this.height;var n=new t.Canvas(r);this.backgroundImage?(n.setBackgroundImage(this.backgroundImage.src,function(){n.renderAll(),e&&e(n)}),n.backgroundImageOpacity=this.backgroundImageOpacity,n.backgroundImageStretch=this.backgroundImageStretch):e&&e(n)}}),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.util.object.clone,i=t.util.toFixed,o=t.util.string.capitalize,a=t.util.degreesToRadians,s=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var r=t.perfLimitSizeTotal,n=e.width,i=e.height,o=t.maxCacheSideLimit,a=t.minCacheSideLimit;if(n<=o&&i<=o&&n*i<=r)return n<a&&(e.width=a),i<a&&(e.height=a),e;var s=n/i,l=t.util.limitDimsByArea(s,r),c=t.util.capValue,u=c(a,l.x,o),d=c(a,l.y,o);return n>u&&(e.zoomX/=n/u,e.width=u,e.capped=!0),i>d&&(e.zoomY/=i/d,e.height=d,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),r=t.x*e.scaleX/this.scaleX,n=t.y*e.scaleY/this.scaleY;return{width:r+2,height:n+2,zoomX:e.scaleX,zoomY:e.scaleY,x:r,y:n}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var r=e._currentTransform.target,n=e._currentTransform.action;if(this===r&&n.slice&&"scale"===n.slice(0,5))return!1}var i,o,a=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),l=t.minCacheSideLimit,c=s.width,u=s.height,d=s.zoomX,h=s.zoomY,f=c!==this.cacheWidth||u!==this.cacheHeight,p=this.zoomX!==d||this.zoomY!==h,g=f||p,m=0,v=0,y=!1;if(f){var b=this._cacheCanvas.width,w=this._cacheCanvas.height,x=c>b||u>w;y=x||(c<.9*b||u<.9*w)&&b>l&&w>l,x&&!s.capped&&(c>l||u>l)&&(m=.1*c,v=.1*u)}return this instanceof t.Text&&this.path&&(g=!0,y=!0,m+=this.getHeightOfLine(0)*this.zoomX,v+=this.getHeightOfLine(0)*this.zoomY),!!g&&(y?(a.width=Math.ceil(c+m),a.height=Math.ceil(u+v)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,a.width,a.height)),i=s.x/2,o=s.y/2,this.cacheTranslationX=Math.round(a.width/2-i)+i,this.cacheTranslationY=Math.round(a.height/2-o)+o,this.cacheWidth=c,this.cacheHeight=u,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(d,h),this.zoomX=d,this.zoomY=h,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,"fill"),this._initGradient(e.stroke,"stroke"),this._initPattern(e.fill,"fill"),this._initPattern(e.stroke,"stroke")},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,r=this.calcTransformMatrix(!t);e.transform(r[0],r[1],r[2],r[3],r[4],r[5])},toObject:function(e){var r=t.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:i(this.left,r),top:i(this.top,r),width:i(this.width,r),height:i(this.height,r),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:i(this.strokeWidth,r),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:i(this.strokeMiterLimit,r),scaleX:i(this.scaleX,r),scaleY:i(this.scaleY,r),angle:i(this.angle,r),flipX:this.flipX,flipY:this.flipY,opacity:i(this.opacity,r),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:i(this.skewX,r),skewY:i(this.skewY,r)};return this.clipPath&&!this.clipPath.excludeFromExport&&(n.clipPath=this.clipPath.toObject(e),n.clipPath.inverted=this.clipPath.inverted,n.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,n,e),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var r=t.util.getKlass(e.type).prototype;return r.stateProperties.forEach(function(t){"left"===t||"top"===t||(e[t]===r[t]&&delete e[t],Array.isArray(e[t])&&Array.isArray(r[t])&&0===e[t].length&&0===r[t].length&&delete e[t])}),e},toString:function(){return"#<fabric."+o(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,r=e.scaleY;if(this.canvas){var n=this.canvas.getZoom(),i=this.canvas.getRetinaScaling();t*=n*i,r*=n*i}return{scaleX:t,scaleY:r}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,r){var n="scaleX"===e||"scaleY"===e,i=this[e]!==r,o=!1;return n&&(r=this._constrainScale(r)),"scaleX"===e&&r<0?(this.flipX=!this.flipX,r*=-1):"scaleY"===e&&r<0?(this.flipY=!this.flipY,r*=-1):"shadow"!==e||!r||r instanceof t.Shadow?"dirty"===e&&this.group&&this.group.set("dirty",r):r=new t.Shadow(r),this[e]=r,i&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(e)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),e.restore())},renderCache:function(e){e=e||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!!("stroke"===this.paintFirst&&this.hasFill()&&this.hasStroke()&&"object"==typeof this.shadow||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(e,r){if(e.save(),r.inverted?e.globalCompositeOperation="destination-out":e.globalCompositeOperation="destination-in",r.absolutePositioned){var n=t.util.invertTransform(this.calcTransformMatrix());e.transform(n[0],n[1],n[2],n[3],n[4],n[5])}r.transform(e),e.scale(1/r.zoomX,1/r.zoomY),e.drawImage(r._cacheCanvas,-r.cacheTranslationX,-r.cacheTranslationY),e.restore()},drawObject:function(e,t){var r=this.fill,n=this.stroke;t?(this.fill="black",this.stroke="",this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e,this.clipPath),this.fill=r,this.stroke=n},_drawClipPath:function(e,t){t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e,t))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!e){var t=this.cacheWidth/this.zoomX,r=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-r/2,t,r)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var r=t.stroke;r&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,r.toLive?"percentage"===r.gradientUnits||r.gradientTransform||r.patternTransform?this._applyPatternForTransformedGradient(e,r):(e.strokeStyle=r.toLive(e,this),this._applyPatternGradientTransform(e,r)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var r=t.fill;r&&(r.toLive?(e.fillStyle=r.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=r)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle="transparent",e.fillStyle="#000000"},_setLineDash:function(e,t){!t||0===t.length||(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,r){var n,i,o,s=this.getViewportTransform(),l=this.calcTransformMatrix();i=typeof(r=r||{}).hasBorders<"u"?r.hasBorders:this.hasBorders,o=typeof r.hasControls<"u"?r.hasControls:this.hasControls,l=t.util.multiplyTransformMatrices(s,l),n=t.util.qrDecompose(l),e.save(),e.translate(n.translateX,n.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(n.angle-=180),e.rotate(a(this.group?n.angle:this.angle)),r.forActiveSelection||this.group?i&&this.drawBordersInGroup(e,n,r):i&&this.drawBorders(e,r),o&&this.drawControls(e,r),e.restore()},_setShadow:function(e){if(this.shadow){var r,n=this.shadow,i=this.canvas,o=i&&i.viewportTransform[0]||1,a=i&&i.viewportTransform[3]||1;r=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),i&&i._isRetinaScaling()&&(o*=t.devicePixelRatio,a*=t.devicePixelRatio),e.shadowColor=n.color,e.shadowBlur=n.blur*t.browserShadowBlurConstant*(o+a)*(r.scaleX+r.scaleY)/4,e.shadowOffsetX=n.offsetX*o*r.scaleX,e.shadowOffsetY=n.offsetY*a*r.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var r=t.gradientTransform||t.patternTransform,n=-this.width/2+t.offsetX||0,i=-this.height/2+t.offsetY||0;return"percentage"===t.gradientUnits?e.transform(this.width,0,0,this.height,n,i):e.transform(1,0,0,1,n,i),r&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),{offsetX:n,offsetY:i}},_renderPaintInOrder:function(e){"stroke"===this.paintFirst?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),"evenodd"===this.fillRule?e.fill("evenodd"):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,r){var n,i=this._limitCacheSize(this._getCacheCanvasDimensions()),o=t.util.createCanvasElement(),a=this.canvas.getRetinaScaling(),s=i.x/this.scaleX/a,l=i.y/this.scaleY/a;o.width=s,o.height=l,(n=o.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(s,0),n.lineTo(s,l),n.lineTo(0,l),n.closePath(),n.translate(s/2,l/2),n.scale(i.zoomX/this.scaleX/a,i.zoomY/this.scaleY/a),this._applyPatternGradientTransform(n,r),n.fillStyle=r.toLive(e),n.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(a*this.scaleX/i.zoomX,a*this.scaleY/i.zoomY),e.strokeStyle=n.createPattern(o,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",e.scaleX),this.set("scaleY",e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var r=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),r=t.util.transformPoint(r,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,r.x+=e.offsetLeft,r.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(r,"center","center")},clone:function(e,r){var n=this.toObject(r);this.constructor.fromObject?this.constructor.fromObject(n,e):t.Object._fromObject("Object",n,e)},cloneAsImage:function(e,r){var n=this.toCanvasElement(r);return e&&e(new t.Image(n)),this},toCanvasElement:function(e){e||(e={});var r=t.util,n=r.saveObjectTransform(this),i=this.group,o=this.shadow,a=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&r.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var l,c,u,d,h=t.util.createCanvasElement(),f=this.getBoundingRect(!0,!0),p=this.shadow,g={x:0,y:0};p&&(c=p.blur,l=p.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(a(p.offsetX)+c)*a(l.scaleX),g.y=2*Math.round(a(p.offsetY)+c)*a(l.scaleY)),u=f.width+g.x,d=f.height+g.y,h.width=Math.ceil(u),h.height=Math.ceil(d);var m=new t.StaticCanvas(h,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===e.format&&(m.backgroundColor="#fff"),this.setPositionByOrigin(new t.Point(m.width/2,m.height/2),"center","center");var v=this.canvas;m.add(this);var y=m.toCanvasElement(s||1,e);return this.shadow=o,this.set("canvas",v),i&&(this.group=i),this.set(n).setCoords(),m._objects=[],m.dispose(),m=null,y},toDataURL:function(e){return e||(e={}),t.util.toDataURL(this.toCanvasElement(e),e.format||"png",e.quality||1)},isType:function(e){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set("angle",e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,r){r=r||this.canvas.getPointer(e);var n=new t.Point(r.x,r.y),i=this._getLeftTopCoords();return this.angle&&(n=t.util.rotatePoint(n,i,a(-this.angle))),{x:n.x-i.x,y:n.y-i.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){t.runningAnimations&&t.runningAnimations.cancelByTarget(this)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),r(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object.ENLIVEN_PROPS=["clipPath"],t.Object._fromObject=function(e,r,i,o){var a=t[e];r=n(r,!0),t.util.enlivenPatterns([r.fill,r.stroke],function(e){typeof e[0]<"u"&&(r.fill=e[0]),typeof e[1]<"u"&&(r.stroke=e[1]),t.util.enlivenObjectEnlivables(r,r,function(){var e=o?new a(r[o],r):new a(r);i&&i(e)})})},t.Object.__uid=0)}(e),function(){var e=t.util.degreesToRadians,r={left:-.5,center:0,right:.5},n={top:-.5,center:0,bottom:.5};t.util.object.extend(t.Object.prototype,{translateToGivenOrigin:function(e,i,o,a,s){var l,c,u,d=e.x,h=e.y;return"string"==typeof i?i=r[i]:i-=.5,"string"==typeof a?a=r[a]:a-=.5,"string"==typeof o?o=n[o]:o-=.5,"string"==typeof s?s=n[s]:s-=.5,c=s-o,((l=a-i)||c)&&(u=this._getTransformedDimensions(),d=e.x+l*u.x,h=e.y+c*u.y),new t.Point(d,h)},translateToCenterPoint:function(r,n,i){var o=this.translateToGivenOrigin(r,n,i,"center","center");return this.angle?t.util.rotatePoint(o,r,e(this.angle)):o},translateToOriginPoint:function(r,n,i){var o=this.translateToGivenOrigin(r,"center","center",n,i);return this.angle?t.util.rotatePoint(o,r,e(this.angle)):o},getCenterPoint:function(){var e=new t.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var r=this.getCenterPoint();return this.translateToOriginPoint(r,e,t)},toLocalPoint:function(r,n,i){var o,a,s=this.getCenterPoint();return o=typeof n<"u"&&typeof i<"u"?this.translateToGivenOrigin(s,"center","center",n,i):new t.Point(this.left,this.top),a=new t.Point(r.x,r.y),this.angle&&(a=t.util.rotatePoint(a,s,-e(this.angle))),a.subtractEquals(o)},setPositionByOrigin:function(e,t,r){var n=this.translateToCenterPoint(e,t,r),i=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",i.x),this.set("top",i.y)},adjustPosition:function(n){var i,o,a=e(this.angle),s=this.getScaledWidth(),l=t.util.cos(a)*s,c=t.util.sin(a)*s;i="string"==typeof this.originX?r[this.originX]:this.originX-.5,o="string"==typeof n?r[n]:n-.5,this.left+=l*(o-i),this.top+=c*(o-i),this.setCoords(),this.originX=n},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX="center",this.originY="center",this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){var e=t.util,r=e.degreesToRadians,n=e.multiplyTransformMatrices,i=e.transformPoint;e.object.extend(t.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,r){return function(e){return[new t.Point(e.tl.x,e.tl.y),new t.Point(e.tr.x,e.tr.y),new t.Point(e.br.x,e.br.y),new t.Point(e.bl.x,e.bl.y)]}(this._getCoords(e,r))},intersectsWithRect:function(e,r,n,i){var o=this.getCoords(n,i);return"Intersection"===t.Intersection.intersectPolygonRectangle(o,e,r).status},intersectsWithObject:function(e,r,n){return"Intersection"===t.Intersection.intersectPolygonPolygon(this.getCoords(r,n),e.getCoords(r,n)).status||e.isContainedWithinObject(this,r,n)||this.isContainedWithinObject(e,r,n)},isContainedWithinObject:function(e,t,r){for(var n=this.getCoords(t,r),i=t?e.aCoords:e.lineCoords,o=0,a=e._getImageLines(i);o<4;o++)if(!e.containsPoint(n[o],a))return!1;return!0},isContainedWithinRect:function(e,t,r,n){var i=this.getBoundingRect(r,n);return i.left>=e.x&&i.left+i.width<=t.x&&i.top>=e.y&&i.top+i.height<=t.y},containsPoint:function(e,t,r,n){var i=this._getCoords(r,n),o=(t=t||this._getImageLines(i),this._findCrossPoints(e,t));return 0!==o&&o%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,r=this.canvas.vptCoords.br;return!(!this.getCoords(!0,e).some(function(e){return e.x<=r.x&&e.x>=t.x&&e.y<=r.y&&e.y>=t.y})&&!this.intersectsWithRect(t,r,!0,e))||this._containsCenterOfCanvas(t,r,e)},_containsCenterOfCanvas:function(e,t,r){var n={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(n,null,!0,r)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,r=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,r,!0,e)||this.getCoords(!0,e).every(function(e){return(e.x>=r.x||e.x<=t.x)&&(e.y>=r.y||e.y<=t.y)})&&this._containsCenterOfCanvas(t,r,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var r,n,i,o,a,s=0;for(var l in t)if(!((a=t[l]).o.y<e.y&&a.d.y<e.y||a.o.y>=e.y&&a.d.y>=e.y||(a.o.x===a.d.x&&a.o.x>=e.x?o=a.o.x:(r=(a.d.y-a.o.y)/(a.d.x-a.o.x),n=e.y-0*e.x,i=a.o.y-r*a.o.x,o=-(n-i)/(0-r)),o>=e.x&&(s+=1),2!==s)))break;return s},getBoundingRect:function(t,r){var n=this.getCoords(t,r);return e.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:0===e?1e-4:e},scale:function(e){return this._set("scaleX",e),this._set("scaleY",e),this.setCoords()},scaleToWidth:function(e,t){var r=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/r)},scaleToHeight:function(e,t){var r=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/r)},calcLineCoords:function(){var t=this.getViewportTransform(),n=this.padding,o=r(this.angle),a=e.cos(o)*n,s=e.sin(o)*n,l=a+s,c=a-s,u=this.calcACoords(),d={tl:i(u.tl,t),tr:i(u.tr,t),bl:i(u.bl,t),br:i(u.br,t)};return n&&(d.tl.x-=c,d.tl.y-=l,d.tr.x+=l,d.tr.y-=c,d.bl.x-=l,d.bl.y+=c,d.br.x+=c,d.br.y+=l),d},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),r=this.getViewportTransform(),i=n(r,t),o=n(i,e),a=(o=n(o,[1/r[0],0,0,1/r[3],0,0]),this._calculateCurrentDimensions()),s={};return this.forEachControl(function(e,t,r){s[t]=e.positionHandler(a,o,r)}),s},calcACoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),r=n(t,e),o=this._getTransformedDimensions(),a=o.x/2,s=o.y/2;return{tl:i({x:-a,y:-s},r),tr:i({x:a,y:-s},r),bl:i({x:-a,y:s},r),br:i({x:a,y:s},r)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t="_",r="";return!e&&this.group&&(r=this.group.transformMatrixKey(e)+t),r+this.top+t+this.left+t+this.scaleX+t+this.scaleY+t+this.skewX+t+this.skewY+t+this.angle+t+this.originX+t+this.originY+t+this.width+t+this.height+t+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var r=this.transformMatrixKey(e),i=this.matrixCache||(this.matrixCache={});return i.key===r?i.value:(this.group&&(t=n(this.group.calcTransformMatrix(!1),t)),i.key=r,i.value=t,t)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),r=this.ownMatrixCache||(this.ownMatrixCache={});if(r.key===t)return r.value;var n=this._calcTranslateMatrix(),i={angle:this.angle,translateX:n[4],translateY:n[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return r.key=t,r.value=e.composeMatrix(i),r.value},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(t,r){typeof t>"u"&&(t=this.skewX),typeof r>"u"&&(r=this.skewY);var n,i,o,a=0===t&&0===r;if(this.strokeUniform?(i=this.width,o=this.height):(i=(n=this._getNonTransformedDimensions()).x,o=n.y),a)return this._finalizeDimensions(i*this.scaleX,o*this.scaleY);var s=e.sizeAfterTransform(i,o,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:r});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform(),t=this._getTransformedDimensions();return i(t,e,!0).scalarAdd(2*this.padding)}})}(),t.util.object.extend(t.Object.prototype,{sendToBack:function(){return this.group?t.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?t.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?t.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?t.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&"activeSelection"!==this.group.type?t.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),function(){function e(e,r){if(r){if(r.toLive)return e+": url(#SVGID_"+r.id+"); ";var n=new t.Color(r),i=e+": "+n.toRgb()+"; ",o=n.getAlpha();return 1!==o&&(i+=e+"-opacity: "+o.toString()+"; "),i}return e+": none; "}var r=t.util.toFixed;t.util.object.extend(t.Object.prototype,{getSvgStyles:function(t){var r=this.fillRule?this.fillRule:"nonzero",n=this.strokeWidth?this.strokeWidth:"0",i=this.strokeDashArray?this.strokeDashArray.join(" "):"none",o=this.strokeDashOffset?this.strokeDashOffset:"0",a=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=typeof this.opacity<"u"?this.opacity:"1",u=this.visible?"":" visibility: hidden;",d=t?"":this.getSvgFilter(),h=e("fill",this.fill);return[e("stroke",this.stroke),"stroke-width: ",n,"; ","stroke-dasharray: ",i,"; ","stroke-linecap: ",a,"; ","stroke-dashoffset: ",o,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",l,"; ",h,"fill-rule: ",r,"; ","opacity: ",c,";",d,u].join("")},getSvgSpanStyles:function(t,r){var n="; ",i=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+n:"",o=t.strokeWidth?"stroke-width: "+t.strokeWidth+n:"",a=t.fontSize?"font-size: "+t.fontSize+"px"+n:"",s=t.fontStyle?"font-style: "+t.fontStyle+n:"",l=t.fontWeight?"font-weight: "+t.fontWeight+n:"",c=t.fill?e("fill",t.fill):"",u=t.stroke?e("stroke",t.stroke):"",d=this.getSvgTextDecoration(t);return d&&(d="text-decoration: "+d+n),[u,o,i,a,s,l,d,c,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",r?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter(function(t){return e[t.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(e,r){var n=e?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+t.util.matrixToSVG(n)+(r||"")+'" '},_setSVGBg:function(e){if(this.backgroundColor){var n=t.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',r(-this.width/2,n),'" y="',r(-this.height/2,n),'" width="',r(this.width,n),'" height="',r(this.height,n),'"></rect>\n')}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var r=(t=t||{}).reviver,n=t.additionalTransform||"",i=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),o=e.indexOf("COMMON_PARTS");return e[o]=i,r?r(e.join("")):e.join("")},_createBaseSVGMarkup:function(e,r){var n,i,o=(r=r||{}).noStyle,a=r.reviver,s=o?"":'style="'+this.getSvgStyles()+'" ',l=r.withShadow?'style="'+this.getSvgFilter()+'" ':"",c=this.clipPath,u=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",d=c&&c.absolutePositioned,h=this.stroke,f=this.fill,p=this.shadow,g=[],m=e.indexOf("COMMON_PARTS"),v=r.additionalTransform;return c&&(c.clipPathId="CLIPPATH_"+t.Object.__uid++,i='<clipPath id="'+c.clipPathId+'" >\n'+c.toClipPathSVG(a)+"</clipPath>\n"),d&&g.push("<g ",l,this.getSvgCommons()," >\n"),g.push("<g ",this.getSvgTransform(!1),d?"":l+this.getSvgCommons()," >\n"),n=[s,u,o?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),e[m]=n,f&&f.toLive&&g.push(f.toSVG(this)),h&&h.toLive&&g.push(h.toSVG(this)),p&&g.push(p.toSVG(this)),c&&g.push(i),g.push(e.join("")),g.push("</g>\n"),d&&g.push("</g>\n"),a?a(g.join("")):g.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var e=t.util.object.extend,r="stateProperties";function n(t,r,n){var i={};n.forEach(function(e){i[e]=t[e]}),e(t[r],i,!0)}function i(e,t,r){if(e===t)return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n++)if(!i(e[n],t[n]))return!1;return!0}if(e&&"object"==typeof e){var a,s=Object.keys(e);if(!t||"object"!=typeof t||!r&&s.length!==Object.keys(t).length)return!1;for(n=0,o=s.length;n<o;n++)if("canvas"!==(a=s[n])&&"group"!==a&&!i(e[a],t[a]))return!1;return!0}}t.util.object.extend(t.Object.prototype,{hasStateChanged:function(e){var t="_"+(e=e||r);return Object.keys(this[t]).length<this[e].length||!i(this[t],this,!0)},saveState:function(e){var t=e&&e.propertySet||r,i="_"+t;return this[i]?(n(this,i,this[t]),e&&e.stateProperties&&n(this,i,e.stateProperties),this):this.setupState(e)},setupState:function(e){var t=(e=e||{}).propertySet||r;return e.propertySet=t,this["_"+t]={},this.saveState(e),this}})}(),function(){var e=t.util.degreesToRadians;t.util.object.extend(t.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var r,n,i,o=e.x,a=e.y,s=Object.keys(this.oCoords),l=s.length-1;for(this.__corner=0;l>=0;l--)if(i=s[l],this.isControlVisible(i)&&(n=this._getImageLines(t?this.oCoords[i].touchCorner:this.oCoords[i].corner),0!==(r=this._findCrossPoints({x:o,y:a},n))&&r%2==1))return this.__corner=i,i;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var r=this.controls[t];e[t].corner=r.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=r.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var r=this.getCenterPoint(),n=this._calculateCurrentDimensions(),i=this.canvas.viewportTransform;return t.translate(r.x,r.y),t.scale(1/i[0],1/i[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-n.x/2,-n.y/2,n.x,n.y),t.restore(),this},drawBorders:function(e,t){t=t||{};var r=this._calculateCurrentDimensions(),n=this.borderScaleFactor,i=r.x+n,o=r.y+n,a=typeof t.hasControls<"u"?t.hasControls:this.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-i/2,-o/2,i,o),a&&(e.beginPath(),this.forEachControl(function(t,r,n){t.withConnection&&t.getVisibility(n,r)&&(s=!0,e.moveTo(t.x*i,t.y*o),e.lineTo(t.x*i+t.offsetX,t.y*o+t.offsetY))}),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,r,n){n=n||{};var i=t.util.sizeAfterTransform(this.width,this.height,r),o=this.strokeWidth,a=this.strokeUniform,s=this.borderScaleFactor,l=i.x+o*(a?this.canvas.getZoom():r.scaleX)+s,c=i.y+o*(a?this.canvas.getZoom():r.scaleY)+s;return e.save(),this._setLineDash(e,n.borderDashArray||this.borderDashArray),e.strokeStyle=n.borderColor||this.borderColor,e.strokeRect(-l/2,-c/2,l,c),e.restore(),this},drawControls:function(e,r){r=r||{},e.save();var n,i,o=this.canvas.getRetinaScaling();return e.setTransform(o,0,0,o,0,0),e.strokeStyle=e.fillStyle=r.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=r.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,r.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(n=this.group.calcTransformMatrix()),this.forEachControl(function(o,a,s){i=s.oCoords[a],o.getVisibility(s,a)&&(n&&(i=t.util.transformPoint(i,n)),o.render(e,i.x,i.y,r,s))}),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||(e={}),e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),t.util.object.extend(t.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,r){var n=function(){},i=(r=r||{}).onComplete||n,o=r.onChange||n,a=this;return t.util.animate({target:this,startValue:e.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),i()}})},fxCenterObjectV:function(e,r){var n=function(){},i=(r=r||{}).onComplete||n,o=r.onChange||n,a=this;return t.util.animate({target:this,startValue:e.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),i()}})},fxRemove:function(e,r){var n=function(){},i=(r=r||{}).onComplete||n,o=r.onChange||n,a=this;return t.util.animate({target:this,startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),a.requestRenderAll(),o()},onComplete:function(){a.remove(e),i()}})}}),t.util.object.extend(t.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var e,t,r=[],n=[];for(e in arguments[0])r.push(e);for(var i=0,o=r.length;i<o;i++)e=r[i],t=i!==o-1,n.push(this._animate(e,arguments[0][e],arguments[1],t));return n}return this._animate.apply(this,arguments)},_animate:function(e,r,n,i){var o,a=this;r=r.toString(),n=n?t.util.object.clone(n):{},~e.indexOf(".")&&(o=e.split("."));var s=a.colorProperties.indexOf(e)>-1||o&&a.colorProperties.indexOf(o[1])>-1,l=o?this.get(o[0])[o[1]]:this.get(e);"from"in n||(n.from=l),s||(r=~r.indexOf("=")?l+parseFloat(r.replace("=","")):parseFloat(r));var c={target:this,startValue:n.from,endValue:r,byValue:n.by,easing:n.easing,duration:n.duration,abort:n.abort&&function(e,t,r){return n.abort.call(a,e,t,r)},onChange:function(t,r,s){o?a[o[0]][o[1]]=t:a.set(e,t),!i&&n.onChange&&n.onChange(t,r,s)},onComplete:function(e,t,r){i||(a.setCoords(),n.onComplete&&n.onComplete(e,t,r))}};return s?t.util.animateColor(c.startValue,c.endValue,c.duration,c):t.util.animate(c)}}),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};function o(e,t){var r=e.origin,n=e.axis1,i=e.axis2,o=e.dimension,a=t.nearest,s=t.center,l=t.farthest;return function(){switch(this.get(r)){case a:return Math.min(this.get(n),this.get(i));case s:return Math.min(this.get(n),this.get(i))+.5*this.get(o);case l:return Math.max(this.get(n),this.get(i))}}}t.Line?t.warn("fabric.Line is already defined"):(t.Line=t.util.createClass(t.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(e,t){e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in e?e.left:this._getLeftToOriginX(),this.top="top"in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper("_set",e,t),typeof i[e]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:o({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:o({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var r=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=r},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return r(this.callSuper("toObject",e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(e.y-=this.strokeWidth),0===this.height&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,r=e*this.width*.5,n=t*this.height*.5;return{x1:r,x2:e*this.width*-.5,y1:n,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',e.x1,'" y1="',e.y1,'" x2="',e.x2,'" y2="',e.y2,'" />\n']}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),t.Line.fromElement=function(e,n,i){i=i||{};var o=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),a=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];n(new t.Line(a,r(o,i)))},t.Line.fromObject=function(e,r){var i=n(e,!0);i.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject("Line",i,function(e){delete e.points,r&&r(e)},"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.degreesToRadians;t.Circle?t.warn("fabric.Circle is already defined."):(t.Circle=t.util.createClass(t.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:t.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,t){return this.callSuper("_set",e,t),"radius"===e&&this.setRadius(t),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,n=(this.endAngle-this.startAngle)%360;if(0===n)e=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var i=r(this.startAngle),o=r(this.endAngle),a=this.radius;e=['<path d="M '+t.util.cos(i)*a+" "+t.util.sin(i)*a," A "+a+" "+a," 0 ",+(n>180?"1":"0")+" 1"," "+t.util.cos(o)*a+" "+t.util.sin(o)*a,'" ',"COMMON_PARTS"," />\n"]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,r(this.startAngle),r(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",2*e).set("height",2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),t.Circle.fromElement=function(e,r){var n=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!function(e){return"radius"in e&&e.radius>=0}(n))throw new Error("value of `r` attribute is required and can not be negative");n.left=(n.left||0)-n.radius,n.top=(n.top||0)-n.radius,r(new t.Circle(n))},t.Circle.fromObject=function(e,r){t.Object._fromObject("Circle",e,r)})}(e),function(e){var t=e.fabric||(e.fabric={});t.Triangle?t.warn("fabric.Triangle is already defined"):(t.Triangle=t.util.createClass(t.Object,{type:"triangle",width:100,height:100,_render:function(e){var t=this.width/2,r=this.height/2;e.beginPath(),e.moveTo(-t,r),e.lineTo(0,-r),e.lineTo(t,r),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-e+" "+t,"0 "+-t,e+" "+t].join(","),'" />']}}),t.Triangle.fromObject=function(e,r){return t.Object._fromObject("Triangle",e,r)})}(e),function(e){var t=e.fabric||(e.fabric={}),r=2*Math.PI;t.Ellipse?t.warn("fabric.Ellipse is already defined."):(t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this.set("rx",e&&e.rx||0),this.set("ry",e&&e.ry||0)},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.set("width",2*t);break;case"ry":this.ry=t,this.set("height",2*t)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,r,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),t.Ellipse.fromElement=function(e,r){var n=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,r(new t.Ellipse(n))},t.Ellipse.fromObject=function(e,r){t.Object._fromObject("Ellipse",e,r)})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend;t.Rect?t.warn("fabric.Rect is already defined"):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,r=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,i=this.height,o=-this.width/2,a=-this.height/2,s=0!==t||0!==r,l=.4477152502;e.beginPath(),e.moveTo(o+t,a),e.lineTo(o+n-t,a),s&&e.bezierCurveTo(o+n-l*t,a,o+n,a+l*r,o+n,a+r),e.lineTo(o+n,a+i-r),s&&e.bezierCurveTo(o+n,a+i-l*r,o+n-l*t,a+i,o+n-t,a+i),e.lineTo(o+t,a+i),s&&e.bezierCurveTo(o+l*t,a+i,o,a+i-l*r,o,a+i-r),e.lineTo(o,a+r),s&&e.bezierCurveTo(o,a+l*r,o+l*t,a,o+t,a),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),t.Rect.fromElement=function(e,n,i){if(!e)return n(null);i=i||{};var o=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0,o.height=o.height||0,o.width=o.width||0;var a=new t.Rect(r(i?t.util.object.clone(i):{},o));a.visible=a.visible&&a.width>0&&a.height>0,n(a)},t.Rect.fromObject=function(e,r){return t.Object._fromObject("Rect",e,r)})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.util.array.min,i=t.util.array.max,o=t.util.toFixed,a=t.util.projectStrokeOnPoints;t.Polyline?t.warn("fabric.Polyline is already defined"):(t.Polyline=t.util.createClass(t.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:t.Object.prototype.cacheProperties.concat("points"),initialize:function(e,t){t=t||{},this.points=e||[],this.callSuper("initialize",t),this._setPositionDimensions(t)},_projectStrokeOnPoints:function(){return a(this.points,this,!0)},_setPositionDimensions:function(e){var t,r=this._calcDimensions(e),n=this.exactBoundingBox?this.strokeWidth:0;this.width=r.width-n,this.height=r.height-n,e.fromSVG||(t=this.translateToGivenOrigin({x:r.left-this.strokeWidth/2+n/2,y:r.top-this.strokeWidth/2+n/2},"left","top",this.originX,this.originY)),typeof e.left>"u"&&(this.left=e.fromSVG?r.left:t.x),typeof e.top>"u"&&(this.top=e.fromSVG?r.top:t.y),this.pathOffset={x:r.left+this.width/2+n/2,y:r.top+this.height/2+n/2}},_calcDimensions:function(){var e=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,t=n(e,"x")||0,r=n(e,"y")||0;return{left:t,top:r,width:(i(e,"x")||0)-t,height:(i(e,"y")||0)-r}},toObject:function(e){return r(this.callSuper("toObject",e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],r=this.pathOffset.x,n=this.pathOffset.y,i=t.Object.NUM_FRACTION_DIGITS,a=0,s=this.points.length;a<s;a++)e.push(o(this.points[a].x-r,i),",",o(this.points[a].y-n,i)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',e.join(""),'" />\n']},commonRender:function(e){var t,r=this.points.length,n=this.pathOffset.x,i=this.pathOffset.y;if(!r||isNaN(this.points[r-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-n,this.points[0].y-i);for(var o=0;o<r;o++)t=this.points[o],e.lineTo(t.x-n,t.y-i);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get("points").length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(n,i,o){if(!n)return i(null);o||(o={});var a=t.parsePointsAttribute(n.getAttribute("points")),s=t.parseAttributes(n,t[e].ATTRIBUTE_NAMES);s.fromSVG=!0,i(new t[e](a,r(s,o)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator("Polyline"),t.Polyline.fromObject=function(e,r){return t.Object._fromObject("Polyline",e,r,"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.projectStrokeOnPoints;t.Polygon?t.warn("fabric.Polygon is already defined"):(t.Polygon=t.util.createClass(t.Polyline,{type:"polygon",_projectStrokeOnPoints:function(){return r(this.points,this)},_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator("Polygon"),t.Polygon.fromObject=function(e,r){t.Object._fromObject("Polygon",e,r,"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.array.min,n=t.util.array.max,i=t.util.object.extend,o=t.util.object.clone,a=t.util.toFixed;t.Path?t.warn("fabric.Path is already defined"):(t.Path=t.util.createClass(t.Object,{type:"path",path:null,cacheProperties:t.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:t.Object.prototype.stateProperties.concat("path"),initialize:function(e,t){delete(t=o(t||{})).path,this.callSuper("initialize",t),this._setPath(e||[],t)},_setPath:function(e,r){this.path=t.util.makePathSimpler(Array.isArray(e)?e:t.util.parsePath(e)),t.Polyline.prototype._setPositionDimensions.call(this,r||{})},_renderPathCommands:function(e){var t,r=0,n=0,i=0,o=0,a=0,s=0,l=-this.pathOffset.x,c=-this.pathOffset.y;e.beginPath();for(var u=0,d=this.path.length;u<d;++u)switch(t=this.path[u],t[0]){case"L":i=t[1],o=t[2],e.lineTo(i+l,o+c);break;case"M":r=i=t[1],n=o=t[2],e.moveTo(i+l,o+c);break;case"C":i=t[5],o=t[6],a=t[3],s=t[4],e.bezierCurveTo(t[1]+l,t[2]+c,a+l,s+c,i+l,o+c);break;case"Q":e.quadraticCurveTo(t[1]+l,t[2]+c,t[3]+l,t[4]+c),i=t[3],o=t[4],a=t[1],s=t[2];break;case"z":case"Z":i=r,o=n,e.closePath()}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(e){return i(this.callSuper("toObject",e),{path:this.path.map(function(e){return e.slice()})})},toDatalessObject:function(e){var t=this.toObject(["sourcePath"].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',t.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return" translate("+a(-this.pathOffset.x,e)+", "+a(-this.pathOffset.y,e)+")"},toClipPathSVG:function(e){var t=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,i,o=[],a=[],s=0,l=0,c=0,u=0,d=0,h=this.path.length;d<h;++d){switch((e=this.path[d])[0]){case"L":c=e[1],u=e[2],i=[];break;case"M":s=c=e[1],l=u=e[2],i=[];break;case"C":i=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[3],e[4],e[5],e[6]),c=e[5],u=e[6];break;case"Q":i=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[1],e[2],e[3],e[4]),c=e[3],u=e[4];break;case"z":case"Z":c=s,u=l}i.forEach(function(e){o.push(e.x),a.push(e.y)}),o.push(c),a.push(u)}var f=r(o)||0,p=r(a)||0;return{left:f,top:p,width:(n(o)||0)-f,height:(n(a)||0)-p}}}),t.Path.fromObject=function(e,r){if("string"==typeof e.sourcePath){var n=e.sourcePath;t.loadSVGFromURL(n,function(n){var i=n[0];i.setOptions(e),e.clipPath?t.util.enlivenObjects([e.clipPath],function(e){i.clipPath=e[0],r&&r(i)}):r&&r(i)})}else t.Object._fromObject("Path",e,r,"path")},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(["d"]),t.Path.fromElement=function(e,r,n){var o=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);o.fromSVG=!0,r(new t.Path(o.d,i(o,n)))})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.array.min,n=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,r){t=t||{},this._objects=[],r&&this.callSuper("initialize",t),this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(r)this._updateObjectsACoords();else{var i=t&&t.centerPoint;void 0!==t.originX&&(this.originX=t.originX),void 0!==t.originY&&(this.originY=t.originY),i||this._calcBounds(),this._updateObjectsCoords(i),delete t.centerPoint,this.callSuper("initialize",t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=this._objects.length;e--;)this._objects[e].setCoords(!0)},_updateObjectsCoords:function(e){e=e||this.getCenterPoint();for(var t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var r=e.left,n=e.top;e.set({left:r-t.x,top:n-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(e){var r=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(r&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,r?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,r){var n=this._objects.length;if(this.useSetOnGroup)for(;n--;)this._objects[n].setOnGroup(e,r);if("canvas"===e)for(;n--;)this._objects[n]._set(e,r);t.Object.prototype._set.call(this,e,r)},toObject:function(e){var r=this.includeDefaultValues,n=this._objects.filter(function(e){return!e.excludeFromExport}).map(function(t){var n=t.includeDefaultValues;t.includeDefaultValues=r;var i=t.toObject(e);return t.includeDefaultValues=n,i}),i=t.Object.prototype.toObject.call(this,e);return i.objects=n,i},toDatalessObject:function(e){var r,n=this.sourcePath;if(n)r=n;else{var i=this.includeDefaultValues;r=this._objects.map(function(t){var r=t.includeDefaultValues;t.includeDefaultValues=i;var n=t.toDatalessObject(e);return t.includeDefaultValues=r,n})}var o=t.Object.prototype.toDatalessObject.call(this,e);return o.objects=r,o},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e)for(var r=0,n=this._objects.length;r<n;r++)if(this._objects[r].willDrawShadow())return this.ownCaching=!1,!1;return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,r=this._objects.length;e<r;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,r=this._objects.length;t<r;t++)this._objects[t].render(e);this._drawClipPath(e,this.clipPath)},isCacheDirty:function(e){if(this.callSuper("isCacheDirty",e))return!0;if(!this.statefullCache)return!1;for(var t=0,r=this._objects.length;t<r;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var n=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-n/2,-i/2,n,i)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach(function(r){t.util.addTransformToObject(r,e),delete r.group,r.setCoords()}),this},destroy:function(){return this._objects.forEach(function(e){e.set("dirty",!0)}),this._restoreObjectsState()},dispose:function(){this.callSuper("dispose"),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[]},toActiveSelection:function(){if(this.canvas){var e=this._objects,r=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var i=new t.ActiveSelection([]);return i.set(n),i.type="activeSelection",r.remove(this),e.forEach(function(e){e.group=i,e.dirty=!0,r.add(e)}),i.canvas=r,i._objects=e,r._activeObject=i,i.setCoords(),i}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject(function(e){e.setCoords(!0)}),this},_calcBounds:function(e){for(var t,r,n,i,o=[],a=[],s=["tr","br","bl","tl"],l=0,c=this._objects.length,u=s.length;l<c;++l){for(n=(t=this._objects[l]).calcACoords(),i=0;i<u;i++)r=s[i],o.push(n[r].x),a.push(n[r].y);t.aCoords=n}this._getBounds(o,a,e)},_getBounds:function(e,i,o){var a=new t.Point(r(e),r(i)),s=new t.Point(n(e),n(i)),l=a.y||0,c=a.x||0,u=s.x-a.x||0,d=s.y-a.y||0;this.width=u,this.height=d,o||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(e){for(var t=["<g ","COMMON_PARTS"," >\n"],r=0,n=this._objects.length;r<n;r++)t.push("\t\t",this._objects[r].toSVG(e));return t.push("</g>\n"),t},getSvgStyles:function(){var e=typeof this.opacity<"u"&&1!==this.opacity?"opacity: "+this.opacity+";":"",t=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),t].join("")},toClipPathSVG:function(e){for(var t=[],r=0,n=this._objects.length;r<n;r++)t.push("\t",this._objects[r].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,r){var n=e.objects,i=t.util.object.clone(e,!0);delete i.objects,"string"!=typeof n?t.util.enlivenObjects(n,function(n){t.util.enlivenObjectEnlivables(e,i,function(){r&&r(new t.Group(n,i,!0))})}):t.loadSVGFromURL(n,function(o){var a=t.util.groupSVGElements(o,e,n),s=i.clipPath;delete i.clipPath,a.set(i),s?t.util.enlivenObjects([s],function(e){a.clipPath=e[0],r&&r(a)}):r&&r(a)})})}(e),function(e){var t=e.fabric||(e.fabric={});t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:"activeSelection",initialize:function(e,r){r=r||{},this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;r.originX&&(this.originX=r.originX),r.originY&&(this.originY=r.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,r),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var r=t.Object.prototype.toObject.call(this),n=new t.Group([]);if(delete r.type,n.set(r),e.forEach(function(e){e.canvas.remove(e),e.group=n}),n._objects=e,!this.canvas)return n;var i=this.canvas;return i.add(n),i._activeObject=n,n.setCoords(),n},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,r){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",e,t),typeof(r=r||{}).hasControls>"u"&&(r.hasControls=!1),r.forActiveSelection=!0;for(var n=0,i=this._objects.length;n<i;n++)this._objects[n]._renderControls(e,r);e.restore()}}),t.ActiveSelection.fromObject=function(e,r){t.util.enlivenObjects(e.objects,function(n){delete e.objects,r&&r(new t.ActiveSelection(n,e,!0))})})}(e),function(e){var r=t.util.object.extend;e.fabric||(e.fabric={}),e.fabric.Image?t.warn("fabric.Image is already defined."):(t.Image=t.util.createClass(t.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:t.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:t.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,r){r||(r={}),this.filters=[],this.cacheKey="texture"+t.Object.__uid++,this.callSuper("initialize",r),this._initElement(e,r)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=e,this._originalElement=e,this._initConfig(t),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var r=t.filterBackend;r&&r.evictCachesForKey&&r.evictCachesForKey(e)},dispose:function(){this.callSuper("dispose"),this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(this.stroke&&0!==this.strokeWidth){var t=this.width/2,r=this.height/2;e.beginPath(),e.moveTo(-t,-r),e.lineTo(t,-r),e.lineTo(t,r),e.lineTo(-t,r),e.lineTo(-t,-r),e.closePath()}},toObject:function(e){var t=[];this.filters.forEach(function(e){e&&t.push(e.toObject())});var n=r(this.callSuper("toObject",["cropX","cropY"].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:t});return this.resizeFilter&&(n.resizeFilter=this.resizeFilter.toObject()),n},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e,r=[],n=[],i=this._element,o=-this.width/2,a=-this.height/2,s="",l="";if(!i)return[];if(this.hasCrop()){var c=t.Object.__uid++;r.push('<clipPath id="imageCrop_'+c+'">\n','\t<rect x="'+o+'" y="'+a+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),s=' clip-path="url(#imageCrop_'+c+')" '}if(this.imageSmoothing||(l='" image-rendering="optimizeSpeed'),n.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',o-this.cropX,'" y="',a-this.cropY,'" width="',i.width||i.naturalWidth,'" height="',i.height||i.height,l,'"',s,"></image>\n"),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,e=["\t<rect ",'x="',o,'" y="',a,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=u}return"fill"!==this.paintFirst?r.concat(e,n):r.concat(n,e)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(e,r,n){return t.util.loadImage(e,function(e,t){this.setElement(e,n),this._setWidthHeight(),r&&r(this,t)},this,n&&n.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var e=this.resizeFilter,r=this.minimumScaleTrigger,n=this.getTotalObjectScaling(),i=n.scaleX,o=n.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!e||i>r&&o>r)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=o);t.filterBackend||(t.filterBackend=t.initFilterBackend());var s=t.util.createCanvasElement(),l=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,c=a.width,u=a.height;s.width=c,s.height=u,this._element=s,this._lastScaleX=e.scaleX=i,this._lastScaleY=e.scaleY=o,t.filterBackend.applyFilters([e],a,c,u,this._element,l),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter(function(e){return e&&!e.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===e.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var r=this._originalElement,n=r.naturalWidth||r.width,i=r.naturalHeight||r.height;if(this._element===this._originalElement){var o=t.util.createCanvasElement();o.width=n,o.height=i,this._element=o,this._filteredEl=o}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,n,i),this._lastScaleX=1,this._lastScaleY=1;return t.filterBackend||(t.filterBackend=t.initFilterBackend()),t.filterBackend.applyFilters(e,this._originalElement,n,i,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),t.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var r=this._filterScalingX,n=this._filterScalingY,i=this.width,o=this.height,a=Math.min,s=Math.max,l=s(this.cropX,0),c=s(this.cropY,0),u=t.naturalWidth||t.width,d=t.naturalHeight||t.height,h=l*r,f=c*n,p=a(i*r,u-h),g=a(o*n,d-f),m=-i/2,v=-o/2,y=a(i,u/r-l),b=a(o,d/n-c);t&&e.drawImage(t,h,f,p,g,m,v,y,b)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,r){this.setElement(t.util.getById(e),r),t.util.addClass(this.getElement(),t.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,r){e&&e.length?t.util.enlivenObjects(e,function(e){r&&r(e)},"fabric.Image.filters"):r&&r()},_setWidthHeight:function(e){e||(e={});var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,r=t.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),n=this._element.width,i=this._element.height,o=1,a=1,s=0,l=0,c=0,u=0,d=this.width,h=this.height,f={width:d,height:h};return!r||"none"===r.alignX&&"none"===r.alignY?(o=d/n,a=h/i):("meet"===r.meetOrSlice&&(e=(d-n*(o=a=t.util.findScaleToFit(this._element,f)))/2,"Min"===r.alignX&&(s=-e),"Max"===r.alignX&&(s=e),e=(h-i*a)/2,"Min"===r.alignY&&(l=-e),"Max"===r.alignY&&(l=e)),"slice"===r.meetOrSlice&&(e=n-d/(o=a=t.util.findScaleToCover(this._element,f)),"Mid"===r.alignX&&(c=e/2),"Max"===r.alignX&&(c=e),e=i-h/a,"Mid"===r.alignY&&(u=e/2),"Max"===r.alignY&&(u=e),n=d/o,i=h/a)),{width:n,height:i,scaleX:o,scaleY:a,offsetLeft:s,offsetTop:l,cropX:c,cropY:u}}}),t.Image.CSS_CANVAS="canvas-img",t.Image.prototype.getSvgSrc=t.Image.prototype.getSrc,t.Image.fromObject=function(e,r){var n=t.util.object.clone(e);t.util.loadImage(n.src,function(e,i){i?r&&r(null,!0):t.Image.prototype._initFilters.call(n,n.filters,function(i){n.filters=i||[],t.Image.prototype._initFilters.call(n,[n.resizeFilter],function(i){n.resizeFilter=i[0],t.util.enlivenObjectEnlivables(n,n,function(){var i=new t.Image(e,n);r(i,!1)})})})},null,n.crossOrigin)},t.Image.fromURL=function(e,r,n){t.util.loadImage(e,function(e,i){r&&r(new t.Image(e,n),i)},null,n&&n.crossOrigin)},t.Image.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),t.Image.fromElement=function(e,n,i){var o=t.parseAttributes(e,t.Image.ATTRIBUTE_NAMES);t.Image.fromURL(o["xlink:href"],n,r(i?t.util.object.clone(i):{},o))})}(e),t.util.object.extend(t.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(e){var r=function(){},n=(e=e||{}).onComplete||r,i=e.onChange||r,o=this;return t.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){o.rotate(e),i()},onComplete:function(){o.setCoords(),n()}})}}),t.util.object.extend(t.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function e(e,t){var r="precision "+t+" float;\nvoid main(){}",n=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(n,r),e.compileShader(n),!!e.getShaderParameter(n,e.COMPILE_STATUS)}function r(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}t.isWebglSupported=function(r){if(t.isLikelyNode)return!1;r=r||t.WebglFilterBackend.prototype.tileSize;var n=document.createElement("canvas"),i=n.getContext("webgl")||n.getContext("experimental-webgl"),o=!1;if(i){t.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),o=t.maxTextureSize>=r;for(var a=["highp","mediump","lowp"],s=0;s<3;s++)if(e(i,a[s])){t.webGlPrecision=a[s];break}}return this.isSupported=o,o},t.WebglFilterBackend=r,r.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,r){var o,a=typeof window.performance<"u";try{new ImageData(1,1),o=!0}catch{o=!1}var s=typeof ArrayBuffer<"u",l=typeof Uint8ClampedArray<"u";if(a&&o&&s&&l){var c=t.util.createCanvasElement(),u=new ArrayBuffer(e*r*4);if(t.forceGLPutImageData)return this.imageBuffer=u,void(this.copyGLTo2D=i);var d,h,f={imageBuffer:u,destinationWidth:e,destinationHeight:r,targetCanvas:c};c.width=e,c.height=r,d=window.performance.now(),n.call(f,this.gl,f),h=window.performance.now()-d,d=window.performance.now(),i.call(f,this.gl,f),h>window.performance.now()-d?(this.imageBuffer=u,this.copyGLTo2D=i):this.copyGLTo2D=n}},createWebGLCanvas:function(e,r){var n=t.util.createCanvasElement();n.width=e,n.height=r;var i={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},o=n.getContext("webgl",i);o||(o=n.getContext("experimental-webgl",i)),o&&(o.clearColor(0,0,0,0),this.canvas=n,this.gl=o)},applyFilters:function(e,t,r,n,i,o){var a,s=this.gl;o&&(a=this.getCachedTexture(o,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:r,sourceHeight:n,destinationWidth:r,destinationHeight:n,context:s,sourceTexture:this.createTexture(s,r,n,!a&&t),targetTexture:this.createTexture(s,r,n),originalTexture:a||this.createTexture(s,r,n,!a&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:i},c=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,c),e.forEach(function(e){e&&e.applyTo(l)}),function(e){var t=e.targetCanvas,r=t.width,n=t.height,i=e.destinationWidth,o=e.destinationHeight;(r!==i||n!==o)&&(t.width=i,t.height=o)}(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(c),i.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,r,n,i){var o=e.createTexture();return e.bindTexture(e.TEXTURE_2D,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),o},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var r=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=r,r},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:n,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:"",vendor:""};if(!e)return t;var r=e.getExtension("WEBGL_debug_renderer_info");if(r){var n=e.getParameter(r.UNMASKED_RENDERER_WEBGL),i=e.getParameter(r.UNMASKED_VENDOR_WEBGL);n&&(t.renderer=n.toLowerCase()),i&&(t.vendor=i.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){var e=function(){};function r(){}t.Canvas2dFilterBackend=r,r.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,r,n,i){var o=i.getContext("2d");o.drawImage(t,0,0,r,n);var a={sourceWidth:r,sourceHeight:n,imageData:o.getImageData(0,0,r,n),originalEl:t,originalImageData:o.getImageData(0,0,r,n),canvasEl:i,ctx:o,filterBackend:this};return e.forEach(function(e){e.applyTo(a)}),(a.imageData.width!==r||a.imageData.height!==n)&&(i.width=a.imageData.width,i.height=a.imageData.height),o.putImageData(a.imageData,0,0),a}}}(),t.Image=t.Image||{},t.Image.filters=t.Image.filters||{},t.Image.filters.BaseFilter=t.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,r,n){r=r||this.fragmentSource,n=n||this.vertexSource,"highp"!==t.webGlPrecision&&(r=r.replace(/precision highp float/g,"precision "+t.webGlPrecision+" float"));var i=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+e.getShaderInfoLog(i));var o=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(o,r),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+e.getShaderInfoLog(o));var a=e.createProgram();if(e.attachShader(a,i),e.attachShader(a,o),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(a));var s=this.getAttributeLocations(e,a),l=this.getUniformLocations(e,a)||{};return l.uStepW=e.getUniformLocation(a,"uStepW"),l.uStepH=e.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:s,uniformLocations:l}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,r){var n=t.aPosition,i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,r,n=e.context;e.passes>1?(t=e.destinationWidth,r=e.destinationHeight,(e.sourceWidth!==t||e.sourceHeight!==r)&&(n.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(n,t,r)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,r=t.Image.filters[this.type].prototype;if(e){if(Array.isArray(r[e])){for(var n=r[e].length;n--;)if(this[e][n]!==r[e][n])return!1;return!0}return r[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,r=this.retrieveShader(e);0===e.pass&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(r.program),this.sendAttributeData(t,r.attributeLocations,e.aPosition),t.uniform1f(r.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(r.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,r.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,r){e.activeTexture(r),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement("canvas");t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),t.Image.filters.BaseFilter.fromObject=function(e,r){var n=new t.Image.filters[e.type](e);return r&&r(n),n},function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.ColorMatrix=n(r.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,r,n,i,o,a=e.imageData.data,s=a.length,l=this.matrix,c=this.colorsOnly;for(o=0;o<s;o+=4)t=a[o],r=a[o+1],n=a[o+2],c?(a[o]=t*l[0]+r*l[1]+n*l[2]+255*l[4],a[o+1]=t*l[5]+r*l[6]+n*l[7]+255*l[9],a[o+2]=t*l[10]+r*l[11]+n*l[12]+255*l[14]):(i=a[o+3],a[o]=t*l[0]+r*l[1]+n*l[2]+i*l[3]+255*l[4],a[o+1]=t*l[5]+r*l[6]+n*l[7]+i*l[8]+255*l[9],a[o+2]=t*l[10]+r*l[11]+n*l[12]+i*l[13]+255*l[14],a[o+3]=t*l[15]+r*l[16]+n*l[17]+i*l[18]+255*l[19])},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,"uColorMatrix"),uConstants:e.getUniformLocation(t,"uConstants")}},sendUniformData:function(e,t){var r=this.matrix,n=[r[0],r[1],r[2],r[3],r[5],r[6],r[7],r[8],r[10],r[11],r[12],r[13],r[15],r[16],r[17],r[18]],i=[r[4],r[9],r[14],r[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,n),e.uniform4fv(t.uConstants,i)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Brightness=n(r.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(e){if(0!==this.brightness){var t,r=e.imageData.data,n=r.length,i=Math.round(255*this.brightness);for(t=0;t<n;t+=4)r[t]=r[t]+i,r[t+1]=r[t+1]+i,r[t+2]=r[t+2]+i}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,"uBrightness")}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.Image.filters,i=t.util.createClass;n.Convolute=i(n.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),r=this.type+"_"+t+"_"+(this.opaque?1:0),n=this.fragmentSource[r];return e.programCache.hasOwnProperty(r)||(e.programCache[r]=this.createProgram(e.context,n)),e.programCache[r]},applyTo2d:function(e){var t,r,n,i,o,a,s,l,c,u,d,h,f,p=e.imageData,g=p.data,m=this.matrix,v=Math.round(Math.sqrt(m.length)),y=Math.floor(v/2),b=p.width,w=p.height,x=e.ctx.createImageData(b,w),C=x.data,_=this.opaque?1:0;for(d=0;d<w;d++)for(u=0;u<b;u++){for(o=4*(d*b+u),t=0,r=0,n=0,i=0,f=0;f<v;f++)for(h=0;h<v;h++)a=u+h-y,!((s=d+f-y)<0||s>=w||a<0||a>=b)&&(l=4*(s*b+a),c=m[f*v+h],t+=g[l]*c,r+=g[l+1]*c,n+=g[l+2]*c,_||(i+=g[l+3]*c));C[o]=t,C[o+1]=r,C[o+2]=n,C[o+3]=_?g[o+3]:i}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,"uMatrix"),uOpaque:e.getUniformLocation(t,"uOpaque"),uHalfSize:e.getUniformLocation(t,"uHalfSize"),uSize:e.getUniformLocation(t,"uSize")}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return r(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Grayscale=n(r.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(e){var t,r,n=e.imageData.data,i=n.length,o=this.mode;for(t=0;t<i;t+=4)"average"===o?r=(n[t]+n[t+1]+n[t+2])/3:"lightness"===o?r=(Math.min(n[t],n[t+1],n[t+2])+Math.max(n[t],n[t+1],n[t+2]))/2:"luminosity"===o&&(r=.21*n[t]+.72*n[t+1]+.07*n[t+2]),n[t]=r,n[t+1]=r,n[t+2]=r},retrieveShader:function(e){var t=this.type+"_"+this.mode;if(!e.programCache.hasOwnProperty(t)){var r=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,r)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,"uMode")}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Invert=n(r.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(e){var t,r=e.imageData.data,n=r.length;for(t=0;t<n;t+=4)r[t]=255-r[t],r[t+1]=255-r[t+1],r[t+2]=255-r[t+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,"uInvert")}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.Image.filters,i=t.util.createClass;n.Noise=i(n.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(e){if(0!==this.noise){var t,r,n=e.imageData.data,i=n.length,o=this.noise;for(t=0,i=n.length;t<i;t+=4)r=(.5-Math.random())*o,n[t]+=r,n[t+1]+=r,n[t+2]+=r}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,"uNoise"),uSeed:e.getUniformLocation(t,"uSeed")}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return r(this.callSuper("toObject"),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Pixelate=n(r.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(e){var t,r,n,i,o,a,s,l,c,u,d,h=e.imageData,f=h.data,p=h.height,g=h.width;for(r=0;r<p;r+=this.blocksize)for(n=0;n<g;n+=this.blocksize)for(i=f[t=4*r*g+4*n],o=f[t+1],a=f[t+2],s=f[t+3],u=Math.min(r+this.blocksize,p),d=Math.min(n+this.blocksize,g),l=r;l<u;l++)for(c=n;c<d;c++)f[t=4*l*g+4*c]=i,f[t+1]=o,f[t+2]=a,f[t+3]=s},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,"uBlocksize"),uStepW:e.getUniformLocation(t,"uStepW"),uStepH:e.getUniformLocation(t,"uStepH")}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.Image.filters,i=t.util.createClass;n.RemoveColor=i(n.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(e){var r,n,i,o,a=e.imageData.data,s=255*this.distance,l=new t.Color(this.color).getSource(),c=[l[0]-s,l[1]-s,l[2]-s],u=[l[0]+s,l[1]+s,l[2]+s];for(r=0;r<a.length;r+=4)n=a[r],i=a[r+1],o=a[r+2],n>c[0]&&i>c[1]&&o>c[2]&&n<u[0]&&i<u[1]&&o<u[2]&&(a[r+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,"uLow"),uHigh:e.getUniformLocation(t,"uHigh")}},sendUniformData:function(e,r){var n=new t.Color(this.color).getSource(),i=parseFloat(this.distance),o=[0+n[0]/255-i,0+n[1]/255-i,0+n[2]/255-i,1],a=[n[0]/255+i,n[1]/255+i,n[2]/255+i,1];e.uniform4fv(r.uLow,o),e.uniform4fv(r.uHigh,a)},toObject:function(){return r(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass,i={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var o in i)r[o]=n(r.ColorMatrix,{type:o,matrix:i[o],mainParameter:!1,colorsOnly:!0}),t.Image.filters[o].fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,r=t.Image.filters,n=t.util.createClass;r.BlendColor=n(r.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(e){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[e]+"}\n}"},retrieveShader:function(e){var t,r=this.type+"_"+this.mode;return e.programCache.hasOwnProperty(r)||(t=this.buildSource(this.mode),e.programCache[r]=this.createProgram(e.context,t)),e.programCache[r]},applyTo2d:function(e){var r,n,i,o,a,s,l,c=e.imageData.data,u=c.length,d=1-this.alpha;r=(l=new t.Color(this.color).getSource())[0]*this.alpha,n=l[1]*this.alpha,i=l[2]*this.alpha;for(var h=0;h<u;h+=4)switch(o=c[h],a=c[h+1],s=c[h+2],this.mode){case"multiply":c[h]=o*r/255,c[h+1]=a*n/255,c[h+2]=s*i/255;break;case"screen":c[h]=255-(255-o)*(255-r)/255,c[h+1]=255-(255-a)*(255-n)/255,c[h+2]=255-(255-s)*(255-i)/255;break;case"add":c[h]=o+r,c[h+1]=a+n,c[h+2]=s+i;break;case"diff":case"difference":c[h]=Math.abs(o-r),c[h+1]=Math.abs(a-n),c[h+2]=Math.abs(s-i);break;case"subtract":c[h]=o-r,c[h+1]=a-n,c[h+2]=s-i;break;case"darken":c[h]=Math.min(o,r),c[h+1]=Math.min(a,n),c[h+2]=Math.min(s,i);break;case"lighten":c[h]=Math.max(o,r),c[h+1]=Math.max(a,n),c[h+2]=Math.max(s,i);break;case"overlay":c[h]=r<128?2*o*r/255:255-2*(255-o)*(255-r)/255,c[h+1]=n<128?2*a*n/255:255-2*(255-a)*(255-n)/255,c[h+2]=i<128?2*s*i/255:255-2*(255-s)*(255-i)/255;break;case"exclusion":c[h]=r+o-2*r*o/255,c[h+1]=n+a-2*n*a/255,c[h+2]=i+s-2*i*s/255;break;case"tint":c[h]=r+o*d,c[h+1]=n+a*d,c[h+2]=i+s*d}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,"uColor")}},sendUniformData:function(e,r){var n=new t.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,e.uniform4fv(r.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,r=t.Image.filters,n=t.util.createClass;r.BlendImage=n(r.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(e){var t=this.type+"_"+this.mode,r=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,r)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,r=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,r,t.TEXTURE1),this.callSuper("applyToWebGL",e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,r=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/r,1]},applyTo2d:function(e){var r,n,i,o,a,s,l,c,u,d,h,f=e.imageData,p=e.filterBackend.resources,g=f.data,m=g.length,v=f.width,y=f.height,b=this.image;p.blendImage||(p.blendImage=t.util.createCanvasElement()),d=(u=p.blendImage).getContext("2d"),u.width!==v||u.height!==y?(u.width=v,u.height=y):d.clearRect(0,0,v,y),d.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),d.drawImage(b._element,0,0,v,y),h=d.getImageData(0,0,v,y).data;for(var w=0;w<m;w+=4)switch(a=g[w],s=g[w+1],l=g[w+2],c=g[w+3],r=h[w],n=h[w+1],i=h[w+2],o=h[w+3],this.mode){case"multiply":g[w]=a*r/255,g[w+1]=s*n/255,g[w+2]=l*i/255,g[w+3]=c*o/255;break;case"mask":g[w+3]=o}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,"uTransformMatrix"),uImage:e.getUniformLocation(t,"uImage")}},sendUniformData:function(e,t){var r=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,r)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,r){t.Image.fromObject(e.image,function(n){var i=t.util.object.clone(e);i.image=n,r(new t.Image.filters.BlendImage(i))})}}(e),function(e){var t=e.fabric||(e.fabric={}),r=Math.pow,n=Math.floor,i=Math.sqrt,o=Math.abs,a=Math.round,s=Math.sin,l=Math.ceil,c=t.Image.filters,u=t.util.createClass;c.Resize=u(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,"uDelta"),uTaps:e.getUniformLocation(t,"uTaps")}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),r=this.type+"_"+t;if(!e.programCache.hasOwnProperty(r)){var n=this.generateShader(t);e.programCache[r]=this.createProgram(e.context,n)}return e.programCache[r]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,r=this.getFilterWindow(),n=new Array(r),i=1;i<=r;i++)n[i-1]=e(i*t);return n},generateShader:function(e){for(var t=new Array(e),r=this.fragmentSourceTOP,n=1;n<=e;n++)t[n-1]=n+".0 * uDelta";return r+="uniform float uTaps["+e+"];\n",r+="void main() {\n",r+=" vec4 color = texture2D(uTexture, vTexCoord);\n",r+=" float sum = 1.0;\n",t.forEach(function(e,t){r+=" color += texture2D(uTexture, vTexCoord + "+e+") * uTaps["+t+"];\n",r+=" color += texture2D(uTexture, vTexCoord - "+e+") * uTaps["+t+"];\n",r+=" sum += 2.0 * uTaps["+t+"];\n"}),r+=" gl_FragColor = color / sum;\n",r+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var r=(t*=Math.PI)/e;return s(t)/t*s(r)/r}},applyTo2d:function(e){var t=e.imageData,r=this.scaleX,n=this.scaleY;this.rcpScaleX=1/r,this.rcpScaleY=1/n;var i,o=t.width,s=t.height,l=a(o*r),c=a(s*n);"sliceHack"===this.resizeType?i=this.sliceByTwo(e,o,s,l,c):"hermite"===this.resizeType?i=this.hermiteFastResize(e,o,s,l,c):"bilinear"===this.resizeType?i=this.bilinearFiltering(e,o,s,l,c):"lanczos"===this.resizeType&&(i=this.lanczosResize(e,o,s,l,c)),e.imageData=i},sliceByTwo:function(e,r,i,o,a){var s,l,c=e.imageData,u=.5,d=!1,h=!1,f=r*u,p=i*u,g=t.filterBackend.resources,m=0,v=0,y=r,b=0;for(g.sliceByTwo||(g.sliceByTwo=document.createElement("canvas")),((s=g.sliceByTwo).width<1.5*r||s.height<i)&&(s.width=1.5*r,s.height=i),(l=s.getContext("2d")).clearRect(0,0,1.5*r,i),l.putImageData(c,0,0),o=n(o),a=n(a);!d||!h;)r=f,i=p,o<n(f*u)?f=n(f*u):(f=o,d=!0),a<n(p*u)?p=n(p*u):(p=a,h=!0),l.drawImage(s,m,v,r,i,y,b,f,p),m=y,v=b,b+=p;return l.getImageData(m,v,o,a)},lanczosResize:function(e,t,a,s,c){var u=e.imageData.data,d=e.ctx.createImageData(s,c),h=d.data,f=this.lanczosCreate(this.lanczosLobes),p=this.rcpScaleX,g=this.rcpScaleY,m=2/this.rcpScaleX,v=2/this.rcpScaleY,y=l(p*this.lanczosLobes/2),b=l(g*this.lanczosLobes/2),w={},x={},C={};return function e(l){var _,S,A,k,E,I,j,T,F,O,P;for(x.x=(l+.5)*p,C.x=n(x.x),_=0;_<c;_++){for(x.y=(_+.5)*g,C.y=n(x.y),E=0,I=0,j=0,T=0,F=0,S=C.x-y;S<=C.x+y;S++)if(!(S<0||S>=t)){O=n(1e3*o(S-x.x)),w[O]||(w[O]={});for(var M=C.y-b;M<=C.y+b;M++)M<0||M>=a||(P=n(1e3*o(M-x.y)),w[O][P]||(w[O][P]=f(i(r(O*m,2)+r(P*v,2))/1e3)),(A=w[O][P])>0&&(E+=A,I+=A*u[k=4*(M*t+S)],j+=A*u[k+1],T+=A*u[k+2],F+=A*u[k+3]))}h[k=4*(_*s+l)]=I/E,h[k+1]=j/E,h[k+2]=T/E,h[k+3]=F/E}return++l<s?e(l):d}(0)},bilinearFiltering:function(e,t,r,i,o){var a,s,l,c,u,d,h,f,p,g=0,m=this.rcpScaleX,v=this.rcpScaleY,y=4*(t-1),b=e.imageData.data,w=e.ctx.createImageData(i,o),x=w.data;for(l=0;l<o;l++)for(c=0;c<i;c++)for(u=m*c-(a=n(m*c)),d=v*l-(s=n(v*l)),p=4*(s*t+a),h=0;h<4;h++)f=b[p+h]*(1-u)*(1-d)+b[p+4+h]*u*(1-d)+b[p+y+h]*d*(1-u)+b[p+y+4+h]*u*d,x[g++]=f;return w},hermiteFastResize:function(e,t,r,a,s){for(var c=this.rcpScaleX,u=this.rcpScaleY,d=l(c/2),h=l(u/2),f=e.imageData.data,p=e.ctx.createImageData(a,s),g=p.data,m=0;m<s;m++)for(var v=0;v<a;v++){for(var y=4*(v+m*a),b=0,w=0,x=0,C=0,_=0,S=0,A=0,k=(m+.5)*u,E=n(m*u);E<(m+1)*u;E++)for(var I=o(k-(E+.5))/h,j=(v+.5)*c,T=I*I,F=n(v*c);F<(v+1)*c;F++){var O=o(j-(F+.5))/d,P=i(T+O*O);P>1&&P<-1||(b=2*P*P*P-3*P*P+1)>0&&(A+=b*f[3+(O=4*(F+E*t))],x+=b,f[O+3]<255&&(b=b*f[O+3]/250),C+=b*f[O],_+=b*f[O+1],S+=b*f[O+2],w+=b)}g[y]=C/w,g[y+1]=_/w,g[y+2]=S/w,g[y+3]=A/x}return p},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Contrast=n(r.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(0!==this.contrast){var t,r=e.imageData.data,n=r.length,i=Math.floor(255*this.contrast),o=259*(i+255)/(255*(259-i));for(t=0;t<n;t+=4)r[t]=o*(r[t]-128)+128,r[t+1]=o*(r[t+1]-128)+128,r[t+2]=o*(r[t+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,"uContrast")}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Saturation=n(r.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(e){if(0!==this.saturation){var t,r,n=e.imageData.data,i=n.length,o=-this.saturation;for(t=0;t<i;t+=4)r=Math.max(n[t],n[t+1],n[t+2]),n[t]+=r!==n[t]?(r-n[t])*o:0,n[t+1]+=r!==n[t+1]?(r-n[t+1])*o:0,n[t+2]+=r!==n[t+2]?(r-n[t+2])*o:0}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,"uSaturation")}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Vibrance=n(r.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(e){if(0!==this.vibrance){var t,r,n,i,o=e.imageData.data,a=o.length,s=-this.vibrance;for(t=0;t<a;t+=4)r=Math.max(o[t],o[t+1],o[t+2]),n=(o[t]+o[t+1]+o[t+2])/3,i=2*Math.abs(r-n)/255*s,o[t]+=r!==o[t]?(r-o[t])*i:0,o[t+1]+=r!==o[t+1]?(r-o[t+1])*i:0,o[t+2]+=r!==o[t+2]?(r-o[t+2])*i:0}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,"uVibrance")}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Blur=n(r.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var r,n,i=e.filterBackend.resources,o=e.imageData.width,a=e.imageData.height;i.blurLayer1||(i.blurLayer1=t.util.createCanvasElement(),i.blurLayer2=t.util.createCanvasElement()),r=i.blurLayer1,n=i.blurLayer2,(r.width!==o||r.height!==a)&&(n.width=r.width=o,n.height=r.height=a);var s,l,c,u,d=r.getContext("2d"),h=n.getContext("2d"),f=15,p=.06*this.blur*.5;for(d.putImageData(e.imageData,0,0),h.clearRect(0,0,o,a),u=-f;u<=f;u++)c=p*(l=u/f)*o+(s=(Math.random()-.5)/4),h.globalAlpha=1-Math.abs(l),h.drawImage(r,c,s),d.drawImage(n,0,0),h.globalAlpha=1,h.clearRect(0,0,n.width,n.height);for(u=-f;u<=f;u++)c=p*(l=u/f)*a+(s=(Math.random()-.5)/4),h.globalAlpha=1-Math.abs(l),h.drawImage(r,s,c),d.drawImage(n,0,0),h.globalAlpha=1,h.clearRect(0,0,n.width,n.height);e.ctx.drawImage(r,0,0);var g=e.ctx.getImageData(0,0,r.width,r.height);return d.globalAlpha=1,d.clearRect(0,0,r.width,r.height),g},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,"uDelta")}},sendUniformData:function(e,t){var r=this.chooseRightDelta();e.uniform2fv(t.delta,r)},chooseRightDelta:function(){var e,t=1,r=[0,0];return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?r[0]=e:r[1]=e,r}}),r.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Gamma=n(r.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],r.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,r=e.imageData.data,n=this.gamma,i=r.length,o=1/n[0],a=1/n[1],s=1/n[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,i=256;t<i;t++)this.rVals[t]=255*Math.pow(t/255,o),this.gVals[t]=255*Math.pow(t/255,a),this.bVals[t]=255*Math.pow(t/255,s);for(t=0,i=r.length;t<i;t+=4)r[t]=this.rVals[r[t]],r[t+1]=this.gVals[r[t+1]],r[t+2]=this.bVals[r[t+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,"uGamma")}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Composed=n(r.BaseFilter,{type:"Composed",subFilters:[],initialize:function(e){this.callSuper("initialize",e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach(function(t){t.applyTo(e)})},toObject:function(){return t.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(e){return e.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(e){return!e.isNeutralState()})}}),t.Image.filters.Composed.fromObject=function(e,r){var n=(e.subFilters||[]).map(function(e){return new t.Image.filters[e.type](e)}),i=new t.Image.filters.Composed({subFilters:n});return r&&r(i),i}}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.HueRotation=n(r.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var e=this.rotation*Math.PI,r=t.util.cos(e),n=t.util.sin(e),i=1/3,o=Math.sqrt(i)*n,a=1-r;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=r+a/3,this.matrix[1]=i*a-o,this.matrix[2]=i*a+o,this.matrix[5]=i*a+o,this.matrix[6]=r+i*a,this.matrix[7]=i*a-o,this.matrix[10]=i*a-o,this.matrix[11]=i*a+o,this.matrix[12]=r+i*a},isNeutralState:function(e){return this.calculateMatrix(),r.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),r.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.clone;if(t.Text)t.warn("fabric.Text is already defined");else{var n="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide pathAlign".split(" ");t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide","pathAlign"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:t.Object.prototype.stateProperties.concat(n),cacheProperties:t.Object.prototype.cacheProperties.concat(n),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper("initialize",t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||(t._measuringContext=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext("2d")),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var e,t,r,n,i,o,a,s=0,l=this._textLines.length;s<l;s++)if(("justify"===this.textAlign||s!==l-1&&!this.isEndOfWrapping(s))&&(n=0,i=this._textLines[s],(t=this.getLineWidth(s))<this.width&&(a=this.textLines[s].match(this._reSpacesAndTabs)))){r=a.length,e=(this.width-t)/r;for(var c=0,u=i.length;c<=u;c++)o=this.__charBounds[s][c],this._reSpaceAndTab.test(i[c])?(o.width+=e,o.kernedWidth+=e,o.left+=n,n+=e):o.left+=n}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,r){if(e.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":e.textBaseline="middle";break;case"ascender":e.textBaseline="top";break;case"descender":e.textBaseline="bottom"}e.font=this._getFontDeclaration(t,r)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,r=this._textLines.length;t<r;t++){var n=this.getLineWidth(t);n>e&&(e=n)}return e},_renderTextLine:function(e,t,r,n,i,o){this._renderChars(e,t,r,n,i,o)},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var t,r,n,i,o,a,s,l=e.fillStyle,c=this._getLeftOffset(),u=this._getTopOffset(),d=0,h=0,f=this.path,p=0,g=this._textLines.length;p<g;p++)if(t=this.getHeightOfLine(p),this.textBackgroundColor||this.styleHas("textBackgroundColor",p)){n=this._textLines[p],r=this._getLineLeftOffset(p),h=0,d=0,i=this.getValueOfPropertyAt(p,0,"textBackgroundColor");for(var m=0,v=n.length;m<v;m++)o=this.__charBounds[p][m],a=this.getValueOfPropertyAt(p,m,"textBackgroundColor"),f?(e.save(),e.translate(o.renderLeft,o.renderTop),e.rotate(o.angle),e.fillStyle=a,a&&e.fillRect(-o.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),o.width,t/this.lineHeight),e.restore()):a!==i?(s=c+r+d,"rtl"===this.direction&&(s=this.width-s-h),e.fillStyle=i,i&&e.fillRect(s,u,h,t/this.lineHeight),d=o.left,h=o.width,i=a):h+=o.kernedWidth;a&&!f&&(s=c+r+d,"rtl"===this.direction&&(s=this.width-s-h),e.fillStyle=a,e.fillRect(s,u,h,t/this.lineHeight)),u+=t}else u+=t;e.fillStyle=l,this._removeShadow(e)}},getFontCache:function(e){var r=e.fontFamily.toLowerCase();t.charWidthsCache[r]||(t.charWidthsCache[r]={});var n=t.charWidthsCache[r],i=e.fontStyle.toLowerCase()+"_"+(e.fontWeight+"").toLowerCase();return n[i]||(n[i]={}),n[i]},_measureChar:function(e,t,r,n){var i,o,a,s,l=this.getFontCache(t),c=r+e,u=this._getFontDeclaration(t)===this._getFontDeclaration(n),d=t.fontSize/this.CACHE_FONT_SIZE;if(r&&void 0!==l[r]&&(a=l[r]),void 0!==l[e]&&(s=i=l[e]),u&&void 0!==l[c]&&(s=(o=l[c])-a),void 0===i||void 0===a||void 0===o){var h=this.getMeasuringContext();this._setTextStyles(h,t,!0)}return void 0===i&&(s=i=h.measureText(e).width,l[e]=i),void 0===a&&u&&r&&(a=h.measureText(r).width,l[r]=a),u&&void 0===o&&(o=h.measureText(c).width,l[c]=o,s=o-a),{width:i*d,kernedWidth:s*d}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,"fontSize")},measureLine:function(e){var t=this._measureLine(e);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var r,n,i,o,a,s,l=0,c=this._textLines[e],u=new Array(c.length),d=0,h=this.path,f="right"===this.pathSide;for(this.__charBounds[e]=u,r=0;r<c.length;r++)n=c[r],o=this._getGraphemeBox(n,e,r,i),u[r]=o,l+=o.kernedWidth,i=n;if(u[r]={left:o?o.left+o.width:0,width:0,kernedWidth:0,height:this.fontSize},h){switch(s=h.segmentsInfo[h.segmentsInfo.length-1].length,(a=t.util.getPointOnPath(h.path,0,h.segmentsInfo)).x+=h.pathOffset.x,a.y+=h.pathOffset.y,this.textAlign){case"left":d=f?s-l:0;break;case"center":d=(s-l)/2;break;case"right":d=f?0:s-l}for(d+=this.pathStartOffset*(f?-1:1),r=f?c.length-1:0;f?r>=0:r<c.length;f?r--:r++)o=u[r],d>s?d%=s:d<0&&(d+=s),this._setGraphemeOnPath(d,o,a),d+=o.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(e,r,n){var i=e+r.kernedWidth/2,o=this.path,a=t.util.getPointOnPath(o.path,i,o.segmentsInfo);r.renderLeft=a.x-n.x,r.renderTop=a.y-n.y,r.angle=a.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(e,t,r,n,i){var o,a=this.getCompleteStyleDeclaration(t,r),s=n?this.getCompleteStyleDeclaration(t,r-1):{},l=this._measureChar(e,a,n,s),c=l.kernedWidth,u=l.width;0!==this.charSpacing&&(u+=o=this._getWidthOfCharSpacing(),c+=o);var d={width:u,left:0,height:a.fontSize,kernedWidth:c,deltaY:a.deltaY};if(r>0&&!i){var h=this.__charBounds[t][r-1];d.left=h.left+h.width+l.kernedWidth-l.width}return d},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],r=this.getHeightOfChar(e,0),n=1,i=t.length;n<i;n++)r=Math.max(this.getHeightOfChar(e,n),r);return this.__lineHeights[e]=r*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,r=0,n=this._textLines.length;r<n;r++)e=this.getHeightOfLine(r),t+=r===n-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var r=0,n=this._getLeftOffset(),i=this._getTopOffset(),o=0,a=this._textLines.length;o<a;o++){var s=this.getHeightOfLine(o),l=s/this.lineHeight,c=this._getLineLeftOffset(o);this._renderTextLine(t,e,this._textLines[o],n+c,i+r+l,o),r+=s}e.restore()},_renderTextFill:function(e){!this.fill&&!this.styleHas("fill")||this._renderTextCommon(e,"fillText")},_renderTextStroke:function(e){(!this.stroke||0===this.strokeWidth)&&this.isEmptyStyles()||(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,"strokeText"),e.closePath(),e.restore())},_renderChars:function(e,r,n,i,o,a){var s,l,c,u,d,h=this.getHeightOfLine(a),f=-1!==this.textAlign.indexOf("justify"),p="",g=0,m=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(a)&&!m,y="ltr"===this.direction,b="ltr"===this.direction?1:-1,w=r.canvas.getAttribute("dir");if(r.save(),w!==this.direction&&(r.canvas.setAttribute("dir",y?"ltr":"rtl"),r.direction=y?"ltr":"rtl",r.textAlign=y?"left":"right"),o-=h*this._fontSizeFraction/this.lineHeight,v)return this._renderChar(e,r,a,0,n.join(""),i,o,h),void r.restore();for(var x=0,C=n.length-1;x<=C;x++)u=x===C||this.charSpacing||m,p+=n[x],c=this.__charBounds[a][x],0===g?(i+=b*(c.kernedWidth-c.width),g+=c.width):g+=c.kernedWidth,f&&!u&&this._reSpaceAndTab.test(n[x])&&(u=!0),u||(s=s||this.getCompleteStyleDeclaration(a,x),l=this.getCompleteStyleDeclaration(a,x+1),u=t.util.hasStyleChanged(s,l,!1)),u&&(m?(r.save(),r.translate(c.renderLeft,c.renderTop),r.rotate(c.angle),this._renderChar(e,r,a,x,p,-g/2,0,h),r.restore()):(d=i,this._renderChar(e,r,a,x,p,d,o,h)),p="",s=l,i+=b*g,g=0);r.restore()},_applyPatternGradientTransformText:function(e){var r,n=t.util.createCanvasElement(),i=this.width+this.strokeWidth,o=this.height+this.strokeWidth;return n.width=i,n.height=o,(r=n.getContext("2d")).beginPath(),r.moveTo(0,0),r.lineTo(i,0),r.lineTo(i,o),r.lineTo(0,o),r.closePath(),r.translate(i/2,o/2),r.fillStyle=e.toLive(r),this._applyPatternGradientTransform(r,e),r.fill(),r.createPattern(n,"no-repeat")},handleFiller:function(e,t,r){var n,i;return r.toLive?"percentage"===r.gradientUnits||r.gradientTransform||r.patternTransform?(n=-this.width/2,i=-this.height/2,e.translate(n,i),e[t]=this._applyPatternGradientTransformText(r),{offsetX:n,offsetY:i}):(e[t]=r.toLive(e,this),this._applyPatternGradientTransform(e,r)):(e[t]=r,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,"strokeStyle",t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,"fillStyle",t.fill)},_renderChar:function(e,t,r,n,i,o,a){var s,l,c=this._getStyleDeclaration(r,n),u=this.getCompleteStyleDeclaration(r,n),d="fillText"===e&&u.fill,h="strokeText"===e&&u.stroke&&u.strokeWidth;!h&&!d||(t.save(),d&&(s=this._setFillStyles(t,u)),h&&(l=this._setStrokeStyles(t,u)),t.font=this._getFontDeclaration(u),c&&c.textBackgroundColor&&this._removeShadow(t),c&&c.deltaY&&(a+=c.deltaY),d&&t.fillText(i,o-s.offsetX,a-s.offsetY),h&&t.strokeText(i,o-l.offsetX,a-l.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,r){var n=this.get2DCursorLocation(e,!0),i=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),o=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),a={fontSize:i*r.size,deltaY:o+i*r.baseline};return this.setSelectionStyles(a,e,t),this},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),r=this.width-t,n=this.textAlign,i=this.direction,o=0,a=this.isEndOfWrapping(e);return"justify"===n||"justify-center"===n&&!a||"justify-right"===n&&!a||"justify-left"===n&&!a?0:("center"===n&&(o=r/2),"right"===n&&(o=r),"justify-center"===n&&(o=r/2),"justify-right"===n&&(o=r),"rtl"===i&&(o-=r),o)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||(e=this.hasStateChanged("_dimensionAffectingProps")),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){if(void 0!==this.__lineWidths[e])return this.__lineWidths[e];var t=this.measureLine(e).width;return this.__lineWidths[e]=t,t},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(e,t,r){var n=this._getStyleDeclaration(e,t);return n&&typeof n[r]<"u"?n[r]:this[r]},_renderTextDecoration:function(e,t){if(this[t]||this.styleHas(t)){for(var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y=this._getLeftOffset(),b=this._getTopOffset(),w=this.path,x=this._getWidthOfCharSpacing(),C=this.offsets[t],_=0,S=this._textLines.length;_<S;_++)if(r=this.getHeightOfLine(_),this[t]||this.styleHas(t,_)){l=this._textLines[_],g=r/this.lineHeight,o=this._getLineLeftOffset(_),d=0,h=0,c=this.getValueOfPropertyAt(_,0,t),v=this.getValueOfPropertyAt(_,0,"fill"),u=b+g*(1-this._fontSizeFraction),n=this.getHeightOfChar(_,0),a=this.getValueOfPropertyAt(_,0,"deltaY");for(var A=0,k=l.length;A<k;A++)if(f=this.__charBounds[_][A],p=this.getValueOfPropertyAt(_,A,t),m=this.getValueOfPropertyAt(_,A,"fill"),i=this.getHeightOfChar(_,A),s=this.getValueOfPropertyAt(_,A,"deltaY"),w&&p&&m)e.save(),e.fillStyle=v,e.translate(f.renderLeft,f.renderTop),e.rotate(f.angle),e.fillRect(-f.kernedWidth/2,C*i+s,f.kernedWidth,this.fontSize/15),e.restore();else if((p!==c||m!==v||i!==n||s!==a)&&h>0){var E=y+o+d;"rtl"===this.direction&&(E=this.width-E-h),c&&v&&(e.fillStyle=v,e.fillRect(E,u+C*n+a,h,this.fontSize/15)),d=f.left,h=f.width,c=p,v=m,n=i,a=s}else h+=f.kernedWidth;E=y+o+d,"rtl"===this.direction&&(E=this.width-E-h),e.fillStyle=m,p&&m&&e.fillRect(E,u+C*n+a,h-x,this.fontSize/15),b+=r}else b+=r;this._removeShadow(e)}},_getFontDeclaration:function(e,r){var n=e||this,i=this.fontFamily,o=t.Text.genericFonts.indexOf(i.toLowerCase())>-1,a=void 0===i||i.indexOf("'")>-1||i.indexOf(",")>-1||i.indexOf('"')>-1||o?n.fontFamily:'"'+n.fontFamily+'"';return[t.isLikelyNode?n.fontWeight:n.fontStyle,t.isLikelyNode?n.fontStyle:n.fontWeight,r?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",a].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var r=e.split(this._reNewline),n=new Array(r.length),i=["\n"],o=[],a=0;a<r.length;a++)n[a]=t.util.string.graphemeSplit(r[a]),o=o.concat(n[a],i);return o.pop(),{_unwrappedLines:n,lines:r,graphemeText:o,graphemeLines:n}},toObject:function(e){var r=n.concat(e),i=this.callSuper("toObject",r);return i.styles=t.util.stylesToArray(this.styles,this.text),i.path&&(i.path=this.path.toObject()),i},set:function(e,t){this.callSuper("set",e,t);var r=!1,n=!1;if("object"==typeof e)for(var i in e)"path"===i&&this.setPathInfo(),r=r||-1!==this._dimensionAffectingProps.indexOf(i),n=n||"path"===i;else r=-1!==this._dimensionAffectingProps.indexOf(e),n="path"===e;return n&&this.setPathInfo(),r&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,n,i){if(!e)return n(null);var o=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),a=o.textAnchor||"left";if((i=t.util.object.extend(i?r(i):{},o)).top=i.top||0,i.left=i.left||0,o.textDecoration){var s=o.textDecoration;-1!==s.indexOf("underline")&&(i.underline=!0),-1!==s.indexOf("overline")&&(i.overline=!0),-1!==s.indexOf("line-through")&&(i.linethrough=!0),delete i.textDecoration}"dx"in o&&(i.left+=o.dx),"dy"in o&&(i.top+=o.dy),"fontSize"in i||(i.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in e?l=e.textContent:"firstChild"in e&&null!==e.firstChild&&"data"in e.firstChild&&null!==e.firstChild.data&&(l=e.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=i.strokeWidth;i.strokeWidth=0;var u=new t.Text(l,i),d=u.getScaledHeight()/u.height,h=((u.height+u.strokeWidth)*u.lineHeight-u.height)*d,f=u.getScaledHeight()+h,p=0;"center"===a&&(p=u.getScaledWidth()/2),"right"===a&&(p=u.getScaledWidth()),u.set({left:u.left-p,top:u.top-(f-u.fontSize*(.07+u._fontSizeFraction))/u.lineHeight,strokeWidth:typeof c<"u"?c:1}),n(u)},t.Text.fromObject=function(e,n){var i=r(e),o=e.path;return delete i.path,t.Object._fromObject("Text",i,function(r){r.styles=t.util.stylesFromArray(e.styles,e.text),o?t.Object._fromObject("Path",o,function(e){r.set("path",e),n(r)},"path"):n(r)},"text")},t.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],t.util.createAccessors&&t.util.createAccessors(t.Text)}}(e),t.util.object.extend(t.Text.prototype,{isEmptyStyles:function(e){if(!this.styles||typeof e<"u"&&!this.styles[e])return!0;var t=typeof e>"u"?this.styles:{line:this.styles[e]};for(var r in t)for(var n in t[r])for(var i in t[r][n])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||""===e||typeof t<"u"&&!this.styles[t])return!1;var r=typeof t>"u"?this.styles:{0:this.styles[t]};for(var n in r)for(var i in r[n])if(typeof r[n][i][e]<"u")return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||""===e)return!1;var t,r,n=this.styles,i=0,o=!0,a=0;for(var s in n){for(var l in t=0,n[s]){var c;i++,(c=n[s][l]).hasOwnProperty(e)?(r?c[e]!==r&&(o=!1):r=c[e],c[e]===this[e]&&delete c[e]):o=!1,0!==Object.keys(c).length?t++:delete n[s][l]}0===t&&delete n[s]}for(var u=0;u<this._textLines.length;u++)a+=this._textLines[u].length;o&&i===a&&(this[e]=r,this.removeStyle(e))},removeStyle:function(e){if(this.styles&&e&&""!==e){var t,r,n,i=this.styles;for(r in i){for(n in t=i[r])delete t[n][e],0===Object.keys(t[n]).length&&delete t[n];0===Object.keys(t).length&&delete i[r]}}},_extendStyles:function(e,r){var n=this.get2DCursorLocation(e);this._getLineStyle(n.lineIndex)||this._setLineStyle(n.lineIndex),this._getStyleDeclaration(n.lineIndex,n.charIndex)||this._setStyleDeclaration(n.lineIndex,n.charIndex,{}),t.util.object.extend(this._getStyleDeclaration(n.lineIndex,n.charIndex),r)},get2DCursorLocation:function(e,t){typeof e>"u"&&(e=this.selectionStart);for(var r=t?this._unwrappedTextLines:this._textLines,n=r.length,i=0;i<n;i++){if(e<=r[i].length)return{lineIndex:i,charIndex:e};e-=r[i].length+this.missingNewlineOffset(i)}return{lineIndex:i-1,charIndex:r[i-1].length<e?r[i-1].length:e}},getSelectionStyles:function(e,t,r){typeof e>"u"&&(e=this.selectionStart||0),typeof t>"u"&&(t=this.selectionEnd||e);for(var n=[],i=e;i<t;i++)n.push(this.getStyleAtPosition(i,r));return n},getStyleAtPosition:function(e,t){var r=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(r.lineIndex,r.charIndex):this._getStyleDeclaration(r.lineIndex,r.charIndex))||{}},setSelectionStyles:function(e,t,r){typeof t>"u"&&(t=this.selectionStart||0),typeof r>"u"&&(r=this.selectionEnd||t);for(var n=t;n<r;n++)this._extendStyles(n,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var r=this.styles&&this.styles[e];return r?r[t]:null},getCompleteStyleDeclaration:function(e,t){for(var r,n=this._getStyleDeclaration(e,t)||{},i={},o=0;o<this._styleProperties.length;o++)i[r=this._styleProperties[o]]=typeof n[r]>"u"?this[r]:n[r];return i},_setStyleDeclaration:function(e,t,r){this.styles[e][t]=r},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]},_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}}),function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf("underline")>-1&&(e.underline=!0),e.textDecoration.indexOf("line-through")>-1&&(e.linethrough=!0),e.textDecoration.indexOf("overline")>-1&&(e.overline=!0),delete e.textDecoration)}t.IText=t.util.createClass(t.Text,t.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper("initialize",e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire("selectionStart",e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire("selectionEnd",e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(e){this.clearContextTop(),this.callSuper("render",e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper("_render",e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,r=this.canvas.viewportTransform;t.save(),t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,r=this.height+4;e.clearRect(-t/2,-r/2,t,r)},_getCursorBoundaries:function(e){typeof e>"u"&&(e=this.selectionStart);var t=this._getLeftOffset(),r=this._getTopOffset(),n=this._getCursorBoundariesOffsets(e);return{left:t,top:r,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var t,r,n,i,o=0,a=0,s=this.get2DCursorLocation(e);n=s.charIndex,r=s.lineIndex;for(var l=0;l<r;l++)o+=this.getHeightOfLine(l);t=this._getLineLeftOffset(r);var c=this.__charBounds[r][n];return c&&(a=c.left),0!==this.charSpacing&&n===this._textLines[r].length&&(a-=this._getWidthOfCharSpacing()),i={top:o,left:t+(a>0?a:0)},"rtl"===this.direction&&(i.left*=-1),this.cursorOffsetCache=i,this.cursorOffsetCache},renderCursor:function(e,t){var r=this.get2DCursorLocation(),n=r.lineIndex,i=r.charIndex>0?r.charIndex-1:0,o=this.getValueOfPropertyAt(n,i,"fontSize"),a=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/a,l=e.topOffset,c=this.getValueOfPropertyAt(n,i,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,i,"fill"),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,l+e.top+c,s,o)},renderSelection:function(e,t){for(var r=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,i=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(r),a=this.get2DCursorLocation(n),s=o.lineIndex,l=a.lineIndex,c=o.charIndex<0?0:o.charIndex,u=a.charIndex<0?0:a.charIndex,d=s;d<=l;d++){var h,f=this._getLineLeftOffset(d)||0,p=this.getHeightOfLine(d),g=0,m=0;if(d===s&&(g=this.__charBounds[s][c].left),d>=s&&d<l)m=i&&!this.isEndOfWrapping(d)?this.width:this.getLineWidth(d)||5;else if(d===l)if(0===u)m=this.__charBounds[l][u].left;else{var v=this._getWidthOfCharSpacing();m=this.__charBounds[l][u-1].left+this.__charBounds[l][u-1].width-v}h=p,(this.lineHeight<1||d===l&&this.lineHeight>1)&&(p/=this.lineHeight);var y=e.left+f+g,b=m-g,w=p,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",w=1,x=p):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),t.fillRect(y,e.top+e.topOffset+x,b,w),e.topOffset+=h}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fontSize")},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fill")},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),t.IText.fromObject=function(r,n){var i=t.util.stylesFromArray(r.styles,r.text),o=Object.assign({},r,{styles:i});if(e(o),o.styles)for(var a in o.styles)for(var s in o.styles[a])e(o.styles[a][s]);t.Object._fromObject("IText",o,n,"text")}}(),function(){var e=t.util.object.clone;t.util.object.extend(t.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))})},initRemovedHandler:function(){var e=this;this.on("removed",function(){var r=e.canvas;r&&(r._iTextInstances=r._iTextInstances||[],t.util.removeFromArray(r._iTextInstances,e),0===r._iTextInstances.length&&(r._hasITextHandlers=!1,e._removeCanvasHandlers(r)))})},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.__isMousedown=!1})},e.on("mouse:up",e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off("mouse:up",e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(e,t,r,n){var i;return i={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate("_currentCursorOpacity",t,{duration:r,onComplete:function(){i.isAborted||e[n]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return i.isAborted}}),i},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(e){var t=this,r=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){t._tick()},r)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(e){var t=0,r=e-1;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)t++,r--;for(;/\S/.test(this._text[r])&&r>-1;)t++,r--;return e-t},findWordBoundaryRight:function(e){var t=0,r=e;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)t++,r++;for(;/\S/.test(this._text[r])&&r<this._text.length;)t++,r++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,r=e-1;!/\n/.test(this._text[r])&&r>-1;)t++,r--;return e-t},findLineBoundaryRight:function(e){for(var t=0,r=e;!/\n/.test(this._text[r])&&r<this._text.length;)t++,r++;return e+t},searchWordBoundary:function(e,r){for(var n=this._text,i=this._reSpace.test(n[e])?e-1:e,o=n[i],a=t.reNonWord;!a.test(o)&&i>0&&i<n.length;)o=n[i+=r];return a.test(o)&&(i+=1===r?0:1),i},selectWord:function(e){e=e||this.selectionStart;var t=this.searchWordBoundary(e,-1),r=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=r,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e=e||this.selectionStart;var t=this.findLineBoundaryLeft(e),r=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=r,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(e){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.selected=!1,e.isEditing&&e.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(e){if(this.__isMousedown&&this.isEditing){document.activeElement!==this.hiddenTextarea&&this.hiddenTextarea.focus();var t=this.getSelectionStartFromPointer(e.e),r=this.selectionStart,n=this.selectionEnd;(t!==this.__selectionStartOnMouseDown||r===n)&&(r===t||n===t)||(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==r||this.selectionEnd!==n)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,r,n){var i=n.slice(0,e),o=t.util.string.graphemeSplit(i).length;if(e===r)return{selectionStart:o,selectionEnd:o};var a=n.slice(e,r);return{selectionStart:o,selectionEnd:o+t.util.string.graphemeSplit(a).length}},fromGraphemeToStringSelection:function(e,t,r){var n=r.slice(0,e).join("").length;return e===t?{selectionStart:n,selectionEnd:n}:{selectionStart:n,selectionEnd:n+r.slice(e,t).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,r=this._getCursorBoundaries(e),n=this.get2DCursorLocation(e),i=n.lineIndex,o=n.charIndex,a=this.getValueOfPropertyAt(i,o,"fontSize")*this.lineHeight,s=r.leftOffset,l=this.calcTransformMatrix(),c={x:r.left+s,y:r.top+r.topOffset+a},u=this.canvas.getRetinaScaling(),d=this.canvas.upperCanvasEl,h=d.width/u,f=d.height/u,p=h-a,g=f-a,m=d.clientWidth/h,v=d.clientHeight/f;return c=t.util.transformPoint(c,l),(c=t.util.transformPoint(c,this.canvas.viewportTransform)).x*=m,c.y*=v,c.x<0&&(c.x=0),c.x>p&&(c.x=p),c.y<0&&(c.y=0),c.y>g&&(c.y=g),c.x+=this.canvas._offset.left,c.y+=this.canvas._offset.top,{left:c.x+"px",top:c.y+"px",fontSize:a+"px",charHeight:a}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),e&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),e&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var r,n,i=this.get2DCursorLocation(e,!0),o=this.get2DCursorLocation(t,!0),a=i.lineIndex,s=i.charIndex,l=o.lineIndex,c=o.charIndex;if(a!==l){if(this.styles[a])for(r=s;r<this._unwrappedTextLines[a].length;r++)delete this.styles[a][r];if(this.styles[l])for(r=c;r<this._unwrappedTextLines[l].length;r++)(n=this.styles[l][r])&&(this.styles[a]||(this.styles[a]={}),this.styles[a][s+r-c]=n);for(r=a+1;r<=l;r++)delete this.styles[r];this.shiftLineStyles(l,a-l)}else if(this.styles[a]){n=this.styles[a];var u,d,h=c-s;for(r=s;r<c;r++)delete n[r];for(d in this.styles[a])(u=parseInt(d,10))>=c&&(n[u-h]=n[d],delete n[d])}},shiftLineStyles:function(t,r){var n=e(this.styles);for(var i in this.styles){var o=parseInt(i,10);o>t&&(this.styles[o+r]=n[o],n[o-r]||delete this.styles[o])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(t,r,n,i){var o,a={},s=!1,l=this._unwrappedTextLines[t].length===r;for(var c in n||(n=1),this.shiftLineStyles(t,n),this.styles[t]&&(o=this.styles[t][0===r?r:r-1]),this.styles[t]){var u=parseInt(c,10);u>=r&&(s=!0,a[u-r]=this.styles[t][c],l&&0===r||delete this.styles[t][c])}var d=!1;for(s&&!l&&(this.styles[t+n]=a,d=!0),d&&n--;n>0;)i&&i[n-1]?this.styles[t+n]={0:e(i[n-1])}:o?this.styles[t+n]={0:e(o)}:delete this.styles[t+n],n--;this._forceClearCache=!0},insertCharStyleObject:function(t,r,n,i){this.styles||(this.styles={});var o=this.styles[t],a=o?e(o):{};for(var s in n||(n=1),a){var l=parseInt(s,10);l>=r&&(o[l+n]=a[l],a[l-n]||delete o[l])}if(this._forceClearCache=!0,i)for(;n--;)Object.keys(i[n]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][r+n]=e(i[n]));else if(o)for(var c=o[r?r-1:1];c&&n--;)this.styles[t][r+n]=e(c)},insertNewStyleBlock:function(e,t,r){for(var n=this.get2DCursorLocation(t,!0),i=[0],o=0,a=0;a<e.length;a++)"\n"===e[a]?i[++o]=0:i[o]++;for(i[0]>0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,i[0],r),r=r&&r.slice(i[0]+1)),o&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+i[0],o),a=1;a<o;a++)i[a]>0?this.insertCharStyleObject(n.lineIndex+a,0,i[a],r):r&&this.styles[n.lineIndex+a]&&r[0]&&(this.styles[n.lineIndex+a][0]=r[0]),r=r&&r.slice(i[a]+1);i[a]>0&&this.insertCharStyleObject(n.lineIndex+a,0,i[a],r)},setSelectionStartEndWithShift:function(e,t,r){r<=e?(t===e?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=e),this.selectionStart=r):r>e&&r<t?"right"===this._selectionDirection?this.selectionEnd=r:this.selectionStart=r:(t===e?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=t),this.selectionEnd=r)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),t.util.object.extend(t.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire("tripleclick",e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&1!==e.e.button)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),r=this.selectionStart,n=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(r,n,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,r=this.getLocalPointer(e),n=0,i=0,o=0,a=0,s=0,l=0,c=this._textLines.length;l<c&&o<=r.y;l++)o+=this.getHeightOfLine(l)*this.scaleY,s=l,l>0&&(a+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));i=this._getLineLeftOffset(s)*this.scaleX,t=this._textLines[s],"rtl"===this.direction&&(r.x=this.width*this.scaleX-r.x+i);for(var u=0,d=t.length;u<d&&(n=i,(i+=this.__charBounds[s][u].kernedWidth*this.scaleX)<=r.x);u++)a++;return this._getNewSelectionStartFromOffset(r,n,i,a,d)},_getNewSelectionStartFromOffset:function(e,t,r,n,i){var o=e.x-t,a=r-e.x,s=n+(a>o||a<0?0:1);return this.flipX&&(s=i-s),s>this._text.length&&(s=this._text.length),s}}),t.util.object.extend(t.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=t.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+e.top+"; left: "+e.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+e.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):t.document.body.appendChild(this.hiddenTextarea),t.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),t.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),t.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),t.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(t.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var r=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var n,i,o,a,s,l=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,c=this._text.length,u=l.length,d=u-c,h=this.selectionStart,f=this.selectionEnd,p=h!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var g=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),m=h>g.selectionStart;p?(n=this._text.slice(h,f),d+=f-h):u<c&&(n=m?this._text.slice(f+d,f):this._text.slice(h,h-d)),i=l.slice(g.selectionEnd-d,g.selectionEnd),n&&n.length&&(i.length&&(o=this.getSelectionStyles(h,h+1,!1),o=i.map(function(){return o[0]})),p?(a=h,s=f):m?(a=f-n.length,s=f):(a=f,s=f+n.length),this.removeStyleFromTo(a,s)),i.length&&(r&&i.join("")===t.copiedText&&!t.disableStyleCopyPaste&&(o=t.copiedTextStyle),this.insertNewStyleBlock(i,h,o)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(t.copiedText=this.getSelectedText(),t.disableStyleCopyPaste?t.copiedTextStyle=null:t.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||t.window.clipboardData},_getWidthBeforeCursor:function(e,t){var r,n=this._getLineLeftOffset(e);return t>0&&(n+=(r=this.__charBounds[e][t-1]).left+r.width),n},getDownCursorOffset:function(e,t){var r=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(r),i=n.lineIndex;if(i===this._textLines.length-1||e.metaKey||34===e.keyCode)return this._text.length-r;var o=n.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i+1,a);return this._textLines[i].slice(o).length+s+1+this.missingNewlineOffset(i)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var r=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(r),i=n.lineIndex;if(0===i||e.metaKey||33===e.keyCode)return-r;var o=n.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i-1,a),l=this._textLines[i].slice(0,o),c=this.missingNewlineOffset(i-1);return-this._textLines[i-1].length+s-l.length+(1-c)},_getIndexOnLine:function(e,t){for(var r,n,i=this._textLines[e],o=this._getLineLeftOffset(e),a=0,s=0,l=i.length;s<l;s++)if((o+=r=this.__charBounds[e][s].width)>t){n=!0;var c=o-r,u=o,d=Math.abs(c-t);a=Math.abs(u-t)<d?s:s-1;break}return n||(a=i.length-1),a},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",e)},moveCursorUp:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",e)},_moveCursorUpOrDown:function(e,t){var r=this["get"+e+"CursorOffset"](t,"right"===this._selectionDirection);t.shiftKey?this.moveCursorWithShift(r):this.moveCursorWithoutShift(r),0!==r&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t="left"===this._selectionDirection?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),0!==e},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),0!==e},moveCursorLeft:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",e)},_move:function(e,t,r){var n;if(e.altKey)n=this["findWordBoundary"+r](this[t]);else{if(!e.metaKey&&35!==e.keyCode&&36!==e.keyCode)return this[t]+="Left"===r?-1:1,!0;n=this["findLineBoundary"+r](this[t])}if(typeof n<"u"&&this[t]!==n)return this[t]=n,!0},_moveLeft:function(e,t){return this._move(e,t,"Left")},_moveRight:function(e,t){return this._move(e,t,"Right")},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(t=this._moveLeft(e,"selectionStart")),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(e,"selectionStart")):void 0},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",e)},_moveCursorLeftOrRight:function(e,t){var r="moveCursor"+e+"With";this._currentCursorOpacity=1,t.shiftKey?r+="Shift":r+="outShift",this[r](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(e,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(e,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(t=this._moveRight(e,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){typeof t>"u"&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,r,n,i){typeof i>"u"&&(i=n),i>n&&this.removeStyleFromTo(n,i);var o=t.util.string.graphemeSplit(e);this.insertNewStyleBlock(o,n,r),this._text=[].concat(this._text.slice(0,n),o,this._text.slice(i)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var e=t.util.toFixed,r=/ +/g;t.util.object.extend(t.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",t?'text-decoration="'+t+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",e.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(e,t){var r,n=[],i=[],o=e;this._setSVGBg(i);for(var a=0,s=this._textLines.length;a<s;a++)r=this._getLineLeftOffset(a),(this.textBackgroundColor||this.styleHas("textBackgroundColor",a))&&this._setSVGTextLineBg(i,a,t+r,o),this._setSVGTextLineText(n,a,t+r,o),o+=this.getHeightOfLine(a);return{textSpans:n,textBgRects:i}},_createTextCharSpan:function(n,i,o,a){var s=n!==n.trim()||n.match(r),l=this.getSvgSpanStyles(i,s),c=l?'style="'+l+'"':"",u=i.deltaY,d="",h=t.Object.NUM_FRACTION_DIGITS;return u&&(d=' dy="'+e(u,h)+'" '),['<tspan x="',e(o,h),'" y="',e(a,h),'" ',d,c,">",t.util.string.escapeXml(n),"</tspan>"].join("")},_setSVGTextLineText:function(e,r,n,i){var o,a,s,l,c,u=this.getHeightOfLine(r),d=-1!==this.textAlign.indexOf("justify"),h="",f=0,p=this._textLines[r];i+=u*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,m=p.length-1;g<=m;g++)c=g===m||this.charSpacing,h+=p[g],s=this.__charBounds[r][g],0===f?(n+=s.kernedWidth-s.width,f+=s.width):f+=s.kernedWidth,d&&!c&&this._reSpaceAndTab.test(p[g])&&(c=!0),c||(o=o||this.getCompleteStyleDeclaration(r,g),a=this.getCompleteStyleDeclaration(r,g+1),c=t.util.hasStyleChanged(o,a,!0)),c&&(l=this._getStyleDeclaration(r,g)||{},e.push(this._createTextCharSpan(h,l,n,i)),h="",o=a,n+=f,f=0)},_pushTextBgRect:function(r,n,i,o,a,s){var l=t.Object.NUM_FRACTION_DIGITS;r.push("\t\t<rect ",this._getFillAttributes(n),' x="',e(i,l),'" y="',e(o,l),'" width="',e(a,l),'" height="',e(s,l),'"></rect>\n')},_setSVGTextLineBg:function(e,t,r,n){for(var i,o,a=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,l=0,c=0,u=this.getValueOfPropertyAt(t,0,"textBackgroundColor"),d=0,h=a.length;d<h;d++)i=this.__charBounds[t][d],(o=this.getValueOfPropertyAt(t,d,"textBackgroundColor"))!==u?(u&&this._pushTextBgRect(e,u,r+c,n,l,s),c=i.left,l=i.width,u=o):l+=i.kernedWidth;o&&this._pushTextBgRect(e,o,r+c,n,l,s)},_getFillAttributes:function(e){var r=e&&"string"==typeof e?new t.Color(e):"";return r&&r.getSource()&&1!==r.getAlpha()?'opacity="'+r.getAlpha()+'" fill="'+r.setAlpha(1).toRgb()+'"':'fill="'+e+'"'},_getSVGLineTopOffset:function(e){for(var t,r=0,n=0;n<e;n++)r+=this.getHeightOfLine(n);return t=this.getHeightOfLine(n),{lineTop:r,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return t.Object.prototype.getSvgStyles.call(this,e)+" white-space: pre;"}})}(),function(e){var t=e.fabric||(e.fabric={});t.Textbox=t.util.createClass(t.IText,t.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(e){for(var t=0,r=0,n=0,i={},o=0;o<e.graphemeLines.length;o++)"\n"===e.graphemeText[n]&&o>0?(r=0,n++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[n])&&o>0&&(r++,n++),i[o]={line:t,offset:r},n+=e.graphemeLines[o].length,r+=e.graphemeLines[o].length;return i},styleHas:function(e,r){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[r];n&&(r=n.line)}return t.Text.prototype.styleHas.call(this,e,r)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,r,n=0,i=!1,o=this._styleMap[e],a=this._styleMap[e+1];for(var s in o&&(e=o.line,n=o.offset),a&&(i=a.line===e,t=a.offset),r=typeof e>"u"?this.styles:{line:this.styles[e]})for(var l in r[s])if(l>=n&&(!i||l<t))for(var c in r[s][l])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var r=this._styleMap[e];if(!r)return null;e=r.line,t=r.offset+t}return this.callSuper("_getStyleDeclaration",e,t)},_setStyleDeclaration:function(e,t,r){var n=this._styleMap[e];e=n.line,t=n.offset+t,this.styles[e][t]=r},_deleteStyleDeclaration:function(e,t){var r=this._styleMap[e];e=r.line,t=r.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var r,n=[];for(this.isWrapping=!0,r=0;r<e.length;r++)n=n.concat(this._wrapLine(e[r],r,t));return this.isWrapping=!1,n},_measureWord:function(e,t,r){var n,i=0;r=r||0;for(var o=0,a=e.length;o<a;o++)i+=this._getGraphemeBox(e[o],t,o+r,n,!0).kernedWidth,n=e[o];return i},_wrapLine:function(e,r,n,i){var o=0,a=this.splitByGrapheme,s=[],l=[],c=a?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),u="",d=0,h=a?"":" ",f=0,p=0,g=0,m=!0,v=this._getWidthOfCharSpacing();i=i||0,0===c.length&&c.push([]),n-=i;for(var y=0;y<c.length;y++)u=a?c[y]:t.util.string.graphemeSplit(c[y]),f=this._measureWord(u,r,d),d+=u.length,(o+=p+f-v)>n&&!m?(s.push(l),l=[],o=f,m=!0):o+=v,!m&&!a&&l.push(h),l=l.concat(u),p=a?0:this._measureWord([h],r,d),d++,m=!1,f>g&&(g=f);return y&&s.push(l),g+i>this.dynamicMinWidth&&(this.dynamicMinWidth=g-v+i),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?this.isEndOfWrapping(e)?1:0:1},_splitTextIntoLines:function(e){for(var r=t.Text.prototype._splitTextIntoLines.call(this,e),n=this._wrapText(r.lines,this.width),i=new Array(n.length),o=0;o<n.length;o++)i[o]=n[o].join("");return r.lines=i,r.graphemeLines=n,r},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(e))}}),t.Textbox.fromObject=function(e,r){var n=t.util.stylesFromArray(e.styles,e.text),i=Object.assign({},e,{styles:n});return t.Object._fromObject("Textbox",i,r,"text")}}(e),function(){var e=t.controlsUtils,r=e.scaleSkewCursorStyleHandler,n=e.scaleCursorStyleHandler,i=e.scalingEqually,o=e.scalingYOrSkewingX,a=e.scalingXOrSkewingY,s=e.scaleOrSkewActionName,l=t.Object.prototype.controls;if(l.ml=new t.Control({x:-.5,y:0,cursorStyleHandler:r,actionHandler:a,getActionName:s}),l.mr=new t.Control({x:.5,y:0,cursorStyleHandler:r,actionHandler:a,getActionName:s}),l.mb=new t.Control({x:0,y:.5,cursorStyleHandler:r,actionHandler:o,getActionName:s}),l.mt=new t.Control({x:0,y:-.5,cursorStyleHandler:r,actionHandler:o,getActionName:s}),l.tl=new t.Control({x:-.5,y:-.5,cursorStyleHandler:n,actionHandler:i}),l.tr=new t.Control({x:.5,y:-.5,cursorStyleHandler:n,actionHandler:i}),l.bl=new t.Control({x:-.5,y:.5,cursorStyleHandler:n,actionHandler:i}),l.br=new t.Control({x:.5,y:.5,cursorStyleHandler:n,actionHandler:i}),l.mtr=new t.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),t.Textbox){var c=t.Textbox.prototype.controls={};c.mtr=l.mtr,c.tr=l.tr,c.br=l.br,c.tl=l.tl,c.bl=l.bl,c.mt=l.mt,c.mb=l.mb,c.mr=new t.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:r,actionName:"resizing"}),c.ml=new t.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:r,actionName:"resizing"})}}()}(Vb);const $b={lockScalingFlip:!0,originY:"center",originX:"center",lockMovementX:!0,lockMovementY:!0,borderColor:"transparent"};function Wb(e=36){let t="";for(let r=0;r<e;r+=1)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}let Gb=null;function qb(e){Gb=e}class Yb{constructor(){ja(this,"maxZoom",2),ja(this,"minZoom",1),ja(this,"step",.05),this.allowUserZoom&&this.bindMouseWheel(),vp.subscribe(e=>e.stageSize,()=>{setTimeout(()=>{this.fitToScreen()},1)})}get allowUserZoom(){var e,t,r;return(null==(r=null==(t=null==(e=yp().config)?void 0:e.tools)?void 0:t.zoom)?void 0:r.allowUserZoom)??!0}get currentZoom(){return yp().zoom}zoomIn(e=this.step){this.set(this.currentZoom+e)}canZoomIn(e=this.step){return this.currentZoom+e<=this.maxZoom}canZoomOut(e=this.step){return this.currentZoom-e>=this.minZoom}zoomOut(e=this.step){this.set(this.currentZoom-e)}set(e,t=!0){if(e<this.minZoom||e>this.maxZoom)return;const r=Da(yp().original.width*e,0),n=Da(yp().original.height*e,0);wp().setZoom(e),t&&wp().setDimensions({width:r,height:n}),yp().setZoom(e)}fitToScreen(){var e,t;if(null==(t=null==(e=yp().config.tools)?void 0:e.zoom)||!t.fitImageToScreen)return;const{width:r,height:n}=yp().stageSize,i=Math.max(n,1),o=Math.max(r,1);if(yp().original.height>i||yp().original.width>o){const e=Math.min(i/yp().original.height,o/yp().original.width);this.minZoom=Math.min(e,1)}else this.minZoom=1;this.set(this.minZoom)}bindMouseWheel(){wp().on("mouse:wheel",e=>{e.e.preventDefault(),e.e.stopPropagation(),null==Gb&&(e.e.deltaY<0?this.zoomIn():this.zoomOut())})}}function Xb(e){return new Promise(t=>{Vb.fabric.util.loadImage(e,e=>t(new Vb.fabric.Image(e)),null,yp().config.crossOrigin?"anonymous":void 0)})}function Kb(){return!(yp().config.image||yp().config.blankCanvasSize||wp()&&0!==wp().getObjects().length)}class Zb{constructor(){ja(this,"minWidth",50),ja(this,"minHeight",50)}resize(e,t,{applyZoom:r=!1,resizeHelper:n=!0}={}){const i=yp().zoom;wp().setWidth(e*(r?i:1)),wp().setHeight(t*(r?i:1)),yp().setOriginal(e,t),n&&bp().transform.resetStraightenAnchor()}async addMainImage(e,t="mainImage"){var r,n;yp().toggleLoading(t);const i=await Xb(e);if(i)return this.clear(),i.set(_p),i.name=ff.MainImage,wp().add(i),this.resize(i.width,i.height),i.center(),i.setCoords(),bp().zoom.fitToScreen(),yp().toggleLoading(!1),null==(n=(r=yp().config).onMainImageLoaded)||n.call(r,i),i}openNew(e,t,r){return e=Math.max(this.minWidth,e),t=Math.max(this.minHeight,t),this.clear(),this.resize(e,t),wp().backgroundColor=r,bp().zoom.fitToScreen(),yp().toggleLoading("newCanvas"),requestAnimationFrame(()=>{yp().toggleLoading(!1)}),Promise.resolve({width:e,height:t})}getMainImage(){return wp().getObjects().find(e=>e.name===ff.MainImage)}render(){wp().requestRenderAll()}async loadInitialContent(){var e,t;const r=yp().config.image,n=yp().config.blankCanvasSize,i=yp().config.state;if(r&&r.endsWith("json")){const e=await Cp(r);await bp().import.loadState(e)}else r&&r.startsWith('{"canvas')?await bp().import.loadState(r):r?await this.addMainImage(r):i?await bp().import.loadState(i):n&&await this.openNew(n.width,n.height);return Kb()&&null!=(t=null==(e=yp().config.ui)?void 0:e.openImageDialog)&&t.show&&yp().togglePanel("newImage",!0),new Promise(e=>{setTimeout(()=>{bp().history.addInitial(),e()},10)})}clear(){wp().clear(),bp().frame.remove(),bp().transform.resetStraightenAnchor()}}const Jb=["fontSize","fontFamily","left","top","width","height","scaleX","scaleY","flipX","flipY","angle","src","strokeWidth"];function Qb(e={}){wp().fire("object:modified",function(e){return{values:e,sizeOrPositionChanged:ew(e)}}(e))}function ew(e){return Object.keys(e).some(e=>Jb.includes(e))}function tw(e){var t,r;const[n]=kp(null==(t=e.selected)?void 0:t[0]),i=n===yp().activeTool;return!(!yp().dirty||null!=(r=e.selected)&&r[0]&&i)&&(e.deselected&&bp().objects.select(e.deselected[0]),!0)}function rw(e){(null==e?void 0:e.data.id)!==yp().objects.active.id&&(yp().objects.setActive(e??null),yp().activeTool!==nd.DRAW&&Ap())}class nw{constructor(){this.syncObjects(),yp().fabric.on("selection:created",e=>{var t;null!=(t=e.selected)&&t[0]&&!tw(e)&&rw(e.selected[0])}),yp().fabric.on("selection:updated",e=>{var t;tw(e)||rw(null==(t=e.selected)?void 0:t[0])}),yp().fabric.on("selection:cleared",()=>{rw()}),yp().fabric.on("text:editing:entered",()=>{yp().objects.setIsEditingText(!0)}),yp().fabric.on("text:editing:exited",()=>{yp().objects.setIsEditingText(!1)}),yp().fabric.on("object:added",()=>{this.syncObjects()}),yp().fabric.on("object:removed",()=>{this.syncObjects()})}getAll(){return wp().getObjects().filter(e=>{var t;return!(null!=(t=null==e?void 0:e.data)&&t.pixieInternal)})}get(e){return this.getAll().find(t=>t.name===e)}getById(e){return this.getAll().find(t=>t.data.id===e)}isActive(e){var t;const r="string"==typeof e?e:e.data.id;return(null==(t=yp().objects.active)?void 0:t.id)===r}getActive(){return wp().getActiveObject()}has(e){return this.getAll().findIndex(t=>t.name===e)>-1}select(e){const t="string"==typeof e?this.getById(e):e;t&&(wp().setActiveObject(t),wp().requestRenderAll())}deselectActive(){wp().discardActiveObject(),wp().requestRenderAll()}setValues(e,t){if(!(t=t||this.getActive()))return;let r=!1;(function(e){return e.name===ff.Sticker&&"forEachObject"in e})(t)&&e.fill&&e.fill!==t.fill&&t.forEachObject(t=>t.set("fill",e.fill)),hf(t)?((e.fontFamily!==t.fontFamily||e.fontSize!==t.fontSize)&&(r=!0),t.selectionStart!==t.selectionEnd?t.setSelectionStyles(e):t.set(e)):t.set(e),r?setTimeout(()=>{wp().requestRenderAll()},50):wp().requestRenderAll(),yp().objects.setActive(t),Qb(e)}move(e,t=1,r){(r=r||this.getActive())&&("up"===e?this.setValues({top:r.top-t}):"down"===e?this.setValues({top:r.top+t}):"left"===e?this.setValues({left:r.left-t}):"right"===e&&this.setValues({left:r.left+t}),bp().canvas.render())}bringToFront(e){(e=e||this.getActive())&&(e.bringToFront(),bp().canvas.render())}sendToBack(e){(e=e||this.getActive())&&(e.sendToBack(),bp().canvas.render())}flipHorizontally(e){(e=e||this.getActive())&&(this.setValues({flipX:!e.flipX}),bp().canvas.render())}duplicate(e){const t=e||this.getActive();t&&(this.deselectActive(),t.clone(e=>{e.set({left:t.left+40,top:t.top+40,data:{...t.data,id:Wb(10)},name:t.name}),wp().add(e),this.select(e),bp().canvas.render()}))}delete(e){(e=e||this.getActive())&&(this.deselectActive(),wp().remove(e),wp().requestRenderAll(),bp().history.addHistoryItem({name:"deletedObject"}))}syncObjects(){const e=this.getAll().map(e=>({name:e.name,selectable:e.selectable??!1,id:e.data.id}));vp.setState({objects:{...yp().objects,all:e}})}}const iw={frame:null,fonts:[]};function ow(e){return e.state||(e.state=Sp()),{...e.state||Sp(),name:e.name,id:Wb(15)}}function aw(e){return!!e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e)}function sw(e){return e?aw(e)?e:`${yp().config.baseUrl?`${yp().config.baseUrl}/`:""}${e}`:""}function lw(e,t){return t||btoa(e.split("/").pop())}const cw=new class{constructor(){ja(this,"loadedAssets",{})}loadAsset(e,t={type:"js"}){var r;e=e.startsWith("//")?`${window.location.protocol}${e}`:e;const n=null==(r=this.loadedAssets[e])?void 0:r.state;return"loaded"!==n||t.force?!n||this.loadedAssets[e].doc!==t.document||t.force&&"loaded"===n?(this.loadedAssets[e]={state:new Promise(r=>{const n={url:aw(e)?e:`assets/${e}`,id:lw(e,t.id),resolve:r,parentEl:t.parentEl,document:t.document};"css"===t.type?this.loadStyleAsset(n):this.loadScriptAsset(n)}),doc:t.document},this.loadedAssets[e].state):this.loadedAssets[e].state:new Promise(e=>e())}isLoadingOrLoaded(e){return null!=this.loadedAssets[e]}loadStyleAsset(e){var t;const r=e.document||document,n=e.parentEl||r.head,i=r.createElement("link"),o=lw(e.url,e.id);i.rel="stylesheet",i.id=o,i.href=e.url;try{n.querySelector(`#${o}`)&&(null==(t=n.querySelector(`#${o}`))||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state="loaded",e.resolve()},n.appendChild(i)}loadScriptAsset(e){var t;const r=e.document||document,n=e.parentEl||r.body,i=r.createElement("script"),o=lw(e.url,e.id);i.async=!0,i.id=o,i.src=e.url;try{n.querySelector(`#${o}`)&&(null==(t=n.querySelector(`#${o}`))||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state="loaded",e.resolve()},(n||n).appendChild(i)}};function uw(e){return`be-fonts-${e}`}function dw(e,t){const r=t.document||document,n=[],i=[];let o=[];if(e.forEach(e=>{"google"in e&&e.google?n.push(e):"src"in e&&i.push(e)}),null!=n&&n.length){const n=t.weights||[400],i=e.map(e=>`${e.family}:${n.join(",")}`).join("|"),a=cw.loadAsset(`https://fonts.googleapis.com/css?family=${i}&display=swap`,{type:"css",id:uw(t.id),force:t.forceAssetLoad,document:r});o.push(a)}if(null!=i&&i.length){const e=i.map(async e=>{const n=Array.from(r.fonts.values()).find(t=>t.family===e.family);if(n)return n.loaded;const i=new FontFace(e.family,`url(${null!=t&&t.prefixSrc?t.prefixSrc(e.src):e.src})`,e.descriptors);return r.fonts.add(i),i.load()});o=o.concat(e)}return Promise.all(o)}class hw{async undo(){if(this.canUndo()){const e=yp().history.items[yp().history.pointer-1];await this.load(e)}}async redo(){if(this.canRedo()){const e=yp().history.items[yp().history.pointer+1];await this.load(e)}}canUndo(){return yp().history.canUndo}canRedo(){return yp().history.canRedo}reload(){return this.load(yp().history.items[yp().history.pointer])}replaceCurrent(){const e=yp().history.items[yp().history.pointer];[...yp().history.items][yp().history.pointer]=ow({name:e.name,state:e})}addHistoryItem(e){const t=ow(e),r=[...yp().history.items.slice(0,yp().history.pointer+1),t];yp().history.update(r.length-1,r)}load(e){return e={...e,editor:e.editor||iw},new Promise(t=>{dw(function(e){const t=[];return e.forEach(e=>{var r,n,i;if(!hf(e))return;const o=null==(i=null==(n=null==(r=yp().config.tools)?void 0:r.text)?void 0:n.items)?void 0:i.find(t=>t.family===e.fontFamily);o&&t.push(o)}),t}(e.canvas.objects),{prefixSrc:sw,id:"pixie-fonts"}).finally(()=>{wp().loadFromJSON(e.canvas,()=>{bp().zoom.set(1),e.canvasWidth&&e.canvasHeight&&bp().canvas.resize(e.canvasWidth,e.canvasHeight,{resizeHelper:!1,applyZoom:!1}),bp().frame.remove(),e.editor.frame&&bp().frame.add(e.editor.frame.name,e.editor.frame.sizePercent),bp().objects.syncObjects(),bp().objects.getAll().forEach(e=>{var t,r;if(!e.data.pixieInternal&&"left"===e.originX&&"top"===e.originY){const t=e.getPointByOrigin("center","center");e.set("left",t.x),e.set("top",t.y)}e.set({...$b}),"i-text"===e.type&&(e.padding=null==(r=null==(t=yp().config.tools)?void 0:t.text)?void 0:r.controlsPadding)}),bp().canvas.render(),wp().calcOffset(),bp().zoom.fitToScreen(),yp().history.updatePointerById(e.id),bp().transform.resetStraightenAnchor(),t()})})})}addInitial(e){!yp().history.items.find(e=>"initial"===e.name)&&(e||!Kb())&&this.addHistoryItem({name:"initial",state:e})}}class fw{canMerge(){return bp().objects.getAll().filter(e=>e.name!==ff.MainImage).length>0}async apply(){yp().toggleLoading("merge");const e=bp().export.getDataUrl();e&&await bp().canvas.addMainImage(e,"merge")}}const pw=[{name:"grayscale"},{name:"blackWhite",fabricType:"blackwhite"},{name:"sharpen",uses:"Convolute",matrix:[0,-1,0,-1,5,-1,0,-1,0]},{name:"invert"},{name:"vintage"},{name:"polaroid"},{name:"kodachrome"},{name:"technicolor"},{name:"brownie"},{name:"sepia"},{name:"removeColor",fabricType:"removecolor",options:{distance:{type:"slider",current:.1,min:0,max:1,step:.01},color:{current:"#fff",type:"colorPicker"}}},{name:"brightness",options:{brightness:{type:"slider",current:.1,min:-1,max:1,step:.1}}},{name:"gamma",options:{red:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},green:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},blue:{type:"slider",current:.1,min:.2,max:2.2,step:.003921}},apply:e=>{e.gamma=[e.red,e.green,e.blue]}},{name:"noise",options:{noise:{type:"slider",current:40,min:1,max:600}}},{name:"pixelate",options:{blocksize:{type:"slider",min:1,max:40,current:6}}},{name:"blur",uses:"Convolute",matrix:[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9]},{name:"emboss",uses:"Convolute",matrix:[1,1,1,1,.7,-1,-1,-1,-1]},{name:"blendColor",fabricType:"blendcolor",options:{alpha:{type:"slider",current:.5,min:.1,max:1,step:.1},mode:{current:"add",type:"select",available:[{key:"add"},{key:"multiply"},{key:"subtract"},{key:"diff"},{key:"screen"},{key:"lighten"},{key:"darken"}]},color:{type:"colorPicker",current:"#FF4081"}}}],gw={grayscale:Zu("grayscale"),blackWhite:Zu("Black & White"),sharpen:Zu("Sharpen"),invert:Zu("Invert"),vintage:Zu("Vintage"),polaroid:Zu("Polaroid"),kodachrome:Zu("Kodachrome"),technicolor:Zu("Technicolor"),brownie:Zu("Brownie"),sepia:Zu("Sepia"),removeColor:Zu("Remove Color"),brightness:Zu("Brightness"),gamma:Zu("Gamma"),noise:Zu("Noise"),pixelate:Zu("Pixelate"),blur:Zu("Blur"),emboss:Zu("Emboss"),blendColor:Zu("Blend Color")},mw={distance:Zu("distance"),color:Zu("color"),brightness:Zu("brightness"),red:Zu("red"),green:Zu("green"),blue:Zu("blue"),noise:Zu("noise"),blocksize:Zu("blocksize"),mode:Zu("mode"),alpha:Zu("alpha")};function vw(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}class yw{constructor(){vp.subscribe(e=>e.history.pointer,()=>{this.syncState()})}apply(e){yp().filter.select(e,this.hasOptions(e));const t=this.getByName(e);if(this.isApplied(t.name))return void this.remove(t.name);const r=this.create(t);this.getImages().forEach(e=>{var t;null==(t=e.filters)||t.push(r),e.applyFilters()}),this.syncState(),bp().canvas.render()}remove(e){yp().filter.deselect(e);const t=this.getByName(e);this.getImages().forEach(e=>{var r;const n=this.findFilterIndex(t.name,e.filters);null==(r=e.filters)||r.splice(n,1),e.applyFilters()}),this.syncState(),bp().canvas.render()}getAll(){return pw}getByName(e){return pw.find(t=>t.name===e)}isApplied(e){const t=bp().canvas.getMainImage();return!!t&&this.findFilterIndex(e,t.filters)>-1}applyValue(e,t,r){const n=this.getByName(e);this.getImages().forEach(e=>{const i=(e.filters||[]).find(e=>e.type.toLowerCase()===n.name.toLowerCase());i&&(i[t]=r,n.apply&&n.apply(i,t,r),e.applyFilters())}),bp().canvas.render()}addCustom(e,t,r,n){const i=Vb.fabric.Image.filters;i[vw(e)]=Vb.fabric.util.createClass(i.BaseFilter,t),i[vw(e)].fromObject=i.BaseFilter.fromObject,pw.push({name:e,options:r,initialConfig:n})}create(e){const t=e.initialConfig||{};let r;return e.uses?(t.matrix=e.matrix,r=new(Vb.fabric.Image.filters[vw(e.uses)])(t)):(Object.entries(e.options||{}).forEach(([e,r])=>{t[e]=r.current}),r=new(Vb.fabric.Image.filters[vw(e.name)])(t)),r.name=e.name,r}hasOptions(e){return!!this.getByName(e).options}findFilterIndex(e,t){if(null==t||!t.length)return-1;const r=this.getByName(e);return t.findIndex(e=>this.configMatchesFabricFilter(r,e))}syncState(){var e;const t=[];((null==(e=this.getImages()[0])?void 0:e.filters)||[]).forEach(e=>{const r=this.getByFabricFilter(e);r&&t.push(r.name)}),vp.setState({filter:{...yp().filter,applied:t}})}getByFabricFilter(e){return pw.find(t=>this.configMatchesFabricFilter(t,e))}configMatchesFabricFilter(e,t){const r=t.type.toLowerCase().replace(" ","");return r===e.fabricType||r===e.name||"convolute"===r&&this.matrixAreEqual(e.matrix,t.matrix)}matrixAreEqual(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=e.length;r--;)if(e[r]!==t[r])return!1;return!0}getImages(){return bp().objects.getAll().filter(e=>e.name===ff.Image||e.name===ff.MainImage)}}function bw(e){var t,r;const n=(null==(r=null==(t=yp().config.tools)?void 0:t.resize)?void 0:r.minWidth)||50;return e?Math.ceil(100*n/yp().original.width):n}function ww(e){var t,r;const n=(null==(r=null==(t=yp().config.tools)?void 0:t.resize)?void 0:r.maxWidth)||2400;return e?Math.ceil(100*n/yp().original.width):n}function xw(e){var t,r;const n=(null==(r=null==(t=yp().config.tools)?void 0:t.resize)?void 0:r.minHeight)||50;return e?Math.ceil(100*n/yp().original.height):n}function Cw(e){var t,r;const n=(null==(r=null==(t=yp().config.tools)?void 0:t.resize)?void 0:r.maxHeight)||2400;return e?Math.ceil(100*n/yp().original.height):n}function _w(e,t){if(t)return e;const r=yp().original.height/e;return Math.floor(yp().original.width/r)}function Sw(e,t){if(t)return e;const r=yp().original.width/e;return Math.floor(yp().original.height/r)}class Aw{apply(e){const{width:t,height:r,usePercentages:n}=function(e){return e.width<bw(e.usePercentages)&&(e.width=bw(e.usePercentages),e.maintainAspect&&(e.height=Sw(e.width,e.usePercentages))),e.width>ww(e.usePercentages)&&(e.width=ww(e.usePercentages),e.maintainAspect&&(e.height=Sw(e.width,e.usePercentages))),e.height<xw(e.usePercentages)&&(e.height=xw(e.usePercentages),e.maintainAspect&&(e.width=_w(e.height,e.usePercentages))),e.height>Cw(e.usePercentages)&&(e.height=Cw(e.usePercentages),e.maintainAspect&&(e.width=_w(e.height,e.usePercentages))),e}(e),i=Math.ceil(yp().original.width),o=Math.ceil(yp().original.height),a=Math.ceil(t),s=Math.ceil(r);let l,c;n?(l=t/100,c=r/100):(l=t/yp().original.width,c=r/yp().original.height),(i!==a||o!==s)&&this.resize(l,c)}resize(e,t){bp().zoom.set(1,!1);const r=Math.round(yp().original.height*t),n=Math.round(yp().original.width*e);bp().canvas.resize(n,r,{applyZoom:!1,resizeHelper:!0}),bp().objects.getAll().forEach(r=>{const n=r.scaleX||1,i=r.scaleY||1,o=r.left||0,a=r.top||0,s=n*e,l=i*t,c=o*e,u=a*t;r.scaleX=s,r.scaleY=l,r.left=c,r.top=u,r.setCoords()}),bp().zoom.fitToScreen(),wp().requestRenderAll()}}function kw(e,t,r){let n=t,i=r;return e&&(r*e>t?i=t/e:n=r*e),{width:Math.floor(n),height:Math.floor(i)}}function Ew(e){if(!e)return null;const t=e.split(":");return parseInt(t[0])/parseInt(t[1])}class Iw{constructor(){ja(this,"refs",null)}apply(e){var t;const r=null==(t=bp().frame.active.config)?void 0:t.name,n=bp().frame.active.currentSizeInPercent;return bp().frame.active.hide(),bp().merge.apply().then(()=>{bp().canvas.resize(Math.round(e.width),Math.round(e.height),{applyZoom:!0,resizeHelper:!0});const t=bp().canvas.getMainImage();t.cropX=Math.round(e.left),t.cropY=Math.round(e.top),t.width=Math.round(e.width),t.height=Math.round(e.height),t.viewportCenter(),r&&bp().frame.add(r,n),bp().zoom.fitToScreen(),bp().canvas.render()})}drawZone(e){var t;null!=(t=this.refs)&&t.current&&(yp().crop.setCropzoneRect(e),function(e,t){null!==t.innerZone&&(function(e,t){t.innerZone.style.width=`${e.width}px`,t.innerZone.style.height=`${e.height}px`,t.innerZone.style.transform=`translate(${e.left}px, ${e.top}px)`}(e,t),function(e,t){const r=yp().canvasSize.width,n=yp().canvasSize.height;t.maskTop.style.height=`${e.top}px`,t.maskTop.style.width=`${r}px`,t.maskLeft.style.top=`${e.top}px`,t.maskLeft.style.height=`${e.height}px`,t.maskLeft.style.width=`${e.left}px`;const i=e.left+e.width;t.maskRight.style.left=`${i}px`,t.maskRight.style.top=`${e.top}px`,t.maskRight.style.height=`${e.height}px`,t.maskRight.style.width=r-i+"px",t.maskBottom.style.height=n-(e.top+e.height)+"px",t.maskBottom.style.width=`${r}px`}(e,t),function(e,t){const r=(e.width-2)/3;t.lineVer1.style.height=`${e.height}px`,t.lineVer1.style.transform=`translate(${r}px, 0)`,t.lineVer2.style.height=`${e.height}px`,t.lineVer2.style.transform=`translate(${2*r}px, 0)`;const n=(e.height-2)/3;t.lineHor1.style.width=`${e.width}px`,t.lineHor1.style.transform=`translate(0, ${n}px)`,t.lineHor2.style.width=`${e.width}px`,t.lineHor2.style.transform=`translate(0, ${2*n}px)`}(e,t))}(e,this.refs.current))}resetCropzone(e){const t=yp().canvasSize,r=Ew(e);if(!t)return;yp().crop.setAspectRatio(e);const n=function(e,t=null){const r={width:e.width,height:e.height,top:0,left:0,angle:0};if(t){const e=kw(t,r.width,r.height);r.width=e.width,r.height=e.height}return r.left=(e.width-r.width)/2,r.top=(e.height-r.height)/2,r}(t,r);this.drawZone(n)}registerRefs(e){this.refs=e}}class jw{getShapeByName(e){var t,r;const n=null==(r=null==(t=yp().config.tools)?void 0:t.shapes)?void 0:r.items;return(null==n?void 0:n.find(t=>t.name===e))||null}addBasicShape(e){var t;const r=this.getShapeByName(e);if(!r)return null;const{width:n,height:i,...o}=(null==(t=yp().config.objectDefaults)?void 0:t.shape)||{},a={...o,...r.options};let s;if("circle"===r.name)s=new Vb.fabric.Circle({...a,radius:100});else if("ellipse"===r.name)s=new Vb.fabric.Ellipse({...a,rx:100,ry:50});else if("Path"===r.type)s=new Vb.fabric.Path(a.path,{displayName:r.name,...a});else{const e=r.type;s=new Vb.fabric[e]({...a,width:150,height:150})}return this.addAndPositionShape(s,ff.Shape,{width:n,height:i}),s}addSticker(e,t){var r,n,i;const o=null==(i=null==(n=null==(r=yp().config.tools)?void 0:r.stickers)?void 0:n.items)?void 0:i.find(t=>t.name===e);if(!o)return Promise.resolve();if("svg"===o.type){const e=Tw(o,t);return this.addSvgSticker(e)}return this.addRegularSticker(o,t)}addRegularSticker(e,t){return new Promise(r=>{Vb.fabric.util.loadImage(Tw(e,t),e=>{var t;const{width:n,height:i,...o}=(null==(t=yp().config.objectDefaults)?void 0:t.sticker)||{},a=new Vb.fabric.Image(e,o);this.addAndPositionShape(a,ff.Sticker,{width:n,height:i}),r()})})}addSvgSticker(e,t=ff.Sticker){return new Promise(r=>{Vb.fabric.loadSVGFromURL(e,(e,n)=>{var i;const{width:o,height:a,...s}=(null==(i=yp().config.objectDefaults)?void 0:i.sticker)||{},l=Vb.fabric.util.groupSVGElements(e,n);l.set(s),this.addAndPositionShape(l,t,{width:o,height:a}),r()})})}addAndPositionShape(e,t,{width:r}){e.name=t,e.scaleX=1,e.scaleY=1,wp().add(e);const n=r||yp().original.width*yp().zoom/4;e.scaleToWidth(Math.min(150,n)),e.viewportCenter(),e.setCoords(),bp().canvas.render(),wp().setActiveObject(e)}}function Tw(e,t){return sw(`images/stickers/${e.name}/${t}.${e.type}`)}class Fw{constructor(e){ja(this,"patternCache",[]),this.activeFrame=e}fillParts(e){this.patternCache.forEach(t=>{this.fillPartWithPattern(t,e)})}fillPartWithPattern(e,t){if(!this.activeFrame.parts)return;e.canvas=new Vb.fabric.StaticCanvas(null),e.canvas.add(e.img);const r=new Vb.fabric.Pattern({source:e.canvas.getElement(),repeat:"repeat"===t?"repeat":"no-repeat"});this.activeFrame.parts[e.name]&&this.activeFrame.parts[e.name].set("fill",r)}scale(e){if(!this.activeFrame.config||!this.patternCache)return;const t=this.activeFrame.config.mode;e/=wp().getRetinaScaling(),this.patternCache.forEach(r=>{this.activeFrame.parts&&("top"===r.name||"bottom"===r.name?"stretch"===t?(this.scalePatternToWidth(r.img,this.activeFrame.parts.top.getScaledWidth()),this.scalePatternToHeight(r.img,e)):r.img.scaleToHeight(e):"left"===r.name||"right"===r.name?"stretch"===t?(this.scalePatternToWidth(r.img,e),this.scalePatternToHeight(r.img,this.activeFrame.parts.left.getScaledHeight())):r.img.scaleToWidth(e):"stretch"===t?(this.scalePatternToWidth(r.img,e),this.scalePatternToHeight(r.img,e)):r.img.scaleToWidth(e),r.canvas.setDimensions({width:r.img.getScaledWidth(),height:r.img.getScaledHeight()}))}),bp().canvas.render()}scalePatternToWidth(e,t){if(!e.width)return;const r=e.getBoundingRect().width/e.getScaledWidth();e.set("scaleX",t/e.width/r),e.setCoords()}scalePatternToHeight(e,t){if(!e.height)return;const r=e.getBoundingRect().height/e.getScaledHeight();e.set("scaleY",t/e.height/r),e.setCoords()}load(e){const t=this.activeFrame.getPartNames().map(t=>new Promise(r=>{const n={..._p,originX:"left",originY:"top"};yp().config.crossOrigin&&(n.crossOrigin="anonymous"),Vb.fabric.Image.fromURL(this.getPartUrl(e,t),e=>{r({name:t,img:e})},n)}));return Promise.all(t).then(t=>{this.patternCache=t,this.fillParts(e.mode)})}getPartUrl(e,t){return sw(`images/frames/${e.name}/${t}.png`)}}class Ow{constructor(e,t){this.activeFrame=e,this.patterns=t}get defaultColor(){var e,t;return null==(t=null==(e=yp().config.objectDefaults)?void 0:e.global)?void 0:t.fill}build(e,t){this.createParts(e),this.resize(t),this.activeFrame.config=e,"basic"!==e.mode?this.patterns.load(e).then(()=>{this.patterns.scale(t),bp().canvas.render()}):bp().canvas.render()}createParts(e){const t={};this.activeFrame.getPartNames().forEach(r=>{const n="basic"===e.mode?this.defaultColor:void 0;t[r]=new Vb.fabric.Rect({..._p,fill:n,originX:"left",originY:"top",name:`frame.rect.${r}`,objectCaching:!1,data:{pixieInternal:!0}}),wp().add(t[r])}),this.activeFrame.parts=t}resize(e){const t=yp().original.width,r=yp().original.height,n=this.activeFrame,i=e;n.parts&&(n.parts.topLeft.set({width:i,height:i}),n.parts.topRight.set({left:t-n.parts.topLeft.getScaledWidth(),width:i,height:i}),n.parts.top.set({left:n.parts.topLeft.getScaledWidth()-1,width:t-n.parts.topLeft.getScaledWidth()-n.parts.topRight.getScaledWidth()+3,height:i}),n.parts.bottomLeft.set({top:r-n.parts.topLeft.getScaledHeight(),width:i,height:i}),n.parts.left.set({top:n.parts.topLeft.getScaledHeight()-1,width:i,height:r-n.parts.topLeft.getScaledHeight()-n.parts.bottomLeft.getScaledHeight()+3}),n.parts.bottomRight.set({left:t-n.parts.bottomLeft.getScaledWidth(),top:r-n.parts.topRight.getScaledWidth(),width:i,height:i}),n.parts.bottom.set({left:n.parts.top.left,top:r-n.parts.top.getScaledHeight(),width:n.parts.top.getScaledWidth(),height:i}),n.parts.right.set({left:t-n.parts.left.getScaledWidth(),top:n.parts.left.top,width:n.parts.left.width,height:n.parts.left.getScaledHeight()}))}}class Pw{constructor(){ja(this,"corners",["topLeft","topRight","bottomLeft","bottomRight"]),ja(this,"sides",["top","right","bottom","left"]),ja(this,"parts",null),ja(this,"config",null),ja(this,"currentSizeInPercent",100)}getPartNames(){return[...this.corners,...this.sides]}hide(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!1})),bp().canvas.render())}show(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!0})),bp().canvas.render())}remove(){this.parts&&(this.config=null,Object.values(this.parts).forEach(e=>{wp().remove(e)}),this.parts=null,bp().canvas.render())}is(e){return!!this.config&&this.config.name===e.name}changeColor(e){var t;"basic"!==(null==(t=this.config)?void 0:t.mode)||!this.parts||(Object.values(this.parts).forEach(t=>{t.set("fill",e)}),bp().canvas.render())}getMinSize(){var e;return(null==(e=this.config)?void 0:e.size.min)??1}getMaxSize(){var e;return(null==(e=this.config)?void 0:e.size.max)??35}}class Mw{constructor(){ja(this,"patterns"),ja(this,"builder"),ja(this,"active"),this.active=new Pw,this.patterns=new Fw(this.active),this.builder=new Ow(this.active,this.patterns),wp().on("object:added",()=>{Object.values(this.active.parts||[]).forEach(e=>e.moveTo(98))})}add(e,t){const r=this.getByName(e);if(!r||this.active.is(r))return;this.active.remove(),this.active.currentSizeInPercent=t??r.size.default;const n=this.calcFrameSizeInPixels(this.active.currentSizeInPercent);this.builder.build(r,n),yp().frame.select(r)}resize(e){if(!this.active.parts||!this.active.config)return;e?this.active.currentSizeInPercent=e:e=this.active.currentSizeInPercent;const t=this.calcFrameSizeInPixels(e);this.builder.resize(t),this.patterns.scale(t),bp().canvas.render()}changeColor(e){this.active.changeColor(e)}remove(){this.active.remove(),yp().frame.deselect()}getByName(e){var t,r;const n=null==(r=null==(t=yp().config.tools)?void 0:t.frame)?void 0:r.items;if(n)return n.find(t=>t.name===e)}getActiveFrameConfig(){return this.active.config}calcFrameSizeInPixels(e){const t=Math.min(yp().original.width,yp().original.height);return Math.ceil(e/100*t)}}class Rw{constructor(){ja(this,"minWidth",250)}add(e,t={}){var r,n,i,o,a;if(!(e=e||(null==(n=null==(r=yp().config.tools)?void 0:r.text)?void 0:n.defaultText)))return;const s={...null==(i=yp().config.objectDefaults)?void 0:i.text,...t,name:ff.Text,padding:null==(a=null==(o=yp().config.tools)?void 0:o.text)?void 0:a.controlsPadding,editingBorderColor:Qu.fill},l=new Vb.fabric.IText(e,s);wp().add(l),null==t.left&&null==t.top&&this.autoPositionText(l),bp().objects.select(l)}autoPositionText(e){const t=wp().getWidth(),r=wp().getHeight(),n=Math.min(wp().getWidth(),this.minWidth);e.scaleToWidth(Math.max(t/3,n)),e.getScaledHeight()>r&&e.scaleToHeight(r-e.getScaledHeight()-20),e.viewportCenter(),wp().getObjects("i-text").forEach(t=>{if(t!==e&&t.intersectsWithObject(e)){const r=t.top-e.top+t.getScaledHeight();let n=e.top+r;n>yp().original.height-t.getScaledHeight()&&(n=0),e.set("top",n),e.setCoords()}})}selectOrAddText(e,t={}){if(yp().objects.active.isText)return!1;const r=bp().objects.getAll().find(e=>hf(e));return r?(bp().objects.select(r),!1):(this.add(e,t),!0)}}const Lw=e=>{const t=new Vb.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=Vb.fabric.document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext("2d");return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(0,5),t.lineTo(10,5),t.closePath(),t.stroke(),e},t},Nw=e=>{const t=new Vb.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext("2d");return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(5,0),t.lineTo(5,10),t.closePath(),t.stroke(),e},t},Dw=e=>{const t=new Vb.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=this.width/2,t=document.createElement("canvas"),r=new Vb.fabric.Rect({width:e,height:e,angle:45,fill:this.color}),n=r.getBoundingRect().width;t.width=n+5,t.height=n+5,r.set({left:n/2,top:n/2});const i=t.getContext("2d");return r.render(i),t},t},zw=e=>{const t=new Vb.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=document.createElement("canvas");e.width=12,e.height=12;const t=e.getContext("2d");return t.fillStyle=this.color,t.fillRect(0,0,10,10),e},t};var Bw,Uw;class Vw{constructor(){ja(this,"customBrushes",{VLineBrush:Lw,HLineBrush:Nw,DiamondBrush:Dw,SquareBrush:zw}),ja(this,"currentBrush",{type:"PencilBrush",color:null==(Uw=null==(Bw=yp().config.objectDefaults)?void 0:Bw.global)?void 0:Uw.fill,width:ed[1]}),ja(this,"onPathCreated",e=>{e.path.name=ff.Drawing,e.path.set(function(){const e={..._p};return delete e.strokeWidth,e}()),yp().setDirty(!0)})}enable(){wp().on("path:created",this.onPathCreated),wp().isDrawingMode=!0,this.setBrushType(this.currentBrush.type),this.setBrushSize(this.currentBrush.width)}disable(){wp().off("path:created",this.onPathCreated),wp().isDrawingMode=!1}getBrushType(){return this.currentBrush.type}setBrushType(e){this.currentBrush.type=e,wp().freeDrawingBrush=e in Vb.fabric?new Vb.fabric[e](wp()):this.customBrushes[e](wp()),this.applyBrushStyles()}applyBrushStyles(){Object.keys(this.currentBrush).forEach(e=>{wp().freeDrawingBrush[e]=this.currentBrush[e]});const e=wp().freeDrawingBrush;e.getPatternSrc&&(e.source=e.getPatternSrc.call(e))}setBrushSize(e){this.currentBrush.width=e,this.applyBrushStyles()}getBrushSize(){return this.currentBrush.width}setBrushColor(e){this.currentBrush.color=e,this.applyBrushStyles()}getBrushColor(){return this.currentBrush.color}}async function Hw(e,t=!0,r=!0){const n=await Xb(e);if(n)return new Promise(e=>{n.name=ff.Image,n.opacity=0;const i=yp().original.width,o=yp().original.height;if(t&&(n.width>=i||n.height>=o)){const e=i-.1*i,t=o-.1*o,r=1/Math.min(t/n.getScaledHeight(),e/n.getScaledWidth());n.scaleX*=1/r,n.scaleY*=1/r}yp().fabric.add(n),r&&yp().fabric.setActiveObject(n),n.viewportCenter(),n.setCoords(),yp().fabric.requestRenderAll(),bp().zoom.fitToScreen(),n.animate("opacity","1",{duration:425,onChange:()=>{yp().fabric.requestRenderAll()},onComplete:()=>{e(n)}})})}function $w(e){var t;return(null==(t=/(?:\.([^.]+))?$/.exec(e))?void 0:t[1])||""}class Ww{constructor(e,t){ja(this,"id"),ja(this,"fingerprint"),ja(this,"name"),ja(this,"relativePath",""),ja(this,"size"),ja(this,"mime",""),ja(this,"extension",""),ja(this,"native"),ja(this,"lastModified"),ja(this,"cachedData"),this.id=Ep(),this.name=e.name,this.size=e.size,this.mime=function(e){const t={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",yaml:"text/yaml",yml:"text/yaml",log:"text/plain"},r=e.name?$w(e.name):null;return e.type?e.type:r&&r in t?t[r]:"application/octet-stream"}(e),this.lastModified=e.lastModified,this.extension=$w(e.name)||"bin",this.native=e,(t=(t=t||e.webkitRelativePath||"").replace(/^\/+/g,""))&&t.split("/").length>1&&(this.relativePath=t),this.fingerprint=function({name:e,mime:t,size:r,relativePath:n,lastModified:i}){let o="be";return"string"==typeof e&&(o+=`-${Gw(e.toLowerCase())}`),t&&(o+=`-${t}`),"string"==typeof n&&(o+=`-${Gw(n.toLowerCase())}`),void 0!==r&&(o+=`-${r}`),void 0!==i&&(o+=`-${i}`),o}({name:this.name,size:this.size,mime:this.mime,lastModified:this.lastModified})}get data(){return new Promise(e=>{this.cachedData&&e(this.cachedData);const t=new FileReader;t.addEventListener("load",()=>{this.cachedData=t.result,e(this.cachedData)}),"json"===this.extension?t.readAsText(this.native):t.readAsDataURL(this.native)})}}function Gw(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}var qw=(e=>(e.image="image/*",e.audio="audio/*",e.text="text/*",e.json="application/json",e.video="video/mp4,video/mpeg,video/x-m4v,video/*",e))(qw||{});function Yw(e,t=1){if(null==e||Number.isNaN(e))return"";const r=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(r&&(e=-e),e<1)return(r?"-":"")+e+" B";const i=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,i));const o=n[i];return e>=10||e%1==0?`${(r?"-":"")+e.toFixed(0)} ${o}`:`${(r?"-":"")+e.toFixed(t)} ${o}`}function Xw(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}Xw.prototype.match=function(e){var t,r,n=!0,i=this.parts,o=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(r=(e||"").split(this.separator),t=0;n&&t<o;t++)"*"!==i[t]&&(n=t<r.length&&i[t]===r[t]);n=n&&r}else n=!1;else if("function"==typeof e.splice)for(n=[],t=e.length;t--;)this.match(e[t])&&(n[n.length]=e[t]);else if("object"==typeof e)for(var a in n={},e)this.match(a)&&(n[a]=e[a]);return n};var Kw=/[\/\+\.]/;const Zw=Yu(function(e,t){function r(t){var r=function(e,t,r){var n=new Xw(e,r||/[\/\.]/);return typeof t<"u"?n.match(t):n}(t,e,Kw);return r&&r.length>=2}return t?r(t.split(";")[0]):r});function Jw(e,t){return t.map(e=>e.split(",")).flat().some(t=>{if(t.includes("/"))return!!e.mime&&Zw(e.mime.replace(/;.*?$/,""),t);const r=t.replace(".","").toLowerCase();return!(!r||!e.extension)&&e.extension.toLowerCase()===r})}class Qw{async uploadAndAddImage(e=!0){const t=await this.openUploadWindow();await this.openUploadedFile(t,e)}async uploadAndReplaceMainImage(){const e=await this.openUploadWindow();e&&await this.openBackgroundImage(e)}async uploadAndOpenStateFile(){const e=await this.openUploadWindow(ex);e&&await this.loadState(await e.data)}async addImageFromUrl(e,t=!0){var r,n;await Hw(e,(null==(n=null==(r=yp().config.tools)?void 0:r.import)?void 0:n.fitOverlayToScreen)??!0,t),bp().history.addHistoryItem({name:"overlayImage"})}async addImageFromData(e,t=!0){var r,n;await Hw(e,(null==(n=null==(r=yp().config.tools)?void 0:r.import)?void 0:n.fitOverlayToScreen)??!0,t),bp().history.addHistoryItem({name:"overlayImage"})}async openUploadedFile(e,t=!0){if(!e)return;const r=await e.data;switch(e.extension){case"json":await this.loadState(r);break;case"svg":await bp().shape.addSvgSticker(r,ff.Image),bp().history.addHistoryItem({name:"overlayImage"});break;default:await this.addImageFromData(r,t)}}async loadState(e){let t;yp().toggleLoading("state"),await xp(),t="string"==typeof e?e.endsWith(".json")?await Cp(e):JSON.parse(e):e,t.history?yp().history.reset(t.history):await bp().history.addInitial(t),await bp().history.reload(),yp().toggleLoading(!1)}async openUploadWindow(e){var t,r;e=e||function(){var e,t;const r=null==(t=null==(e=yp().config.tools)?void 0:e.import)?void 0:t.validImgExtensions;return r?{extensions:r}:{types:[qw.image]}}();const n=(await function(e={}){return new Promise(t=>{const r=function(e={}){const t=document.querySelector("#hidden-file-upload-input");t&&t.remove();const r=document.createElement("input");return r.type="file",r.multiple=e.multiple??!1,r.classList.add("hidden"),r.style.display="none",r.style.visibility="hidden",r.id="hidden-file-upload-input",r.accept=function({extensions:e=[],types:t=[]}){const r=[];return null!=e&&e.length&&(e=e.map(e=>e.startsWith(".")?e:`.${e}`),r.push(e.join(","))),null!=t&&t.length&&r.push(t.join(",")),r.join(",")}(e),e.directory&&(r.webkitdirectory=!0),document.body.appendChild(r),r}(e);r.onchange=e=>{const n=e.target.files;if(!n)return t([]);const i=Array.from(n).filter(e=>".DS_Store"!==e.name).map(e=>new Ww(e));t(i),r.remove()},document.body.appendChild(r),r.click()})}(e))[0];return this.fileIsValid(n)?(null==(r=(t=yp().config).onFileOpen)||r.call(t,n),n):null}async openBackgroundImage(e){let t;await xp(),t=e instanceof HTMLImageElement?e.src:e instanceof Ww?await e.data:e;const r=await bp().canvas.addMainImage(t);return await bp().history.addInitial(),r}fileIsValid(e){var t,r,n,i;const o=function(e,t){if(!t)return;const{maxFileSize:r,allowedFileTypes:n,blockedFileTypes:i}=t;return r&&null!=e.size&&e.size>r?Zu("`:file` exceeds maximum allowed size of :size",{values:{file:e.name,size:Yw(r)}}):null!=n&&n.length&&!Jw(e,n)||null!=i&&i.length&&Jw(e,i)?Zu("This file type is not allowed"):void 0}(e,{maxFileSize:(null==(r=null==(t=yp().config.tools)?void 0:t.import)?void 0:r.maxFileSize)??10485760,allowedFileTypes:[...(null==(i=null==(n=yp().config.tools)?void 0:n.import)?void 0:i.validImgExtensions)??[],"json"]});return!o||(Fp.danger(o),!1)}}const ex={types:[".json",qw.json]};class tx{constructor(){ja(this,"watermark",null),ja(this,"lineStyle",{stroke:"rgba(255,255,255,0.3)",strokeWidth:5,strokeLineCap:"round",strokeLineJoin:"round"})}add(e){this.createGroup(),this.addText(e),this.addLines(),wp().add(this.watermark),bp().canvas.render()}remove(){this.watermark&&(wp().remove(this.watermark),this.watermark=null,bp().canvas.render())}createGroup(){this.watermark=new Vb.fabric.Group(void 0,{..._p,width:yp().original.width,height:yp().original.height,excludeFromExport:!0,top:0,left:0,originX:"left",originY:"top"})}addText(e){var t;const r=new Vb.fabric.Text(e,{fill:"rgba(255,255,255,0.3)",strokeWidth:2,stroke:"rgba(255,255,255,0.4)",originX:"center",originY:"center",fontWeight:600,fontSize:150,fontFamily:"Courier New"});r.scaleToWidth(yp().original.width/2),null==(t=this.watermark)||t.add(r)}addLines(){var e;if(!this.watermark)return;const t=null==(e=this.watermark)?void 0:e.getObjects("text")[0],r=yp().original.width/2,n=yp().original.height/2,i=100,o=t.width/4,a=new Vb.fabric.Line(void 0,this.lineStyle),s=new Vb.fabric.Line(void 0,this.lineStyle),l=new Vb.fabric.Line(void 0,this.lineStyle),c=new Vb.fabric.Line(void 0,this.lineStyle);this.watermark.add(a,s,l,c),a.set({x1:o,y1:-i,x2:r,y2:-n}),s.set({x1:o,y1:i,x2:r,y2:n}),l.set({x1:-o,y1:-i,x2:-r,y2:-n}),c.set({x1:-o,y1:i,x2:-r,y2:n})}}var rx={exports:{}};!function(e){!function(){function t(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){a(n.response,t,r)},n.onerror=function(){},n.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function n(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof qu&&qu.global===qu?qu:void 0,o=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,o,a){var s=i.URL||i.webkitURL,l=document.createElement("a");o=o||e.name||"download",l.download=o,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?n(l):r(l.href)?t(e,o,a):n(l,l.target="_blank")):(l.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(l.href)},4e4),setTimeout(function(){n(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,i,o){if(i=i||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return typeof t>"u"?t={autoBom:!1}:"object"!=typeof t&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,o),i);else if(r(e))t(e,i,o);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout(function(){n(a)})}}:function(e,r,n,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return t(e,r,n);var s="application/octet-stream"===e.type,l=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&l||o)&&typeof FileReader<"u"){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var d=i.URL||i.webkitURL,h=d.createObjectURL(e);a?a.location=h:location.href=h,a=null,setTimeout(function(){d.revokeObjectURL(h)},4e4)}});i.saveAs=a.saveAs=a,e.exports=a}()}(rx);var nx=rx.exports;class ix{save(e,t,r){var n,i,o;const a=null==(n=yp().config.tools)?void 0:n.export;e=e||(null==a?void 0:a.defaultName),t=this.getFormat(t),r=this.getQuality(r);const s=`${e}.${t}`;this.applyWaterMark();const l="json"===t?this.getJsonState():this.getDataUrl(t,r);if(bp().watermark.remove(),l)if(yp().config.saveUrl)fetch(yp().config.saveUrl,{method:"POST",body:JSON.stringify({data:l,filename:s,format:t})});else if(yp().config.onSave)null==(o=(i=yp().config).onSave)||o.call(i,l,s,t);else{const e=this.getCanvasBlob(t,l);nx.saveAs(e,s)}}getDataUrl(e,t){try{return"svg"===e?wp().toSVG():wp().toDataURL({format:this.getFormat(e),quality:this.getQuality(t),multiplier:Math.max(yp().original.width/wp().width,yp().original.height/wp().height)})}catch(e){e.message.toLowerCase().includes("tainted")&&Fp.danger(Zu("Could not export canvas with external image."))}return null}getCanvasBlob(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});const r=`image/${e}`;return function(e,t,r){t=t||"",r=r||512;const n=atob(e),i=[];for(let o=0;o<n.length;o+=r){const e=n.slice(o,o+r),t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);const a=new Uint8Array(t);i.push(a)}return new Blob(i,{type:t})}(t=t.replace(/data:image\/([a-z]*)?;base64,/,""),r)}getJsonState(){return JSON.stringify({...Sp(),history:yp().history})}applyWaterMark(){const e=yp().config.watermarkText;e&&bp().watermark.add(e)}getFormat(e){var t;const r=null==(t=yp().config.tools)?void 0:t.export;return"jpg"===(e=e||(null==r?void 0:r.defaultFormat)||"png")&&(e="jpeg"),e}getQuality(e){var t;const r=null==(t=yp().config.tools)?void 0:t.export;return e||(null==r?void 0:r.defaultQuality)||.8}}class ox{constructor(){ja(this,"previewRect",null)}async apply(e){this.previewRect||this.showPreview(),this.updatePreview(e),wp().remove(this.previewRect),wp().clipPath=this.previewRect;const t=bp().export.getDataUrl();t&&bp().canvas.clear(),this.hidePreview(),t&&await bp().canvas.addMainImage(t),wp().clipPath=void 0}getPreviewRadius(){var e;return(null==(e=this.previewRect)?void 0:e.rx)||0}updatePreview(e){this.previewRect&&(this.previewRect.set({rx:e,ry:e}),bp().canvas.render())}showPreview(){const e=.04*yp().original.width;this.previewRect=new Vb.fabric.Rect({width:yp().original.width,height:yp().original.height,rx:e,ry:e,objectCaching:!1,fill:"transparent",name:"round.rect",data:{pixieInternal:!0},stroke:"rgba(255,255,255,0.8)",strokeWidth:3,strokeDashArray:[4,4],selectable:!1,evented:!1}),wp().add(this.previewRect),this.previewRect.moveTo(99),this.previewRect.viewportCenter(),bp().canvas.render()}hidePreview(){this.previewRect&&(wp().remove(this.previewRect),bp().canvas.render(),this.previewRect=null)}}class ax{get straightenAnchor(){return wp().getObjects().find(e=>e.name===ff.StraightenAnchor)}rotateLeft(){this.rotateFixed(-90)}rotateRight(){this.rotateFixed(90)}straighten(e){this.storeObjectsRelationToHelper(),bp().objects.deselectActive();const t=(this.straightenAnchor.data.rotateAngle||0)+e,r=this.getImageScale(t,this.straightenAnchor);this.straightenAnchor.angle=t,this.straightenAnchor.scaleX=r,this.straightenAnchor.scaleY=r,this.straightenAnchor.data.straightenAngle=e,this.transformObjectsBasedOnHelper()}flip(e){const t="horizontal"===e?"flipY":"flipX";bp().objects.getAll().forEach(e=>{e[t]=!e[t]}),bp().canvas.render()}rotateFixed(e){bp().zoom.set(1,!1),bp().objects.deselectActive();const t=this.straightenAnchor.data.rotateAngle||0;e=90*Math.round(e/90);const r=t+(this.straightenAnchor.data.straightenAngle||0)+e;bp().canvas.resize(yp().original.height,yp().original.width,{applyZoom:!1,resizeHelper:!1}),this.storeObjectsRelationToHelper(),this.straightenAnchor.rotate(r),this.straightenAnchor.data.rotateAngle=t+e,this.straightenAnchor.center(),this.transformObjectsBasedOnHelper(),bp().frame.resize(bp().frame.active.currentSizeInPercent),requestAnimationFrame(()=>{bp().zoom.fitToScreen()})}getImageScale(e,t){e=Vb.fabric.util.degreesToRadians(e);const r=yp().original.width/2,n=yp().original.height/2,i=t.width/2,o=t.height/2,a=Math.sqrt(r**2+n**2),s=Math.asin(n/a);let l=(e%(2*Math.PI)+4*Math.PI)%(2*Math.PI);l>Math.PI&&(l-=Math.PI),l>Math.PI/2&&l<=Math.PI&&(l=Math.PI/2-(l-Math.PI/2));const c=Math.PI/2-s-Math.abs(l),u=Math.abs(s-Math.abs(l)),d=Math.cos(c)*a,h=Math.cos(u)*a;return Math.max(h/i,d/o)}storeObjectsRelationToHelper(){bp().objects.getAll().forEach(e=>{if(e!==this.straightenAnchor){const t=Vb.fabric.util.multiplyTransformMatrices(Vb.fabric.util.invertTransform(this.straightenAnchor.calcTransformMatrix()),e.calcTransformMatrix());e.data={...e.data,relationToCanvas:t}}})}transformObjectsBasedOnHelper(){bp().objects.getAll().forEach(e=>{if(e.data.relationToCanvas){const t=Vb.fabric.util.multiplyTransformMatrices(this.straightenAnchor.calcTransformMatrix(),e.data.relationToCanvas),r=Vb.fabric.util.qrDecompose(t);e.set({flipX:!1,flipY:!1}),e.setPositionByOrigin({x:r.translateX,y:r.translateY},"center","center"),e.set(r),e.setCoords(),e.data.relationToCanvas=null}})}resetStraightenAnchor(){const e=this.straightenAnchor;e&&wp().remove(e);const t=new Vb.fabric.Rect({..._p,name:ff.StraightenAnchor,visible:!1,width:yp().original.width,height:yp().original.height,data:{pixieInternal:!0,straightenAngle:0,rotateAngle:0}});wp().add(t),t.viewportCenter()}}function sx(e,t){const r=new ResizeObserver(e=>{const r=e[0].contentRect;t({width:r.width,height:r.height})});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}}function lx(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}const cx="flex flex-shrink-0 items-center justify-between px-12 py-[9px] w-full h-[54px]",ux={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{type:"tween",duration:.15}};function dx(e,{padding:t,equalWidth:r,variant:n}={}){switch(e){case"2xs":return"link"===n?"text-xs":`text-xs h-24 ${r?"w-24":t||"px-10"}`;case"xs":return"link"===n?"text-xs":`text-xs h-30 ${r?"w-30":t||"px-14"}`;case"sm":return"link"===n?"text-sm":`text-sm h-36 ${r?"w-36":t||"px-18"}`;case"md":return"link"===n?"text-base":`text-base h-42 ${r?"w-42":t||"px-22"}`;case"lg":return"link"===n?"text-lg":`text-base h-50 ${r?"w-50":t||"px-26"}`;case"xl":return"link"===n?"text-xl":`text-lg h-60 ${r?"w-60":t||"px-32"}`;default:return e||""}}function hx(e){const{variant:t,shadow:r,whitespace:n="whitespace-nowrap",display:i="inline-flex"}=e,o={...e,border:e.border||"border"};let a=[];return"outline"===t?a=function({color:e,border:t}){const r="disabled:text-disabled disabled:bg-transparent disabled:border-disabled-bg";switch(e){case"primary":return[`text-primary bg-transparent ${t} border-primary/50`,"hover:bg-primary/hover hover:border-primary",r];case"danger":return[`text-danger bg-transparent ${t} border-danger/50`,"hover:bg-danger/4 hover:border-danger",r];case"positive":return[`text-positive bg-transparent ${t} border-positive/50`,"hover:bg-positive/4 hover:border-positive",r];case"paper":return[`text bg-paper ${t}`,"hover:bg-hover",r];case"white":return["text-white bg-transparent border border-white","hover:bg-white/20","disabled:text-white/70 disabled:border-white/70 disabled:bg-transparent"];default:return[`bg-transparent ${t}`,"hover:bg-hover",r]}}(o):"text"===t?a=function({color:e}){const t="disabled:text-disabled disabled:bg-transparent";switch(e){case"primary":return["text-primary bg-transparent border-transparent","hover:bg-primary/4",t];case"danger":return["text-danger bg-transparent border-transparent","hover:bg-danger/4",t];case"positive":return["text-positive bg-transparent border-transparent","hover:bg-positive/4",t];case"white":return["text-white bg-transparent border-transparent","hover:bg-white/20","disabled:text-white/70 disabled:bg-transparent"];default:return["bg-transparent border-transparent","hover:bg-hover",t]}}(o):"flat"===t||"raised"===t?a=function({color:e,border:t}){const r="disabled:text-disabled disabled:bg-disabled disabled:border-transparent disabled:shadow-none";switch(e){case"primary":return[`text-on-primary bg-primary ${t} border-primary`,"hover:bg-primary-dark hover:border-primary-dark",r];case"danger":return[`text-white bg-danger ${t} border-danger`,"hover:bg-danger/90 hover:border-danger/90",r];case"chip":return[`text-main bg-chip ${t} border-chip`,"hover:bg-chip/90 hover:border-chip/90",r];case"paper":return[`text-main bg-paper ${t} border-paper`,"hover:bg-paper/90 hover:border-paper/90",r];case"white":return[`text-black bg-white ${t} border-white`,"hover:bg-white",r];default:return[`bg ${t} border-background`,"hover:bg-hover",r]}}(o):"link"===t&&(a=function({color:e}){switch(e){case"primary":return["text-primary","hover:underline","disabled:text-disabled"];case"danger":return["text-danger","hover:underline","disabled:text-disabled"];default:return["text-main","hover:underline","disabled:text-disabled"]}}(o)),[...a,r||"raised"===t&&"shadow-md",n,i,t&&"align-middle flex-shrink-0 items-center transition-button duration-200","select-none appearance-none no-underline outline-none disabled:pointer-events-none disabled:cursor-default"]}function fx(e){return e&&(t=>{t.currentTarget.contains(t.target)&&e(t)})}const px=(0,o.forwardRef)((e,t)=>{const{children:r,color:n=null,variant:o,radius:a,shadow:s,whitespace:l,justify:c="justify-center",className:u,href:d,form:h,border:f,elementType:p,to:g,relative:m,replace:v,end:y,display:b,type:w="button",onClick:x,onPointerDown:C,onPointerUp:_,onKeyDown:S,...A}=e,k=p||(d?"a":"button"),E="a"===k;return(0,i.jsx)(k,{ref:t,form:E?void 0:h,href:d,to:g,relative:m,type:E?void 0:w,replace:v,end:y,onPointerDown:fx(C),onPointerUp:fx(_),onClick:fx(x),onKeyDown:fx(S),className:od("focus-visible:ring",hx({variant:o,color:n,border:f,whitespace:l,display:b}),a,c,u),...A,children:r})}),gx=o.forwardRef(({children:e,startIcon:t,endIcon:r,size:n="sm",sizeClassName:o,className:a,equalWidth:s=!1,radius:l="rounded-button",variant:c="text",disabled:u,elementType:d,to:h,replace:f,href:p,download:g,...m},v)=>{const y=od("font-semibold",o||dx(n,{equalWidth:s,variant:c}),a);return(0,i.jsxs)(px,{className:y,ref:v,radius:l,variant:c,disabled:u,to:u?void 0:h,href:u?void 0:p,download:u?void 0:g,elementType:u?void 0:d,replace:u?void 0:f,...m,children:[t&&(0,i.jsx)(mx,{position:"start",icon:t,size:n}),e,r&&(0,i.jsx)(mx,{position:"end",icon:r,size:n})]})});function mx({icon:e,position:t,size:r}){const n=od("m-auto",{"-ml-4 mr-8":"start"===t,"-mr-4 ml-8":"end"===t},e.props.className);return o.cloneElement(e,{className:n,size:r})}const vx=(0,o.createContext)(null);function yx(){return(0,o.useContext)(vx)}const bx=ld((0,i.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"}),"CheckOutlined"),wx=o.forwardRef((e,t)=>{let{startIcon:r,capitalizeFirst:n,children:o,description:a,endIcon:s,endSection:l,isDisabled:c,isActive:u,isSelected:d,showCheckmark:h,elementType:f="div",radius:p,padding:g,...m}=e;!r&&h&&(r=(0,i.jsx)(bx,{size:"sm",className:od("text-primary",!d&&"invisible")}));const v=od("icon-sm rounded overflow-hidden flex-shrink-0",!c&&"text-muted"),y=od(!c&&"text-muted");return(0,i.jsxs)(f,{...m,"aria-disabled":c,className:xx(e),ref:t,children:[r&&(0,i.jsx)("div",{className:v,children:r}),(0,i.jsxs)("div",{className:od("min-w-auto mr-auto w-full overflow-hidden overflow-ellipsis",n&&"first-letter:capitalize"),children:[o,a&&(0,i.jsx)("div",{className:od("mt-4 whitespace-normal text-xs",c?"text-disabled":"text-muted"),children:a})]}),(s||l)&&(0,i.jsx)("div",{className:s?v:y,children:s||l})]})});function xx({className:e,isSelected:t,isActive:r,isDisabled:n,showCheckmark:i,endIcon:o,endSection:a,radius:s,padding:l}){let c,u="";return u=n?"text-disabled pointer-events-none":t?r?"bg-primary/focus":"bg-primary/selected hover:bg-primary/focus":r?"hover:bg-fg-base/15 bg-focus":"hover:bg-hover",c=l||(i?o||a?"pl-8 pr-8 py-8":"pl-8 pr-24 py-8":"px-20 py-8"),od("w-full select-none outline-none cursor-pointer","text-sm truncate flex items-center gap-10",!n&&"text-main",c,u,e,s)}function Cx({children:e,value:t,startIcon:r,endIcon:n,endSection:o,description:a,capitalizeFirst:s,textLabel:l,isDisabled:c,onSelected:u,onClick:d,...h}){var f;const{collection:p,showCheckmark:g,virtualFocus:m,listboxId:v,role:y,listItemsRef:b,handleItemSelection:w,state:{selectedValues:x,activeIndex:C,setActiveIndex:_}}=yx(),S=x.includes(t),A=null==(f=p.get(t))?void 0:f.index,k=C===A;return null==A?null:(0,i.jsx)(wx,{...h,onFocus:()=>{m||_(A)},onPointerEnter:e=>{_(A),m||e.currentTarget.focus()},onPointerDown:e=>{m&&e.preventDefault()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),w(t),null==u||u())},onClick:e=>{w(t),null==u||u(),null==d||d(e)},ref:e=>b.current[A]=e,id:`${v}-${A}`,role:"menu"===y?"menuitem":"option",tabIndex:m?void 0:k&&!c?-1:0,"aria-selected":k&&S,showCheckmark:g,isDisabled:c,isActive:k,isSelected:S,startIcon:r,description:a,endIcon:n,endSection:o,capitalizeFirst:s,"data-value":t,children:e})}var _x={exports:{}};!function(e){(function(){var t=Object.assign;function r(e,r){r||(r={});var n,i,o,a=r.vargs||function(e){var t=e+"",r=t.indexOf("...");return r>=0&&(r<t.indexOf(")")||t.indexOf("arguments")>=0)}(e),s=Object.create(null),l=[],c=[],u=new WeakMap,d=r.maxAge>0&&r.maxAge<1/0?function(e,t,n){return setTimeout(function(){if(n)return t.splice(e,1),void n.splice(e,1);t instanceof WeakMap?t.delete(e):delete t[e]},r.maxAge)}:0,h=r.equals?r.equals:function(e,t){return e===t},f=r.maxArgs,p=r.serializer;return 1!==e.length||r.equals||a?i=function(){var t=arguments.length;if(!t&&null!=n)return c[n];var r,i=f||t;for(r=l.length-1;r>=0;r--)if(f||l[r].length===i)for(var o=i-1;o>=0&&h(l[r][o],arguments[o]);o--)if(0===o)return c[r];return r=l.length-(r+1),!t&&null==n&&(n=r),!d||d(r,c,l),c[r]=e.apply(this,l[r]=arguments)}.bind(this):(i=function(t){var r,n=typeof t;if(!p&&("object"===n&&t||"function"===n))return u.get(t)||(!d||d(t,u),u.set(t,r=e.call(this,t)),r);var i="number"===n||"boolean"===n||null==t?t:"string"===n?JSON.stringify(t):p(t);return s[i]||(!d||d(i,s),s[i]=e.call(this,t))}.bind(this),o=1),i.clear=function(){u=new WeakMap,s=Object.create(null),l=[],c=[],n=void 0},i.keys=function(){return o?null:l.slice()},i.values=function(){return o?null:c.slice()},i.keyValues=function(){return o?{primitives:t({},s),objects:u}:null},i}"function"!=typeof t&&(t=function(){var e=arguments,t=arguments[0];if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var r=1;r<e.length;r++)if(e[r]&&"object"==typeof e[r])for(var n in e[r])t[n]=e[r][n];return t}),e.exports=r,typeof window<"u"&&(window.nanomemoize=r)}).call(qu)}(_x);const Sx=Yu(_x.exports);function Ax({children:e,label:t,index:r}){const n=(0,o.useId)();return(0,i.jsxs)("div",{role:"group",className:od(0!==r&&"border-t my-4"),"aria-labelledby":t?`be-select-${n}`:void 0,children:[t&&(0,i.jsx)("div",{className:"block uppercase text-muted text-xs px-16 py-10",role:"presentation",id:`be-select-${n}`,"aria-hidden":"true",children:t}),e]})}const kx=Sx(({maxItems:e,children:t,items:r,inputValue:n})=>{let i=Ix({children:t,items:r}),o=Ex({collection:i,inputValue:n});return e&&(i=new Map([...i.entries()].slice(0,e)),o=new Map([...o.entries()].slice(0,e))),{collection:i,filteredCollection:o}}),Ex=Sx(({collection:e,inputValue:t})=>{let r=new Map;const n=t?`${t}`.toLowerCase().trim():"";if(n){let t=0;e.forEach((e,i)=>{(e.item?JSON.stringify(e.item):e.textLabel).toLowerCase().trim().includes(n)&&r.set(i,{...e,index:t++})})}else r=e;return r}),Ix=Sx(({children:e,items:t})=>{let r;r=t&&"function"==typeof e?t.map(t=>e(t)):e;const n=new Map;let i=0;const a=(e,r,o,a)=>{const s=i++,l=r?null==t?void 0:t[o].items[a]:null==t?void 0:t[s];n.set(e.props.value,{index:s,element:e,textLabel:jx(e),item:l,section:r,isDisabled:e.props.isDisabled,value:e.props.value})};return o.Children.forEach(r,(e,t)=>{(0,o.isValidElement)(e)&&(e.type===Ax?o.Children.forEach(e.props.children,(r,n)=>{a(r,e,t,n)}):a(e))}),n});function jx(e){var t;const r=e.props.children;return e.props.textLabel?e.props.textLabel:null!=(t=null==r?void 0:r.props)&&t.message?r.props.message:`${r}`||""}const Tx=Math.min,Fx=Math.max,Ox=Math.round,Px=Math.floor,Mx=e=>({x:e,y:e}),Rx={left:"right",right:"left",bottom:"top",top:"bottom"},Lx={start:"end",end:"start"};function Nx(e,t,r){return Fx(e,Tx(t,r))}function Dx(e,t){return"function"==typeof e?e(t):e}function zx(e){return e.split("-")[0]}function Bx(e){return e.split("-")[1]}function Ux(e){return"x"===e?"y":"x"}function Vx(e){return"y"===e?"height":"width"}function Hx(e){return["top","bottom"].includes(zx(e))?"y":"x"}function $x(e){return Ux(Hx(e))}function Wx(e){return e.replace(/start|end/g,e=>Lx[e])}function Gx(e){return e.replace(/left|right|bottom|top/g,e=>Rx[e])}function qx(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Yx(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function Xx(e,t,r){let{reference:n,floating:i}=e;const o=Hx(t),a=$x(t),s=Vx(a),l=zx(t),c="y"===o,u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,h=n[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:n.y-i.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-i.width,y:d};break;default:f={x:n.x,y:n.y}}switch(Bx(t)){case"start":f[a]-=h*(r&&c?-1:1);break;case"end":f[a]+=h*(r&&c?-1:1)}return f}async function Kx(e,t){var r;void 0===t&&(t={});const{x:n,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=Dx(t,e),p=qx(f),g=s[h?"floating"===d?"reference":"floating":d],m=Yx(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(g)))||r?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},w=Yx(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+p.top)/b.y,bottom:(w.bottom-m.bottom+p.bottom)/b.y,left:(m.left-w.left+p.left)/b.x,right:(w.right-m.right+p.right)/b.x}}function Zx(e){return eC(e)?(e.nodeName||"").toLowerCase():"#document"}function Jx(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Qx(e){var t;return null==(t=(eC(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function eC(e){return e instanceof Node||e instanceof Jx(e).Node}function tC(e){return e instanceof Element||e instanceof Jx(e).Element}function rC(e){return e instanceof HTMLElement||e instanceof Jx(e).HTMLElement}function nC(e){return!(typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof Jx(e).ShadowRoot)}function iC(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=cC(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function oC(e){return["table","td","th"].includes(Zx(e))}function aC(e){const t=sC(),r=cC(e);return"none"!==r.transform||"none"!==r.perspective||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","perspective","filter"].some(e=>(r.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(r.contain||"").includes(e))}function sC(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function lC(e){return["html","body","#document"].includes(Zx(e))}function cC(e){return Jx(e).getComputedStyle(e)}function uC(e){return tC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dC(e){if("html"===Zx(e))return e;const t=e.assignedSlot||e.parentNode||nC(e)&&e.host||Qx(e);return nC(t)?t.host:t}function hC(e){const t=dC(e);return lC(t)?e.ownerDocument?e.ownerDocument.body:e.body:rC(t)&&iC(t)?t:hC(t)}function fC(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const i=hC(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),a=Jx(i);return o?t.concat(a,a.visualViewport||[],iC(i)?i:[],a.frameElement&&r?fC(a.frameElement):[]):t.concat(i,fC(i,[],r))}function pC(e){const t=cC(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=rC(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=Ox(r)!==o||Ox(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function gC(e){return tC(e)?e:e.contextElement}function mC(e){const t=gC(e);if(!rC(t))return Mx(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=pC(t);let a=(o?Ox(r.width):r.width)/n,s=(o?Ox(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const vC=Mx(0);function yC(e){const t=Jx(e);return sC()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:vC}function bC(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const i=e.getBoundingClientRect(),o=gC(e);let a=Mx(1);t&&(n?tC(n)&&(a=mC(n)):a=mC(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==Jx(e))&&t}(o,r,n)?yC(o):Mx(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const e=Jx(o),t=n&&tC(n)?Jx(n):n;let r=e,i=r.frameElement;for(;i&&n&&t!==r;){const e=mC(i),t=i.getBoundingClientRect(),n=cC(i),o=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=a,r=Jx(i),i=r.frameElement}}return Yx({width:u,height:d,x:l,y:c})}const wC=[":popover-open",":modal"];function xC(e){return wC.some(t=>{try{return e.matches(t)}catch{return!1}})}function CC(e){return bC(Qx(e)).left+uC(e).scrollLeft}function _C(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=Jx(e),n=Qx(e),i=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const e=sC();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=Qx(e),r=uC(e),n=e.ownerDocument.body,i=Fx(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Fx(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+CC(e);const s=-r.scrollTop;return"rtl"===cC(n).direction&&(a+=Fx(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:s}}(Qx(e));else if(tC(t))n=function(e,t){const r=bC(e,!0,"fixed"===t),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=rC(e)?mC(e):Mx(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:n*o.y}}(t,r);else{const r=yC(e);n={...t,x:t.x-r.x,y:t.y-r.y}}return Yx(n)}function SC(e,t){const r=dC(e);return!(r===t||!tC(r)||lC(r))&&("fixed"===cC(r).position||SC(r,t))}function AC(e,t){const r=t.get(e);if(r)return r;let n=fC(e,[],!1).filter(e=>tC(e)&&"body"!==Zx(e)),i=null;const o="fixed"===cC(e).position;let a=o?dC(e):e;for(;tC(a)&&!lC(a);){const t=cC(a),r=aC(a);!r&&"fixed"===t.position&&(i=null),(o?!r&&!i:!r&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||iC(a)&&!r&&SC(e,a))?n=n.filter(e=>e!==a):i=t,a=dC(a)}return t.set(e,n),n}function kC(e,t,r){const n=rC(t),i=Qx(t),o="fixed"===r,a=bC(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Mx(0);if(n||!n&&!o)if(("body"!==Zx(t)||iC(i))&&(s=uC(t)),n){const e=bC(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=CC(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function EC(e){return"static"===cC(e).position}function IC(e,t){return rC(e)&&"fixed"!==cC(e).position?t?t(e):e.offsetParent:null}function jC(e,t){const r=Jx(e);if(xC(e))return r;if(!rC(e)){let t=dC(e);for(;t&&!lC(t);){if(tC(t)&&!EC(t))return t;t=dC(t)}return r}let n=IC(e,t);for(;n&&oC(n)&&EC(n);)n=IC(n,t);return n&&lC(n)&&EC(n)&&!aC(n)?r:n||function(e){let t=dC(e);for(;rC(t)&&!lC(t);){if(aC(t))return t;t=dC(t)}return null}(e)||r}const TC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o="fixed"===i,a=Qx(n),s=!!t&&xC(t.floating);if(n===a||s&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Mx(1);const u=Mx(0),d=rC(n);if((d||!d&&!o)&&(("body"!==Zx(n)||iC(a))&&(l=uC(n)),rC(n))){const e=bC(n);c=mC(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x,y:r.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:Qx,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[..."clippingAncestors"===r?xC(t)?[]:AC(t,this._c):[].concat(r),n],a=o[0],s=o.reduce((e,r)=>{const n=_C(t,r,i);return e.top=Fx(n.top,e.top),e.right=Tx(n.right,e.right),e.bottom=Tx(n.bottom,e.bottom),e.left=Fx(n.left,e.left),e},_C(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:jC,getElementRects:async function(e){const t=this.getOffsetParent||jC,r=this.getDimensions,n=await r(e.floating);return{reference:kC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=pC(e);return{width:t,height:r}},getScale:mC,isElement:tC,isRTL:function(e){return"rtl"===cC(e).direction}};function FC(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=gC(e),u=i||o?[...c?fC(c):[],...fC(t)]:[];u.forEach(e=>{i&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});const d=c&&s?function(e,t){let r,n=null;const i=Qx(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const f={rootMargin:-Px(u)+"px "+-Px(i.clientWidth-(c+d))+"px "+-Px(i.clientHeight-(u+h))+"px "+-Px(c)+"px",threshold:Fx(0,Tx(1,l))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return a();t?a(!1,t):r=setTimeout(()=>{a(!1,1e-7)},1e3)}p=!1}try{n=new IntersectionObserver(g,{...f,root:i.ownerDocument})}catch{n=new IntersectionObserver(g,f)}n.observe(e)}(!0),o}(c,r):null;let h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),r()}),c&&!l&&f.observe(c),f.observe(t));let p,g=l?bC(e):null;return l&&function t(){const n=bC(e);g&&(n.x!==g.x||n.y!==g.y||n.width!==g.width||n.height!==g.height)&&r(),g=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const OC=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:i}=e,o=await(null==n.isRTL?void 0:n.isRTL(i.floating)),a=zx(r),s=Bx(r),l="y"===Hx(r),c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d=Dx(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return a===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},PC=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Dx(e,t),c={x:r,y:n},u=await Kx(t,l),d=Hx(zx(i)),h=Ux(d);let f=c[h],p=c[d];if(o){const e="y"===h?"bottom":"right";f=Nx(f+u["y"===h?"top":"left"],f,f-u[e])}if(a){const e="y"===d?"bottom":"right";p=Nx(p+u["y"===d?"top":"left"],p,p-u[e])}const g=s.fn({...t,[h]:f,[d]:p});return{...g,data:{x:g.x-r,y:g.y-n}}}}},MC=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=Dx(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const v=zx(i),y=zx(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(y||!g?[Gx(s)]:function(e){const t=Gx(e);return[Wx(e),t,Wx(t)]}(s));!h&&"none"!==p&&w.push(...function(e,t,r,n){const i=Bx(e);let o=function(e,t,r){const n=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?o:a;default:return[]}}(zx(e),"start"===r,n);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(Wx)))),o}(s,g,p,b));const x=[s,...w],C=await Kx(t,m),_=[];let S=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&_.push(C[v]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=Bx(e),i=$x(e),o=Vx(i);let a="x"===i?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Gx(a)),[a,Gx(a)]}(i,a,b);_.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:i,overflows:_}],!_.every(e=>e<=0)){var A,k;const e=((null==(A=o.flip)?void 0:A.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let r=null==(k=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!r)switch(f){case"bestFit":{var E;const e=null==(E=S.map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:E[0];e&&(r=e);break}case"initialPlacement":r=s}if(i!==r)return{reset:{placement:r}}}return{}}}},RC=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...s}=Dx(e,t),l=await Kx(t,s),c=zx(r),u=Bx(r),d="y"===Hx(r),{width:h,height:f}=n.floating;let p,g;"top"===c||"bottom"===c?(p=c,g=u===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,p="end"===u?"top":"bottom");const m=f-l.top-l.bottom,v=h-l.left-l.right,y=Tx(f-l[p],m),b=Tx(h-l[g],v),w=!t.middlewareData.shift;let x=y,C=b;if(d?C=u||w?Tx(b,v):v:x=u||w?Tx(y,m):m,w&&!u){const e=Fx(l.left,0),t=Fx(l.right,0),r=Fx(l.top,0),n=Fx(l.bottom,0);d?C=h-2*(0!==e||0!==t?e+t:Fx(l.left,l.right)):x=f-2*(0!==r||0!==n?r+n:Fx(l.top,l.bottom))}await a({...t,availableWidth:C,availableHeight:x});const _=await i.getDimensions(o.floating);return h!==_.width||f!==_.height?{reset:{rects:!0}}:{}}}},LC=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Dx(e,t)||{};if(null==c)return{};const d=qx(u),h={x:r,y:n},f=$x(i),p=Vx(f),g=await a.getDimensions(c),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[f]-h[f]-o.floating[p],x=h[f]-o.reference[f],C=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let _=C?C[b]:0;(!_||!await(null==a.isElement?void 0:a.isElement(C)))&&(_=s.floating[b]||o.floating[p]);const S=w/2-x/2,A=_/2-g[p]/2-1,k=Tx(d[v],A),E=Tx(d[y],A),I=k,j=_-g[p]-E,T=_/2-g[p]/2+S,F=Nx(I,T,j),O=!l.arrow&&null!=Bx(i)&&T!==F&&o.reference[p]/2-(T<I?k:E)-g[p]/2<0,P=O?T<I?T-I:T-j:0;return{[f]:h[f]+P,data:{[f]:F,centerOffset:T-F-P,...O&&{alignmentOffset:P}},reset:O}}});var NC=typeof document<"u"?o.useLayoutEffect:o.useEffect;function DC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;0!==n--;)if(!DC(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;0!==n--;){const r=i[n];if(!("_owner"===r&&e.$$typeof||DC(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function zC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function BC(e,t){const r=zC(e);return Math.round(t*r)/r}function UC(e){const t=o.useRef(e);return NC(()=>{t.current=e}),t}function VC({floatingWidth:e,ref:t,disablePositioning:r=!1,placement:n="bottom",offset:i=2,showArrow:a=!1,maxHeight:s,shiftCrossAxis:l=!0,fallbackPlacements:c}){const u=(0,o.useRef)(null),d={placement:n,strategy:"fixed"};r||(d.whileElementsMounted=FC,d.middleware=[OC(i),PC({padding:16,crossAxis:l,mainAxis:!0}),MC({padding:16,fallbackPlacements:c}),RC({apply({rects:t,availableHeight:r,availableWidth:n,elements:i}){"matchTrigger"===e&&null!=s?Object.assign(i.floating.style,{width:`${t.reference.width}px`,maxWidth:`${n}`,maxHeight:`${Math.min(r,s)}px`}):null!=s&&Object.assign(i.floating.style,{maxHeight:`${Math.min(r,s)}px`})},padding:16})],a&&d.middleware.push((e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?LC({element:r.current,padding:n}).fn(t):{}:r?LC({element:r,padding:n}).fn(t):{}}}))({element:u})));const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=o.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=o.useState(n);DC(f,n)||p(n);const[g,m]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback(e=>{e!=_.current&&(_.current=e,m(e))},[m]),w=o.useCallback(e=>{e!==S.current&&(S.current=e,y(e))},[y]),x=a||g,C=s||v,_=o.useRef(null),S=o.useRef(null),A=o.useRef(d),k=UC(c),E=UC(i),I=o.useCallback(()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:r,middleware:f};E.current&&(e.platform=E.current),((e,t,r)=>{const n=new Map,i={platform:TC,...r},o={...i.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Xx(c,n,l),h=n,f={},p=0;for(let g=0;g<s.length;g++){const{name:r,fn:o}=s[g],{x:m,y:v,data:y,reset:b}=await o({x:u,y:d,initialPlacement:n,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=m??u,d=v??d,f={...f,[r]:{...f[r],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:u,y:d}=Xx(c,h,l))),g=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}})(e,t,{...i,platform:o})})(_.current,S.current,e).then(e=>{const t={...e,isPositioned:!0};j.current&&!DC(A.current,t)&&(A.current=t,de.flushSync(()=>{h(t)}))})},[f,t,r,E]);NC(()=>{!1===u&&A.current.isPositioned&&(A.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const j=o.useRef(!1);NC(()=>(j.current=!0,()=>{j.current=!1}),[]),NC(()=>{if(x&&(_.current=x),C&&(S.current=C),x&&C){if(k.current)return k.current(x,C,I);I()}},[x,C,I,k]);const T=o.useMemo(()=>({reference:_,floating:S,setReference:b,setFloating:w}),[b,w]),F=o.useMemo(()=>({reference:x,floating:C}),[x,C]),O=o.useMemo(()=>{const e={position:r,left:0,top:0};if(!F.floating)return e;const t=BC(F.floating,d.x),n=BC(F.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...zC(F.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,F.floating,d.x,d.y]);return o.useMemo(()=>({...d,update:I,refs:T,elements:F,floatingStyles:O}),[d,I,T,F,O])}(d),f=(0,o.useMemo)(()=>function(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}([t,h.refs.setReference]),[h.refs.setReference,t]),{x:p,y:g}=h.middlewareData.arrow||{},m={top:"bottom",right:"left",bottom:"top",left:"right"}[h.placement.split("-")[0]],v={left:p,top:g,right:"",bottom:"",[m]:"-4px"};return{...h,reference:f,arrowRef:u,arrowStyle:v}}function HC(e,t){const{children:r,items:n,role:i="listbox",virtualFocus:a,focusLoopingMode:s="stay",autoFocusFirstItem:l=!0,onItemSelected:c,clearInputOnItemSelection:u,blurReferenceOnItemSelection:d,floatingWidth:h="matchTrigger",floatingMinWidth:f,floatingMaxHeight:p,offset:g,placement:m,showCheckmark:v,showEmptyMessage:y,maxItems:b,isAsync:w,allowCustomValue:x,clearSelectionOnInputClear:C}=e,_=e.selectionMode||"none",S=`${(0,o.useId)()}-listbox`,[A,k]=Db(e.inputValue,e.defaultInputValue||"",e.onInputValueChange),[E,I]=(0,o.useState)("all"),j=kx({children:r,items:n,inputValue:w?void 0:A,maxItems:b}),T="all"===E?j.collection:j.filteredCollection,F=(0,o.useRef)([]),O=(0,o.useMemo)(()=>[...T.values()].map(e=>e.isDisabled?null:e.textLabel),[T]),{selectedValues:P,selectValues:M}=function(e){const{selectionMode:t,allowEmptySelection:r}=e,n="single"===t||"multiple"===t,[i,a]=Db(n?e.selectedValue:void 0,n?e.defaultSelectedValue:void 0,n?e.onSelectionChange:void 0),s=(0,o.useMemo)(()=>typeof i>"u"?[]:Array.isArray(i)?i:[i],[i]),l=(0,o.useCallback)(e=>{const n=Array.isArray(e)?e:[e];"single"===t?a(n[0]):n.forEach(e=>{const t=s.indexOf(e);-1===t?(s.push(e),a([...s])):(s.length>1||r)&&(s.splice(t,1),a([...s]))})},[r,s,t,a]);return{selectedValues:s,selectValues:l}}(e),[R,L]=Db(e.isOpen,e.defaultIsOpen,e.onOpenChange),[N,D]=(0,o.useState)(null),z=VC({floatingWidth:h,ref:t,placement:m,offset:g,maxHeight:p??420,shiftCrossAxis:!a}),{refs:B,strategy:U,x:V,y:H}=z,$="none"===_?void 0:T.get(P[0]),W="none"===_||null==$?void 0:$.index,G=(0,o.useCallback)((e,t)=>{var r,n;const i=[...T.values()],o=!i.find(e=>!e.isDisabled),l=T.size-1;null==t||!T.size||t>l||t<0||o?D(null):(t=function(e,t,r,n){var i;const o=e.length-1;for(;null!=(i=e[t])&&i.isDisabled;)if("increment"===n){if(++t>=o){if("loop"!==r)return"stay"===r?t-1:null;t=0}}else if(--t<0){if("loop"!==r)return"stay"===r?t+1:null;t=o}return t}(i,t,s,e),D(t),null!=t&&(a?null==(r=F.current[t])||r.scrollIntoView({block:"nearest"}):null==(n=F.current[t])||n.focus()))},[T,a,s]);return{handleItemSelection:e=>{const t=B.reference.current;"none"!==_?M(e):t&&"focus"in t&&t.focus(),a&&(k(u?"":`${e}`),d&&t&&"blur"in t&&t.blur()),I("all"),L(!1),null==c||c(e),D(null)},onInputChange:(0,o.useCallback)(e=>{k(e.target.value),I(e.target.value.trim()?"filtered":"all"),e.target.value?L(!0):C&&M(""),l&&null==N?G("increment",0):D(null)},[k,L,I,M,C,G,l,N]),focusLoopingMode:s,floatingWidth:h,floatingMinWidth:f,floatingMaxHeight:p,showCheckmark:v,collection:T,collections:j,virtualFocus:a,focusItem:G,showEmptyMessage:y&&!!A,allowCustomValue:x,refs:B,reference:z.reference,floating:B.setFloating,positionStyle:{position:U,top:H??"",left:V??""},listContent:O,listItemsRef:F,listboxId:S,role:i,state:{activeIndex:N,setActiveIndex:D,selectedIndex:W,setSelectedIndex:e=>{if("none"!==_){const t=[...T.values()][e];t&&M(t.value)}},selectionMode:_,selectedValues:P,selectValues:M,inputValue:A,setInputValue:k,isOpen:R,setIsOpen:L,setActiveCollection:I}}}let $C=null,WC=new Set,GC=new Map,qC=!1,YC=!1;function XC(e,t){for(let r of WC)r(e,t)}function KC(e){qC=!0,function(e){return!(e.metaKey||!Tb()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&($C="keyboard",XC("keyboard",e))}function ZC(e){$C="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(qC=!0,XC("pointer",e))}function JC(e){(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(function(e){var t;return!(typeof window>"u"||null==window.navigator)&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some(t=>e.test(t.brand)))||e.test(window.navigator.userAgent))}(/Android/i)&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)})(e)&&(qC=!0,$C="virtual")}function QC(e){e.target===window||e.target===document||(!qC&&!YC&&($C="virtual",XC("virtual",e)),qC=!1,YC=!1)}function e_(){qC=!1,YC=!0}function t_(e){if(typeof window>"u"||GC.get(kb(e)))return;const t=kb(e),r=Ab(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){qC=!0,n.apply(this,arguments)},r.addEventListener("keydown",KC,!0),r.addEventListener("keyup",KC,!0),r.addEventListener("click",JC,!0),t.addEventListener("focus",QC,!0),t.addEventListener("blur",e_,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",ZC,!0),r.addEventListener("pointermove",ZC,!0),r.addEventListener("pointerup",ZC,!0)):(r.addEventListener("mousedown",ZC,!0),r.addEventListener("mousemove",ZC,!0),r.addEventListener("mouseup",ZC,!0)),t.addEventListener("beforeunload",()=>{r_(e)},{once:!0}),GC.set(t,{focus:n})}const r_=(e,t)=>{const r=kb(e),n=Ab(e);t&&n.removeEventListener("DOMContentLoaded",t),GC.has(r)&&(r.HTMLElement.prototype.focus=GC.get(r).focus,n.removeEventListener("keydown",KC,!0),n.removeEventListener("keyup",KC,!0),n.removeEventListener("click",JC,!0),r.removeEventListener("focus",QC,!0),r.removeEventListener("blur",e_,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",ZC,!0),n.removeEventListener("pointermove",ZC,!0),n.removeEventListener("pointerup",ZC,!0)):(n.removeEventListener("mousedown",ZC,!0),n.removeEventListener("mousemove",ZC,!0),n.removeEventListener("mouseup",ZC,!0)),GC.delete(r))};function n_(e,t){return"#comment"!==e.nodeName&&function(e){const t=kb(e);if(!(e instanceof t.HTMLElement||e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,i="none"!==r&&"hidden"!==n&&"collapse"!==n;if(i){const{getComputedStyle:t}=e.ownerDocument.defaultView;let{display:r,visibility:n}=t(e);i="none"!==r&&"hidden"!==n&&"collapse"!==n}return i}(e)&&function(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||n_(e.parentElement,e))}typeof document<"u"&&function(e){const t=Ab(e);let r;"loading"!==t.readyState?t_(e):(r=()=>{t_(e)},t.addEventListener("DOMContentLoaded",r))}();const i_=o.createContext(null);let o_=null;function a_(e){let{children:t,contain:r,restoreFocus:n,autoFocus:i}=e,a=(0,o.useRef)(null),s=(0,o.useRef)(null),l=(0,o.useRef)([]),{parentNode:c}=(0,o.useContext)(i_)||{},u=(0,o.useMemo)(()=>new w_({scopeRef:l}),[l]);mb(()=>{let e=c||x_.root;if(x_.getTreeNode(e.scopeRef)&&o_&&!g_(o_,e.scopeRef)){let t=x_.getTreeNode(o_);t&&(e=t)}e.addChild(u),x_.addNode(u)},[u,c]),mb(()=>{let e=x_.getTreeNode(l);e&&(e.contain=!!r)},[r]),mb(()=>{var e;let t=null===(e=a.current)||void 0===e?void 0:e.nextSibling,r=[];for(;t&&t!==s.current;)r.push(t),t=t.nextSibling;l.current=r},[t]),function(e,t,r){mb(()=>{if(t||r)return;let n=e.current;const i=Ab(n?n[0]:void 0);let o=t=>{let r=t.target;f_(r,e.current)?o_=e:h_(r)||(o_=null)};return i.addEventListener("focusin",o,!1),null==n||n.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),null==n||n.forEach(e=>e.removeEventListener("focusin",o,!1))}},[e,t,r])}(l,n,r),function(e,t){let r=(0,o.useRef)(),n=(0,o.useRef)();mb(()=>{let i=e.current;if(!t)return void(n.current&&(cancelAnimationFrame(n.current),n.current=void 0));const o=Ab(i?i[0]:void 0);let a=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!d_(e)||t.isComposing)return;let r=o.activeElement,n=e.current;if(!n||!f_(r,n))return;let i=y_(u_(n),{tabbable:!0},n);if(!r)return;i.currentNode=r;let a=t.shiftKey?i.previousNode():i.nextNode();a||(i.currentNode=t.shiftKey?n[n.length-1].nextElementSibling:n[0].previousElementSibling,a=t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),a&&m_(a,!0)},s=t=>{o_&&!g_(o_,e)||!f_(t.target,e.current)?d_(e)&&!p_(t.target,e)?r.current?r.current.focus():o_&&o_.current&&v_(o_.current):d_(e)&&(r.current=t.target):(o_=e,r.current=t.target)},l=t=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{if(o.activeElement&&d_(e)&&!p_(o.activeElement,e))if(o_=e,o.body.contains(t.target)){var n;r.current=t.target,null===(n=r.current)||void 0===n||n.focus()}else o_.current&&v_(o_.current)})};return o.addEventListener("keydown",a,!1),o.addEventListener("focusin",s,!1),null==i||i.forEach(e=>e.addEventListener("focusin",s,!1)),null==i||i.forEach(e=>e.addEventListener("focusout",l,!1)),()=>{o.removeEventListener("keydown",a,!1),o.removeEventListener("focusin",s,!1),null==i||i.forEach(e=>e.removeEventListener("focusin",s,!1)),null==i||i.forEach(e=>e.removeEventListener("focusout",l,!1))}},[e,t]),mb(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}(l,r),function(e,t,r){const n=(0,o.useRef)(typeof document<"u"?Ab(e.current?e.current[0]:void 0).activeElement:null);mb(()=>{let n=e.current;const i=Ab(n?n[0]:void 0);if(!t||r)return;let o=()=>{(!o_||g_(o_,e))&&f_(i.activeElement,e.current)&&(o_=e)};return i.addEventListener("focusin",o,!1),null==n||n.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),null==n||n.forEach(e=>e.removeEventListener("focusin",o,!1))}},[e,r]),mb(()=>{const n=Ab(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!d_(e)||t.isComposing)return;let r=n.activeElement;if(!f_(r,e.current))return;let i=x_.getTreeNode(e);if(!i)return;let o=i.nodeToRestore,a=y_(n.body,{tabbable:!0});a.currentNode=r;let s=t.shiftKey?a.previousNode():a.nextNode();if((!o||!n.body.contains(o)||o===n.body)&&(o=void 0,i.nodeToRestore=void 0),(!s||!f_(s,e.current))&&o){a.currentNode=o;do{s=t.shiftKey?a.previousNode():a.nextNode()}while(f_(s,e.current));t.preventDefault(),t.stopPropagation(),s?m_(s,!0):h_(o)?m_(o,!0):r.blur()}};return r||n.addEventListener("keydown",i,!0),()=>{r||n.removeEventListener("keydown",i,!0)}},[e,t,r]),mb(()=>{const r=Ab(e.current?e.current[0]:void 0);if(!t)return;let i=x_.getTreeNode(e);var o;return i?(i.nodeToRestore=null!==(o=n.current)&&void 0!==o?o:void 0,()=>{let n=x_.getTreeNode(e);if(!n)return;let i=n.nodeToRestore;if(t&&i&&(f_(r.activeElement,e.current)||r.activeElement===r.body&&function(e){let t=x_.getTreeNode(o_);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(null==t?void 0:t.scopeRef)===e}(e))){let t=x_.clone();requestAnimationFrame(()=>{if(r.activeElement===r.body){let r=t.getTreeNode(e);for(;r;){if(r.nodeToRestore&&r.nodeToRestore.isConnected)return void m_(r.nodeToRestore);r=r.parent}for(r=t.getTreeNode(e);r;){if(r.scopeRef&&r.scopeRef.current&&x_.getTreeNode(r.scopeRef))return void v_(r.scopeRef.current,!0);r=r.parent}}})}}):void 0},[e,t])}(l,n,r),function(e,t){const r=o.useRef(t);(0,o.useEffect)(()=>{r.current&&(o_=e,!f_(Ab(e.current?e.current[0]:void 0).activeElement,o_.current)&&e.current&&v_(e.current)),r.current=!1},[e])}(l,i),(0,o.useEffect)(()=>{const e=Ab(l.current?l.current[0]:void 0).activeElement;let t=null;if(f_(e,l.current)){for(let r of x_.traverse())r.scopeRef&&f_(e,r.scopeRef.current)&&(t=r);t===x_.getTreeNode(l)&&(o_=t.scopeRef)}},[l]),mb(()=>()=>{var e,t,r;let n=null!==(r=null===(t=x_.getTreeNode(l))||void 0===t||null===(e=t.parent)||void 0===e?void 0:e.scopeRef)&&void 0!==r?r:null;(l===o_||g_(l,o_))&&(!n||x_.getTreeNode(n))&&(o_=n),x_.removeTreeNode(l)},[l]);let d=(0,o.useMemo)(()=>function(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:i,wrap:o,accept:a}=t,s=n||Ab(r[0]).activeElement,l=r[0].previousElementSibling,c=y_(u_(r),{tabbable:i,accept:a},r);c.currentNode=f_(s,r)?s:l;let u=c.nextNode();return!u&&o&&(c.currentNode=l,u=c.nextNode()),u&&m_(u,!0),u},focusPrevious(t={}){let r=e.current,{from:n,tabbable:i,wrap:o,accept:a}=t,s=n||Ab(r[0]).activeElement,l=r[r.length-1].nextElementSibling,c=y_(u_(r),{tabbable:i,accept:a},r);c.currentNode=f_(s,r)?s:l;let u=c.previousNode();return!u&&o&&(c.currentNode=l,u=c.previousNode()),u&&m_(u,!0),u},focusFirst(t={}){let r=e.current,{tabbable:n,accept:i}=t,o=y_(u_(r),{tabbable:n,accept:i},r);o.currentNode=r[0].previousElementSibling;let a=o.nextNode();return a&&m_(a,!0),a},focusLast(t={}){let r=e.current,{tabbable:n,accept:i}=t,o=y_(u_(r),{tabbable:n,accept:i},r);o.currentNode=r[r.length-1].nextElementSibling;let a=o.previousNode();return a&&m_(a,!0),a}}}(l),[]),h=(0,o.useMemo)(()=>({focusManager:d,parentNode:u}),[u,d]);return o.createElement(i_.Provider,{value:h},o.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,o.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:s}))}const s_=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],l_=s_.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";s_.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const c_=s_.join(':not([hidden]):not([tabindex="-1"]),');function u_(e){return e[0].parentElement}function d_(e){let t=x_.getTreeNode(o_);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function h_(e){return p_(e)}function f_(e,t){return!(!e||!t)&&t.some(t=>t.contains(e))}function p_(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of x_.traverse(x_.getTreeNode(t)))if(r&&f_(e,r.current))return!0;return!1}function g_(e,t){var r;let n=null===(r=x_.getTreeNode(t))||void 0===r?void 0:r.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function m_(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{!function(e){const t=Ab(e);if("virtual"===$C){let r=t.activeElement;!function(e){requestAnimationFrame(()=>{0===Fb.size?e():Ob.add(e)})}(()=>{t.activeElement===r&&e.isConnected&&Ib(e)})}else Ib(e)}(e)}catch{}}function v_(e,t=!0){let r=e[0].previousElementSibling,n=u_(e),i=y_(n,{tabbable:t},e);i.currentNode=r;let o=i.nextNode();t&&!o&&(n=u_(e),i=y_(n,{tabbable:!1},e),i.currentNode=r,o=i.nextNode()),m_(o)}function y_(e,t,r){let n=null!=t&&t.tabbable?c_:l_,i=Ab(e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var i;return null!=t&&null!==(i=t.from)&&void 0!==i&&i.contains(e)?NodeFilter.FILTER_REJECT:!e.matches(n)||!n_(e)||r&&!f_(e,r)||null!=t&&t.accept&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});return null!=t&&t.from&&(i.currentNode=t.from),i}class b_{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,r){let n=this.fastMap.get(t??null);if(!n)return;let i=new w_({scopeRef:e});n.addChild(i),i.parent=n,this.fastMap.set(e,i),r&&(i.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let r=t.parent;for(let i of this.traverse())i!==t&&t.nodeToRestore&&i.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&f_(i.nodeToRestore,t.scopeRef.current)&&(i.nodeToRestore=t.nodeToRestore);let n=t.children;r&&(r.removeChild(t),n.size>0&&n.forEach(e=>r&&r.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){var e;let t=new b_;var r;for(let n of this.traverse())t.addTreeNode(n.scopeRef,null!==(r=null===(e=n.parent)||void 0===e?void 0:e.scopeRef)&&void 0!==r?r:null,n.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new w_({scopeRef:null}),this.fastMap.set(null,this.root)}}class w_{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}let x_=new b_;function C_(){const{width:e,height:t}=function(){let e=xb(),[t,r]=(0,o.useState)(()=>e?{width:0,height:0}:Nb());return(0,o.useEffect)(()=>{let e=()=>{r(e=>{let t=Nb();return t.width===e.width&&t.height===e.height?e:t})};return Lb?Lb.addEventListener("resize",e):window.addEventListener("resize",e),()=>{Lb?Lb.removeEventListener("resize",e):window.removeEventListener("resize",e)}},[]),t}();return{"--be-viewport-height":`${t}px`,"--be-viewport-width":`${e}px`}}const __={initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{type:"tween",duration:.125}},S_=(0,o.forwardRef)(({children:e,style:t,autoFocus:r=!1,restoreFocus:n=!0,isDismissable:a,isContextMenu:s,isOpen:l,onClose:c,triggerRef:u,arrowRef:d,arrowStyle:h,onPointerLeave:f,onPointerEnter:p},g)=>{const m=C_(),v=Rb(g),{domProps:y}=function({onClose:e,isDismissable:t=!0,triggerRef:r,isContextMenu:n=!1},i){const a=(0,o.useRef)({isPointerDown:!1,isContextMenu:n,onClose:e}),s=a.current;s.isContextMenu=n,s.onClose=e;const l=(0,o.useCallback)(e=>{const t=e.target;if(t){const e=t.ownerDocument;if(!e||!e.documentElement.contains(t))return!1}return i.current&&!i.current.contains(t)},[i]),c=(0,o.useCallback)(()=>A_[A_.length-1]===i,[i]),u=(0,o.useCallback)(()=>{c()&&s.onClose()},[c,s]),d=(0,o.useCallback)(e=>{var t,n;return!(!r.current||!("contains"in r.current))&&(null==(n=(t=r.current).contains)?void 0:n.call(t,e))},[r]),h=(0,o.useCallback)(e=>{d(e.target)||c()&&(e.stopPropagation(),e.preventDefault())},[d,c]),f=(0,o.useCallback)(e=>{d(e.target)||(c()&&(e.stopPropagation(),e.preventDefault()),(!s.isContextMenu||2!==e.button)&&u())},[d,u,s,c]);return(0,o.useEffect)(()=>{A_.push(i);const e=e=>{l(e)&&(h(e),a.current.isPointerDown=!0)},t=e=>{a.current.isPointerDown&&l(e)&&(a.current.isPointerDown=!1,f(e))},n=e=>{e.preventDefault(),l(e)&&u()},o=e=>{if(!r.current)return;const t=e.target;let n;r.current instanceof Node?n=r.current:"contextElement"in r.current&&(n=r.current.contextElement),(!(t instanceof Node)||!n||t.contains(n))&&s.onClose()};return document.addEventListener("pointerdown",e,!0),document.addEventListener("pointerup",t,!0),document.addEventListener("contextmenu",n,!0),document.addEventListener("scroll",o,!0),()=>{const r=A_.indexOf(i);r>=0&&A_.splice(r,1),document.removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerup",t,!0),document.removeEventListener("contextmenu",n,!0),document.removeEventListener("scroll",o,!0)}},[i,l,s,f,h,r,d,u]),{domProps:{onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),u())}}}}({isDismissable:a,onClose:c,triggerRef:u,isContextMenu:s},v);return(0,i.jsx)(ob.div,{className:"isolate z-popover",role:"presentation",ref:v,style:{...m,...t,position:"fixed"},...__,...Eb(y,{onPointerLeave:f,onPointerEnter:p}),children:(0,i.jsx)(a_,{restoreFocus:n,autoFocus:r,contain:!1,children:e})})}),A_=[],k_={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}};function E_({position:e="absolute",className:t,isTransparent:r=!1,disableInitialTransition:n,...o}){return(0,i.jsx)(ob.div,{...o,className:od(t,!r&&"bg-background/80","inset-0 z-10 h-full w-full",e,"backdrop-blur-sm"),"aria-hidden":!0,initial:n?void 0:{opacity:0},animate:{opacity:1},exit:{opacity:0},...k_,transition:{duration:.15}})}const I_=(0,o.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:r=!0,isDismissable:n,isOpen:o,onClose:a},s)=>{const l=C_(),c=Rb(s);return(0,i.jsxs)("div",{className:"fixed inset-0 isolate z-tray",style:l,children:[(0,i.jsx)(E_,{onClick:()=>{n&&a()}},"tray-underlay"),(0,i.jsx)(ob.div,{ref:c,className:"absolute bottom-0 left-0 right-0 z-20 mx-auto max-h-tray w-full max-w-375 overflow-hidden rounded-t pb-safe-area",role:"presentation",initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},transition:{type:"tween",duration:.2},children:(0,i.jsx)(a_,{restoreFocus:r,autoFocus:t,contain:!0,children:e})})]})});function j_(e,t){if(e===t)return!0;if(!e||!t)return!1;const r=Object.keys(e),n=Object.keys(t),i=r.length;if(n.length!==i)return!1;for(let o=0;o<i;o++){const n=r[o];if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1}return!0}function T_(){const{i18n:e}=fp(e=>e.data);return{locale:e,localeCode:(null==e?void 0:e.language)||"en",lines:null==e?void 0:e.lines}}function F_(e,{message:t,values:r}){const n=t.match(/\[(.+?)]/),i=null==r?void 0:r.count;if(n&&n[1]&&!Number.isNaN(i)){const[r,o]=n,a=o.split("|");if(!a.length)return t;const s=O_(e).select(i);let l=a.find(e=>e.startsWith(s));l||(l=a[0]);const c=l.substring(l.indexOf(" ")+1);return t.replace(r,c)}return t}const O_=Sx(e=>new Intl.PluralRules(e));function P_(e,t){return null!=e&&(void 0!==Object.hasOwn?Object.hasOwn(e,t):Object.hasOwnProperty(t))}const M_=(0,o.memo)(e=>{const{message:t,values:r}=e,{lines:n,localeCode:a}=T_();let s;if(s=P_(n,t)?null==n?void 0:n[t]:P_(n,null==t?void 0:t.toLowerCase())?null==n?void 0:n[null==t?void 0:t.toLowerCase()]:t,!r||!s)return(0,i.jsx)(o.Fragment,{children:s});s=F_(a,{message:s,values:r});const l=[],c=[];if(Object.entries(r).forEach(([e,t])=>{"function"==typeof t?c.push(e):(0,o.isValidElement)(t)?l.push(e):null!=t&&(s=null==s?void 0:s.replace(`:${e}`,`${t}`))}),c.length||l.length){const e=[];if(c.length){const t=c.join("");e.push(`(<[${t}]>.+?<\\/[${t}]>)`)}if(l.length){const t=l.join("|");e.push(`(:(?:${t}))`)}const t=new RegExp(e.join("|"),"gm"),n=s.split(t).filter(Boolean).map((e,t)=>{if(e.startsWith("<")&&e.endsWith(">")){const n=e.match(/<([a-z]+)>(.+?)<\/([a-z]+)>/);if(n){const[,e,i]=n,a=null==r?void 0:r[e];if("function"==typeof a){const e=a(i);return(0,o.cloneElement)(e,{key:t})}}}if(e.startsWith(":")){const n=e.replace(":",""),i=null==r?void 0:r[n];if((0,o.isValidElement)(i))return(0,o.cloneElement)(i,{key:t})}return e});return(0,i.jsx)(o.Fragment,{children:n})}return(0,i.jsx)(o.Fragment,{children:s})},function(e,t){const{values:r,...n}=e,{values:i,...o}=t;return j_(i,r)&&j_(n,o)});function R_({listbox:e,children:t,isLoading:r,mobileOverlay:n=I_,searchField:a,onClose:s,prepend:l,className:c,...u}){const d=xb()||typeof window>"u"?fp.getState().data.is_mobile_device??!1:window.screen.width<=768,{floatingWidth:h,floatingMinWidth:f="min-w-180",collection:p,showEmptyMessage:g,state:{isOpen:m,setIsOpen:v},positionStyle:y,floating:b,refs:w}=e,x=!l&&d?n:S_,C=od("text-base sm:text-sm outline-none bg max-h-inherit flex flex-col",!l&&"shadow-xl border py-4",c,x===S_&&"rounded-panel",x===S_&&"auto"===h?`max-w-288 ${f}`:""),_=(0,o.useMemo)(()=>{let e=0;const t=[];return[...p.values()].reduce((r,n)=>{if(n.section){if(!t.includes(n.section)){const i=(0,o.cloneElement)(n.section,{key:n.section.key||e,index:e});r.push(i),t.push(n.section),e++}}else r.push((0,o.cloneElement)(n.element,{key:n.element.key||n.element.props.value}));return r},[])},[p]),S=_.length>0||g&&!r,A=S?(0,i.jsxs)("div",{className:C,role:"presentation",children:[a,(0,i.jsx)(L_,{isLoading:r,...u,children:_})]}):null;return(0,i.jsxs)(vx.Provider,{value:e,children:[t,l?A:dp&&(0,de.createPortal)((0,i.jsx)(hb,{children:m&&S&&(0,i.jsx)(x,{triggerRef:w.reference,restoreFocus:!0,isOpen:m,onClose:()=>{null==s||s(),v(!1)},isDismissable:!0,style:y,ref:b,children:A})}),dp)]})}function L_({className:e,children:t,isLoading:r,...n}){const{role:a,listboxId:s,virtualFocus:l,focusItem:c,state:{activeIndex:u,setActiveIndex:d,selectedIndex:h}}=yx(),f=(0,o.useRef)(!0),p=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>d(null),[d]),(0,o.useEffect)(()=>{if(f.current){const e=u??h;null!=e||l?null!=e&&requestAnimationFrame(()=>{c("increment",e)}):requestAnimationFrame(()=>{var e;null==(e=p.current)||e.focus({preventScroll:!0})})}f.current=!1},[u,h,c,l]),(0,i.jsx)("div",{tabIndex:l?void 0:-1,role:a,id:s,className:"flex-auto overflow-y-auto overscroll-contain outline-none",ref:p,...n,children:t.length?t:(0,i.jsx)(N_,{})})}function N_(){return(0,i.jsx)("div",{className:"px-8 py-4 text-sm italic text-muted",children:(0,i.jsx)(M_,{message:"There are no items matching your query"})})}function D_({state:{isOpen:e,setIsOpen:t,selectedIndex:r,activeIndex:n,setInputValue:i,setActiveIndex:o},focusLoopingMode:a,collection:s,focusItem:l,handleItemSelection:c,allowCustomValue:u}){const d=n=>{if(!e&&n.currentTarget.contains(n.target)){if("ArrowDown"===n.key)return n.preventDefault(),t(!0),l("increment",r??0),!0;if("ArrowUp"===n.key)return n.preventDefault(),t(!0),l("decrement",r??s.size-1),!0;if("Enter"===n.key||"Space"===n.key)return n.preventDefault(),t(!0),l("increment",r??0),!0}},h=r=>{const i=Math.max(0,s.size-1);if(e&&r.currentTarget.contains(r.target))switch(r.key){case"ArrowDown":return r.preventDefault(),null==n?l("increment",0):n>=i?"loop"===a?l("increment",0):"deselect"===a&&o(null):l("increment",n+1),!0;case"ArrowUp":return r.preventDefault(),null==n?l("decrement",i):n<=0?"loop"===a?l("decrement",i):"deselect"===a&&o(null):l("decrement",n-1),!0;case"Home":return r.preventDefault(),l("increment",0),!0;case"End":return r.preventDefault(),l("decrement",i),!0;case"Tab":return t(!1),!0}};return{handleTriggerKeyDown:d,handleListboxKeyboardNavigation:h,handleListboxSearchFieldKeydown:r=>{var o,a;if("Enter"===r.key&&null!=n&&s.size){r.preventDefault();const[e,t]=[...s.entries()][n];return void(e&&(c(e),null==(a=(o=t.element.props).onSelected)||a.call(o)))}"Escape"===r.key&&e&&(t(!1),u||i("")),d(r)||h(r)}}}const z_=new Map;function B_(){const e=function(e){const{localeCode:t}=T_(),r=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(z_.has(r))return z_.get(r);const n=new Intl.Collator(t,e);return z_.set(r,n),n}({usage:"search",sensitivity:"base"}),t=(0,o.useRef)({search:"",timeout:void 0}).current,r=(r,n)=>{let i=n??0;for(;null!=i;){const n=r[i],o=null==n?void 0:n.slice(0,t.search.length);if(o&&0===e.compare(o,t.search))return i;if(!(i<r.length-1))return null;i++}return null};return{findMatchingItem:(e,n,i=0)=>{const o=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(e.key);if(!o||e.ctrlKey||e.metaKey)return null;" "===o&&t.search.trim().length>0&&(e.preventDefault(),e.stopPropagation()),t.search+=o;let a=r(n,i);return null==a&&(a=r(n,0)),clearTimeout(t.timeout),t.timeout=setTimeout(()=>{t.search=""},500),a??null}}}function U_(e){return function(e,{noSSR:t}={noSSR:!0}){const r=typeof window<"u"&&"function"==typeof window.matchMedia,[n,i]=(0,o.useState)(t?()=>!!r&&window.matchMedia(e).matches:null);return(0,o.useEffect)(()=>{if(!r)return;const n=window.matchMedia(e),o=()=>{i(n.matches)};return n.addEventListener("change",o),t||o(),()=>{n.removeEventListener("change",o)}},[r,e,t]),typeof window>"u"?null:n}("(max-width: 768px)",e)}const V_=ld((0,i.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"SearchOutlined");var H_=e=>null==e,$_=e=>!H_(e)&&!Array.isArray(e)&&(e=>"object"==typeof e)(e)&&!(e=>e instanceof Date)(e),W_=e=>$_(e)&&e.target?(e=>"checkbox"===e.type)(e.target)?e.target.checked:e.target.value:e,G_=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function q_(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(G_&&(e instanceof Blob||e instanceof FileList)||!r&&!$_(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return $_(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=q_(e[r]));else t=e}return t}var Y_=e=>Array.isArray(e)?e.filter(Boolean):[],X_=e=>void 0===e,K_=(e,t,r)=>{if(!t||!$_(e))return r;const n=Y_(t.split(/[,[\].]+?/)).reduce((e,t)=>H_(e)?e:e[t],e);return X_(n)||n===e?X_(e[t])?r:e[t]:n},Z_=e=>"boolean"==typeof e,J_=(e,t,r)=>{let n=-1;const i=(e=>/^\w*$/.test(e))(t)?[t]:(e=>Y_(e.replace(/["|']|\]/g,"").split(/\.|\[/)))(t),o=i.length,a=o-1;for(;++n<o;){const t=i[n];let o=r;if(n!==a){const r=e[t];o=$_(r)||Array.isArray(r)?r:isNaN(+i[n+1])?{}:[]}if("__proto__"===t)return;e[t]=o,e=e[t]}return e};const Q_=o.createContext(null),eS=()=>o.useContext(Q_);var tS=(e,t,r)=>!e||!t||e===t||(e=>Array.isArray(e)?e:[e])(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e)));function rS(e){const t=o.useRef(e);t.current=e,o.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function nS(e){const t=eS(),{control:r=t.control,disabled:n,name:i,exact:a}=e||{},[s,l]=o.useState(r._formState),c=o.useRef(!0),u=o.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=o.useRef(i);return d.current=i,rS({disabled:n,next:e=>c.current&&tS(d.current,e.name,a)&&((e,t,r)=>{r(e);const{name:n,...i}=e;return(e=>$_(e)&&!Object.keys(e).length)(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>!0===t[e])})(e,u.current,r._updateFormState)&&l({...r._formState,...e}),subject:r._subjects.state}),o.useEffect(()=>(c.current=!0,u.current.isValid&&r._updateValid(!0),()=>{c.current=!1}),[r]),((e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return"all"!==t._proxyFormState[i]&&(t._proxyFormState[i]=!n||"all"),r&&(r[i]=!0),e[i]}});return i})(s,r,u.current,!1)}function iS(e={}){const{size:t="md",startAppend:r,endAppend:n,className:i,labelPosition:o,labelDisplay:a="block",inputClassName:s,inputWrapperClassName:l,unstyled:c,invalid:u,disabled:d,background:h="bg-transparent",flexibleHeight:f,inputShadow:p="shadow-sm",descriptionPosition:g="bottom",inputRing:m,inputFontSize:v,labelSuffix:y}={...e};if(c)return{label:"",input:s||"",wrapper:i||"",inputWrapper:l||"",adornment:"",append:{size:"",radius:""},size:{font:"",height:""},description:"",error:""};const b=function({size:e,flexibleHeight:t}){switch(e){case"2xs":return{font:"text-xs",height:t?"min-h-24":"h-24"};case"xs":return{font:"text-xs",height:t?"min-h-30":"h-30"};case"sm":return{font:"text-sm",height:t?"min-h-36":"h-36"};case"lg":return{font:"text-md md:text-lg",height:t?"min-h-50":"h-50"};case"xl":return{font:"text-xl",height:t?"min-h-60":"h-60"};default:return{font:"text-sm",height:t?"min-h-42":"h-42"}}}({size:e.size,flexibleHeight:f});v&&(b.font=v);const w=r||n,x=m||"focus:ring "+(u?"focus:ring-danger/focus focus:border-danger/60":"focus:ring-primary/focus focus:border-primary/60"),C=function(e){const{startAppend:t,endAppend:r,inputRadius:n}=e,i=t||r;return"rounded-full"===n?{input:od(!i&&"rounded-full",t&&"rounded-r-full rounded-l-none",r&&"rounded-l-full rounded-r-none"),append:t?"rounded-l-full":"rounded-r-full"}:"rounded-none"===n?{input:"",append:""}:n?{input:n,append:n}:{input:od(!i&&"rounded-input",t&&"rounded-r-input rounded-l-none",r&&"rounded-l-input rounded-r-none"),append:t?"rounded-l-input":"rounded-r-input"}}(e);return{label:od(a,"first-letter:capitalize text-left whitespace-nowrap",d&&"text-disabled",b.font,y?"":"side"===o?"mr-16":"mb-4"),input:od("block text-left relative w-full appearance-none transition-shadow text",h,C.input,oS(e),!d&&`${x} focus:outline-none ${p}`,d&&"text-disabled cursor-not-allowed",s,b.font,b.height,aS(e)),adornment:sS(t),append:{size:dx(t),radius:C.append},wrapper:od(i,b.font,{"flex items-center":"side"===o}),inputWrapper:od("isolate relative",l,w&&"flex items-stretch"),size:b,description:`text-muted ${"bottom"===g?"pt-10":"pb-10"} text-xs`,error:"text-danger pt-10 text-xs"}}function oS({startAppend:e,endAppend:t,inputBorder:r,invalid:n}){if(r)return r;const i=n?"border-danger":"border-divider";return e||t?e?`${i} border-y border-r`:`${i} border-y border-l`:`${i} border`}function aS({startAdornment:e,endAdornment:t,inputRadius:r}){return"rounded-full"===r?od(e?"pl-54":"pl-28",t?"pr-54":"pr-28"):od(e?"pl-46":"pl-12",t?"pr-46":"pr-12")}function sS(e){switch(e){case"2xs":return"icon-2xs";case"xs":return"icon-xs";case"sm":case"md":return"icon-sm";case"lg":return"icon-lg";case"xl":return"icon-xl";default:return""}}function lS({children:e,direction:t,className:r,position:n=("start"===t?"left-0":"right-0")}){return e?(0,i.jsx)("div",{className:od("pointer-events-none absolute top-0 z-10 flex h-full min-w-42 items-center justify-center text-muted",n,r),children:e}):null}function cS(e,t){const r={...e};return Object.keys(r).forEach(e=>{const t=e;(null==r[t]||""===r[t])&&delete r[t]}),r}const uS=o.forwardRef((e,t)=>{const{children:r,description:n,errorMessage:o,descriptionProps:a={},errorMessageProps:s={},startAdornment:l,endAdornment:c,adornmentPosition:u,startAppend:d,endAppend:h,fieldClassNames:f,disabled:p,wrapperProps:g}=e;return(0,i.jsxs)("div",{className:f.wrapper,ref:t,...g,children:[(0,i.jsx)(dS,{...e}),(0,i.jsxs)("div",{className:f.inputWrapper,children:[(0,i.jsx)(lS,{direction:"start",className:f.adornment,position:u,children:l}),d&&(0,i.jsx)(hS,{style:f.append,disabled:p,children:d}),r,h&&(0,i.jsx)(hS,{style:f.append,disabled:p,children:h}),(0,i.jsx)(lS,{direction:"end",className:f.adornment,position:u,children:c})]}),n&&!o&&(0,i.jsx)("div",{className:f.description,...a,children:n}),o&&(0,i.jsx)("div",{className:f.error,...s,children:o})]})});function dS({labelElementType:e,fieldClassNames:t,labelProps:r,label:n,labelSuffix:o,labelSuffixPosition:a="spaced",required:s}){if(!n)return null;const l=(0,i.jsxs)(e||"label",{className:t.label,...r,children:[n,s&&(0,i.jsx)("span",{className:"text-danger",children:" *"})]});return o?(0,i.jsxs)("div",{className:od("mb-4 flex w-full gap-4","spaced"===a?"items-end":"items-center"),children:[l,(0,i.jsx)("div",{className:od("text-xs text-muted","spaced"===a?"ml-auto":""),children:o})]}):l}function hS({children:e,style:t,disabled:r}){return o.cloneElement(e,{...e.props,disabled:e.props.disabled||r,...cS(t)})}function fS({autoFocus:e,autoSelectText:t},r){const n=(0,o.useRef)(e);(0,o.useEffect)(()=>{n.current&&r.current&&requestAnimationFrame(()=>{var e,n;null==(e=r.current)||e.focus(),t&&"input"===(null==(n=r.current)?void 0:n.nodeName.toLowerCase())&&r.current.select()}),n.current=!1},[r,t])}function pS(e){const{focusRef:t,labelElementType:r="label",label:n,labelSuffix:i,labelSuffixPosition:a,autoFocus:s,autoSelectText:l,labelPosition:c,descriptionPosition:u,size:d,errorMessage:h,description:f,flexibleHeight:p,startAdornment:g,endAdornment:m,startAppend:v,adornmentPosition:y,endAppend:b,className:w,inputClassName:x,inputWrapperClassName:C,unstyled:_,background:S,invalid:A,disabled:k,id:E,inputRadius:I,inputBorder:j,inputShadow:T,inputRing:F,inputFontSize:O,...P}=e;fS(e,t);const M=(0,o.useId)(),R=E||M,L={id:`${R}-label`,htmlFor:"label"===r?R:void 0},N={id:`${R}-description`},D={id:`${R}-error`},z={"aria-label":e.label||e["aria-label"]||!e.placeholder?e["aria-label"]:e.placeholder,"aria-invalid":A||void 0,id:R,disabled:k,...P},B=[];n&&B.push(L.id),z["aria-labelledby"]&&B.push(z["aria-labelledby"]),z["aria-labelledby"]=B.length?B.join(" "):void 0;const U=[];return f&&U.push(N.id),h&&U.push(D.id),z["aria-describedby"]&&U.push(z["aria-describedby"]),z["aria-describedby"]=U.length?U.join(" "):void 0,{fieldProps:{errorMessageProps:D,descriptionProps:N,labelProps:L,disabled:k,label:n,labelSuffix:i,labelSuffixPosition:a,autoFocus:s,autoSelectText:l,labelPosition:c,descriptionPosition:u,size:d,errorMessage:h,description:f,flexibleHeight:p,startAdornment:g,endAdornment:m,startAppend:v,adornmentPosition:y,endAppend:b,className:w,inputClassName:x,inputWrapperClassName:C,unstyled:_,background:S,invalid:A},inputProps:z}}const gS=(0,o.forwardRef)(({inputElementType:e="input",flexibleHeight:t,inputRef:r,inputTestId:n,...o},a)=>{const s=Rb(r),{fieldProps:l,inputProps:c}=pS({...o,focusRef:s}),u="textarea"===e,d=u?"textarea":"input",h=iS({...o,flexibleHeight:t||"textarea"===e});return"textarea"===e&&!o.unstyled&&(h.input=`${h.input} py-12`),(0,i.jsx)(uS,{ref:a,fieldClassNames:h,...l,children:(0,i.jsx)(d,{"data-testid":n,ref:s,...c,rows:u?c.rows||4:void 0,className:h.input})})});o.forwardRef(({name:e,...t},r)=>{const{field:{onChange:n,onBlur:a,value:s="",ref:l},fieldState:{invalid:c,error:u}}=function(e){const t=eS(),{name:r,disabled:n,control:i=t.control,shouldUnregister:a}=e,s=((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(i._names.array,r),l=function(e){const t=eS(),{control:r=t.control,name:n,defaultValue:i,disabled:a,exact:s}=e||{},l=o.useRef(n);l.current=n,rS({disabled:a,subject:r._subjects.values,next:e=>{tS(l.current,e.name,s)&&u(q_(((e,t,r,n,i)=>(e=>"string"==typeof e)(e)?K_(r,e,i):Array.isArray(e)?e.map(e=>K_(r,e)):r)(l.current,r._names,e.values||r._formValues,0,i)))}});const[c,u]=o.useState(r._getWatch(n,i));return o.useEffect(()=>r._removeUnmounted()),c}({control:i,name:r,defaultValue:K_(i._formValues,r,K_(i._defaultValues,r,e.defaultValue)),exact:!0}),c=nS({control:i,name:r}),u=o.useRef(i.register(r,{...e.rules,value:l,...Z_(e.disabled)?{disabled:e.disabled}:{}}));return o.useEffect(()=>{const e=i._options.shouldUnregister||a,t=(e,t)=>{const r=K_(i._fields,e);r&&(r._f.mount=t)};if(t(r,!0),e){const e=q_(K_(i._options.defaultValues,r));J_(i._defaultValues,r,e),X_(K_(i._formValues,r))&&J_(i._formValues,r,e)}return()=>{(s?e&&!i._state.action:e)?i.unregister(r):t(r,!1)}},[r,i,s,a]),o.useEffect(()=>{K_(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:K_(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:l,...Z_(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:o.useCallback(e=>u.current.onChange({target:{value:W_(e),name:r},type:"change"}),[r]),onBlur:o.useCallback(()=>u.current.onBlur({target:{value:K_(i._formValues,r),name:r},type:"blur"}),[r,i]),ref:e=>{const t=K_(i._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!K_(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!K_(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!K_(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!K_(c.validatingFields,r)},error:{enumerable:!0,get:()=>K_(c.errors,r)}})}}({name:e}),d={onChange:n,onBlur:a,value:s??"",invalid:c,errorMessage:null==u?void 0:u.message,inputRef:l,name:e};return(0,i.jsx)(gS,{ref:r,...Eb(d,t)})});const mS=(0,o.forwardRef)((e,t)=>{const{searchPlaceholder:r,showSearchField:n,children:[a,s],floatingWidth:l="auto",isLoading:c}=e,u=(0,o.useId)(),d=U_(),h=HC({...e,clearInputOnItemSelection:!0,showEmptyMessage:n,floatingWidth:d?"auto":l,virtualFocus:n,role:n?"listbox":"menu",focusLoopingMode:n?"stay":"loop",children:s.props.children},t),{state:{isOpen:f,setIsOpen:p,activeIndex:g,inputValue:m,setInputValue:v},listboxId:y,focusItem:b,listContent:w,reference:x,onInputChange:C}=h,{handleTriggerKeyDown:_,handleListboxKeyboardNavigation:S,handleListboxSearchFieldKeydown:A}=D_(h),{findMatchingItem:k}=B_();return(0,i.jsx)(R_,{onClick:e=>e.stopPropagation(),listbox:h,onKeyDownCapture:n?void 0:e=>{if(!f)return;const t=k(e,w,g);null!=t&&b("increment",t)},onKeyDown:S,onClose:n?()=>v(""):void 0,"aria-labelledby":u,isLoading:c,searchField:n?(0,i.jsx)(gS,{size:"sm",placeholder:r,startAdornment:(0,i.jsx)(V_,{}),className:"flex-shrink-0 px-8 pb-8 pt-4",autoFocus:!0,"aria-expanded":f?"true":"false","aria-haspopup":"listbox","aria-controls":f?y:void 0,"aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:"false",value:m,onChange:C,onKeyDown:e=>{A(e)}}):null,children:(0,o.cloneElement)(a,{id:u,"aria-expanded":f?"true":"false","aria-haspopup":"menu","aria-controls":f?y:void 0,ref:x,onKeyDown:_,onClick:fx(e=>{var t,r;null==(r=null==(t=a.props)?void 0:t.onClick)||r.call(t,e),p(!f)})})})});function vS({children:e}){return e}function yS({item:e,button:t}){return(0,i.jsxs)(mS,{children:[t,(0,i.jsx)(vS,{children:(e.menuItems||[]).map(e=>(0,i.jsx)(Cx,{value:e.label,onSelected:()=>{e.action(yp().editor)},children:e.label},e.label))})]})}const bS=(0,o.forwardRef)(({children:e,size:t="md",iconSize:r=(t&&t.length<=3?t:"md"),variant:n="text",radius:a="rounded-button",className:s,padding:l,equalWidth:c=!0,badge:u,...d},h)=>{const f=od(dx(t,{padding:l,equalWidth:c,variant:n}),s,u&&"relative");return(0,i.jsxs)(px,{...d,ref:h,radius:a,variant:n,className:f,children:[(0,o.cloneElement)(e,{size:r}),u]})}),wS=o.memo(function({icon:e,className:t,size:r}){let n;return n=o.isValidElement(e)?o.cloneElement(e,{className:"svg-iconEl"}):"string"==typeof e?(0,i.jsx)("img",{className:"w-font h-font",src:e,alt:""}):Array.isArray(e)?o.createElement(cd(e),{size:r}):o.createElement(e,{size:r}),(0,i.jsx)("span",{className:od(t,"leading-none"),children:n})});function xS({value:e}){return e?(0,i.jsx)(M_,"string"==typeof e?{message:e}:{...e}):null}function CS({item:e}){const t=e.label?(0,i.jsx)(SS,{item:e}):(0,i.jsx)(_S,{item:e});return e.menuItems?(0,i.jsx)(yS,{item:e,button:t}):o.cloneElement(t,{onClick:()=>{var t;null==(t=e.action)||t.call(e,yp().editor)}})}const _S=(0,o.forwardRef)(({item:e,...t},r)=>(0,i.jsx)(bS,{ref:r,radius:"rounded-full",size:"sm",...t,children:(0,i.jsx)(wS,{icon:e.icon})})),SS=(0,o.forwardRef)(({item:e,...t},r)=>(0,i.jsx)(gx,{ref:r,radius:"rounded-full",size:"xs",color:e.buttonColor||"primary",variant:e.buttonVariant||"flat",startIcon:e.icon&&(0,i.jsx)(wS,{icon:e.icon}),...t,children:(0,i.jsx)(xS,{value:e.label})}));function AS({children:e,color:t,variant:r,radius:n="rounded-button",size:a,className:s,value:l,onChange:c,multiple:u,disabled:d}){const h=o.Children.map(e,(i,s)=>{if(o.isValidElement(i)){const h=(e=>void 0!==l&&(u?l.includes(e):e===l))(i.props.value),f=h?"primary":t;return o.cloneElement(i,{color:h?"primary":t,variant:r,size:a,radius:null,disabled:i.props.disabled||d,...i.props,onClick:e=>{i.props.onClick&&i.props.onClick(e),c&&(u?null==c||c((e=>{const t=[...l],r=l.indexOf(e);return r>-1?t.splice(r,1):t.push(e),t})(i.props.value)):null==c||c(i.props.value))},className:od(i.props.className,h?"z-20":"z-10",kS(s,e,n,f))})}});return(0,i.jsx)("div",{className:od(n,"isolate inline-flex",s),children:h})}function kS(e,t,r,n){return 0===e?od(r,"rounded-tr-none rounded-br-none",!n&&"border-r-transparent disabled:border-r-transparent"):e===t.length-1?od(r,"rounded-tl-none rounded-bl-none -ml-1"):od("rounded-none -ml-1",!n&&"border-r-transparent disabled:border-r-transparent")}const ES=ld((0,i.jsx)("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"}),"UndoOutlined"),IS=ld((0,i.jsx)("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"}),"RedoOutlined");function jS(){const e=vp(e=>e.history.canUndo),t=vp(e=>e.history.canRedo);return(0,i.jsxs)(AS,{variant:"outline",children:[(0,i.jsx)(bS,{equalWidth:!1,size:"xs",padding:"pl-12 pr-10",radius:"rounded-full",disabled:!e,onClick:()=>{bp().history.undo()},children:(0,i.jsx)(ES,{})},"undo"),(0,i.jsx)(bS,{equalWidth:!1,padding:"pl-10 pr-12",size:"xs",radius:"rounded-full",disabled:!t,onClick:()=>{bp().history.redo()},children:(0,i.jsx)(IS,{})},"redo")]})}const TS=ld((0,i.jsx)("path",{d:"M19 13H5v-2h14v2z"}),"RemoveOutlined"),FS=ld((0,i.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"AddOutlined");function OS(){var e,t;const r=vp(e=>e.zoom)||1;return vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.zoom)?void 0:r.allowUserZoom})??1?(0,i.jsxs)("div",{className:"flex items-center select-none",children:[(0,i.jsx)(bS,{size:"sm",disabled:!(null!=(e=bp().zoom)&&e.canZoomOut()),onClick:()=>{bp().zoom.zoomOut(bp().zoom.step)},children:(0,i.jsx)(TS,{})}),(0,i.jsxs)("div",{className:"w-[4ch] text-sm text-center",children:[Math.round(100*r),"%"]}),(0,i.jsx)(bS,{size:"sm",disabled:!(null!=(t=bp().zoom)&&t.canZoomIn()),onClick:()=>{bp().zoom.zoomIn(bp().zoom.step)},children:(0,i.jsx)(FS,{})})]}):null}function PS({item:e}){switch(e.type){case"undoWidget":return(0,i.jsx)(jS,{});case"zoomWidget":return(0,i.jsx)(OS,{});case"button":return(0,i.jsx)(CS,{item:e});case"image":return(0,i.jsx)("img",{className:"h-30 object-cover",src:sw(e.src),alt:""});default:return null}}const MS=ld((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}),"CloseOutlined");function RS(){var e;let t=vp(e=>{var t;return(null==(t=e.config.ui)?void 0:t.mode)===Xu.OVERLAY});const{width:r}=vp(e=>e.stageSize),n=r<=700;return n&&null!=(e=yp().config.ui)&&e.forceOverlayModeOnMobile&&(t=!0),{isModal:t,isMobile:n}}function LS(){const{isModal:e,isMobile:t}=RS(),r=vp(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,n=vp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.menubar)?void 0:r.items}),{left:a,center:s,right:l}=(0,o.useMemo)(()=>function(e,t){const r={left:[],center:[],right:[]};(e||[]).filter(e=>!t&&!e.mobileOnly||t&&!e.desktopOnly).forEach(e=>{"left"===e.align?r.left.push({...e,position:e.position??1}):"right"===e.align?r.right.push({...e,position:e.position??1}):r.center.push({...e,position:e.position??1})});const n=Object.entries(r).map(([e,t])=>[e,t.sort((e,t)=>(e.position??0)-(t.position??0))]);return Object.fromEntries(n)}(n||[],t),[n,t]),c=e&&t&&r&&(0,i.jsx)(bS,{size:"sm",className:"ml-10",onClick:()=>{yp().editor.close()},children:(0,i.jsx)(MS,{})});return(0,i.jsxs)(ob.div,{className:cx,...ux,children:[(0,i.jsx)("div",{className:"mr-auto flex items-center gap-8",children:a.map((e,t)=>(0,i.jsx)(PS,{item:e},t))}),(0,i.jsx)("div",{className:"flex items-center gap-10",children:s.map((e,t)=>(0,i.jsx)(PS,{item:e},t))}),(0,i.jsx)("div",{className:"ml-auto flex items-center gap-8",children:l.map((e,t)=>(0,i.jsx)(PS,{item:e},t))}),c]})}function NS(){const e=vp(e=>{var t;return null==(t=e.crop.zoneRect)?void 0:t.width})||1,t=vp(e=>{var t;return null==(t=e.crop.zoneRect)?void 0:t.height})||1;return(0,i.jsx)("div",{className:"text-sm",children:`${e}x${t}`})}function DS(){const e=vp(e=>e.activeTool);return(0,i.jsxs)(ob.div,{className:cx,...ux,children:[(0,i.jsx)(zS,{}),BS(e),(0,i.jsx)(US,{})]})}function zS(){const{isMobile:e}=RS(),t=vp(e=>e.dirty);return e?(0,i.jsx)(bS,{size:"sm",onClick:()=>{yp().cancelChanges()},children:(0,i.jsx)(MS,{})}):(0,i.jsx)(gx,{variant:"outline",size:"xs",startIcon:(0,i.jsx)(MS,{}),radius:"rounded-full",className:"min-w-92",onClick:()=>{yp().cancelChanges()},children:(0,i.jsx)(M_,t?{message:"Cancel"}:{message:"Close"})})}function BS(e){var t,r;if(!e)return null;const n=(0,i.jsx)("div",{className:"capitalize text-sm",children:(0,i.jsx)(M_,{message:e})});return e===nd.CROP&&((null==(r=null==(t=yp().config.tools)?void 0:t.crop)?void 0:r.allowCustomRatio)??1)?(0,i.jsx)(NS,{}):n}function US(){const{isMobile:e}=RS(),t=vp(e=>e.dirty);return e?(0,i.jsx)(bS,{size:"sm",disabled:!t,onClick:()=>{yp().applyChanges()},children:(0,i.jsx)(bx,{})}):(0,i.jsx)(gx,{variant:"flat",color:"primary",size:"xs",disabled:!t,startIcon:(0,i.jsx)(bx,{}),radius:"rounded-full",onClick:()=>{yp().applyChanges()},children:(0,i.jsx)(M_,{message:"Apply"})})}function VS(){const e=vp(e=>e.activeTool);return(0,i.jsx)(hb,{initial:!1,children:e?(0,i.jsx)(DS,{},"activeToolbar"):(0,i.jsx)(LS,{},"mainToolbar")})}const HS={newCanvas:Zu("Loading Canvas"),mainImage:Zu("Loading Image"),state:Zu("Loading State"),merge:Zu("Processing Image")};function $S(){const[e,t]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{vp.subscribe(e=>e.loading,e=>{e&&t(e)})},[]),(0,i.jsx)(hb,{children:e&&(0,i.jsx)(ob.div,{initial:{y:"60%",opacity:0},animate:{y:0,opacity:1},exit:{y:"-60%",opacity:0},transition:{type:"tween",duration:.3},onAnimationComplete:()=>{setTimeout(()=>{t(!1)},400)},className:"absolute z-loading-indicator inset-0 m-auto p-6 w-144 h-32 text-center text-sm bg-paper rounded-full shadow-lg",children:(0,i.jsx)(M_,{...HS[e]})})})}const WS={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function GS(e,t,r){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*r):e*t*r/(t+r*e)}function qS(e,t,r,n=.15){return 0===n?function(e,t,r){return Math.max(t,Math.min(e,r))}(e,t,r):e<t?-GS(t-e,r-t,n)+t:e>r?+GS(e-r,r-t,n)+r:e}function YS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function KS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?XS(Object(r),!0).forEach(function(t){YS(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XS(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}const ZS={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function JS(e){return e?e[0].toUpperCase()+e.slice(1):""}const QS=["enter","leave"];const eA=["gotpointercapture","lostpointercapture"];function tA(e){let t=e.substring(2).toLowerCase();const r=!!~t.indexOf("passive");r&&(t=t.replace("passive",""));const n=eA.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(n);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:r}}function rA(e){return"touches"in e}function nA(e){return rA(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function iA(e){return rA(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function oA(e,t){try{const r=t.clientX-e.clientX,n=t.clientY-e.clientY,i=(t.clientX+e.clientX)/2,o=(t.clientY+e.clientY)/2,a=Math.hypot(r,n);return{angle:-180*Math.atan2(r,n)/Math.PI,distance:a,origin:[i,o]}}catch{}return null}function aA(e,t){const[r,n]=Array.from(e.touches).filter(e=>t.includes(e.identifier));return oA(r,n)}function sA(e){const t=iA(e);return rA(e)?t.identifier:t.pointerId}function lA(e){const t=iA(e);return[t.clientX,t.clientY]}function cA(e){let{deltaX:t,deltaY:r,deltaMode:n}=e;return 1===n?(t*=40,r*=40):2===n&&(t*=800,r*=800),[t,r]}function uA(e,...t){return"function"==typeof e?e(...t):e}function dA(){}function hA(...e){return 0===e.length?dA:1===e.length?e[0]:function(){let t;for(const r of e)t=r.apply(this,arguments)||t;return t}}function fA(e,t){return Object.assign({},t,e||{})}class pA{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:n}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=n,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?uA(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:n}=this;t.args=this.args;let i=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,n.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,n.locked=!!document.pointerLockElement,Object.assign(n,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:r,altKey:n,metaKey:i,ctrlKey:o}=e;Object.assign(t,{shiftKey:r,altKey:n,metaKey:i,ctrlKey:o})}return t}(e)),n.down=n.pressed=n.buttons%2==1||n.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);WS.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[o,a]=t._movement,[s,l]=r.threshold,{_step:c,values:u}=t;if(r.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(o)>=s&&u[0]),!1===c[1]&&(c[1]=Math.abs(a)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(o)>=s&&Math.sign(o)*s),!1===c[1]&&(c[1]=Math.abs(a)>=l&&Math.sign(a)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(r.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?o-c[0]:0,d[1]=!1!==c[1]?a-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const h=t.offset,f=t._active&&!t._blocked||t.active;f&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=n[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=uA(r.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[p,g]=t.offset,[[m,v],[y,b]]=t._bounds;t.overflow=[p<m?-1:p>v?1:0,g<y?-1:g>b?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const w=t._active&&r.rubberband||[0,0];if(t.offset=function(e,[t,r],[n,i]){const[[o,a],[s,l]]=e;return[qS(t,o,a,n),qS(r,s,l,i)]}(t._bounds,t.offset,w),t.delta=WS.sub(t.offset,h),this.computeMovement(),f&&(!t.last||i>32)){t.delta=WS.sub(t.offset,h);const e=t.delta.map(Math.abs);WS.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const n=this.handler(KS(KS(KS({},t),e),{},{[this.aliasKey]:e.values}));void 0!==n&&(e.memo=n)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class gA extends pA{constructor(...e){super(...e),YS(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=WS.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=WS.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const n="object"==typeof r.axisThreshold?r.axisThreshold[nA(e)]:r.axisThreshold;t.axis=function([e,t],r){const n=Math.abs(e),i=Math.abs(t);return n>i&&n>r?"x":i>n&&i>r?"y":void 0}(t._movement,n)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const mA=e=>e,vA={enabled:(e=!0)=>e,eventOptions:(e,t,r)=>KS(KS({},r.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return WS.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?WS.toVector(e):void 0,transform(e,t,r){const n=e||r.shared.transform;return this.hasCustomTransform=!!n,n||mA},threshold:e=>WS.toVector(e,0)},yA=KS(KS({},vA),{},{axis(e,t,{axis:r}){if(this.lockDirection="lock"===r,!this.lockDirection)return r},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>yA.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:r=1/0,top:n=-1/0,bottom:i=1/0}=e;return[[t,r],[n,i]]}}),bA={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},wA=typeof window<"u"&&window.document&&window.document.createElement;function xA(){return wA&&"ontouchstart"in window}const CA={isBrowser:wA,gesture:function(){try{return"constructor"in GestureEvent}catch{return!1}}(),touch:xA(),touchscreen:xA()||wA&&window.navigator.maxTouchPoints>1,pointer:wA&&"onpointerdown"in window,pointerLock:wA&&"exitPointerLock"in window.document},_A={mouse:0,touch:0,pen:8},SA=KS(KS({},yA),{},{device(e,t,{pointer:{touch:r=!1,lock:n=!1,mouse:i=!1}={}}){return this.pointerLock=n&&CA.pointerLock,CA.touch&&r?"touch":this.pointerLock?"mouse":CA.pointer&&!i?"pointer":CA.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:r}){if(this.preventScrollDelay="number"==typeof r?r:r||void 0===r&&e?250:void 0,CA.touchscreen&&!1!==r)return e||(void 0!==r?"y":void 0)},pointerCapture(e,t,{pointer:{capture:r=!0,buttons:n=1,keys:i=!0}={}}){return this.pointerButtons=n,this.keys=i,!this.pointerLock&&"pointer"===this.device&&r},threshold(e,t,{filterTaps:r=!1,tapsThreshold:n=3,axis:i}){const o=WS.toVector(e,r?n:i?1:0);return this.filterTaps=r,this.tapsThreshold=n,o},swipe({velocity:e=.5,distance:t=50,duration:r=250}={}){return{velocity:this.transform(WS.toVector(e)),distance:this.transform(WS.toVector(t)),duration:r}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?KS(KS({},_A),e):_A,keyboardDisplacement:(e=10)=>e}),AA=KS(KS({},vA),{},{device(e,t,{shared:r,pointer:{touch:n=!1}={}}){if(r.target&&!CA.touch&&CA.gesture)return"gesture";if(CA.touch&&n)return"touch";if(CA.touchscreen){if(CA.pointer)return"pointer";if(CA.touch)return"touch"}},bounds(e,t,{scaleBounds:r={},angleBounds:n={}}){const i=e=>{const t=fA(uA(r,e),{min:-1/0,max:1/0});return[t.min,t.max]},o=e=>{const t=fA(uA(n,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof r&&"function"!=typeof n?[i(),o()]:e=>[i(e),o(e)]},threshold(e,t,r){return this.lockDirection="lock"===r.axis,WS.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});KS(KS({},yA),{},{mouseOnly:(e=!0)=>e}),KS(KS({},yA),{},{mouseOnly:(e=!0)=>e});const kA=new Map,EA=new Map;function IA(e){kA.set(e.key,e.engine),EA.set(e.key,e.resolver)}const jA={key:"drag",engine:class extends gA{constructor(...e){super(...e),YS(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),n={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=yA.bounds(n)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const n=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(n&&n.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=sA(e),r._pointerActive=!0,this.computeValues(lA(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==nA(e)?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const n=sA(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;const i=lA(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=WS.sub(i,t._values),this.computeValues(i)),WS.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):r.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===r.preventScrollAxis||"xy"===r.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const n=sA(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[i,o]=t._distance;if(t.tap=i<=r.tapsThreshold&&o<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[e,n]=t._delta,[i,o]=t._movement,[a,s]=r.swipe.velocity,[l,c]=r.swipe.distance,u=r.swipe.duration;if(t.elapsedTime<u){const r=Math.abs(e/t.timeDelta),u=Math.abs(n/t.timeDelta);r>a&&Math.abs(i)>l&&(t.swipe[0]=Math.sign(e)),u>s&&Math.abs(o)>c&&(t.swipe[1]=Math.sign(n))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=bA[e.key];if(t){const r=this.state,n=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,n),r._keyboardActive=!0,WS.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in bA&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:SA},TA={key:"pinch",engine:class extends pA{constructor(...e){super(...e),YS(this,"ingKey","pinching"),YS(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:r}=this.state;this.state.offset="wheel"===e?WS.add(t,r):[(1+t[0])*r[0],t[1]+r[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,r]=e._movement;if(!e.axis){const n=30*Math.abs(t)-Math.abs(r);n<0?e.axis="angle":n>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&("scale"===this.state.axis?e[1]=0:"angle"===this.state.axis&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,r=this.ctrl.touchIds;if(t._active&&t._touchIds.every(e=>r.has(e))||r.size<2)return;this.start(e),t._touchIds=Array.from(r).slice(0,2);const n=aA(e,t._touchIds);n&&this.pinchStart(e,n)}pointerStart(e){if(null!=e.buttons&&e.buttons%2!=1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,r=t._pointerEvents,n=this.ctrl.pointerIds;if(t._active&&Array.from(r.keys()).every(e=>n.has(e))||(r.size<2&&r.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);const i=oA(...Array.from(r.values()));i&&this.pinchStart(e,i)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=aA(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const r=oA(...Array.from(t.values()));r&&this.pinchMove(e,r)}pinchMove(e,t){const r=this.state,n=r._values[1],i=t.angle-n;let o=0;Math.abs(i)>270&&(o+=Math.sign(i)),this.computeValues([t.distance,t.angle-360*o]),r.origin=t.origin,r.turns=o,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(e=>!this.ctrl.touchIds.has(e))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const r=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=WS.sub(t._movement,r),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(t=>e[t]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const t=this.state;t._delta=[-cA(e)[1]/100*t.offset[0],0],WS.addTo(t._movement,t._delta),function(e){const[t,r]=e.overflow,[n,i]=e._delta,[o,a]=e._direction;(t<0&&n>0&&o<0||t>0&&n<0&&o>0)&&(e._movement[0]=e._movementBound[0]),(r<0&&i>0&&a<0||r>0&&i<0&&a>0)&&(e._movement[1]=e._movementBound[1])}(t),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:AA};const FA={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(CA.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},OA=["target","eventOptions","window","enabled","transform"];function PA(e={},t){const r={};for(const[n,i]of Object.entries(t))switch(typeof i){case"function":r[n]=i.call(r,e[n],n,e);break;case"object":r[n]=PA(e[n],i);break;case"boolean":i&&(r[n]=e[n])}return r}class MA{constructor(e,t){YS(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,n,i){const o=this._listeners,a=function(e,t=""){const r=ZS[e];return e+(r&&r[t]||t)}(t,r),s=KS(KS({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(a,n,s);const l=()=>{e.removeEventListener(a,n,s),o.delete(l)};return o.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class RA{constructor(){YS(this,"_timeouts",new Map)}add(e,t,r=140,...n){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...n))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>{window.clearTimeout(e)}),this._timeouts.clear()}}class LA{constructor(e){YS(this,"gestures",new Set),YS(this,"_targetEventStore",new MA(this)),YS(this,"gestureEventStores",{}),YS(this,"gestureTimeoutStores",{}),YS(this,"handlers",{}),YS(this,"config",{}),YS(this,"pointerIds",new Set),YS(this,"touchIds",new Set),YS(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&NA(e,"drag"),t.wheel&&NA(e,"wheel"),t.scroll&&NA(e,"scroll"),t.move&&NA(e,"move"),t.pinch&&NA(e,"pinch"),t.hover&&NA(e,"hover")}(this,e)}setEventIds(e){return rA(e)?(this.touchIds=new Set(function(e){return function(e){return Array.from(e.touches).filter(t=>{var r,n;return t.target===e.currentTarget||(null===(r=e.currentTarget)||void 0===r||null===(n=r.contains)||void 0===n?void 0:n.call(r,t.target))})}(e).map(e=>e.identifier)}(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,r={}){const n=e,{target:i,eventOptions:o,window:a,enabled:s,transform:l}=n,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(n,OA);if(r.shared=PA({target:i,eventOptions:o,window:a,enabled:s,transform:l},FA),t){const e=EA.get(t);r[t]=PA(KS({shared:r.shared},c),e)}else for(const u in c){const e=EA.get(u);e&&(r[u]=PA(KS({shared:r.shared},c[u]),e))}return r}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let n;if(!t.target||(n=t.target(),n)){if(t.enabled){for(const t of this.gestures){const i=this.config[t],o=DA(r,i.eventOptions,!!n);i.enabled&&new(kA.get(t))(this,e,t).bind(o)}const i=DA(r,t.eventOptions,!!n);for(const t in this.nativeHandlers)i(t,"",r=>this.nativeHandlers[t](KS(KS({},this.state.shared),{},{event:r,args:e})),void 0,!0)}for(const e in r)r[e]=hA(...r[e]);if(!n)return r;for(const e in r){const{device:t,capture:i,passive:o}=tA(e);this._targetEventStore.add(n,t,"",r[e],{capture:i,passive:o})}}}}function NA(e,t){e.gestures.add(t),e.gestureEventStores[t]=new MA(e,t),e.gestureTimeoutStores[t]=new RA}const DA=(e,t,r)=>(n,i,o,a={},s=!1)=>{var l,c;const u=null!==(l=a.capture)&&void 0!==l?l:t.capture,d=null!==(c=a.passive)&&void 0!==c?c:t.passive;let h=s?n:function(e,t="",r=!1){const n=ZS[e],i=n&&n[t]||t;return"on"+JS(e)+JS(i)+(function(e=!1,t){return e&&!QS.includes(t)}(r,i)?"Capture":"")}(n,i,u);r&&d&&(h+="Passive"),e[h]=e[h]||[],e[h].push(o)},zA=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function BA(e,t,r,n,i,o){if(!e.has(r)||!kA.has(n))return;const a=r+"Start",s=r+"End";i[n]=e=>{let n;return e.first&&a in t&&t[a](e),r in t&&(n=t[r](e)),e.last&&s in t&&t[s](e),n},o[n]=o[n]||{}}function UA({e:e,rect:t,deltaX:r,deltaY:n}){return{rect:t,x:e.clientX,y:e.clientY,deltaX:r??0,deltaY:n??0,nativeEvent:e}}function VA({onMoveStart:e,onMove:t,onMoveEnd:r,minimumMovement:n=0,preventDefault:i,stopPropagation:a=!0,onPress:s,onLongPress:l,...c}){const u=(0,o.useRef)({lastPosition:{x:0,y:0},started:!1,longPressTriggered:!1}).current,{addGlobalListener:d,removeGlobalListener:h}=Mb(),f=r=>{if(r.pointerId===u.id){const i=r.clientX-u.lastPosition.x,o=r.clientY-u.lastPosition.y;(Math.abs(i)>=n||Math.abs(o)>=n)&&!u.started&&(t=>{!u.el||!1===(null==e?void 0:e(t,u.el))||(u.originalTouchAction=u.el.style.touchAction,u.el.style.touchAction="none",u.originalUserSelect=document.documentElement.style.userSelect,document.documentElement.style.userSelect="none",u.started=!0)})(r),u.started&&(null==t||t(r,i,o),u.lastPosition={x:r.clientX,y:r.clientY})}},p=e=>{var t;if(e.pointerId===u.id){u.longPressTimer&&clearTimeout(u.longPressTimer);const n=u.longPressTriggered;u.longPressTriggered=!1,u.started&&(null==r||r(e)),u.el&&("pointercancel"!==e.type&&(null==(t=c.onPointerUp)||t.call(c,e,u.el),e.target&&u.el.contains(e.target)&&(n?null==l||l(e,u.el):null==s||s(e,u.el))),document.documentElement.style.userSelect=u.originalUserSelect||"",u.el.style.touchAction=u.originalTouchAction||""),u.id=void 0,u.started=!1,h(window,"pointermove",f,!1),h(window,"pointerup",p,!1),h(window,"pointercancel",p,!1)}};return{domProps:{onPointerDown:fx(r=>{var n;if(0===r.button&&null==u.id){if(u.started=!1,!1===(null==(n=c.onPointerDown)?void 0:n.call(c,r)))return;a&&r.stopPropagation(),i&&r.preventDefault(),u.id=r.pointerId,u.el=r.currentTarget,u.lastPosition={x:r.clientX,y:r.clientY},l&&(u.longPressTimer=setTimeout(()=>{l(r,u.el),u.longPressTriggered=!0},400)),(e||t)&&d(window,"pointermove",f,!1),d(window,"pointerup",p,!1),d(window,"pointercancel",p,!1)}})}}}function HA(e){return{left:e.left,top:e.top,width:e.width,height:e.height}}var $A=(e=>(e.topLeft="topLeft",e.topRight="topRight",e.bottomLeft="bottomLeft",e.bottomRight="bottomRight",e))($A||{});let WA={};const GA=(e={})=>{qb(null),WA=e};function qA({aspectRatio:e,boundaryRef:t,boundaryRect:r,restrictWithinBoundary:n=!0,minWidth:i=50,minHeight:o=50,...a}){const s={onMoveStart:(e,n)=>{var i;const o=e.target;if(!o.dataset.resizeHandle||Gb||(GA({currentRect:HA(n.getBoundingClientRect()),resizeDir:o.dataset.resizeHandle}),!WA.currentRect))return!1;qb("resize"),r?WA.boundaryRect=r:null!=t&&t.current&&(WA.boundaryRect=HA(t.current.getBoundingClientRect())),WA.currentRect&&WA.boundaryRect&&(WA.currentRect.left-=WA.boundaryRect.left,WA.currentRect.top-=WA.boundaryRect.top),WA.initialAspectRatio=WA.currentRect.width/WA.currentRect.height,null==(i=a.onResizeStart)||i.call(a,UA({rect:WA.currentRect,e:e}))},onMove:(t,r,n)=>{var s;if(!WA.resizeDir||!WA.currentRect)return;const l="initial"===e?WA.initialAspectRatio:e,c=function(e,t,r,n){const i={...e},o={...e};return"topRight"===WA.resizeDir?(o.width=Math.floor(o.width+t),o.height=n?Math.floor(o.width/n):Math.floor(o.height-r),o.top=Math.floor(o.top+(i.height-o.height))):"bottomRight"===WA.resizeDir?(o.width=Math.floor(o.width+t),o.height=n?Math.floor(o.width/n):Math.floor(o.height+r)):"topLeft"===WA.resizeDir?(o.width=Math.floor(o.width-t),o.height=n?Math.floor(o.width/n):Math.floor(o.height-r),o.left=Math.floor(o.left+(i.width-o.width)),o.top=Math.floor(o.top+(i.height-o.height))):"bottomLeft"===WA.resizeDir&&(o.width=Math.floor(o.width-t),o.height=n?Math.floor(o.width/n):Math.floor(o.height+r),o.left=Math.floor(o.left+t)),o}(WA.currentRect,r,n,l),u=function(e,t,r,n){const i="bottomLeft"===WA.resizeDir||"topLeft"===WA.resizeDir,o="topRight"===WA.resizeDir||"topLeft"===WA.resizeDir;let a={...e};a.width=Math.max(t,e.width),a.height=Math.max(r,e.height);const s=a.width-e.width;i&&s>0&&(a.left-=s);const l=a.height-e.height;if(o&&l>0&&(a.top-=l),WA.boundaryRect&&(a=function(e,t){const r={...e};r.left=Math.max(0,r.left);const n=r.left-e.left;n>0&&(r.width-=n),r.top=Math.max(0,r.top);const i=r.top-e.top;return i>0&&(r.height-=i),r.width=Math.min(r.width,t.width-r.left),r.height=Math.min(r.height,t.height-r.top),r}(a,WA.boundaryRect)),n){const e=a.width,t=a.height,r=kw(n,a.width,a.height);a.width=r.width,a.height=r.height,o&&(a.top+=t-a.height),i&&(a.left+=e-a.width)}return a}(c,i,o,l);null==(s=a.onResize)||s.call(a,UA({rect:u,e:t,deltaX:r,deltaY:n})),WA.currentRect=c},onMoveEnd:e=>{var t;WA.currentRect&&(null==(t=a.onResizeEnd)||t.call(a,UA({rect:WA.currentRect,e:e}))),GA()}},{domProps:l}=VA(s);return{resizeProps:l}}function YA({position:e,inset:t=!1}){const r=function(e,t){const r=t?"left-0":"-left-5",n=t?"top-0":"-top-5",i=t?"bottom-0":"-bottom-5",o=t?"right-0":"-right-5";switch(e){case $A.topLeft:return`${r} ${n} border-l-4 border-t-4 cursor-nwse-resize`;case $A.topRight:return`${o} ${n} border-r-4 border-t-4 cursor-nesw-resize`;case $A.bottomRight:return`${o} ${i} border-r-4 border-b-4 cursor-se-resize`;case $A.bottomLeft:return`${r} ${i} border-l-4 border-b-4 cursor-sw-resize`;default:return""}}(e,t);return(0,i.jsx)("div",{"data-resize-handle":e,className:`border-white absolute w-20 h-20 ${r}`})}var XA=(e=>(e.top="maskTop",e.right="maskRight",e.bottom="maskBottom",e.left="maskLeft",e))(XA||{});function KA({position:e,refs:t}){const r=function(e){switch(e){case"maskTop":return"left-0 top-0";case"maskBottom":return"bottom-0 left-0";default:return""}}(e);return(0,i.jsx)("div",{className:`cropzone-transition bg-black/50 bottom absolute ${r}`,ref:r=>t.current[e]=r})}function ZA({name:e,refs:t}){const r=od("cropzone-transition pointer-events-none absolute left-0 top-0 bg-white/50",e.startsWith("lineHor")?"h-px":"w-px");return(0,i.jsx)("div",{className:r,ref:r=>{t.current[e]=r}})}function JA(e,t,r){return Math.min(Math.max(e,t),r)}let QA={};function ek({boundaryRef:e,boundaryRect:t,minimumMovement:r,restrictWithinBoundary:n=!0,...i}){const o={minimumMovement:r,onMoveStart:(r,n)=>{var o;if(Gb)return!1;QA={currentRect:HA(n.getBoundingClientRect())},qb("move"),t?QA.boundaryRect=t:null!=e&&e.current&&(QA.boundaryRect=HA(e.current.getBoundingClientRect())),QA.currentRect&&QA.boundaryRect&&(QA.currentRect.left-=QA.boundaryRect.left,QA.currentRect.top-=QA.boundaryRect.top),null==(o=i.onMoveStart)||o.call(i,UA({rect:QA.currentRect,e:r}))},onMove:(e,t,r)=>{var o;if(!QA.currentRect)return;const a={...QA.currentRect,left:QA.currentRect.left+t,top:QA.currentRect.top+r},s={...a};QA.boundaryRect&&n&&(s.left=JA(a.left,0,QA.boundaryRect.width-a.width),s.top=JA(a.top,0,QA.boundaryRect.height-a.height)),null==(o=i.onMove)||o.call(i,UA({rect:s,e:e,deltaX:t,deltaY:r})),QA.currentRect=a},onMoveEnd:e=>{var t;QA.currentRect&&(null==(t=i.onMoveEnd)||t.call(i,UA({rect:QA.currentRect,e:e})),qb(null),QA={})}},{domProps:a}=VA(o);return{moveProps:a}}function tk(){const e=(0,o.useRef)({}),[t,r]=(0,o.useState)(!0),n=vp(e=>e.canvasSize),a=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.crop)?void 0:r.cropzone}),s=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.crop)?void 0:r.defaultRatio})||null,l=vp(e=>e.crop.selectedAspectRatio)||null,{moveProps:c}=ek({boundaryRect:n,onMoveStart:()=>r(!0),onMove:e=>bp().crop.drawZone(e.rect),onMoveEnd:()=>r(!1)}),{resizeProps:u}=qA({boundaryRect:n,minHeight:50,minWidth:50,aspectRatio:Ew(l),onResizeStart:()=>r(!0),onResize:e=>bp().crop.drawZone(e.rect),onResizeEnd:()=>r(!1)});(0,o.useLayoutEffect)(()=>{bp().crop.registerRefs(e),bp().crop.resetCropzone(s)},[s,n]);const d=od("cropzone absolute z-cropzone isolate left-0 top-0 w-full h-full overflow-hidden",t&&"moving");return(0,i.jsxs)("div",{className:d,onPointerDown:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,i.jsxs)("div",{className:"cropzone-transition border-white/50 absolute z-10 left-0 top-0 border",...Eb(u,c),ref:t=>e.current.innerZone=t,children:[!(null!=a&&a.hideTopLeft)&&(0,i.jsx)(YA,{position:$A.topLeft,inset:!0}),!(null!=a&&a.hideTopRight)&&(0,i.jsx)(YA,{position:$A.topRight,inset:!0}),!(null!=a&&a.hideBottomLeft)&&(0,i.jsx)(YA,{position:$A.bottomLeft,inset:!0}),!(null!=a&&a.hideBottomRight)&&(0,i.jsx)(YA,{position:$A.bottomRight,inset:!0}),(0,i.jsx)(ZA,{name:"lineVer1",refs:e}),(0,i.jsx)(ZA,{name:"lineVer2",refs:e}),(0,i.jsx)(ZA,{name:"lineHor1",refs:e}),(0,i.jsx)(ZA,{name:"lineHor2",refs:e})]}),(0,i.jsx)(KA,{refs:e,position:XA.top}),(0,i.jsx)(KA,{refs:e,position:XA.left}),(0,i.jsx)(KA,{refs:e,position:XA.right}),(0,i.jsx)(KA,{refs:e,position:XA.bottom})]})}const rk=ld((0,i.jsx)("path",{d:"M 7 2 C 6.448 2 6 2.448 6 3 C 6 3.552 6.448 4 7 4 L 20 4 L 20 17 C 20 17.552 20.448 18 21 18 C 21.552 18 22 17.552 22 17 L 22 4 C 22 2.895 21.105 2 20 2 L 7 2 z M 4 6 C 2.895 6 2 6.895 2 8 L 2 20 C 2 21.105 2.895 22 4 22 L 16 22 C 17.105 22 18 21.105 18 20 L 18 8 C 18 6.895 17.105 6 16 6 L 4 6 z M 10 10 C 10.552 10 11 10.448 11 11 L 11 13 L 13 13 C 13.552 13 14 13.448 14 14 C 14 14.552 13.552 15 13 15 L 11 15 L 11 17 C 11 17.552 10.552 18 10 18 C 9.448 18 9 17.552 9 17 L 9 15 L 7 15 C 6.448 15 6 14.552 6 14 C 6 13.448 6.448 13 7 13 L 9 13 L 9 11 C 9 10.448 9.448 10 10 10 z"})),nk=ld((0,i.jsx)("path",{d:"M 11 3 L 2 21 L 11 21 L 11 3 z M 13 3 L 13 21 L 22 21 L 13 3 z M 9 11.472656 L 9 19 L 5.2363281 19 L 9 11.472656 z"})),ik=ld((0,i.jsx)("path",{d:"M 16.476562 2.4511719 C 16.392047 2.4657656 16.308531 2.5061719 16.238281 2.5761719 L 14.130859 4.6835938 C 13.956859 4.8575938 13.956859 5.1394531 14.130859 5.3144531 L 16.238281 7.4238281 C 16.519281 7.7048281 17 7.5054219 17 7.1074219 L 17 6 L 20 6 L 20 9 A 1.0001 1.0001 0 1 0 22 9 L 22 6 C 22 4.9069372 21.093063 4 20 4 L 17 4 L 17 2.8925781 C 17 2.5940781 16.730109 2.4073906 16.476562 2.4511719 z M 4 5 C 2.9069372 5 2 5.9069372 2 7 L 2 14 C 2 15.093063 2.9069372 16 4 16 L 7 16 L 7 19 C 7 20.105 7.895 21 9 21 L 16 21 C 17.105 21 18 20.105 18 19 L 18 12 C 18 10.895 17.105 10 16 10 L 13 10 L 13 7 C 13 5.9069372 12.093063 5 11 5 L 4 5 z M 4 7 L 11 7 L 11 14 L 4 14 L 4 7 z"})),ok=ld((0,i.jsx)("path",{d:"M 10 2 L 9 3 L 3 3 L 3 5 L 21 5 L 21 3 L 15 3 L 14 2 L 10 2 z M 4.3652344 7 L 5.8925781 20.263672 C 6.0245781 21.253672 6.877 22 7.875 22 L 16.123047 22 C 17.121047 22 17.974422 21.254859 18.107422 20.255859 L 19.634766 7 L 4.3652344 7 z"})),ak={width:120,height:30},sk=[{name:"Duplicate",icon:rk,onClick:()=>{bp().objects.duplicate()}},{name:"Flip",icon:nk,onClick:()=>{bp().objects.flipHorizontally()}},{name:"Bring to front",icon:ik,onClick:()=>{bp().objects.bringToFront()}},{name:"Delete",icon:ok,onClick:()=>{bp().objects.delete()}}],lk=o.forwardRef((e,t)=>{const r=vp(e=>e.objects.active.isMoving)?"opacity-0":"opacity-100";return(0,i.jsx)("div",{ref:t,className:`${r} absolute z-obj-box left-0 top-0 flex items-center text-white bg-controls rounded shadow transition-opacity overflow-hidden`,children:sk.map(e=>{const t=e.icon;return(0,i.jsx)(bS,{size:"sm",className:"w-30 h-30 hover:bg-white/hover",radius:"rounded-none",onClick:e.onClick,children:(0,i.jsx)(t,{})},e.name)})})});function ck(e,t){const r=bp().objects.getActive();if(!r||!e.current)return;const n=e.current,i=Vb.fabric.util.degreesToRadians(r.angle??0);let o=Math.round(r.getScaledWidth()*yp().zoom),a=Math.round(r.getScaledHeight()*yp().zoom),s=Math.round((r.left??0)*yp().zoom),l=Math.round((r.top??0)*yp().zoom);const c="center"===r.originX?o/2:0,u="center"===r.originY?a/2:0;r.padding&&(o+=2*r.padding,a+=2*r.padding,s-=r.padding,l-=r.padding),n.style.width=`${o}px`,n.style.height=`${a}px`,n.style.transform=`translate(${s-c}px, ${l-u}px) rotate(${i}rad)`,bp().canvas.render(),function(e,t){if(!t)return;const r=e.angle||0,n=r>168&&r<188?-30:-15,i=yp().canvasSize,o=yp().stageSize,a=ak,s=i.top-o.top,l=i.left-o.left,c=o.width-(l+i.width),u=o.height-(s+i.height),d=-s,h=-(i.left-o.left),f=i.width-a.width+c,p=i.height-a.height+u,g=e.getBoundingRect();let m=g.top-a.height+n,v=g.left+g.width/2-a.width/2;m=Math.min(p,Math.max(d,m)),v=Math.min(f,Math.max(h,v)),t.style.transform=`translate(${v}px, ${m}px) rotate(0deg)`}(r,t.current)}function uk(){return(0,i.jsx)("div",{className:"absolute -bottom-20 left-1/2 w-2 h-20 bg-white cursor-default -translate-x-1/2",children:(0,i.jsx)("div",{"data-rotate-handle":!0,className:"w-18 h-18 absolute -bottom-10 -left-8 bg-white rounded-full cursor-move"})})}let dk={};function hk(e){const t=dk.centerX||0,r=dk.centerY||0;return Math.atan2(r-e.pageY,t-e.pageX)-(dk.startAngle||0)}const fk=(e={})=>{qb(null),dk=e};function pk(){const e=(0,o.useRef)(null),t=(0,o.useRef)(null),r=vp(e=>e.objects.active.id),n=vp(e=>e.objects.isEditingText),a=vp(e=>e.zoom),s=function(){const e=bp().objects.getActive();if(!e||!e.name)return{};const t=yp().config.objectControls||{},r=e.name;return{...t.global,...t[r]}}(),l=(0,o.useRef)(null),c=(0,o.useCallback)(()=>{l.current?(clearTimeout(l.current),l.current=null,function(){var e;const t=bp().objects.getActive();hf(t)&&(t.enterEditing(),null==(e=t.hiddenTextarea)||e.focus())}()):l.current=setTimeout(()=>{l.current=null},300)},[]);let{moveProps:u}=ek({boundaryRef:yp().canvasRef,restrictWithinBoundary:!1,onMoveEnd:()=>{yp().objects.setActiveIsMoving(!1)},onMove:e=>{yp().objects.setActiveIsMoving(!0),function(e){const t=e.rect.width/2,r=e.rect.height/2;bp().objects.setValues({left:(e.rect.left+t)/yp().zoom,top:(e.rect.top+r)/yp().zoom})}(e)}});s.lockMovement&&(u={});const{resizeProps:d}=qA({minWidth:50,minHeight:50,aspectRatio:s.unlockAspectRatio?null:"initial",boundaryRef:s.containWithinCanvas?yp().canvasRef:void 0,restrictWithinBoundary:!1,onResizeEnd:()=>{yp().objects.setActiveIsMoving(!1)},onResize:e=>{yp().objects.setActiveIsMoving(!0),function(e){const t=bp().objects.getActive();if(!t)return;const r={};hf(t)?(e.deltaX>0||t.getScaledHeight()>=20&&t.getScaledWidth()>=20)&&(r.fontSize=(t.fontSize||1)+e.deltaX):(t.width&&(r.scaleX=e.rect.width/yp().zoom/t.width),t.height&&(r.scaleY=e.rect.height/yp().zoom/t.height)),bp().objects.setValues(r)}(e)}}),{rotateProps:h}=function(e){const t={onMoveStart:(t,r)=>{var n,i;if(!t.target.dataset.rotateHandle||Gb)return!1;const o=HA(r.getBoundingClientRect());if(!o)return!1;const a=null==(n=r.style.transform.match(/rotate\((.+?)\)/))?void 0:n[1],[s="0"]=a?a.split(","):[];fk({currentRect:o,centerX:o.left+o.width/2,centerY:o.top+o.height/2,startAngle:parseFloat(s)}),qb("rotate"),dk.startAngle=hk(t),null==(i=e.onRotateStart)||i.call(e,UA({rect:o,e:t}))},onMove:(t,r,n)=>{var i;if(!dk.currentRect)return;const o={...dk.currentRect};o.angle=hk(t),o.left+=r,o.top+=n,null==(i=e.onRotate)||i.call(e,UA({rect:o,e:t,deltaX:r,deltaY:n})),dk.currentRect=o},onMoveEnd:t=>{var r;dk.currentRect&&(null==(r=e.onRotateEnd)||r.call(e,UA({rect:dk.currentRect,e:t}))),fk()}},{domProps:r}=VA(t);return{rotateProps:r}}({boundaryRef:yp().canvasRef,onRotateEnd:()=>{yp().objects.setActiveIsMoving(!1)},onRotate:e=>{yp().objects.setActiveIsMoving(!0),function(e){const t=bp().objects.getActive();if(!t||!e.rect.angle)return;const r=Vb.fabric.util.radiansToDegrees(e.rect.angle);r!==t.angle&&bp().objects.setValues({angle:r})}(e)}});return(0,o.useEffect)(()=>{wp()&&yp().editor.on("object:modified",r=>{r.sizeOrPositionChanged&&ck(e,t)})},[]),(0,o.useEffect)(()=>{ck(e,t)},[r,a,n]),(0,i.jsxs)("div",{className:r&&!n?"block":"hidden",children:[(0,i.jsxs)("div",{ref:e,...Eb(h,d,u),onClick:c,className:"absolute z-obj-box border-2 border-white shadow-md cursor-move",children:[!s.hideTopLeft&&(0,i.jsx)(YA,{position:$A.topLeft}),!s.hideTopRight&&(0,i.jsx)(YA,{position:$A.topRight}),!s.hideBottomLeft&&(0,i.jsx)(YA,{position:$A.bottomLeft}),!s.hideBottomRight&&(0,i.jsx)(YA,{position:$A.bottomRight}),!s.hideRotatingPoint&&(0,i.jsx)(uk,{})]}),(0,i.jsx)(lk,{ref:t})]})}function gk(){const e=vp(e=>e.activeTool===nd.CROP),t=vp(e=>e.objects.active.id);return(0,i.jsxs)("div",{children:[e&&(0,i.jsx)(tk,{}),t&&(0,i.jsx)(pk,{})]})}const mk=function(e){return e.forEach(IA),function(e,t){const{handlers:r,nativeHandlers:n,config:i}=function(e,t){const[r,n,i]=function(e){const t={},r={},n=new Set;for(let i in e)zA.test(i)?(n.add(RegExp.lastMatch),r[i]=e[i]):t[i]=e[i];return[r,t,n]}(e),o={};return BA(i,r,"onDrag","drag",o,t),BA(i,r,"onWheel","wheel",o,t),BA(i,r,"onScroll","scroll",o,t),BA(i,r,"onPinch","pinch",o,t),BA(i,r,"onMove","move",o,t),BA(i,r,"onHover","hover",o,t),{handlers:o,config:t,nativeHandlers:n}}(e,t||{});return function(e,t={},r,n){const i=o.useMemo(()=>new LA(e),[]);if(i.applyHandlers(e,n),i.applyConfig(t,r),o.useEffect(i.effect.bind(i)),o.useEffect(()=>i.clean.bind(i),[]),void 0===t.target)return i.bind.bind(i)}(r,i,void 0,n)}}([jA,TA]),vk=o.forwardRef((e,t)=>{const[r,n]=(0,o.useState)(!1);return(0,o.useEffect)(()=>vp.subscribe(e=>e.loading,e=>{n(!e)}),[]),(0,i.jsx)(yk,{children:(0,i.jsxs)(ob.div,{initial:{opacity:0},variants:{visible:{opacity:1,transition:{duration:.35,delay:.5}},hidden:{opacity:0,transition:{duration:0}}},animate:r?"visible":"hidden",className:"relative m-auto w-max",style:{backgroundImage:`url(${sw("images/empty-canvas-bg.png")})`},children:[(0,i.jsx)(gk,{}),(0,i.jsx)("canvas",{ref:t})]})})});function yk({children:e}){const t=(0,o.useRef)(null),r=mk({onPinch:e=>{if(!bp().zoom.allowUserZoom||!bk(e))return e.cancel();1===e.direction[0]?bp().zoom.zoomIn(.01):bp().zoom.zoomOut(.01),e.event.stopPropagation(),e.event.preventDefault()},onDrag:e=>{if(e.pinching||!bk(e))return e.cancel();t.current.scrollLeft-=e.delta[0],t.current.scrollTop-=e.delta[1]}});return(0,i.jsx)("div",{ref:t,className:"w-full h-full overflow-hidden touch-none flex",...r(),children:e})}function bk(e){return!(wp().findTarget(e.event,!1)||wp().isDrawingMode)}function wk({actionBtn:e,children:t,className:r}){return(0,i.jsxs)("div",{className:od(r,"flex gap-16 items-center h-full"),children:[e&&(0,i.jsx)("div",{className:"flex-shrink-0",children:e}),(0,i.jsx)("div",{className:"w-full flex-auto",children:t}),e&&(0,i.jsx)("div",{className:"w-96"})]})}function xk(){return(xk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Ck(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}function _k(e){var t=(0,o.useRef)(e),r=(0,o.useRef)(function(e){t.current&&t.current(e)});return t.current=e,r.current}var Sk,Ak,kk,Ek,Ik,jk,Tk,Fk,Ok,Pk,Mk,Rk,Lk,Nk,Dk,zk,Bk,Uk,Vk,Hk,$k,Wk,Gk,qk,Yk,Xk,Kk,Zk,Jk,Qk,eE,tE,rE,nE,iE,oE=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e<t?t:e},aE=function(e){return"touches"in e},sE=function(e){return e&&e.ownerDocument.defaultView||self},lE=function(e,t,r){var n=e.getBoundingClientRect(),i=aE(t)?function(e,t){for(var r=0;r<e.length;r++)if(e[r].identifier===t)return e[r];return e[0]}(t.touches,r):t;return{left:oE((i.pageX-(n.left+sE(e).pageXOffset))/n.width),top:oE((i.pageY-(n.top+sE(e).pageYOffset))/n.height)}},cE=function(e){!aE(e)&&e.preventDefault()},uE=o.memo(function(e){var t=e.onMove,r=e.onKey,n=Ck(e,["onMove","onKey"]),i=(0,o.useRef)(null),a=_k(t),s=_k(r),l=(0,o.useRef)(null),c=(0,o.useRef)(!1),u=(0,o.useMemo)(function(){var e=function(e){cE(e),(aE(e)?e.touches.length>0:e.buttons>0)&&i.current?a(lE(i.current,e,l.current)):r(!1)},t=function(){return r(!1)};function r(r){var n=c.current,o=sE(i.current),a=r?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",t)}return[function(e){var t,n=e.nativeEvent,o=i.current;if(o&&(cE(n),t=n,(!c.current||aE(t))&&o)){if(aE(n)){c.current=!0;var s=n.changedTouches||[];s.length&&(l.current=s[0].identifier)}o.focus(),a(lE(o,n,l.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},r]},[s,a]),d=u[0],h=u[1],f=u[2];return(0,o.useEffect)(function(){return f},[f]),o.createElement("div",xk({},n,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),dE=function(e){return e.filter(Boolean).join(" ")},hE=function(e){var t=e.color,r=e.left,n=e.top,i=void 0===n?.5:n,a=dE(["react-colorful__pointer",e.className]);return o.createElement("div",{className:a,style:{top:100*i+"%",left:100*r+"%"}},o.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},fE=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},pE=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?fE(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?fE(parseInt(e.substring(6,8),16)/255,2):1}},gE=function(e){var t=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:fE(e.h),s:fE(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:fE(i/2),a:fE(n,2)}}(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},mE=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},vE=o.memo(function(e){var t=e.hue,r=e.onChange,n=dE(["react-colorful__hue",e.className]);return o.createElement("div",{className:n},o.createElement(uE,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:oE(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":fE(t),"aria-valuemax":"360","aria-valuemin":"0"},o.createElement(hE,{className:"react-colorful__hue-pointer",left:t/360,color:gE({h:t,s:100,v:100,a:1})})))}),yE=o.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:gE({h:t.h,s:100,v:100,a:1})};return o.createElement("div",{className:"react-colorful__saturation",style:n},o.createElement(uE,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:oE(t.s+100*e.left,0,100),v:oE(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+fE(t.s)+"%, Brightness "+fE(t.v)+"%"},o.createElement(hE,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:gE(t)})))}),bE=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},wE=typeof window<"u"?o.useLayoutEffect:o.useEffect,xE=new Map,CE=function(e){var t=e.className,n=e.colorModel,i=e.color,a=void 0===i?n.defaultColor:i,s=e.onChange,l=Ck(e,["className","colorModel","color","onChange"]),c=(0,o.useRef)(null);!function(e){wE(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!xE.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',xE.set(t,n);var i=r.nc;i&&n.setAttribute("nonce",i),t.head.appendChild(n)}},[])}(c);var u=function(e,t,r){var n=_k(r),i=(0,o.useState)(function(){return e.toHsva(t)}),a=i[0],s=i[1],l=(0,o.useRef)({color:t,hsva:a});(0,o.useEffect)(function(){if(!e.equal(t,l.current.color)){var r=e.toHsva(t);l.current={hsva:r,color:t},s(r)}},[t,e]),(0,o.useEffect)(function(){var t;bE(a,l.current.hsva)||e.equal(t=e.fromHsva(a),l.current.color)||(l.current={hsva:a,color:t},n(t))},[a,e,n]);var c=(0,o.useCallback)(function(e){s(function(t){return Object.assign({},t,e)})},[]);return[a,c]}(n,a,s),d=u[0],h=u[1],f=dE(["react-colorful",t]);return o.createElement("div",xk({},l,{ref:c,className:f}),o.createElement(yE,{hsva:d,onChange:h}),o.createElement(vE,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},_E={defaultColor:"000",toHsva:function(e){return function(e){var t=e.r,r=e.g,n=e.b,i=e.a,o=Math.max(t,r,n),a=o-Math.min(t,r,n),s=a?o===t?(r-n)/a:o===r?2+(n-t)/a:4+(t-r)/a:0;return{h:fE(60*(s<0?s+6:s)),s:fE(o?a/o*100:0),v:fE(o/255*100),a:i}}(pE(e))},fromHsva:function(e){return function(e){return function(e){var t=e.r,r=e.g,n=e.b,i=e.a,o=i<1?mE(fE(255*i)):"";return"#"+mE(t)+mE(r)+mE(n)+o}(function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var o=Math.floor(t),a=n*(1-r),s=n*(1-(t-o)*r),l=n*(1-(1-t+o)*r),c=o%6;return{r:fE(255*[n,s,a,a,l,n][c]),g:fE(255*[l,n,n,s,a,a][c]),b:fE(255*[a,a,l,n,n,s][c]),a:fE(i,2)}}(e))}({h:e.h,s:e.s,v:e.v,a:1})},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||bE(pE(e),pE(t))}},SE=function(e){return o.createElement(CE,xk({},e,{colorModel:_E}))},AE=/^#?([0-9A-F]{3,8})$/i,kE=function(e){var t=e.color,r=void 0===t?"":t,n=e.onChange,i=e.onBlur,a=e.escape,s=e.validate,l=e.format,c=e.process,u=Ck(e,["color","onChange","onBlur","escape","validate","format","process"]),d=(0,o.useState)(function(){return a(r)}),h=d[0],f=d[1],p=_k(n),g=_k(i),m=(0,o.useCallback)(function(e){var t=a(e.target.value);f(t),s(t)&&p(c?c(t):t)},[a,c,s,p]),v=(0,o.useCallback)(function(e){s(e.target.value)||f(a(r)),g(e)},[r,a,s,g]);return(0,o.useEffect)(function(){f(a(r))},[r,a]),o.createElement("input",xk({},u,{value:l?l(h):h,spellCheck:"false",onChange:m,onBlur:v}))},EE=function(e){return"#"+e},IE=function(e){var t=e.prefixed,r=e.alpha,n=Ck(e,["prefixed","alpha"]),i=(0,o.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,r?8:6)},[r]),a=(0,o.useCallback)(function(e){return function(e,t){var r=AE.exec(e),n=r?r[1].length:0;return 3===n||6===n||!!t&&4===n||!!t&&8===n}(e,r)},[r]);return o.createElement(kE,xk({},n,{escape:i,format:t?EE:void 0,process:EE,validate:a}))};Sk={alpha:"\u0623\u0644\u0641\u0627",black:"\u0623\u0633\u0648\u062f",blue:"\u0623\u0632\u0631\u0642","blue purple":"\u0623\u0631\u062c\u0648\u0627\u0646\u064a \u0645\u0632\u0631\u0642",brightness:"\u0627\u0644\u0633\u0637\u0648\u0639",brown:"\u0628\u0646\u064a","brown yellow":"\u0623\u0635\u0641\u0631 \u0628\u0646\u064a",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0633\u0645\u0627\u0648\u064a","cyan blue":"\u0623\u0632\u0631\u0642 \u0633\u0645\u0627\u0648\u064a",dark:"\u062f\u0627\u0643\u0646",gray:"\u0631\u0645\u0627\u062f\u064a",grayish:"\u0645\u0627\u0626\u0644 \u0644\u0644\u0631\u0645\u0627\u062f\u064a",green:"\u0623\u062e\u0636\u0631","green cyan":"\u0633\u0645\u0627\u0648\u064a \u0645\u062e\u0636\u0631",hue:"\u062f\u0631\u062c\u0629 \u0627\u0644\u0644\u0648\u0646",light:"\u0641\u0627\u062a\u062d",lightness:"\u0627\u0644\u0625\u0636\u0627\u0621\u0629",magenta:"\u0623\u0631\u062c\u0648\u0627\u0646\u064a","magenta pink":"\u0623\u0631\u062c\u0648\u0627\u0646\u064a \u0648\u0631\u062f\u064a",orange:"\u0628\u0631\u062a\u0642\u0627\u0644\u064a","orange yellow":"\u0623\u0635\u0641\u0631 \u0628\u0631\u062a\u0642\u0627\u0644\u064a",pale:"\u0628\u0627\u0647\u062a",pink:"\u0648\u0631\u062f\u064a","pink red":"\u0623\u062d\u0645\u0631 \u0648\u0631\u062f\u064a",purple:"\u0623\u0631\u062c\u0648\u0627\u0646\u064a","purple magenta":"\u0628\u0646\u0641\u0633\u062c\u064a",red:"\u0623\u062d\u0645\u0631","red orange":"\u0628\u0631\u062a\u0642\u0627\u0644\u064a \u0645\u062d\u0645\u0631",saturation:"\u0627\u0644\u062a\u0634\u0628\u0639",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u0634\u0641\u0627\u0641`,"very dark":"\u062f\u0627\u0643\u0646 \u062c\u062f\u064b\u0627","very light":"\u0641\u0627\u062a\u062d \u062c\u062f\u064b\u0627",vibrant:"\u0633\u0627\u0637\u0639",white:"\u0623\u0628\u064a\u0636",yellow:"\u0623\u0635\u0641\u0631","yellow green":"\u0623\u062e\u0636\u0631 \u0645\u0635\u0641\u0631"},Ak={alpha:"\u0410\u043b\u0444\u0430",black:"\u0447\u0435\u0440\u043d\u043e",blue:"\u0421\u0438\u043d\u044c\u043e","blue purple":"\u0441\u0438\u043d\u044c\u043e \u043b\u0438\u043b\u0430\u0432\u043e",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442",brown:"\u043a\u0430\u0444\u044f\u0432\u043e","brown yellow":"\u043a\u0430\u0444\u044f\u0432\u043e \u0436\u044a\u043b\u0442\u043e",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0446\u0438\u0430\u043d","cyan blue":"\u0446\u0438\u0430\u043d \u0441\u0438\u043d\u044c\u043e",dark:"\u0442\u044a\u043c\u043d\u043e",gray:"\u0441\u0438\u0432\u043e",grayish:"\u0441\u0438\u0432\u043a\u0430\u0432",green:"\u0417\u0435\u043b\u0435\u043d\u043e","green cyan":"\u0437\u0435\u043b\u0435\u043d \u0446\u0438\u0430\u043d",hue:"\u041e\u0442\u0442\u0435\u043d\u044a\u043a",light:"\u0441\u0432\u0435\u0442\u043b\u043e",lightness:"\u041b\u0435\u043a\u043e\u0442\u0430",magenta:"\u043c\u0430\u0433\u0435\u043d\u0442\u0430","magenta pink":"\u043c\u0430\u0433\u0435\u043d\u0442\u0430 \u0440\u043e\u0437\u043e\u0432\u043e",orange:"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e","orange yellow":"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e \u0436\u044a\u043b\u0442\u043e",pale:"\u0431\u043b\u0435\u0434\u043e",pink:"\u0440\u043e\u0437\u043e\u0432\u043e","pink red":"\u0440\u043e\u0437\u043e\u0432\u043e \u0447\u0435\u0440\u0432\u0435\u043d\u043e",purple:"\u043b\u0438\u043b\u0430\u0432\u043e","purple magenta":"\u043b\u0438\u043b\u0430\u0432\u043e \u043c\u0430\u0433\u0435\u043d\u0442\u0430",red:"\u0427\u0435\u0440\u0432\u0435\u043d\u043e","red orange":"\u0447\u0435\u0440\u0432\u0435\u043d \u043f\u043e\u0440\u0442\u043e\u043a\u0430\u043b",saturation:"\u041d\u0430\u0441\u0438\u0442\u0435\u043d\u043e\u0441\u0442",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u0435\u043d`,"very dark":"\u043c\u043d\u043e\u0433\u043e \u0442\u044a\u043c\u043d\u043e","very light":"\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u043b\u043e",vibrant:" \u044f\u0440\u043a\u043e",white:"\u0431\u044f\u043b\u043e",yellow:"\u0436\u044a\u043b\u0442\u043e","yellow green":"\u0436\u044a\u043b\u0442\u043e \u0437\u0435\u043b\u0435\u043d"},kk={alpha:"Alfa",black:"\u010dern\xe1",blue:"Modr\xe1","blue purple":"modrofialov\xe1",brightness:"Jas",brown:"hn\u011bd\xe1","brown yellow":"hn\u011bdo\u017elut\xe1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"tyrkysov\xe1","cyan blue":"tyrkysovomodr\xe1",dark:"tmav\xe1",gray:"\u0161ed\xe1",grayish:"na\u0161edl\xe1",green:"Zelen\xe1","green cyan":"zelenotyrkysov\xe1",hue:"Odst\xedn",light:"sv\u011btl\xe1",lightness:"Sv\u011btlost",magenta:"purpurov\xe1","magenta pink":"purpurov\u011b r\u016f\u017eov\xe1",orange:"oran\u017eov\xe1","orange yellow":"oran\u017eovo\u017elut\xe1",pale:"bled\xe1",pink:"r\u016f\u017eov\xe1","pink red":"r\u016f\u017eovo\u010derven\xe1",purple:"fialov\xe1","purple magenta":"fialov\u011b purpurov\xe1",red:"\u010cerven\xe1","red orange":"\u010dervenooran\u017eov\xe1",saturation:"Sytost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} pr\u016fhledn\xe9`,"very dark":"velmi tmav\xe1","very light":"velmi sv\u011btl\xe1",vibrant:"z\xe1\u0159iv\xe1",white:"b\xedl\xe1",yellow:"\u017elut\xe1","yellow green":"\u017elutozelen\xe1"},Ek={alpha:"Alfa",black:"sort",blue:"Bl\xe5","blue purple":"bl\xe5lilla",brightness:"Lysstyrke",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyan bl\xe5",dark:"m\xf8rk",gray:"gr\xe5",grayish:"gr\xe5lig",green:"Gr\xf8n","green cyan":"gr\xf8n cyan",hue:"Tone",light:"lys",lightness:"Lyshed",magenta:"magenta","magenta pink":"magenta pink",orange:"orange","orange yellow":"orangegul",pale:"bleg",pink:"lyser\xf8d","pink red":"lyser\xf8dlig r\xf8d",purple:"lilla","purple magenta":"lilla magenta",red:"R\xf8d","red orange":"r\xf8dorange",saturation:"Farvem\xe6tning",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gennemsigtig`,"very dark":"meget m\xf8rk","very light":"meget lys",vibrant:"klar",white:"hvid",yellow:"gul","yellow green":"gulgr\xf8n"},Ik={alpha:"Alpha",black:"Schwarz",blue:"Blau","blue purple":"Blaulila",brightness:"Helligkeit",brown:"Braun","brown yellow":"Braungelb",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"Cyan","cyan blue":"Cyanblau",dark:"dunkles",gray:"Grau",grayish:"gr\xe4uliches",green:"Gr\xfcn","green cyan":"Gr\xfcncyan",hue:"Farbton",light:"helles",lightness:"Leuchtkraft",magenta:"Magenta","magenta pink":"Magentarosa",orange:"Orange","orange yellow":"Orangegelb",pale:"blasses",pink:"Rosa","pink red":"Rosarot",purple:"Lila","purple magenta":"Lilamagenta",red:"Rot","red orange":"Rotorange",saturation:"S\xe4ttigung",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, zu ${e.percentTransparent} transparent`,"very dark":"sehr dunkles","very light":"sehr helles",vibrant:"lebhaftes",white:"Wei\xdf",yellow:"Gelb","yellow green":"Gelbgr\xfcn"},jk={alpha:"\u0386\u03bb\u03c6\u03b1",black:"\u03bc\u03b1\u03cd\u03c1\u03bf",blue:"\u039c\u03c0\u03bb\u03b5","blue purple":"\u03bc\u03c0\u03bb\u03b5 \u03bc\u03c9\u03b2",brightness:"\u03a6\u03c9\u03c4\u03b5\u03b9\u03bd\u03cc\u03c4\u03b7\u03c4\u03b1",brown:"\u03ba\u03b1\u03c6\u03ad","brown yellow":"\u03ba\u03b1\u03c6\u03ad \u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u03ba\u03c5\u03b1\u03bd\u03cc","cyan blue":"\u03ba\u03c5\u03b1\u03bd\u03cc \u03bc\u03c0\u03bb\u03b5",dark:"\u03c3\u03ba\u03bf\u03cd\u03c1\u03bf",gray:"\u03b3\u03ba\u03c1\u03b9",grayish:"\u03b3\u03ba\u03c1\u03b9\u03b6\u03c9\u03c0\u03cc",green:"\u03a0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf","green cyan":"\u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf \u03ba\u03c5\u03b1\u03bd\u03cc",hue:"\u03a4\u03cc\u03bd\u03bf\u03c2",light:"\u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",lightness:"\u03a6\u03c9\u03c4\u03b5\u03b9\u03bd\u03cc\u03c4\u03b7\u03c4\u03b1",magenta:"\u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1","magenta pink":"\u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1 \u03c1\u03bf\u03b6",orange:"\u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af","orange yellow":"\u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af \u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf",pale:"\u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",pink:"\u03c1\u03bf\u03b6","pink red":"\u03c1\u03bf\u03b6 \u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf",purple:"\u03bc\u03c9\u03b2","purple magenta":"\u03bc\u03c9\u03b2 \u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1",red:"\u039a\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf","red orange":"\u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf \u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af",saturation:"\u039a\u03bf\u03c1\u03b5\u03c3\u03bc\u03cc\u03c2",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u03b4\u03b9\u03b1\u03c6\u03b1\u03bd\u03ad\u03c2`,"very dark":"\u03c0\u03bf\u03bb\u03cd \u03c3\u03ba\u03bf\u03cd\u03c1\u03bf","very light":"\u03c0\u03bf\u03bb\u03cd \u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",vibrant:"\u03ad\u03bd\u03c4\u03bf\u03bd\u03bf",white:"\u03bb\u03b5\u03c5\u03ba\u03cc",yellow:"\u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf","yellow green":"\u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf \u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"},Tk={hue:"Hue",saturation:"Saturation",lightness:"Lightness",brightness:"Brightness",red:"Red",green:"Green",blue:"Blue",alpha:"Alpha",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"very dark",dark:"dark",light:"light","very light":"very light",pale:"pale",grayish:"grayish",vibrant:"vibrant",black:"black",white:"white",gray:"gray",pink:"pink","pink red":"pink red","red orange":"red orange",brown:"brown",orange:"orange","orange yellow":"orange yellow","brown yellow":"brown yellow",yellow:"yellow","yellow green":"yellow green","green cyan":"green cyan",cyan:"cyan","cyan blue":"cyan blue","blue purple":"blue purple",purple:"purple","purple magenta":"purple magenta",magenta:"magenta","magenta pink":"magenta pink"},Fk={alpha:"Alpha",black:"negro",blue:"Azul","blue purple":"p\xfarpura azulado",brightness:"Brillo",brown:"marr\xf3n","brown yellow":"amarillo amarronado",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cian","cyan blue":"azul cian",dark:"oscuro",gray:"gris",grayish:"gris\xe1ceo",green:"Verde","green cyan":"cian verdoso",hue:"Tono",light:"claro",lightness:"Luminosidad",magenta:"magenta","magenta pink":"rosa magenta",orange:"naranja","orange yellow":"amarillo anaranjado",pale:"p\xe1lido",pink:"rosa","pink red":"rojo rosado",purple:"morado","purple magenta":"magenta viol\xe1ceo",red:"Rojo","red orange":"naranja rojizo",saturation:"Saturaci\xf3n",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muy oscuro","very light":"muy claro",vibrant:"intenso",white:"blanco",yellow:"amarillo","yellow green":"verde amarillento"},Ok={alpha:"Alfa",black:"must",blue:"Sinine","blue purple":"sinakaslilla",brightness:"Heledus",brown:"pruun","brown yellow":"pruunikaskollane",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ts\xfcaan","cyan blue":"ts\xfcaansinine",dark:"tume",gray:"hall",grayish:"hallikas",green:"Roheline","green cyan":"ts\xfcaanroheline",hue:"V\xe4rv",light:"valgus",lightness:"Valgus",magenta:"magentapunane","magenta pink":"magentaroosa",orange:"oran\u017e","orange yellow":"oran\u017eikaskollane",pale:"kahvatu",pink:"roosa","pink red":"vaarikapunane",purple:"lilla","purple magenta":"purpurne magenta",red:"Punane","red orange":"punakasoran\u017e",saturation:"K\xfcllastus",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} l\xe4bipaistev`,"very dark":"v\xe4ga tume","very light":"v\xe4ga hele",vibrant:"ere",white:"valge",yellow:"kollane","yellow green":"kollakasroheline"},Pk={alpha:"Alpha",black:"musta",blue:"Sininen","blue purple":"sinivioletti",brightness:"Kirkkaus",brown:"ruskea","brown yellow":"ruskeankeltainen",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"syaani","cyan blue":"syaaninsininen",dark:"tumma",gray:"harmaa",grayish:"harmahtava",green:"Vihre\xe4","green cyan":"vihre\xe4nsyaani",hue:"S\xe4vy",light:"vaalea",lightness:"Valom\xe4\xe4r\xe4",magenta:"magenta","magenta pink":"magentapinkki",orange:"oranssi","orange yellow":"oranssinkeltainen",pale:"vaalea",pink:"pinkki","pink red":"vaaleanpunainen",purple:"violetti","purple magenta":"violettimagenta",red:"Punainen","red orange":"punaoranssi",saturation:"V\xe4rikyll\xe4isyys",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} l\xe4pin\xe4kyv\xe4`,"very dark":"hyvin tumma","very light":"eritt\xe4in vaalea",vibrant:"eloisa",white:"valkea",yellow:"keltainen","yellow green":"keltavihre\xe4"},Mk={alpha:"Alpha",black:"Noir",blue:"Bleu","blue purple":"Violet bleu",brightness:"Luminosit\xe9",brown:"Brun","brown yellow":"Jaune brun",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"Cyan","cyan blue":"Bleu cyan",dark:"Sombre",gray:"Gris",grayish:"Gris\xe2tre",green:"Vert","green cyan":"Cyan vert",hue:"Teinte",light:"Clair",lightness:"Luminosit\xe9",magenta:"Magenta","magenta pink":"Rose magenta",orange:"Orange","orange yellow":"Jaune orang\xe9",pale:"P\xe2le",pink:"Rose","pink red":"Rouge ros\xe9",purple:"Violet","purple magenta":"Magenta violet",red:"Rouge","red orange":"Orange rouge",saturation:"Saturation",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"Tr\xe8s sombre","very light":"Tr\xe8s clair",vibrant:"Vif",white:"Blanc",yellow:"Jaune","yellow green":"Vert jaune"},Rk={alpha:"\u05d0\u05dc\u05e4\u05d0",black:"\u05e9\u05d7\u05d5\u05e8",blue:"\u05db\u05d7\u05d5\u05dc","blue purple":"\u05db\u05d7\u05d5\u05dc \u05e1\u05d2\u05d5\u05dc",brightness:"\u05d1\u05d4\u05d9\u05e8\u05d5\u05ea",brown:"\u05d7\u05d5\u05dd","brown yellow":"\u05d7\u05d5\u05dd \u05e6\u05d4\u05d5\u05d1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u05d8\u05d5\u05e8\u05e7\u05d9\u05d6","cyan blue":"\u05db\u05d7\u05d5\u05dc \u05e6\u05d9\u05d0\u05df",dark:"\u05db\u05d4\u05d4",gray:"\u05d0\u05e4\u05d5\u05e8",grayish:"\u05d0\u05e4\u05e8\u05e4\u05e8",green:"\u05d9\u05e8\u05d5\u05e7","green cyan":"\u05e6\u05d9\u05d0\u05df \u05d9\u05e8\u05d5\u05e7",hue:"\u05d2\u05d5\u05d5\u05df",light:"\u05d0\u05d5\u05e8",lightness:"\u05db\u05de\u05d5\u05ea \u05d0\u05d5\u05e8",magenta:"\u05de\u05d2'\u05e0\u05d8\u05d4","magenta pink":"\u05d5\u05e8\u05d5\u05d3 \u05de\u05d2'\u05e0\u05d8\u05d4",orange:"\u05db\u05ea\u05d5\u05dd","orange yellow":"\u05db\u05ea\u05d5\u05dd \u05e6\u05d4\u05d5\u05d1",pale:"\u05d7\u05d9\u05d5\u05d5\u05e8",pink:"\u05d5\u05e8\u05d5\u05d3","pink red":"\u05d5\u05e8\u05d5\u05d3 \u05d0\u05d3\u05d5\u05dd",purple:"\u05e1\u05d2\u05d5\u05dc","purple magenta":"\u05de\u05d2'\u05e0\u05d8\u05d4 \u05e1\u05d2\u05d5\u05dc",red:"\u05d0\u05d3\u05d5\u05dd","red orange":"\u05db\u05ea\u05d5\u05dd \u05d0\u05d3\u05d5\u05dd",saturation:"\u05e8\u05d5\u05d5\u05d9\u05d4",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u05e9\u05e7\u05d5\u05e3`,"very dark":"\u05db\u05d4\u05d4 \u05de\u05d0\u05d5\u05d3","very light":"\u05d1\u05d4\u05d9\u05e8 \u05de\u05d0\u05d5\u05d3",vibrant:"\u05ea\u05d5\u05e1\u05e1",white:"\u05dc\u05d1\u05df",yellow:"\u05e6\u05d4\u05d5\u05d1","yellow green":"\u05e6\u05d4\u05d5\u05d1 \u05d9\u05e8\u05d5\u05e7"},Lk={alpha:"Alfa",black:"crno",blue:"Plava","blue purple":"plavo ljubi\u010dasta",brightness:"Svjetlina",brown:"sme\u0111a","brown yellow":"sme\u0111e \u017euta",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cijan","cyan blue":"cijan plava",dark:"tamno",gray:"siva",grayish:"sivkasto",green:"Zelena","green cyan":"zelena cijan",hue:"Nijansa",light:"svjetlo",lightness:"Osvijetljenost",magenta:"magenta","magenta pink":"magentno ru\u017ei\u010dasta",orange:"naran\u010dasta","orange yellow":"naran\u010dasto \u017euta",pale:"blijeda",pink:"ru\u017ei\u010dasta","pink red":"ru\u017ei\u010dasto crvena",purple:"ljubi\u010dasta","purple magenta":"ljubi\u010dasta magenta",red:"Crvena","red orange":"crveno naran\u010dasta",saturation:"Zasi\u0107enost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirnosti`,"very dark":"jako tamna","very light":"vrlo svijetlo",vibrant:"vibrantna",white:"bijela",yellow:"\u017euto","yellow green":"\u017euto zelena"},Nk={alpha:"Alfa",black:"fekete",blue:"K\xe9k","blue purple":"k\xe9k lila",brightness:"F\xe9nyess\xe9g",brown:"barna","brown yellow":"barna s\xe1rga",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ci\xe1nk\xe9k","cyan blue":"ci\xe1nk\xe9k",dark:"s\xf6t\xe9t",gray:"sz\xfcrke",grayish:"sz\xfcrk\xe9s",green:"Z\xf6ld","green cyan":"z\xf6ld ci\xe1nk\xe9k",hue:"Sz\xedn\xe1rnyalat",light:"vil\xe1gos",lightness:"Vil\xe1goss\xe1g",magenta:"b\xedbor","magenta pink":"b\xedbor r\xf3zsasz\xedn",orange:"narancs","orange yellow":"narancss\xe1rga",pale:"halv\xe1ny",pink:"r\xf3zsasz\xedn","pink red":"r\xf3zsasz\xedn piros",purple:"lila","purple magenta":"lila b\xedbor",red:"Piros","red orange":"piros narancs",saturation:"Tel\xedtetts\xe9g",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \xe1tl\xe1tsz\xf3`,"very dark":"nagyon s\xf6t\xe9t","very light":"nagyon vil\xe1gos",vibrant:"\xe9l\xe9nk",white:"feh\xe9r",yellow:"s\xe1rga","yellow green":"s\xe1rga z\xf6ld"},Dk={alpha:"Alfa",black:"nero",blue:"Blu","blue purple":"blu viola",brightness:"Luminosit\xe0",brown:"marrone","brown yellow":"giallo bruno",colorName:e=>`${e.hue} ${e.chroma} ${e.lightness}`,cyan:"ciano","cyan blue":"blu ciano",dark:"scuro",gray:"grigio",grayish:"grigiastro",green:"Verde","green cyan":"verde ciano",hue:"Tonalit\xe0",light:"chiaro",lightness:"Luminosit\xe0",magenta:"magenta","magenta pink":"rosa magenta",orange:"arancio","orange yellow":"giallo arancio",pale:"tenue",pink:"rosa","pink red":"rosa rosso",purple:"viola","purple magenta":"viola magenta",red:"Rosso","red orange":"rosso arancio",saturation:"Saturazione",transparentColorName:e=>`${e.hue} ${e.chroma} ${e.lightness}, trasparenza ${e.percentTransparent}`,"very dark":"molto scuro","very light":"molto chiaro",vibrant:"vivace",white:"bianco",yellow:"giallo","yellow green":"giallo verde"},zk={alpha:"\u30a2\u30eb\u30d5\u30a1",black:"\u30d6\u30e9\u30c3\u30af",blue:"\u9752","blue purple":"\u30d6\u30eb\u30fc\u30d1\u30fc\u30d7\u30eb",brightness:"\u660e\u308b\u3055",brown:"\u30d6\u30e9\u30a6\u30f3","brown yellow":"\u30d6\u30e9\u30a6\u30f3\u30a4\u30a8\u30ed\u30fc",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u30b7\u30a2\u30f3","cyan blue":"\u30b7\u30a2\u30f3\u30d6\u30eb\u30fc",dark:"\u30c0\u30fc\u30af",gray:"\u30b0\u30ec\u30fc",grayish:"\u30b0\u30ec\u30a4\u30c3\u30b7\u30e5",green:"\u7dd1","green cyan":"\u30b0\u30ea\u30fc\u30f3\u30b7\u30a2\u30f3",hue:"\u8272\u76f8",light:"\u30e9\u30a4\u30c8",lightness:"\u660e\u5ea6",magenta:"\u30de\u30bc\u30f3\u30bf","magenta pink":"\u30de\u30bc\u30f3\u30bf\u30d4\u30f3\u30af",orange:"\u30aa\u30ec\u30f3\u30b8","orange yellow":"\u30aa\u30ec\u30f3\u30b8\u30a4\u30a8\u30ed\u30fc",pale:"\u30da\u30fc\u30eb",pink:"\u30d4\u30f3\u30af","pink red":"\u30d4\u30f3\u30af\u30ec\u30c3\u30c9",purple:"\u30d1\u30fc\u30d7\u30eb","purple magenta":"\u30d1\u30fc\u30d7\u30eb\u30de\u30bc\u30f3\u30bf",red:"\u8d64","red orange":"\u30ec\u30c3\u30c9\u30aa\u30ec\u30f3\u30b8",saturation:"\u5f69\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u6700\u3082\u6697\u3044","very light":"\u30d9\u30ea\u30fc\u30e9\u30a4\u30c8",vibrant:"\u9bae\u3084\u304b",white:"\u30db\u30ef\u30a4\u30c8",yellow:"\u30a4\u30a8\u30ed\u30fc","yellow green":"\u30a4\u30a8\u30ed\u30fc\u30b0\u30ea\u30fc\u30f3"},Bk={alpha:"\uc54c\ud30c",black:"\uac80\uc740\uc0c9",blue:"\ud30c\ub791","blue purple":"\uccad\uc790\uc0c9",brightness:"\uba85\ub3c4",brown:"\uac08\uc0c9","brown yellow":"\ud669\uac08\uc0c9",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\uccad\ub85d\uc0c9","cyan blue":"\uccad\ub85d\uc0c9",dark:"\ub2e4\ud06c",gray:"\ud68c\uc0c9",grayish:"\ud68c\uac08\uc0c9",green:"\ucd08\ub85d","green cyan":"\uccad\ub85d\uc0c9",hue:"\uc0c9\uc870",light:"\ub77c\uc774\ud2b8",lightness:"\ubc1d\uae30",magenta:"\uc790\ud64d\uc0c9","magenta pink":"\ub9c8\uc820\ud0c0 \ud551\ud06c",orange:"\uc8fc\ud669\uc0c9","orange yellow":"\ubd88\uadf8\uc2a4\ub984\ud55c \ub178\ub791",pale:"\ud759\uc0c9",pink:"\ubd84\ud64d\uc0c9","pink red":"\ud551\ud06c \ub808\ub4dc",purple:"\uc790\uc8fc\uc0c9","purple magenta":"\ubcf4\ub77c\ube5b \uc790\ud64d\uc0c9",red:"\ube68\uac15","red orange":"\ubd89\uc740 \uc8fc\ud669\uc0c9",saturation:"\ucc44\ub3c4",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \ud22c\uba85\ub3c4`,"very dark":"\ub9e4\uc6b0 \uc5b4\ub450\uc6b4","very light":"\ub9e4\uc6b0 \uc5f0\ud568",vibrant:"\uac15\ub82c\ud55c",white:"\ud770\uc0c9",yellow:"\ub178\ub780\uc0c9","yellow green":"\uc5f0\ub450\uc0c9"},Uk={alpha:"Alfa",black:"juoda",blue:"M\u0117lyna","blue purple":"melsvai violetin\u0117",brightness:"Ry\u0161kumas",brown:"ruda","brown yellow":"rusvai geltona",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u017ealsvai m\u0117lyna","cyan blue":"\u017ealsvai m\u0117lyna",dark:"tamsi",gray:"pilka",grayish:"pilk\u0161va",green:"\u017dalia","green cyan":"\u017ealsvai m\u0117lyna",hue:"Atspalvis",light:"\u0161viesi",lightness:"\u0160viesumas",magenta:"rausvai raudona","magenta pink":"purpurin\u0117",orange:"oran\u017ein\u0117","orange yellow":"oran\u017einio atspalvio geltona",pale:"bly\u0161ki",pink:"ro\u017ein\u0117","pink red":"ro\u017ein\u0117 raudona",purple:"violetin\u0117","purple magenta":"purpurin\u0117 rausvai raudona",red:"Raudona","red orange":"rausvai oran\u017ein\u0117",saturation:"\u012esotinimas",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} skaidri`,"very dark":"labai tamsi","very light":"labai \u0161viesi",vibrant:"ry\u0161ki",white:"balta",yellow:"geltona","yellow green":"gelsvai \u017ealia"},Vk={alpha:"Alfa",black:"melns",blue:"Zila","blue purple":"zili violets",brightness:"Spilgtums",brown:"br\u016bns","brown yellow":"br\u016bni dzeltens",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ci\u0101ns","cyan blue":"ci\u0101na zils",dark:"tum\u0161s",gray:"pel\u0113ks",grayish:"pel\u0113c\u012bgs",green:"Za\u013ca","green cyan":"za\u013c\u0161 ci\u0101ns",hue:"Nokr\u0101sa",light:"gai\u0161s",lightness:"Gai\u0161ums",magenta:"fuksiju","magenta pink":"fuksiju roz\u0101",orange:"oran\u017es","orange yellow":"oran\u017ei dzeltens",pale:"b\u0101ls",pink:"roz\u0101","pink red":"roz\u012bgi sarkans",purple:"violets","purple magenta":"violets fuksiju",red:"Sarkana","red orange":"sarkan\u012bgi oran\u017es",saturation:"Pies\u0101tin\u0101jums",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} caursp\u012bd\u012bgs`,"very dark":"\u013coti tum\u0161s","very light":"\u013coti gai\u0161s",vibrant:"ko\u0161s",white:"balts",yellow:"dzeltens","yellow green":"dzelteni za\u013c\u0161"},Hk={alpha:"Alfa",black:"svart",blue:"Bl\xe5","blue purple":"bl\xe5lilla",brightness:"Lysstyrke",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyanbl\xe5",dark:"m\xf8rk",gray:"gr\xe5",grayish:"gr\xe5aktig",green:"Gr\xf8nn","green cyan":"gr\xf8nncyan",hue:"Fargetone",light:"lys",lightness:"Lyshet",magenta:"magenta","magenta pink":"magentarosa",orange:"oransje","orange yellow":"oransjegul",pale:"blek",pink:"rosa","pink red":"rosar\xf8d",purple:"lilla","purple magenta":"lillamagenta",red:"R\xf8d","red orange":"r\xf8doransje",saturation:"Metning",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gjennomsiktig`,"very dark":"sv\xe6rt m\xf8rk","very light":"sv\xe6rt lys",vibrant:"levende",white:"hvit",yellow:"gul","yellow green":"gulgr\xf8nn"},$k={alpha:"Alfa",black:"zwart",blue:"Blauw","blue purple":"paarsblauw",brightness:"Helderheid",brown:"bruin","brown yellow":"bruingeel",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyaan","cyan blue":"cyaanblauw",dark:"donker",gray:"grijs",grayish:"grijsachtig",green:"Groen","green cyan":"cyaangroen",hue:"Kleurtoon",light:"licht",lightness:"Lichtsterkte",magenta:"magenta","magenta pink":"magentaroze",orange:"oranje","orange yellow":"oranjegeel",pale:"bleek",pink:"roze","pink red":"rozerood",purple:"paars","purple magenta":"magentapaars",red:"Rood","red orange":"roodoranje",saturation:"Verzadiging",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparant`,"very dark":"heel donker","very light":"heel licht",vibrant:"levendig",white:"wit",yellow:"geel","yellow green":"geelgroen"},Wk={alpha:"Alfa",black:"czarny",blue:"Niebieski","blue purple":"niebiesko-fioletowy",brightness:"Jasno\u015b\u0107",brown:"br\u0105zowy","brown yellow":"br\u0105zowo-\u017c\xf3\u0142ty",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyjanowy","cyan blue":"cyjanowo-niebieski",dark:"ciemny",gray:"szary",grayish:"szarawy",green:"Zielony","green cyan":"zielono-cyjanowy",hue:"Odcie\u0144",light:"jasny",lightness:"Jaskrawo\u015b\u0107",magenta:"purpurowy","magenta pink":"purpurowo-r\xf3\u017cowy",orange:"pomara\u0144czowy","orange yellow":"pomara\u0144czowo-\u017c\xf3\u0142ty",pale:"blady",pink:"r\xf3\u017cowy","pink red":"r\xf3\u017cowo-czerwony",purple:"fioletowy","purple magenta":"fioletowo-purpurowy",red:"Czerwony","red orange":"czerwono-pomara\u0144czowy",saturation:"Nasycenie",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} przezroczysto\u015bci`,"very dark":"bardzo ciemny","very light":"bardzo jasny",vibrant:"intensywny",white:"bia\u0142y",yellow:"\u017c\xf3\u0142ty","yellow green":"\u017c\xf3\u0142to-zielony"},Gk={alpha:"Alfa",black:"preto",blue:"Azul","blue purple":"roxo azulado",brightness:"Brilho",brown:"marrom","brown yellow":"marrom amarelado",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ciano","cyan blue":"azul-ciano",dark:"escuro",gray:"cinza",grayish:"acinzentado",green:"Verde","green cyan":"verde-ciano",hue:"Matiz",light:"claro",lightness:"Luminosidade",magenta:"magenta","magenta pink":"rosa-magenta",orange:"laranja","orange yellow":"amarelo alaranjado",pale:"p\xe1lido",pink:"rosa","pink red":"rosa avermelhado",purple:"roxo","purple magenta":"roxo-magenta",red:"Vermelho","red orange":"laranja avermelhado",saturation:"Satura\xe7\xe3o",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muito escuro","very light":"muito claro",vibrant:"vibrante",white:"branco",yellow:"amarelo","yellow green":"verde amarelado"},qk={alpha:"Alfa",black:"preto",blue:"Azul","blue purple":"azul-p\xfarpura",brightness:"Luminosidade",brown:"castanho","brown yellow":"amarelo-castanho",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ciano","cyan blue":"azul-ciano",dark:"escuro",gray:"cinzento",grayish:"acinzentado",green:"Verde","green cyan":"verde-ciano",hue:"Tonalidade",light:"claro",lightness:"Claridade",magenta:"magenta","magenta pink":"rosa-magenta",orange:"laranja","orange yellow":"amarelo-laranja",pale:"p\xe1lido",pink:"cor-de-rosa","pink red":"vermelho-rosa",purple:"p\xfarpura","purple magenta":"p\xfarpura-magenta",red:"Vermelho","red orange":"laranja-vermelho",saturation:"Satura\xe7\xe3o",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muito escuro","very light":"muito claro",vibrant:"vibrante",white:"branco",yellow:"amarelo","yellow green":"verde-amarelo"},Yk={alpha:"Alfa",black:"negru",blue:"Albastru","blue purple":"albastru-violet",brightness:"Luminozitate",brown:"maro","brown yellow":"galben maro",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"bleu","cyan blue":"albastru-bleu",dark:"\xeenchis",gray:"gri",grayish:"cenu\u0219iu",green:"Verde","green cyan":"verde bleu",hue:"Nuan\u021b\u0103",light:"deschis",lightness:"Luminozitate",magenta:"fucsia","magenta pink":"roz-fucsia",orange:"portocaliu","orange yellow":"galben-portocaliu",pale:"pal",pink:"roz","pink red":"roz-ro\u0219u",purple:"violet","purple magenta":"violet-fucsia",red:"Ro\u0219u","red orange":"portocaliu-ro\u0219u",saturation:"Satura\u021bie",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"foarte \xeenchis","very light":"foarte deschis",vibrant:"plin de via\u021b\u0103",white:"alb",yellow:"galben","yellow green":"galben-verde"},Xk={alpha:"\u0410\u043b\u044c\u0444\u0430",black:"\u0447\u0435\u0440\u043d\u044b\u0439",blue:"\u0421\u0438\u043d\u0438\u0439","blue purple":"\u0441\u0438\u043d\u0435-\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442\u044c",brown:"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439","brown yellow":"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0436\u0435\u043b\u0442\u044b\u0439",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0433\u043e\u043b\u0443\u0431\u043e\u0439","cyan blue":"\u0446\u0432\u0435\u0442 \u043c\u043e\u0440\u0441\u043a\u043e\u0439 \u0432\u043e\u043b\u043d\u044b",dark:"\u0442\u0435\u043c\u043d\u044b\u0439",gray:"\u0441\u0435\u0440\u044b\u0439",grayish:"\u0441\u0435\u0440\u043e\u0432\u0430\u0442\u044b\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439","green cyan":"\u0441\u0438\u043d\u0435-\u0437\u0435\u043b\u0435\u043d\u044b\u0439",hue:"\u041e\u0442\u0442\u0435\u043d\u043e\u043a",light:"\u0441\u0432\u0435\u0442\u043b\u044b\u0439",lightness:"\u041e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u044c",magenta:"\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439","magenta pink":"\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u043e-\u0440\u043e\u0437\u043e\u0432\u044b\u0439",orange:"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439","orange yellow":"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e-\u0436\u0435\u043b\u0442\u044b\u0439",pale:"\u0431\u043b\u0435\u0434\u043d\u044b\u0439",pink:"\u0440\u043e\u0437\u043e\u0432\u044b\u0439","pink red":"\u0440\u043e\u0437\u043e\u0432\u043e-\u043a\u0440\u0430\u0441\u043d\u044b\u0439",purple:"\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439","purple magenta":"\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e-\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439",red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439","red orange":"\u043a\u0440\u0430\u0441\u043d\u043e-\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439",saturation:"\u041d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u044c",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 \u043d\u0430 ${e.percentTransparent}`,"very dark":"\u043e\u0447\u0435\u043d\u044c \u0442\u0435\u043c\u043d\u044b\u0439","very light":"\u043e\u0447\u0435\u043d\u044c \u0441\u0432\u0435\u0442\u043b\u044b\u0439",vibrant:"\u044f\u0440\u043a\u0438\u0439",white:"\u0431\u0435\u043b\u044b\u0439",yellow:"\u0436\u0435\u043b\u0442\u044b\u0439","yellow green":"\u0436\u0435\u043b\u0442\u043e-\u0437\u0435\u043b\u0435\u043d\u044b\u0439"},Kk={alpha:"Alfa",black:"\u010dierna",blue:"Modr\xe1","blue purple":"modrofialov\xe1",brightness:"Jas",brown:"hned\xe1","brown yellow":"hnedo\u017elt\xe1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"az\xfarov\xe1","cyan blue":"az\xfarov\xe1 modr\xe1",dark:"tmav\xe1",gray:"siv\xe1",grayish:"sivast\xe1",green:"Zelen\xe1","green cyan":"zelen\xe1 az\xfarov\xe1",hue:"Odtie\u0148",light:"svetl\xe1",lightness:"Svetlos\u0165",magenta:"purpurov\xe1","magenta pink":"ru\u017eov\xe1 purpurov\xe1",orange:"oran\u017eov\xe1","orange yellow":"oran\u017eovo\u017elt\xe1",pale:"bled\xe1",pink:"ru\u017eov\xe1","pink red":"ru\u017eovo\u010derven\xe1",purple:"fialov\xe1","purple magenta":"fialov\xe1 purpurov\xe1",red:"\u010cerven\xe1","red orange":"\u010dervenooran\u017eov\xe1",saturation:"S\xfdtos\u0165",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prieh\u013eadn\xe1`,"very dark":"ve\u013emi tmav\xe1","very light":"ve\u013emi svetl\xe1",vibrant:"energick\xe1",white:"biela",yellow:"\u017elt\xe1","yellow green":"\u017eltozelen\xe1"},Zk={alpha:"Alfa",black:"\u010drna",blue:"Modra","blue purple":"modro vijoli\u010dna",brightness:"Svetlost",brown:"rjava","brown yellow":"rjavo rumena",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cian","cyan blue":"cian modra",dark:"temna",gray:"siva",grayish:"sivkasta",green:"Zelena","green cyan":"zelena cian",hue:"Barva",light:"svetla",lightness:"Lahkost",magenta:"\u0161krlatna","magenta pink":"\u0161krlatno roza",orange:"oran\u017ena","orange yellow":"oran\u017eno rumena",pale:"bleda",pink:"roza","pink red":"roza rde\u010da",purple:"vijoli\u010dna","purple magenta":"vijoli\u010dno \u0161krlatna",red:"Rde\u010da","red orange":"rde\u010de oran\u017ena",saturation:"Nasi\u010denost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozorna`,"very dark":"zelo temna","very light":"zelo svetla",vibrant:"\u017eivahna",white:"bela",yellow:"rumena","yellow green":"rumeno zelena"},Jk={alpha:"Alfa",black:"crno",blue:"Plava","blue purple":"plavoljubi\u010dasta",brightness:"Osvetljenost",brown:"sme\u0111a","brown yellow":"sme\u0111e\u017euta",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cijan","cyan blue":"cijan plava",dark:"tamno",gray:"siva",grayish:"sivkasta",green:"Zelena","green cyan":"zeleno cijan",hue:"Nijansa",light:"svetla",lightness:"Osvetljenje",magenta:"purpurnocrvena","magenta pink":"magenta ru\u017ei\u010dasta",orange:"narand\u017easta","orange yellow":"narand\u017easto\u017euta",pale:"bledo",pink:"ru\u017ei\u010dasta","pink red":"ru\u017ei\u010dastocrvena",purple:"ljubi\u010dasta","purple magenta":"ljubi\u010dasta magenta",red:"Crvena","red orange":"crvenonarand\u017easta",saturation:"Zasi\u0107enje",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirna`,"very dark":"veoma tamno","very light":"vrlo svetlo",vibrant:"\u017eivopisna",white:"bela",yellow:"\u017euto","yellow green":"\u017eutozelena"},Qk={alpha:"Alfa",black:"svart",blue:"Bl\xe5tt","blue purple":"bl\xe5lila",brightness:"Ljusstyrka",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyanbl\xe5",dark:"m\xf6rk",gray:"gr\xe5",grayish:"gr\xe5aktig",green:"Gr\xf6nt","green cyan":"gr\xf6n cyan",hue:"Nyans",light:"ljus",lightness:"Ljushet",magenta:"magenta","magenta pink":"magentarosa",orange:"orange","orange yellow":"orangegul",pale:"blek",pink:"rosa","pink red":"rosar\xf6d",purple:"lila","purple magenta":"lila magenta",red:"R\xf6tt","red orange":"r\xf6dorange",saturation:"M\xe4ttnad",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} genomskinlig`,"very dark":"mycket m\xf6rk","very light":"mycket ljus",vibrant:"livfull",white:"vit",yellow:"gul","yellow green":"gulgr\xf6n"},eE={alpha:"Alfa",black:"siyah",blue:"Mavi","blue purple":"mavi mor",brightness:"Parlakl\u0131k",brown:"kahverengi","brown yellow":"kahverengi sar\u0131",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"camg\xf6be\u011fi","cyan blue":"camg\xf6be\u011fi mavi",dark:"koyu",gray:"gri",grayish:"grimsi",green:"Ye\u015fil","green cyan":"ye\u015fil camg\xf6be\u011fi",hue:"Ton",light:"a\xe7\u0131k",lightness:"Canl\u0131l\u0131k",magenta:"eflatun","magenta pink":"eflatun pembe",orange:"turuncu","orange yellow":"turuncu sar\u0131",pale:"solgun",pink:"pembe","pink red":"pembe k\u0131rm\u0131z\u0131",purple:"mor","purple magenta":"mor eflatun",red:"K\u0131rm\u0131z\u0131","red orange":"k\u0131rm\u0131z\u0131 portakal",saturation:"Doygunluk",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} saydam`,"very dark":"\xe7ok koyu","very light":"\xe7ok a\xe7\u0131k",vibrant:"canl\u0131",white:"beyaz",yellow:"sar\u0131","yellow green":"sar\u0131 ye\u015fil"},tE={alpha:"\u0410\u043b\u044c\u0444\u0430",black:"\u0447\u043e\u0440\u043d\u0438\u0439",blue:"\u0421\u0438\u043d\u0456\u0439","blue purple":"\u0441\u0438\u043d\u044c\u043e-\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439",brightness:"\u042f\u0441\u043a\u0440\u0430\u0432\u0456\u0441\u0442\u044c",brown:"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u0438\u0439","brown yellow":"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0436\u043e\u0432\u0442\u0438\u0439",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439","cyan blue":"\u0441\u0438\u043d\u044c\u043e-\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439",dark:"\u0442\u0435\u043c\u043d\u0438\u0439",gray:"\u0441\u0456\u0440\u0438\u0439",grayish:"\u0441\u0456\u0440\u0443\u0432\u0430\u0442\u0438\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439","green cyan":"\u0437\u0435\u043b\u0435\u043d\u043e-\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439",hue:"\u0422\u043e\u043d",light:"\u0441\u0432\u0456\u0442\u043b\u0438\u0439",lightness:"\u041e\u0441\u0432\u0456\u0442\u043b\u0435\u043d\u0456\u0441\u0442\u044c",magenta:"\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u0438\u0439","magenta pink":"\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u043e-\u0440\u043e\u0436\u0435\u0432\u0438\u0439",orange:"\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439","orange yellow":"\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u043e-\u0436\u043e\u0432\u0442\u0438\u0439",pale:"\u0431\u043b\u0456\u0434\u0438\u0439",pink:"\u0440\u043e\u0436\u0435\u0432\u0438\u0439","pink red":"\u0440\u043e\u0436\u0435\u0432\u043e-\u0447\u0435\u0440\u0432\u043e\u043d\u0438\u0439",purple:"\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439","purple magenta":"\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u043e-\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u0438\u0439",red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439","red orange":"\u0447\u0435\u0440\u0432\u043e\u043d\u043e-\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439",saturation:"\u041d\u0430\u0441\u0438\u0447\u0435\u043d\u0456\u0441\u0442\u044c",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, \u043f\u0440\u043e\u0437\u043e\u0440\u0438\u0439 \u043d\u0430 ${e.percentTransparent}`,"very dark":"\u0434\u0443\u0436\u0435 \u0442\u0435\u043c\u043d\u0438\u0439","very light":"\u0434\u0443\u0436\u0435 \u0441\u0432\u0456\u0442\u043b\u0438\u0439",vibrant:"\u044f\u0441\u043a\u0440\u0430\u0432\u0438\u0439",white:"\u0431\u0456\u043b\u0438\u0439",yellow:"\u0436\u043e\u0432\u0442\u0438\u0439","yellow green":"\u0436\u043e\u0432\u0442\u043e-\u0437\u0435\u043b\u0435\u043d\u0438\u0439"},rE={alpha:"Alpha",black:"\u9ed1\u8272",blue:"\u84dd\u8272","blue purple":"\u84dd\u7d2b\u8272",brightness:"\u4eae\u5ea6",brown:"\u68d5\u8272\u7684","brown yellow":"\u68d5\u9ec4\u8272",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u84dd\u7eff\u8272","cyan blue":"\u9752\u84dd\u8272",dark:"\u6df1\u8272",gray:"\u7070\u8272",grayish:"\u6d45\u7070\u8272\u7684",green:"\u7eff\u8272","green cyan":"\u7eff\u9752\u8272",hue:"\u8272\u76f8",light:"\u6d45\u8272",lightness:"\u660e\u4eae\u5ea6",magenta:"\u7d2b\u7ea2\u8272","magenta pink":"\u7d2b\u7c89\u8272",orange:"\u6a59\u8272","orange yellow":"\u6a59\u9ec4\u8272",pale:"\u82cd\u767d\u7684",pink:"\u7c89\u8272","pink red":"\u7c89\u7ea2\u8272",purple:"\u7d2b\u8272","purple magenta":"\u7d2b\u6d0b\u7ea2\u8272",red:"\u7ea2\u8272","red orange":"\u7ea2\u6a59\u8272",saturation:"\u9971\u548c\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u5f88\u6697","very light":"\u5f88\u6d45",vibrant:"\u751f\u673a\u52c3\u52c3",white:"\u767d\u8272",yellow:"\u9ec4\u8272","yellow green":"\u9ec4\u8272/\u7eff\u8272"},nE={alpha:"Alpha",black:"\u9ed1",blue:"\u85cd\u8272","blue purple":"\u85cd\u7d2b",brightness:"\u4eae\u5ea6",brown:"\u68d5","brown yellow":"\u68d5\u9ec3",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u9752","cyan blue":"\u9752\u85cd",dark:"\u6697",gray:"\u7070",grayish:"\u504f\u7070",green:"\u7da0\u8272","green cyan":"\u9752\u7da0",hue:"\u8272\u76f8",light:"\u6dfa",lightness:"\u660e\u4eae",magenta:"\u6d0b\u7d05","magenta pink":"\u6dfa\u6d0b\u7d05",orange:"\u6a59","orange yellow":"\u6a59\u9ec3",pale:"\u6de1",pink:"\u7c89\u7d05","pink red":"\u7c89\u7d05",purple:"\u7d2b","purple magenta":"\u7d2b\u6d0b\u7d05",red:"\u7d05\u8272","red orange":"\u6a59\u7d05",saturation:"\u98fd\u548c\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u5f88\u6697","very light":"\u5f88\u6dfa",vibrant:"\u9bae\u8c54",white:"\u767d",yellow:"\u9ec3","yellow green":"\u9ec3\u7da0"},iE={"ar-AE":Sk,"bg-BG":Ak,"cs-CZ":kk,"da-DK":Ek,"de-DE":Ik,"el-GR":jk,"en-US":Tk,"es-ES":Fk,"et-EE":Ok,"fi-FI":Pk,"fr-FR":Mk,"he-IL":Rk,"hr-HR":Lk,"hu-HU":Nk,"it-IT":Dk,"ja-JP":zk,"ko-KR":Bk,"lt-LT":Uk,"lv-LV":Vk,"nb-NO":Hk,"nl-NL":$k,"pl-PL":Wk,"pt-BR":Gk,"pt-PT":qk,"ro-RO":Yk,"ru-RU":Xk,"sk-SK":Kk,"sl-SI":Zk,"sr-SP":Jk,"sv-SE":Qk,"tr-TR":eE,"uk-UA":tE,"zh-CN":rE,"zh-TW":nE};const jE=Symbol.for("react-aria.i18n.locale"),TE=Symbol.for("react-aria.i18n.strings");let FE;class OE{getStringForLocale(e,t){let r=this.getStringsForLocale(t)[e];if(!r)throw new Error(`Could not find intl message ${e} in ${t} locale`);return r}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,r="en-US"){if(t[e])return t[e];let n=function(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}(e);if(t[n])return t[n];for(let i in t)if(i.startsWith(n+"-"))return t[i];return t[r]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let t=window[jE];if(void 0===FE){let e=window[TE];if(!e)return null;FE={};for(let r in e)FE[r]=new OE({[t]:e[r]},t)}let r=null==FE?void 0:FE[e];if(!r)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}}const PE=new Map,ME=new Map;class RE{format(e,t){let r=this.strings.getStringForLocale(e,this.locale);return"function"==typeof r?r(t,this):r}plural(e,t,r="cardinal"){let n=t["="+e];if(n)return"function"==typeof n?n():n;let i=this.locale+":"+r,o=PE.get(i);return o||(o=new Intl.PluralRules(this.locale,{type:r}),PE.set(i,o)),n=t[o.select(e)]||t.other,"function"==typeof n?n():n}number(e){let t=ME.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),ME.set(this.locale,t)),t.format(e)}select(e,t){let r=e[t]||e.other;return"function"==typeof r?r():r}constructor(e,t){this.locale=e,this.strings=t}}let LE=new Map,NE=!1;try{NE="exceptZero"===new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay}catch{}let DE=!1;try{DE="unit"===new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style}catch{}const zE={degree:{narrow:{default:"\xb0","ja-JP":" \u5ea6","zh-TW":"\u5ea6","sl-SI":" \xb0"}}};class BE{format(e){let t="";if(t=NE||null==this.options.signDisplay?this.numberFormatter.format(e):function(e,t,r){if("auto"===t)return e.format(r);if("never"===t)return e.format(Math.abs(r));{let n=!1;if("always"===t?n=r>0||Object.is(r,0):"exceptZero"===t&&(Object.is(r,-0)||Object.is(r,0)?r=Math.abs(r):n=r>0),n){let t=e.format(-r),n=e.format(r),i=t.replace(n,"").replace(/\u200e|\u061C/,"");return t.replace(n,"!!!").replace(i,"+").replace("!!!",n)}return e.format(r)}}(this.numberFormatter,this.options.signDisplay,e),"unit"===this.options.style&&!DE){var r;let{unit:e,unitDisplay:n="short",locale:i}=this.resolvedOptions();if(!e)return t;let o=null===(r=zE[e])||void 0===r?void 0:r[n];t+=o[i]||o.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if("function"==typeof this.numberFormatter.formatRange)return this.numberFormatter.formatRange(e,t);if(t<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} \u2013 ${this.format(t)}`}formatRangeToParts(e,t){if("function"==typeof this.numberFormatter.formatRangeToParts)return this.numberFormatter.formatRangeToParts(e,t);if(t<e)throw new RangeError("End date must be >= start date");let r=this.numberFormatter.formatToParts(e),n=this.numberFormatter.formatToParts(t);return[...r.map(e=>({...e,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...n.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!NE&&null!=this.options.signDisplay&&(e={...e,signDisplay:this.options.signDisplay}),!DE&&"unit"===this.options.style&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=function(e,t={}){let{numberingSystem:r}=t;if(r&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${r}`),"unit"===t.style&&!DE){var n;let{unit:e,unitDisplay:r="short"}=t;if(!e)throw new Error('unit option must be provided with style: "unit"');if(null===(n=zE[e])||void 0===n||!n[r])throw new Error(`Unsupported unit ${e} with unitDisplay = ${r}`);t={...t,style:"decimal"}}let i=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(LE.has(i))return LE.get(i);let o=new Intl.NumberFormat(e,t);return LE.set(i,o),o}(e,t),this.options=t}}let UE=new OE(function(e){return e&&e.__esModule?e.default:e}(iE));const VE=[[0,"pink"],[15,"red"],[48,"orange"],[94,"yellow"],[135,"green"],[175,"cyan"],[264,"blue"],[284,"purple"],[320,"magenta"],[349,"pink"]];class HE{toHexInt(){return this.toFormat("rgb").toHexInt()}getChannelValue(e){if(e in this)return this[e];throw new Error("Unsupported color channel: "+e)}withChannelValue(e,t){if(e in this){let r=this.clone();return r[e]=t,r}throw new Error("Unsupported color channel: "+e)}getChannelName(e,t){return(OE.getGlobalDictionaryForPackage("@react-stately/color")||UE).getStringForLocale(e,t)}getColorSpaceAxes(e){let{xChannel:t,yChannel:r}=e,n=t||this.getColorChannels().find(e=>e!==r),i=r||this.getColorChannels().find(e=>e!==n),o=this.getColorChannels().find(e=>e!==n&&e!==i);return{xChannel:n,yChannel:i,zChannel:o}}getColorName(e){let t,[r,n,i]=KE(this),o=OE.getGlobalDictionaryForPackage("@react-stately/color")||UE;if(r>.999)return o.getStringForLocale("white",e);if(r<.001)return o.getStringForLocale("black",e);[t,r]=this.getOklchHue(r,n,i,e);let a="",s="";n<=.1&&n>=.001?s=r>=.7?"pale":"grayish":n>=.15&&(s="vibrant"),r<.3?a="very dark":r<.55?a="dark":r<.7||(a=r<.85?"light":"very light"),s&&(s=o.getStringForLocale(s,e)),a&&(a=o.getStringForLocale(a,e));let l=this.getChannelValue("alpha"),c=new RE(e,o);if(l<1){let r=new BE(e,{style:"percent"}).format(1-l);return c.format("transparentColorName",{lightness:a,chroma:s,hue:t,percentTransparent:r}).replace(/\s+/g," ").trim()}return c.format("colorName",{lightness:a,chroma:s,hue:t}).replace(/\s+/g," ").trim()}getOklchHue(e,t,r,n){let i=OE.getGlobalDictionaryForPackage("@react-stately/color")||UE;if(t<.001)return[i.getStringForLocale("gray",n),e];for(let o=0;o<VE.length;o++){let[t,a]=VE[o],[s,l]=VE[o+1]||[360,"pink"];if(r>=t&&r<s)return"orange"===a&&(e<.68?a="brown":e=e-.68+.55),r>t+(s-t)/2&&a!==l?a=`${a} ${l}`:"yellow"===a&&e<.85&&(a="yellow green"),[i.getStringForLocale(a,n).toLocaleLowerCase(n),e]}throw new Error("Unexpected hue")}getHueName(e){let[t,r,n]=KE(this),[i]=this.getOklchHue(t,r,n,e);return i}}class $E extends HE{static parse(e){let t=[];if(/^#[\da-f]+$/i.test(e)&&[4,5,7,9].includes(e.length)){const r=(e.length<6?e.replace(/[^#]/gi,"$&$&"):e).slice(1).split("");for(;r.length>0;)t.push(parseInt(r.splice(0,2).join(""),16));t[3]=void 0!==t[3]?t[3]/255:void 0}const r=e.match(/^rgba?\((.*)\)$/);var n;return null!=r&&r[1]&&(t=r[1].split(",").map(e=>Number(e.trim())),t=t.map((e,t)=>zb(e,0,t<3?255:1))),t.length<3?void 0:new $E(t[0],t[1],t[2],null!==(n=t[3])&&void 0!==n?n:1)}toString(e="css"){switch(e){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(255*this.alpha).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hex":case"hexa":case"rgb":case"rgba":return this;case"hsb":case"hsba":return this.toHSB();case"hsl":case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+e)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const e=this.red/255,t=this.green/255,r=this.blue/255,n=Math.min(e,t,r),i=Math.max(e,t,r),o=i-n,a=0===i?0:o/i;let s=0;if(0!==o){switch(i){case e:s=(t-r)/o+(t<r?6:0);break;case t:s=(r-e)/o+2;break;case r:s=(e-t)/o+4}s/=6}return new GE(Ub(360*s,2),Ub(100*a,2),Ub(100*i,2),this.alpha)}toHSL(){const e=this.red/255,t=this.green/255,r=this.blue/255,n=Math.min(e,t,r),i=Math.max(e,t,r),o=(i+n)/2,a=i-n;let s,l;if(0===a)s=l=0;else{switch(l=a/(o<.5?i+n:2-i-n),i){case e:s=(t-r)/a+(t<r?6:0);break;case t:s=(r-e)/a+2;break;case r:s=(e-t)/a+4}s/=6}return new XE(Ub(360*s,2),Ub(100*l,2),Ub(100*o,2),this.alpha)}clone(){return new $E(this.red,this.green,this.blue,this.alpha)}getChannelRange(e){switch(e){case"red":case"green":case"blue":return{minValue:0,maxValue:255,step:1,pageSize:17};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"red":case"green":case"blue":return{style:"decimal"};case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let r=this.getChannelFormatOptions(e),n=this.getChannelValue(e);return new BE(t,r).format(n)}getColorSpace(){return"rgb"}getColorChannels(){return $E.colorChannels}constructor(e,t,r,n){super(),this.red=e,this.green=t,this.blue=r,this.alpha=n}}$E.colorChannels=["red","green","blue"];const WE=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;class GE extends HE{static parse(e){let t;if(t=e.match(WE)){var r;const[e,n,i,o]=(null!==(r=t[1])&&void 0!==r?r:t[2]).split(",").map(e=>Number(e.trim().replace("%","")));return new GE(YE(e,360),zb(n,0,100),zb(i,0,100),zb(o??1,0,1))}}toString(e="css"){switch(e){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${Ub(this.saturation,2)}%, ${Ub(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${Ub(this.saturation,2)}%, ${Ub(this.brightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsb":case"hsba":return this;case"hsl":case"hsla":return this.toHSL();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+e)}}toHSL(){let e=this.saturation/100,t=this.brightness/100,r=t*(1-e/2);return e=0===r||1===r?0:(t-r)/Math.min(r,1-r),new XE(Ub(this.hue,2),Ub(100*e,2),Ub(100*r,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,r=this.brightness/100,n=(n,i=(n+e/60)%6)=>r-t*r*Math.max(Math.min(i,4-i,1),0);return new $E(Math.round(255*n(5)),Math.round(255*n(3)),Math.round(255*n(1)),this.alpha)}clone(){return new GE(this.hue,this.saturation,this.brightness,this.alpha)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"brightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let r=this.getChannelFormatOptions(e),n=this.getChannelValue(e);return("saturation"===e||"brightness"===e)&&(n/=100),new BE(t,r).format(n)}getColorSpace(){return"hsb"}getColorChannels(){return GE.colorChannels}constructor(e,t,r,n){super(),this.hue=e,this.saturation=t,this.brightness=r,this.alpha=n}}GE.colorChannels=["hue","saturation","brightness"];const qE=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;function YE(e,t){return(e%t+t)%t}class XE extends HE{static parse(e){let t;if(t=e.match(qE)){var r;const[e,n,i,o]=(null!==(r=t[1])&&void 0!==r?r:t[2]).split(",").map(e=>Number(e.trim().replace("%","")));return new XE(YE(e,360),zb(n,0,100),zb(i,0,100),zb(o??1,0,1))}}toString(e="css"){switch(e){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${Ub(this.saturation,2)}%, ${Ub(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${Ub(this.saturation,2)}%, ${Ub(this.lightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsl":case"hsla":return this;case"hsb":case"hsba":return this.toHSB();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+e)}}toHSB(){let e=this.saturation/100,t=this.lightness/100,r=t+e*Math.min(t,1-t);return e=0===r?0:2*(1-t/r),new GE(Ub(this.hue,2),Ub(100*e,2),Ub(100*r,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,r=this.lightness/100,n=t*Math.min(r,1-r),i=(t,i=(t+e/30)%12)=>r-n*Math.max(Math.min(i-3,9-i,1),-1);return new $E(Math.round(255*i(0)),Math.round(255*i(8)),Math.round(255*i(4)),this.alpha)}clone(){return new XE(this.hue,this.saturation,this.lightness,this.alpha)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"lightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let r=this.getChannelFormatOptions(e),n=this.getChannelValue(e);return("saturation"===e||"lightness"===e)&&(n/=100),new BE(t,r).format(n)}getColorSpace(){return"hsl"}getColorChannels(){return XE.colorChannels}constructor(e,t,r,n){super(),this.hue=e,this.saturation=t,this.lightness=r,this.alpha=n}}function KE(e){let t=e.toFormat("rgb"),r=t.getChannelValue("red")/255,n=t.getChannelValue("green")/255,i=t.getChannelValue("blue")/255;[r,n,i]=function(e,t,r){return[ZE(e),ZE(t),ZE(r)]}(r,n,i);let[o,a,s]=function(e,t,r){return JE([.4123907992659595,.35758433938387796,.1804807884018343,.21263900587151036,.7151686787677559,.07219231536073371,.01933081871559185,.11919477979462599,.9505321522496606],e,t,r)}(r,n,i),[l,c,u]=function(e,t,r){let[n,i,o]=JE([.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],e,t,r);return JE([.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774],Math.cbrt(n),Math.cbrt(i),Math.cbrt(o))}(o,a,s);return function(e,t,r){var n=180*Math.atan2(r,t)/Math.PI;return[e,Math.sqrt(t**2+r**2),n>=0?n:n+360]}(l,c,u)}function ZE(e){let t=e<0?-1:1,r=Math.abs(e);return r<=.04045?e/12.92:t*Math.pow((r+.055)/1.055,2.4)}function JE(e,t,r,n){return[e[0]*t+e[1]*r+e[2]*n,e[3]*t+e[4]*r+e[5]*n,e[6]*t+e[7]*r+e[8]*n]}function QE({onChange:e,value:t,colors:r}){const n=r.map(r=>{const n=t===r;return(0,i.jsx)(px,{onClick:()=>{null==e||e(r)},className:od("relative block flex-shrink-0 w-26 h-26 border rounded",n&&"shadow-md"),style:{backgroundColor:r},children:n&&(0,i.jsx)("span",{className:"absolute inset-0 m-auto rounded-full w-8 h-8 bg-white"})},r)});return(0,i.jsx)("div",{className:"flex flex-wrap gap-6",children:n})}XE.colorChannels=["hue","saturation","lightness"];const eI=[{color:"rgb(255, 255, 255)",name:Zu("White")},{color:"rgb(239,245,245)",name:Zu("Solitude")},{color:"rgb(245,213,174)",name:Zu("Wheat")},{color:"rgb(253,227,167)",name:Zu("Cape Honey")},{color:"rgb(242,222,186)",name:Zu("Milk punch")},{color:"rgb(97,118,75)",name:Zu("Dingy"),foreground:"rgb(255, 255, 255)"},{color:"rgb(4, 147, 114)",name:Zu("Aquamarine"),foreground:"rgb(255, 255, 255)"},{color:"rgb(222,245,229)",name:Zu("Cosmic Latte")},{color:"rgb(233,119,119)",name:Zu("Geraldine"),foreground:"rgb(90,14,14)"},{color:"rgb(247,164,164)",name:Zu("Sundown")},{color:"rgb(30,139,195)",name:Zu("Pelorous"),foreground:"rgb(255, 255, 255)"},{color:"rgb(142,68,173)",name:Zu("Deep Lilac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(108,74,182)",name:Zu("Blue marguerite"),foreground:"rgb(255, 255, 255)"},{color:"rgb(139,126,116)",name:Zu("Americano"),foreground:"rgb(255, 255, 255)"},{color:"rgb(0,0,0)",name:Zu("Black"),foreground:"rgb(255, 255, 255)"},{color:"rgb(64,66,88)",name:Zu("Blue zodiac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(101,100,124)",name:Zu("Comet"),foreground:"rgb(255, 255, 255)"}].map(({color:e})=>e).slice(0,14);function tI({defaultValue:e,onChange:t,colorPresets:r,showInput:n}){const[a,s]=(0,o.useState)(e),l=r||eI,c=iS({size:"sm"});return(0,i.jsxs)("div",{children:[(0,i.jsx)(SE,{className:"!w-auto",color:a,onChange:e=>{null==t||t(e),s(e)}}),(0,i.jsxs)("div",{className:"px-12 py-20",children:[l&&(0,i.jsx)(QE,{colors:l,onChange:e=>{if(e){const r=function(e){let t=$E.parse(e)||GE.parse(e)||XE.parse(e);if(t)return t;throw new Error("Invalid color value: "+e)}(e).toString("hex");null==t||t(r),s(r)}},value:a}),n&&(0,i.jsx)("div",{className:"pt-20",children:(0,i.jsx)(IE,{autoComplete:"off",role:"textbox",autoCorrect:"off",spellCheck:"false",required:!0,"aria-label":"Hex color",prefixed:!0,className:c.input,color:a,onChange:e=>{null==t||t(e),s(e)}})})]})]})}const rI=o.createContext(null);function nI(){return(0,o.useContext)(rI)}function iI(){const{lines:e,localeCode:t}=T_();return{trans:(0,o.useCallback)(r=>oI({...r,lines:e,localeCode:t}),[e,t])}}const oI=Sx(e=>{let{lines:t,message:r,values:n,localeCode:i}=e;return null==r?"":(r=(null==t?void 0:t[r])||(null==t?void 0:t[r.toLowerCase()])||r,n&&(r=F_(i,e),Object.entries(n).forEach(([e,t])=>{r=r.replace(`:${e}`,`${t}`)})),r)},{equals:j_,callTimeout:0});function aI({onDismiss:e}){const{trans:t}=iI();return(0,i.jsx)("button",{className:"sr-only","aria-label":t(Zu("Dismiss")),tabIndex:-1,onClick:()=>{e&&e()}})}function sI(e){const{type:t="modal",dialogProps:r,...n}=(0,o.useContext)(rI),{children:a,className:s,size:l="md",background:c,radius:u="rounded",maxWidth:d="max-w-dialog",...h}=e;let f=null;("popover"===t||"tray"===t)&&(f=(0,i.jsx)(aI,{onDismiss:n.close}));const p="fullscreenTakeover"===l||"tray"===t,g=od("mx-auto pointer-events-auto outline-none flex flex-col overflow-hidden",c||"bg","tray"!==t&&function(e){switch(e){case"2xs":return"w-256";case"xs":return"w-320";case"sm":return"w-384";case"md":return"w-440";case"lg":return"w-620";case"xl":return"w-780";case"2xl":return"w-850";case"fullscreen":return"w-1280";case"fullscreenTakeover":return"w-full h-full";default:return e}}(l),"tray"===t&&"rounded-t border-b-bg","fullscreenTakeover"!==l&&"shadow-2xl border max-h-dialog",!p&&`${u} ${d}`,s);return(0,i.jsxs)("div",{...Eb({role:"dialog",tabIndex:-1},r,h),style:{...e.style,"--be-dialog-padding":"24px"},"aria-modal":!0,className:g,children:[o.Children.toArray(a).map(e=>(0,o.isValidElement)(e)?(0,o.cloneElement)(e,{size:e.props.size??l}):e),f]})}const lI=ld((0,i.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDownOutlined"),cI=(0,o.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:r=!0,isDismissable:n=!0,isOpen:o=!1,placement:a="center",onClose:s},l)=>{const c=C_(),u=Rb(l);return(0,i.jsxs)("div",{className:"fixed inset-0 isolate z-modal",style:c,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),s())},children:[(0,i.jsx)(E_,{onClick:()=>{n&&s()}},"modal-underlay"),(0,i.jsx)(ob.div,{ref:u,className:od("pointer-events-none absolute inset-0 z-20 flex h-full w-full","center"===a&&"items-center justify-center","top"===a&&"items-start justify-center pt-40"),role:"presentation",initial:{opacity:0,scale:"top"===a?1:.7},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1},transition:{duration:.1},children:(0,i.jsx)(a_,{restoreFocus:r,autoFocus:t,contain:!0,children:e})})]})});function uI(e){let{children:t,type:r,disableInitialTransition:n,isDismissable:a=!0,moveFocusToDialog:s=!0,returnFocusToTrigger:l=!0,triggerOnHover:c=!1,triggerOnContextMenu:u=!1,usePortal:d=!0,mobileType:h,alwaysReturnCurrentValueOnClose:f}=e;const p=(0,o.useRef)(null),g=u&&!e.triggerRef?p:e.triggerRef,m=(0,o.useRef)(e.value),[v,y]=Db(e.isOpen,e.defaultIsOpen,e.onOpenChange),[b,w]=Db(e.value,e.defaultValue,e.onValueChange);U_()&&"popover"===r&&(r=h||"modal");const x=(0,o.useRef)(null),{x:C,y:_,reference:S,strategy:A,refs:k}=VC({...e,disablePositioning:"modal"===r}),E="popover"===r?{position:A,top:_??"",left:C??""}:{},I=(0,o.useId)(),j=`${I}-label`,T=`${I}-description`,F=`${I}-form`,O=function(e){const t=(0,o.useRef)(e);return(0,o.useEffect)(()=>{t.current=e}),(0,o.useMemo)(()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}(e.onClose),P=(0,o.useCallback)(e=>{typeof e>"u"&&f&&(e=b);const t=typeof e<"u"?e:m.current;null==O||O(t,{initialValue:m.current,valueChanged:t!==m.current}),y(!1)},[O,y,b,f]),M=(0,o.useCallback)(()=>{y(!0),m.current=e.value},[e.value,y]);mb(()=>{null!=g&&g.current&&k.reference.current!==g.current&&S(g.current)},[S,null==g?void 0:g.current,k]);const R=(0,o.useMemo)(()=>({"aria-labelledby":j,"aria-describedby":T}),[j,T]);let L;L="modal"===r?cI:"tray"===r?I_:S_;const N=(0,o.useMemo)(()=>({dialogProps:R,type:r,labelId:j,descriptionId:T,isDismissable:a,close:P,value:b,initialValue:m.current,setValue:w,formId:F}),[P,T,R,F,j,r,a,b,w]);c=c&&"popover"===r;const D={onPointerEnter:fx(e=>{M()}),onPointerLeave:fx(e=>{x.current=setTimeout(()=>{P()},150)})},z={onPointerEnter:fx(e=>{x.current&&clearTimeout(x.current)}),onPointerLeave:fx(e=>{P()})},B={onContextMenu:fx(e=>{e.preventDefault(),p.current=function({x:e,y:t},r){return{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,right:e,bottom:t,left:e}),contextElement:r}}({x:e.clientX,y:e.clientY},e.currentTarget),M()})},U={onClick:fx(e=>{e.stopPropagation(),v?P():M()})},{dialogTrigger:V,dialog:H}=function(e,t){const r=Array.isArray(e)?e:o.Children.toArray(e);let n=2===r.length?r[1]:r[0];return n="function"==typeof n?n(t):n,2===r.length?{dialogTrigger:r[0],dialog:n}:{dialog:n}}(t,N),$=(0,i.jsx)(hb,{initial:!n,children:v&&(0,i.jsx)(rI.Provider,{value:N,children:(0,i.jsx)(L,{...c?z:{},ref:k.setFloating,triggerRef:k.reference,style:E,restoreFocus:l,autoFocus:s,isOpen:v,onClose:P,isDismissable:a,isContextMenu:u,placement:e.placement,children:H})})});return(0,i.jsxs)(o.Fragment,{children:[V&&(0,o.cloneElement)(V,Eb({...g||u?{}:{ref:S},...u?{}:U,...c?D:{},...u?B:{}},{...V.props})),d?dp&&(0,de.createPortal)($,dp):$]})}function dI(e){const{label:t,className:r,value:n,onChange:a,size:s,width:l="w-max"}=e,c=vp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.colorPresets)?void 0:r.items})||[],u=iS({size:s}),[d,h]=(0,o.useState)(n),[f,p]=(0,o.useState)(!1);return(0,i.jsxs)("div",{className:od(r,l),children:[t&&(0,i.jsx)("span",{className:u.label,children:t}),(0,i.jsxs)(uI,{type:"popover",isOpen:f,onOpenChange:p,children:[(0,i.jsxs)(px,{className:od(u.input,"inline-flex items-center"),"aria-label":e["aria-label"],children:[(0,i.jsx)("span",{className:"block flex-shrink-0 mr-5 border rounded h-2/4 aspect-square",style:{backgroundColor:d}}),(0,i.jsx)(hI,{isActive:f,className:u.adornment})]}),(0,i.jsx)(sI,{size:"auto",children:(0,i.jsx)(tI,{onChange:e=>{h(e),null==a||a(e)},defaultValue:d,colorPresets:c})})]})]})}function hI({isActive:e,className:t}){return(0,i.jsx)(lI,{size:"sm",className:`transition-transform ml-auto flex-shrink-0 ${e?"rotate-180":"rotate-0"} ${t}`})}function fI(e){const{size:t="md",inline:r,label:n,showValueLabel:o=!!n,className:a,width:s="w-full",slider:l,children:c,trackColor:u="primary",fillColor:d="primary"}=e,{domProps:h,trackRef:f,getThumbPercent:p,getThumbValueLabel:g,labelId:m,groupId:v,thumbIds:y,isDisabled:b,numberFormatter:w,minValue:x,maxValue:C,step:_,values:S,getValueLabel:A}=l;let k="",E=Math.max([...w.format(x)].length,[...w.format(C)].length,[...w.format(_)].length);A?k=A(S[0]):1===S.length?k=g(0):2===S.length&&(k=`${g(0)} \u2013 ${g(1)}`,E=3+2*Math.max(E,[...w.format(x)].length,[...w.format(C)].length));const I=iS({size:t,disabled:b,labelDisplay:"flex"}),j=od("touch-none",a,s,{"flex items-center":r});return(0,i.jsxs)("div",{className:j,role:"group",id:v,children:[(n||o)&&(0,i.jsxs)("div",{className:od(I.label,"select-none"),children:[n&&(0,i.jsx)("label",{onClick:()=>{var e;null==(e=document.getElementById(y[0]))||e.focus()},id:m,htmlFor:v,children:n}),o&&(0,i.jsx)("output",{htmlFor:y[0],className:"ml-auto text-right","aria-live":"off",style:E?{width:`${E}ch`,minWidth:`${E}ch`}:void 0,children:k})]}),(0,i.jsxs)("div",{ref:f,className:od("relative",pI(e)),...h,role:"presentation",children:[(0,i.jsx)("div",{className:od("absolute inset-0 m-auto rounded",mI(u,b),gI(t))}),(0,i.jsx)("div",{className:od("absolute inset-0 my-auto rounded",vI(d,b),gI(t)),style:{width:`${Math.max(100*p(0),0)}%`}}),c]})]})}function pI({size:e,wrapperHeight:t}){if(t)return t;switch(e){case"xs":return"h-14";case"sm":return"h-20";default:return"h-30"}}function gI(e){switch(e){case"xs":return"h-2";case"sm":return"h-3";default:return"h-4"}}function mI(e,t){switch(t&&(e="disabled"),e){case"disabled":return"bg-slider-disabled/60";case"primary":return"bg-primary-light";case"neutral":return"bg-divider";default:return e}}function vI(e,t){switch(t&&(e="disabled"),e){case"disabled":return"bg-slider-disabled";case"primary":return"bg-primary";default:return e}}function yI(e={}){const{localeCode:t}=T_();return(0,o.useMemo)(()=>new BE(t,e),[t,e])}function bI({minValue:e=0,maxValue:t=100,isDisabled:r=!1,step:n=1,formatOptions:i,onChangeEnd:a,onPointerDown:s,label:l,getValueLabel:c,showThumbOnHoverOnly:u,thumbSize:d,onPointerMove:h,...f}){const[p,g]=(0,o.useState)(!1),m=yI(i),{addGlobalListener:v,removeGlobalListener:y}=Mb(),b=(0,o.useRef)(null),[w,x]=Db(f.value?f.value:void 0,f.defaultValue??[e],f.onChange),C=(0,o.useRef)(null);C.current=w;const[_,S]=(0,o.useState)(new Array(w.length).fill(!1)),A=(0,o.useRef)(null);A.current=_;const k=t=>0===t?e:w[t-1],E=e=>e===w.length-1?t:w[e+1],I=(e,t)=>{!r&&R(e)&&C.current&&(t=function(e,t,r,n){t=Number(t),r=Number(r);let i=(e-(isNaN(t)?0:t))%n,o=Bb(2*Math.abs(i)>=n?e+Math.sign(i)*(n-Math.abs(i)):e-i,n);return isNaN(t)?!isNaN(r)&&o>r&&(o=Math.floor(Bb(r/n,n))*n):o<t?o=t:!isNaN(r)&&o>r&&(o=t+Math.floor(Bb((r-t)/n,n))*n),o=Bb(o,n),o}(t,k(e),E(e),n),C.current=wI(C.current,e,t),x(C.current))},j=(e,t)=>{var n;if(r||!R(e))return;const i=null==(n=A.current)?void 0:n[e];A.current=wI(A.current||[],e,t),S(A.current),a&&i&&!A.current.some(Boolean)&&a(C.current||[])},[T,F]=(0,o.useState)(void 0),O=r=>(r=>{const n=Math.min(1,(r-e)/(t-e));return isNaN(n)?0:n})(C.current[r]),P=r=>JA((t=>Math.round((t-e)/n)*n+e)(r*(t-e)+e),e,t),M=(0,o.useRef)(new Array(w.length).fill(!0)),R=e=>M.current[e],L=(0,o.useRef)(null),N=(0,o.useRef)(void 0),D=(0,o.useRef)(null),{domProps:z}=VA({onPointerDown:e=>{if(("mouse"!==e.pointerType||!(0!==e.button||e.altKey||e.ctrlKey||e.metaKey))&&(null==s||s(),b.current&&!r&&w.every((e,t)=>!_[t]))){const t=b.current.offsetWidth,r=b.current.getBoundingClientRect().left,n=(e.clientX-r)/t,i=P(n);let o;const a=w.findIndex(e=>i-e<0);if(0===a)o=a;else if(-1===a)o=w.length-1;else{const e=w[a-1],t=w[a];o=Math.abs(e-i)<Math.abs(t-i)?a-1:a}o>=0&&R(o)?(e.preventDefault(),L.current=o,F(o),N.current=e.pointerId,j(L.current,!0),I(o,i),v(window,"pointerup",U,!1)):L.current=null}},onMoveStart(){D.current=null},onMove(e,t){var r;const n=(null==(r=b.current)?void 0:r.offsetWidth)||0;if(null==D.current&&(D.current=O(L.current||0)*n),D.current+=t,null!=L.current&&b.current){const e=JA(D.current/n,0,1);((e,t)=>{I(e,P(t))})(L.current,e)}},onMoveEnd(){null!=L.current&&(j(L.current,!1),L.current=null)}}),B=Eb(z,{onPointerEnter:()=>{g(!0)},onPointerLeave:()=>{g(!1)},onPointerMove:e=>{null==h||h(e)}}),U=e=>{e.pointerId===N.current&&(null!=L.current&&(j(L.current,!1),L.current=null),y(window,"pointerup",U,!1))},V=(0,o.useId)(),H=l?`${V}-label`:void 0,$=`${V}-group`,W=[...Array(w.length)].map((e,t)=>`${V}-thumb-${t}`);return{domProps:B,trackRef:b,isDisabled:r,step:n,values:w,minValue:e,maxValue:t,focusedThumb:T,labelId:H,groupId:$,thumbIds:W,numberFormatter:m,getThumbPercent:O,getThumbMinValue:k,getThumbMaxValue:E,getThumbValueLabel:e=>function(e){return m.format(e)}(w[e]),isThumbDragging:e=>{var t;return(null==(t=A.current)?void 0:t[e])||!1},setThumbValue:I,updateDraggedThumbs:j,setThumbEditable:(e,t)=>{M.current[e]=t},setFocusedThumb:F,getValueLabel:c,isPointerOver:p,showThumbOnHoverOnly:u,thumbSize:d}}function wI(e,t,r){return e[t]===r?e:[...e.slice(0,t),r,...e.slice(t+1)]}function xI({index:e,slider:t,isDisabled:r,ariaLabel:n,inputRef:a,onBlur:s,fillColor:l="primary"}){const c=Rb(a),{addGlobalListener:u,removeGlobalListener:d}=Mb(),{step:h,values:f,focusedThumb:p,labelId:g,thumbIds:m,isDisabled:v,getThumbPercent:y,getThumbMinValue:b,getThumbMaxValue:w,getThumbValueLabel:x,setThumbValue:C,updateDraggedThumbs:_,isThumbDragging:S,setThumbEditable:A,setFocusedThumb:k,isPointerOver:E,showThumbOnHoverOnly:I,thumbSize:j="w-18 h-18"}=t,T=S(e),F=f[e];A(e,!r);const O=r||v,P=(0,o.useCallback)(()=>{c.current&&c.current.focus({preventScroll:!0})},[c]),M=p===e;(0,o.useEffect)(()=>{M&&P()},[M,P]);const R=(0,o.useRef)(void 0),L=t=>{t.pointerId===R.current&&(P(),_(e,!1),d(window,"pointerup",L,!1))},N=od("outline-none rounded-full top-1/2 -translate-y-1/2 -translate-x-1/2 absolute inset-0 transition-button duration-200",j,!O&&"shadow-md",function({isDisabled:e,isDragging:t,fillColor:r}){return e?"bg-slider-disabled cursor-default":r&&"primary"!==r?r:od("hover:bg-primary-dark",t?"bg-primary-dark":"bg-primary")}({fillColor:l,isDisabled:O,isDragging:T}),!I||I&&T||E?"visible":"invisible");return(0,i.jsx)("div",{role:"presentation",className:N,style:{left:`${Math.max(100*y(e),0)}%`},onPointerDown:t=>{0!==t.button||t.altKey||t.ctrlKey||t.metaKey||(P(),R.current=t.pointerId,_(e,!0),u(window,"pointerup",L,!1))},children:(0,i.jsx)("input",{id:m[e],onKeyDown:fx(()=>{_(e,!0)}),onKeyUp:fx(()=>{_(e,!1)}),ref:c,tabIndex:O?void 0:0,min:b(e),max:w(e),step:h,value:F,disabled:O,"aria-label":n,"aria-labelledby":g,"aria-orientation":"horizontal","aria-valuetext":x(e),onFocus:()=>{k(e)},onBlur:t=>{k(void 0),_(e,!1),null==s||s(t)},onChange:t=>{C(e,parseFloat(t.target.value))},type:"range",className:"sr-only"})})}function CI({inputRef:e,onBlur:t,...r}){const{onChange:n,onChangeEnd:o,value:a,defaultValue:s,...l}=r,c={...l,value:null!=a?[a]:void 0,defaultValue:null!=s?[s]:void 0,onChange:e=>{null==n||n(e[0])},onChangeEnd:e=>{null==o||o(e[0])}},u=bI(c);return(0,i.jsx)(fI,{...c,slider:u,children:(0,i.jsx)(xI,{fillColor:r.fillColor,index:0,slider:u,inputRef:e,onBlur:t})})}const _I=o.forwardRef((e,t)=>{let{value:r=0,minValue:n=0,maxValue:o=100,size:a="md",isIndeterminate:s=!1,className:l,position:c="relative",trackColor:u,fillColor:d="border-primary",...h}=e;r=JA(r,n,o);const f=function(e){switch(e){case"xs":return"w-20 h-20";case"sm":return"w-24 h-24";case"md":return"w-32 h-32";case"lg":return"w-42 h-42";default:return e}}(a),p=(r-n)/(o-n),g=yI({style:"percent"});let m="";!s&&!m&&(m=g.format(p));const v={},y={};if(!s){const e=(r-n)/(o-n)*100;let t;e>0&&e<=50?(t=e/50*180-180,v.transform=`rotate(${t}deg)`,y.transform="rotate(-180deg)"):e>50&&(t=(e-50)/50*180-180,v.transform="rotate(0deg)",y.transform=`rotate(${t}deg)`)}return(0,i.jsxs)("div",{...h,"aria-valuenow":s?void 0:r,"aria-valuemin":n,"aria-valuemax":o,"aria-valuetext":s?void 0:m,role:"progressbar",ref:t,className:od("progress-circle",c,f,s&&"indeterminate",l),children:[(0,i.jsx)("div",{className:od(f,u,"rounded-full border-4")}),(0,i.jsxs)("div",{className:od("fills absolute left-0 top-0 h-full w-full",s&&"progress-circle-fills-animate"),children:[(0,i.jsx)(SI,{circleSize:f,subMaskStyle:v,isIndeterminate:s,className:"rotate-180",fillColor:d,subMaskClassName:od(s&&"progress-circle-fill-submask-1-animate")}),(0,i.jsx)(SI,{circleSize:f,subMaskStyle:y,isIndeterminate:s,fillColor:d,subMaskClassName:od(s&&"progress-circle-fill-submask-2-animate")})]})]})});function SI({subMaskStyle:e,subMaskClassName:t,className:r,circleSize:n,isIndeterminate:o,fillColor:a}){return(0,i.jsx)("div",{className:od("absolute h-full w-1/2 origin-[100%] overflow-hidden",r),children:(0,i.jsx)("div",{className:od("h-full w-full origin-[100%] rotate-180 overflow-hidden",!o&&"transition-transform duration-100",t),style:e,children:(0,i.jsx)("div",{className:od(n,a,"rounded-full border-4")})})})}function AI({isLoading:e,icon:t}){const r=(0,o.useRef)(null),{trans:n}=iI(),[a,s]=(0,o.useState)(!1),{state:{isOpen:l,inputValue:c}}=yx(),u=(0,o.useRef)(c);return(0,o.useEffect)(()=>{e&&!a?(null===r.current&&(r.current=setTimeout(()=>{s(!0)},500)),c!==u.current&&(clearTimeout(r.current),r.current=setTimeout(()=>{s(!0)},500))):e||(s(!1),clearTimeout(r.current),r.current=null),u.current=c},[e,a,c]),a&&(l||e)?(0,i.jsx)(_I,{"aria-label":n({message:"Loading"}),size:"sm",isIndeterminate:!0}):t||(0,i.jsx)(lI,{})}const kI=o.forwardRef(function(e,t){const r=U_(),{hideCaret:n,placeholder:o=(0,i.jsx)(M_,{message:"Select an option..."}),selectedValue:a,onItemSelected:s,onOpenChange:l,onInputValueChange:c,onSelectionChange:u,selectionMode:d,minWidth:h="min-w-128",children:f,searchPlaceholder:p,showEmptyMessage:g,showSearchField:m,defaultInputValue:v,inputValue:y,isLoading:b,isAsync:w,valueClassName:x,floatingWidth:C=(r?"auto":"matchTrigger"),..._}=e,S=HC({...e,clearInputOnItemSelection:!0,showEmptyMessage:g||m,floatingWidth:C,selectionMode:"single",role:"listbox",virtualFocus:m},t),{state:{selectedValues:A,isOpen:k,setIsOpen:E,activeIndex:I,setSelectedIndex:j,inputValue:T,setInputValue:F},collections:O,focusItem:P,listboxId:M,reference:R,refs:L,listContent:N,onInputChange:D}=S,{fieldProps:z,inputProps:B}=pS({..._,focusRef:L.reference}),U=O.collection.get(A[0]),V=U?(0,i.jsxs)("span",{className:"flex items-center gap-10",children:[U.element.props.startIcon,(0,i.jsx)("span",{className:od("overflow-hidden overflow-ellipsis whitespace-nowrap",x),children:U.element.props.children})]}):(0,i.jsx)("span",{className:"italic",children:o}),H=iS({...e,endAdornment:!0}),{handleTriggerKeyDown:$,handleListboxKeyboardNavigation:W,handleListboxSearchFieldKeydown:G}=D_(S),{findMatchingItem:q}=B_();return(0,i.jsx)(R_,{listbox:S,onKeyDownCapture:m?void 0:e=>{if(!k)return;const t=q(e,N,I);null!=t&&P("increment",t)},onKeyDown:W,onClose:m?()=>F(""):void 0,isLoading:b,searchField:m&&(0,i.jsx)(gS,{size:"xs"===e.size||"sm"===e.size?"xs":"sm",placeholder:p,startAdornment:(0,i.jsx)(V_,{}),className:"flex-shrink-0 px-8 pb-8 pt-4",autoFocus:!0,"aria-expanded":k?"true":"false","aria-haspopup":"listbox","aria-controls":k?M:void 0,"aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:"false",value:T,onChange:D,onKeyDown:e=>{G(e)}}),children:(0,i.jsx)(uS,{fieldClassNames:H,...z,endAdornment:!n&&(0,i.jsx)(AI,{isLoading:b}),children:(0,i.jsx)("button",{...B,type:"button","data-selected-value":null==U?void 0:U.value,"aria-expanded":k?"true":"false","aria-haspopup":"listbox","aria-controls":k?M:void 0,ref:R,onKeyDown:$,onKeyDownCapture:m?void 0:e=>{if(k)return;const t=q(e,N,I);null!=t&&j(t)},disabled:_.disabled,onClick:()=>{E(!k)},className:od(H.input,!z.unstyled&&h),children:V})})})});function EI(){const e=vp(e=>e.filter.selected);if(!e)return null;const t=bp().filter.getByName(e).options,r=(t,r)=>{var n;null==(n=bp().filter)||n.applyValue(e,t,r),yp().setDirty(!0)},n=bp().canvas.getMainImage().filters,o=bp().filter.findFilterIndex(e,n),a=null==n?void 0:n[o];if(t){const e=Object.entries(t).map(([e,t])=>{let n;const o=a?a[e]:t.current;return"slider"===t.type?n=(0,i.jsx)(CI,{label:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)(M_,{...mw[e]})}),minValue:t.min,maxValue:t.max,step:t.step,defaultValue:o,formatOptions:{style:"percent"},size:"sm",onChange:t=>{r(e,t)}}):"colorPicker"===t.type?n=(0,i.jsx)(dI,{label:(0,i.jsx)(M_,{...mw[e]}),size:"sm",width:"w-full",value:o,onChange:t=>{r(e,t)}}):"select"===t.type&&(n=(0,i.jsx)(kI,{selectionMode:"single",size:"sm",label:(0,i.jsx)(M_,{...mw[e]}),defaultValue:o,onSelectionChange:t=>{r(e,t)},children:t.available.map(e=>(0,i.jsx)(Cx,{value:e.key,children:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)(M_,{message:e.key})})},e.key))})),(0,i.jsx)("div",{className:"pb-10",children:n},e)});return(0,i.jsx)(wk,{children:(0,i.jsx)("div",{className:"max-w-240 pt-10 mx-auto",children:e})})}return null}function II(){const e=vp(e=>e.frame.active),t="basic"===(null==e?void 0:e.mode),r=(0,o.useCallback)(e=>`${e}%`,[]);return(0,i.jsx)(wk,{className:"pb-18 pt-6",children:(0,i.jsxs)("div",{className:"max-w-288 m-auto",children:[t&&(0,i.jsx)(dI,{className:"mb-20",width:"w-full",size:"sm",label:(0,i.jsx)(M_,{message:"Color"}),value:bp().frame.builder.defaultColor,onChange:e=>{bp().frame.active.changeColor(e)}}),(0,i.jsx)(CI,{size:"sm",label:(0,i.jsx)(M_,{message:"Size"}),step:1,minValue:bp().frame.active.getMinSize(),maxValue:bp().frame.active.getMaxSize(),defaultValue:bp().frame.active.currentSizeInPercent,getValueLabel:r,onChange:e=>{bp().frame.resize(e)}})]})})}const jI=o.createContext(null);function TI(){const{tabsRef:e,selectedTab:t}=(0,o.useContext)(jI),[r,n]=(0,o.useState)({width:void 0,transform:void 0,className:void 0});return mb(()=>{if(null!=t&&e.current){const r=e.current[t];if(!r)return;n(e=>({width:`${r.offsetWidth}px`,transform:`translateX(${r.offsetLeft}px)`,className:void 0===e.width?"":"transition-all"}))}},[n,t,e]),(0,i.jsx)("div",{className:od("absolute bottom-0 left-0 h-2 bg-primary",r.className),role:"presentation",style:{width:r.width,transform:r.transform}})}function FI({children:e,center:t,expand:r,className:n}){const a=o.Children.toArray(e);return(0,i.jsx)(a_,{children:(0,i.jsxs)("div",{className:od("flex relative max-w-full overflow-auto border-b max-sm:hidden-scrollbar md:compact-scrollbar",n),role:"tablist","aria-orientation":"horizontal",children:[a.map((e,n)=>(0,o.isValidElement)(e)?(0,o.cloneElement)(e,{index:n,className:od(e.props.className,r&&"flex-auto",t&&0===n&&"ml-auto",t&&n===a.length-1&&"mr-auto")}):null),(0,i.jsx)(TI,{})]})})}function OI(e){const{size:t="md",children:r,className:n,isLazy:a,overflow:s="overflow-hidden"}=e,l=(0,o.useRef)([]),c=(0,o.useId)(),[u,d]=Db(e.selectedTab,e.defaultSelectedTab||0,e.onTabChange),h=(0,o.useMemo)(()=>({selectedTab:u,setSelectedTab:d,tabsRef:l,size:t,isLazy:a,id:c}),[u,c,a,d,t]);return(0,i.jsx)(jI.Provider,{value:h,children:(0,i.jsx)("div",{className:od(n,s,"max-w-full"),children:r})})}const PI=ld((0,i.jsx)("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"}),"FormatUnderlinedOutlined"),MI=ld((0,i.jsx)("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"}),"FormatStrikethroughOutlined"),RI=ld((0,i.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"}),"FormatItalicOutlined"),LI=ld((0,i.jsx)("path",{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"}),"FormatAlignRightOutlined"),NI=ld((0,i.jsx)("path",{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"}),"FormatAlignLeftOutlined"),DI=ld((0,i.jsx)("path",{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"}),"FormatAlignCenterOutlined");function zI(){return(0,i.jsxs)("div",{className:"flex gap-20 justify-center",children:[(0,i.jsx)(BI,{}),(0,i.jsx)(UI,{}),(0,i.jsx)(VI,{})]})}function BI(){const e=vp(e=>e.objects.active.editableProps.fontSize)??40,{trans:t}=iI();return(0,i.jsx)(gS,{type:"number",size:"xs","aria-label":t({message:"Font Size"}),min:1,max:300,className:"w-64 flex-shrink-0",value:e,onChange:e=>{bp().objects.setValues({fontSize:e.target.valueAsNumber}),yp().setDirty(!0)}})}function UI(){const e=vp(e=>e.objects.active.editableProps.fontStyle),t=vp(e=>e.objects.active.editableProps.underline),r=vp(e=>e.objects.active.editableProps.linethrough),[n,a]=(0,o.useState)([e,t&&"underline",r&&"linethrough"]);return(0,i.jsxs)(AS,{size:"xs",variant:"outline",radius:"rounded",value:n,multiple:!0,onChange:e=>{a(e),bp().objects.setValues({underline:e.includes("underline"),linethrough:e.includes("linethrough"),fontStyle:e.includes("italic")?"italic":""}),yp().setDirty(!0)},children:[(0,i.jsx)(bS,{value:"underline",children:(0,i.jsx)(PI,{})}),(0,i.jsx)(bS,{value:"linethrough",children:(0,i.jsx)(MI,{})}),(0,i.jsx)(bS,{value:"italic",children:(0,i.jsx)(RI,{})})]})}function VI(){const e=vp(e=>e.objects.active.editableProps.textAlign);return(0,i.jsxs)(AS,{size:"xs",variant:"outline",radius:"rounded",value:e,onChange:e=>{bp().objects.setValues({textAlign:e}),yp().setDirty(!0)},children:[(0,i.jsx)(bS,{value:"left",children:(0,i.jsx)(NI,{})}),(0,i.jsx)(bS,{value:"center",children:(0,i.jsx)(DI,{})}),(0,i.jsx)(bS,{value:"right",children:(0,i.jsx)(LI,{})})]})}function HI({children:e,className:t}){const{selectedTab:r,isLazy:n}=(0,o.useContext)(jI),a=o.Children.toArray(e).filter(e=>!!e);let s;if(n){const e=a[r];s=(0,o.isValidElement)(e)?(0,o.cloneElement)(a[r],{index:r}):null}else s=a.map((e,t)=>{if((0,o.isValidElement)(e)){const n=t===r;return(0,o.cloneElement)(e,{index:t,"aria-hidden":!n,className:n?e.props.className:od(e.props.className,"hidden")})}return null});return(0,i.jsx)("div",{className:t,children:s})}function $I({className:e,children:t,index:r,...n}){const{id:a}=(0,o.useContext)(jI),[s,l]=(0,o.useState)(0),c=(0,o.useRef)(null);return mb(()=>{if(null!=c&&c.current){const e=()=>{const e=y_(c.current,{tabbable:!0});l(e.nextNode()?void 0:0)};e();const t=new MutationObserver(e);return t.observe(c.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{t.disconnect()}}},[c]),(0,i.jsx)("div",{tabIndex:s,ref:c,id:`${a}-${r}-tabpanel`,"aria-labelledby":`${a}-${r}-tab`,className:od(e,"focus-visible:outline-primary-light"),role:"tabpanel",...n,children:t})}const WI=[{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{color:"#ffe47b",offset:0},{color:"rgb(111,154,211)",offset:1}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{color:"#ff4040",offset:0},{color:"#e6399b",offset:1}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#200772"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#FF4F4F"},{offset:1,color:"rgb(255, 239, 64)"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:20,y2:20},colorStops:[{offset:0,color:"#ffe47b"},{offset:.5,color:"rgb(111,154,211)"},{offset:1,color:"rgb(166,111,213)"}]},{type:"radial",coords:{r1:50,r2:80,x1:45,y1:45,x2:52,y2:50},colorStops:[{offset:0,color:"rgb(155, 237, 0)"},{offset:1,color:"rgba(0, 164, 128,0.4)"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"#9ecb2d"},{offset:.5,color:"#72aa00"},{offset:1,color:"#bfd255"}]},{type:"radial",coords:{r1:100,r2:50,x1:30,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#aebcbf"},{offset:1,color:"#0a0809"}]},{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{offset:0,color:"#ffffff"},{offset:1,color:"#f6f6f6"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#fefcea"},{offset:1,color:"#f1da36"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#ff1a00"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#b7deed"},{offset:1,color:"#21b4e2"}]},{type:"linear",coords:{x1:-80,y1:100,x2:80,y2:-100},colorStops:[{offset:0,color:"#ffe47b"},{offset:1,color:"rgb(111,154,211)"}]}],GI=ld((0,i.jsx)("path",{d:"M19.51 3.08 3.08 19.51c.09.34.27.65.51.9.25.24.56.42.9.51L20.93 4.49c-.19-.69-.73-1.23-1.42-1.41zM11.88 3 3 11.88v2.83L14.71 3h-2.83zM5 3c-1.1 0-2 .9-2 2v2l4-4H5zm14 18c.55 0 1.05-.22 1.41-.59.37-.36.59-.86.59-1.41v-2l-4 4h2zm-9.71 0h2.83L21 12.12V9.29L9.29 21z"}),"TextureOutlined"),qI=ld((0,i.jsx)("path",{d:"M11 9h2v2h-2V9zm-2 2h2v2H9v-2zm4 0h2v2h-2v-2zm2-2h2v2h-2V9zM7 9h2v2H7V9zm12-6H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 18H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm2-7h-2v2h2v2h-2v-2h-2v2h-2v-2h-2v2H9v-2H7v2H5v-2h2v-2H5V5h14v6z"}),"GradientOutlined"),YI=ld((0,i.jsx)("path",{d:"M18 20H4V6h9V4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2v9zm-7.79-3.17-1.96-2.36L5.5 18h11l-3.54-4.71zM20 4V1h-2v3h-3c.01.01 0 2 0 2h3v2.99c.01.01 2 0 2 0V6h3V4h-3z"}),"AddPhotoAlternateOutlined");function XI({property:e}){const{trans:t}=iI(),r=vp(t=>t.objects.active.editableProps[e]);return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-14",children:[(0,i.jsx)(dI,{className:"flex-shrink-0",size:"xs","aria-label":t({message:"Color"}),value:"string"==typeof r?r:Qu.fill,onChange:t=>{bp().objects.setValues({[e]:t}),yp().setDirty(!0)}}),(0,i.jsx)(KI,{type:"gradient",property:e}),(0,i.jsx)(KI,{type:"texture",property:e})]})}function KI({type:e,property:t}){return(0,i.jsx)(o.Fragment,{children:(0,i.jsxs)(uI,{type:"popover",children:[(0,i.jsx)(gx,{className:"flex-shrink-0",id:`${e}-panel-trigger`,variant:"outline",size:"xs",startIcon:(0,i.jsx)("texture"===e?GI:qI,{}),endIcon:(0,i.jsx)(lI,{}),children:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)(M_,"gradient"===e?{message:"Gradient"}:{message:"Texture"})})}),(0,i.jsx)(sI,{size:"auto",children:(0,i.jsx)("div",{className:"grid gap-8 grid-cols-5-min-content p-10 bg-paper rounded shadow-md",children:(0,i.jsx)(ZI,{property:t,type:e})})})]})})}function ZI({type:e,property:t}){const{close:r}=nI(),n=Array.from(Array("gradient"===e?WI.length:28).keys()),a="w-56 h-56 bg border shadow-sm hover:scale-110",s=n.map(n=>{const o=sw(`images/${e}s/${n}.png`);return(0,i.jsx)(px,{radius:"rounded",className:a,style:{backgroundImage:`url(${o})`},"aria-label":`Select ${e} #${n}`,onClick:async()=>{r();const i="gradient"===e?new Vb.fabric.Gradient(WI[n]):await QI(o);bp().objects.setValues({[t]:i}),yp().setDirty(!0)}},n)});return"texture"===e&&s.unshift((0,i.jsx)(JI,{property:t,className:a},"upload-btn")),(0,i.jsx)(o.Fragment,{children:s})}function JI({className:e,property:t}){const{close:r}=nI();return(0,i.jsx)(px,{radius:"rounded",className:e,"aria-label":"Upload an image",onClick:async()=>{const e=await bp().import.openUploadWindow();if(r(),e){const r=await QI(await e.data);bp().objects.setValues({[t]:r})}},children:(0,i.jsx)(YI,{className:"icon-md"})})}function QI(e){return new Promise(t=>{Vb.fabric.util.loadImage(e,e=>{const r=new Vb.fabric.Pattern({source:e,repeat:"repeat"});t(r)})})}function ej(){const e=vp(e=>e.objects.active.editableProps.opacity);return(0,i.jsx)(CI,{className:"max-w-240 w-full mx-auto","aria-label":"Opacity",value:e,minValue:.1,step:.1,maxValue:1,onChange:e=>{bp().objects.setValues({opacity:e}),yp().setDirty(!0)}})}function tj(){const{trans:e}=iI(),t=vp(e=>e.objects.active.editableProps.stroke),r=vp(e=>e.objects.active.editableProps.strokeWidth);return(0,i.jsxs)("div",{className:"flex items-center gap-40",children:[(0,i.jsx)(dI,{className:"ml-auto flex-shrink-0",size:"xs",value:t,"aria-label":e({message:"Outline Color"}),onChange:e=>{bp().objects.setValues({stroke:e}),yp().setDirty(!0)}}),(0,i.jsx)(CI,{"aria-label":"Outline Width",className:"max-w-240 mr-auto flex-shrink-0",value:r,onChange:e=>{bp().objects.setValues({strokeWidth:e}),yp().setDirty(!0)}})]})}const rj=ld((0,i.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}),"ImageOutlined");function nj(){return(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)(gx,{type:"button",variant:"outline",size:"xs",startIcon:(0,i.jsx)(rj,{}),radius:"rounded-full",onClick:async()=>{const e=await bp().import.openUploadWindow();if(e){const t=bp().objects.getActive();if(t&&"setSrc"in t){const r=await e.data;t.setSrc(r,()=>{Qb({src:r}),bp().canvas.render()})}}},children:(0,i.jsx)(M_,{message:"Replace Image"})})})}const ij={color:"rgba(0, 0, 0, 0.6)",blur:3,offsetX:-1,offsetY:0};function oj(){const{trans:e}=iI(),t=vp(e=>e.objects.active.editableProps.shadow)||ij;return(0,i.jsxs)("div",{className:"flex items-center gap-40",children:[(0,i.jsx)(dI,{className:"ml-auto flex-shrink-0",value:t.color,size:"xs","aria-label":e({message:"Shadow Color"}),onChange:e=>{bp().objects.setValues({shadow:aj({color:e})}),yp().setDirty(!0)}}),(0,i.jsx)(CI,{"aria-label":"Shadow Blur",className:"max-w-240 mr-auto flex-shrink-0",defaultValue:t.blur,onChange:e=>{bp().objects.setValues({shadow:aj({blur:e})}),yp().setDirty(!0)}})]})}function aj(e){var t;const r=null==(t=bp().objects.getActive())?void 0:t.shadow;return r?(Object.entries(e).forEach(([e,t])=>{r[e]=t}),r):new Vb.fabric.Shadow({...ij,...e})}function sj({index:e,className:t,isDisabled:r,children:n,padding:a,elementType:s="button",to:l,relative:c,width:u="min-w-min"}){const{selectedTab:d,setSelectedTab:h,tabsRef:f,size:p="md",id:g}=(0,o.useContext)(jI),m=e===d,v=function(){var e;return null===(e=(0,o.useContext)(i_))||void 0===e?void 0:e.focusManager}(),y=a||("sm"===p?"px-12":"px-18"),b=od("tracking-wide overflow-hidden capitalize text-sm flex items-center justify-center outline-none transition-colors","focus-visible:ring focus-visible:ring-2 ring-inset rounded whitespace-nowrap cursor-pointer",u,function({isDisabled:e,isSelected:t}){return e?"text-disabled cursor-default":t?"text-primary":"text-muted hover:text-main"}({isDisabled:r,isSelected:m}),t,"md"===p&&`${y} h-48`,"sm"===p&&`${y} h-32`,r&&"pointer-events-none");return(0,i.jsx)(s,{disabled:r,id:`${g}-${e}-tab`,"aria-controls":`${g}-${e}-tabpanel`,type:"button",role:"tab","aria-selected":m,tabIndex:r?void 0:m?0:-1,onKeyDown:e=>{switch(e.key){case"ArrowLeft":null==v||v.focusPrevious();break;case"ArrowRight":null==v||v.focusNext();break;case"Home":null==v||v.focusFirst();break;case"End":null==v||v.focusLast()}},onClick:()=>{h(e)},to:l,relative:c,className:b,ref:t=>{f.current&&t&&(f.current[e]=t)},children:n})}function lj(){const e=vp(e=>e.objects.active);return(0,i.jsxs)(OI,{size:"sm",className:"pb-18 pt-6",children:[(0,i.jsxs)(FI,{center:!0,children:[e.isText&&(0,i.jsx)(sj,{children:(0,i.jsx)(M_,{message:"Font"})}),!e.isImage&&(0,i.jsx)(sj,{children:(0,i.jsx)(M_,{message:"Color"})}),!e.isImage&&(0,i.jsx)(sj,{children:(0,i.jsx)(M_,{message:"Background"})}),e.isImage&&(0,i.jsx)(sj,{children:(0,i.jsx)(M_,{message:"Image"})}),(0,i.jsx)(sj,{children:(0,i.jsx)(M_,{message:"Opacity"})}),(0,i.jsx)(sj,{children:(0,i.jsx)(M_,{message:"Outline"})}),(0,i.jsx)(sj,{children:(0,i.jsx)(M_,{message:"Shadow"})})]}),(0,i.jsxs)(HI,{className:"pt-16 h-50",children:[e.isText&&(0,i.jsx)($I,{children:(0,i.jsx)(zI,{})},"font"),!e.isImage&&(0,i.jsx)($I,{children:(0,i.jsx)(XI,{property:"fill"})}),!e.isImage&&(0,i.jsx)($I,{children:(0,i.jsx)(XI,{property:"backgroundColor"})}),e.isImage&&(0,i.jsx)($I,{children:(0,i.jsx)(nj,{})}),(0,i.jsx)($I,{children:(0,i.jsx)(ej,{})}),(0,i.jsx)($I,{children:(0,i.jsx)(tj,{})}),(0,i.jsx)($I,{children:(0,i.jsx)(oj,{})})]})]})}function cj(){const e=!U_()&&(0,i.jsx)(gx,{size:"sm",color:"primary",variant:"outline",onClick:()=>{bp().text.add(),yp().setDirty(!0)},children:(0,i.jsx)(M_,{message:"New Text"})});return(0,i.jsx)(wk,{actionBtn:e,children:(0,i.jsx)(lj,{})})}const uj=ld((0,i.jsx)("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownwardOutlined"),dj={};let hj=!1,fj=null,pj=null;const gj=e=>{var t;for(const r in dj)r!==e&&(null==(t=dj[r])||t.call(dj,!0),delete dj[r])},mj=(0,o.forwardRef)(({children:e,label:t,placement:r="top",offset:n=10,variant:a="neutral",delay:s=1500,isDisabled:l,usePortal:c=!0,...u},d)=>{const{x:h,y:f,reference:p,strategy:g,arrowRef:m,arrowStyle:v,refs:y}=VC({placement:r,offset:n,ref:d,showArrow:!0}),[b,w]=(0,o.useState)(!1),x=(0,o.useId)(),C=(0,o.useRef)(),_=()=>{clearTimeout(C.current),C.current=void 0,gj(x),dj[x]=S,hj=!0,w(!0),fj&&(clearTimeout(fj),fj=null),pj&&(clearTimeout(pj),pj=null)},S=(0,o.useCallback)(e=>{e?(clearTimeout(C.current),C.current=void 0,w(!1)):C.current||(C.current=setTimeout(()=>{C.current=void 0,w(!1)},500)),fj&&(clearTimeout(fj),fj=null),hj&&(pj&&clearTimeout(pj),pj=setTimeout(()=>{delete dj[x],pj=null,hj=!1},500))},[x]),A=e=>{!e&&s>0&&!C.current?(gj(x),dj[x]=S,b||fj||hj?b||_():fj=setTimeout(()=>{fj=null,hj=!0,_()},s)):_()};(0,o.useEffect)(()=>()=>{clearTimeout(C.current),dj[x]&&delete dj[x]},[x]),(0,o.useEffect)(()=>{const e=e=>{"Escape"===e.key&&S(!0)};if(b)return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[b,S]);const k=(0,i.jsx)(hb,{children:b&&(0,i.jsxs)(ob.div,{...__,ref:y.setFloating,id:x,role:"tooltip",onPointerEnter:()=>{A(!0)},onPointerLeave:()=>{S()},className:od("z-tooltip my-4 max-w-240 break-words rounded px-8 py-4 text-xs text-white shadow","positive"===a&&"bg-positive","danger"===a&&"bg-danger","neutral"===a&&"bg-toast"),style:{position:g,top:f??"",left:h??""},children:[(0,i.jsx)("div",{ref:m,className:"absolute h-8 w-8 rotate-45 bg-inherit",style:v}),t]})});return(0,i.jsxs)(o.Fragment,{children:[(0,o.cloneElement)(e,Eb({"aria-describedby":b?x:void 0,ref:p,onPointerEnter:e=>{"mouse"===e.pointerType&&A()},onFocus:e=>{e.target.matches(":focus-visible")&&A(!0)},onPointerLeave:e=>{"mouse"===e.pointerType&&S()},onPointerDown:()=>{S(!0)},onBlur:()=>{S()},"aria-label":"string"==typeof t?t:t.props.message},u)),c?dp&&(0,de.createPortal)(k,dp):k]})});function vj(){const e=vp(e=>e.activeToolOverlay),t=vp(e=>e.objects.active.id),r=function(e,t){switch(e){case sf.Filter:return(0,i.jsx)(EI,{});case sf.Frame:return(0,i.jsx)(II,{});case sf.Text:return t&&(0,i.jsx)(cj,{});case sf.ActiveObject:return t&&(0,i.jsx)(lj,{});default:return null}}(e,t),[n,a]=(0,o.useState)(!0);return(0,i.jsxs)("div",{className:"relative z-tool-overlay text-sm",children:[r&&(0,i.jsx)("div",{className:od("absolute right-16 text-muted z-50 transition-all",!n&&"rotate-180",n?"-top-144":"-top-40"),children:(0,i.jsx)(mj,{label:(0,i.jsx)(M_,n?{message:"Hide options"}:{message:"Show options"}),children:(0,i.jsx)(bS,{variant:"outline",radius:"rounded-lg",size:"xs",onClick:()=>{a(!n)},children:(0,i.jsx)(uj,{})})})}),(0,i.jsx)(hb,{children:r&&n&&(0,i.jsx)(ob.div,{initial:{y:0,opacity:0},animate:{y:"-100%",opacity:1},exit:{y:0,opacity:0},transition:{type:"tween",duration:.15},className:"absolute inset-x-0 gap-16 px-5vw bg bg-opacity-95 border-t",children:r},"tool-controls-overlay")})]})}const yj=ld((0,i.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 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 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function bj({filter:e}){const t=vp(t=>t.filter.applied.includes(e)),r=bp().filter.hasOptions(e),n=od("block flex-shrink-0 rounded",{"text-primary border-primary":t}),a=gw[e],s=(0,i.jsxs)(o.Fragment,{children:[(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(wj,{filter:e}),t&&(0,i.jsx)(xj,{filter:e,hasOptions:r})]}),(0,i.jsx)("div",{className:"mt-4 text-center text-xs capitalize",children:a?(0,i.jsx)(M_,{...a}):e})]});return t&&r?(0,i.jsx)("div",{className:n,children:s}):(0,i.jsx)(px,{className:n,onClick:()=>{t?bp().filter.remove(e):bp().filter.apply(e)},children:s})}function wj({filter:e}){const t=vp(t=>t.filter.selected===e),r=od("m-auto w-96 h-56 border rounded object-cover",{shadow:t});return(0,i.jsx)("img",{src:sw(`images/filter/${e}.jpg`),className:r,alt:""})}function xj({filter:e,hasOptions:t}){return(0,i.jsxs)("div",{className:"flex items-center justify-center bg-background/70 absolute inset-0 border-2 border-primary rounded",children:[t?(0,i.jsx)(bS,{color:"primary",size:"md",onClick:()=>{bp().filter.remove(e)},children:(0,i.jsx)(yj,{})}):(0,i.jsx)(yj,{className:"svg-icon icon-md"}),t&&(0,i.jsx)(Cj,{filter:e,hasOptions:t})]})}function Cj({filter:e,hasOptions:t}){return(0,i.jsx)(bS,{color:"primary",size:"md",onClick:()=>{yp().activeToolOverlay===sf.Filter&&yp().filter.selected===e?yp().setActiveTool(yp().activeTool,null):yp().filter.select(e,t)},children:(0,i.jsx)(dd,{})})}const _j=(0,o.forwardRef)(({children:e,className:t,gap:r="gap-10"},n)=>{const a=o.Children.map(e,(t,r)=>o.isValidElement(t)?o.cloneElement(t,{isFirst:0===r,isLast:o.Children.count(e)===r+1}):t);return(0,i.jsx)("div",{ref:n,className:od("tiny-scrollbar pb-4 overflow-x-auto relative flex items-center",r,t),children:a})});function Sj({isFirst:e,isLast:t,children:r,className:n}){const o=od(n,"flex-shrink-0",{"ml-auto":e,"mr-auto":t});return(0,i.jsx)("div",{className:o,children:r})}function Aj(){const e=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.filter)?void 0:r.items})||[];(0,o.useEffect)(()=>{bp().filter.syncState()},[]);const t=e.map(e=>(0,i.jsx)(Sj,{children:(0,i.jsx)(bj,{filter:e})},e));return(0,i.jsx)(_j,{children:t})}const kj=ld((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOutlined"),Ej=ld((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOpenOutlined"),Ij=ld((0,i.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlankOutlined"),jj=ld((0,i.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Tj=ld((0,i.jsx)("path",{d:"M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M17,13H7v-2h10V13z"}),"CheckBox"),Fj=(0,o.forwardRef)((e,t)=>{const{size:r="md",children:n,className:a,icon:s,checkedIcon:l,disabled:c,isIndeterminate:u,errorMessage:d,invalid:h,orientation:f="horizontal",onChange:p,autoFocus:g,required:m,value:v,name:y,inputTestId:b}=e,w=iS({...e,label:n}),x=s||Ij,C=l||(u?Tj:jj),_=Rb(t);fS({autoFocus:g},_),(0,o.useEffect)(()=>{_.current&&(_.current.indeterminate=u||!1)});const[S,A]=Db(e.checked,e.defaultChecked||!1),k=(0,o.useCallback)(e=>{null==p||p(e),A(e.target.checked)},[p,A]),E=od("select-none",a,h&&"text-danger",!h&&c&&"text-disabled");let I,j=h?"text-danger":null;return u?(I=Tj,j=j||"text-primary"):S?(I=C,j=j||"text-primary"):(I=x,j=j||"text-muted"),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:E,children:(0,i.jsxs)("div",{className:od("relative flex items-center","vertical"===f&&"flex-col flex-col-reverse"),children:[(0,i.jsx)("input",{className:"absolute left-0 top-0 h-24 w-24 appearance-none overflow-hidden rounded outline-none ring-inset transition-shadow focus-visible:ring",type:"checkbox","aria-checked":u?"mixed":S,"aria-invalid":h||void 0,onChange:k,ref:_,required:m,disabled:c,value:v,name:y,"data-testid":b}),(0,i.jsx)(I,{size:r,className:od("pointer-events-none",c?"text-disabled":j)}),n&&(0,i.jsx)("div",{className:od("first-letter:capitalize",w.size.font,"vertical"===f?"mb-6":"ml-6"),children:n})]})}),d&&(0,i.jsx)("div",{className:w.error,children:d})]})});function Oj(){const{trans:e}=iI(),{minWidth:t=50,minHeight:r=50,maxHeight:n=2400,maxWidth:a=2400}=vp(e=>{var t;return null==(t=e.config.tools)?void 0:t.resize})||{},s=vp(e=>e.original),l=vp(e=>e.resize.formValue);return(0,o.useEffect)(()=>{yp().resize.setFormValue({...s})},[s]),(0,o.useEffect)(()=>{yp().setDirty(!0)},[]),(0,i.jsxs)("form",{className:"flex items-center justify-center gap-16 w-full",onSubmit:e=>{e.preventDefault(),yp().applyChanges()},children:[(0,i.jsx)(gS,{type:"number",min:t,max:a,size:"sm",className:"w-full max-w-112",label:(0,i.jsx)(M_,{message:"Width"}),value:l.width,onChange:e=>{(e=>{const t={...l,width:e};l.maintainAspect&&(t.height=Sw(e,l.usePercentages)),yp().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,i.jsx)("div",{className:"mt-24",children:(0,i.jsx)(Fj,{size:"md",checked:l.maintainAspect,onChange:e=>{(e=>{const t={...l,maintainAspect:e};e&&(t.height=Sw(t.width,t.usePercentages)),yp().resize.setFormValue(t)})(!l.maintainAspect)},"aria-label":e({message:"Maintain aspect ratio"}),checkedIcon:kj,icon:Ej})}),(0,i.jsx)(gS,{type:"number",min:r,max:n,size:"sm",className:"w-full max-w-112",label:(0,i.jsx)(M_,{message:"Height"}),value:l.height,onChange:e=>{(e=>{const t={...l,height:e};e&&l.maintainAspect&&(t.width=_w(e,l.usePercentages)),yp().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,i.jsx)("button",{type:"submit",className:"hidden",children:(0,i.jsx)(M_,{message:"Resize"})})]})}function Pj(){const e=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.crop)?void 0:r.presets})||[],t=vp(e=>e.crop.selectedAspectRatio),r=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.crop)?void 0:r.allowCustomRatio})??!0,n=e.filter(e=>e.ratio||!e.ratio&&r).map(e=>(0,i.jsx)(Sj,{children:(0,i.jsxs)(px,{onClick:()=>bp().crop.resetCropzone(e.ratio),className:"flex flex-col items-center justify-between cursor-pointer h-56",children:[(0,i.jsx)(Mj,{preset:e,selectedRatio:t}),(0,i.jsx)(Rj,{preset:e,selectedRatio:t})]})},e.ratio||e.name));return(0,i.jsx)(_j,{gap:"gap-18",children:n})}function Mj({preset:e,selectedRatio:t}){let r=40,n=30;if(e.ratio){const t=Ew(e.ratio);({width:r,height:n}=kw(t,r,n))}const o=od("border-2",{"border-dotted":null===e.ratio,"border-primary":t===e.ratio});return(0,i.jsx)("div",{style:{width:`${r}px`,height:`${n}px`},className:o})}function Rj({preset:e,selectedRatio:t}){const r=od("mt-4 text-center text-xs",{"text-primary":t===e.ratio});return(0,i.jsx)("div",{className:r,children:e.name?(0,i.jsx)(M_,{message:e.name}):e.ratio})}const Lj=ld((0,i.jsx)("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}),"FlipOutlined");function Nj(){return(0,i.jsxs)("div",{children:[(0,i.jsx)(bS,{size:"sm",onClick:()=>{bp().transform.flip("vertical"),yp().setDirty(!0)},children:(0,i.jsx)(Lj,{})}),(0,i.jsx)(bS,{size:"sm",onClick:()=>{bp().transform.flip("horizontal"),yp().setDirty(!0)},children:(0,i.jsx)(Lj,{className:"rotate-90"})})]})}const Dj=ld((0,i.jsx)("path",{d:"M7.11 8.53 5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z"}),"RotateLeftOutlined"),zj=ld((0,i.jsx)("path",{d:"M15.55 5.55 11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42 1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"}),"RotateRightOutlined");function Bj(){return(0,i.jsxs)("div",{children:[(0,i.jsx)(bS,{size:"sm",onClick:()=>{bp().transform.rotateLeft(),yp().setDirty(!0)},children:(0,i.jsx)(Dj,{})}),(0,i.jsx)(bS,{size:"sm",onClick:()=>{bp().transform.rotateRight(),yp().setDirty(!0)},children:(0,i.jsx)(zj,{})})]})}function Uj(){return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-16",children:[(0,i.jsx)(Nj,{}),(0,i.jsx)(Vj,{}),(0,i.jsx)(Bj,{})]})}function Vj(){const e=(0,o.useRef)(null),{domProps:t,groupId:r,thumbIds:n,trackRef:a,getThumbValueLabel:s}=bI({minValue:-45,maxValue:45,step:1,defaultValue:[yp().crop.straightenAngle],onChange:t=>{const r=t[0];bp().transform.straighten(r),yp().crop.setTransformAngle(r),yp().setDirty(!0),e.current.style.transform=`translateX(${r}px)`}});return(0,i.jsx)("div",{id:r,role:"group",className:"flex-auto flex-shrink-0 max-w-320 touch-none isolate",children:(0,i.jsxs)("div",{...t,ref:a,className:"h-36 relative",children:[(0,i.jsxs)("output",{htmlFor:n[0],"aria-live":"off",className:"absolute left-1/2 top-1/2 w-40 text-center bg -translate-x-1/2 -translate-y-1/2 z-10",children:[s(0),"\xb0"]}),(0,i.jsx)(Hj,{ref:e})]})})}const Hj=o.forwardRef((e,t)=>{const r=[...Array(80).keys()],n=r.map(e=>(0,i.jsx)("circle",{cx:2+10*e,cy:"20",r:e%5?.75:2},e));return(0,i.jsx)("div",{className:"relative h-full cursor-pointer overflow-hidden",children:(0,i.jsx)("svg",{ref:t,style:{width:10*r.length},className:"absolute -left-80 h-full fill-current",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:n})})});function $j(){return(0,o.useEffect)(()=>(yp().setDirty(!0),bp().frame.active.hide(),()=>{bp().frame.active.show()}),[]),(0,i.jsxs)("div",{className:"pb-16",children:[(0,i.jsx)("div",{className:"mb-10",children:(0,i.jsx)(Uj,{})}),(0,i.jsx)(Pj,{})]})}const Wj=ld((0,i.jsx)("path",{d:"M 16 6 C 12.484375 6 9.273438 7.070313 6.90625 8.84375 C 4.539063 10.617188 3 13.15625 3 16 C 3 18.84375 4.539063 21.382813 6.90625 23.15625 C 9.273438 24.929688 12.484375 26 16 26 C 19.515625 26 22.726563 24.929688 25.09375 23.15625 C 27.460938 21.382813 29 18.84375 29 16 C 29 13.15625 27.460938 10.617188 25.09375 8.84375 C 22.726563 7.070313 19.515625 6 16 6 Z M 16 8 C 19.109375 8 21.898438 8.957031 23.875 10.4375 C 25.851563 11.917969 27 13.875 27 16 C 27 18.125 25.851563 20.082031 23.875 21.5625 C 21.898438 23.042969 19.109375 24 16 24 C 12.890625 24 10.101563 23.042969 8.125 21.5625 C 6.148438 20.082031 5 18.125 5 16 C 5 13.875 6.148438 11.917969 8.125 10.4375 C 10.101563 8.957031 12.890625 8 16 8 Z "})),Gj=ld((0,i.jsx)("path",{d:"M 16 4 C 9.382813 4 4 9.382813 4 16 C 4 22.617188 9.382813 28 16 28 C 22.617188 28 28 22.617188 28 16 C 28 9.382813 22.617188 4 16 4 Z M 16 6 C 21.535156 6 26 10.464844 26 16 C 26 21.535156 21.535156 26 16 26 C 10.464844 26 6 21.535156 6 16 C 6 10.464844 10.464844 6 16 6 Z "})),qj=ld((0,i.jsx)("path",{d:"M 3 6 L 3 26 L 29 26 L 29 6 Z M 5 8 L 27 8 L 27 24 L 5 24 Z "})),Yj=ld((0,i.jsx)("path",{d:"M 16 4.90625 L 15.125 6.40625 L 4.71875 24.5 L 3.875 26 L 28.125 26 L 27.28125 24.5 L 16.875 6.40625 Z M 16 8.9375 L 24.65625 24 L 7.34375 24 Z "}));function Xj(){const e=(vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.shapes)?void 0:r.items})||[]).map(e=>(0,i.jsx)(Sj,{children:(0,i.jsx)(bS,{variant:"outline",radius:"rounded-2xl",size:"xl",onClick:()=>{bp().shape.addBasicShape(e.name),yp().setDirty(!0)},children:(0,i.jsx)(Kj,{shape:e})})},e.name));return(0,i.jsx)(_j,{children:e})}function Kj({shape:e}){var t;return"Path"===e.type?(0,i.jsx)("svg",{className:"m-auto w-36 h-36",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -100 512 700",children:(0,i.jsx)("path",{className:"fill-transparent stroke-current",d:null==(t=e.options)?void 0:t.path,strokeWidth:25})}):o.cloneElement(Zj[e.name],{className:"w-30 h-30"})}const Zj={circle:(0,i.jsx)(Gj,{viewBox:"0 0 32 32"}),square:(0,i.jsx)(qj,{viewBox:"0 0 32 32"}),triangle:(0,i.jsx)(Yj,{viewBox:"0 0 32 32"}),ellipse:(0,i.jsx)(Wj,{viewBox:"0 0 32 32"})};function Jj(e,t,r){let n,i=r.initialDeps??[];return()=>{var o,a,s,l;let c;r.key&&null!=(o=r.debug)&&o.call(r)&&(c=Date.now());const u=e();if(u.length===i.length&&!u.some((e,t)=>i[t]!==e))return n;let d;if(i=u,r.key&&null!=(a=r.debug)&&a.call(r)&&(d=Date.now()),n=t(...u),r.key&&null!=(s=r.debug)&&s.call(r)){Math.round(100*(Date.now()-c)),Math.round(100*(Date.now()-d))}return null==(l=null==r?void 0:r.onChange)||l.call(r,n),n}}function Qj(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const eT=(e,t,r)=>{let n;return function(...i){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,i),r)}},tT=e=>e,rT=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let i=t;i<=r;i++)n.push(i);return n},nT=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;const i=e=>{const{width:r,height:n}=e;t({width:Math.round(r),height:Math.round(n)})};if(i(r.getBoundingClientRect()),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(e=>{const t=e[0];if(null!=t&&t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void i({width:e.inlineSize,height:e.blockSize})}i(r.getBoundingClientRect())});return o.observe(r,{box:"border-box"}),()=>{o.unobserve(r)}},iT={passive:!0},oT=typeof window>"u"||"onscrollend"in window,aT=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;let i=0;const o=oT?()=>{}:eT(n,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=n=>()=>{i=r[e.options.horizontal?"scrollLeft":"scrollTop"],o(),t(i,n)},s=a(!0),l=a(!1);return l(),r.addEventListener("scroll",s,iT),r.addEventListener("scrollend",l,iT),()=>{r.removeEventListener("scroll",s),r.removeEventListener("scrollend",l)}},sT=(e,t,r)=>{if(null!=t&&t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[r.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[r.options.horizontal?"width":"height"])},lT=(e,{adjustments:t=0,behavior:r},n)=>{var i,o;const a=e+t;null==(o=null==(i=n.scrollElement)?void 0:i.scrollTo)||o.call(i,{[n.options.horizontal?"left":"top"]:a,behavior:r})};class cT{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}):null);return{disconnect:()=>{var e;return null==(e=t())?void 0:e.disconnect()},observe:e=>{var r;return null==(r=t())?void 0:r.observe(e,{box:"border-box"})},unobserve:e=>{var r;return null==(r=t())?void 0:r.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,r])=>{typeof r>"u"&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:tT,rangeExtractor:rT,onChange:()=>{},measureElement:sT,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,...e}},this.notify=(e,t)=>{var r,n;const{startIndex:i,endIndex:o}=this.range??{startIndex:void 0,endIndex:void 0},a=this.calculateRange();(e||i!==(null==a?void 0:a.startIndex)||o!==(null==a?void 0:a.endIndex))&&(null==(n=(r=this.options).onChange)||n.call(r,this,t))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null},this._didMount=()=>(this.measureElementCache.forEach(this.observer.observe),()=>{this.observer.disconnect(),this.cleanup()}),this._willUpdate=()=>{var e;const t=this.options.getScrollElement();this.scrollElement!==t&&(this.cleanup(),this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this._scrollToOffset(this.scrollOffset,{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.scrollOffset<e?"forward":"backward":null,this.scrollOffset=e;const r=this.isScrolling;this.isScrolling=t,this.notify(r!==t,t)})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.getMeasurementOptions=Jj(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey],(e,t,r,n)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:r,getItemKey:n}),{key:!1}),this.getFurthestMeasurement=(e,t)=>{const r=new Map,n=new Map;for(let i=t-1;i>=0;i--){const t=e[i];if(r.has(t.lane))continue;const o=n.get(t.lane);if(null==o||t.end>o.end?n.set(t.lane,t):t.end<o.end&&r.set(t.lane,!0),r.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurements=Jj(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:r,getItemKey:n},i)=>{const o=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const a=this.measurementsCache.slice(0,o);for(let s=o;s<e;s++){const e=n(s),o=1===this.options.lanes?a[s-1]:this.getFurthestMeasurement(a,s),l=o?o.end+this.options.gap:t+r,c=i.get(e),u="number"==typeof c?c:this.options.estimateSize(s),d=l+u,h=o?o.lane:s%this.options.lanes;a[s]={index:s,start:l,size:u,end:d,key:e,lane:h}}return this.measurementsCache=a,a},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Jj(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(e,t,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:r}){const n=e.length-1,i=uT(0,n,t=>e[t].start,r);let o=i;for(;o<n&&e[o].end<r+t;)o++;return{startIndex:i,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:r}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=Jj(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(e,t,r,n)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:r,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,r=e.getAttribute(t);return r?parseInt(r,10):-1},this._measureElement=(e,t)=>{const r=this.measurementsCache[this.indexFromElement(e)];if(!r||!e.isConnected)return void this.measureElementCache.forEach((t,r)=>{t===e&&(this.observer.unobserve(e),this.measureElementCache.delete(r))});const n=this.measureElementCache.get(r.key);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.measureElementCache.set(r.key,e));const i=this.options.measureElement(e,t,this);this.resizeItem(r,i)},this.resizeItem=(e,t)=>{const r=t-(this.itemSizeCache.get(e.key)??e.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(e,r,this):e.start<this.scrollOffset+this.scrollAdjustments)&&this._scrollToOffset(this.scrollOffset,{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(e.index),this.itemSizeCache=new Map(this.itemSizeCache.set(e.key,t)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=Jj(()=>[this.getIndexes(),this.getMeasurements()],(e,t)=>{const r=[];for(let n=0,i=e.length;n<i;n++){const i=t[e[n]];r.push(i)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();return Qj(t[uT(0,t.length-1,e=>Qj(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>{const r=this.getSize();"auto"===t&&(t=e<=this.scrollOffset?"start":e>=this.scrollOffset+r?"end":"start"),"start"===t||("end"===t?e-=r:"center"===t&&(e-=r/2));const n=this.options.horizontal?"scrollWidth":"scrollHeight",i=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[n]:this.scrollElement[n]:0)-this.getSize();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const r=Qj(this.getMeasurements()[e]);if("auto"===t)if(r.end>=this.scrollOffset+this.getSize()-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=this.scrollOffset+this.options.scrollPaddingStart))return[this.scrollOffset,t];t="start"}const n="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,t),t]},this.isDynamicMode=()=>this.measureElementCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:r}={})=>{this.cancelScrollToIndex(),"smooth"===r&&this.isDynamicMode(),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:r})},this.scrollToIndex=(e,{align:t="auto",behavior:r}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===r&&this.isDynamicMode();const[n,i]=this.getOffsetForIndex(e,t);this._scrollToOffset(n,{adjustments:void 0,behavior:r}),"smooth"!==r&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.measureElementCache.has(this.options.getItemKey(e))){const[t]=this.getOffsetForIndex(e,i);((e,t)=>Math.abs(e-t)<1)(t,this.scrollOffset)||this.scrollToIndex(e,{align:i,behavior:r})}else this.scrollToIndex(e,{align:i,behavior:r})}))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode(),this._scrollToOffset(this.scrollOffset+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let r;return r=0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map(e=>e.end)),r-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:t,behavior:r})=>{this.options.scrollToFn(e,{behavior:r,adjustments:t},this)},this.measure=()=>{var e,t;this.itemSizeCache=new Map,null==(t=(e=this.options).onChange)||t.call(e,this,!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset="function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}),this.notify(!1,!1)}}const uT=(e,t,r,n)=>{for(;e<=t;){const i=(e+t)/2|0,o=r(i);if(o<n)e=i+1;else{if(!(o>n))return i;t=i-1}}return e>0?e-1:0},dT=typeof document<"u"?o.useLayoutEffect:o.useEffect;function hT(){const e=vp(e=>{var t;return null==(t=e.config.ui)?void 0:t.activeTheme});return vp(t=>{var r;return((null==(r=t.config.ui)?void 0:r.themes)||[]).find(t=>t.name===e)})}function fT({category:e}){const t=hT(),r=e.name,n=e.list?e.list:Array.from(Array(e.items).keys()),a=(0,o.useRef)(null),s=function(e){return function(e){const t=o.useReducer(()=>({}),{})[1],r={...e,onChange:(r,n)=>{var i;n?(0,de.flushSync)(t):t(),null==(i=e.onChange)||i.call(e,r,n)}},[n]=o.useState(()=>new cT(r));return n.setOptions(r),o.useEffect(()=>n._didMount(),[]),dT(()=>n._willUpdate()),n}({observeElementRect:nT,observeElementOffset:aT,scrollToFn:lT,...e})}({horizontal:!0,count:n.length,getScrollElement:()=>a.current,estimateSize:(0,o.useCallback)(()=>52,[]),overscan:5});return(0,o.useEffect)(()=>{s.scrollToIndex(0)},[r]),(0,i.jsx)(o.Fragment,{children:(0,i.jsx)("div",{ref:a,className:"tiny-scrollbar overflow-x-auto overflow-y-hidden",style:{height:"52px"},children:(0,i.jsx)("div",{className:"h-full relative mx-auto",style:{width:`${s.getTotalSize()}px`},children:s.getVirtualItems().map(r=>{const o=`${n[r.index]}`;return(0,i.jsx)("div",{className:"absolute top-0 left-0 h-full",style:{width:`${r.size}px`,transform:`translateX(${r.start}px)`},children:(0,i.jsx)(gx,{variant:"outline",radius:"rounded-xl",size:"md",equalWidth:!0,onClick:async()=>{await bp().shape.addSticker(e.name,o),yp().setDirty(!0)},children:(0,i.jsx)("img",{className:od("m-auto m-auto w-28 h-28",e.invertPreview&&(null==t?void 0:t.isDark)&&"invert"),src:Tw(e,o),alt:o})})},r.index)})})})})}function pT(){const e=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.stickers)?void 0:r.items})||[],[t,r]=(0,o.useState)(e[0]),n=e.map(e=>{const r=t===e,n=Ju[e.name];return(0,i.jsx)(gx,{size:"xs",color:r?"primary":null,value:e,children:(0,i.jsx)("span",{className:"capitalize",children:n?(0,i.jsx)(M_,{...n}):e.name})},e.name)});return(0,i.jsxs)("div",{className:"h-92",children:[(0,i.jsx)("div",{className:"mb-10 w-full hide-scrollbar overflow-x-auto overflow-y-hidden flex",children:(0,i.jsx)(AS,{value:t,onChange:e=>r(e),variant:"outline",radius:"rounded-full",className:"mx-auto",children:n})}),t&&(0,i.jsx)(fT,{category:t})]})}function gT(){const e=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.frame)?void 0:r.items})||[],t=vp(e=>e.frame.active);(0,o.useEffect)(()=>{yp().frame.active&&yp().frame.showOptionsPanel()},[]);const r=e.map(e=>{const r=sw(`images/frames/${e.name}/thumbnail.png`),n=(null==t?void 0:t.name)===e.name;return(0,i.jsx)(Sj,{children:(0,i.jsxs)("button",{type:"button",className:"border-2 overflow-hidden relative rounded border cursor-pointer "+(n?"border-primary":""),onClick:()=>{yp().setDirty(!0),n?bp().frame.remove():bp().frame.add(e.name)},children:[n&&(0,i.jsx)(mT,{}),(0,i.jsx)("img",{draggable:"false",className:"w-64 h-64",src:r,alt:e.name})]})},e.name)});return(0,i.jsx)(_j,{children:r})}function mT(){return(0,i.jsx)("span",{className:"bg-background/70 absolute inset-0 text-primary",children:(0,i.jsx)(yj,{className:"svg-icon icon-md absolute inset-0 block m-auto"})})}function vT(){const e=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.text)?void 0:r.items});(0,o.useEffect)(()=>{e&&dw(e,{prefixSrc:sw,id:"pixie-fonts"}).catch(()=>{})},[e]),(0,o.useEffect)(()=>{bp().text.selectOrAddText()&&yp().setDirty(!0)},[]);const t=(e||[]).map(e=>(0,i.jsx)(Sj,{children:(0,i.jsx)(yT,{fontConfig:e})},e.family));return(0,i.jsx)(_j,{className:"pt-6",children:t})}function yT({fontConfig:e}){var t;const r=vp(e=>e.objects.active.editableProps.fontFamily),n=od("block px-6 w-110 h-68 text-sm bg border rounded-2xl",{"border-primary":r===e.family,"text-primary":r===e.family});return(0,i.jsx)("button",{type:"button",className:n,style:{fontFamily:e.family.includes('"')?e.family:`"${e.family}"`,fontWeight:(null==(t=e.descriptors)?void 0:t.weight)||"normal"},onClick:async()=>{bp().text.selectOrAddText(),yp().setDirty(!0),bp().objects.setValues({fontFamily:e.family})},children:e.family})}const bT=ld((0,i.jsx)("path",{d:"M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7H288h9.4H512c17.7 0 32-14.3 32-32s-14.3-32-32-32H387.9L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416H288l-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"}),"EraserFA","0 0 576 512");function wT(){return(0,o.useEffect)(()=>(bp().draw.enable(),()=>{bp().draw.disable()}),[]),(0,i.jsxs)(_j,{gap:"gap-16",children:[(0,i.jsx)(Sj,{children:(0,i.jsx)(dI,{size:"sm",label:(0,i.jsx)(M_,{message:"Brush Color"}),value:bp().draw.currentBrush.color,onChange:e=>{bp().draw.setBrushColor(e)}})}),(0,i.jsx)(Sj,{children:(0,i.jsx)(CT,{})}),(0,i.jsx)(Sj,{children:(0,i.jsx)(xT,{})})]})}function xT(){const e=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.draw)?void 0:r.brushSizes})||[],[t,r]=(0,o.useState)(bp().draw.currentBrush.width);return(0,i.jsx)(kI,{selectionMode:"single",selectedValue:t,onSelectionChange:e=>{r(e),bp().draw.setBrushSize(e)},size:"sm",label:(0,i.jsx)(M_,{message:"Brush Size"}),children:e.map(e=>(0,i.jsx)(Cx,{value:e,children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)("div",{className:"flex-shrink-0 mr-8 border-[3px] rounded-full",style:{width:`${e}px`,height:`${e}px`}}),e]})},e))})}function CT(){const e=vp(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.draw)?void 0:r.brushTypes})||[],t=hT(),[r,n]=(0,o.useState)(bp().draw.currentBrush.type);return(0,i.jsx)(kI,{selectionMode:"single",selectedValue:r,onSelectionChange:e=>{n(e),bp().draw.setBrushType(e)},size:"sm",label:(0,i.jsx)(M_,{message:"Brush Type"}),children:e.map(e=>(0,i.jsx)(Cx,{value:e,children:(0,i.jsxs)("div",{className:"flex items-center",children:["EraserBrush"===e?(0,i.jsx)(bT,{className:"mr-8"}):(0,i.jsx)("img",{className:"flex-shrink-0 mr-8 w-24 h-24",src:_T(e,null==t?void 0:t.isDark),alt:""}),(0,i.jsx)(M_,{message:e.replace(/([A-Z])/g," $1").trim()})]})},e))})}function _T(e,t=!1){return sw(`images/brushes/${t?"white":"black"}/${e.replace("Brush","").toLowerCase()}.png`)}function ST(){const{trans:e}=iI(),t=vp(e=>e.corners.radius);return(0,o.useEffect)(()=>(yp().setDirty(!0),bp().corners.showPreview(),()=>bp().corners.hidePreview()),[]),(0,i.jsx)("div",{className:"max-w-320 mx-auto",children:(0,i.jsx)(CI,{minValue:1,maxValue:300,label:e({message:"Radius"}),getValueLabel:e=>`${e}px`,onChange:e=>{bp().corners.updatePreview(e),yp().corners.setRadius(e)},value:t})})}const AT={initial:{y:"130%",opacity:0},animate:{y:0,opacity:1},exit:{y:"130%",opacity:0,left:0,position:"absolute",overflowY:"hidden"},transition:{type:"tween",duration:.15}};function kT({activeTool:e}){const t=function(e){switch(e){case nd.FILTER:return(0,i.jsx)(Aj,{});case nd.RESIZE:return(0,i.jsx)(Oj,{});case nd.CROP:return(0,i.jsx)($j,{});case nd.DRAW:return(0,i.jsx)(wT,{});case nd.TEXT:return(0,i.jsx)(vT,{});case nd.SHAPES:return(0,i.jsx)(Xj,{});case nd.STICKERS:return(0,i.jsx)(pT,{});case nd.FRAME:return(0,i.jsx)(gT,{});case nd.CORNERS:return(0,i.jsx)(ST,{});default:return null}}(e);return(0,i.jsx)(ob.div,{className:"relative h-full w-full text-sm bg select-none overflow-hidden",...AT,children:t})}function ET({className:e}){const t=vp(e=>e.activeTool);return(0,i.jsx)("nav",{className:od("z-navbar min-h-86 flex-shrink-0 px-16 relative overflow-hidden",e),children:(0,i.jsx)(hb,{initial:!1,children:t?(0,i.jsx)(kT,{activeTool:t},"tool-controls"):(0,i.jsx)(IT,{},"nav-items")})})}function IT(){const e=vp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.nav)?void 0:r.items})||[];return(0,i.jsx)(ob.div,{className:"w-full h-full bg-inherit",...AT,children:(0,i.jsx)(_j,{children:e.map(e=>(0,i.jsx)(Sj,{children:(0,i.jsx)(jT,{item:e})},e.name))})})}function jT({item:e}){const t=Id[e.name];return(0,i.jsxs)(px,{variant:"outline",color:"paper",className:"flex-col flex-shrink-0 w-68 h-68",radius:"rounded-2xl",onClick:()=>{"string"==typeof e.action?Ap(e.action):"function"==typeof e.action&&e.action(yp().editor)},children:[(0,i.jsx)("div",{className:"mb-1",children:(0,i.jsx)(wS,{className:"icon-md",icon:e.icon})}),(0,i.jsx)("div",{className:"mt-6 text-xs capitalize max-w-[90%] overflow-hidden overflow-ellipsis",children:t?(0,i.jsx)(M_,{...t}):e.name})]})}function TT(){const e=vp(e=>e.history.items),t=vp(e=>e.history.pointer);return(0,i.jsxs)(ob.div,{...__,className:"absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden",children:[(0,i.jsxs)("div",{className:"px-10 py-2 mb-4 font-medium text-sm border-b flex items-center",children:[(0,i.jsx)(M_,{message:"History"}),(0,i.jsx)(bS,{size:"xs",className:"ml-auto flex-shrink-0",onClick:()=>{yp().togglePanel("history",!1)},children:(0,i.jsx)(MS,{})})]}),(0,i.jsx)("div",{className:"p-10",children:e.map(r=>{const n=r.id===e[t].id,a=kd[r.name],s=a.icon&&o.createElement(a.icon,{className:"icon-sm"});return(0,i.jsx)(gx,{onClick:()=>{n||bp().history.load(r)},variant:"outline",color:n?"primary":null,size:"sm",className:od("w-full mb-8",n&&"pointer-events-none"),justify:"justify-start",startIcon:s,children:(0,i.jsx)(M_,{...a.name})},r.id)})})]})}function FT(e){const{children:t,className:r,color:n,onDismiss:a,leftAdornment:s,rightAdornment:l,hideDismissButton:c=!1,size:u,showDivider:d,justify:h="justify-between",titleFontWeight:f="font-semibold",titleTextSize:p=("xs"===u?"text-xs":"text-sm"),closeButtonSize:g=("xs"===u?"xs":"sm"),actions:m}=e,{labelId:v,isDismissable:y,close:b}=(0,o.useContext)(rI);return(0,i.jsxs)("div",{className:od(r,"flex flex-shrink-0 items-center gap-10",f,d&&"border-b",OT(e),n||"text-main",h),children:[s,(0,i.jsx)("h3",{id:v,className:od(p,"mr-auto leading-5 opacity-90"),children:t}),l,m,y&&!c&&(0,i.jsx)(bS,{"aria-label":"Dismiss",onClick:()=>{a?a():b()},size:g,className:od("-mr-8 text-muted",l&&"sr-only"),children:(0,i.jsx)(MS,{})})]})}function OT({size:e,padding:t}){if(t)return t;switch(e){case"2xs":case"xs":return"px-14 py-4";case"sm":return"px-18 py-4";default:return"px-24 py-6"}}const PT=(0,o.forwardRef)((e,t)=>{const{children:r,className:n,padding:o,size:a,...s}=e;return(0,i.jsx)("div",{...s,ref:t,className:od(n,MT(e),"overflow-y-auto overflow-x-hidden overscroll-contain text-sm flex-auto"),children:r})});function MT({size:e,padding:t}){if(t)return t;switch(e){case"xs":return"p-14";case"sm":return"p-18";default:return"px-24 py-20"}}function RT(){const e=vp(e=>e.openPanels.newImage);return(0,i.jsx)(uI,{isOpen:e,disableInitialTransition:!0,type:"modal",isDismissable:!1,children:(0,i.jsx)(LT,{})})}function LT(){const[e,t]=(0,o.useState)("default");return(0,i.jsxs)(sI,{className:"text-center max-w-max text-main",size:"auto",children:[(0,i.jsx)(FT,{padding:"px-24 pt-24 pb-12",showDivider:!1,children:(0,i.jsx)(M_,{message:"Open a photo or design to get started"})}),(0,i.jsx)(PT,{children:(0,i.jsx)("default"===e?NT:zT,{setActivePanel:t})})]})}function NT({setActivePanel:e}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(gx,{className:"mr-20",size:"sm",variant:"raised",color:"primary",onClick:()=>{bp().import.uploadAndReplaceMainImage()},children:(0,i.jsx)(M_,{message:"Open Photo"})}),(0,i.jsx)(gx,{variant:"outline",size:"sm",color:"primary",onClick:()=>{e("newCanvas")},children:(0,i.jsx)(M_,{message:"Create New"})}),(0,i.jsx)(DT,{})]})}function DT(){const e=vp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.openImageDialog)?void 0:r.sampleImages});return null!=e&&e.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"relative py-20 text-main",children:[(0,i.jsx)("hr",{className:"absolute h-1 border-none bg-divider w-full top inset-0 m-auto"}),(0,i.jsx)("span",{className:"text-sm bg px-6 relative",children:(0,i.jsx)(M_,{message:"or use sample"})})]}),(0,i.jsx)("ul",{className:"flex items-center gap-16",children:e.map(e=>(0,i.jsx)("li",{className:"shrink-0",children:(0,i.jsx)("button",{type:"button",onClick:async()=>{"function"==typeof e.action?e.action():e.url.endsWith(".json")?(await Cp(sw(e.url)),yp().togglePanel("newImage",!1)):(await bp().import.openBackgroundImage(sw(e.url)),yp().togglePanel("newImage",!1))},children:(0,i.jsx)("img",{className:"w-80 h-80 rounded overflow-hidden transition-shadow hover:shadow-md",src:sw(e.thumbnail),alt:""})})},e.url||e.thumbnail))})]}):null}function zT({setActivePanel:e}){const[t,r]=(0,o.useState)({width:800,height:600,bgColor:"transparent"});return(0,i.jsxs)("form",{onSubmit:e=>{e.preventDefault();const{width:r,height:n,bgColor:i}=t;r&&n&&(yp().setConfig({blankCanvasSize:{width:r,height:n}}),bp().canvas.openNew(r,n,i),yp().togglePanel("newImage",!1),bp().history.addInitial())},children:[(0,i.jsx)(gS,{type:"number",label:(0,i.jsx)(M_,{message:"Width"}),value:t.width,min:1,required:!0,className:"mb-16",onChange:e=>{r({...t,width:e.target.valueAsNumber})}}),(0,i.jsx)(gS,{type:"number",label:(0,i.jsx)(M_,{message:"Height"}),value:t.height,min:1,required:!0,className:"mb-16",onChange:e=>{r({...t,height:e.target.valueAsNumber})}}),(0,i.jsx)(dI,{onChange:e=>{r({...t,bgColor:e})},className:"mb-16",value:t.bgColor,label:(0,i.jsx)(M_,{message:"Background color"})}),(0,i.jsxs)("div",{className:"text-right",children:[(0,i.jsx)(gx,{size:"sm",variant:"text",className:"mr-10",onClick:()=>{e("default")},children:(0,i.jsx)(M_,{message:"Cancel"})}),(0,i.jsx)(gx,{size:"sm",type:"submit",variant:"raised",color:"primary",children:(0,i.jsx)(M_,{message:"Create"})})]})]})}const BT=(0,o.forwardRef)((e,t)=>{const r=iS(e),{label:n,children:a,size:s,className:l,orientation:c="horizontal",disabled:u,required:d,invalid:h,errorMessage:f,description:p}=e,g=(0,o.useId)(),m=e.name||g;return(0,i.jsxs)("fieldset",{"aria-describedby":p?`${g}-description`:void 0,ref:t,className:od("text-left",l),children:[n&&(0,i.jsx)("legend",{className:r.label,children:n}),(0,i.jsx)("div",{className:od("flex",n?"mt-6":"mt-0","vertical"===c?"flex-col gap-10":"flex-row gap-16"),children:o.Children.map(a,e=>{if((0,o.isValidElement)(e))return(0,o.cloneElement)(e,{name:m,size:s,invalid:e.props.invalid||h||void 0,disabled:e.props.disabled||u,required:e.props.required||d})})}),p&&!f&&(0,i.jsx)("div",{className:r.description,id:`${g}-description`,children:p}),f&&(0,i.jsx)("div",{className:r.error,children:f})]})}),UT=(0,o.forwardRef)((e,t)=>{const{children:r,autoFocus:n,size:o,invalid:a,isFirst:s,...l}=e,c=Rb(t);fS({autoFocus:n},c);const u=function(e){switch(e){case"xs":return{circle:"h-12 w-12",label:"text-xs"};case"sm":return{circle:"h-16 w-16",label:"text-sm"};case"lg":return{circle:"h-24 w-24",label:"text-lg"};default:return{circle:"h-20 w-20",label:"text-base"}}}(o);return(0,i.jsxs)("label",{className:od("inline-flex gap-8 select-none items-center whitespace-nowrap align-middle",u.label,e.disabled&&"text-disabled pointer-events-none",e.invalid&&"text-danger"),children:[(0,i.jsx)("input",{type:"radio",className:od("focus-visible:ring outline-none","rounded-full transition-button border-2 appearance-none","border-text-muted disabled:border-disabled-fg checked:border-primary checked:hover:border-primary-dark","before:bg-primary disabled:before:bg-disabled-fg before:hover:bg-primary-dark","before:h-full before:w-full before:block before:rounded-full before:scale-10 before:opacity-0 before:transition before:duration-200","checked:before:scale-[.65] checked:before:opacity-100",u.circle),ref:c,...l}),r&&(0,i.jsx)("span",{children:r})]})});function VT(){const e=vp(e=>e.openPanels.export);return(0,i.jsx)(uI,{isOpen:e,onOpenChange:e=>{e||yp().togglePanel("export",!1)},type:"modal",children:(0,i.jsx)(HT,{})})}function HT(){const[e,t]=(0,o.useState)(()=>{var e,t,r,n,i,o;return{filename:(null==(t=null==(e=yp().config.tools)?void 0:e.export)?void 0:t.defaultName)||"image",format:(null==(n=null==(r=yp().config.tools)?void 0:r.export)?void 0:n.defaultFormat)||"jpeg",quality:(null==(o=null==(i=yp().config.tools)?void 0:i.export)?void 0:o.defaultQuality)||.8}});return(0,i.jsx)(sI,{className:"text-center max-w-max text-main",size:"auto",children:(0,i.jsx)(PT,{children:(0,i.jsxs)("form",{onSubmit:t=>{t.preventDefault(),bp().export.save(e.filename,e.format,e.quality),yp().togglePanel("export",!1)},children:[(0,i.jsx)(gS,{required:!0,size:"sm",label:(0,i.jsx)(M_,{message:"Save As"}),value:e.filename,onChange:r=>{t({...e,filename:r.target.value})}}),(0,i.jsxs)(BT,{size:"sm",className:"my-20","aria-label":"Image format",children:[(0,i.jsx)(UT,{value:"jpeg",checked:"jpeg"===e.format,onChange:r=>{t({...e,format:r.target.value})},children:"JPEG"}),(0,i.jsx)(UT,{value:"png",checked:"png"===e.format,onChange:r=>{t({...e,format:r.target.value})},children:"PNG"}),(0,i.jsx)(UT,{value:"json",checked:"json"===e.format,onChange:r=>{t({...e,format:r.target.value})},children:"JSON"})]}),(0,i.jsx)(CI,{size:"sm",minValue:.1,step:.1,maxValue:1,value:e.quality,onChange:r=>{t({...e,quality:r})},formatOptions:{style:"percent"},label:(0,i.jsx)(M_,{message:"Quality"})}),(0,i.jsx)(gx,{variant:"raised",color:"primary",type:"submit",className:"mt-20 w-full",size:"sm",children:(0,i.jsx)(M_,{message:"Save"})})]})})})}function $T(){const e=vp(e=>e.objects.all),t=vp(e=>e.objects.active.id);return(0,i.jsxs)(ob.div,{...__,className:"absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden",children:[(0,i.jsxs)("div",{className:"px-10 py-2 mb-4 font-medium text-sm border-b flex items-center",children:[(0,i.jsx)(M_,{message:"Objects"}),(0,i.jsx)(bS,{size:"xs",className:"ml-auto flex-shrink-0",onClick:()=>{yp().togglePanel("objects",!1)},children:(0,i.jsx)(MS,{})})]}),(0,i.jsx)("div",{className:"p-8",children:e.map(e=>{const r=e.id===t,n=e.name;if(!n)return null;const a=pf[n],s=a.icon&&o.createElement(a.icon,{className:"icon-sm"});return(0,i.jsx)(gx,{onClick:()=>{r||!e.selectable||bp().objects.select(e.id)},variant:"outline",color:r?"primary":null,size:"sm",className:od("w-full mb-8",(r||!e.selectable)&&"pointer-events-none"),justify:"justify-start",startIcon:s,children:(0,i.jsx)(M_,{...a.name})},e.id)})})]})}function WT(){const e=vp(e=>e.openPanels.history),t=vp(e=>e.openPanels.objects);return(0,i.jsxs)("div",{className:"z-modal",children:[(0,i.jsxs)(hb,{children:[e&&(0,i.jsx)(TT,{},"historyPanel"),t&&(0,i.jsx)($T,{},"objListPanel")]}),(0,i.jsx)(RT,{}),(0,i.jsx)(VT,{})]})}function GT(){return GT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GT.apply(this,arguments)}var qT,YT;function XT(e,t){if(!1===e||null===e||typeof e>"u")throw new Error(t)}function KT(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function ZT(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function JT(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function QT(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function eF(e,t){let r=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?r.map((t,r)=>r===e.length-1?t.pathname:t.pathnameBase):r.map(e=>e.pathnameBase)}function tF(e,t,r,n){let i;void 0===n&&(n=!1),"string"==typeof e?i=ZT(e):(i=GT({},e),XT(!i.pathname||!i.pathname.includes("?"),QT("?","pathname","search",i)),XT(!i.pathname||!i.pathname.includes("#"),QT("#","pathname","hash",i)),XT(!i.search||!i.search.includes("#"),QT("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(null==s)o=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:i=""}="string"==typeof e?ZT(e):e;return{pathname:r?r.startsWith("/")?r:JT(r,t):t,search:nF(n),hash:iF(i)}}(i,o),c=s&&"/"!==s&&s.endsWith("/"),u=(a||"."===s)&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(qT||(qT={})),function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(YT||(YT={}));const rF=e=>e.join("/").replace(/\/\/+/g,"/"),nF=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",iF=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",oF=["post","put","patch","delete"];new Set(oF);const aF=["get",...oF];function sF(){return sF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sF.apply(this,arguments)}new Set(aF);const lF=o.createContext(null),cF=o.createContext(null),uF=o.createContext(null),dF=o.createContext({outlet:null,matches:[],isDataRoute:!1});function hF(){return null!=o.useContext(uF)}function fF(){return hF()||XT(!1),o.useContext(uF).location}function pF(e){o.useContext(cF).static||o.useLayoutEffect(e)}function gF(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=o.useContext(cF),{matches:i}=o.useContext(dF),{pathname:a}=fF(),s=JSON.stringify(eF(i,n.v7_relativeSplatPath));return o.useMemo(()=>tF(e,JSON.parse(s),a,"path"===r),[e,s,a,r])}var mF=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(mF||{}),vF=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(vF||{});function yF(){return yF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yF.apply(this,arguments)}new Promise(()=>{});const bF=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch{}const wF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xF=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,CF=o.forwardRef(function(e,t){let r,{onClick:n,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,f=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&(i[r]=e[r]);return i}(e,bF),{basename:p}=o.useContext(cF),g=!1;if("string"==typeof u&&xF.test(u)&&(r=u,wF))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=function(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}(t.pathname,p);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:g=!0}catch{}let m=function(e,t){let{relative:r}=void 0===t?{}:t;hF()||XT(!1);let{basename:n,navigator:i}=o.useContext(cF),{hash:a,pathname:s,search:l}=gF(e,{relative:r}),c=s;return"/"!==n&&(c="/"===s?n:rF([n,s])),i.createHref({pathname:c,search:l,hash:a})}(u,{relative:i}),v=function(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=function(){let{isDataRoute:e}=o.useContext(dF);return e?function(){let{router:e}=function(){let e=o.useContext(lF);return e||XT(!1),e}(mF.UseNavigateStable),t=function(){let e=function(){let e=o.useContext(dF);return e||XT(!1),e}(),t=e.matches[e.matches.length-1];return t.route.id||XT(!1),t.route.id}(vF.UseNavigateStable),r=o.useRef(!1);return pF(()=>{r.current=!0}),o.useCallback(function(n,i){void 0===i&&(i={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,sF({fromRouteId:t},i)))},[e,t])}():function(){hF()||XT(!1);let e=o.useContext(lF),{basename:t,future:r,navigator:n}=o.useContext(cF),{matches:i}=o.useContext(dF),{pathname:a}=fF(),s=JSON.stringify(eF(i,r.v7_relativeSplatPath)),l=o.useRef(!1);return pF(()=>{l.current=!0}),o.useCallback(function(r,i){if(void 0===i&&(i={}),!l.current)return;if("number"==typeof r)return void n.go(r);let o=tF(r,JSON.parse(s),a,"path"===i.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:rF([t,o.pathname])),(i.replace?n.replace:n.push)(o,i.state,i)},[t,n,s,a,e])}()}(),u=fF(),d=gF(e,{relative:s});return o.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,r)){t.preventDefault();let r=void 0!==n?n:KT(u)===KT(d);c(e,{replace:r,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:l})}},[u,c,d,n,i,r,e,a,s,l])}(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:i,unstable_viewTransition:h});return o.createElement("a",yF({},f,{href:r||m,onClick:g||a?n:function(e){n&&n(e),e.defaultPrevented||v(e)},ref:t,target:c}))});var _F,SF;!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(_F||(_F={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(SF||(SF={}));const AF=ld((0,i.jsx)("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"),kF=ld((0,i.jsx)("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"),EF={opacity:0,y:50,scale:.3},IF={opacity:1,y:0,scale:1},jF={opacity:0,scale:.5};function TF(){const e=jp(e=>e.toasts);return(0,i.jsx)("div",{className:"pointer-events-none relative",children:(0,i.jsx)(hb,{initial:!1,children:e.map(e=>(0,i.jsx)("div",{className:od("fixed z-toast mx-auto p-20","bottom-center"===e.position?"bottom-0 left-0 right-0":"bottom-0 right-0"),children:(0,i.jsxs)(ob.div,{initial:e.disableEnterAnimation?void 0:EF,animate:e.disableEnterAnimation?void 0:IF,exit:e.disableExitAnimation?void 0:jF,className:od("pointer-events-auto mx-auto flex max-h-100 min-h-50 w-min min-w-288 max-w-500 items-center gap-10 rounded-lg border bg-paper bg-paper py-6 pl-16 pr-6 text-sm text-main shadow-lg"),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&&(0,i.jsx)(AF,{className:"flex-shrink-0 text-danger",size:"md"}),"loading"===e.type&&(0,i.jsx)(_I,{size:"sm",className:"flex-shrink-0",isIndeterminate:!0}),"positive"===e.type&&(0,i.jsx)(kF,{className:"flex-shrink-0 text-positive",size:"md"}),(0,i.jsx)("div",{className:"mr-auto w-max overflow-hidden overflow-ellipsis","data-testid":"toast-message",children:(0,i.jsx)(xS,{value:e.message})}),e.action&&(0,i.jsx)(gx,{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:()=>Tp().remove(e.id),elementType:CF,to:e.action.action,children:(0,i.jsx)(xS,{value:e.action.label})}),"loading"!==e.type&&(0,i.jsx)(bS,{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:()=>{Tp().remove(e.id)},size:"sm",children:(0,i.jsx)(MS,{})})]})},e.id))})})}function FF(e){return Tb()?e.metaKey:e.ctrlKey}function OF(e){switch(e.key){case"z":FF(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?bp().history.redo():bp().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),bp().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),bp().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),bp().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),bp().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),bp().objects.delete();break;case"v":FF(e)&&(e.preventDefault(),e.stopPropagation(),async function(){try{const e=await navigator.clipboard.read();for(const t of e)for(const e of t.types)if(e.startsWith("image/")){const r=await t.getType(e),n=new FileReader;return n.onload=e=>{var t;null!=(t=e.target)&&t.result&&bp().import.addImageFromData(e.target.result)},void n.readAsDataURL(r)}}catch(e){}}())}}const PF=new Map,MF=new Map,RF={};async function*LF(e){const t=e.createReader();let r;do{r=await new Promise((e,r)=>{t.readEntries(e,r)});for(const e of r)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await NF(e);yield new Ww(t,e.fullPath)}else e.isDirectory&&(yield*LF(e))}while(r.length>0)}function NF(e){return new Promise((t,r)=>e.file(t,r))}function DF(e){return null!=RF.dragTargetId?PF.get(RF.dragTargetId):e.dataTransfer.types.includes("Files")?{type:"nativeFile",el:null,ref:null,getData:()=>async function(e){const t=[];for await(const r of e)t.push(r);return t}(async function*(e){const t=[];for(const r of e.items)if("file"===r.kind){const e=r.webkitGetAsEntry();e&&t.push(e)}for(const r of t)if(r.isFile){if(".DS_Store"===r.name)continue;const e=await NF(r);yield new Ww(e,r.fullPath)}else r.isDirectory&&(yield*LF(r))}(e.dataTransfer))}:void 0}function zF(){const e=vp(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible})??!0,t=vp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.nav)?void 0:r.position})??"bottom",r=vp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.menubar)?void 0:r.position})??"top",n=vp(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,a=(0,o.useRef)(null),s=(0,o.useRef)(null),{isModal:l,isMobile:c}=RS(),u=(0,o.useCallback)(async e=>{var t,r;if(yp().activeTool||yp().dirty||"nativeFile"!==e.type)return;const n=await e.getData();bp().import.fileIsValid(n[0])&&((null==(r=null==(t=yp().config.tools)?void 0:t.import)?void 0:r.openDroppedImageAsBackground)?await bp().import.openBackgroundImage(n[0]):await bp().import.openUploadedFile(n[0]))},[]),{droppableProps:d}=function({id:e,disabled:t,ref:r,...n}){const i=(0,o.useRef)({dragOverElements:new Set,dropActivateTimer:void 0}).current,a=(0,o.useRef)(n);a.current=n,(0,o.useLayoutEffect)(()=>(MF.set(e,{...MF.get(e),disabled:t,id:e,ref:r}),()=>{MF.delete(e)}),[e,a,t,r]);const s=e=>{var t;const n=a.current,i=n.allowDragEventsFromItself||r.current!==(null==(t=e.ref)?void 0:t.current);return!(!(null!=e&&e.type&&i&&n.types.includes(e.type))||n.acceptsDrop&&!n.acceptsDrop(e))},l=e=>{var t,r;const n=DF(e);n&&(null==(r=(t=a.current).onDragLeave)||r.call(t,n))};return{droppableProps:t?{}:{onDragOver:e=>{var t,r;e.preventDefault(),e.stopPropagation();const n=DF(e);n&&s(n)&&(null==(r=(t=a.current).onDragOver)||r.call(t,n,e))},onDragEnter:e=>{var t,r;if(e.stopPropagation(),i.dragOverElements.add(e.target),i.dragOverElements.size>1)return;const n=DF(e);n&&s(n)&&(null==(r=(t=a.current).onDragEnter)||r.call(t,n),clearTimeout(i.dropActivateTimer),"function"==typeof a.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;n&&(null==(t=(e=a.current).onDropActivate)||t.call(e,n))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const r of i.dragOverElements)e.currentTarget.contains(r)||i.dragOverElements.delete(r);if(i.dragOverElements.size>0)return;const t=DF(e);t&&s(t)&&(l(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,r,n,o;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),l(e),clearTimeout(i.dropActivateTimer);const c=DF(e);c&&(null==(r=(t=a.current).onDragLeave)||r.call(t,c),s(c)&&(null==(o=(n=a.current).onDrop)||o.call(n,c)))}}}}({id:"pixie-root",ref:s,types:["nativeFile"],onDrop:u});(0,o.useEffect)(()=>{var e,t;yp().fabric||(vp.setState({canvasRef:a}),function(e){const t=function(e){var t;const r=new Vb.fabric.Canvas(e,{width:1,height:1});r.preserveObjectStacking=!0,r.selection=!1,r.renderOnAddRemove=!1;const n=yp().config.textureSize;n&&(Vb.fabric.textureSize=n);const i={...null==(t=yp().config.objectDefaults)?void 0:t.global,...$b};Object.keys(i).forEach(e=>{Vb.fabric.Object.prototype[e]=i[e]}),r.on("object:added",e=>{var t,r;e.target&&(null==(r=null==(t=e.target)?void 0:t.data)||!r.id)&&(e.target.data||(e.target.data={}),e.target.data.id=Wb(10))});const o=Vb.fabric.Object.prototype.controls;return Object.keys(o).forEach(e=>{delete o[e]}),r}(e);yp().editor.fabric=t,vp.setState({fabric:t}),yp().editor.tools={canvas:new Zb,objects:new nw,zoom:new Yb,history:new hw,filter:new yw,resize:new Aw,crop:new Iw,merge:new fw,shape:new jw,frame:new Mw,text:new Rw,draw:new Vw,transform:new ax,import:new Qw,watermark:new tx,export:new ix,corners:new ox}}(a.current),null!=(e=yp().config.ui)&&e.defaultTool&&yp().setActiveTool(null==(t=yp().config.ui)?void 0:t.defaultTool,null),bp().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=yp().config).onLoad)||t.call(e,yp().editor)}));const r=sx(s,()=>{yp().setStageSize(lx(s.current))}),n=sx(a,()=>{yp().setCanvasSize(lx(a.current))});return()=>{r(),n()}},[s]);const h=od("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!l,"fixed inset-0 w-full h-full z-20":l,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":l&&!c});return(0,i.jsxs)(fb,{features:gb,strict:!0,children:[l&&e&&!c&&n&&(0,i.jsx)(bS,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{yp().editor.close()},children:(0,i.jsx)(MS,{})}),l&&e&&(0,i.jsx)(E_,{position:"fixed",disableInitialTransition:!0}),(0,i.jsxs)(ob.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:e?"visible":"hidden",className:h,children:["top"===r&&(0,i.jsx)(VS,{}),"top"===t&&(0,i.jsx)(ET,{className:"pt-14"}),(0,i.jsxs)("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...Eb(d,{onKeyDownCapture:OF}),ref:s,children:[(0,i.jsx)($S,{}),(0,i.jsx)(vk,{ref:a})]}),(0,i.jsx)(vj,{}),"bottom"===t&&(0,i.jsx)(ET,{}),"bottom"===r&&(0,i.jsx)(VS,{}),(0,i.jsx)(WT,{}),(0,i.jsx)(TF,{})]})]})}!function(){fabric.Object.ENLIVEN_PROPS.push("eraser");var e=fabric.Object.prototype._drawClipPath,t=fabric.Object.prototype.needsItsOwnCache,r=fabric.Object.prototype.toObject,n=fabric.Object.prototype.getSvgCommons,i=fabric.Object.prototype._createBaseClipPathSVGMarkup,o=fabric.Object.prototype._createBaseSVGMarkup;fabric.Object.prototype.cacheProperties.push("eraser"),fabric.Object.prototype.stateProperties.push("eraser"),fabric.util.object.extend(fabric.Object.prototype,{erasable:!0,eraser:void 0,needsItsOwnCache:function(){return t.call(this)||!!this.eraser},_drawClipPath:function(t,r){if(e.call(this,t,r),this.eraser){var n=this._getNonTransformedDimensions();this.eraser.isType("eraser")&&this.eraser.set({width:n.x,height:n.y}),e.call(this,t,this.eraser)}},toObject:function(e){var t=r.call(this,["erasable"].concat(e));return this.eraser&&!this.eraser.excludeFromExport&&(t.eraser=this.eraser.toObject(e)),t},getSvgCommons:function(){return n.call(this)+(this.eraser?'mask="url(#'+this.eraser.clipPathId+')" ':"")},_createEraserSVGMarkup:function(e){return this.eraser?(this.eraser.clipPathId="MASK_"+fabric.Object.__uid++,['<mask id="',this.eraser.clipPathId,'" >',this.eraser.toSVG(e),"</mask>","\n"].join("")):""},_createBaseClipPathSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),i.call(this,e,t)].join("")},_createBaseSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),o.call(this,e,t)].join("")}});var a=fabric.Group.prototype._restoreObjectsState;fabric.util.object.extend(fabric.Group.prototype,{_addEraserPathToObjects:function(e){this._objects.forEach(function(t){fabric.EraserBrush.prototype._addPathToObjectEraser.call(fabric.EraserBrush.prototype,t,e)})},applyEraserToObjects:function(){var e=this,t=this.eraser;if(t){delete this.eraser;var r=e.calcTransformMatrix();t.clone(function(t){var n=e.clipPath;t.getObjects("path").forEach(function(t){var i=fabric.util.multiplyTransformMatrices(r,t.calcTransformMatrix());fabric.util.applyTransformToObject(t,i),n?n.clone(function(n){var i=fabric.EraserBrush.prototype.applyClipPathToPath.call(fabric.EraserBrush.prototype,t,n,r);e._addEraserPathToObjects(i)},["absolutePositioned","inverted"]):e._addEraserPathToObjects(t)})})}},_restoreObjectsState:function(){return!0===this.erasable&&this.applyEraserToObjects(),a.call(this)}}),fabric.Eraser=fabric.util.createClass(fabric.Group,{type:"eraser",originX:"center",originY:"center",drawObject:function(e){e.save(),e.fillStyle="black",e.fillRect(-this.width/2,-this.height/2,this.width,this.height),e.restore(),this.callSuper("drawObject",e)},_getBounds:function(){},_toSVG:function(e){var t=["<g ","COMMON_PARTS"," >\n"],r=["<rect ",'fill="white" ','x="',-this.width/2,'" y="',-this.height/2,'" width="',this.width,'" height="',this.height,'" />\n'].join("");t.push("\t\t",r);for(var n=0,i=this._objects.length;n<i;n++)t.push("\t\t",this._objects[n].toSVG(e));return t.push("</g>\n"),t}}),fabric.Eraser.fromObject=function(e,t){var r=e.objects;fabric.util.enlivenObjects(r,function(r){var n=fabric.util.object.clone(e,!0);delete n.objects,fabric.util.enlivenObjectEnlivables(e,n,function(){t&&t(new fabric.Eraser(r,n,!0))})})};var s=fabric.Canvas.prototype._renderOverlay;fabric.util.object.extend(fabric.Canvas.prototype,{isErasing:function(){return this.isDrawingMode&&this.freeDrawingBrush&&"eraser"===this.freeDrawingBrush.type&&this.freeDrawingBrush._isErasing},_renderOverlay:function(e){s.call(this,e),this.isErasing()&&!this.freeDrawingBrush.inverted&&this.freeDrawingBrush._render()}}),fabric.EraserBrush=fabric.util.createClass(fabric.PencilBrush,{type:"eraser",inverted:!1,_isErasing:!1,_isErasable:function(e){return!1!==e.erasable},_prepareCollectionTraversal:function(e,t,r){e.forEachObject(function(n){n.forEachObject&&"deep"===n.erasable?this._prepareCollectionTraversal(n,t,r):!this.inverted&&n.erasable&&n.visible?(n.visible=!1,e.dirty=!0,r.visibility.push(n),r.collection.push(e)):this.inverted&&n.visible&&(n.erasable&&n.eraser?(n.eraser.inverted=!0,n.dirty=!0,e.dirty=!0,r.eraser.push(n),r.collection.push(e)):(n.visible=!1,e.dirty=!0,r.visibility.push(n),r.collection.push(e)))},this)},preparePattern:function(){this._patternCanvas||(this._patternCanvas=fabric.util.createCanvasElement());var e=this._patternCanvas;e.width=this.canvas.width,e.height=this.canvas.height;var t=e.getContext("2d");if(this.canvas._isRetinaScaling()){var r=this.canvas.getRetinaScaling();this.canvas.__initRetinaScaling(r,e,t)}var n=this.canvas.backgroundImage,i=n&&this._isErasable(n),o=this.canvas.overlayImage,a=o&&this._isErasable(o);if(!this.inverted&&(n&&!i||this.canvas.backgroundColor))i&&(this.canvas.backgroundImage=void 0),this.canvas._renderBackground(t),i&&(this.canvas.backgroundImage=n);else if(this.inverted&&n&&i){var l=this.canvas.backgroundColor;this.canvas.backgroundColor=void 0,this.canvas._renderBackground(t),this.canvas.backgroundColor=l}t.save(),t.transform.apply(t,this.canvas.viewportTransform);var c={visibility:[],eraser:[],collection:[]};this._prepareCollectionTraversal(this.canvas,t,c),this.canvas._renderObjects(t,this.canvas._objects),c.visibility.forEach(function(e){e.visible=!0}),c.eraser.forEach(function(e){e.eraser.inverted=!1,e.dirty=!0}),c.collection.forEach(function(e){e.dirty=!0}),t.restore(),!this.inverted&&(o&&!a||this.canvas.overlayColor)?(a&&(this.canvas.overlayImage=void 0),s.call(this.canvas,t),a&&(this.canvas.overlayImage=o)):this.inverted&&o&&a&&(l=this.canvas.overlayColor,this.canvas.overlayColor=void 0,s.call(this.canvas,t),this.canvas.overlayColor=l)},_setBrushStyles:function(e){this.callSuper("_setBrushStyles",e),e.strokeStyle="black"},_saveAndTransform:function(e){this.callSuper("_saveAndTransform",e),this._setBrushStyles(e),e.globalCompositeOperation=e===this.canvas.getContext()?"destination-out":"source-over"},needsFullRender:function(){return!0},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this.preparePattern(),this._isErasing=!0,this.canvas.fire("erasing:start"),this._render())},_render:function(){var e;this.inverted||(e=this.canvas.getContext(),this.callSuper("_render",e)),e=this.canvas.contextTop,this.canvas.clearContext(e),this.callSuper("_render",e),e.save();var t=1/this.canvas.getRetinaScaling();e.scale(t,t),e.globalCompositeOperation="source-in",e.drawImage(this._patternCanvas,0,0),e.restore()},createPath:function(e){var t=this.callSuper("createPath",e);return t.globalCompositeOperation=this.inverted?"source-over":"destination-out",t.stroke=this.inverted?"white":"black",t},applyClipPathToPath:function(e,t,r){var n=fabric.util.invertTransform(e.calcTransformMatrix()),i=t.calcTransformMatrix(),o=t.absolutePositioned?n:fabric.util.multiplyTransformMatrices(n,r);return t.absolutePositioned=!1,fabric.util.applyTransformToObject(t,fabric.util.multiplyTransformMatrices(o,i)),e.clipPath=e.clipPath?fabric.util.mergeClipPaths(t,e.clipPath):t,e},clonePathWithClipPath:function(e,t,r){var n=t.calcTransformMatrix(),i=t.clipPath,o=this;e.clone(function(e){i.clone(function(t){r(o.applyClipPathToPath(e,t,n))},["absolutePositioned","inverted"])})},_addPathToObjectEraser:function(e,t){var r=this;if(e.forEachObject&&"deep"===e.erasable){var n=e._objects.filter(function(e){return e.erasable});n.length>0&&e.clipPath?this.clonePathWithClipPath(t,e,function(e){n.forEach(function(t){r._addPathToObjectEraser(t,e)})}):n.length>0&&n.forEach(function(e){r._addPathToObjectEraser(e,t)})}else{var i=e.eraser;i||(i=new fabric.Eraser,e.eraser=i),t.clone(function(t){var n=fabric.util.multiplyTransformMatrices(fabric.util.invertTransform(e.calcTransformMatrix()),t.calcTransformMatrix());fabric.util.applyTransformToObject(t,n),i.addWithUpdate(t),e.set("dirty",!0),e.fire("erasing:end",{path:t}),e.group&&Array.isArray(r.__subTargets)&&r.__subTargets.push(e)})}},applyEraserToCanvas:function(e){var t=this.canvas,r={};return["backgroundImage","overlayImage"].forEach(function(n){var i=t[n];i&&i.erasable&&(this._addPathToObjectEraser(i,e),r[n]=i)},this),r},_finalizeAndAddPath:function(){var e=this.canvas.contextTop,t=this.canvas;e.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate)),t.clearContext(t.contextTop),this._isErasing=!1;var r=this._points&&this._points.length>1?this.convertPointsToSVGPath(this._points):null;if(!r||this._isEmptySVGPath(r))return t.fire("erasing:end"),void t.requestRenderAll();var n=this.createPath(r);n.setCoords(),t.fire("before:path:created",{path:n});var i=this.applyEraserToCanvas(n),o=this;this.__subTargets=[];var a=[];t.forEachObject(function(e){e.erasable&&e.intersectsWithObject(n,!0,!0)&&(o._addPathToObjectEraser(e,n),a.push(e))}),t.fire("erasing:end",{path:n,targets:a,subTargets:this.__subTargets,drawables:i}),delete this.__subTargets,t.requestRenderAll(),this._resetShadow(),t.fire("path:created",{path:n})}})}(),za(!1);const BF=class e{constructor(e){if(ja(this,"tools",{}),ja(this,"fabric",null),e.sentryDsn&&function(e){const t={...e};Lc(t,"react"),Gu(t)}({dsn:e.sentryDsn}),function(e,t){void 0===t&&(t={});var r=t.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.3.2 | 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 [hidden]{display:none}.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-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--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-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--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%!important}.pi .container{width:100%}@media (min-width:640px){.pi .\\!container{max-width:640px!important}.pi .container{max-width:640px}}@media (min-width:768px){.pi .\\!container{max-width:768px!important}.pi .container{max-width:768px}}@media (min-width:1024px){.pi .\\!container{max-width:1024px!important}.pi .container{max-width:1024px}}@media (min-width:1280px){.pi .\\!container{max-width:1280px!important}.pi .container{max-width:1280px}}@media (min-width:1536px){.pi .\\!container{max-width:1536px!important}.pi .container{max-width:1536px}}.pi .sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pi .pointer-events-none{pointer-events:none}.pi .pointer-events-auto{pointer-events:auto}.pi .\\!visible{visibility:visible!important}.pi .visible{visibility:visible}.pi .invisible{visibility:hidden}.pi .collapse{visibility:collapse}.pi .static{position:static}.pi .fixed{position:fixed}.pi .absolute{position:absolute}.pi .relative{position:relative}.pi .inset-0{top:0;right:0;bottom:0;left:0}.pi .inset-x-0{left:0;right:0}.pi .-bottom-10{bottom:-10px}.pi .-bottom-20{bottom:-20px}.pi .-bottom-5{bottom:-5px}.pi .-left-5{left:-5px}.pi .-left-8{left:-8px}.pi .-left-80{left:-80px}.pi .-right-5{right:-5px}.pi .-top-144{top:-144px}.pi .-top-40{top:-40px}.pi .-top-5{top:-5px}.pi .bottom-0{bottom:0}.pi .bottom-20{bottom:20px}.pi .left-0{left:0}.pi .left-1\\/2{left:50%}.pi .left-20{left:20px}.pi .right-0{right:0}.pi .right-16{right:16px}.pi .right-2{right:2px}.pi .right-20{right:20px}.pi .right-4{right:4px}.pi .top-0{top:0}.pi .top-1\\/2{top:50%}.pi .top-2{top:2px}.pi .isolate{isolation:isolate}.pi .z-10{z-index:10}.pi .z-20{z-index:20}.pi .z-50{z-index:50}.pi .z-cropzone{z-index:10}.pi .z-loading-indicator{z-index:50}.pi .z-modal{z-index:110}.pi .z-navbar{z-index:40}.pi .z-obj-box{z-index:20}.pi .z-popover{z-index:130}.pi .z-toast{z-index:160}.pi .z-tool-overlay{z-index:30}.pi .z-tooltip{z-index:150}.pi .z-tray{z-index:120}.pi .m-auto{margin:auto}.pi .mx-20{margin-left:20px;margin-right:20px}.pi .mx-8{margin-left:8px;margin-right:8px}.pi .mx-auto{margin-left:auto;margin-right:auto}.pi .my-20{margin-bottom:20px;margin-top:20px}.pi .my-4{margin-bottom:4px;margin-top:4px}.pi .my-6{margin-bottom:6px;margin-top:6px}.pi .my-8{margin-bottom:8px;margin-top:8px}.pi .my-auto{margin-bottom:auto;margin-top:auto}.pi .-ml-1{margin-left:-1px}.pi .-ml-10{margin-left:-10px}.pi .-ml-12{margin-left:-12px}.pi .-ml-3{margin-left:-3px}.pi .-ml-4{margin-left:-4px}.pi .-ml-6{margin-left:-6px}.pi .-mr-4{margin-right:-4px}.pi .-mr-8{margin-right:-8px}.pi .mb-1{margin-bottom:1px}.pi .mb-10{margin-bottom:10px}.pi .mb-16{margin-bottom:16px}.pi .mb-2{margin-bottom:2px}.pi .mb-20{margin-bottom:20px}.pi .mb-24{margin-bottom:24px}.pi .mb-4{margin-bottom:4px}.pi .mb-6{margin-bottom:6px}.pi .mb-8{margin-bottom:8px}.pi .ml-10{margin-left:10px}.pi .ml-12{margin-left:12px}.pi .ml-4{margin-left:4px}.pi .ml-6{margin-left:6px}.pi .ml-8{margin-left:8px}.pi .ml-auto{margin-left:auto}.pi .mr-10{margin-right:10px}.pi .mr-16{margin-right:16px}.pi .mr-20{margin-right:20px}.pi .mr-4{margin-right:4px}.pi .mr-5{margin-right:5px}.pi .mr-6{margin-right:6px}.pi .mr-8{margin-right:8px}.pi .mr-auto{margin-right:auto}.pi .mt-0{margin-top:0}.pi .mt-10{margin-top:10px}.pi .mt-14{margin-top:14px}.pi .mt-20{margin-top:20px}.pi .mt-24{margin-top:24px}.pi .mt-4{margin-top:4px}.pi .mt-6{margin-top: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 .grid{display:grid}.pi .contents{display:contents}.pi .hidden{display:none}.pi .aspect-square{aspect-ratio:1/1}.pi .h-1{height:1px}.pi .h-12{height:12px}.pi .h-128{height:128px}.pi .h-14{height:14px}.pi .h-16{height:16px}.pi .h-18{height:18px}.pi .h-2{height:2px}.pi .h-2\\/4{height:50%}.pi .h-20{height:20px}.pi .h-22{height:22px}.pi .h-24{height:24px}.pi .h-26{height:26px}.pi .h-28{height:28px}.pi .h-3{height:3px}.pi .h-30{height:30px}.pi .h-32{height:32px}.pi .h-36{height:36px}.pi .h-38{height:2.375rem}.pi .h-4{height:4px}.pi .h-40{height:40px}.pi .h-42{height:42px}.pi .h-48{height:48px}.pi .h-50{height:50px}.pi .h-56{height:56px}.pi .h-6{height:6px}.pi .h-60{height:60px}.pi .h-64{height:64px}.pi .h-68{height:68px}.pi .h-8{height:8px}.pi .h-80{height:80px}.pi .h-84{height:84px}.pi .h-92{height:92px}.pi .h-\\[54px\\]{height:54px}.pi .h-font{height:1em}.pi .h-full{height:100%}.pi .h-px{height:1px}.pi .h-screen{height:100dvh}.pi .max-h-100{max-height:6.25rem}.pi .max-h-\\[calc\\(100\\%-40px\\)\\]{max-height:calc(100% - 40px)}.pi .max-h-\\[calc\\(100vh-90px\\)\\]{max-height:calc(100vh - 90px)}.pi .max-h-dialog{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .max-h-full{max-height:100%}.pi .max-h-inherit{max-height:inherit}.pi .max-h-tray{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .min-h-24{min-height:24px}.pi .min-h-30{min-height:30px}.pi .min-h-36{min-height:36px}.pi .min-h-42{min-height:42px}.pi .min-h-50{min-height:50px}.pi .min-h-60{min-height:60px}.pi .min-h-86{min-height:86px}.pi .\\!w-auto{width:auto!important}.pi .w-1\\/2{width:50%}.pi .w-110{width:110px}.pi .w-12{width:12px}.pi .w-1280{width:80rem}.pi .w-14{width:14px}.pi .w-144{width:144px}.pi .w-16{width:16px}.pi .w-18{width:18px}.pi .w-2{width:2px}.pi .w-20{width:20px}.pi .w-22{width:22px}.pi .w-224{width:224px}.pi .w-24{width:24px}.pi .w-256{width:256px}.pi .w-26{width:26px}.pi .w-28{width:28px}.pi .w-280{width:17.5rem}.pi .w-30{width:30px}.pi .w-32{width:32px}.pi .w-320{width:320px}.pi .w-36{width:36px}.pi .w-38{width:2.375rem}.pi .w-384{width:384px}.pi .w-40{width:40px}.pi .w-42{width:42px}.pi .w-440{width:27.5rem}.pi .w-46{width:2.875rem}.pi .w-50{width:50px}.pi .w-56{width:56px}.pi .w-60{width:60px}.pi .w-620{width:38.75rem}.pi .w-64{width:64px}.pi .w-68{width:68px}.pi .w-780{width:48.75rem}.pi .w-8{width:8px}.pi .w-80{width:80px}.pi .w-850{width:53.125rem}.pi .w-96{width:96px}.pi .w-\\[4ch\\]{width:4ch}.pi .w-auto{width:auto}.pi .w-font{width:1em}.pi .w-full{width:100%}.pi .w-max{width:-moz-max-content;width:max-content}.pi .w-min{width:-moz-min-content;width:min-content}.pi .w-px{width:1px}.pi .w-screen{width:100vw}.pi .min-w-0{min-width:0}.pi .min-w-128{min-width:128px}.pi .min-w-180{min-width:11.25rem}.pi .min-w-192{min-width:192px}.pi .min-w-288{min-width:288px}.pi .min-w-30{min-width:30px}.pi .min-w-4{min-width:4px}.pi .min-w-42{min-width:42px}.pi .min-w-92{min-width:92px}.pi .min-w-min{min-width:-moz-min-content;min-width:min-content}.pi .max-w-112{max-width:112px}.pi .max-w-240{max-width:240px}.pi .max-w-288{max-width:288px}.pi .max-w-320{max-width:320px}.pi .max-w-375{max-width:375px}.pi .max-w-500{max-width:31.25rem}.pi .max-w-\\[90\\%\\]{max-width:90%}.pi .max-w-\\[calc\\(100\\%-40px\\)\\]{max-width:calc(100% - 40px)}.pi .max-w-\\[calc\\(100vw-90px\\)\\]{max-width:calc(100vw - 90px)}.pi .max-w-dialog{max-width:calc(var(--be-viewport-width, 100vw)*.9)}.pi .max-w-full{max-width:100%}.pi .max-w-max{max-width:-moz-max-content;max-width:max-content}.pi .flex-\\[1_1_60px\\]{flex:1 1 60px}.pi .flex-auto{flex:1 1 auto}.pi .flex-shrink-0,.pi .shrink-0{flex-shrink:0}.pi .origin-\\[0_55\\%\\]{transform-origin:0 55%}.pi .origin-\\[100\\%\\]{transform-origin:100%}.pi .-translate-x-1\\/2{--tw-translate-x:-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-y-1\\/2{--tw-translate-y:-50%}.pi .rotate-0{--tw-rotate:0deg}.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-180{--tw-rotate:180deg}.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 .scale-y-\\[0\\.6\\]{--tw-scale-y:.6}.pi .scale-y-\\[0\\.6\\],.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-default{cursor:default}.pi .cursor-move{cursor:move}.pi .cursor-nesw-resize{cursor:nesw-resize}.pi .cursor-not-allowed{cursor:not-allowed}.pi .cursor-nwse-resize{cursor:nwse-resize}.pi .cursor-pointer{cursor:pointer}.pi .cursor-se-resize{cursor:se-resize}.pi .cursor-sw-resize{cursor:sw-resize}.pi .touch-none{touch-action:none}.pi .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pi .resize{resize:both}.pi .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.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-end{align-items:flex-end}.pi .items-center{align-items:center}.pi .items-stretch{align-items:stretch}.pi .justify-start{justify-content:flex-start}.pi .justify-center{justify-content:center}.pi .justify-between{justify-content:space-between}.pi .gap-10{gap:10px}.pi .gap-14{gap:14px}.pi .gap-16{gap:16px}.pi .gap-18{gap:18px}.pi .gap-20{gap:20px}.pi .gap-36{gap:36px}.pi .gap-4{gap:4px}.pi .gap-40{gap:40px}.pi .gap-6{gap:6px}.pi .gap-8{gap:8px}.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 .overflow-auto{overflow:auto}.pi .overflow-hidden{overflow:hidden}.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 .overscroll-contain{overscroll-behavior:contain}.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 .break-words{overflow-wrap:break-word}.pi .rounded{border-radius:4px}.pi .rounded-2xl{border-radius:16px}.pi .rounded-3xl{border-radius:24px}.pi .rounded-button{border-radius:var(--be-button-radius,.25rem)}.pi .rounded-full{border-radius:9999px}.pi .rounded-input{border-radius:var(--be-input-radius,.25rem)}.pi .rounded-lg{border-radius:8px}.pi .rounded-md{border-radius:6px}.pi .rounded-none{border-radius:0}.pi .rounded-panel{border-radius:var(--be-panel-radius,.25rem)}.pi .rounded-xl{border-radius:12px}.pi .rounded-l{border-bottom-left-radius:4px;border-top-left-radius:4px}.pi .rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.pi .rounded-l-input{border-bottom-left-radius:var(--be-input-radius,.25rem);border-top-left-radius:var(--be-input-radius,.25rem)}.pi .rounded-l-none{border-bottom-left-radius:0;border-top-left-radius:0}.pi .rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.pi .rounded-r-input{border-bottom-right-radius:var(--be-input-radius,.25rem);border-top-right-radius:var(--be-input-radius,.25rem)}.pi .rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.pi .rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.pi .rounded-bl-none{border-bottom-left-radius:0}.pi .rounded-br-none{border-bottom-right-radius:0}.pi .rounded-tl-none{border-top-left-radius:0}.pi .rounded-tr-none{border-top-right-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-top-width:1px}.pi .border-b,.pi .border-y{border-bottom-width:1px}.pi .border-b-4{border-bottom-width:4px}.pi .border-l{border-left-width:1px}.pi .border-l-4{border-left-width:4px}.pi .border-r{border-right-width:1px}.pi .border-r-4{border-right-width:4px}.pi .border-t{border-top-width:1px}.pi .border-t-4{border-top-width:4px}.pi .border-dotted{border-style:dotted}.pi .border-none{border-style:none}.pi .border-background{--tw-border-opacity:1;border-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-bg-alt{--tw-border-opacity:1;border-color:rgb(var(--be-background-alt)/var(--tw-border-opacity))}.pi .border-chip{--tw-border-opacity:1;border-color:rgb(var(--be-background-chip)/var(--tw-border-opacity))}.pi .border-danger{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .border-danger\\/50{border-color:#ef444480}.pi .border-divider{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .border-paper{--tw-border-opacity:1;border-color:rgb(var(--be-paper)/var(--tw-border-opacity))}.pi .border-positive\\/50{border-color:#22c55e80}.pi .border-primary{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-primary\\/50{border-color:rgb(var(--be-primary)/.5)}.pi .border-text-muted{border-color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .border-transparent{border-color:transparent}.pi .border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .border-white\\/50{border-color:#ffffff80}.pi .border-b-bg{--tw-border-opacity:1;border-bottom-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-b-transparent{border-bottom-color:transparent}.pi .border-r-transparent{border-right-color:transparent}.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-background{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-background\\/70{background-color:rgb(var(--be-background)/.7)}.pi .bg-background\\/80{background-color:rgb(var(--be-background)/.8)}.pi .bg-black\\/50{background-color:#00000080}.pi .bg-black\\/80{background-color:#000c}.pi .bg-chip{--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi .bg-controls{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-danger{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .bg-danger-lighter{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity))}.pi .bg-divider{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .bg-fg-base\\/4{background-color:rgb(var(--be-foreground-base)/4%)}.pi .bg-focus{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .bg-inherit{background-color:inherit}.pi .bg-paper{--tw-bg-opacity:1;background-color:rgb(var(--be-paper)/var(--tw-bg-opacity))}.pi .bg-positive{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.pi .bg-positive-lighter{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity))}.pi .bg-primary{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/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-primary-light{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-light)/var(--tw-bg-opacity))}.pi .bg-primary\\/focus{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .bg-primary\\/selected{background-color:rgb(var(--be-primary)/var(--be-selected-opacity))}.pi .bg-slider-disabled{--tw-bg-opacity:1;background-color:rgb(189 189 189/var(--tw-bg-opacity))}.pi .bg-slider-disabled\\/60{background-color:#bdbdbd99}.pi .bg-toast{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-transparent{background-color:transparent}.pi .bg-warning{--tw-bg-opacity:1;background-color:rgb(243 164 50/var(--tw-bg-opacity))}.pi .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .bg-white\\/50{background-color:#ffffff80}.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-10{padding:10px}.pi .p-14{padding:14px}.pi .p-16{padding:16px}.pi .p-18{padding:18px}.pi .p-2{padding:2px}.pi .p-20{padding:20px}.pi .p-4{padding:4px}.pi .p-40{padding:40px}.pi .p-6{padding:6px}.pi .p-8{padding:8px}.pi .px-10{padding-left:10px;padding-right:10px}.pi .px-12{padding-left:12px;padding-right:12px}.pi .px-14{padding-left:14px;padding-right:14px}.pi .px-16{padding-left:16px;padding-right:16px}.pi .px-18{padding-left:18px;padding-right:18px}.pi .px-20{padding-left:20px;padding-right:20px}.pi .px-22{padding-left:22px;padding-right:22px}.pi .px-24{padding-left:24px;padding-right:24px}.pi .px-26{padding-left:26px;padding-right:26px}.pi .px-32{padding-left:32px;padding-right:32px}.pi .px-4{padding-left:4px;padding-right:4px}.pi .px-5vw{padding-left:5vw;padding-right:5vw}.pi .px-6{padding-left:6px;padding-right:6px}.pi .px-8{padding-left:8px;padding-right:8px}.pi .py-10{padding-bottom:10px;padding-top:10px}.pi .py-12{padding-bottom:12px;padding-top:12px}.pi .py-14{padding-bottom:14px;padding-top:14px}.pi .py-2{padding-bottom:2px;padding-top:2px}.pi .py-20{padding-bottom:20px;padding-top:20px}.pi .py-3{padding-bottom:3px;padding-top:3px}.pi .py-4{padding-bottom:4px;padding-top:4px}.pi .py-5{padding-bottom:5px;padding-top:5px}.pi .py-6{padding-bottom:6px;padding-top:6px}.pi .py-8{padding-bottom:8px;padding-top:8px}.pi .py-\\[9px\\]{padding-bottom:9px;padding-top:9px}.pi .pb-10{padding-bottom:10px}.pi .pb-12{padding-bottom:12px}.pi .pb-14{padding-bottom:14px}.pi .pb-16{padding-bottom:16px}.pi .pb-18{padding-bottom:18px}.pi .pb-20{padding-bottom:20px}.pi .pb-4{padding-bottom:4px}.pi .pb-8{padding-bottom:8px}.pi .pb-safe-area{padding-bottom:env(safe-area-inset-bottom)}.pi .pl-10{padding-left:10px}.pi .pl-12{padding-left:12px}.pi .pl-14{padding-left:14px}.pi .pl-16{padding-left:16px}.pi .pl-18{padding-left:18px}.pi .pl-28{padding-left:28px}.pi .pl-46{padding-left:2.875rem}.pi .pl-54{padding-left:3.375rem}.pi .pl-8{padding-left:8px}.pi .pr-10{padding-right:10px}.pi .pr-12{padding-right:12px}.pi .pr-18{padding-right:18px}.pi .pr-24{padding-right:24px}.pi .pr-28{padding-right:28px}.pi .pr-46{padding-right:2.875rem}.pi .pr-54{padding-right:3.375rem}.pi .pr-6{padding-right:6px}.pi .pr-8{padding-right:8px}.pi .pt-10{padding-top:10px}.pi .pt-12{padding-top:12px}.pi .pt-14{padding-top:14px}.pi .pt-16{padding-top:16px}.pi .pt-20{padding-top:20px}.pi .pt-24{padding-top:24px}.pi .pt-4{padding-top:4px}.pi .pt-40{padding-top:40px}.pi .pt-6{padding-top:6px}.pi .text-left{text-align:left}.pi .text-center{text-align:center}.pi .text-right{text-align:right}.pi .align-middle{vertical-align:middle}.pi .text-base{font-size:16px;line-height:24px}.pi .text-lg{font-size:18px;line-height:28px}.pi .text-sm{font-size:14px;line-height:20px}.pi .text-xl{font-size:20px;line-height:28px}.pi .text-xs{font-size:12px;line-height:16px}.pi .font-bold{font-weight:700}.pi .font-medium{font-weight:500}.pi .font-semibold{font-weight:600}.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-5{line-height:1.25rem}.pi .leading-none{line-height:1}.pi .tracking-wide{letter-spacing:.025em}.pi .\\!text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))!important}.pi .text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.pi .text-black\\/30{color:#0000004d}.pi .text-danger{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.pi .text-danger-darker{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.pi .text-disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .text-link{--tw-text-opacity:1;color:rgb(var(--be-link-color,var(--be-primary))/var(--tw-text-opacity))}.pi .text-main{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-muted{color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .text-on-primary{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .text-positive{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.pi .text-positive-darker{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.pi .text-primary{--tw-text-opacity:1;color:rgb(var(--be-primary)/var(--tw-text-opacity))}.pi .text-white{--tw-text-opacity:1;color:rgb(255 255 255/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-70{opacity:.7}.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-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.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)}.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-lg,.pi .shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.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-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-sm,.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-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 .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 .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 .backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.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-all{transition-duration:.15s;transition-property:all;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-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-opacity{transition-duration:.15s;transition-property:opacity;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-transform{transition-duration:.15s;transition-property:transform;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 .duration-100{transition-duration:.1s}.pi .duration-200{transition-duration:.2s}.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 .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{-ms-overflow-style:none;scrollbar-width:none}.pi .hide-scrollbar::-webkit-scrollbar{background:transparent;display:none;height:0;width:0}.pi .svg-icon{display:inline-block;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;fill:currentColor;transition-duration:.15s;transition-property:transform,fill;transition-timing-function:cubic-bezier(.4,0,.2,1)}.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\\:z-10:before{content:var(--tw-content);z-index:10}.pi .before\\:block:before{content:var(--tw-content);display:block}.pi .before\\:h-12:before{content:var(--tw-content);height:12px}.pi .before\\:h-14:before{content:var(--tw-content);height:14px}.pi .before\\:h-18:before{content:var(--tw-content);height:18px}.pi .before\\:h-22:before{content:var(--tw-content);height:22px}.pi .before\\:h-28:before{content:var(--tw-content);height:28px}.pi .before\\:h-full:before{content:var(--tw-content);height:100%}.pi .before\\:w-12:before{content:var(--tw-content);width:12px}.pi .before\\:w-14:before{content:var(--tw-content);width:14px}.pi .before\\:w-18:before{content:var(--tw-content);width:18px}.pi .before\\:w-22:before{content:var(--tw-content);width:22px}.pi .before\\:w-28:before{content:var(--tw-content);width:28px}.pi .before\\:w-full:before{content:var(--tw-content);width:100%}.pi .before\\:translate-x-2:before{--tw-translate-x:2px}.pi .before\\:scale-10: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\\:scale-10:before{--tw-scale-x:.1;--tw-scale-y:.1}.pi .before\\:rounded-3xl:before{border-radius:24px;content:var(--tw-content)}.pi .before\\:rounded-full:before{border-radius:9999px;content:var(--tw-content)}.pi .before\\:border:before{border-width:1px;content:var(--tw-content)}.pi .before\\:bg-primary:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.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 .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{content:var(--tw-content);top:0;right:0;bottom:0;left:0}.pi .checked\\:border-danger:checked{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .checked\\:border-primary:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .checked\\:bg-danger:checked{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .checked\\:bg-primary:checked{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .checked\\:before\\:translate-x-14:checked:before{--tw-translate-x:14px}.pi .checked\\:before\\:translate-x-14: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\\:translate-x-20:checked:before{--tw-translate-x:20px}.pi .checked\\:before\\:translate-x-24:checked:before{--tw-translate-x:24px}.pi .checked\\:before\\:translate-x-24:checked:before,.pi .checked\\:before\\:translate-x-30: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-36:checked:before{--tw-translate-x:36px}.pi .checked\\:before\\:scale-\\[\\.65\\]: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\\:scale-\\[\\.65\\]:checked:before{--tw-scale-x:.65;--tw-scale-y:.65}.pi .checked\\:before\\:border-white:checked:before{content:var(--tw-content);--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.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 .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;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\\:border-chip\\/90:hover{border-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:border-danger:hover{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .hover\\:border-danger\\/90:hover{border-color:#ef4444e6}.pi .hover\\:border-paper\\/90:hover{border-color:rgb(var(--be-paper)/.9)}.pi .hover\\:border-positive:hover{--tw-border-opacity:1;border-color:rgb(34 197 94/var(--tw-border-opacity))}.pi .hover\\:border-primary:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/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\\:bg-chip\\/90:hover{background-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:bg-danger\\/4:hover{background-color:#ef44440a}.pi .hover\\:bg-danger\\/90:hover{background-color:#ef4444e6}.pi .hover\\:bg-fg-base\\/15:hover{background-color:rgb(var(--be-foreground-base)/15%)}.pi .hover\\:bg-hover:hover{background-color:rgb(var(--be-foreground-base)/var(--be-hover-opacity))}.pi .hover\\:bg-paper\\/90:hover{background-color:rgb(var(--be-paper)/.9)}.pi .hover\\:bg-positive\\/4:hover{background-color:#22c55e0a}.pi .hover\\:bg-primary-dark:hover{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:bg-primary\\/4:hover{background-color:rgb(var(--be-primary)/4%)}.pi .hover\\:bg-primary\\/focus:hover{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:bg-primary\\/hover:hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .hover\\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .hover\\:bg-white\\/20:hover{background-color:#fff3}.pi .hover\\:bg-white\\/hover:hover{background-color:rgb(255 255 255/var(--be-hover-opacity))}.pi .hover\\:text-main:hover{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .hover\\:text-primary-dark:hover{--tw-text-opacity:1;color:rgb(var(--be-primary-dark)/var(--tw-text-opacity))}.pi .hover\\:underline:hover{text-decoration-line:underline}.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{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.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);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.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\\: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\\:outline:focus-visible{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .focus-visible\\:outline-primary-light:focus-visible{outline-color:rgb(var(--be-primary-light)/1)}.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 .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-offset-2:focus-visible{--tw-ring-offset-width:2px}.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-disabled-fg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:border-transparent:disabled{border-color:transparent}.pi .disabled\\:border-white\\/70:disabled{border-color:#ffffffb3}.pi .disabled\\:border-r-transparent:disabled{border-right-color:transparent}.pi .disabled\\:bg-disabled:disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:bg-transparent:disabled{background-color:transparent}.pi .disabled\\:text-disabled:disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:text-white\\/70:disabled{color:#ffffffb3}.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 :is(.dark .dark\\:bg-chip){--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi :is(.dark .dark\\:text-white\\/50){color:#ffffff80}.pi :is(.dark .dark\\:checked\\:border-primary-dark:checked){--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi :is(.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\\:text-sm{font-size:14px;line-height:20px}}@media (min-width:768px){.pi .md\\:text-lg{font-size:18px;line-height:28px}}.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){dp=e,hp=e}(t),this.setConfig(e),vp.setState({editor:this}),(0,a.H)(t).render((0,i.jsx)(o.StrictMode,{children:(0,i.jsx)(zF,{})})))}get state(){return yp()}get defaultConfig(){return e.defaultConfig}open(e={}){return new Promise(async t=>{var r;Object.keys(e).length?await this.resetEditor({...tf(e,{ui:{visible:!0},image:e.image||yp().config.image,state:e.state||yp().config.state,blankCanvasSize:e.blankCanvasSize||yp().config.blankCanvasSize})}):null!=(r=yp().config.ui)&&r.visible||yp().setConfig({ui:{visible:!0}}),t()})}close(){var e,t,r;null!=(e=yp().config.ui)&&e.visible&&(this.setConfig({ui:{visible:!1}}),null==(r=(t=yp().config).onClose)||r.call(t))}setConfig(e){yp().setConfig(e)}uploadAndAddImage(){return bp().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return bp().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return bp().import.uploadAndOpenStateFile()}newCanvas(e,t,r){return bp().canvas.openNew(e,t,r)}getState(e){return JSON.stringify(Sp(e))}setState(e){return bp().import.loadState(e)}async setStateFromUrl(e){const t=await Cp(e);return bp().import.loadState(t)}openTool(e){Ap(e)}applyChanges(){yp().applyChanges()}cancelChanges(){yp().cancelChanges()}async resetEditor(e){await xp(e),await bp().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&yp().togglePanel("history",!1),"history"===e&&yp().togglePanel("objects",!1),yp().togglePanel(e,t)}on(e,t){var r;null==(r=this.fabric)||r.on(e,t)}isDirty(){return yp().dirty}get(e){return this.tools[e]}notify(e){return Fp(e)}static init(e){return new Promise(t=>{const r=e.onLoad;e.onLoad=e=>{null==r||r(e),t(e)},new this(e)})}};ja(BF,"defaultConfig",Td),ja(BF,"version","3.0.5");let UF=BF;function VF(e){if(!this.backgroundColor)return;const t=this._getNonTransformedDimensions(),r=-t.x/2,n=-t.y/2,i=t.x,o=t.y,a=this.backgroundColor;if("string"==typeof a||a instanceof CanvasGradient||a instanceof CanvasPattern)e.fillStyle=a,e.fillRect(r,n,i,o);else if("object"!=typeof a||!("type"in a)||"linear"!==a.type&&"radial"!==a.type){if("source"in a&&(a.source instanceof HTMLImageElement||a.source instanceof HTMLCanvasElement))if(a.repeat){const t=e.createPattern(a.source,a.repeat);t&&(e.fillStyle=t,e.fillRect(r,n,i,o))}else e.drawImage(a.source,r,n,i,o)}else{const t=function(e,t,r,n){var i,o;if("linear"===t.type){const i=e.createLinearGradient(r+t.coords.x1,n+t.coords.y1,r+t.coords.x2,n+t.coords.y2);return t.colorStops.forEach(e=>i.addColorStop(e.offset,e.color)),i}if("radial"===t.type){const a=e.createRadialGradient(r+t.coords.x1,n+t.coords.y1,null!==(i=t.coords.r1)&&void 0!==i?i:0,r+t.coords.x2,n+t.coords.y2,null!==(o=t.coords.r2)&&void 0!==o?o:0);return t.colorStops.forEach(e=>a.addColorStop(e.offset,e.color)),a}throw new Error("Unknown gradient type")}(e,a,r,n);e.fillStyle=t,e.fillRect(r,n,i,o)}this._removeShadow(e)}const HF="fm-pixie-editor",$F=new class{constructor(){this._container=document.createElement("div"),this._instance=null,this._container.classList.add(HF),this._container.style.width="100%",this._container.style.height="85vh",this._container.style.minHeight="400px"}get className(){return`.${HF}`}get canvas(){var e,t;return null===(t=null===(e=this._instance)||void 0===e?void 0:e.state.canvasRef)||void 0===t?void 0:t.current}get tools(){var e;return null===(e=this._instance)||void 0===e?void 0:e.tools}isLoaded(){return!!this._instance}async _setConfig(e){var t;this._instance?await this._instance.resetEditor(e):this._instance=await UF.init(Object.assign(Object.assign({},e),{selector:this.className})),(t=this._instance).fabric&&t.fabric.on("object:added",e=>{const t=e.target;t&&"text"===t.name&&(t._renderBackground=VF)})}async show(e,t,r=t.firstChild){t.insertBefore(this._container,r),await this._setConfig(e),this._instance.open()}close(){var e;null===(e=this._container.parentNode)||void 0===e||e.removeChild(this._container)}};function WF(e,t){return e?t?`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`:e:t}function GF(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;const n=function(e){const t=r.p;if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let n=WF(t,e||"");return!n||n.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(n)||(n="/"+n),n}(e),i=WF(n,t);return!i||i.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(i)?i:"/"+i}var qF,YF;!function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(qF||(qF={})),function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(YF||(YF={}));const XF=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob()),KF=({visible:e,onClose:t,file:r,onSave:n,onSaveCopy:a})=>{var s;const{t:l}=kr(),c=o.useRef(null),u=oi(),d=Co(),{options:h,actions:f,state:p}=ti(),{i18n:g}=kr(),{config:m}=h,{setCurrentMenuFile:v,setLoading:y}=f,{loading:b}=p,{getFileData:w,resolveFileForEditByUrl:x}=d,[C,_]=o.useState(null),[A,k]=o.useState(""),[E,I]=o.useState(!1),[T,F]=o.useState(!1),[O,P]=o.useState(null),M=o.useRef(!1),R=o.useRef(),L=o.useRef(),N=o.useRef("saveCopy"),D=o.useRef(void 0);R.current=n,L.current=a,o.useEffect(()=>{r&&!M.current&&(async()=>{if(D.current!==r)if("object"!=typeof r){D.current=r,null==y||y(!0);try{if(r.startsWith("data:"))P({thumbnail:r,saveWithoutFolder:!0});else{const e=await x(r);D.current===r&&P(e)}}catch(It){D.current===r&&(D.current=null),null==t||t()}finally{null==y||y(!1)}}else P(r)})()},[r,t,x,y]);const z=o.useCallback(async e=>{try{if(e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await w(e.id);if(!t)throw new Error(l("Error loading image"));return new Promise(e=>{const r=new FileReader;r.onload=()=>e(r.result),r.readAsDataURL(t)})}catch(e){throw e}},[w,l]);o.useEffect(()=>{if(!C&&e&&O){let e=!1;const n=async()=>{var n,i,o;null==y||y(!0);try{const t=await z(O);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid image data: empty or null");if(!t.startsWith("data:"))throw new Error("Invalid image data: not a valid data URL");const r=t.match(/^data:([^;]+);base64,(.+)$/);if(!r)throw new Error("Invalid image data: malformed data URL format");const[,n,i]=r;if(!n.startsWith("image/"))throw new Error(`Invalid image data: unsupported MIME type ${n}`);if(i.length<10)throw new Error("Invalid image data: base64 content too short");if(!/^[A-Za-z0-9+/]+=*$/.test(i))throw new Error("Invalid image data: corrupted base64 content");if(!e){_(t);const e=fo(O,"image/png");k(e.mimeType)}}catch(r){e||(u.error({id:"IMAGE_DOWNLOAD_FAILED",innerException:r,message:l("Error loading image"),placement:"bottomRight",data:{itemId:null!==(n=null==O?void 0:O.id)&&void 0!==n?n:void 0,itemName:null!==(i=null==O?void 0:O.name)&&void 0!==i?i:void 0,folderId:null!==(o=null==O?void 0:O.folderId)&&void 0!==o?o:null,thumbnail:null==O?void 0:O.thumbnail}}),null==t||t())}};return n(),()=>{e=!0}}},[O,z,C,u,t,y,l,e]);const B=o.useCallback(async(e,t,r,n)=>{var i,o,a,s,c,d;const h="save"===n?R.current:L.current;if(!O||!h)return;const f="object"==typeof O&&null!==O?O:null;let p=null;try{null==y||y(!0);let o=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 r=`image/${e}`;if(t.startsWith("data:")){const e=ir(t);e&&e.startsWith("image/")&&(r=e);const n=t.replace(/data:image\/[^;]+;base64,/,"");return XF(n,nr(r))}return XF(t,nr(r))}(r,e),a=nr(o.type||`image/${r}`);if("image/gif"!==a&&m)try{const e=new File([o],t,{type:a}),r=await mo(e,{maxSizeMB:m.compressMaxSize||.5,maxWidthOrHeight:m.compressMaxWidthOrHeight||2e3,mimeType:a});o=r,a=r.type}catch(e){}const s=e.startsWith("data:")?e:`data:${a};base64,${e}`,c=Object.assign(Object.assign({},O),{thumbnail:s,size:o.size,date:(new Date).toISOString().split("T")[0],type:a,folderId:O.folderId||"",name:O.name||t,extension:O.extension||(null===(i=(O.name||t).split(".").pop())||void 0===i?void 0:i.toLowerCase())||""});p=c;const u=await h(c);if(u)return null==y||y(!1),u;throw new Error(l("saveCopy"===n?"Failed to save image copy":"Failed to save changes"))}catch(e){const r=null!=p?p:f;if(!(null==e?void 0:e.notificationShown)){const i=pi(e),h=null!==(a=null!==(o=hi(null==i?void 0:i.code,l))&&void 0!==o?o:null==i?void 0:i.message)&&void 0!==a?a:l("saveCopy"===n?"Failed to save image copy":"Error saving image");u.error({id:"saveCopy"===n?"IMAGE_SAVE_COPY_FAILED":"IMAGE_SAVE_FAILED",message:h,placement:"bottomRight",data:{itemId:null!==(s=null==r?void 0:r.id)&&void 0!==s?s:void 0,itemName:null!==(c=null==r?void 0:r.name)&&void 0!==c?c:t,folderId:null!==(d=null==r?void 0:r.folderId)&&void 0!==d?d:null,thumbnail:null==r?void 0:r.thumbnail},innerException:e})}null==y||y(!1)}},[m,O,u,h,y,l]),U=o.useCallback(async e=>{var t;if(!$F.isLoaded()||!O)return;N.current=e;const r=O.name||"edited-image",n=fo(O,A);try{await(null===(t=$F.tools)||void 0===t?void 0:t.export.save(r.replace(/\.[^/.]+$/,""),n.pixieFormat,po.QUALITY))}catch(t){try{const t=$F.canvas,i=t?t.toDataURL(n.mimeType):null;i&&await B(i,r,n.extension,e)}catch(e){}}},[O,A,B]),V=o.useCallback(async()=>{var r;if(C&&e&&E&&!M.current)try{M.current=!0;const e=c.current;let n=0;for(;n<20&&(0===e.clientWidth||0===e.clientHeight);)await new Promise(e=>setTimeout(e,50)),n++;const o=(null==m?void 0:m.locale)?null==m?void 0:m.locale.replace("_","-"):"en",a=matchMedia(Gt).matches?$t:Ht,s=(null==m?void 0:m.theme)===Wt?a:null==m?void 0:m.theme,l=((null==m?void 0:m.locale)||g.language||"en").split("-")[0].split("_")[0],u=(g.getResourceBundle(l,"translation")||{}).pixie||{},d=e=>e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),h={};Object.entries(u).forEach(([e,t])=>{const r=d(e);h[r]=t,h[e]=t});const f={[o]:h},p=fo(O,A),v={selector:"#pixie-editor",baseUrl:GF((null==m?void 0:m.baseUrl)||"",(null==m?void 0:m.assetsUrl)||"assets/image-editor"),image:C,activeLanguage:o,languages:f,ui:{activeTheme:s,mode:"inline",forceOverlayModeOnMobile:!1,visible:!0,menubar:{replaceDefaultItems:!0,position:qF.TOP,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",align:"right",desktopOnly:!0,icon:()=>(0,i.jsx)(ie.A,{style:{fontSize:20}}),action:e=>{e.togglePanel("history")}},{type:"button",icon:()=>(0,i.jsx)(re.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:t}]},nav:{position:YF.TOP}},tools:{export:{defaultFormat:p.pixieFormat,defaultQuality:po.QUALITY,defaultName:(null===(r=null==O?void 0:O.name)||void 0===r?void 0:r.replace(/\.[^/.]+$/,""))||"image"},text:{replaceDefaultItems:!0,defaultText:"Handwriting",items:[{family:"Inter",src:"fonts/inter-v20-cyrillic_latin-regular.woff2"},{family:"Commissioner",src:"fonts/commissioner-v24-cyrillic_latin-regular.woff2"},{family:"Montserrat Light",src:"fonts/Montserrat-Light.woff2"},{family:"Montserrat Regular",src:"fonts/Montserrat-Regular.woff2"},{family:"Montserrat Bold",src:"fonts/Montserrat-Bold.woff2"},{family:"Montserrat Black",src:"fonts/Montserrat-Black.woff2"},{family:"Roboto Light",src:"fonts/Roboto-Light.woff2"},{family:"Roboto Regular",src:"fonts/Roboto-Regular.woff2"},{family:"Roboto Bold",src:"fonts/Roboto-Bold.woff2"},{family:"Roboto Black",src:"fonts/Roboto-Black.woff2"},{family:"Lato Light",src:"fonts/Lato-Light.woff2"},{family:"Lato Regular",src:"fonts/Lato-Regular.woff2"},{family:"Lato Bold",src:"fonts/Lato-Bold.woff2"},{family:"Lato Black",src:"fonts/Lato-Black.woff2"},{family:"Rubik Light",src:"fonts/Rubik-Light.woff2"},{family:"Rubik Regular",src:"fonts/Rubik-Regular.woff2"},{family:"Rubik Bold",src:"fonts/Rubik-Bold.woff2"},{family:"Rubik Black",src:"fonts/Rubik-Black.woff2"},{family:"Bebas Neue Light",src:"fonts/BebasNeueLight.woff2"},{family:"Bebas Neue Regular",src:"fonts/BebasNeueRegular.woff2"},{family:"Bebas Neue Book",src:"fonts/BebasNeueBook.woff2"},{family:"Bebas Neue Bold",src:"fonts/BebasNeueBold.woff2"},{family:"Fira Sans",src:"fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"},{family:"Lobster",src:"fonts/Lobster.woff2"},{family:"Pacifico",src:"fonts/pacifico-v23-cyrillic_latin-regular.woff2"},{family:"Playfair Display",src:"fonts/playfair-display-v40-cyrillic_latin-regular.woff2"},{family:"Oswald",src:"fonts/oswald-v57-cyrillic_latin-regular.woff2"},{family:"Caveat",src:"fonts/caveat-v23-cyrillic_latin-regular.woff2"}]}},onSave:async function(e,t,r){try{return null==y||y(!0),await B(e,t,r,N.current)}catch(e){throw null==y||y(!1),e}}};try{F(!1),await $F.show(v,c.current);const e=$F.canvas;e&&e.focus(),F(!0),y&&y(!1)}catch(It){}}catch(It){u.error({id:"EDITOR_INIT_FAILED",message:l("Error initializing editor"),placement:"bottomRight",innerException:It}),M.current=!1,null==t||t()}},[C,e,E,null==m?void 0:m.locale,null==m?void 0:m.theme,null==m?void 0:m.baseUrl,null==m?void 0:m.assetsUrl,t,y,B,u,g,l]);o.useEffect(()=>{e&&C&&E&&V()},[e,C,E,V]),o.useEffect(()=>{if(!e){try{$F.close()}catch(It){}_(null),k(""),M.current=!1,I(!1),F(!1)}return()=>{try{$F.close()}catch(It){}}},[e]),(0,o.useEffect)(()=>{T&&y&&y(!1)},[T,y]);const H=Boolean(null==O?void 0:O.id)&&!1!==(null===(s=null==m?void 0:m.features)||void 0===s?void 0:s.enableUpdateFile);return(0,i.jsx)(j.A,{title:(null==O?void 0:O.name)?l("Editing: {{name}}",{name:O.name}):l("Editing image"),open:e,closeIcon:null,onCancel:t,afterOpenChange:e=>I(e),forceRender:!0,width:"100vw",style:{top:0,height:"100vh",maxWidth:"none",padding:10},styles:{body:{height:"85vh",padding:0}},footer:[(0,i.jsx)(S.Ay,{onClick:t,disabled:!E||b,children:l("Cancel")},"cancel"),(0,i.jsx)(S.Ay,{type:"primary",onClick:()=>U("saveCopy"),loading:b,children:l("Save as copy and choose")},"save-copy"),...H?[(0,i.jsx)(S.Ay,{type:"primary",onClick:()=>U("save"),loading:b,children:l("Save and choose")},"save")]:[]],maskClosable:!1,destroyOnHidden:!1,afterClose:()=>{v&&v("")},children:(0,i.jsxs)("div",{ref:c,style:{position:"relative",width:"100%",height:"100%"},children:[e&&!T?(0,i.jsx)("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:(0,i.jsx)("span",{style:{fontSize:14,color:"#555"},children:l("Loading editor...")})}):null,b&&(0,i.jsx)(wa,{style:{position:"absolute",top:0,background:"var(--colorBgLayout)",zIndex:100,opacity:.7}})]})})};const{Text:ZF}=p.A,JF=({visible:e,files:t,totalFiles:r,completedFiles:n,onClose:o,onMinimize:a,onInsert:s,minimized:c=!1})=>{var u;const{token:d}=l.A.useToken(),{t:h}=kr();if(!e)return null;const f=e=>{switch(e){case"success":return(0,i.jsx)("div",{className:"uploadProgress__status-icon",children:(0,i.jsx)(oe.A,{style:{color:d.colorSuccess}})});case"error":return(0,i.jsx)(ae.A,{style:{color:d.colorError}});default:return(0,i.jsx)(se.A,{style:{color:"#1890ff"}})}};if(c)return(0,i.jsx)("div",{className:"uploadProgress__minimized",children:(0,i.jsx)(S.Ay,{type:"primary",size:"small",onClick:a,className:"uploadProgress__minimized-button",children:h("Upload progress",{completed:n,total:r})})});const p=t.filter(e=>"uploading"===e.status).length,g=t.filter(e=>"success"===e.status).length,m=t.filter(e=>"error"===e.status).length,v=t.filter(e=>"error"===e.status),y=v.length>1&&v.every(e=>{var t;return e.error&&e.error===(null===(t=v[0])||void 0===t?void 0:t.error)}),b=y?null===(u=v[0])||void 0===u?void 0:u.error:null;return(0,i.jsx)("div",{className:"uploadProgress fm-upload-progress",children:(0,i.jsxs)("div",{className:"uploadProgress__card",children:[(0,i.jsxs)("div",{className:"uploadProgress__header",children:[(0,i.jsx)(ZF,{strong:!0,className:"uploadProgress__header-title",children:p>0?h("Uploading files",{completed:n,total:r}):g>0?h("Uploaded files",{success:g,total:r}):h("Upload error files",{errorCount:m})}),(0,i.jsx)("div",{className:"uploadProgress__header-buttons",children:(0,i.jsx)(S.Ay,{type:"text",size:"small",icon:(0,i.jsx)(re.A,{className:"uploadProgress__close-icon"}),onClick:o,className:"uploadProgress__header-button"})})]}),(0,i.jsxs)("div",{className:"uploadProgress__body "+(t.some(e=>"error"===e.status)?"uploadProgress__body--error":""),children:[(0,i.jsx)("div",{className:"uploadProgress__list-wrapper",children:(0,i.jsx)(P.A,{className:"uploadProgress__file-list",size:"small",dataSource:t,renderItem:e=>{const t="error"===e.status,r=t?(e=>{if(!e)return null;const t=e.toLowerCase();return t.includes("type")||t.includes("format")||t.includes("\u0444\u043e\u0440\u043c\u0430\u0442")||t.includes("\u0442\u0438\u043f")||t.includes("not allowed")||t.includes("\u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d")||t.includes("name")||t.includes("invalid")||t.includes("\u043d\u0430\u0437\u0432\u0430")||t.includes("\u043d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c")||t.includes("allowed characters")?null:t.includes("large")||t.includes("size")||t.includes("\u0440\u043e\u0437\u043c\u0456\u0440")||t.includes("\u0440\u0430\u0437\u043c\u0435\u0440")?h("upload_error_hint_size"):t.includes("exists")||t.includes("\u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454")||t.includes("\u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442")?h("upload_error_hint_exists"):null})(e.error):null;return(0,i.jsx)(P.A.Item,{className:"uploadProgress__file-item "+(t?"uploadProgress__file-item--error":""),actions:(n=e,"success"===n.status?[(0,i.jsx)(S.Ay,{type:"primary",size:"small",onClick:()=>s(n),children:h("Insert")},"insert")]:[]),children:(0,i.jsx)(P.A.Item.Meta,{avatar:(0,i.jsx)(M.A,{size:"small",icon:f(e.status),className:"uploadProgress__file-avatar"}),title:(0,i.jsxs)("div",{className:"uploadProgress__file-info",children:[(0,i.jsx)(ZF,{ellipsis:!0,className:"uploadProgress__file-name",children:e.name}),(0,i.jsx)(ZF,{type:"secondary",className:"uploadProgress__file-size",children:void 0!==e.size?li(e.size):""})]}),description:"uploading"===e.status?(0,i.jsx)(T.A,{percent:e.progress,size:"small",status:"active",showInfo:!1,className:"uploadProgress__progress-bar"}):t?y?null:(0,i.jsxs)("div",{className:"uploadProgress__error-item",children:[(0,i.jsx)(ZF,{type:"danger",className:"uploadProgress__error-message",children:e.error||h("Error")}),r&&(0,i.jsx)(ZF,{type:"secondary",className:"uploadProgress__error-hint",children:r})]}):null})});var n}})}),b&&(0,i.jsxs)("div",{className:"uploadProgress__common-error",children:[(0,i.jsxs)("div",{className:"uploadProgress__common-error-row",children:[(0,i.jsx)(ae.A,{style:{color:d.colorError,marginRight:8,flexShrink:0}}),(0,i.jsx)(ZF,{type:"danger",children:b})]}),(0,i.jsx)(ZF,{type:"secondary",className:"uploadProgress__common-error-hint",children:h("Applies to all {{count}} files",{count:v.length})})]})]})]})})},{Header:QF}=R.A,{Title:eO}=p.A,tO=({activeLibraryItem:e,selectedFolder:t,isTrashFolder:r,onClearTrash:n,files:a,loading:s,onRefresh:l,refreshDisabled:c,showRefresh:u=!1})=>{const{t:d}=kr(),h=e===Lt&&(null!=r?r:t===Vt),[f,p]=o.useState(!1),g={[Lt]:d("My files"),[Nt]:d("GIF"),[Dt]:d("Stock images"),[zt]:d("Icons"),[Bt]:d("AI image generation")};let m;return o.useEffect(()=>{const e=setTimeout(()=>{p(h&&a.length>0&&!s)},200);return()=>clearTimeout(e)},[h,a.length,s]),m=e===Lt?h?d("Trash"):t:g[e],(0,i.jsx)(QF,{className:"actions-header",children:(0,i.jsxs)("div",{className:"header-title-container",children:[(0,i.jsx)(eO,{level:5,className:"header-title",children:m}),f&&n&&(0,i.jsx)(S.Ay,{type:"default",onClick:n,className:"clear-trash-button","aria-label":d("Clear Trash"),children:d("Clear")}),e===Lt&&u&&l&&(0,i.jsx)(v.A,{title:d("Refresh"),children:(0,i.jsx)(S.Ay,{type:"text",className:"folder-refresh-button",icon:(0,i.jsx)(Vn,{size:16}),onClick:l,disabled:c})})]})})};var rO=function(e,t){return rO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},rO(e,t)},nO=function(){return nO=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},nO.apply(this,arguments)},iO="Pixel",oO="Percent",aO={unit:oO,value:.8};function sO(e){return"number"==typeof e?{unit:oO,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:iO,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:oO,value:parseFloat(e)}:aO:aO}var lO=function(e){function t(t){var r=e.call(this,t)||this;return r.lastScrollTop=0,r.actionTriggered=!1,r.startY=0,r.currentY=0,r.dragging=!1,r.maxPullDownDistance=0,r.getScrollableTarget=function(){return r.props.scrollableTarget instanceof HTMLElement?r.props.scrollableTarget:"string"==typeof r.props.scrollableTarget?document.getElementById(r.props.scrollableTarget):(r.props.scrollableTarget,null)},r.onStart=function(e){r.lastScrollTop||(r.dragging=!0,e instanceof MouseEvent?r.startY=e.pageY:e instanceof TouchEvent&&(r.startY=e.touches[0].pageY),r.currentY=r.startY,r._infScroll&&(r._infScroll.style.willChange="transform",r._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},r.onMove=function(e){r.dragging&&(e instanceof MouseEvent?r.currentY=e.pageY:e instanceof TouchEvent&&(r.currentY=e.touches[0].pageY),r.currentY<r.startY||(r.currentY-r.startY>=Number(r.props.pullDownToRefreshThreshold)&&r.setState({pullToRefreshThresholdBreached:!0}),r.currentY-r.startY>1.5*r.maxPullDownDistance||r._infScroll&&(r._infScroll.style.overflow="visible",r._infScroll.style.transform="translate3d(0px, "+(r.currentY-r.startY)+"px, 0px)")))},r.onEnd=function(){r.startY=0,r.currentY=0,r.dragging=!1,r.state.pullToRefreshThresholdBreached&&(r.props.refreshFunction&&r.props.refreshFunction(),r.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){r._infScroll&&(r._infScroll.style.overflow="auto",r._infScroll.style.transform="none",r._infScroll.style.willChange="unset")})},r.onScrollListener=function(e){"function"==typeof r.props.onScroll&&setTimeout(function(){return r.props.onScroll&&r.props.onScroll(e)},0);var t=r.props.height||r._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;r.actionTriggered||((r.props.inverse?r.isElementAtTop(t,r.props.scrollThreshold):r.isElementAtBottom(t,r.props.scrollThreshold))&&r.props.hasMore&&(r.actionTriggered=!0,r.setState({showLoader:!0}),r.props.next&&r.props.next()),r.lastScrollTop=t.scrollTop)},r.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},r.throttledOnScrollListener=function(e,t,r,n){var i,o=!1,a=0;function s(){i&&clearTimeout(i)}function l(){var e=this,l=Date.now()-a,c=arguments;function u(){a=Date.now(),r.apply(e,c)}o||(n&&!i&&u(),s(),void 0===n&&l>150?u():!0!==t&&(i=setTimeout(n?function(){i=void 0}:u,void 0===n?150-l:150)))}return"boolean"!=typeof t&&(n=r,r=t,t=void 0),l.cancel=function(){s(),o=!0},l}(0,r.onScrollListener).bind(r),r.onStart=r.onStart.bind(r),r.onMove=r.onMove.bind(r),r.onEnd=r.onEnd.bind(r),r}return function(e,t){function r(){this.constructor=e}rO(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(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 r=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,n=sO(t);return n.unit===iO?e.scrollTop<=n.value+r-e.scrollHeight+1:e.scrollTop<=n.value/100+r-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var r=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,n=sO(t);return n.unit===iO?e.scrollTop+r>=e.scrollHeight-n.value:e.scrollTop+r>=n.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),r=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),n=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return o.createElement("div",{style:n,className:"infinite-scroll-component__outerdiv"},o.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&o.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},o.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&&!r&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(o.Component);function cO(){return cO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cO.apply(this,arguments)}function uO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function dO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uO(Object(r),!0).forEach(function(t){hO(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uO(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function hO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class fO extends o.Component{constructor(e){let t;super(e),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),t=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:t}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})):this.reCalculateColumnCount()}reCalculateColumnCount(){const e=window&&window.innerWidth||1/0;let t=this.props.breakpointCols;"object"!=typeof t&&(t={default:parseInt(t)||2});let r=1/0,n=t.default||2;for(let i in t){const o=parseInt(i);o>0&&e<=o&&o<r&&(r=o,n=t[i])}n=Math.max(1,parseInt(n)||1),this.state.columnCount!==n&&this.setState({columnCount:n})}itemsInColumns(){const e=this.state.columnCount,t=new Array(e),r=o.Children.toArray(this.props.children);for(let n=0;n<r.length;n++){const i=n%e;t[i]||(t[i]=[]),t[i].push(r[n])}return t}renderColumns(){const{column:e,columnAttrs:t={},columnClassName:r}=this.props,n=this.itemsInColumns(),i=100/n.length+"%";let a=r;a&&"string"!=typeof a&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===a&&(a="my-masonry-grid_column"));const s=dO(dO(dO({},e),t),{},{style:dO(dO({},t.style),{},{width:i}),className:a});return n.map((e,t)=>o.createElement("div",cO({},s,{key:t}),e))}logDeprecated(e){}render(){const e=this.props,{children:t,breakpointCols:r,columnClassName:n,columnAttrs:i,column:a,className:s}=e,l=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let c=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(c="my-masonry-grid")),o.createElement("div",cO({},l,{className:c}),this.renderColumns())}}fO.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};var pO={gifTab:"gifTab",scrollableDiv:"scrollableDiv",gifSearchInput:"gifSearchInput",search:"search",searchResults:"searchResults",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",searchOutputWrapper:"searchOutputWrapper",divider:"divider",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const gO={default:4,1600:3,1100:2,700:1},mO=({setImageGifList:e,imageGifList:t=[],currentReqGif:r,setCurrentReqGif:n,inputRef:a,customRequest:l})=>{const{t:c}=kr(),{GifPlayIcon:u}=ca(),{options:f}=ti(),{config:p}=f,[g,m]=(0,o.useState)(null),[v,y]=(0,o.useState)(!1),[b,w]=(0,o.useState)(25),[x,C]=(0,o.useState)(null),[_]=d.A.useForm(),S=(0,o.useRef)(r);(0,o.useEffect)(()=>{_.setFieldsValue({keywords:r.keywords})},[]);const A=null==p?void 0:p.handleProxyUrl,k=async e=>A?Promise.resolve(A(e)):e,E=async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{images:Object.assign(Object.assign({},e.images),{downsized:Object.assign(Object.assign({},e.images.downsized),{url:await k(e.images.downsized.url)})})}))),I=async function({query:e,page:t}){var r;const n=e.keywords.replace(/[^\w\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null!==(r=null==p?void 0:p.REACT_APP_GIPHY_KEY)&&void 0!==r?r:"Nh77eBlPeMn1ed9MBAvL542NUGeNO26F"}&q=${encodeURIComponent(n)}&limit=25&offset=${t}&lang=en`,i=await fetch(await k(e));return{data:await i.json()}}catch(e){}},j=async()=>{var t,r;const n=await I({query:S.current,page:0});(null===(r=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.length)&&n.data.data.length>0&&e(await E(n.data.data))};return(0,o.useEffect)(()=>()=>{x&&clearTimeout(x)},[x]),(0,i.jsx)("div",{className:pO.gifTab,children:(0,i.jsx)("div",{className:pO.searchOutputWrapper,children:(0,i.jsxs)("div",{id:"scrollableDiv",className:pO.scrollableDiv,children:[(0,i.jsxs)(d.A,{form:_,onValuesChange:e=>{if(void 0!==e.keywords){const t=Object.assign(Object.assign({},S.current),{keywords:e.keywords});n(t),S.current=t,x&&clearTimeout(x);const r=setTimeout(j,800);C(r)}},className:t.length>0?pO.searchResults:pO.search,children:[(0,i.jsx)(d.A.Item,{name:"keywords",className:pO.gifSearchInput,children:(0,i.jsx)(h.A,{onKeyDown:e=>"Space"===e.code&&j(),onPressEnter:e=>j(),allowClear:!0,placeholder:c("Search GIFs"),ref:a,spellCheck:"false",prefix:(0,i.jsx)($n,{size:16,strokeWidth:null==p?void 0:p.iconStrokeWidth,onClick:j})})}),t.length>0&&!v&&(0,i.jsx)("div",{className:`ant-divider ${pO.divider}`,role:"separator"})]}),!t.length&&!v&&(0,i.jsx)(i.Fragment,{children:r.keywords?(0,i.jsx)(ua,{}):(0,i.jsxs)("div",{className:pO.resultsContainer,children:[(0,i.jsx)("div",{className:pO.videoIcon,children:(0,i.jsx)(u,{className:pO.playButton})}),(0,i.jsx)("h1",{className:pO.title,children:c("Over 350,000 live images")}),(0,i.jsx)("p",{className:pO.subtitle,children:c("Enter a search query and we'll find the perfect image for you")})]})}),!t.length&&v&&(0,i.jsx)(wa,{}),t.length>0&&(0,i.jsx)(lO,{dataLength:t&&t.length,next:async()=>{v||(y(!0),I({query:S.current,page:b}).then(async t=>{if(t&&t.data&&t.data.data){const r=await E(t.data.data);e(e=>[...e,...r])}y(!1),w(e=>e+25)}).catch(()=>{y(!1)}))},hasMore:!!t,endMessage:(0,i.jsxs)(O.A,{plain:!0,children:[c("That`s all we could find.")," \ud83e\udd10"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:(0,i.jsx)(wa,{}),children:(0,i.jsx)(fO,{breakpointCols:gO,className:pO.myMasonryGrid,columnClassName:pO.myMasonryGridColumn,children:t.map((e,t)=>(0,i.jsxs)("div",{className:pO.listItem,onClick:()=>(async(e,t)=>{var r;m(t),setTimeout(()=>{m(null)},2e3);let n=e.split("?")[0].split("#")[0].split("/"),i=n[n.length-1]||"uploaded-file";i.includes(".")&&(null===(r=i.split(".").pop())||void 0===r?void 0:r.length)&&i.split(".").pop().length<=5||(i+=".gif"),l(e,i)})(e.images.downsized.url,e.id,e.title),children:[(0,i.jsx)("img",{className:g===e.id?pO.loadedImage:"",width:"100%",src:e.images.downsized.url,alt:e.title,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(pO.loaded)}}),(0,i.jsx)("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),g===e.id&&(0,i.jsx)(s.A,{className:pO.antSpin})]},e.id+t))})})]})})})};var vO={stockTab:"stockTab",stockSearchInput:"stockSearchInput",searchOutputWrapper:"searchOutputWrapper",divider:"divider",search:"search",searchResults:"searchResults",scrollableDiv:"scrollableDiv",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",creatorInfo:"creatorInfo",stockColorFilter:"stockColorFilter",allColors:"allColors",blackColor:"blackColor",bwColor:"bwColor",whiteColor:"whiteColor",orangeColor:"orangeColor",redColor:"redColor",purpleColor:"purpleColor",magentaColor:"magentaColor",greenColor:"greenColor",tealColor:"tealColor",blueColor:"blueColor",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const yO={default:4,1600:3,1100:2,700:1},bO=(e,t)=>{const r=new URL(e);return r.searchParams.set("w",t.toString()),r.toString()},wO=({imageStockList:e,setImageStockList:t,currentReq:r,setCurrentReq:n,inputRef:a,customRequest:l})=>{var c,u,f;const{t:p}=kr(),{StockBigIcon:g,MixedViewIcon:m,LandscapeViewIcon:y,PortraitViewIcon:b,SquareViewIcon:w}=ca(),{options:_}=ti(),{config:S}=_,[A,k]=(0,o.useState)(!1),[E,I]=(0,o.useState)(2),[j,T]=(0,o.useState)(null),[F,P]=(0,o.useState)(null),[M,R]=(0,o.useState)(!0),[N]=d.A.useForm(),D=null==S?void 0:S.handleProxyUrl,z=null!==(c=null==S?void 0:S.UNSPLASH_KEY)&&void 0!==c?c:"HX2_qqq3F3ljmtYtfmb9P6h0dn2u9mnnOl36IdV8el0",B=(null===(u=null==S?void 0:S.locale)||void 0===u?void 0:u.slice(0,2))||"ru",U=(0,o.useRef)(r),V=async e=>D?Promise.resolve(D(e)):e,H=async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{urls:{raw:await V(bO(e.urls.raw,1200)),small:await V(bO(e.urls.raw,540))}})));(0,o.useEffect)(()=>{U.current=r},[r]),(0,o.useEffect)(()=>{0===e.length&&N.setFieldsValue({color:"",orientation:""})},[e,N]),(0,o.useEffect)(()=>{N.setFieldsValue({keywords:r.keywords,color:r.color,orientation:r.orientation})},[]);const $=async function({query:e,page:t}){const r=e.keywords.replace(/[^\w\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let n=`https://api.unsplash.com/search/photos?client_id=${z}&lang=${B}&per_page=18&query=${encodeURIComponent(r)}&page=${t}`;""!==e.color&&(n+=`&color=${e.color}`),""!==e.orientation&&(n+=`&orientation=${e.orientation}`);const i=await fetch(await V(n));return{data:await i.json()}}catch(e){}finally{k(!1)}},W=async()=>{var e,r,n;k(!0);const i=await $({query:U.current,page:1});(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.results)&&(t(await H(i.data.results)),R(18===i.data.results.length),(null===(n=null===(r=null==i?void 0:i.data)||void 0===r?void 0:r.results)||void 0===n?void 0:n.length)&&i.data.results.length>0&&I(2))};(0,o.useEffect)(()=>()=>{F&&clearTimeout(F)},[F]);return(0,i.jsx)("div",{className:vO.stockTab,children:(0,i.jsx)("div",{className:vO.searchOutputWrapper,children:(0,i.jsxs)("div",{className:vO.scrollableDiv,id:"scrollableDiv",children:[(0,i.jsxs)(d.A,{form:N,initialValues:Zt,onValuesChange:(t,r)=>{const i=Object.assign(Object.assign({},Zt),r);if(n(i),U.current=i,F&&clearTimeout(F),""!==r.keywords){const e=setTimeout(W,800);P(e)}else e.length||(n(Object.assign({},Zt)),U.current=Zt,N.resetFields())},className:e.length>0?vO.searchResults:vO.search,children:[(0,i.jsxs)(x.A,{gutter:24,children:[(0,i.jsx)(C.A,{span:e.length>0?void 0:24,children:(0,i.jsx)(d.A.Item,{name:"keywords",className:vO.stockSearchInput,children:(0,i.jsx)(h.A,{allowClear:!0,placeholder:p("Search image"),ref:a,spellCheck:"false",prefix:(0,i.jsx)($n,{size:16,strokeWidth:null==S?void 0:S.iconStrokeWidth})})})}),!!e.length&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(C.A,{children:(0,i.jsx)(d.A.Item,{name:"orientation",children:(0,i.jsxs)(L.Ay.Group,{onChange:e=>n(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[(0,i.jsx)(v.A,{title:p("All"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"",children:(0,i.jsx)(m,{})})}),(0,i.jsx)(v.A,{title:p("Landscape"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"landscape",children:(0,i.jsx)(y,{})})}),(0,i.jsx)(v.A,{title:p("Portrait"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"portrait",children:(0,i.jsx)(b,{})})}),(0,i.jsx)(v.A,{title:p("Squarish"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"squarish",children:(0,i.jsx)(w,{})})})]})})}),(0,i.jsx)(C.A,{children:(0,i.jsx)(d.A.Item,{name:"color",children:(0,i.jsxs)(L.Ay.Group,{className:vO.stockColorFilter,onChange:e=>n(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[(0,i.jsx)(v.A,{title:p("All"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.allColors,value:"",children:"All"})}),(0,i.jsx)(v.A,{title:p("Black"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.blackColor,value:"black",children:"B"})}),(0,i.jsx)(v.A,{title:p("Black and White"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.bwColor,value:"black_and_white",children:"B&W"})}),(0,i.jsx)(v.A,{title:p("White"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.whiteColor,value:"white",children:"W"})}),(0,i.jsx)(v.A,{title:p("Orange"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.orangeColor,value:"orange",children:"O"})}),(0,i.jsx)(v.A,{title:p("Red"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.redColor,value:"red",children:"R"})}),(0,i.jsx)(v.A,{title:p("Purple"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.purpleColor,value:"purple",children:"P"})}),(0,i.jsx)(v.A,{title:p("Magenta"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.magentaColor,value:"magenta",children:"M"})}),(0,i.jsx)(v.A,{title:p("Green"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.greenColor,value:"green",children:"G"})}),(0,i.jsx)(v.A,{title:p("Teal"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.tealColor,value:"teal",children:"T"})}),(0,i.jsx)(v.A,{title:p("Blue"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:vO.blueColor,value:"blue",children:"B"})})]})})})]})]}),e.length>0&&!A&&(0,i.jsx)("div",{className:`ant-divider ${vO.divider}`,role:"separator"})]}),!e.length&&!A&&(0,i.jsx)(i.Fragment,{children:r.keywords?(0,i.jsx)(ua,{}):(0,i.jsxs)("div",{className:vO.resultsContainer,children:[(0,i.jsx)("div",{className:vO.videoIcon,children:(0,i.jsx)(g,{className:vO.playButton})}),(0,i.jsx)("h1",{className:vO.title,children:p("Millions of free stock images")}),(0,i.jsx)("p",{className:vO.subtitle,children:p("Enter a search query and we'll find the perfect image for you")})]})}),!e.length&&A&&(0,i.jsx)(wa,{}),e.length>0&&(0,i.jsx)(lO,{dataLength:e&&e.length,next:async()=>{if(A||""===U.current.keywords)return k(!1),void(""===U.current.keywords&&R(!1));k(!0),$({query:U.current,page:E}).then(async e=>{if(e&&e.data&&e.data.results){const r=await H(e.data.results);t(e=>[...e,...r]),R(18===e.data.results.length)}I(e=>e+1)}).catch(e=>{}).finally(()=>{k(!1)})},hasMore:M&&""!==(null===(f=U.current)||void 0===f?void 0:f.keywords),endMessage:(0,i.jsxs)(O.A,{plain:!0,children:[p("That`s all we could find.")," \ud83e\udd10"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:(0,i.jsx)(wa,{}),children:(0,i.jsx)(fO,{breakpointCols:yO,className:vO.myMasonryGrid,columnClassName:vO.myMasonryGridColumn,children:e.map((e,t)=>(0,i.jsxs)("div",{className:vO.listItem,onClick:()=>(async(e,t,r)=>{var n;!async function(e){try{const t=`${e}${e.includes("?")?"&":"?"}client_id=${z}`,r=await V(t),n=await fetch(r);return{data:await n.json()}}catch(e){}}(t.download_location),T(r),setTimeout(()=>T(null),2e3);const i=e.raw,o=i.split("?")[0].split("#")[0].split("/");let a=o[o.length-1]||"uploaded-file";a.includes(".")&&(null===(n=a.split(".").pop())||void 0===n?void 0:n.length)&&a.split(".").pop().length<=5||(a+=".jpg"),l(i,a)})(e.urls,e.links,e.id,e.description),children:[(0,i.jsx)("img",{className:j===e.id?vO.loadedImage:"",width:"100%",src:e.urls.small,alt:e.description,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(vO.loaded)}}),(0,i.jsxs)("p",{className:vO.creatorInfo,onClick:e=>e.stopPropagation(),children:[p("Photo by")," ",(0,i.jsx)("a",{target:"_blank",href:`${e.user.links.html}?utm_source=${null==S?void 0:S.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:e.user.name})," ",p("on")," ",(0,i.jsx)("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==S?void 0:S.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),j===e.id&&(0,i.jsx)(s.A,{className:vO.antSpin})]},e.id+t))})})]})})})};const xO=({images:e,transitionDuration:t=1e3,frameHeight:r})=>{const[n,a]=(0,o.useState)([]),[s,l]=(0,o.useState)(r);(0,o.useEffect)(()=>{const e=()=>{if("undefined"==typeof window)return void l(r);const e=window.innerHeight,t=Math.max(e-260,130);if("number"==typeof r){const e=Math.min(r,t);l(e)}else l(t)};if(e(),"undefined"!=typeof window)return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[r]);const c=()=>{a(e=>e.map((t,r)=>r===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return(0,o.useEffect)(()=>{if(e.length>0){const t=e[e.length-1];a(e=>[...e,{src:t,opacity:0}]),setTimeout(c,1e3)}else a([])},[e]),(0,i.jsx)("div",{className:"slideshowContainer",style:{height:s,minHeight:130},children:n.map((e,r)=>(0,i.jsx)("img",{src:`data:image/jpeg;base64, ${e.src}`,alt:`Slide ${r+1}`,className:"slideshowImage",style:{opacity:e.opacity,transition:`opacity ${t}ms linear`,display:"block"}},r))})};"function"==typeof SuppressedError&&SuppressedError;const CO=e=>{var{className:t,style:r,color:n,text:o,bordered:a}=e,s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["className","style","color","text","bordered"]);const l=o||"";return(0,i.jsx)(N.A,Object.assign({style:r,color:n,bordered:a,className:t},s,{children:l}))},_O=({text:e,counter:t,limits:r,wrapperStyles:n})=>{const{t:o}=kr(),{options:a}=ti(),s=a.config,{token:c}=l.A.useToken(),u=+r>0,d=!u||t<+r,h=(null==s?void 0:s.billingPageUrl)||"/billing",f=t+" "+o("of")+" "+(u?r:"\u221e")+" "+(e||o("tests",{count:r}))+" "+o("was used",{count:t});return(0,i.jsxs)("div",{className:"limits-couter-wrapper",style:n,children:[(0,i.jsx)(CO,{bordered:!1,text:f,className:"limit-counter",style:{color:d?c.colorText:"white"},color:d?c.colorFillSecondary:"rgb(255, 77, 79)"}),u&&(0,i.jsx)("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(h),children:o("Need more?")})]})};var SO={imageAi:"imageAi",imageAiExample:"imageAiExample",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 AO=(0,o.memo)(({className:e,onClick:t})=>(0,i.jsx)("div",{className:`${SO.arrow} ${SO.arrowNext} ${e||""}`,onClick:t,children:(0,i.jsx)(S.Ay,{className:`${SO.arrowBtn} ${SO.arrowBtnNext}`,size:"large",icon:(0,i.jsx)(le.A,{})})}));AO.displayName="SampleNextArrow";const kO=(0,o.memo)(({className:e,onClick:t})=>(0,i.jsx)("div",{className:`${SO.arrow} ${SO.arrowPrev} ${e||""}`,onClick:t,children:(0,i.jsx)(S.Ay,{className:`${SO.arrowBtn} ${SO.arrowBtnPrev}`,size:"large",icon:(0,i.jsx)(ce.A,{})})}));kO.displayName="SamplePrevArrow";const EO=({customRequest:e,inputAiRef:t,isImageUploaded:r,setIsImageUploaded:n,aiImageRequest:a,setAiImageRequest:s,imageAiList:l,setImageAiList:c,isLoadingAi:u,setIsLoadingAi:f})=>{const{t:p}=kr(),{AiIcon_2:g}=ca(),m=o.useRef(null),[v,y]=(0,o.useState)("auto"),{aiImageCounter:b,currentAiImgLimits:w,loadingDuringGeneration:_,requestStatus:A,handleGenerate:k,convertBase64ToFile:E,isShiftPressed:I,setIsShiftPressed:j,limitsInPlugin:T}=function({setFrameHeight:e,customRequest:t,aiTabRef:r,isImageUploaded:n,setIsImageUploaded:i,aiImageRequest:a,imageAiList:s,setImageAiList:l,isLoadingAi:c,setIsLoadingAi:u}){const{t:d}=kr(),{options:h}=ti(),f=h.config,p=oi(),g=(()=>{const{options:e}=ti(),t=e.config;return(0,o.useCallback)((e,r)=>{!1!==(null==t?void 0:t.pushToGTM)&&((e,t)=>{const r=()=>{try{const t=Object.assign(Object.assign({},e),{appLabel:"blocks_app"});window.dataLayer&&"function"==typeof window.dataLayer.push&&window.dataLayer.push(t)}catch(e){}};t?setTimeout(r,t):r()})(e,r)},[null==t?void 0:t.pushToGTM])})(),{messages:m}=h.config,[v,y]=(0,o.useState)([]),[b,w]=(0,o.useState)(0),[x,C]=(0,o.useState)(null),[_,S]=(0,o.useState)(!1),[A,k]=(0,o.useState)(d("Evaluating the task")),[E,I]=(0,o.useState)(!1),j=(0,o.useRef)(new Set),T=(0,o.useRef)(new Set),F=(0,o.useRef)(new Set);(0,o.useEffect)(()=>{y(m)},[m]),(0,o.useEffect)(()=>{s.length||x||(y([]),j.current.clear(),T.current.clear(),F.current.clear(),M.current=-1)},[s,x]);const O=(0,o.useMemo)(()=>f&&"function"==typeof(null==f?void 0:f.sendAIImageRequest)?null==f?void 0:f.sendAIImageRequest:()=>Promise.resolve({}),[f]),P=(0,o.useCallback)(e=>{const t=`${x}-${e.progress}-${JSON.stringify(e.images||e.data)}`;if(!F.current.has(t))if(F.current.add(t),"error"!==e.status&&"Canceled"!==e.status){if(e.images){if(k(String(e.status)),100===e.progress){u(!1),l(e.images);const t=x,r=Array.isArray(e.images)?e.images:[];r.length>0&&t&&!j.current.has(t)&&(j.current.add(t),p.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:d("Images generated successfully"),placement:"bottomRight",data:{request:a,taskId:t,images:r}})),C(null),I(!1)}}else if(e.data&&(l([String(e.data)]),100===e.progress)){u(!1);const t=x,r=e.data?[String(e.data)]:[];r.length>0&&t&&!j.current.has(t)&&(j.current.add(t),p.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:d("Images generated successfully"),placement:"bottomRight",data:{request:a,taskId:t,images:r}})),C(null),I(!1)}}else u(!1),I(!1),x&&!T.current.has(x)&&(T.current.add(x),p.error({id:"AI_RESPONSE_INVALID",message:d("Something went wrong, please try again"),placement:"bottomRight",description:String(x)||void 0,data:{requestId:x,request:a,response:e},innerException:e}))},[a,l,k,d,u,x,p,I]),M=(0,o.useRef)(-1);(0,o.useEffect)(()=>{if(v.length>0){const e=v.length-1;e>M.current&&(M.current=e,P(v[e]))}},[P,v]);const R=(0,o.useMemo)(()=>{if(f&&"function"==typeof(null==f?void 0:f.sseQuery)){const e=null==f?void 0:f.sseQuery;return t=>e(t)}return e=>{}},[f]),L=(0,o.useMemo)(()=>f&&"object"==typeof(null==f?void 0:f.handleLimitUsageEmitter)?null==f?void 0:f.handleLimitUsageEmitter:{fire:()=>{}},[f]),N=null==f?void 0:f.elementId,{projectId:D}=f,{limits:z}=(null==f?void 0:f.limits)?f:{limits:{ai_img_limit:0}},{ai_img_limit:B}=z,U=B>0&&b>=B,V=!(!(null==f?void 0:f.limits)||!f.counters)&&false,H=(0,o.useCallback)(()=>{L.fire({name:"AiImgCount",count:b+1})},[L,b]),$=(0,o.useMemo)(()=>!U&&!V,[U,V,b,B]),W=(0,o.useCallback)(async()=>{k(d("Evaluating the task")),""===a||c||(u(!0),I(!0),l([]),y([]),g({event:"submit_form",action:"ai_image_generation",entity_id:N,project_id:D}),O({body:{project_id:D,request:"create-image",connection:"midjourney",message:a}}).then(e=>{var t,r,n,i,o;const{data:s,error:l}=e||{};if(l)throw l;const c=s;if(401===(null==c?void 0:c.status)||401===(null===(t=null==c?void 0:c.data)||void 0===t?void 0:t.status))throw new Error("ERROR");const h=(null==c?void 0:c.task)||(null===(r=null==c?void 0:c.data)||void 0===r?void 0:r.task),f=null!==(i=null!==(n=null==h?void 0:h.id)&&void 0!==n?n:x)&&void 0!==i?i:void 0;200===(null==c?void 0:c.status)||200===(null===(o=null==c?void 0:c.data)||void 0===o?void 0:o.status)?((null==h?void 0:h.id)&&(k(h.message),C(h.id)),(null==c?void 0:c.message)&&p.success({id:"AI_IMAGE_GENERATION_STARTED",message:c.message,placement:"bottomRight",data:{request:a,taskId:f,response:null==c?void 0:c.data}}),R({task_id:null==h?void 0:h.id,entity_id:N})):(u(!1),I(!1),f&&!T.current.has(f)&&(T.current.add(f),p.error({id:"AI_IMAGE_GENERATION_FAILED",message:(null==c?void 0:c.message)||d("Something went wrong, please try again"),placement:"bottomRight",description:a,data:{request:a,taskId:f,response:c},innerException:c})))}).catch(e=>{u(!1),I(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&x&&!T.current.has(x)&&(T.current.add(x),null==p||p.error({id:"AI_IMAGE_GENERATION_FAILED",message:d("Something went wrong, please try again"),placement:"bottomRight",description:a,innerException:e,data:{request:a,taskId:x,response:null==t?void 0:t.data,error:pi(null==t?void 0:t.error)}})),t}))},[a,c,u,I,l,g,N,D,O,p,R,d,x]),G=(0,o.useCallback)(()=>{$&&W()},[$,V,w,H,W,p,d]);(0,o.useEffect)(()=>{},[f,V]);const q=(0,o.useCallback)(e=>{if(n)return;const r=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!r)return;const o=r[1],a=r[2],s=atob(a),l=new Array(s.length);for(let t=0;t<s.length;t++)l[t]=s.charCodeAt(t);const c=new Uint8Array(l),u=new Blob([c],{type:`image/${o}`}),d=new File([u],"image.jpeg",{type:u.type,lastModified:Date.now()});i(!0),(async()=>{try{"function"==typeof t&&await Promise.resolve(t({file:d}))}catch(e){}finally{i(!1)}})()},[n,i,t]);return(0,o.useEffect)(()=>{(c||s.length>0)&&setTimeout(()=>{var t,n;let i=350;if(r.current){const e=null===(t=r.current)||void 0===t?void 0:t.firstChild;e&&e instanceof HTMLElement&&(i=(null===(n=r.current.getBoundingClientRect())||void 0===n?void 0:n.height)-48-e.clientHeight)}e(i)},0)},[r,s.length,c,e]),{aiImageCounter:b,setAiImageCounter:w,currentAiImgLimits:B,isFieldsDisabled:U,canGenerateImage:$,aiImageRequest:a,imageAiList:s,setImageAiList:l,isLoadingAi:c,setIsLoadingAi:u,loadingDuringGeneration:E,setLoadingDuringGeneration:I,requestStatus:A,setRequestStatus:k,handleGenerate:G,handleLimitAiImgCount:H,convertBase64ToFile:q,isShiftPressed:_,setIsShiftPressed:S,currentReqId:x,setCurrentReqId:C,limitsInPlugin:V}}({setFrameHeight:y,customRequest:e,aiTabRef:m,isImageUploaded:r,setIsImageUploaded:n,aiImageRequest:a,imageAiList:l,setImageAiList:c,isLoadingAi:u,setIsLoadingAi:f});(0,o.useEffect)(()=>{},[r]);const[F,O]=(0,o.useState)(!1),P=(0,o.useCallback)(()=>O(!0),[]),M=(0,o.useCallback)(()=>O(!1),[]),R=(0,o.useCallback)(e=>s(e.target.value),[s]),L=(0,o.useCallback)(e=>{"Shift"===e.key?j(!0):"Enter"!==e.key||I||(e.preventDefault(),k())},[I,k,j]),N=(0,o.useCallback)(e=>{"Shift"===e.key&&j(!1)},[j]);return(0,i.jsxs)("div",{className:SO.imageAi,ref:m,children:[T&&(0,i.jsx)(_O,{text:"images",counter:b,limits:w,wrapperStyles:{marginTop:-25}}),(0,i.jsx)(x.A,{gutter:24,className:SO.row,children:(0,i.jsxs)(C.A,{span:24,children:[(0,i.jsx)(d.A.Item,{children:(0,i.jsxs)("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${SO.inputAffixWrapper}${F?" ant-input-affix-wrapper-focused":""}`,children:[(0,i.jsx)(h.A.TextArea,{ref:t,onKeyDown:L,onKeyUp:N,onFocus:P,onBlur:M,autoSize:!0,allowClear:!0,className:`${SO.textAreaInputHybrid} ${SO.textarea}`,placeholder:p("Generate image"),value:a,onChange:R,spellCheck:"false"}),(0,i.jsx)("span",{className:`ant-input-suffix ${SO.inputSuffix}`,children:u||_?(0,i.jsx)(H.A,{className:`${SO.inputIcon} input-icon`,spin:!0}):(0,i.jsx)(g,{className:`${SO.inputIcon} input-icon`,onClick:k})})]})}),(0,i.jsxs)("div",{className:SO.imageAiExample,children:[(0,i.jsx)("span",{children:p("For example:")})," ",p("A beautiful image of a sunset over a calm ocean.")]})]})}),(u||l.length>0)&&(0,i.jsxs)(D.A,{dotPosition:"top",arrows:!0,nextArrow:(0,i.jsx)(AO,{}),prevArrow:(0,i.jsx)(kO,{}),className:SO.carousel,infinite:!1,children:[u&&!l.length&&(0,i.jsx)("div",{className:SO.loading,children:(0,i.jsxs)("div",{className:"spin",children:[(0,i.jsx)(H.A,{style:{fontSize:48},spin:!0}),(0,i.jsx)("p",{className:"status",children:A})]})}),l.length>0&&l.map((e,t)=>(0,i.jsxs)("div",{className:SO.imageItem,children:[(0,i.jsx)(xO,{images:l,frameHeight:v}),(0,i.jsx)("div",{className:"buttons",children:l.length>0&&!u&&(0,i.jsx)(S.Ay,{onClick:()=>E(`data:image/jpeg;base64, ${e}`),loading:r,icon:(0,i.jsx)(ue.A,{}),children:p("Use this variant")})})]},t))]})]})};var IO={iconsTab:"iconsTab",hasSearch:"hasSearch",iconsSearchFormCenteredContainer:"iconsSearchFormCenteredContainer",iconsSearchFormCentered:"iconsSearchFormCentered",iconsSearchFormInput:"iconsSearchFormInput",iconsSearchFormInputInput:"iconsSearchFormInputInput",iconsSearchResults:"iconsSearchResults",iconsControlsControls:"iconsControlsControls",iconsControls:"iconsControls",iconsControlElement:"iconsControlElement",iconsControlsStrokeWidth:"iconsControlsStrokeWidth",iconsControlsHeader:"iconsControlsHeader",iconsSearchFormSelect:"iconsSearchFormSelect",iconsSearchFormStyleItem:"iconsSearchFormStyleItem",iconsSearchDivider:"iconsSearchDivider",iconsGrid:"iconsGrid",iconsBottomBar:"iconsBottomBar",iconsBottomBarContent:"iconsBottomBarContent",iconsGridEmptyState:"iconsGridEmptyState",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle",iconsGridInfiniteScroll:"iconsGridInfiniteScroll",iconsGridGrid:"iconsGridGrid",iconsGridItem:"iconsGridItem",iconsGridItemThumbnail:"iconsGridItemThumbnail",iconsGridItemSvg:"iconsGridItemSvg",iconsGridItemImg:"iconsGridItemImg",iconsGridItemName:"iconsGridItemName",iconsGridLoading:"iconsGridLoading",iconsControlsBackButton:"iconsControlsBackButton",iconsGridCheckbox:"iconsGridCheckbox",iconsGridShowCheckboxes:"iconsGridShowCheckboxes",iconsHeaderContainer:"iconsHeaderContainer",iconsHeaderContainerLeft:"iconsHeaderContainerLeft",copyToFolderModalBody:"copyToFolderModalBody",copyToFolderModalLoadingOverlay:"copyToFolderModalLoadingOverlay"};const jO=[{label:"Line",value:"line"},{label:"Solid",value:"solid"},{label:"Flat",value:"flat"},{label:"Duo",value:"duo"},{label:"Handrawn",value:"handrawn"},{label:"Creative",value:"creative"},{label:"Gradient",value:"gradient"},{label:"Remix",value:"remix"},{label:"Neon",value:"neon"},{label:"Pop",value:"pop"},{label:"Light",value:"light"},{label:"Glyph",value:"glyph"},{label:"Minimal",value:"minimal"},{label:"Outlined",value:"outlined"},{label:"Geometric",value:"geometric"},{label:"Bold",value:"bold"},{label:"Stroke",value:"stroke"},{label:"Wireframe",value:"wireframe"},{label:"Filled",value:"filled"}],TO=({query:e,onQueryChange:t,onSubmit:r,styleFilter:n,onStyleChange:o,hasResults:a=!1,inputRef:s})=>{const{t:l}=kr(),{options:c}=ti(),{config:u}=c,f=e.length>0&&a;return(0,i.jsxs)("div",{className:IO.iconsSearchFormCenteredContainer,children:[(0,i.jsxs)(d.A,{layout:"inline",onFinish:r,className:f?IO.iconsSearchResults:IO.iconsSearchFormCentered,children:[(0,i.jsx)(d.A.Item,{className:IO.iconsSearchFormInput,children:(0,i.jsx)(h.A,{ref:s,className:IO.iconsSearchFormInputInput,allowClear:!0,prefix:(0,i.jsx)($n,{size:16,strokeWidth:null==u?void 0:u.iconStrokeWidth,onClick:r}),placeholder:l("Search icons"),value:e,onChange:e=>t(e.target.value),onKeyDown:e=>"Space"===e.code&&r(),onPressEnter:r,spellCheck:"false"})}),f&&(0,i.jsx)(d.A.Item,{className:IO.iconsSearchFormStyleItem,children:(0,i.jsx)(g.A,{allowClear:!0,placeholder:l("Style"),value:null!=n?n:void 0,onChange:e=>o(null!=e?e:null),className:IO.iconsSearchFormSelect,options:jO.map(e=>({label:l(e.label),value:e.value}))})})]}),f&&(0,i.jsx)("div",{className:`ant-divider ${IO.iconsSearchDivider}`,role:"separator"})]})},FO=e=>{const{t:t}=kr(),{mode:r,colorHex:n,setColorHex:o,colorHex2:a,setColorHex2:s,colorHex3:l,setColorHex3:c,sizePx:u,setSizePx:d,strokeWidth:h,setStrokeWidth:f,showSecondColor:p,showThirdColor:g,onBack:m,styleFilter:v}=e;return(0,i.jsxs)("div",{className:IO.iconsControls,children:[(0,i.jsx)("div",{className:IO.iconsControlsControls,children:"family"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:IO.iconsControlsStrokeWidth,children:[(0,i.jsx)("span",{children:t("Size")}),(0,i.jsx)(z.A,{min:20,max:200,value:u,formatter:e=>`${e}px`,parser:e=>e?e.replace("px",""):"",onChange:e=>d("number"==typeof e?e:50)})]}),(0,i.jsxs)("div",{className:IO.iconsControlsStrokeWidth,children:[(0,i.jsx)("span",{children:t("Stroke width")}),(0,i.jsx)(z.A,{min:.3,max:3,step:.1,value:"number"==typeof h?h:1,formatter:e=>`${e}px`,parser:e=>e?e.replace("px",""):"",onChange:e=>f("number"==typeof e?e:1)})]}),"gradient"===v?(0,i.jsx)(A.A,{size:8,children:(0,i.jsx)(B.A,{defaultValue:[{color:n||"#108ee9",percent:0},{color:a||"#87d068",percent:100}],showText:!0,mode:"gradient",onChangeComplete:e=>{try{const t=e.toCssString().match(/(rgba?\([^)]+\)|#[0-9a-fA-F]{3,8})/g)||[];t[0]&&o(t[0]),t[1]&&s(t[1])}catch(e){}},size:"small"})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:IO.iconsControlElement,children:[(0,i.jsx)("span",{children:t("Color1")}),(0,i.jsx)(B.A,{value:n,format:"hex",disabledAlpha:!0,onChange:(e,t)=>o(t),size:"middle"})]}),p&&(0,i.jsxs)("div",{className:IO.iconsControlElement,children:[(0,i.jsx)("span",{children:t("Color2")}),(0,i.jsx)(B.A,{value:a,format:"hex",disabledAlpha:!0,onChange:(e,t)=>s(t),size:"middle"})]}),g&&(0,i.jsxs)("div",{className:IO.iconsControlElement,children:[(0,i.jsx)("span",{children:t("Color3")}),(0,i.jsx)(B.A,{value:l,format:"hex",disabledAlpha:!0,onChange:(e,t)=>c(t),size:"middle"})]})]})]})}),(0,i.jsx)("div",{className:IO.iconsControlsHeader,children:(0,i.jsx)("div",{children:"family"===r?(0,i.jsx)(S.Ay,{className:IO.iconsControlsBackButton,type:"default",onClick:m,title:t("Back"),children:t("Back")}):null})})]})},OO=(0,i.jsx)(H.A,{style:{fontSize:20},spin:!0}),PO=({items:e,hasMore:t,loading:r,hasQuery:n,mode:o,selectedHash:a,onLoadMore:l,onItemClick:c,onInsert:u,scrollContainerRef:d,colorVars:h,svgTextMap:f,previewSize:p,selectedHashes:g,onToggleSelect:v})=>{const{t:y}=kr(),{ThumbsUpIcon:b}=ca(),w=Boolean(g&&g.size>0),x=(0,i.jsx)("div",n?{className:IO.iconsGridEmptyState,children:(0,i.jsx)(ua,{})}:{className:IO.iconsGridEmptyState,children:(0,i.jsxs)("div",{className:IO.resultsContainer,children:[(0,i.jsx)("span",{className:IO.videoIcon,children:(0,i.jsx)(b,{className:IO.playButton,style:{width:48,height:49,marginBottom:10}})}),(0,i.jsx)("h1",{className:IO.title,children:y("Millions of icons")}),(0,i.jsx)("p",{className:IO.subtitle,children:y("Enter a search query and we'll find the perfect icon for you")})]})});return(0,i.jsxs)("div",{id:"iconsScrollableDiv",ref:d,className:IO.iconsGrid,children:[0!==e.length||r?(0,i.jsx)(lO,{dataLength:e.length,next:l,hasMore:t,scrollableTarget:"iconsScrollableDiv",className:IO.iconsGridInfiniteScroll,loader:(0,i.jsx)(s.A,{indicator:OO}),children:(0,i.jsx)("div",{className:`${IO.iconsGridGrid} ${w?IO.iconsGridShowCheckboxes:""}`,style:{"--icons-grid-min-col":`${Math.max(100,(null!=p?p:50)+48)}px`},children:e.map(e=>{var t,r,n,s,l,u,d,y,b,w,x;return(0,i.jsxs)("div",{style:{border:g&&g.has(e.hash)||a===e.hash?"1px solid #1890ff":"1px solid #f0f0f0",boxShadow:g&&g.has(e.hash)||a===e.hash?"0 0 0 2px rgba(24,144,255,0.2)":"none"},className:IO.iconsGridItem,onClick:()=>{c(e),v&&"family"===o&&v(e.hash)},children:[(0,i.jsx)("div",{style:{height:null!=p?p:50},className:IO.iconsGridItemThumbnail,children:"family"===o&&f[e.hash]?(0,i.jsx)("div",{style:{color:null==h?void 0:h.colorHex,"--icon-grad-1":null!==(t=null==h?void 0:h.colorHex)&&void 0!==t?t:"#000","--icon-grad-2":null!==(r=null==h?void 0:h.colorHex2)&&void 0!==r?r:"#ff007a","--icon-color-1":null!==(n=null==h?void 0:h.colorHex)&&void 0!==n?n:"#000","--icon-color-2":null!==(s=null==h?void 0:h.colorHex2)&&void 0!==s?s:"#ff007a","--icon-color-3":null!==(l=null==h?void 0:h.colorHex3)&&void 0!==l?l:"#00C2FF","--icon-stroke-1":null!==(u=null==h?void 0:h.colorHex)&&void 0!==u?u:"#000","--icon-stroke-2":null!==(d=null==h?void 0:h.colorHex2)&&void 0!==d?d:"#ff007a","--icon-stroke-3":null!==(y=null==h?void 0:h.colorHex3)&&void 0!==y?y:"#00C2FF","--icon-fill-1":null!==(b=null==h?void 0:h.colorHex)&&void 0!==b?b:"#000","--icon-fill-2":null!==(w=null==h?void 0:h.colorHex2)&&void 0!==w?w:"#ff007a","--icon-fill-3":null!==(x=null==h?void 0:h.colorHex3)&&void 0!==x?x:"#00C2FF"},dangerouslySetInnerHTML:{__html:f[e.hash]},className:IO.iconsGridItemSvg}):(0,i.jsx)("img",{src:e.imagePreviewUrl,alt:e.name,style:{maxHeight:null!=p?p:96},className:IO.iconsGridItemImg})}),(0,i.jsx)("div",{className:IO.iconsGridItemName,title:e.name,children:e.name}),v?(0,i.jsx)("div",{onClick:e=>{e.stopPropagation()},className:IO.iconsGridCheckbox,children:(0,i.jsx)(m.A,{checked:Boolean(g&&g.has(e.hash)),onChange:()=>v(e.hash)})}):null]},e.hash)})})}):x,!r&&t&&e.length>0&&(0,i.jsx)("div",{style:{height:1},ref:e=>{if(!e||!d.current)return;const t=d.current;t.scrollHeight<=t.clientHeight&&l()}}),r&&0===e.length&&(0,i.jsx)("div",{className:IO.iconsGridLoading,children:(0,i.jsx)(s.A,{indicator:OO})})]})},MO="path|rect|circle|ellipse|polygon|line|polyline|g";function RO(e){const t=e.trim();if(!t||"none"===t||"transparent"===t)return null;if(/^url\(#/.test(t))return null;if(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t)){const e=t.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})/);return e?"#"+(3===e[1].length?e[1].replace(/(.)/g,"$1$1"):e[1]).toLowerCase():null}if(/^rgb\(/.test(t)){const e=t.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);if(e)return"#"+[1,2,3].map(t=>parseInt(e[t],10).toString(16).padStart(2,"0")).join("")}if(/^rgba\(/.test(t)){const e=t.match(/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*[\d.]+\s*\)/);if(e)return"#"+[1,2,3].map(t=>parseInt(e[t],10).toString(16).padStart(2,"0")).join("")}const r={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff"},n=t.toLowerCase();return r[n]?r[n]:("currentcolor"===n||"inherit"===n||/^[a-zA-Z]+$/.test(t),null)}function LO(e,t){const r=new RegExp(`${t}\\s*:\\s*([^;]+)`,"i"),n=e.match(r);return n?n[1].trim():null}function NO(e){let t=0;const r=new RegExp(`<(?:${MO})([^>]*)>`,"gi");let n;for(;null!==(n=r.exec(e));){const e=n[1],r=e.match(/fill\s*=\s*["']([^"']*)["']/i),i=e.match(/style\s*=\s*["']([^"']*)["']/i),o=r&&r[1]&&!/^none$/i.test(r[1])&&!/^url\(#/i.test(r[1]),a=i&&LO(i[1],"fill")&&!/^none$/i.test(LO(i[1],"fill"));(o||a)&&(t+=1)}return t}function DO(e){let t=0;const r=new RegExp(`<(?:${MO})([^>]*)>`,"gi");let n;for(;null!==(n=r.exec(e));){const e=n[1],r=e.match(/stroke\s*=\s*["']([^"']*)["']/i),i=e.match(/style\s*=\s*["']([^"']*)["']/i),o=r&&r[1]&&!/^none$/i.test(r[1])&&!/^url\(#/i.test(r[1]),a=i&&LO(i[1],"stroke")&&!/^none$/i.test(LO(i[1],"stroke"));(o||a)&&(t+=1)}return t}function zO(e){return/<linearGradient/i.test(e)||/<radialGradient/i.test(e)||/fill="url\(#|stroke="url\(#/i.test(e)}function BO(e){const t=e.trim().replace(/(?:px|em|ex|%)\s*$/i,""),r=parseFloat(t);return Number.isNaN(r)||r<=0||r>10?null:Math.round(10*r)/10}function UO(e){const t=[],r=e.indexOf("</defs>"),n=r>=0?e.slice(r):e,i=new RegExp(`<(?:${MO})[^>]*stroke-width\\s*=\\s*["']([^"']+)["']`,"gi");let o;for(;null!==(o=i.exec(n));){const e=BO(o[1]);null!=e&&t.push(e)}const a=new RegExp(`<(?:${MO})[^>]*style\\s*=\\s*["'][^"']*stroke-width\\s*:\\s*([^;"]+)[^"']*["']`,"gi");for(;null!==(o=a.exec(n));){const e=BO(o[1]);null!=e&&t.push(e)}if(0===t.length)return;t.sort((e,t)=>e-t);const s=Math.floor(t.length/2);return t.length%2==1?t[s]:(t[s-1]+t[s])/2}function VO(e){const t=function(e){const t=[],r=new Set;Array.from(e.matchAll(/<stop[^>]*?stop-color\s*=\s*["']([^"']+)["']/gi)).map(e=>e[1]).forEach(e=>{const n=RO(e);n&&!r.has(n)&&(r.add(n),t.push(e))});const n=new RegExp(`<(?:${MO})([^>]*)>`,"gi");let i;for(;null!==(i=n.exec(e));){const e=i[1],n=e.match(/fill\s*=\s*["']([^"']*)["']/i);if(n&&n[1]){const e=RO(n[1]);e&&!r.has(e)&&(r.add(e),t.push(n[1]))}const o=e.match(/stroke\s*=\s*["']([^"']*)["']/i);if(o&&o[1]){const e=RO(o[1]);e&&!r.has(e)&&(r.add(e),t.push(o[1]))}const a=e.match(/style\s*=\s*["']([^"']*)["']/i);if(a&&a[1]){const e=LO(a[1],"fill");if(e){const n=RO(e);n&&!r.has(n)&&(r.add(n),t.push(e))}const n=LO(a[1],"stroke");if(n){const e=RO(n);e&&!r.has(e)&&(r.add(e),t.push(n))}}}const o=e.match(/<svg([^>]*)>/i);if(o&&o[1]){const e=o[1];for(const[i,o]of[["fill",/fill\s*=\s*["']([^"']*)["']/i],["stroke",/stroke\s*=\s*["']([^"']*)["']/i]]){const n=e.match(o);if(n&&n[1]){const e=RO(n[1]);e&&!r.has(e)&&(r.add(e),t.push(n[1]))}}const n=e.match(/style\s*=\s*["']([^"']*)["']/i);if(n&&n[1])for(const i of["fill","stroke"]){const e=LO(n[1],i);if(e){const n=RO(e);n&&!r.has(n)&&(r.add(n),t.push(e))}}}return t}(e);return{colors:t,fillsCount:NO(e),strokesCount:DO(e),hasGradient:zO(e),strokeWidth:UO(e)}}const HO=new Map,$O="https://public-api.streamlinehq.com/v1";const WO=({apiKey:e,customRequest:t,query:r,setQuery:n,inputRef:a})=>{var l,c,u,f,g,m,v,y,b;const{t:w}=kr(),[x,C]=o.useState(""),_=void 0!==r?r:x,k=void 0!==n?n:C,[E,I]=o.useState(""),[T,F]=o.useState("global"),[P,M]=o.useState(null),[R,L]=o.useState(null),[N,D]=o.useState(null),[z,B]=o.useState(null),[V,H]=o.useState([]),[$,W]=o.useState(0),[G,q]=o.useState(!1),[Y,X]=o.useState(!1),[K,Z]=o.useState(null),[J,Q]=o.useState({}),[ee,te]=o.useState({}),[re,ne]=o.useState({}),[ie,oe]=o.useState("#000000"),[ae,se]=o.useState("#ff007a"),[le,ce]=o.useState("#00C2FF"),[ue,de]=o.useState(1),[he,fe]=o.useState(50),[pe,ge]=o.useState(!0),[me,ve]=o.useState(!0),[ye,be]=o.useState(!1),we=ti(),{options:xe}=we,Ce=o.useRef(null),_e=o.useRef(!1),Se=o.useRef(null),Ae=o.useRef(0),ke=o.useRef(!1),Ee=o.useRef(null),Ie=o.useRef(null===(l=null==xe?void 0:xe.config)||void 0===l?void 0:l.handleTranslate),je=o.useRef(null===(c=null==xe?void 0:xe.config)||void 0===c?void 0:c.locale);o.useEffect(()=>{var e,t;Ie.current=null===(e=null==xe?void 0:xe.config)||void 0===e?void 0:e.handleTranslate,je.current=null===(t=null==xe?void 0:xe.config)||void 0===t?void 0:t.locale},[null===(u=null==xe?void 0:xe.config)||void 0===u?void 0:u.handleTranslate,null===(f=null==xe?void 0:xe.config)||void 0===f?void 0:f.locale]);const Te=o.useRef(null),Fe=o.useRef(null),Oe=o.useRef(null),[Pe,Me]=o.useState(new Set),Re=null!==(m=null===(g=null==xe?void 0:xe.config)||void 0===g?void 0:g.STREAMLINE_API_KEY)&&void 0!==m?m:"3pAQQzwUNMmcgSr2.f4eb08cd5886d44b1fc6a701a3ba797c",Le=null===(v=null==xe?void 0:xe.config)||void 0===v?void 0:v.handleProxyUrl,Ne=async e=>Le?Promise.resolve(Le(e)):e,De=async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{imagePreviewUrl:await Ne(e.imagePreviewUrl)}))),{performSearch:ze,fetchSvgDataUrl:Be,fetchPngDataUrl:Ue,normalizeSvgForCss:Ve}=function(e,t,r,n){const i=o.useMemo(()=>t&&"string"==typeof t?t.replace(/\/$/,""):"/streamline",[t]),a=async e=>r?Promise.resolve(r(e)):e,s=null==n?void 0:n.trim(),l=o.useCallback(async e=>r?a(function(e){const{mode:t,q:r,offset:n,limit:i,familySlug:o,style:a}=e,s=new URLSearchParams;"global"===t&&(s.set("productType","icons"),s.set("productTier","free")),s.set("query",r),s.set("offset",String(n)),s.set("limit",String(i)),a&&s.set("style",a);const l="global"===t?"search/global":`search/family/${encodeURIComponent(o||"")}`;return`${$O}/${l}?${s.toString()}`}(e)):function(e,t){const{mode:r,q:n,offset:i,limit:o,familySlug:a,style:s}=t,l="global"===r?"search/global":`search/family/${encodeURIComponent(a||"")}`,c=new URL(`${e}/${l}`,window.location.origin);return"global"===r&&(c.searchParams.set("productType","icons"),c.searchParams.set("productTier","free")),c.searchParams.set("query",n),c.searchParams.set("offset",String(i)),c.searchParams.set("limit",String(o)),s&&c.searchParams.set("style",s),c.toString().replace(window.location.origin,"")}(i,e),[i,r]),c=o.useCallback(async e=>{var t;const r=await l({mode:e.mode,q:e.query.trim(),offset:e.offset,limit:e.limit,familySlug:e.familySlug,style:null!==(t=e.style)&&void 0!==t?t:null}),n={Accept:"application/json"};s&&(n["x-api-key"]=s);const i=await fetch(r,{method:"GET",headers:n,signal:e.signal});if(!i.ok){const e=await i.text();throw new Error(`Request failed: ${i.status} ${e}`)}return await i.json()},[l,s]),u=o.useCallback((e,t)=>{let r=e;const n=/<linearGradient[\s\S]*?<\/linearGradient>/i.test(r)||/<radialGradient[\s\S]*?<\/radialGradient>/i.test(r);if(!/fill="url\(#/i.test(r)&&!/stroke="url\(#/i.test(r)){const e=function(e){var t,r,n,i,o,a,s,l;const c=new Map,u={v:1},d=e=>{const t=RO(e);t&&!c.has(t)&&(c.set(t,u.v),u.v=Math.min(u.v+1,3))},h=e.match(/<svg([^>]*)>/i);if(null==h?void 0:h[1]){const e=h[1],t=e.match(/fill\s*=\s*["']([^"']*)["']/i),r=e.match(/stroke\s*=\s*["']([^"']*)["']/i);!(null==t?void 0:t[1])||/^none$/i.test(t[1])||/^url\(#/i.test(t[1])||d(t[1]),!(null==r?void 0:r[1])||/^none$/i.test(r[1])||/^url\(#/i.test(r[1])||d(r[1])}const f=new RegExp(`<(?:${MO})([^>]*)>`,"gi");let p;for(;null!==(p=f.exec(e));){const e=p[1],c=e.match(/fill\s*=\s*["']([^"']*)["']/i),u=e.match(/style\s*=\s*["']([^"']*)["']/i),h=null===(t=null==u?void 0:u[1])||void 0===t?void 0:t.match(/fill\s*:\s*([^;]+)/i),f=null===(i=null!==(r=null==c?void 0:c[1])&&void 0!==r?r:null===(n=null==h?void 0:h[1])||void 0===n?void 0:n.trim())||void 0===i?void 0:i.trim();!f||/^none$/i.test(f)||/^url\(#/i.test(f)||d(f);const g=e.match(/stroke\s*=\s*["']([^"']*)["']/i),m=e.match(/style\s*=\s*["']([^"']*)["']/i),v=null===(o=null==m?void 0:m[1])||void 0===o?void 0:o.match(/stroke\s*:\s*([^;]+)/i),y=null===(l=null!==(a=null==g?void 0:g[1])&&void 0!==a?a:null===(s=null==v?void 0:v[1])||void 0===s?void 0:s.trim())||void 0===l?void 0:l.trim();!y||/^none$/i.test(y)||/^url\(#/i.test(y)||d(y)}return c}(r),t=t=>{const r=RO(t),n=r?e.get(r):void 0;return 1===n?"var(--icon-color-1)":2===n?"var(--icon-color-2)":3===n?"var(--icon-color-3)":"currentColor"};r=r.replace(/<svg([^>]*)>/i,(e,r)=>{let n=r;const i=r.match(/fill\s*=\s*["']([^"']*)["']/i);!(null==i?void 0:i[1])||/^none$/i.test(i[1])||/^url\(#/i.test(i[1])||(n=n.replace(/fill\s*=\s*["'][^"']*["']/i,`fill="${t(i[1])}"`));const o=r.match(/stroke\s*=\s*["']([^"']*)["']/i);return!(null==o?void 0:o[1])||/^none$/i.test(o[1])||/^url\(#/i.test(o[1])||(n=n.replace(/stroke\s*=\s*["'][^"']*["']/i,`stroke="${t(o[1])}"`)),`<svg${n}>`}),r=r.replace(/<(path|rect|circle|ellipse|polygon|line|polyline)([^>]*?)(\/>|>)/gi,(e,r,n,i)=>{var o,a,s,l,c,u,d,h;let f=n;const p=n.match(/fill\s*=\s*["']([^"']*)["']/i),g=n.match(/style\s*=\s*["']([^"']*)["']/i),m=null===(o=null==g?void 0:g[1])||void 0===o?void 0:o.match(/fill\s*:\s*([^;]+)/i),v=null===(l=null!==(a=null==p?void 0:p[1])&&void 0!==a?a:null===(s=null==m?void 0:m[1])||void 0===s?void 0:s.trim())||void 0===l?void 0:l.trim();if(v&&!/^none$/i.test(v)&&!/^url\(#/i.test(v)){const e=t(v);p?f=f.replace(/fill\s*=\s*["'][^"']*["']/i,`fill="${e}"`):(null==g?void 0:g[1])&&(f=f.replace(/style\s*=\s*["']([^"']*)["']/i,(t,r)=>`style="${r.replace(/fill\s*:\s*[^;]+/gi,`fill: ${e}`)}"`))}const y=n.match(/stroke\s*=\s*["']([^"']*)["']/i),b=n.match(/style\s*=\s*["']([^"']*)["']/i),w=null===(c=null==b?void 0:b[1])||void 0===c?void 0:c.match(/stroke\s*:\s*([^;]+)/i),x=null===(h=null!==(u=null==y?void 0:y[1])&&void 0!==u?u:null===(d=null==w?void 0:w[1])||void 0===d?void 0:d.trim())||void 0===h?void 0:h.trim();if(x&&!/^none$/i.test(x)&&!/^url\(#/i.test(x)){const e=t(x);y?f=f.replace(/stroke\s*=\s*["'][^"']*["']/i,`stroke="${e}"`):(null==b?void 0:b[1])&&(f=f.replace(/style\s*=\s*["']([^"']*)["']/i,(t,r)=>`style="${r.replace(/stroke\s*:\s*[^;]+/gi,`stroke: ${e}`)}"`))}return`<${r}${f}${i}`})}return n&&(r=r.replace(/<linearGradient([^>]*?)>([\s\S]*?)<\/linearGradient>/gi,(e,t,r)=>{let n=0;return`<linearGradient${t}>${r.replace(/<stop([^>]*?)>/gi,(e,t)=>{const r=0===n?"var(--icon-grad-1)":"var(--icon-grad-2)";return n+=1,/stop-color\s*=/.test(t)?"<stop"+t.replace(/stop-color="[^"]*"/i,'stop-color="'+r+'"')+">":"<stop"+t+' stop-color="'+r+'">'})}</linearGradient>`}),r=r.replace(/<radialGradient([^>]*?)>([\s\S]*?)<\/radialGradient>/gi,(e,t,r)=>{let n=0;return`<radialGradient${t}>${r.replace(/<stop([^>]*?)>/gi,(e,t)=>{const r=0===n?"var(--icon-grad-1)":"var(--icon-grad-2)";return n+=1,/stop-color\s*=/.test(t)?"<stop"+t.replace(/stop-color="[^"]*"/i,'stop-color="'+r+'"')+">":"<stop"+t+' stop-color="'+r+'">'})}</radialGradient>`})),"number"!=typeof(null==t?void 0:t.strokeWidth)||Number.isNaN(t.strokeWidth)||(/stroke-width\s*=\s*["'][^"']*["']/i.test(r)&&(r=r.replace(/stroke-width\s*=\s*["'][^"']*["']/gi,`stroke-width="${t.strokeWidth}"`)),/stroke-width\s*:/.test(r)&&(r=r.replace(/stroke-width\s*:\s*[^;]+/gi,`stroke-width: ${t.strokeWidth}`)),/stroke-width/i.test(r)||(r=r.replace(/<svg/,`<svg stroke-width="${t.strokeWidth}"`))),r=r.replace(/<svg([^>]*)>/i,(e,t)=>`<svg${t.replace(/\swidth="[^"]*"/i,"").replace(/\sheight="[^"]*"/i,"")} width="100%" height="100%">`),r},[]),d=o.useCallback(async(t,n)=>{const o=[t,e?"css=1":"css=0",(null==n?void 0:n.colors)?`c=${n.colors}`:"",(null==n?void 0:n.backgroundColor)?`bg=${n.backgroundColor}`:"",null!=(null==n?void 0:n.strokeWidth)?`sw=${n.strokeWidth}`:"",null!=(null==n?void 0:n.size)?`s=${n.size}`:"",null!=(null==n?void 0:n.responsive)?`r=${n.responsive}`:"",null!=(null==n?void 0:n.strokeToFill)?`sf=${n.strokeToFill}`:""].filter(Boolean).join("|"),l=HO.get(o);if(l)return l;const c=await(async(e,t)=>{var n,o;const s=new URLSearchParams;(null==t?void 0:t.colors)&&s.set("colors",t.colors),(null==t?void 0:t.backgroundColor)&&s.set("backgroundColor",t.backgroundColor),null!=(null==t?void 0:t.strokeWidth)&&s.set("strokeWidth",String(t.strokeWidth)),s.set("size",String(null!==(n=null==t?void 0:t.size)&&void 0!==n?n:96)),s.set("responsive",String(null===(o=null==t?void 0:t.responsive)||void 0===o||o)),null!=(null==t?void 0:t.strokeToFill)&&s.set("strokeToFill",String(t.strokeToFill));const l=`${$O}/icons/${encodeURIComponent(e)}/download/svg?${s.toString()}`;if(r)return a(l);const c=new URL(`${i}/icons/${encodeURIComponent(e)}/download/svg`,window.location.origin);return s.forEach((e,t)=>c.searchParams.set(t,e)),c.toString().replace(window.location.origin,"")})(t,n),d={Accept:"image/svg+xml"};s&&(d["x-api-key"]=s);const h=await fetch(c,{method:"GET",headers:d,signal:null==n?void 0:n.signal});if(!h.ok){const e=await h.text();throw new Error(`SVG request failed: ${h.status} ${e}`)}let f=await h.text();const p=f;e&&!(null==n?void 0:n.colors)&&(f=u(f,{strokeWidth:null==n?void 0:n.strokeWidth}));const g={text:f,url:`data:image/svg+xml;utf8,${encodeURIComponent(f)}`,original:p};return HO.set(o,g),g},[i,u,e,r,a,s]),h=o.useCallback(async(e,t)=>{const n=await(async(e,t)=>{var n;const o=new URLSearchParams;o.set("size",String(null!==(n=null==t?void 0:t.size)&&void 0!==n?n:96)),(null==t?void 0:t.colors)&&o.set("colors",t.colors),(null==t?void 0:t.backgroundColor)&&o.set("backgroundColor",t.backgroundColor),null!=(null==t?void 0:t.strokeWidth)&&o.set("strokeWidth",String(t.strokeWidth));const s=`${$O}/icons/${encodeURIComponent(e)}/download/png?${o.toString()}`;if(r)return a(s);const l=new URL(`${i}/icons/${encodeURIComponent(e)}/download/png`,window.location.origin);return o.forEach((e,t)=>l.searchParams.set(t,e)),l.toString().replace(window.location.origin,"")})(e,t),o={Accept:"image/png"};s&&(o["x-api-key"]=s);const l=await fetch(n,{method:"GET",headers:o,signal:null==t?void 0:t.signal});if(!l.ok){const e=await l.text();throw new Error(`PNG request failed: ${l.status} ${e}`)}const c=await l.blob();return await new Promise((e,t)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>t(new Error("Failed to read PNG blob")),r.readAsDataURL(c)})},[i,r,a,s]);return{buildUrl:l,performSearch:c,fetchSvgDataUrl:d,fetchPngDataUrl:h,normalizeSvgForCss:u}}(me,null===(y=null==xe?void 0:xe.config)||void 0===y?void 0:y.STREAMLINE_BASE_URL,Le,Re),He=o.useMemo(()=>{if("family"!==T||0===V.length)return null;const e=new Set(V.map(e=>e.hash)),t=Object.keys(re).some(t=>e.has(t))?re:ee,r=V.map(e=>t[e.hash]).filter(e=>Boolean(e));return 0===r.length?null:function(e){const t=[],r=new Set;let n,i=0,o=0,a=!1;for(const s of e){i+=s.fillsCount,o+=s.strokesCount,s.hasGradient&&(a=!0);for(const e of s.colors){const n=RO(e);n&&!r.has(n)&&(r.add(n),t.push(e))}null==n&&null!=s.strokeWidth&&(n=s.strokeWidth)}return{colors:t,fillsCount:i,strokesCount:o,hasGradient:a,strokeWidth:n}}(r.map(e=>VO(e)))},[V,T,re,ee]);o.useMemo(()=>"family"===T&&(!!(null==He?void 0:He.hasGradient)||!!(P||"").toLowerCase().includes("gradient")),[He,P,T]);const $e=o.useMemo(()=>"family"===T&&V.some(e=>{const t=ee[e.hash];return t&&/var\(--icon-color-2\)/i.test(t)}),[V,T,ee]),We=o.useMemo(()=>"family"===T&&V.some(e=>{const t=ee[e.hash];return t&&/var\(--icon-color-3\)/i.test(t)}),[V,T,ee]),Ge=o.useMemo(()=>!!me&&!!He&&(He.hasGradient||He.colors.length>=2&&$e),[He,me,$e]),qe=o.useMemo(()=>!!me&&!!He&&He.colors.length>=3&&We,[He,me,We]);o.useEffect(()=>(_e.current=!0,()=>{var e,t,r;_e.current=!1;try{null===(e=Te.current)||void 0===e||e.abort(),null===(t=Fe.current)||void 0===t||t.abort(),null===(r=Oe.current)||void 0===r||r.abort()}catch(e){}}),[]);const Ye=o.useRef(_),Xe=o.useCallback(async e=>{var t,r,n,i,o,a,s,l;const c=null!==(r=null===(t=e.override)||void 0===t?void 0:t.query)&&void 0!==r?r:E;if(!c||0===c.trim().length)return;if(Y)return;if(!_e.current)return;null===(n=Te.current)||void 0===n||n.abort();const u=new AbortController;Te.current=u,X(!0);const d=e.initial?0:$,h=e.initial?30:20,f=null!==(o=null===(i=e.override)||void 0===i?void 0:i.mode)&&void 0!==o?o:T,p=null!==(s=null===(a=e.override)||void 0===a?void 0:a.familySlug)&&void 0!==s?s:P,g=c.trim();try{const t=await ze({mode:f,familySlug:p||null,query:g,offset:d,limit:h,style:N,signal:u.signal});if(!_e.current)return;if(e.initial)H(await De(t.results));else{const e=await De(t.results);H(t=>[...t,...e])}q(Boolean(null===(l=t.pagination)||void 0===l?void 0:l.hasMore)),W(d+h)}catch(e){if("AbortError"===(null==e?void 0:e.name))return;U.Ay.error(w("Request error"))}finally{_e.current&&X(!1)}},[E,P,Le,V,Y,T,$,ze,N,w]);o.useEffect(()=>{Ee.current=Xe},[Xe]),o.useEffect(()=>{if("family"===T){const e=window.setTimeout(()=>{ke.current=!1},100);return()=>window.clearTimeout(e)}ke.current=!1},[T]);const Ke=o.useCallback(async e=>{var t;if(!e||0===e.trim().length)return;const r=++Ae.current;let n=e.trim();if(Ie.current)try{n=await Ie.current(e,{locale:je.current})}catch(t){n=e}r===Ae.current&&(F("global"),M(null),B(null),H([]),q(!1),W(0),Z(null),Me(new Set),I(n),await(null===(t=Ee.current)||void 0===t?void 0:t.call(Ee,{initial:!0,override:{query:n}})))},[]),Ze=o.useCallback(async()=>{_&&0!==_.trim().length&&await Ke(_)},[_,Ke]),Je=o.useCallback(()=>{Ae.current+=1,F("global"),M(null),L(null),B(null),D(null),I(""),H([]),q(!1),W(0),Z(null),Me(new Set),oe("#000000"),se("#ff007a"),ce("#00C2FF")},[]);o.useEffect(()=>{const e=Ye.current;e&&e.trim().length>=3&&Ke(e)},[]),o.useEffect(()=>{const e=_.trim();Se.current&&(window.clearTimeout(Se.current),Se.current=null),e.length<3?Je():Se.current=window.setTimeout(()=>{Ke(e)},700)},[_,N,Je,Ke]);const Qe=o.useCallback(()=>{ke.current||G&&!Y&&Xe({initial:!1})},[Xe,G,Y]),et=o.useCallback(e=>{if("global"===T){if(!e.familySlug||!E)return;return Se.current&&(window.clearTimeout(Se.current),Se.current=null),ke.current=!0,F("family"),M(e.familySlug),L(e.hash),B(e.categoryName||null),H([]),q(!1),W(0),Z(null),Me(new Set),oe("#000000"),se("#ff007a"),ce("#00C2FF"),void Xe({initial:!0,override:{mode:"family",familySlug:e.familySlug,query:E}})}Z(e.hash)},[E,Xe,T]),tt=o.useCallback(()=>{const e=E.trim();F("global"),M(null),L(null),B(null),H([]),q(!1),W(0),Z(null),Me(new Set),oe("#000000"),se("#ff007a"),ce("#00C2FF"),e&&Xe({initial:!0,override:{mode:"global",familySlug:null,query:e}})},[E,Xe]);o.useEffect(()=>{var e;if("family"!==T||0===V.length)return;const t=new Set(V.map(e=>e.hash));let r=V.map(e=>e.hash).filter(e=>!J[e]||!ee[e]);if(!R||t.has(R)||re[R]||(r=[R,...r]),0===r.length)return;let n=!1;null===(e=Fe.current)||void 0===e||e.abort();const i=new AbortController;return Fe.current=i,Promise.all(r.map(e=>Be(e,{colors:me?void 0:ie,strokeWidth:ue,size:he,responsive:pe,signal:i.signal}).then(t=>({h:e,r:t})).catch(()=>null))).then(e=>{if(n||!_e.current)return;const t={},r={},i={};e.forEach(e=>{e&&e.h&&e.r&&(t[e.h]=e.r.url,r[e.h]=e.r.text,e.r.original&&(i[e.h]=e.r.original))}),Object.keys(t).length>0&&Q(e=>Object.assign(Object.assign({},e),t)),Object.keys(r).length>0&&te(e=>Object.assign(Object.assign({},e),r)),Object.keys(i).length>0&&ne(e=>Object.assign(Object.assign({},e),i))}),()=>{n=!0,i.abort()}},[ie,R,Be,V,T,re,pe,he,ue,ee,J,me]),o.useEffect(()=>{if("family"!==T)return;if(0===V.length)return;const e=V.map(e=>e.hash),t={},r={};let n=!1;e.forEach(e=>{const i=re[e]||ee[e];if(!i)return;const o=Ve(i,{strokeWidth:"number"==typeof ue?ue:void 0});o&&o!==ee[e]&&(t[e]=o,r[e]=`data:image/svg+xml;utf8,${encodeURIComponent(o)}`,n=!0)}),n&&(Object.keys(t).length>0&&te(e=>Object.assign(Object.assign({},e),t)),Object.keys(r).length>0&&Q(e=>Object.assign(Object.assign({},e),r)))},[V,T,Ve,re,ue,ee]);const rt=o.useRef(null);o.useEffect(()=>{var e;if("family"!==T||0===V.length)return;const t=R&&re[R]?R:null===(e=V[0])||void 0===e?void 0:e.hash;if(!t||!re[t])return;if(rt.current===P)return;const r=re[t];if(!r)return;rt.current=P;const n=function(e){var t,r,n,i,o,a,s,l;const c=[],u=new Set,d=e=>{const t=RO(e);t&&!u.has(t)&&(u.add(t),c.push(e))},h=Array.from(e.matchAll(/<stop[^>]*?stop-color\s*=\s*["']([^"']+)["']/gi)).map(e=>e[1]);if(h.length>=2)return h.slice(0,3).forEach(e=>d(e)),c;const f=e.match(/<svg([^>]*)>/i);if(null==f?void 0:f[1]){const e=f[1],t=e.match(/fill\s*=\s*["']([^"']*)["']/i),r=e.match(/stroke\s*=\s*["']([^"']*)["']/i);!(null==t?void 0:t[1])||/^none$/i.test(t[1])||/^url\(#/i.test(t[1])||d(t[1]),!(null==r?void 0:r[1])||/^none$/i.test(r[1])||/^url\(#/i.test(r[1])||d(r[1])}const p=new RegExp(`<(?:${MO})([^>]*)>`,"gi");let g;for(;null!==(g=p.exec(e));){const e=g[1],c=e.match(/fill\s*=\s*["']([^"']*)["']/i),u=e.match(/style\s*=\s*["']([^"']*)["']/i),h=null===(t=null==u?void 0:u[1])||void 0===t?void 0:t.match(/fill\s*:\s*([^;]+)/i),f=null===(i=null!==(r=null==c?void 0:c[1])&&void 0!==r?r:null===(n=null==h?void 0:h[1])||void 0===n?void 0:n.trim())||void 0===i?void 0:i.trim();!f||/^none$/i.test(f)||/^url\(#/i.test(f)||d(f);const p=e.match(/stroke\s*=\s*["']([^"']*)["']/i),m=e.match(/style\s*=\s*["']([^"']*)["']/i),v=null===(o=null==m?void 0:m[1])||void 0===o?void 0:o.match(/stroke\s*:\s*([^;]+)/i),y=null===(l=null!==(a=null==p?void 0:p[1])&&void 0!==a?a:null===(s=null==v?void 0:v[1])||void 0===s?void 0:s.trim())||void 0===l?void 0:l.trim();!y||/^none$/i.test(y)||/^url\(#/i.test(y)||d(y)}return c.slice(0,3)}(r),i=e=>{const t=(e||"").trim().match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);return t?"#"+(3===t[1].length?t[1].replace(/(.)/g,"$1$1"):t[1]).toLowerCase():function(e){var t;const r=e.trim();if(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(r)){const e=r.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})/);if(e)return"#"+(3===e[1].length?e[1].replace(/(.)/g,"$1$1"):e[1]).toLowerCase()}const n=r.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);if(n)return"#"+[1,2,3].map(e=>parseInt(n[e],10).toString(16).padStart(2,"0")).join("");const i=r.match(/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*[\d.]+\s*\)/);return i?"#"+[1,2,3].map(e=>parseInt(i[e],10).toString(16).padStart(2,"0")).join(""):null!==(t={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff"}[r.toLowerCase()])&&void 0!==t?t:RO(r)||"#000000"}(e)};n[0]&&oe(i(n[0])),n[1]&&se(i(n[1])),n[2]&&ce(i(n[2]))},[V,T,re,P,R]),o.useEffect(()=>{"family"!==T&&(rt.current=null)},[T]);const nt=o.useRef(null);o.useEffect(()=>{if("family"!==T||!P||0===V.length)return;const e=V[0];if(!e||!re[e.hash])return;if(nt.current===P)return;const t=re[e.hash];if(!t)return;const r=VO(t);"number"==typeof r.strokeWidth&&r.strokeWidth>0&&(nt.current=P,de(r.strokeWidth))},[V,T,re,P]),o.useEffect(()=>{"family"!==T&&(nt.current=null)},[T]);const it=o.useCallback(e=>function(e,t){const{colorHex:r,colorHex2:n,colorHex3:i}=t,o=[`--icon-grad-1: ${r}`,`--icon-grad-2: ${n}`,`--icon-stroke-1: ${r}`,`--icon-stroke-2: ${n}`,`--icon-stroke-3: ${i}`,`--icon-fill-1: ${r}`,`--icon-fill-2: ${n}`,`--icon-fill-3: ${i}`,`color: ${r}`].join(";");let a=e.replace(/<svg([^>]*)>/i,(e,t)=>{let r=t;return/style="/i.test(r)?r=r.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};${o}"`):r+=` style="${o}"`,`<svg${r}>`});return a=a.replace(/var\(--icon-color-1\)/g,r).replace(/var\(--icon-color-2\)/g,n).replace(/var\(--icon-color-3\)/g,i).replace(/var\(--icon-fill-1\)/g,r).replace(/var\(--icon-fill-2\)/g,n).replace(/var\(--icon-fill-3\)/g,i).replace(/var\(--icon-stroke-1\)/g,r).replace(/var\(--icon-stroke-2\)/g,n).replace(/var\(--icon-stroke-3\)/g,i).replace(/var\(--icon-grad-1\)/g,r).replace(/var\(--icon-grad-2\)/g,n).replace(/currentColor/g,r),a}(e,{colorHex:ie,colorHex2:ae,colorHex3:le}),[ie,ae,le]),ot=o.useCallback(e=>{Me(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]),at=o.useCallback(()=>{Me(new Set)},[]),st=o.useMemo(()=>{if(1===Pe.size){const[e]=Array.from(Pe);return V.find(t=>t.hash===e)||null}return 0===Pe.size&&K&&V.find(e=>e.hash===K)||null},[V,K,Pe]),lt=o.useCallback((e,t="image/png")=>{try{const r=e.split(",");if(r.length<2)return new Blob([],{type:t});const n=r[1]||"",i=atob(n),o=new Array(i.length);for(let e=0;e<i.length;e+=1)o[e]=i.charCodeAt(e);const a=new Uint8Array(o);return new Blob([a],{type:t})}catch(e){return new Blob([],{type:t})}},[]),ct=o.useCallback(async(e,t)=>{try{const r=async e=>{const t="family"===T?it(e):e,r=function(e,t){const r=e.match(/\swidth="([0-9.]+)(px)?"/i),n=e.match(/\sheight="([0-9.]+)(px)?"/i);if(r&&n){const e=parseFloat(r[1]),i=parseFloat(n[1]);if(Number.isFinite(e)&&Number.isFinite(i)&&e>0&&i>0){const r=e/i;return r>=1?{width:t,height:Math.max(1,Math.round(t/r))}:{width:Math.max(1,Math.round(t*r)),height:t}}}const i=e.match(/viewBox="([^"]+)"/i);if(i){const e=i[1].trim().split(/\s+/);if(4===e.length){const r=parseFloat(e[2]),n=parseFloat(e[3]);if(Number.isFinite(r)&&Number.isFinite(n)&&r>0&&n>0){const e=r/n;return e>=1?{width:t,height:Math.max(1,Math.round(t/e))}:{width:Math.max(1,Math.round(t*e)),height:t}}}}return{width:t,height:t}}(t,he);return async function(e,t,r){const n=new Blob([e],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(n);try{const e=new Image;return await new Promise((n,o)=>{e.onload=()=>{const i=document.createElement("canvas"),a=Math.max(1,Math.round(2*t)),s=Math.max(1,Math.round(2*r));i.width=a,i.height=s;const l=i.getContext("2d");l?(l.clearRect(0,0,a,s),l.drawImage(e,0,0,a,s),n(i.toDataURL("image/png"))):o(new Error("Canvas 2D context is not available"))},e.onerror=()=>o(new Error("Failed to load SVG image")),e.src=i})}finally{URL.revokeObjectURL(i)}}(t,r.width,r.height)},n=async e=>{const n=await Be(e,{colors:me?void 0:ie,strokeWidth:"number"==typeof ue?ue:void 0,size:he,responsive:pe,signal:t}),i=n.original||n.text;return r(i)};if("family"!==T)try{return await Ue(e.hash,{size:he,colors:me?void 0:ie,strokeWidth:"number"==typeof ue?ue:void 0,signal:t})}catch(t){return e.hash?await n(e.hash):null}const i=ee[e.hash]||re[e.hash];return i?r(i):e.hash?await n(e.hash):null}catch(e){return null}},[it,ie,Be,Ue,T,re,pe,he,ue,ee,me]),ut=o.useCallback(async e=>{var r;try{if(!_e.current)return;be(!0),null===(r=Oe.current)||void 0===r||r.abort();const n=new AbortController;Oe.current=n;const i=await ct(e,n.signal);if(!_e.current||!i)return;await Promise.resolve(t(i))}catch(e){U.Ay.error(w("Request error"))}finally{_e.current&&be(!1)}},[t,ct,w]);o.useCallback(()=>{var e;Z(null),at();const t=null===(e=null==xe?void 0:xe.config)||void 0===e?void 0:e.onClose;"function"==typeof t&&t()},[at,xe]);const{isCopyIconsModalVisible:dt,isCopyLoading:ht,copyForm:ft,openCopyModal:pt,closeCopyModal:gt,resetAfterClose:mt,handleCopyTreeSelect:vt,handleIconsCopyOk:yt,fetchChildFolders:bt,generateMenuItemsFromFolders:wt,handleCreateFolderAndCopy:xt}=(({items:e,selectedHashes:t,getPngDataUrlForItem:r,dataUrlToBlob:n,clearSelection:i})=>{const{t:a}=kr(),{options:s,state:l}=ti(),c=oi(),[u,h]=o.useState(!1),[f]=d.A.useForm(),[p,g]=o.useState(!1),m=o.useRef(!1),{state:v,actions:{fetchFolders:y,fetchChildFolders:b,handleModalOk:w}}=Ii(),{EmptyFolderIcon:x}=ca(),{activeFormField:C,setActiveFormField:_,generateMenuItemsFromFolders:S}=_a({folders:Array.isArray(v.folders)?v.folders:[],selectedFolder:l.selectedFolder,EmptyFolderIcon:x,handleCreateFolderModalOk:w,setIsLoading:g,t:a}),A=o.useCallback(async()=>{await y(),h(!0)},[y]),k=o.useCallback(async e=>{e.length>0&&(f.setFieldsValue({targetFolder:e[0]}),C!==e[0].toString()&&_(""))},[C,f,_]),E=o.useCallback(async o=>{var u,d;try{const{dataProviders:d}=s;if(!d||!d.uploadFile&&!d.uploadFiles)return void c.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:a("API-endpoint for file upload is not configured"),placement:"bottomRight"});const h=o||(null==l?void 0:l.selectedFolder)||void 0,f=Array.from(t);if(0===f.length)return;const p=null!==(u=d.uploadFile)&&void 0!==u?u:async e=>{var t,r,n;if(!d.uploadFiles)throw new Error("Upload is not supported by data provider");const i=await d.uploadFiles({folderId:e.folderId,items:[{name:e.name,size:e.size,type:e.type,folderId:e.folderId,data:e.data,extension:e.extension}]}),o=null===(t=null==i?void 0:i.detailed)||void 0===t?void 0:t[0];if(!i||!i.success||!o||!1===o.success){const e=(null===(r=null==o?void 0:o.error)||void 0===r?void 0:r.message)||(null===(n=null==i?void 0:i.error)||void 0===n?void 0:n.message)||"Upload failed";throw new Error(e)}return o.data},{successCount:g,failCount:m}=await async function(e){var t;const{hashes:r,items:n,folderId:i,dataProviders:o,getPngDataUrlForItem:a,dataUrlToBlob:s}=e;let l=0,c=0;for(const u of r){const r=n.find(e=>e.hash===u);if(!r){c+=1;continue}const d=await a(r);if(!d){c+=1;continue}const h=`${(null===(t=r.name)||void 0===t?void 0:t.trim())||`icon-${u}`}.png`,f=s(d,"image/png");try{await o.uploadFile({name:h,size:f.size,type:"image/png",folderId:i,data:f,extension:"png"}),l+=1}catch(e){c+=1}}return{successCount:l,failCount:c}}({hashes:f,items:e,folderId:h,dataProviders:{uploadFile:p},getPngDataUrlForItem:r,dataUrlToBlob:n});g>0&&c.success({id:"FILES_COPY_SUCCESS",message:a("Files copied"),placement:"bottomRight",data:{successCount:g,totalCount:f.length,itemIds:f,folderId:null!=h?h:null}}),m>0&&c.error({id:"FILES_COPY_ERROR",message:a("\u041f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438"),placement:"bottomRight",data:{failCount:m,totalCount:f.length,itemIds:f,folderId:null!=h?h:null}}),i()}catch(e){c.error({id:"FILES_COPY_ERROR",message:a("\u041f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438"),placement:"bottomRight",innerException:e,data:{failCount:Array.from(t).length||0,totalCount:Array.from(t).length||0,itemIds:Array.from(t),folderId:null!==(d=null==l?void 0:l.selectedFolder)&&void 0!==d?d:null}})}},[i,n,r,e,c,s,t,null==l?void 0:l.selectedFolder,a]),I=o.useCallback(()=>{p||m.current||(h(!1),_(""),g(!1))},[p,_]),j=o.useCallback(()=>{_(""),g(!1)},[_]),T=o.useCallback(async e=>{if(!m.current){m.current=!0,g(!0);try{await E(null!=e?e:null),h(!1),_("")}finally{m.current=!1,g(!1)}}},[E,_]),F=o.useCallback(()=>{var e;const t=null!==(e=l.selectedFolder)&&void 0!==e?e:"folders";_(t),f.setFieldsValue({folderName:a("New folder"),targetFolder:t})},[f,l.selectedFolder,_,a]);return{isCopyIconsModalVisible:u,isCopyLoading:p,copyForm:f,openCopyModal:A,closeCopyModal:I,resetAfterClose:j,handleCopyTreeSelect:k,handleIconsCopyOk:T,handleCreateFolderAndCopy:F,fetchChildFolders:b,generateMenuItemsFromFolders:S}})({items:V,selectedHashes:Pe,getPngDataUrlForItem:ct,dataUrlToBlob:lt,clearSelection:at});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:`${IO.iconsTab} ${E.trim()?IO.hasSearch:""}`,children:[E.trim()&&(V.length>0||Y)&&Pe.size>0?(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:IO.iconsHeaderContainer,children:[(0,i.jsxs)("div",{className:IO.iconsHeaderContainerLeft,children:[(0,i.jsxs)(p.A.Text,{type:"secondary",children:[Pe.size," ",w("selected")]}),(0,i.jsx)(S.Ay,{icon:(0,i.jsx)(Hn,{size:16}),onClick:at,children:w("Deselected")})]}),(0,i.jsx)(A.A,{children:(0,i.jsx)(S.Ay,{icon:(0,i.jsx)(jn,{size:16}),onClick:pt,children:w("Copy to folder")})})]})}):(0,i.jsx)(TO,{query:_,onQueryChange:k,onSubmit:Ze,styleFilter:N,onStyleChange:D,hasResults:V.length>0||Y,inputRef:a}),"family"===T?(0,i.jsx)(FO,{mode:T,familySlug:P,categoryName:z,colorHex:ie,setColorHex:oe,colorHex2:ae,setColorHex2:se,colorHex3:le,setColorHex3:ce,sizePx:he,setSizePx:fe,strokeWidth:ue,setStrokeWidth:de,responsiveSvg:pe,setResponsiveSvg:ge,useCssColor:me,setUseCssColor:ve,showSecondColor:Ge,showThirdColor:qe,styleFilter:N,onBack:tt}):null,(0,i.jsx)(PO,{items:V,hasMore:G,loading:Y,hasQuery:Boolean(E.trim()),mode:T,selectedHash:K,onLoadMore:Qe,onItemClick:et,onInsert:ut,scrollContainerRef:Ce,colorVars:{colorHex:ie,colorHex2:ae,colorHex3:le},svgTextMap:ee,previewSize:he,selectedHashes:Pe,onToggleSelect:ot}),st?(0,i.jsxs)("div",{className:IO.iconsBottomBar,children:[(0,i.jsx)(O.A,{className:"zero-divider"}),(0,i.jsx)("div",{className:IO.iconsBottomBarContent,children:(0,i.jsx)(A.A,{children:(0,i.jsx)(S.Ay,{size:"large",type:"primary",style:{height:40},loading:ye,onClick:()=>ut(st),children:w("Choose")})})})]}):null]}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:w("Copy to folder")}),open:dt,onCancel:()=>{ht||gt()},maskClosable:!ht,closable:!ht,keyboard:!ht,footer:(0,i.jsxs)("div",{className:xa.formFooter,children:[(0,i.jsxs)(S.Ay,{className:xa.folderButton,onClick:xt,loading:ht,children:[(0,i.jsx)(Mn,{size:18,strokeWidth:null===(b=xe.config)||void 0===b?void 0:b.iconStrokeWidth}),w("Create folder")]}),(0,i.jsx)(S.Ay,{type:"primary",className:xa.folderButton,onClick:()=>{gt()},loading:ht,children:w("Done")})]}),afterClose:()=>mt(),children:(0,i.jsxs)("div",{className:IO.copyToFolderModalBody,children:[ht?(0,i.jsx)("div",{className:IO.copyToFolderModalLoadingOverlay,children:(0,i.jsx)(s.A,{size:"large"})}):null,(0,i.jsx)(d.A,{form:ft,layout:"vertical",initialValues:{targetFolder:"folders",folderName:w("New folder"),is_force_create:!1},children:(0,i.jsxs)("div",{className:xa.foldersWrapper,children:[(0,i.jsx)(d.A.Item,{name:"targetFolder",rules:[{required:!0,message:w("Select the destination folder")}],className:xa.formItem,children:(0,i.jsx)(ba,{onSelect:vt,generateMenuItems:()=>wt({targetForm:ft,onTreeSelect:vt,onComplete:yt,actionButtonText:w("Copy here")}),fetchChildFolders:bt,disabledFolders:[],mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),(0,i.jsx)(d.A.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(w("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{})}),(0,i.jsx)(d.A.Item,{name:"is_force_create",style:{display:"none"},children:(0,i.jsx)(h.A,{})})]})})]})})]})},{Sider:GO,Content:qO}=R.A,YO={keywords:""},XO=()=>{var e,t,r,n,a;const l=Ii(),c=(()=>{const{state:e}=ti(),{files:t,loading:r,isUrlModalVisible:n}=e,i=Co(),a=(()=>{const{state:e,actions:t}=ti(),{selectedFiles:r,files:n,multiSelect:i}=e,{setSelectedFiles:a}=t,s=(0,o.useRef)(null),l=(0,o.useCallback)((e,t,r)=>{const i=Array.isArray(n)?n:[],o=i.findIndex(t=>t.id===e),a=i.findIndex(e=>e.id===t);if(-1===o||-1===a)return r;const[s,l]=o<a?[o,a]:[a,o],c=i.slice(s,l+1).map(e=>e.id),u=new Set(r);return c.forEach(e=>u.add(e)),u},[n]),c=(0,o.useCallback)((e,t)=>{if(!r||!a)return;const n=!1!==i,o=!!(null==t?void 0:t.shiftKey)&&n,c=!!(null==t?void 0:t.metaKey)||!!(null==t?void 0:t.ctrlKey)||!!(null==t?void 0:t.forceToggle);if(!n)return s.current=e,void a(new Set([e]));if(o&&s.current){const t=c?new Set(r):new Set;return void a(l(s.current,e,t))}if(o&&!s.current)return s.current=e,void a(new Set([e]));if(c){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),s.current=e,void a(t)}s.current=e,a(new Set([e]))},[i,r,a,l]);return{state:{selectedFiles:r||new Set},actions:{toggleFileSelection:c}}})(),s=Eo(i.fetchFiles);return{state:{files:t||[],selectedFiles:a.state.selectedFiles,loading:r||!1,isAddingFileByUrl:n||!1,isRenamingFile:s.state.isRenamingFile,fileToRename:s.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:a.actions.toggleFileSelection,showRenameModal:s.actions.showRenameModal,handleRenameCancel:s.actions.handleRenameCancel,handleRenameOk:s.actions.handleRenameOk,showMoveModal:s.actions.showMoveModal,handleMoveCancel:s.actions.handleMoveCancel,handleMoveOk:s.actions.handleMoveOk,showCopyModal:s.actions.showCopyModal,handleCopyCancel:s.actions.handleCopyCancel,handleCopyOk:s.actions.handleCopyOk,showDeleteConfirm:s.actions.showDeleteConfirm,handleDeleteConfirmCancel:s.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:s.actions.handleDeleteConfirmOk}}})(),u=(()=>{var e,t;const{state:r,actions:n,options:i}=ti(),{selectedFolder:a,pathHistory:s,folders:l}=r,{t:c}=kr(),{setSelectedFolder:u,setPathHistory:d}=n,h=(0,o.useCallback)(()=>{var e;return`em_fm:lastFolder:${(null===(e=null==i?void 0:i.config)||void 0===e?void 0:e.projectId)||"default"}`},[null===(e=null==i?void 0:i.config)||void 0===e?void 0:e.projectId]),f=(0,o.useCallback)((e,t=new Set)=>{if(t.has(e))return[];const r=(Array.isArray(l)?l:[]).find(t=>t.id===e);if(!r)return[];const n=new Set(t);return n.add(e),r.parentId?r.parentId===r.id?[{id:r.id,name:r.name+" (\u043e\u0448\u0438\u0431\u043a\u0430)"}]:[...f(r.parentId,n),{id:r.id,name:r.name}]:[{id:r.id,name:r.name}]},[l]),p=(0,o.useCallback)(e=>{var t;if("undefined"==typeof window)return;const r=!0===(null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.rememberLastFolder),n=h();try{if(!r)return void localStorage.removeItem(n);e?localStorage.setItem(n,e):localStorage.removeItem(n)}catch(e){}},[h,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.rememberLastFolder]),g=(0,o.useCallback)(e=>{if("folders"===e){const e=[{id:"folders",name:c("Folders")}];return null==d||d(e),void(i.onPathChange&&i.onPathChange([]))}if(!(Array.isArray(l)?l:[]).find(t=>t.id===e))return;const t=f(e),r=[{id:"folders",name:c("Folders")},...t];null==d||d(r),i.onPathChange&&i.onPathChange(r.map(e=>e.name))},[l,f,d,i,c]),m=(0,o.useCallback)(e=>{const t="folders"===e?null:e;t!==a&&(null==u||u(t),p(t),g(e))},[p,a,u,g]),v=(0,o.useCallback)(e=>{if(-1===e)null==u||u(null),null==d||d([{id:"folders",name:c("Folders")}]),i.onPathChange&&i.onPathChange([]);else{const t=s.slice(0,e+1),r=t[t.length-1],n="folders"===r.id?void 0:r.id;null==u||u(n||null),null==d||d(t),i.onPathChange&&i.onPathChange(t.map(e=>e.name))}},[i,s,d,u,c]),y=(0,o.useCallback)(e=>{if(!e.isFolder)return;null==u||u(e.id);const t={id:e.id,name:e.name};if(d){const e=[...s,t];d(e)}if(i.onPathChange){const t=[...s.map(e=>e.name),e.name];i.onPathChange(t)}},[i,s,d,u]);return{state:{selectedFolder:a,pathHistory:s},actions:{handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y},selectedFolder:a,pathHistory:s,handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y}})(),d=(()=>{const{state:e,actions:t}=ti(),{pagination:r}=e,{setPagination:n}=t,i=(0,o.useCallback)((e,t)=>{const i=t||r.pageSize;null==n||n({current:e,pageSize:i,total:r.total})},[r.pageSize,r.total,n]);return{state:{pagination:r},actions:{handlePaginationChange:i}}})(),h=(()=>{const[e,t]=o.useState(()=>{const e=localStorage.getItem(Io);return e?Math.max(290,parseInt(e,10)):298}),[r,n]=o.useState(!1),[i,a]=o.useState(!1),[s,l]=o.useState(0),c=o.useCallback(()=>{t(298),localStorage.setItem(Io,298..toString())},[]),u=o.useCallback(r=>{r.preventDefault(),r.stopPropagation(),n(!0),document.body.classList.add("resizing");const i=r.clientX,o=e;let s=o;const c=e=>{e.preventDefault();const r=Math.max(Math.min(o+e.clientX-i,600),290);s=r,t(r),l(e.clientX),a(!0)},u=()=>{n(!1),document.body.classList.remove("resizing"),a(!1),localStorage.setItem(Io,s.toString()),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)},[e]);return o.useEffect(()=>()=>{document.body.classList.remove("resizing")},[]),{sidebarWidth:e,isResizing:r,showResizeGuide:i,resizeGuidePosition:s,handleResizeStart:u,handleDoubleClick:c}})(),f=(()=>{const[e,t]=(0,o.useState)([]),[r,n]=(0,o.useState)(!1),[i,a]=(0,o.useState)(!1),s=(0,o.useRef)(0),l=(0,o.useRef)(new Map),c=(0,o.useCallback)(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),u=(0,o.useCallback)(e=>li(e.size),[]),d=(0,o.useCallback)((e,r)=>{const i=r.map(t=>({id:c(),folderId:e,name:t.name,size:u(t),status:"uploading",progress:0}));return t(i),n(!0),a(!1),i.map(e=>e.id)},[c,u]),h=(0,o.useCallback)((e,r)=>{const i={id:c(),folderId:e,name:r,size:void 0,status:"uploading",progress:0};return t(e=>[...e,i]),n(!0),a(!1),i.id},[c]),f=(0,o.useCallback)((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,r))}):t))},[]),p=(0,o.useCallback)((e,r)=>{r&&l.current.set(e,r),t(t=>t.map(t=>{if(t.id===e){const e=Object.assign(Object.assign({},t),{status:"success",progress:100});return(null==r?void 0:r.size)&&void 0===t.size&&(e.size=li(r.size)),e}return t}))},[]),g=(0,o.useCallback)((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:r}):t))},[]),m=(0,o.useCallback)(()=>{n(!1),a(!1),setTimeout(()=>{t([]),l.current.clear()},300)},[]),v=(0,o.useCallback)(()=>{a(e=>!e)},[]),y=(0,o.useCallback)(e=>l.current.get(e),[]),b=e.length,w=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:r,isUploadMinimized:i,totalFiles:b,completedFiles:w,startUpload:d,startUploadByUrl:h,updateProgress:f,markAsSuccess:p,markAsError:g,getUploadedFile:y,closeUpload:m,minimizeUpload:v}})(),p=Co(),{deleteItems:g}=ji(),m=oi(),{t:v}=kr(),{options:y,state:b}=ti(),w=null==y?void 0:y.config,{dataProviders:x}=y,{DropZoneFileIcon:C}=ca(),[_,A]=(0,o.useState)(!1),[k,E]=(0,o.useState)(!1),[I,j]=(0,o.useState)(!1),T=(0,o.useRef)(0),F=(0,o.useRef)(!1);F.current=k;const P=o.useRef(null),M=o.useRef([]),[L,N]=(0,o.useState)(!1),[D,z]=(0,o.useState)(!1),{folders:B,loading:U}=l.state,{fetchFolders:V,fetchChildFolders:H,handleCreateFolder:$,handleModalOk:W,handleModalCancel:G,generateMenuItems:q}=l.actions,Y=(e=>{var t;const{state:r,actions:n,options:i}=ti(),{t:a}=kr(),s=oi(),{folders:l,folderToRename:c,renameFolderForm:u,isRenameFolderModalVisible:d}=r,{setFolderToRename:h,setIsRenameFolderModalVisible:f}=n,{apiEndpoints:p,dataProviders:g,config:m}=i,v=(0,o.useCallback)(e=>{null==h||h(e),null==f||f(!0);const t=null==l?void 0:l.find(t=>t.id===e);t&&u&&u.setFieldsValue({newFolderName:t.name})},[h,f,l,u]),y=(0,o.useCallback)(()=>{null==f||f(!1),null==h||h(null),null==u||u.resetFields()},[f,h,u]),b=(0,o.useCallback)(async()=>{var t,r;if(c&&u)try{const i=await u.validateFields();if(!(null==i?void 0:i.newFolderName))return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:c,folderName:null==i?void 0:i.newFolderName,reason:"emptyName"}});if(!1===(null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder))return void s.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:a("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:null!=c?c:void 0,itemName:null==i?void 0:i.newFolderName}});if(!(null==g?void 0:g.renameFolder))throw new Error(a("renameFolder is not implemented in dataProviders"));const o=await g.renameFolder(c,i.newFolderName.trim());if(!(null==o?void 0:o.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:null!=c?c:void 0,itemName:i.newFolderName,error:{message:"invalidResponse"}}});s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:o.id,itemName:o.name,folderId:null!==(r=o.parentId)&&void 0!==r?r:null}}),y(),await e(),c!==o.id&&n.setSelectedFolder&&n.setSelectedFolder(o.id)}catch(e){s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:e,data:{itemId:null!=c?c:void 0,itemName:null==u?void 0:u.getFieldValue("newFolderName"),error:{message:e instanceof Error?e.message:String(e)}}})}},[c,u,p,y,e,a,null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder,s]);return{state:{isRenamingFolder:d||!1,folderToRename:c},actions:{showRenameFolderModal:v,handleRenameFolderCancel:y,handleRenameFolderOk:b}}})(V),{files:X,selectedFiles:K,loading:Z,isRenamingFile:J,fileToRename:Q}=c.state,{fetchFiles:ee,handleDeleteFile:te,handleDeleteFolder:re,handleAddFile:ne,handleAddFileByUrl:ie,toggleFileSelection:oe,showRenameModal:ae,handleRenameCancel:se,handleRenameOk:le,handleDroppedFiles:ce,showMoveModal:ue,handleMoveCancel:he,handleMoveOk:fe,handleCopyOk:pe,handleCopyCancel:ge,showDeleteConfirm:me,handleDeleteConfirmCancel:ve,handleDeleteConfirmOk:ye}=c.actions,{selectedFolder:be,pathHistory:we}=u.state,{handleFolderSelect:xe,handleBreadcrumbClick:Ce,handleItemClick:_e}=u.actions,{pagination:Se}=d.state,Ae=ii(ee),{searchTerm:ke,sortBy:Ee,sortOrder:Ie}=Ae.state,{handleSearch:je,handleSort:Te,handlePaginationChange:Fe}=Ae.actions,Oe=(0,o.useCallback)(async()=>{const e=(e=>yi(e))(we||[]);try{await xi({options:y,pathFolder:e,dataProviders:null==y?void 0:y.dataProviders})}catch(e){}await V(),await ee({folderId:be||"",page:Se.current,limit:Se.pageSize,search:ke,sortBy:Ee,sortOrder:Ie,itemType:"all"})},[ee,V,y,Se.current,Se.pageSize,we,ke,be,Ee,Ie]),Pe=(({files:e,selectedFiles:t,fetchFiles:r,selectedFolder:n})=>{const{t:i}=kr(),a=oi(),{options:s,actions:l,state:c}=o.useContext(ei),{setActiveLibraryItem:u}=l,{activeLibraryItem:d}=c,h=Co(),[f,p]=o.useState(!1),[g,m]=o.useState(null),v=o.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return Yt.includes(t)}const r=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!r&&Yt.includes(r)},[]),y=o.useCallback(async e=>{var t,r;const{dataProviders:n}=s;if(!1===(null===(r=null===(t=s.config)||void 0===t?void 0:t.features)||void 0===r?void 0:r.enableUpdateFile))throw new Ti(i("Updating files is disabled by configuration"),"UnsupportedOperation");if(!e.id||!e.thumbnail||!(null==n?void 0:n.updateFile))throw new Ti(i("Failed to save changes"),"UnsupportedOperation");const o=or(e.thumbnail,e.type),a=ar(o),l=e.name.lastIndexOf("."),c=`${l>0?e.name.substring(0,l):e.name}.${a}`,u=cr(e.thumbnail,o);return n.updateFile(e.id,{name:c,type:o,data:u})},[s,i]),b=o.useCallback(async e=>{var t;if(!e.thumbnail)throw new Ti(i("Failed to save changes"),"ValidationError");const r=null!==(t=e.saveWithoutFolder)&&void 0!==t?t:!e.id,n=or(e.thumbnail,e.type),o=cr(e.thumbnail,n),a=new File([o],e.name,{type:n,lastModified:Date.now()}),s=await h.uploadFileWithProvider(a,e.folderId||void 0,void 0,r);if(!s)throw new Ti(i("Failed to save image copy"),"FileWriteError");return s},[h,i]),w=o.useCallback(r=>{let n;if(r)n=r;else{if(1!==t.size)return;const r=Array.from(t)[0];if(n=e.find(e=>e.id===r),!n||n.isFolder||!v(n))return}u&&u(Ut),m(n),p(!0)},[t,e,v,p,u]),x=o.useCallback(()=>{u&&d===Ut&&u(Lt),p(!1),m(null)},[d,u]),C=o.useCallback(async e=>{var t,o,l,c,u,d;try{const l=await y(e);return a.success({id:"IMAGE_UPDATE_SUCCESS",message:i("Success"),description:i("Image updated successfully"),placement:"bottomRight",data:{itemId:null!==(t=null==l?void 0:l.id)&&void 0!==t?t:void 0,itemName:null==l?void 0:l.name,folderId:null!==(o=null==l?void 0:l.folderId)&&void 0!==o?o:null,thumbnail:null==l?void 0:l.thumbnail}}),l&&s.onEditorOk&&s.onEditorOk(l),await r({folderId:n||""}),x(),null!=l?l:void 0}catch(t){const r=pi(t),n=null!==(c=null!==(l=hi(null==r?void 0:r.code,i))&&void 0!==l?l:null==r?void 0:r.message)&&void 0!==c?c:i("Failed to save changes");throw a.error({id:"IMAGE_SAVE_FAILED",message:n,innerException:t,placement:"bottomRight",data:{itemId:null!==(u=e.id)&&void 0!==u?u:void 0,itemName:e.name,folderId:null!==(d=e.folderId)&&void 0!==d?d:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[y,s,r,n,a,x,i]),_=o.useCallback(async e=>{var t,o,l,c,u,d;try{const l=await b(e);return a.success({id:"IMAGE_SAVE_COPY_SUCCESS",message:i("Success"),description:i("Image copy saved successfully"),placement:"bottomRight",data:{itemId:null!==(t=null==l?void 0:l.id)&&void 0!==t?t:void 0,itemName:null==l?void 0:l.name,folderId:null!==(o=null==l?void 0:l.folderId)&&void 0!==o?o:null,thumbnail:null==l?void 0:l.thumbnail}}),l&&s.onEditorOk&&s.onEditorOk(l),await r({folderId:n||""}),x(),null!=l?l:void 0}catch(t){const r=pi(t),n=null!==(c=null!==(l=hi(null==r?void 0:r.code,i))&&void 0!==l?l:null==r?void 0:r.message)&&void 0!==c?c:i("Failed to save image copy");throw a.error({id:"IMAGE_SAVE_COPY_FAILED",message:n,innerException:t,placement:"bottomRight",data:{itemId:null!==(u=e.id)&&void 0!==u?u:void 0,itemName:e.name,folderId:null!==(d=e.folderId)&&void 0!==d?d:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[b,s,r,n,a,x,i]);return{isPixieEditorVisible:f,editingFile:g,handleEdit:w,handlePixieEditorSave:C,handlePixieEditorSaveCopy:_,handlePixieEditorClose:x}})({files:X||[],selectedFiles:K||new Set,fetchFiles:ee,selectedFolder:be||null}),[Me,Re]=(0,o.useState)(!1),Le=(0,o.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!e.dataTransfer||!e.dataTransfer.types||!e.dataTransfer.types.includes("Files"))return;e.dataTransfer.dropEffect="copy";const t=e.relatedTarget,r=e.currentTarget;t&&r.contains(t)||(T.current+=1,T.current>0&&A(!0))},[]),Ne=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation();const t=e.relatedTarget,r=e.currentTarget;if(t&&!r.contains(t))T.current=Math.max(0,T.current-1),T.current<=0&&A(!1);else if(t){const e=t.closest('[class*="dragOverlay"]');if(e&&r.contains(e))return}},[]),De=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},[]),ze=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),A(!1),T.current=0;const t=(()=>{var t;const r=e.dataTransfer;if(!r)return[];if(null===(t=r.files)||void 0===t?void 0:t.length)return Array.from(r.files);const n=[];if(r.items)for(let e=0;e<r.items.length;e++){const t=r.items[e].getAsFile();t&&n.push(t)}return n})();t.length&&(Re(!0),ce(t).catch(e=>{null==e||e.name}).finally(()=>{Re(!1)}))},[ce]),Be=(0,o.useCallback)(()=>{A(!1),T.current=0,document.body.removeAttribute("data-fm-dragging"),j(!1),E(!1)},[]);o.useEffect(()=>{M.current=X||[]},[X]);const Ue=null==b?void 0:b.activeLibraryItem;(0,o.useEffect)(()=>{const e=e=>{e?document.body.setAttribute("data-fm-dragging","true"):document.body.removeAttribute("data-fm-dragging")};let t=!1;const r=r=>{var n,i;!t&&(null===(i=null===(n=r.dataTransfer)||void 0===n?void 0:n.types)||void 0===i?void 0:i.includes("Files"))&&(t=!0,j(!0),e(!0),Ue===Lt&&E(!0))},n=r=>{const n=r.relatedTarget;(!n||!document.documentElement.contains(n))&&t&&(t=!1,j(!1),E(!1),e(!1))};return window.addEventListener("dragenter",r,!0),window.addEventListener("dragleave",n,!0),()=>{window.removeEventListener("dragenter",r,!0),window.removeEventListener("dragleave",n,!0),document.body.removeAttribute("data-fm-dragging")}},[Ue]),(0,o.useEffect)(()=>{const e=e=>{var t,r;if(document.body.removeAttribute("data-fm-dragging"),j(!1),!(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files")))return;e.preventDefault();const n=(e=>{var t;if(!e)return[];if(null===(t=e.files)||void 0===t?void 0:t.length)return Array.from(e.files);const r=[];if(e.items)for(let n=0;n<e.items.length;n++){const t=e.items[n].getAsFile();t&&r.push(t)}return r})(e.dataTransfer);if(!n.length)return;const i=e.target,o=i.closest(`.${ha.filesContainer.replace(/\s+/g,".")}`)||i.closest("[data-files-container]"),a=i.closest(".em-filemanager")||i.closest(".file-manager__layout")||i.closest("[data-drop-overlay]")||i.closest("[data-drag-capture]");(F.current||_||o||a)&&(e.preventDefault(),e.stopPropagation(),E(!1),A(!1),T.current=0,Re(!0),ce(n).catch(e=>{null==e||e.name}).finally(()=>Re(!1)))},t=e=>{var t,r;(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files"))&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",document.body.hasAttribute("data-fm-dragging")||(document.body.setAttribute("data-fm-dragging","true"),j(!0)),Ue!==Lt||F.current||E(!0))},r=e=>{var t,r;(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files"))&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",document.body.setAttribute("data-fm-dragging","true"),j(!0))},n={capture:!0,passive:!1};return window.addEventListener("drop",e,n),window.addEventListener("dragover",t,n),window.addEventListener("dragenter",r,n),()=>{window.removeEventListener("drop",e,n),window.removeEventListener("dragover",t,n),window.removeEventListener("dragenter",r,n)}},[_,ce,Ue]),(0,o.useEffect)(()=>{const e=e=>{_&&Be(),E(!1),j(!1),document.body.removeAttribute("data-fm-dragging")};return window.addEventListener("dragend",e,!0),()=>window.removeEventListener("dragend",e,!0)},[_,Be]),(0,o.useEffect)(()=>{let e=null;const t=t=>{_&&(e=setTimeout(()=>{_&&Be()},200))};return document.addEventListener("mouseup",t,!0),()=>{document.removeEventListener("mouseup",t,!0),e&&clearTimeout(e)}},[_,Be]),(0,o.useEffect)(()=>{const e=e=>{"Escape"===e.key&&_&&Be()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[_,Be]),(0,o.useEffect)(()=>{const e=e=>{_&&setTimeout(()=>{_&&Be()},100)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[_,Be]);const Ve=o.useCallback(async()=>{await ye(),await V(),be===Vt&&H&&await H(Vt),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var e,t;return null===(t=null===(e=P.current)||void 0===e?void 0:e.refreshFileCounts)||void 0===t?void 0:t.call(e)})})},[V,H,ye,be]),He=o.useCallback(()=>{z(!0)},[]),$e=o.useCallback(async()=>{var e,t;if(be===Vt)try{if(null==x?void 0:x.cleanTrash){const t=await x.cleanTrash();await ee({folderId:Vt}),await(null===(e=P.current)||void 0===e?void 0:e.refreshFileCounts()),t.success?m.success({id:"TRASH_CLEARED_SUCCESS",message:v("Trash cleared successfully"),description:v("{{count}} items permanently deleted",{count:t.deletedCount||0}),placement:"bottomRight"}):m.error({id:"TRASH_CLEAR_FAILED",message:v("Failed to clear trash"),placement:"bottomRight"})}else{const e=M.current||[];if(0===e.length)return void z(!1);const r=e.map(e=>({id:e.id,isFolder:e.isFolder})),n=await g({items:r,selectedFolder:Vt,getItemNameById:t=>{var r;return(null===(r=e.find(e=>e.id===t))||void 0===r?void 0:r.name)||t||""},showNotifications:!1});await ee({folderId:Vt}),await(null===(t=P.current)||void 0===t?void 0:t.refreshFileCounts());const{successCount:i,failCount:o}=n;0===o?m.success({id:"TRASH_CLEARED_SUCCESS",message:v("Trash cleared successfully"),description:v("{{count}} items permanently deleted",{count:i}),placement:"bottomRight"}):i>0?m.warning({id:"TRASH_CLEARED_PARTIAL",message:v("Trash partially cleared"),description:v("{{succeeded}} items deleted, {{failed}} items failed",{succeeded:i,failed:o}),placement:"bottomRight"}):m.error({id:"TRASH_CLEAR_FAILED",message:v("Failed to clear trash"),placement:"bottomRight"})}z(!1)}catch(e){m.error({id:"TRASH_CLEAR_ERROR",message:v("Error clearing trash"),placement:"bottomRight"}),z(!1)}else z(!1)},[be,x,ee,m,v,g]),We=o.useCallback(()=>{z(!1)},[]),Ge=o.useCallback(async e=>{var t;await fe(e),await(null===(t=P.current)||void 0===t?void 0:t.refreshFileCounts())},[fe]),qe=o.useCallback(async e=>{var t;await pe(e),await(null===(t=P.current)||void 0===t?void 0:t.refreshFileCounts())},[pe]),Ye=o.useCallback(async()=>{let e=[],t=new Map;const r=null==y?void 0:y.config;await ne({onStartBatch:n=>{e=f.startUpload(be||void 0,n),t=new Map,n.forEach((n,i)=>{const o=e[i];o&&(t.set(n.name,o),t.set(ki(n.name,r),o))})},onStart:n=>{if(0===e.length){e=f.startUpload(be||void 0,[n]);const i=e[0];i&&(t.set(n.name,i),t.set(ki(n.name,r),i))}},onProgress:(e,r)=>{const n=t.get(e);n&&f.updateProgress(n,r)},onComplete:async e=>{var r;const n=t.get(e);if(n){await new Promise(e=>setTimeout(e,100));const t=null==X?void 0:X.find(t=>t.name===e&&!t.isFolder);f.markAsSuccess(n,t)}await(null===(r=P.current)||void 0===r?void 0:r.refreshFileCounts())},onError:(r,n,i)=>{var o;const a=null!==(o=t.get(r))&&void 0!==o?o:null!=i&&i<e.length?e[i]:void 0;a&&f.markAsError(a,n)},onBatchComplete:async r=>{var n,i,o,a,s,l,c,u;for(let d=0;d<r.successes.length;d++){const u=r.successes[d],h=null===(n=r.uploadedFiles)||void 0===n?void 0:n.get(u),p=null!==(a=null!==(o=null!==(i=t.get(u))&&void 0!==i?i:(null==h?void 0:h.originalFileName)?t.get(h.originalFileName):void 0)&&void 0!==o?o:null!=(null==h?void 0:h.originalIndex)&&h.originalIndex<e.length?e[h.originalIndex]:void 0)&&void 0!==a?a:d<e.length?e[d]:void 0;if(p){let e;if(null==h?void 0:h.id){const t=h;e={id:t.id,name:null!==(s=t.name)&&void 0!==s?s:u,folderId:null!==(c=null!==(l=t.folderId)&&void 0!==l?l:be)&&void 0!==c?c:null,isFolder:!1,size:t.size}}else await new Promise(e=>setTimeout(e,100)),e=null==X?void 0:X.find(e=>e.name===u&&!e.isFolder);f.updateProgress(p,100),f.markAsSuccess(p,e)}}r.errors.forEach(({fileName:e,error:r})=>{const n=t.get(e);n&&f.markAsError(n,r)}),await(null===(u=P.current)||void 0===u?void 0:u.refreshFileCounts())}})},[ne,f,X,be,null==y?void 0:y.config]),Xe=o.useCallback(async(e,t,r,n)=>{var i,o;try{N(!0);let a=r||"uploaded-file";if(!r&&e){const t=e.split("?")[0].split("#")[0].split("/");a=t[t.length-1]||"uploaded-file",a.includes(".")&&(null===(i=a.split(".").pop())||void 0===i?void 0:i.length)&&a.split(".").pop().length<=5||(a+=".jpg")}const s=f.startUploadByUrl(be||void 0,a);try{const r=await ie(e,t,!0,null!=n?n:"uploadByUrl");if(f.updateProgress(s,100),r){await new Promise(e=>setTimeout(e,100));const e=(null==X?void 0:X.find(e=>e.id===r.id&&!e.isFolder))||r;f.markAsSuccess(s,e)}else f.markAsSuccess(s);await(null===(o=P.current)||void 0===o?void 0:o.refreshFileCounts())}catch(e){const t=pi(e),r=vi(t,v);f.markAsError(s,r)}}finally{N(!1)}},[ie,f,be,X,v]),Ke=o.useCallback(async({file:e})=>{var t;const r=f.startUpload(be||void 0,[e])[0];let n=0;const i=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),f.updateProgress(r,n)},200);try{const n=await p.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),f.updateProgress(r,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==X?void 0:X.find(e=>e.id===n.id&&!e.isFolder))||n;f.markAsSuccess(r,e)}else f.markAsSuccess(r);const o=n&&n.folderId||be||null;return xe&&xe(o&&"folders"!==o?o:"folders"),await(null===(t=P.current)||void 0===t?void 0:t.refreshFileCounts()),n}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw f.markAsError(r,t),e}},[p,f,be,X,xe]),Ze=o.useCallback(async e=>{var t;await te(e),await(null===(t=P.current)||void 0===t?void 0:t.refreshFileCounts())},[te]),Je=o.useCallback(async e=>{var t;if(ce){const r=f.startUpload(be||void 0,e);e.forEach(async(e,t)=>{const n=r[t];if(!n)return;let i=0;const o=setInterval(()=>{i=Math.min(i+10+Math.floor(Date.now()%10),85),f.updateProgress(n,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await ce(e),r.forEach(e=>{f.updateProgress(e,100),f.markAsSuccess(e)}),await(null===(t=P.current)||void 0===t?void 0:t.refreshFileCounts())}},[ce,f,be]),Qe=o.useCallback(async e=>{var t;await re(e),await V(),await(null===(t=P.current)||void 0===t?void 0:t.refreshFileCounts())},[re,V]),et=(({files:e,selectedFiles:t,toggleFileSelection:r,showRenameModal:n,showMoveModal:i,showCopyModal:a,handleDeleteFile:s,handleDeleteFolder:l,showDeleteConfirm:c,onEdit:u})=>{const d=o.useCallback(()=>{t&&t.size>0&&t.forEach(e=>{r(e)})},[t,r]),h=o.useCallback(e=>{if(t&&1===t.size||e){const r=e||Array.from(t)[0];n(r)}},[t,n]),f=o.useCallback(r=>{if(t&&t.size>0||(null==r?void 0:r.id)){if(c)return void c();(r?[r.id]:t).forEach(t=>{const r=e.find(e=>e.id===t);r&&(r.isFolder?l(t):s(t))})}},[t,e,s,l,c]);return{handleClearSelection:d,handleRename:h,handleDeleteSelected:f,handleCopy:o.useCallback(()=>{a()},[a]),handleMove:o.useCallback(()=>{i()},[i]),handleEdit:o.useCallback(()=>{u()},[u])}})({files:X||[],selectedFiles:K||new Set,toggleFileSelection:oe,showRenameModal:ae,showMoveModal:ue,showCopyModal:c.actions.showCopyModal||(()=>{}),handleDeleteFile:te,handleDeleteFolder:Qe,showDeleteConfirm:me,onEdit:Pe.handleEdit}),tt=U||Z||Me;(0,o.useEffect)(()=>{rr()},[]),o.useEffect(()=>{if(!xe||0===B.length)return;const e=!1!==(null==w?void 0:w.rememberLastFolder),t=`em_fm:lastFolder:${(null==w?void 0:w.projectId)||"default"}`;if(e&&"undefined"!=typeof window)try{const e=localStorage.getItem(t),r=e&&B.some(t=>t.id===e);if(r)return void xe(e)}catch(e){}be||xe("folders")},[be,xe,B,null==w?void 0:w.rememberLastFolder,null==w?void 0:w.projectId]);const{state:rt,actions:nt,options:it}=o.useContext(ei),{form:ot,urlForm:at,renameForm:st,moveForm:lt,renameFolderForm:ct,copyForm:ut,isModalVisible:dt,isUrlModalVisible:ht,isMoveModalVisible:ft,isRenameFolderModalVisible:pt,isCopyModalVisible:gt,isDeleteConfirmVisible:mt,folderToRename:vt,activeLibraryItem:yt}=rt,{setIsUrlModalVisible:bt,setSortField:wt,setActiveLibraryItem:xt}=nt,{config:Ct}=it,{handleRenameFolderCancel:_t,handleRenameFolderOk:St}=Y.actions;(0,o.useEffect)(()=>{const e=async e=>{if(yt!==Lt)return;const t=document.activeElement;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||"true"===(null==t?void 0:t.getAttribute("contenteditable")))return;const r=e.clipboardData;if(!r)return;const n=Array.from(r.items),i=n.filter(e=>e.type.startsWith("image/"));if(i.length>0){const t=i.map(e=>e.getAsFile()).filter(e=>null!==e);return void(t.length>0&&(e.preventDefault(),await Je(t)))}const o=n.find(e=>"text/plain"===e.type);o&&o.getAsString(async t=>{const r=t.trim();if(r.startsWith("http://")||r.startsWith("https://"))e.preventDefault(),await Xe(r);else if(r.includes("<meta")||r.includes("http")){const t=r.match(/https?:\/\/[^\s"']+/);t&&(e.preventDefault(),await Xe(t[0]))}})};return document.addEventListener("paste",e),()=>{document.removeEventListener("paste",e)}},[yt,Xe,Je]);const At=(0,o.useCallback)(e=>{Fe(e.current||Se.current,e.pageSize||Se.pageSize)},[Fe,Se]),kt=o.useCallback(e=>{const{sortBy:t,sortOrder:r}=(e=>{const[t,r]=e.split("-");return{sortBy:t,sortOrder:r}})(e);Te(t,r)},[Te]),[Et,It]=(0,o.useState)(YO),[jt,Tt]=(0,o.useState)([]),Ft=(0,o.useRef)(null),[Ot,Pt]=(0,o.useState)(Zt),[Mt,Rt]=(0,o.useState)([]),Ht=(0,o.useRef)(null),[$t,Wt]=(0,o.useState)(""),Gt=(0,o.useRef)(null),[qt,Kt]=(0,o.useState)(""),[Jt,Qt]=(0,o.useState)([]),er=o.useRef(void 0),[tr,nr]=(0,o.useState)(!1),[ir,sr]=(0,o.useState)(!1),lr=o.useRef(null),ur=o.useRef(yt),dr=o.useCallback(e=>{const t=e.indexOf(",");if(-1===t)return null;const r=e.substring(0,t),n=r.match(/^data:([^;]+)/),i=n&&n[1]||"image/svg+xml";let o,a="svg";if(i.includes("png")?a="png":(i.includes("jpeg")||i.includes("jpg"))&&(a="jpg"),/;base64/i.test(r)){const r=e.substring(t+1),n=atob(r),a=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)a[e]=n.charCodeAt(e);o=new Blob([a],{type:i})}else{const r=decodeURIComponent(e.substring(t+1));o=new Blob([r],{type:i})}return new File([o],`icon_${Date.now()}.${a}`,{type:i})},[]),hr=o.useCallback(async e=>{var t;const r=f.startUpload(be||void 0,[e])[0];let n=0;const i=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),f.updateProgress(r,n)},200);try{const n=await p.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),f.updateProgress(r,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==X?void 0:X.find(e=>e.id===n.id&&!e.isFolder))||n;f.markAsSuccess(r,e)}else f.markAsSuccess(r);await(null===(t=P.current)||void 0===t?void 0:t.refreshFileCounts())}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw f.markAsError(r,t),e}},[f,X,p,be]),fr=(0,o.useCallback)(async e=>{if(Boolean(e&&e.startsWith("data:"))){const t=dr(e);if(!t)return;return void await hr(t)}e&&await Xe(e,void 0,void 0,"iconStock")},[dr,Xe,hr]),pr=(0,o.useCallback)(async()=>{const e=null==Ct?void 0:Ct.fileForEdit;if(er.current!==e&&yt===Ut&&e&&!Pe.editingFile){er.current=e;try{if("string"==typeof e){if(e.startsWith("data:"))return void(null==Pe||Pe.handleEdit({thumbnail:e,saveWithoutFolder:!0}));const t=await p.resolveFileForEditByUrl(e);er.current===e&&(null==Pe||Pe.handleEdit(t))}}catch(t){er.current===e&&(er.current=null),null==Pe||Pe.handlePixieEditorClose()}}},[null==Ct?void 0:Ct.fileForEdit,yt,Pe,p]);(0,o.useEffect)(()=>{pr()},[pr]),(0,o.useEffect)(()=>{var e,t,r,n;const i=ur.current;ur.current=yt,yt===Lt?(Tt([]),It(YO),Rt([]),Pt(Zt),Qt([]),Kt(""),sr(!1),nr(!1),i===Lt||i!==Dt&&i!==Nt&&i!==Bt||je("")):yt===Bt?null===(e=lr.current)||void 0===e||e.focus():yt===Nt?null===(t=Ft.current)||void 0===t||t.focus():yt===Dt?null===(r=Ht.current)||void 0===r||r.focus():yt===zt&&(null===(n=Gt.current)||void 0===n||n.focus())},[yt,je]);const gr=o.useCallback(async()=>{var e;await St(),await(null===(e=P.current)||void 0===e?void 0:e.refreshFileCounts())},[St]),mr=K.size,vr=o.useMemo(()=>{var e,t,r;if(1!==mr)return!1;const[n]=Array.from(K),i=X.find(e=>e.id===n);if(!i||i.isFolder)return!1;const o="string"==typeof i.name?i.name:"",a=o?null===(e=o.split(".").pop())||void 0===e?void 0:e.toLowerCase():void 0,s=null!==(r=null===(t=i.extension)||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:a;return"string"==typeof i.type&&i.type.startsWith("image/")||"string"==typeof s&&Xt.includes(s)},[mr,K,X]);return null!==(t=null===(e=null==w?void 0:w.getDropOverlayContainer)||void 0===e?void 0:e.call(w))&&void 0!==t||document.body,(0,i.jsxs)(i.Fragment,{children:[I&&Ue===Lt&&(0,de.createPortal)((0,i.jsx)("div",{className:ha.dragCaptureLayer,"data-drag-capture":"true",onDragOver:e=>{var t,r;e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files"))&&!F.current&&E(!0)},onDragEnter:e=>{var t,r;e.preventDefault(),e.stopPropagation(),(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files"))&&E(!0)},onDragLeave:e=>{const t=e.relatedTarget;t&&document.documentElement.contains(t)||(E(!1),j(!1),document.body.removeAttribute("data-fm-dragging"))},onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),j(!1),E(!1),document.body.removeAttribute("data-fm-dragging");const r=e.dataTransfer,n=(null===(t=null==r?void 0:r.files)||void 0===t?void 0:t.length)?Array.from(r.files):(null==r?void 0:r.items)?Array.from(r.items).map(e=>e.getAsFile()).filter(e=>Boolean(e)):[];n.length&&(Re(!0),ce(n).catch(e=>{null==e||e.name}).finally(()=>Re(!1)))},"aria-hidden":"true"}),document.body),k&&(0,de.createPortal)((0,i.jsx)("div",{className:ha.dragOverlayGlobal,"data-drop-overlay":"true",onDragOver:e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},onDragEnter:e=>e.preventDefault(),onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),E(!1),j(!1),document.body.removeAttribute("data-fm-dragging");const r=e.dataTransfer,n=(null===(t=null==r?void 0:r.files)||void 0===t?void 0:t.length)?Array.from(r.files):(null==r?void 0:r.items)?Array.from(r.items).map(e=>e.getAsFile()).filter(e=>Boolean(e)):[];n.length&&(Re(!0),ce(n).catch(e=>{null==e||e.name}).finally(()=>Re(!1)))},"aria-hidden":"true",children:(0,i.jsxs)("div",{className:ha.dragOverlayInner,children:[(0,i.jsx)("div",{className:ha.uploadIcon,children:(0,i.jsx)(C,{})}),(0,i.jsx)("div",{className:ha.textTitle,children:v("Drop files here to upload")}),(0,i.jsx)("div",{className:ha.textDescription,children:v("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),document.body),(0,i.jsx)(R.A,{className:"file-manager__layout",children:(0,i.jsxs)("div",{className:ha.filesContainer,"data-files-container":"true",onDragOver:De,onDragLeave:Ne,onDragEnter:Le,onDrop:ze,children:[_&&(0,i.jsx)("div",{className:ha.dragOverlay,children:(0,i.jsxs)("div",{className:ha.dragOverlayInner,children:[(0,i.jsx)("div",{className:ha.uploadIcon,children:(0,i.jsx)(C,{})}),(0,i.jsx)("div",{className:ha.textTitle,children:v("Drop files here to upload")}),(0,i.jsx)("div",{className:ha.textDescription,children:v("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),h.showResizeGuide&&(0,i.jsx)("div",{className:"resize-guide",style:{left:`${h.resizeGuidePosition}px`}}),(0,i.jsxs)(R.A,{className:"file-manager__content",children:[(0,i.jsxs)(GO,{width:320,theme:"light",className:"file-manager-sider",children:[(0,i.jsx)(Ea,{ref:P,selectedFolder:be||"folders",generateMenuItems:q,onFolderSelect:e=>null==xe?void 0:xe(e),folders:B||[],fetchFolders:V,fetchChildFolders:H,handleAddFile:Ye,setIsUrlModalVisible:e=>null==bt?void 0:bt(e),handleDeleteFolder:Qe,handleCreateFolder:$,activeLibraryItem:yt,setActiveLibraryItem:e=>null==xt?void 0:xt(e)}),(0,i.jsx)("div",{className:"sidebar-resizer "+(h.isResizing?"resizing":""),onMouseDown:h.handleResizeStart,onDoubleClick:h.handleDoubleClick,children:(0,i.jsx)("div",{className:"sidebar-resizer-indicator"})})]}),(0,i.jsxs)(R.A,{className:"file-manager__main-content",children:[Me&&(0,i.jsx)(wa,{style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,zIndex:100,background:"var(--colorBgLayout)"}}),(0,i.jsxs)(qO,{className:"main-content",children:[(0,i.jsx)(tO,{activeLibraryItem:yt,selectedFolder:(null===(r=null==B?void 0:B.find(e=>(null==e?void 0:e.id)===be))||void 0===r?void 0:r.name)||v("Folders"),isTrashFolder:"Trash"===be,onClearTrash:He,files:X||[],loading:tt,onRefresh:Oe,refreshDisabled:Z||U,showRefresh:!(!(null===(n=null==y?void 0:y.apiEndpoints)||void 0===n?void 0:n.clearCache)&&!(null===(a=null==y?void 0:y.dataProviders)||void 0===a?void 0:a.clearCache))}),(0,i.jsx)(O.A,{className:"zero-divider"}),yt===Lt&&(0,i.jsx)(ga,{searchTerm:ke,sortField:rt.sortField||"name",setSortField:e=>null==wt?void 0:wt(e),pathHistory:we||[],handleBreadcrumbClick:e=>null==Ce?void 0:Ce(e),handleAddFile:Ye,setIsUrlModalVisible:e=>null==bt?void 0:bt(e),files:X||[],handleSearch:je,handleSort:Te,sortBy:Ee,sortOrder:Ie,handleSortOptionChange:kt,pagination:Se,setPagination:At,loading:tt,handleItemClick:e=>null==_e?void 0:_e(e),handleDeleteFile:Ze,selectedFiles:K||new Set,toggleFileSelection:(e,t)=>null==oe?void 0:oe(e,t),handleDroppedFiles:Je,fileUpload:f,onClearSelection:et.handleClearSelection,onRename:et.handleRename,onCopy:et.handleCopy,onMove:et.handleMove,onDelete:et.handleDeleteSelected,onEdit:Pe.handleEdit}),yt===Nt&&(0,i.jsx)(mO,{imageGifList:jt,setImageGifList:Tt,currentReqGif:Et,setCurrentReqGif:It,inputRef:Ft,customRequest:(e,t)=>Xe(e,void 0,t,"gif")}),yt===Dt&&(0,i.jsx)(wO,{imageStockList:Mt,setImageStockList:Rt,currentReq:Ot,setCurrentReq:Pt,inputRef:Ht,customRequest:(e,t)=>Xe(e,void 0,t,"imageStock")}),yt===zt&&(0,i.jsx)(WO,{apiKey:null==Ct?void 0:Ct.STREAMLINE_API_KEY,customRequest:fr,query:$t,setQuery:Wt,inputRef:Gt}),yt===Bt&&!!(null==Ct?void 0:Ct.sseQuery)&&(0,i.jsx)(EO,{imageAiList:Jt,setImageAiList:Qt,aiImageRequest:qt,setAiImageRequest:Kt,inputAiRef:lr,customRequest:Ke,isLoadingAi:tr,setIsLoadingAi:nr,isImageUploaded:ir,setIsImageUploaded:sr}),yt===Ut&&(0,i.jsx)(i.Fragment,{}),(0,i.jsx)(i.Fragment,{children:vr&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(O.A,{className:"zero-divider"}),(0,i.jsx)("div",{style:{display:"flex",justifyContent:"right",padding:"17px 24px",alignItems:"center"},children:(0,i.jsx)(S.Ay,{size:"large",type:"primary",style:{height:40},onClick:()=>{if(it.onEditorOk){const e=Array.from(K)[0],t=X.find(t=>t.id===e);t&&it.onEditorOk(t)}},children:v("Choose")})})]})})]})]})]}),L&&(0,i.jsx)("div",{style:{position:"fixed",inset:0,zIndex:1500,backgroundColor:"rgba(255, 255, 255, 0.5)",pointerEvents:"all",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,i.jsx)(s.A,{size:"large"})}),(0,i.jsx)(Aa,{isModalVisible:dt,handleModalOk:W,handleModalCancel:G,form:ot,selectedFolder:be||null,folders:B||[],isUrlModalVisible:ht,setIsUrlModalVisible:e=>null==bt?void 0:bt(e),handleAddFileByUrl:Xe,urlForm:at,isRenameModalVisible:J,handleRenameOk:()=>null==le?void 0:le(),handleRenameCancel:()=>null==se?void 0:se(),renameForm:st,fileToRename:Q,files:X||[],isMoveModalVisible:ft,handleMoveOk:Ge,handleMoveCancel:he,moveForm:lt,selectedFiles:K||new Set,isRenameFolderModalVisible:pt,handleRenameFolderOk:gr,handleRenameFolderCancel:_t,renameFolderForm:ct,folderToRename:vt,isCopyModalVisible:gt,handleCopyOk:qe,handleCopyCancel:ge,copyForm:ut,isDeleteConfirmVisible:mt,handleDeleteConfirmOk:Ve,handleDeleteConfirmCancel:()=>null==ve?void 0:ve(),isClearTrashConfirmVisible:D,handleClearTrashConfirm:$e,handleClearTrashCancel:We,fetchChildFolders:H}),(0,i.jsx)(KF,{visible:Pe.isPixieEditorVisible,onClose:Pe.handlePixieEditorClose,file:Pe.editingFile,onSave:Pe.handlePixieEditorSave,onSaveCopy:Pe.handlePixieEditorSaveCopy}),(0,i.jsx)(JF,{files:f.uploadFiles,visible:f.isUploadVisible,minimized:f.isUploadMinimized,totalFiles:f.totalFiles,completedFiles:f.completedFiles,onClose:f.closeUpload,onMinimize:f.minimizeUpload,onInsert:e=>{var t;const r=f.getUploadedFile(e.id)||e;null===(t=it.onEditorOk)||void 0===t||t.call(it,r)}})]})})]})},KO=(0,o.memo)(({config:e={},onPathChange:t,onChangeSelection:r,onEditorOk:n,searchQuery:a="",sortBySize:s="name",apiEndpoints:l={},customIcons:d,dragDropIcon:h,dataProviders:f,handleNotify:p,handleError:g,handleSuccess:m})=>{const v=o.useMemo(()=>Object.assign({folderTreeLoading:"lazy",expandAllFoldersOnInit:!1,expandRootFolderOnInit:!1,iconStrokeWidth:1.4,availableImageExtensions:["jpg","jpeg","png","gif"],fileNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),e.fileNameProcessing),folderNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),e.folderNameProcessing)},e),[e]);o.useEffect(()=>{v.theme&&(e=>{if("system"===e){const t=matchMedia(Gt).matches?$t:Ht;e=e===Wt?t:e}document.documentElement.setAttribute("data-theme",e)})(v.theme),(e=>{(null==e?void 0:e.customTheme)&&((e={})=>{const t=document.querySelector("head");if(!t)return;const r=document.createElement("style");if(r.type="text/css",r.dataset.themeVariablesFm="true",r.setAttribute("data-file-manager","true"),Object.entries(e).length){let n="";Object.entries(e).forEach(([e,t])=>{"object"!=typeof t&&(n+=`\t--${e}: ${t};\n`)}),n=`.em-filemanager {\n${n}}`,r.appendChild(document.createTextNode(n));const i=t.querySelector('[data-theme-variables-fm="true"]');i?t.replaceChild(r,i):t.insertBefore(r,t.firstChild)}})(null==e?void 0:e.customTheme)})(v)},[v]),(0,o.useEffect)(()=>{v.locale&&v.locale!==yn.language&&yn.changeLanguage(v.locale),v.customLocale&&v.locale&&yn.addResourceBundle(v.locale,"translation",v.customLocale,!0,!0)},[v.locale,v.customLocale]);const y=(0,o.useRef)(null);return(0,i.jsx)(u.A,{className:"em-filemanager",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Ay,{getPopupContainer:()=>y.current||document.body,children:(0,i.jsx)(ri,{options:{apiEndpoints:l,searchQuery:a,sortBySize:s,onPathChange:t,onChangeSelection:r,onEditorOk:n,config:v,customIcons:d,dragDropIcon:h,dataProviders:f,handleNotify:p,handleError:g,handleSuccess:m},children:(0,i.jsx)(XO,{})})}),(0,i.jsx)("div",{ref:y,className:"file-manager-modal-root"})]})})});KO.displayName="FileManagerApp";const ZO=e=>{var t,r,n;return(0,i.jsx)(Er,{i18n:yn,children:(0,i.jsx)(er,{externalTheme:null!==(r=null===(t=e.config)||void 0===t?void 0:t.theme)&&void 0!==r?r:"light",customThemeToken:null===(n=e.config)||void 0===n?void 0:n.customTheme,children:(0,i.jsx)(V.A,{children:(0,i.jsx)(KO,Object.assign({},e))})})})},JO=(new Map,new Map,e=>{const{onClose:t,onSave:r,dataProviders:n,theme:a,locale:s}=e,l=o.useCallback(async(e,t,r)=>{if(!e&&!t||!(null==n?void 0:n.getFiles))return null;try{const i=await n.getFiles({folderId:r||void 0,search:t||void 0,itemType:"file",page:1,limit:1}),[o]=i.files;return o?e&&o.id!==e?null:o:null}catch(e){return null}},[n]),d=o.useMemo(()=>{if(e.file)return e.file;const t=e.name||"edited-image",r=e.extension||(e.type?e.type.split("/")[1]:"png"),n=e.type||`image/${r}`;return{thumbnail:e.imageDataUrl||"",name:t,id:void 0,type:n,extension:r,saveWithoutFolder:!0}},[e.file,e.imageDataUrl,e.name,e.extension,e.type]),h=o.useCallback(async e=>{if((null==n?void 0:n.updateFile)&&e.thumbnail)try{const t=or(e.thumbnail,e.type),r=ar(t),i=e.name.substring(0,e.name.lastIndexOf("."))+"."+r,o=cr(e.thumbnail,t);return await n.updateFile(e.id,{name:i,type:t,data:o})}catch(e){return null}return null},[n]),f=o.useCallback(async e=>{var t,r,i,o,a,s;if(!e.thumbnail)return null;try{const c=null!==(t=e.saveWithoutFolder)&&void 0!==t?t:!e.id,u=c?"":e.folderId||"",d=or(e.thumbnail,e.type),h=cr(e.thumbnail,d),f=new File([h],e.name,{type:d,lastModified:Date.now()});if(null==n?void 0:n.uploadFiles){const t=await n.uploadFiles({items:[{name:f.name,size:f.size,type:f.type,folderId:u,noFolder:c,data:f,extension:ar(d)}],folderId:u}),h=null===(r=t.detailed)||void 0===r?void 0:r[0];if(t.success&&(null==h?void 0:h.success)&&h.data){const t=h.data;if(t.url||t.thumbnailUrl||t.thumbnail)return{id:t.id||e.id||"",name:t.name||e.name,folderId:null!==(i=t.folderId)&&void 0!==i?i:u,type:t.type||f.type,size:null!==(o=t.size)&&void 0!==o?o:f.size,extension:t.extension||ar(d),url:t.url,thumbnailUrl:t.thumbnailUrl,thumbnail:t.thumbnail,date:t.date,dimensions:t.dimensions,aspectRatio:t.aspectRatio,sourceUrl:t.sourceUrl,isFolder:!1,selected:!1};return await l(h.data.id,h.data.name||f.name,null!==(a=h.data.folderId)&&void 0!==a?a:u)||{id:h.data.id||e.id||"",name:h.data.name||e.name,folderId:null!==(s=h.data.folderId)&&void 0!==s?s:u,type:f.type,size:f.size,extension:ar(d),url:h.data.url,thumbnailUrl:h.data.thumbnailUrl,thumbnail:h.data.thumbnail,isFolder:!1,selected:!1}}}return(null==n?void 0:n.uploadFile)?await n.uploadFile({name:f.name,size:f.size,type:f.type,folderId:u,noFolder:c,data:f,extension:ar(d)}):null}catch(e){return null}},[n,l]),p=o.useCallback(async e=>{if((null==n?void 0:n.updateFile)&&e.id&&e.thumbnail)try{const t=await h(e);t&&(e=t)}catch(e){}return r&&await r(e),t&&t(),e},[n,r,t,h]),g=o.useCallback(async e=>{let n=e;if(e.thumbnail)try{const t=await f(e);t&&(n=t)}catch(e){}return r&&await r(n),t&&t(),n},[t,r,f]),m=(0,o.useRef)(null);return(0,o.useEffect)(()=>{s&&s!==yn.language&&yn.changeLanguage(s)},[s]),(0,i.jsx)(u.A,{className:"em-filemanager",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Ay,{getPopupContainer:()=>m.current||document.body,children:(0,i.jsx)(Er,{i18n:yn,children:(0,i.jsx)(er,{externalTheme:null!=a?a:"light",children:(0,i.jsx)(V.A,{children:(0,i.jsx)(ri,{options:{dataProviders:n,handleNotify:e.handleNotify,handleError:e.handleError,handleSuccess:e.handleSuccess,config:{theme:null!=a?a:"light",locale:s,baseUrl:e.baseUrl,assetsUrl:e.assetsUrl,showNotifications:e.showNotifications,handleFileProxy:e.handleFileProxy}},children:(0,i.jsx)(KF,{visible:!0,onClose:t,file:d,onSave:p,onSaveCopy:g})})})})})}),(0,i.jsx)("div",{ref:m,className:"file-manager-modal-root"})]})})})}}]);
|
|
3
|
+
//# sourceMappingURL=3628.6018921f.js.map
|