@emailmaker/filemanager 0.10.71 → 0.10.72

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.
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as n from"react";import i,{useState as o,useEffect as a,createContext as s,useContext as l,useCallback as c,useRef as u,useMemo as d,createElement as h,memo as f,forwardRef as p,useImperativeHandle as g,Children as m,isValidElement as v,Fragment as y,useId as b,cloneElement as w,useLayoutEffect as x,useInsertionEffect as C}from"react";import{createRoot as _}from"react-dom/client";import{Spin as S,theme as k,ConfigProvider as A,App as I,Form as E,Input as F,Typography as T,Select as O,Tooltip as P,Button as M,Space as R,Segmented as L,Checkbox as N,Dropdown as j,Image as D,Col as z,Card as B,Row as U,Table as V,Empty as H,Pagination as $,Tree as W,Modal as G,Progress as q,Menu as Y,Divider as X,List as K,Avatar as Z,Layout as J,Radio as Q,Tag as ee,Carousel as te,InputNumber as re,ColorPicker as ne,message as ie}from"antd";import oe from"antd/es/alert/ErrorBoundary";import ae,{LoadingOutlined as se,BarsOutlined as le,AppstoreOutlined as ce,DownOutlined as ue,RightOutlined as de,LinkOutlined as he,UploadOutlined as fe,FileOutlined as pe,FolderAddOutlined as ge,FolderOpenOutlined as me,FolderOutlined as ve,EyeOutlined as ye,CloseOutlined as be,LikeOutlined as we,HistoryOutlined as xe,ExclamationCircleOutlined as Ce,FileImageOutlined as _e,CheckCircleOutlined as Se,ArrowRightOutlined as ke,ArrowLeftOutlined as Ae,CheckOutlined as Ie}from"@ant-design/icons";import*as Ee from"react-dom";import{createPortal as Fe,flushSync as Te}from"react-dom";function Oe(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 Oe(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)?Oe(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 Me(e){return Me="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},Me(e)}function Re(e){var t=function(e,t){if("object"!=Me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Me(t)?t:t+""}function Le(e,t,r){return(t=Re(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ne(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 je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(r),!0).forEach(function(t){Le(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var De={},ze=[];function Be(e,t){if("production"!==process.env.NODE_ENV&&!e&&void 0!==console){var r=ze.reduce(function(e,t){return t(null!=e?e:"","warning")},t);r&&console.error("Warning: ".concat(r))}}function Ue(e,t){if("production"!==process.env.NODE_ENV&&!e&&void 0!==console){var r=ze.reduce(function(e,t){return t(null!=e?e:"","note")},t);r&&console.warn("Note: ".concat(r))}}function Ve(e,t,r){t||De[r]||(e(!1,r),De[r]=!0)}function He(e,t){Ve(Be,e,t)}function $e(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(He(!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"===Me(t)&&"object"===Me(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 We(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ge(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,Re(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}He.preMessage=function(e){ze.push(e)},He.resetWarned=function(){De={}},He.noteOnce=function(e,t){Ve(Ue,e,t)};function qe(e){return e.join("%")}var Ye=function(){function e(t){We(this,e),Le(this,"instanceId",void 0),Le(this,"cache",new Map),Le(this,"extracted",new Set),this.instanceId=t}return Ge(e,[{key:"get",value:function(e){return this.opGet(qe(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(qe(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}(),Xe=["children"],Ke="data-css-hash",Ze="__cssinjs_instance__";function Je(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(Ke,"]"))||[],r=document.head.firstChild;Array.from(t).forEach(function(t){t[Ze]=t[Ze]||e,t[Ze]===e&&document.head.insertBefore(t,r)});var n={};Array.from(document.querySelectorAll("style[".concat(Ke,"]"))).forEach(function(t){var r,i=t.getAttribute(Ke);n[i]?t[Ze]===e&&(null===(r=t.parentNode)||void 0===r||r.removeChild(t)):n[i]=!0})}return new Ye(e)}var Qe=n.createContext({hashPriority:"low",cache:Je(),defaultCache:!0}),et=function(e){var t,r,i,o,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,Xe),l=n.useContext(Qe),c=(t=function(){var e=je({},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||Je(),e.defaultCache=!t&&l.defaultCache,e},r=[l,s],i=function(e,t){return!$e(e[0],t[0],!0)||!$e(e[1],t[1],!0)},"value"in(o=n.useRef({})).current&&!i(o.current.condition,r)||(o.current.value=t(),o.current.condition=r),o.current.value);return n.createElement(Qe.Provider,{value:c},a)};var tt=function(){function e(){We(this,e),Le(this,"cache",void 0),Le(this,"keys",void 0),Le(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Ge(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):i=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 rt(e,t,r){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4])return e;var n=je(je({},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),{},Le(Le({},"data-token-hash",t),Ke,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>")}Le(tt,"MAX_CACHE_SIZE",20),Le(tt,"MAX_CACHE_OFFSET",5),new tt,"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,je({},n).useInsertionEffect,je({},n).useInsertionEffect;if(process.env.NODE_ENV,"production"!==process.env.NODE_ENV&&"undefined"!=typeof module&&module&&module.hot&&"undefined"!=typeof window){var nt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:null;if(nt&&"function"==typeof nt.webpackHotUpdate){var it=nt.webpackHotUpdate;nt.webpackHotUpdate=function(){return setTimeout(function(){0},0),it.apply(void 0,arguments)}}}process.env.NODE_ENV;var ot="comm",at="rule",st="decl",lt=Math.abs,ct=String.fromCharCode;function ut(e){return e.trim()}function dt(e,t,r){return e.replace(t,r)}function ht(e,t,r){return e.indexOf(t,r)}function ft(e,t){return 0|e.charCodeAt(t)}function pt(e,t,r){return e.slice(t,r)}function gt(e){return e.length}function mt(e,t){return t.push(e),e}var vt=1,yt=1,bt=0,wt=0,xt=0,Ct="";function _t(e,t,r,n,i,o,a,s){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:vt,column:yt,length:a,return:"",siblings:s}}function St(){return xt=wt>0?ft(Ct,--wt):0,yt--,10===xt&&(yt=1,vt--),xt}function kt(){return xt=wt<bt?ft(Ct,wt++):0,yt++,10===xt&&(yt=1,vt++),xt}function At(){return ft(Ct,wt)}function It(){return wt}function Et(e,t){return pt(Ct,e,t)}function Ft(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 Tt(e){return ut(Et(wt-1,Mt(91===e?e+2:40===e?e+1:e)))}function Ot(e){for(;(xt=At())&&xt<33;)kt();return Ft(e)>2||Ft(xt)>3?"":" "}function Pt(e,t){for(;--t&&kt()&&!(xt<48||xt>102||xt>57&&xt<65||xt>70&&xt<97););return Et(e,It()+(t<6&&32==At()&&32==kt()))}function Mt(e){for(;kt();)switch(xt){case e:return wt;case 34:case 39:34!==e&&39!==e&&Mt(xt);break;case 40:41===e&&Mt(e);break;case 92:kt()}return wt}function Rt(e,t){for(;kt()&&e+xt!==57&&(e+xt!==84||47!==At()););return"/*"+Et(t,wt-1)+"*"+ct(47===e?e:kt())}function Lt(e){for(;!Ft(At());)kt();return Et(e,wt)}function Nt(e){return function(e){return Ct="",e}(jt("",null,null,null,[""],e=function(e){return vt=yt=1,bt=gt(Ct=e),wt=0,[]}(e),0,[0],e))}function jt(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=kt()){case 40:if(108!=p&&58==ft(_,d-1)){-1!=ht(_+=dt(Tt(y),"&","&\f"),"&\f",lt(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:_+=Tt(y);break;case 9:case 10:case 13:case 32:_+=Ot(p);break;case 92:_+=Pt(It()-1,7);continue;case 47:switch(At()){case 42:case 47:mt(zt(Rt(kt(),It()),t,r,l),l),5!=Ft(p||1)&&5!=Ft(At()||1)||!gt(_)||" "===pt(_,-1,void 0)||(_+=" ");break;default:_+="/"}break;case 123*g:s[c++]=gt(_)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(_=dt(_,/\f/g,"")),f>0&&(gt(_)-d||0===g&&47===p)&&mt(f>32?Bt(_+";",n,r,d-1,l):Bt(dt(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(mt(C=Dt(_,t,r,c,u,i,s,b,w=[],x=[],d,o),o),123===y)if(0===u)jt(_,t,C,C,w,o,d,s,x);else{switch(h){case 99:if(110===ft(_,3))break;case 108:if(97===ft(_,2))break;default:u=0;case 100:case 109:case 115:}u?jt(e,C,C,n&&mt(Dt(e,C,C,0,0,i,s,b,i,w=[],d,x),x),i,x,d,s,n?w:x):jt(_,C,C,C,[""],x,0,s,x)}}c=u=f=0,g=v=1,b=_="",d=a;break;case 58:d=1+gt(_),f=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==St())continue;switch(_+=ct(y),y*g){case 38:v=u>0?1:(_+="\f",-1);break;case 44:s[c++]=(gt(_)-1)*v,v=1;break;case 64:45===At()&&(_+=Tt(kt())),h=At(),u=d=gt(b=_+=Lt(It())),y++;break;case 45:45===p&&2==gt(_)&&(g=0)}}return o}function Dt(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=pt(e,h+1,h=lt(m=a[g])),w=e;y<p;++y)(w=ut(m>0?f[y]+" "+b:dt(b,/&\f/g,f[y])))&&(l[v++]=w);return _t(e,t,r,0===i?at:s,l,c,u,d)}function zt(e,t,r,n){return _t(e,t,r,ot,ct(xt),pt(e,2,-2),0,n)}function Bt(e,t,r,n,i){return _t(e,t,r,st,pt(e,0,n),pt(e,n+1,-1),n,i)}function Ut(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function Vt(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case st:return e.return=e.return||e.value;case ot:return"";case"@keyframes":return e.return=e.value+"{"+Ut(e.children,n)+"}";case at:if(!gt(e.value=e.props.join(",")))return""}return gt(r=Ut(e.children,n))?e.return=e.value+"{"+r+"}":""}function Ht(e){return e.notSplit=!0,e}Le(Le(Le({},"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=rt(i,o,a,h,u),s&&Object.keys(s).forEach(function(e){if(!t[e]){t[e]=!0;var r=function(e){return Ut(Nt(e),Vt).replace(/\{%%%\:[^;];}/g,";")}(s[e]),n=rt(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,rt(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;if(!i)return null;return[-999,o,rt(i,a,o,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]}),Ht(["borderTop","borderBottom"]),Ht(["borderTop"]),Ht(["borderBottom"]),Ht(["borderLeft","borderRight"]),Ht(["borderLeft"]),Ht(["borderRight"]);const $t={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function Wt(e,t){return t}function Gt(e,t){return e.filter(e=>void 0!==e)}var qt;function Yt(e){return"object"!=typeof e||null===e?0:Array.isArray(e)?2:function(e){if(!Zt.includes(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(void 0===t)return!0;const r=t.prototype;if(null===r||"object"!=typeof r||!Zt.includes(Object.prototype.toString.call(r)))return!1;if(!r.hasOwnProperty("isPrototypeOf"))return!1;return!0}(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Xt(e,t){return"object"==typeof e&&Object.prototype.propertyIsEnumerable.call(e,t)}function Kt(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]()}}})}}!function(e){e[e.NOT=0]="NOT",e[e.RECORD=1]="RECORD",e[e.ARRAY=2]="ARRAY",e[e.SET=3]="SET",e[e.MAP=4]="MAP",e[e.OTHER=5]="OTHER"}(qt||(qt={}));const Zt=["[object Object]","[object Module]"];const Jt={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)Xt(t,i)&&o.push(t[i]);if(0===o.length)continue;const a=t.metaDataUpdater(r,{key:i,parents:e}),s=er(o,t,a);s!==$t.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(Kt(e))},mergeMaps:function(e){return new Map(Kt(e))},mergeOthers:function(e){return e.at(-1)}};function Qt(...e){return function(e,t){const r=function(e,t){return{defaultMergeFunctions:Jt,mergeFunctions:{...Jt,...Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(Jt,e)).map(([e,t])=>!1===t?[e,Jt.mergeOthers]:[e,t]))},metaDataUpdater:e.metaDataUpdater??Wt,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:!1===e.filterValues?void 0:e.filterValues??Gt,actions:$t}}(e,n);function n(...e){return er(e,r,t)}return n}({})(...e)}function er(e,t,r){const n=t.filterValues?.(e,r)??e;if(0===n.length)return;if(1===n.length)return tr(n,t,r);const i=Yt(n[0]);if(0!==i&&5!==i)for(let e=1;e<n.length;e++)if(Yt(n[e])!==i)return tr(n,t,r);switch(i){case 1:return function(e,t,r){const n=t.mergeFunctions.mergeRecords(e,t,r);if(n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords)return t.defaultMergeFunctions.mergeRecords(e,t,r);return n}(n,t,r);case 2:return function(e,t,r){const n=t.mergeFunctions.mergeArrays(e,t,r);if(n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays)return t.defaultMergeFunctions.mergeArrays(e);return n}(n,t,r);case 3:return function(e,t,r){const n=t.mergeFunctions.mergeSets(e,t,r);if(n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets)return t.defaultMergeFunctions.mergeSets(e);return n}(n,t,r);case 4:return function(e,t,r){const n=t.mergeFunctions.mergeMaps(e,t,r);if(n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps)return t.defaultMergeFunctions.mergeMaps(e);return n}(n,t,r);default:return tr(n,t,r)}}function tr(e,t,r){const n=t.mergeFunctions.mergeOthers(e,t,r);return n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):n}const rr="my_files",nr="gif",ir="stock_images",or="icons",ar="ai",sr="editor",lr="Trash",cr="light",ur="dark",dr="system",hr="(prefers-color-scheme: dark)",fr=!1,pr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",gr=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif"],mr=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif","gif"],vr={keywords:"",color:"",orientation:""};S.setDefaultIndicator(e(()=>e(se,{style:{fontSize:48,height:"100%"},spin:!0}),{}));const yr={hashed:!1,algorithm:k.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}}},br={hashed:!1,algorithm:k.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}}},wr=({externalTheme:t=cr,children:r,customThemeToken:n})=>{const i=matchMedia(hr).matches?ur:cr,s=t===dr?i:t,[l,c]=o(s),[u,d]=o("light"===l?yr:br);return a(()=>{c(s)},[s]),a(()=>{const e="light"===l?yr:br,t=n?Qt(e.token,n):e.token;d(Object.assign(Object.assign({},e),{token:t}))},[d,l,n]),e("div",{id:"file-manager-element-id",style:{height:"100%"},children:e(A,{theme:u,children:e(et,{transformers:[],children:e(I,{style:{height:"100%"},children:r})})})})},xr={fileManager:{locale:"en_US",mode:"fileManager",theme:"light",enabledTabs:["editor"]},imageCenter:{locale:"en_US",mode:"imageCenter",theme:"light",enabledTabs:["stock","gif","editor"]},plugin:{locale:"en_US",mode:"plugin",theme:"light",enabledTabs:["editor","stock","gif","ai"]}},Cr=(e="fileManager",t)=>"imageCenter"===e&&t?t:Object.assign({},xr[e]);let _r=!1;const Sr=()=>{if(_r)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]){const e=window.__webpack_require__;e&&"object"==typeof e&&null!==e&&"cache"in e&&console.warn("✅ Webpack detected, additional protection from ResizeObserver errors activated")}})}catch(e){console.warn("Error when searching for webpack objects:",e)}};e(),setTimeout(e,1e3)}_r=!0},kr=()=>{_r=!1},Ar=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},Er=(e,t="image/png")=>{let r=t;if("string"==typeof e&&e.startsWith("data:")){const t=Ir(e);t&&t.startsWith("image/")&&(r=t)}return Ar(r)},Fr=e=>{const t=Ar(e).split("/")[1];return"svg+xml"===t?"svg":t||"png"},Tr=/^data:(.+?);base64,(.+)$/i,Or=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 e=0;e<r;e++)n[e]=t.charCodeAt(e);return n},Pr=(e,t)=>{const r=e.replace(/\s/g,""),n=Or(r),i=new ArrayBuffer(n.length);return new Uint8Array(i).set(n),new Blob([i],{type:t})},Mr=(e,t="application/octet-stream")=>{if(e instanceof Blob)return e;if("string"==typeof e){const r=e.trim(),n=r.match(Tr);if(n){const[,e,t]=n;return Pr(t,e)}return Pr(r,t)}throw new Error("Unsupported data type. Expected Blob or base64 string.")},Rr={"а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"y","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"ts","ч":"ch","ш":"sh","щ":"sch","ъ":"","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"Y","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"Ts","Ч":"Ch","Ш":"Sh","Щ":"Sch","Ъ":"","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya"},Lr=/[<>:"/\\|?*()#\x00-\x1f]/g,Nr={transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0};function jr(e,t){let r=e;return t.transliterate&&(r=r.normalize("NFC").split("").map(e=>Rr[e]||e).join("")),t.removeForbiddenChars&&(r=r.replace(Lr,"_")),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 Dr(e,t){const r=Object.assign(Object.assign({},Nr),null==t?void 0:t.fileNameProcessing),n=e.lastIndexOf(".");let i,o;n>0?(i=e.substring(0,n),o=e.substring(n).toLowerCase()):(i=e,o="");return(jr(i,r)||"unnamed_file")+o}function zr(e,t){return jr(e,Object.assign(Object.assign({},Nr),null==t?void 0:t.folderNameProcessing))||"unnamed_folder"}function Br(e){return!0===(null==e?void 0:e.dedupeUploadNamesOnClient)}const Ur=e=>"string"==typeof e,Vr=()=>{let e,t;const r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},Hr=e=>null==e?"":""+e,$r=/###/g,Wr=e=>e&&e.indexOf("###")>-1?e.replace($r,"."):e,Gr=e=>!e||Ur(e),qr=(e,t,r)=>{const n=Ur(t)?t.split("."):t;let i=0;for(;i<n.length-1;){if(Gr(e))return{};const t=Wr(n[i]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Gr(e)?{}:{obj:e,k:Wr(n[i])}},Yr=(e,t,r)=>{const{obj:n,k:i}=qr(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=qr(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=qr(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=r},Xr=(e,t)=>{const{obj:r,k:n}=qr(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Kr=(e,t,r)=>{for(const n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?Ur(e[n])||e[n]instanceof String||Ur(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):Kr(e[n],t[n],r):e[n]=t[n]);return e},Zr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Jr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Qr=e=>Ur(e)?e.replace(/[&<>"'\/]/g,e=>Jr[e]):e;const en=[" ",",","?","!",";"],tn=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),rn=(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 e=0;e<n.length;){if(!i||"object"!=typeof i)return;let t,o="";for(let a=e;a<n.length;++a)if(a!==e&&(o+=r),o+=n[a],t=i[o],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<n.length-1)continue;e+=a-e+1;break}i=t}return i},nn=e=>e?.replace("_","-"),on={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class an{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||on,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:(Ur(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new an(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new an(this.logger,e)}}var sn=new an;class ln{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){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,r])=>{for(let n=0;n<r;n++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let i=0;i<n;i++)r.apply(r,[e,...t])})}}}class cn extends ln{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):Ur(r)&&i?a.push(...r.split(i)):a.push(r)));const s=Xr(this.data,a);return!s&&!t&&!r&&e.indexOf(".")>-1&&(e=a[0],t=a[1],r=a.slice(2).join(".")),!s&&o&&Ur(r)?rn(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),Yr(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(const n in r)(Ur(r[n])||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{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=Xr(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?Kr(s,r,i):s={...s,...r},Yr(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 un={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 dn=Symbol("i18next/PATH_KEY");function hn(e,t){const{[dn]:r}=e(function(){const e=[],t=Object.create(null);let r;return t.get=(n,i)=>(r?.revoke?.(),i===dn?e:(e.push(i),r=Proxy.revocable(n,t),r.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return r.join(t?.keySeparator??".")}const fn={},pn=e=>!Ur(e)&&"boolean"!=typeof e&&"number"!=typeof e;class gn extends ln{constructor(e,t={}){super(),((e,t,r)=>{e.forEach(e=>{t[e]&&(r[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=sn.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=en.filter(e=>t.indexOf(e)<0&&r.indexOf(e)<0);if(0===n.length)return!0;const i=tn.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:Ur(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:Ur(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=hn(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&&!Ur(n.count),b=gn.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 k=pn(S),A=Object.prototype.toString.apply(S);if(!(v&&S&&k&&["[object Number]","[object Function]","[object RegExp]"].indexOf(A)<0)||Ur(m)&&Array.isArray(S))if(v&&Ur(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 r=0;r<t.length;r++)e.push(t[r]);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 e in S)if(Object.prototype.hasOwnProperty.call(S,e)){const i=`${r}${o}${e}`;t[e]=b&&!f?this.translate(i,{...n,defaultValue:pn(_)?_[e]:void 0,joinArrays:!1,ns:s}):this.translate(i,{...n,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=S[e])}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=Ur(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&&!Ur(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=Ur(o)?[o]:o;return null!=e&&a?.length&&!1!==r.applyPostProcessor&&(e=un.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 Ur(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&&!Ur(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Ur(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,fn[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(fn[`${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&&!Ur(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){const t="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,12)&&void 0!==e[r])return!0;return!1}}class mn{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sn.create("languageUtils")}getScriptPartFromCode(e){if(!(e=nn(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=nn(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Ur(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)),Ur(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 Ur(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))):Ur(e)&&i(this.formatLanguageCode(e)),r.forEach(e=>{n.indexOf(e)<0&&i(this.formatLanguageCode(e))}),n}}const vn={zero:0,one:1,two:2,few:3,many:4,other:5},yn={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class bn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=sn.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const r=nn("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!"),yn;if(!e.match(/-|_/))return yn;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)=>vn[e]-vn[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 wn=(e,t,r,n=".",i=!0)=>{let o=((e,t,r)=>{const n=Xr(e,r);return void 0!==n?n:Xr(t,r)})(e,t,r);return!o&&i&&Ur(r)&&(o=rn(e,r,n),void 0===o&&(o=rn(t,r,n))),o},xn=e=>e.replace(/\$/g,"$$$$");class Cn{constructor(e={}){this.logger=sn.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:Qr,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?Zr(i):o||"{{",this.suffix=a?Zr(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Zr(d):h||Zr("$t("),this.nestingSuffix=f?Zr(f):p||Zr(")"),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=wn(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(wn(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=>xn(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?xn(this.escape(e)):xn(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=Ur(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 Ur(o)||this.useRawValueToEscape||(o=Hr(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&&!Ur(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&&!Ur(i))return i;Ur(i)||(i=Hr(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 _n=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(nn(n),i),t[a]=s),s(r)}},Sn=e=>(t,r,n)=>e(nn(r),n)(t);class kn{constructor(e={}){this.logger=sn.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const r=t.cacheInBuiltFormats?_n:Sn;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()]=_n(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 An extends ln{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=sn.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}=qr(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();Ur(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ur(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 In=()=>({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]),Ur(e[1])&&(t.defaultValue=e[1]),Ur(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}),En=e=>(Ur(e.ns)&&(e.ns=[e.ns]),Ur(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ur(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),Fn=()=>{};class Tn extends ln{constructor(e={},t){var r;if(super(),this.options=En(e),this.services={},this.logger=sn,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&&(Ur(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=In();this.options={...r,...this.options,...En(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?sn.init(n(this.modules.logger),this.options):sn.init(null,this.options),e=this.modules.formatter?this.modules.formatter:kn;const t=new mn(this.options);this.store=new cn(this.options.resources,this.options);const i=this.services;i.logger=sn,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new bn(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 An(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 gn(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=Fn),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=Vr(),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=Fn){let r=t;const n=Ur(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=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(n)t(n);else{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=Vr();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=Fn),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&&un.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=Vr();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=Ur(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(Ur(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=hn(e,{...this.options,...t})),`${o.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=hn(e,{...this.options,...t})),s=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(s,o)};return Ur(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=Vr();return this.options.ns?(Ur(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=Vr();Ur(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 mn(In());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 Tn(e,t)}cloneInstance(e={},t=Fn){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new Tn(n);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["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 cn(e,n),i.services.resourceStore=i.store}return i.translator=new gn(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 On=Tn.createInstance();On.createInstance=Tn.createInstance,On.createInstance,On.dir,On.init,On.loadResources,On.reloadResources,On.use,On.changeLanguage,On.getFixedT,On.t,On.exists,On.setDefaultNamespace,On.hasLoadedNamespace,On.loadNamespaces,On.loadLanguages;var Pn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};const Mn={},Rn=(e,t,r,n)=>{Dn(r)&&Mn[r]||(Dn(r)&&(Mn[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);Dn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)})(e,t,r,n))},Ln=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},Nn=(e,t,r)=>{e.loadNamespaces(t,Ln(e,r))},jn=(e,t,r,n)=>{if(Dn(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Nn(e,r,n);r.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Ln(e,n))},Dn=e=>"string"==typeof e,zn=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Bn={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Un=e=>Bn[e];let Vn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(zn,Un)};let Hn;const $n={type:"3rdParty",init(e){((e={})=>{Vn={...Vn,...e}})(e.options.react),(e=>{Hn=e})(e)}},Wn=s();class Gn{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const qn=(e,t,r,n)=>e.getFixedT(t,r,n),Yn=(e,t={})=>{const{i18n:r}=t,{i18n:n,defaultNS:i}=l(Wn)||{},s=r||n||Hn;if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Gn),!s){Rn(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return Dn(t)?t:"object"==typeof(r=t)&&null!==r&&Dn(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}s.options.react?.wait&&Rn(s,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const d={...Vn,...s.options.react,...t},{useSuspense:h,keyPrefix:f}=d;let p=i||s.options?.defaultNS;p=Dn(p)?[p]:p||["translation"],s.reportNamespaces.addUsedNamespaces?.(p);const g=(s.isInitialized||s.initializedStoreOnce)&&p.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}}):(Rn(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,s,d)),m=((e,t,r,n)=>c(qn(e,t,r,n),[e,t,r,n]))(s,t.lng||null,"fallback"===d.nsMode?p:p[0],f),v=()=>m,y=()=>qn(s,t.lng||null,"fallback"===d.nsMode?p:p[0],f),[b,w]=o(v);let x=p.join();t.lng&&(x=`${t.lng}${x}`);const C=((e,t)=>{const r=u();return a(()=>{r.current=e},[e,t]),r.current})(x),_=u(!0);a(()=>{const{bindI18n:e,bindI18nStore:r}=d;_.current=!0,g||h||(t.lng?jn(s,t.lng,p,()=>{_.current&&w(y)}):Nn(s,p,()=>{_.current&&w(y)})),g&&C&&C!==x&&_.current&&w(y);const n=()=>{_.current&&w(y)};return e&&s?.on(e,n),r&&s?.store.on(r,n),()=>{_.current=!1,s&&e&&e?.split(" ").forEach(e=>s.off(e,n)),r&&s&&r.split(" ").forEach(e=>s.store.off(e,n))}},[s,x]),a(()=>{_.current&&g&&w(v)},[s,f,g]);const S=[b,s,g];if(S.t=b,S.i18n=s,S.ready=g,g)return S;if(!g&&!h)return S;throw new Promise(e=>{t.lng?jn(s,t.lng,p,()=>e()):Nn(s,p,()=>e())})};function Xn({i18n:e,defaultNS:t,children:r}){const n=d(()=>({i18n:e,defaultNS:t}),[e,t]);return h(Wn.Provider,{value:n},r)}var Kn,Zn,Jn,Qn,ei,ti={};function ri(){if(Zn)return Kn;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},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,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)}function n(e,t){return function(e,t){if(t.get)return t.get.call(e);return 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)}Zn=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 Kn=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},Kn}!function(){if(ei)return ti;ei=1;var e=function(){if(Qn)return Jn;function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function t(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)}Qn=1;var r=e(ri());function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Pn||"undefined"!=typeof self&&self;var i={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})}(i);var o=n(i.exports),a=t({__proto__:null,default:o},[i.exports]),s={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})}(s);var l=n(s.exports),c=t({__proto__:null,default:l},[s.exports]),u={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}(u);var d=n(u.exports),h=o||a,f=l||c,p=d||t({__proto__:null,default:d},[u.exports]),g=function(e){return"pt-PT"===e?"pt_PT":e},m=r.default(Intl.NumberFormat,function(e){return h[g(e)]},function(e,t){return f[g(e)][t?"ordinal":"cardinal"]},function(e){return p[g(e)]});return Jn=m}();function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(e);if("undefined"==typeof Intl)void 0!==Pn?Pn.Intl={PluralRules:r.default}:"undefined"!=typeof window?window.Intl={PluralRules:r.default}:ti.Intl={PluralRules:r.default},r.default.polyfill=!0;else if(Intl.PluralRules&&Intl.PluralRules.prototype.selectRange){var n=["en","es","ru","zh"];Intl.PluralRules.supportedLocalesOf(n).length<n.length&&(Intl.PluralRules=r.default,r.default.polyfill=!0)}else Intl.PluralRules=r.default,r.default.polyfill=!0}();var ni={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","Failed to load files in folder":"Could not load folder contents ({{folderName}})","Failed to load subfolders in folder":'Could not load subfolders in "{{folderName}}"',"Failed to load folder items count in folder":'Could not get item count for "{{folderName}}"',"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","Save as copy and choose":"Save as copy and choose","Save and choose":"Save and choose",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..."}},ii={Files:"Файлы",selected:"выбрано",Deselected:"Отменить выбор",Refresh:"Обновить","Select all":"Выбрать все",Rename:"Переименовать","Rename file":"Переименовать файл {{currentFileName}}","Select the destination folder":"Выберите папку назначения","Selected files:":"Выбрано файлов:","Selected files":"Выбрано файлов: {{count}}",selected_files_one:"Выбран {{count}} файл",selected_files_few:"Выбрано {{count}} файла",selected_files_many:"Выбрано {{count}} файлов",selected_files_other:"Выбрано {{count}} файлов",Copy:"Дублировать",Edit:"Изменить",Move:"Переместить","Move to":"Переместить",Delete:"Удалить","New folder":"Новая папка","Image search...":"Поиск изображений...","Search icons":"Найти иконки","By name":"По имени","By size":"По размеру","By date":"По дате",List:"Список",Grid:"Плитки",Main:"Главная",Folders:"Папки","total pages":"Всего {{total}} элементов",Name:"Имя",Untitled:"Без названия",Size:"Размер",Dimensions:"Размер",Date:"Дата",error:"ошибка",Folder:"Папка",created:"создана","Failed to create folder":"Не удалось создать папку","File deleted":"Файл удален","Files deleted":"Файлы удалены","Error when deleting a file":"Ошибка при удалении файла","Folder deleted":"Папка удалена","Error when deleting a folder":"Ошибка при удалении папки","Delete folder":"Удалить папку","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Вы уверены, что хотите удалить эту папку? Это действие также удалит все файлы и подпапки.","API-endpoint for file upload is not configured":"API-endpoint для загрузки файлов не настроен","Please select an image file":"Пожалуйста, выберите файл изображения",File:"Файл","has been successfully uploaded":"успешно загружен","The URL must point to an image":"URL должен указывать на изображение","Image upload...":"Загрузка изображения...",Unknown:"Неизвестно","Error downloading file by URL":"Ошибка загрузки файла по URL","successfully uploaded":"успешно загружен","Error when downloading a file by URL":"Ошибка при загрузке файла по URL","Error when uploading a file":"Ошибка при загрузке файла","Error loading files":"Ошибка загрузки файлов","File not found":"Файл не найден","File renamed to":"Файл переименован на ","Failed to rename the file":"Не удалось переименовать файл","Folder renamed to":"Папка переименована на","Rename folder":"Переименовать папку","New folder name":"Новое название папки","Enter a new folder name":"Введите новое название папки","Please drag and drop image files only":"Пожалуйста, перетащите только файлы изображений","Upload file by URL":"Загрузить файл по URL","Upload file":"Загрузить файл","Creating a new folder":"Создание новой папки",Create:"Создать",Cancel:"Отмена","Folder name":"Название папки","Enter the name of the folder":"Введите название папки","Enter the name":"Введите название","A folder will be created inside:":"Папка будет создана внутри:","selected folder":"выбранной папки","The folder will be created in the root directory":"Папка будет создана в корневом каталоге","Failed to load folders":"Не удалось загрузить папки","Folder name cannot be empty":"Название папки не может быть пустым","Folder creation provider is not configured":"Провайдер создания папок не настроен","Folder created":"Папка создана","Folder rename is disabled by config":"Переименование папок отключено конфигурацией","Folder rename provider is not configured":"Провайдер переименования папок не настроен","Unexpected response when renaming folder":"Неожиданный ответ при переименовании папки","Folder renamed":"Папка переименована","Failed to rename folder":"Не удалось переименовать папку","Failed to load folder items count":"Не удалось получить количество файлов в папке","Failed to load subfolders":"Не удалось загрузить подпапки",Download:"Загрузить","image URL":"URL изображения","Enter the URL of the image":"Введите URL изображения","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Поддерживаемые форматы: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Новое имя файла","Enter a new file name":"Введите новое имя файла","Copy to folder":"Копировать в папку",Added:"Добавлено {{date}}","File uploaded successfully":"Файл {{fileName}} успешно загружен","Successfully uploaded":"Успешно загружено {{successCount}} из {{count}} файла","Successfully uploaded files":"Успешно загружено {{successCount}} из {{count}} файлов",uploads_success_summary:"Загружено {{successCount}} из {{totalCount}} файлов",uploads_fail_summary:"Не удалось загрузить {{failCount}} из {{totalCount}} файлов","File with this name already exists.":"Файл с таким именем уже существует.","File not found or no longer available.":"Файл не найден или уже был удалён.","You don't have permission to access this file.":"У вас нет прав доступа к этому файлу.","File is too large to upload.":"Файл слишком большой для загрузки.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"Файл слишком большой ({{fileSize}}). Максимально допустимый размер — {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Превышено максимальное количество файлов. Допустимо: {{allowed}}, выбрано: {{received}}","This file type is not allowed.":"Этот тип файла не поддерживается.","File name is not valid.":"Недопустимое имя файла.","File name is not valid. Allowed characters: {{allowedChars}}":"Недопустимое имя файла. Допустимые символы: {{allowedChars}}","Failed to read the file.":"Не удалось прочитать файл.","Failed to write the file.":"Не удалось записать файл.","The file appears to be corrupted.":"Файл повреждён или имеет неверный формат.","File integrity check failed.":"Проверка целостности файла завершилась неудачно.","Folder not found or no longer available.":"Папка не найдена или уже была удалена.","Folder with this name already exists.":"Папка с таким именем уже существует.","A folder with that name already exists. Please enter a different folder name.":"Папка с таким именем уже существует. Введите другое имя папки.","You don't have permission to access this folder.":"У вас нет прав доступа к этой папке.","Folder name is not valid.":"Недопустимое имя папки.","Folder name is not valid. Allowed characters: {{allowedChars}}":"Не удалось создать папку. Допустимые символы в названии папки: {{allowedChars}}","Failed to read the folder contents.":"Не удалось прочитать содержимое папки.","Failed to write to the folder.":"Не удалось выполнить операцию с папкой.","Folder storage quota exceeded.":"Превышена квота хранения для папки.","Folder is not empty.":"Папка не пуста.","Server error while processing the folder.":"Ошибка сервера при обработке папки.","Folder operation took too long.":"Операция с папкой выполнялась слишком долго.","Network error. Please check your connection and try again.":"Ошибка сети. Проверьте подключение к интернету и повторите попытку.","The operation took too long. Please try again.":"Операция выполнялась слишком долго. Попробуйте ещё раз.","Server error. Please try again later.":"Ошибка на сервере. Повторите попытку позже.","Service is temporarily unavailable. Please try again later.":"Сервис временно недоступен. Повторите попытку позже.","Too many requests. Please try again a bit later.":"Слишком много запросов. Попробуйте ещё раз немного позже.","Authentication failed. Please sign in again.":"Не удалось пройти аутентификацию. Пожалуйста, войдите снова.","You are not allowed to perform this action.":"У вас нет прав для выполнения этого действия.","Some of the provided data is invalid.":"Некоторые из переданных данных некорректны.","This operation is not supported.":"Эта операция не поддерживается.","Request payload is too large.":"Тело запроса слишком большое.","This media type is not supported.":"Этот тип данных не поддерживается.","You have exceeded the upload quota.":"Превышена квота на загрузку файлов.","Network error while uploading the file.":"Сетевая ошибка при загрузке файла.","File upload took too long.":"Загрузка файла выполнялась слишком долго.","Server error while uploading the file.":"Ошибка сервера при загрузке файла.","The specified URL is not valid.":"Указан некорректный URL.","The specified URL is not reachable.":"Указанный URL недоступен.","Content type at the URL is not allowed.":"Тип содержимого по указанному URL не поддерживается.","Failed to download file from the URL.":"Не удалось скачать файл по указанному URL.","Network error while downloading the file.":"Сетевая ошибка при скачивании файла.","File download took too long.":"Скачивание файла выполнялось слишком долго.","Server error while downloading the file.":"Ошибка сервера при скачивании файла.","Some items could not be processed.":"Не все элементы были обработаны успешно.","Failed to process all items in the batch.":"Не удалось обработать ни один элемент в пакетной операции.","Some items in the batch are in a conflicting state.":"Некоторые элементы в пакетной операции находятся в конфликтующем состоянии.","Some items in the batch did not pass validation.":"Некоторые элементы в пакетной операции не прошли валидацию.","AI service returned an invalid response.":"Сервис AI вернул некорректный ответ.","Failed to generate image using AI.":"Не удалось создать изображение с помощью AI.","You have reached the AI image generation limit.":"Достигнут лимит генерации изображений AI.","Error in external integration.":"Ошибка во внешней интеграции.","Error in a third-party service.":"Ошибка во внешнем сервисе.","An unknown error occurred.":"Произошла неизвестная ошибка.","Renaming is not allowed for this item.":"Переименование не разрешено для этого элемента.","Moving is not allowed for this item.":"Перемещение не разрешено для этого элемента.","Copying is not allowed for this item.":"Копирование не разрешено для этого элемента.","Deleting is not allowed for this item.":"Удаление не разрешено для этого элемента.","Cannot move an item into itself.":"Нельзя переместить элемент в самого себя.","Cannot move an item into its descendant folder.":"Нельзя переместить элемент в дочернюю папку.","Cannot copy an item into itself.":"Нельзя скопировать элемент в самого себя.","Configuration error occurred.":"Произошла ошибка конфигурации.","Storage quota exceeded. Please free up space.":"Превышена квота хранилища. Освободите место.","File is locked by another process or user.":"Файл заблокирован другим процессом или пользователем.","File version conflict. Please refresh and try again.":"Конфликт версий файла. Обновите страницу и попробуйте снова.","Batch operation exceeds the maximum number of items allowed.":"Пакетная операция превышает максимально допустимое количество элементов.",Moved:"Перемещены: {{names}}",move_success_summary:"Перемещено {{successCount}} из {{totalCount}} объектов",move_fail_summary:"Не удалось переместить {{failCount}} из {{totalCount}} объектов",Copied:"Скопированы: {{names}}",copy_success_summary:"Скопировано {{successCount}} из {{totalCount}} объектов",copy_fail_summary:"Не удалось скопировать {{failCount}} из {{totalCount}} объектов",Uploaded:"Загружены: {{names}}",Failed:"Не удалось: {{names}}","Failed to upload":"Не удалось загрузить {{failCount}} из {{count}} файла","Failed to upload files":"Не удалось загрузить {{failCount}} из {{count}} файлов",months:{january:"января",february:"февраля",march:"марта",april:"апреля",may:"мая",june:"июня",july:"июля",august:"августа",september:"сентября",october:"октября",november:"ноября",december:"декабря"},files:"файлов","No available folders":"Нет доступных папок","My files":"Мои файлы",GIF:"GIF","Stock images":"Стоковые изображения",Icons:"Иконки",AI:"AI","AI image generation":"AI генерация изображений","Search GIFs":"Найти GIF","That`s all we could find.":"Это все, что мы смогли найти.","Search image":"Найти изображение",All:"Все",Landscape:"Горизонтальные",Portrait:"Вертикальные",Squarish:"Квадратные",Black:"Черный","Black and White":"Черно-белый",White:"Белый",Orange:"Оранжевый",Red:"Красный",Purple:"Фиолетовый",Magenta:"Пурпурный",Green:"Зеленый",Teal:"Бирюзовый",Blue:"Синий","Photo by":"Фото",on:"на","File Manager":"Файловый менеджер","File Manager not configured":"Файловый менеджер не настроен","Filter by type":"Фильтр по типу","All types":"Все типы","File name":"Имя файла",Actions:"Действия","Add file":"Добавить файл","Add folder":"Добавить папку","Add file by URL":"Добавить файл по URL","File moved":"Файл перемещён","Files moved":"Файлы перемещены","Error when moving a file":"Ошибка при перемещении файла","Files copied":"Файлы скопированы","Failed to download file":"Не удалось скачать файл","Failed to load JSON data":"Не удалось загрузить данные JSON","Invalid file URL":"Некорректный URL файла","Unable to validate file URL":"Не удалось проверить файл по URL","Type to search...":"Введите для поиска...",Submit:"Отправить","No folders yet":"Папок пока нет","Drag files to upload":"Перетащите файлы для загрузки","Drop files here to upload":"Отпустите файлы здесь, чтобы загрузить их","Newest first":"Сначала новые","Oldest first":"Сначала старые","Largest first":"Сначала большие","Smallest first":"Сначала маленькие","A-Z":"По алфавиту А-Я","Z-A":"По алфавиту Я-А","By type":"По типу","Evaluating the task":"Оценка задания","Something went wrong, please try again":"Что-то пошло не так, пожалуйста, попробуйте еще раз","Sort by":"Сортировать по","preview text":"Изображение загружается ...","Use this variant":"Использовать этот вариант","Confirm deletion":"Подтвердить удаление","Are you sure you want to delete the selected items?":"Вы уверены, что хотите удалить выбранные элементы?","Move to Trash":"Переместить в корзину","Are you sure you want to move the selected items to the Trash?":"Вы уверены, что хотите переместить выбранные элементы в корзину?","Permanently delete":"Полное удаление","Delete permanently":"Удалить безвозвратно","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Вы уверены, что хотите безвозвратно удалить выбранные элементы? Это действие нельзя отменить.",Clear:"Очистить","Clear Trash":"Очистить корзину","Are you sure you want to permanently delete all items from Trash?":"Вы уверены, что хотите безвозвратно удалить все элементы из корзины?","Trash cleared successfully":"Корзина успешно очищена","{{count}} items permanently deleted":"{{count}} элементов безвозвратно удалено","Trash partially cleared":"Корзина частично очищена","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} элементов удалено, {{failed}} не удалось удалить","Failed to clear trash":"Не удалось очистить корзину","Error clearing trash":"Ошибка при очистке корзины","Deleting items...":"Удаление элементов...",delete_files_permanent_one:"Это действие безвозвратно удалит {{count}} файл",delete_files_permanent_few:"Это действие безвозвратно удалит {{count}} файла",delete_files_permanent_many:"Это действие безвозвратно удалит {{count}} файлов",delete_files_permanent_other:"Это действие безвозвратно удалит {{count}} файлов",delete_folder_permanent:"Это действие безвозвратно удалит папку «{{name}}» и всё её содержимое, включая {{count}} элементов.",delete_mixed_permanent:"Это действие безвозвратно удалит {{total}} выбранных элементов, включая {{folders}} папок и все {{images}} изображений внутри них.",permanent_delete_warning:"Удаление файлов, которые были использованы в письмах, приведет к проблемам с отображением картинок в старых письмах. Вы уверены, что хотите полностью удалить выбранное?",move_files_to_trash_one:"Это действие переместит в корзину {{count}} файл.",move_files_to_trash_few:"Это действие переместит в корзину {{count}} файла.",move_files_to_trash_many:"Это действие переместит в корзину {{count}} файлов.",move_files_to_trash_other:"Это действие переместит в корзину {{count}} файлов.",move_folder_to_trash:"Это действие переместит в корзину папку «{{name}}» и всё её содержимое ({{count}} элементов).",move_mixed_to_trash:"Это действие переместит в корзину {{total}} выбранных элементов, включая {{folders}} папок и {{images}} изображений.",delete_count_confirm_trash_one:"Переместить в корзину {{count}} файл?",delete_count_confirm_trash_few:"Переместить в корзину {{count}} файла?",delete_count_confirm_trash_many:"Переместить в корзину {{count}} файлов?",delete_count_confirm_trash_other:"Переместить в корзину {{count}} файлов?",delete_count_confirm_permanent_one:"Удалить навсегда {{count}} файл?",delete_count_confirm_permanent_few:"Удалить навсегда {{count}} файла?",delete_count_confirm_permanent_many:"Удалить навсегда {{count}} файлов?",delete_count_confirm_permanent_other:"Удалить навсегда {{count}} файлов?",delete_count_confirm_one:"Удалить {{count}} файл?",delete_count_confirm_few:"Удалить {{count}} файла?",delete_count_confirm_many:"Удалить {{count}} файлов?",delete_count_confirm_other:"Удалить {{count}} файлов?",item:"файл",items:"файлов",Trash:"Корзина",Choose:"Выбрать",Stock:"Фотосток","Select an image from our library":"Выберите изображение из нашей библиотеки","AI generation":"AI генерация","Creating an image on demand":"Создание изображения по запросу","Search file or folder":"Найти файл или папку","Click here to select a file":"Нажмите здесь, чтобы выбрать файл","Supported files:":"Поддерживаемые файлы:","Create folder":"Создать папку",Done:"Готово","Move here":"Переместить сюда","Copy here":"Копировать сюда","File URL":"URL файла","There's nothing here":"Здесь ничего нет","Try using a different search query.":"Попробуйте использовать другой поисковый запрос.","Millions of free stock images":"Миллионы бесплатных стоковых изображений","Enter a search query and we'll find the perfect image for you":"Введите поисковый запрос, и мы найдем для вас идеальное изображение","Millions of icons":"Миллионы иконок","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":"Введите запрос и мы найдем для вас подходящее","Over 350,000 live images":"Более 350 000 живых изображений","The folder will be created in the root directory.":"Папка будет создана в корневом каталоге.",undo:"ОТМЕНА",moved_to_trash_one:"Перемещён {{count}} элемент в корзину",moved_to_trash_few:"Перемещено {{count}} элемента в корзину",moved_to_trash_many:"Перемещено {{count}} элементов в корзину",moved_to_trash_other:"Перемещено {{count}} элементов в корзину",restored_items_one:"Восстановлён {{count}} элемент",restored_items_few:"Восстановлено {{count}} элемента",restored_items_many:"Восстановлено {{count}} элементов",restored_items_other:"Восстановлено {{count}} элементов",Type:"Тип","Generate image":"Cгенерировать изображение","A beautiful image of a sunset over a calm ocean.":"Красивое изображение заката над спокойным океаном.","For example:":"Например:",Insert:"Вставить",Error:"Ошибка","Upload progress":"Загрузка {{completed}}/{{total}}","Uploading files":"Загрузка {{completed}}/{{total}} файлов","Uploaded files":"Загружено {{success}} из {{total}} файлов","Upload error files":"Ошибка загрузки {{errorCount}} файлов","Applies to all {{count}} files":"(применительно ко всем {{count}} файлам)","Some files failed to upload":"Некоторые файлы не удалось загрузить. Проверьте размер и формат файлов.",upload_error_hint_invalid_name:"Переименуйте файл: используйте только буквы, цифры, дефис и подчёркивание.",upload_error_hint_size:"Уменьшите размер файла или выберите другой.",upload_error_hint_format:"Используйте допустимый формат: JPG, PNG или GIF.",upload_error_hint_exists:"Файл с таким именем уже есть в папке. Переименуйте файл.","Images generated successfully":"Изображения успешно сгенерированы","Trash is empty":"Корзина пуста","Deleted files will be displayed here":"Здесь будут отображаться удаленные файлы","Stroke width":"Толщина:",Style:"Стиль",Color1:"Цвет 1:",Color2:"Цвет 2:",Color3:"Цвет 3: ","Global search":"Глобальный поиск","Family search":"Поиск по семейству","Choose for template":"Выбрать для загрузки в шаблон",Back:"Назад","Editing: {{name}}":"Редактирование: {{name}}","Editing image":"Редактирование изображения",Save:"Сохранить","Loading editor...":"Загрузка редактора…","Error loading image":"Ошибка загрузки изображения","Error saving image":"Ошибка при сохранении изображения","Error initializing editor":"Ошибка инициализации редактора","Close File Manager":"Закрыть файловый менеджер","Are you sure you want to close? Unsaved changes will be lost.":"Вы уверены, что хотите закрыть? Несохраненные изменения будут потеряны.","Are you sure you want to close the file manager?":"Вы уверены, что хотите закрыть файловый менеджер?",Close:"Закрыть",KB:"КБ","No files":"Нет файлов","Folder is empty or files not found":"Папка пуста или файлы не найдены","Search files...":"Поиск файлов...",Success:"Успех","Image updated successfully":"Изображение успешно обновлено","Failed to save changes":"Не удалось сохранить изменения: {{error}}","Unknown error":"Неизвестная ошибка","Select destination folder":"Выберите папку назначения","Error moving":"Ошибка при перемещении","Error deleting":"Ошибка при удалении","Error copying":"Ошибка при копировании","Error renaming":"Ошибка при переименовании","Failed to refresh folder tree":"Не удалось обновить дерево папок","Failed to refresh file list":"Не удалось обновить список файлов","Errors occurred while moving":"При перемещении произошли ошибки","Errors occurred while copying":"При копировании произошли ошибки","(error)":"(ошибка)","(circular reference)":"(циклическая ссылка)","File too large. Maximum size: {{size}}":"Файл слишком большой. Максимальный размер: {{size}}","File too small. Minimum size: {{size}}":"Файл слишком маленький. Минимальный размер: {{size}}","Unsupported file type":"Неподдерживаемый тип файла","Unsupported file type: {{type}}":"Неподдерживаемый тип файла: {{type}}",unknown:"неизвестный","Failed to load files":"Не удалось загрузить файлы","Failed to load files in folder":"Не удалось загрузить содержимое папки «{{folderName}}»","Failed to load subfolders in folder":"Не удалось загрузить подпапки в «{{folderName}}»","Failed to load folder items count in folder":"Не удалось получить число элементов в «{{folderName}}»","DataProvider for folder deletion is not configured":"DataProvider для удаления папок не настроен","DataProvider for file upload is not configured":"DataProvider для загрузки файлов не настроен","Error uploading file {{fileName}}":"Ошибка при загрузке файла {{fileName}}","Error uploading file":"Ошибка при загрузке файла","Cannot upload files to Trash":"Нельзя загружать файлы в корзину","Please fill in all fields":"Заполните все поля","URL too long":"URL слишком длинный","Only http and https URLs are supported":"Поддерживаются только URL с протоколом http и https","Private and local URLs are not allowed":"Локальные и приватные URL запрещены","Upload by URL is not supported":"Загрузка по URL не поддерживается","File name is too long. Maximum {{max}} characters":"Имя файла слишком длинное. Максимум {{max}} символов","File name contains invalid characters":"Имя файла содержит недопустимые символы","Large file may take a long time to upload":"Большой файл может загружаться долго","File unavailable: {{status}} {{statusText}}":"Файл недоступен: {{status}} {{statusText}}","File too large: {{size}}":"Файл слишком большой: {{size}}","Unsupported file type: {{contentType}}":"Неподдерживаемый тип файла: {{contentType}}","Invalid server response: folder ID is missing":"Некорректный ответ от сервера: отсутствует ID папки","Error: folder cannot be its own parent":"Ошибка: папка не может быть родителем самой себя","Upload to Trash is forbidden":"Загрузка в корзину запрещена","renameFolder is not implemented in dataProviders":"renameFolder не реализован в dataProviders","renameFile is not implemented in dataProviders":"renameFile не реализован в dataProviders",Deleted:"Удаленные файлы",Clean:"Очистить","Circular dependency detected: folder cannot be its own parent":"Обнаружена циклическая зависимость: папка не может быть родителем самой себя","Save as copy and choose":"Сохранить как копию и выбрать","Save and choose":"Сохранить и выбрать",pixie:{"added drawing":"Добавление рисунка","added frame":"Добавление рамки","added image":"Добавление изображения","added shape":"Добавление фигуры","added sticker":"Добавление стикера","added text":"Добавление текста","applied filters":"Применение фильтр",apply:"Применить",background:"Фон","background color":"Фоновый цвет",beach:"Пляж","brush color":"Цвет кисти","brush size":"Размер кисти","brush type":"Тип кисти",bubbles:"Пузырьки",Cancel:"Отмена","changed style":"Изменение стиля","Circle Brush":"Круги",close:"Закрыть",color:"Цвет",corners:"Углы",crop:"Обрезать",Custom:"Пользовательский","deleted object":"Удаление объекта","Diamond Brush":"Алмаз",doodles:"Цветные",draw:"Рисунок",emoticons:"Смайлики","Eraser Brush":"Ластик",filter:"Фильтр",font:"Шрифт","font size":"Размер шрифта",frame:"Рамка",gradient:"Градиент",height:"Высота",history:"История","H Line Brush":"Н-образная",image:"Изображение",initial:"Начальный",landmarks:"Достопримечательности","loaded state":"Загрузка состояния","loading canvas":"Загрузка","loading image":"Загрузка","loading state":"Загрузка","maintain aspect ratio":"Maintain aspect ratio",merge:"Объединение","merged objects":"Объединение объектов","new text":"Новая надпись",objects:"Объект",opacity:"Прозрачность",outline:"Контур","outline color":"Цвет контура","Pencil Brush":"Карандаш","processing image":"Загрузка",quality:"Качество",radius:"Радиус","replace image":"Replace Image","replaced background image":"Удаление фонового изображения",resize:"Размер","resized image":"Изменение размера","rounded corner":"Загругление углов",save:"Сохранить",shadow:"Тень","shadow color":"Цвет тени",shapes:"Фигуры","Spray Brush":"Спрей",square:"Квардрат","Square Brush":"Квардрат",stickers:"Стикеры",text:"Надпись",texture:"Текстура",transportation:"Транспорт","V Line Brush":"V-образная",width:"Ширина",grayscale:"Оттенки серого","black & White":"Черно-белый",sharpen:"Резкость",invert:"Инверсия",vintage:"Винтаж",polaroid:"Полароид",kodachrome:"Кодахром",technicolor:"Техниколор",brownie:"Коричневый",sepia:"Сепия","remove Color":"Удалить цвет",brightness:"Яркость",gamma:"Гамма",noise:"Шум",pixelate:"Пиксельизация",blur:"Размытие",emboss:"Тиснение","blend Color":"Смешать цвет",distance:"Расстояние",red:"Красный",green:"Зеленый",blue:"Синий",blocksize:"Размер блока",alpha:"Альфа",add:"Добавить",multiply:"Умножить",subtract:"Вычесть",diff:"Разница",screen:"Экран",lighten:"Осветлить",darken:"Затемнить","select an option...":"Выберите опцию..."}},oi={Files:"Файли",selected:"обрано",Deselected:"Скасувати вибір",Refresh:"Оновити","Select all":"Вибрати все",Rename:"Перейменувати","Rename file":"Перейменувати файл {{currentFileName}}","Select the destination folder":"Виберіть папку призначення","Selected files:":"Обрано файлів:","Selected files":"Обрано файлів: {{count}}",selected_files_one:"Обрано {{count}} файл",selected_files_few:"Обрано {{count}} файли",selected_files_many:"Обрано {{count}} файлів",selected_files_other:"Обрано {{count}} файлів",Copy:"Дублювати",Edit:"Змінити",Move:"Перемістити","Move to":"Перемістити",Delete:"Видалити","New folder":"Нова папка","Image search...":"Пошук зображень...","Search icons":"Знайти іконки","By name":"За назвою","By size":"За розміром","By date":"За датою",List:"Список",Grid:"Плитки",Main:"Головна",Folders:"Папки","total pages":"Всього {{total}} елементів",Name:"Назва",Untitled:"Без назви",Size:"Розмір",Dimensions:"Розмір",Date:"Дата",error:"помилка",Folder:"Папка",created:"створена","Failed to create folder":"Не вдалося створити папку","File deleted":"Файл видалено","Error when deleting a file":"Помилка при видаленні файлу","Folder deleted":"Папку видалено","Error when deleting a folder":"Помилка при видаленні папки","Delete folder":"Видалити папку","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Ви впевнені, що хочете видалити цю папку? Ця дія також видалить усі файли та підпапки.","API-endpoint for file upload is not configured":"API-endpoint для завантаження файлів не налаштовано","Please select an image file":"Будь ласка, виберіть файл зображення",File:"Файл","has been successfully uploaded":"успішно завантажено","The URL must point to an image":"URL повинен вказувати на зображення","Image upload...":"Завантаження зображення...",Unknown:"Невідомо","Error downloading file by URL":"Помилка завантаження файлу за URL","successfully uploaded":"успішно завантажено","Error when downloading a file by URL":"Помилка при завантаженні файлу за URL","Error when uploading a file":"Помилка при завантаженні файлу","Error loading files":"Помилка завантаження файлів","File not found":"Файл не знайдено","File renamed to":"Файл перейменовано на ","Failed to rename the file":"Не вдалося перейменувати файл","Folder renamed to":"Папку перейменовано на","Rename folder":"Перейменувати папку","New folder name":"Нова назва папки","Enter a new folder name":"Введіть нову назву папки","Please drag and drop image files only":"Будь ласка, перетягуйте лише файли зображень","Upload file by URL":"Завантажити файл за URL","Upload file":"Завантажити файл","Creating a new folder":"Створення нової папки",Create:"Створити",Cancel:"Скасувати","Folder name":"Назва папки","Enter the name of the folder":"Введіть назву папки","Enter the name":"Введіть назву","A folder will be created inside:":"Папка буде створена всередині:","selected folder":"обраної папки","The folder will be created in the root directory":"Папка буде створена в кореневому каталозі","Failed to load folders":"Не вдалося завантажити папки","Folder name cannot be empty":"Назва папки не може бути порожньою","Folder creation provider is not configured":"Постачальник створення папок не налаштований","Folder created":"Папку створено","Folder rename is disabled by config":"Перейменування папок вимкнено в налаштуваннях","Folder rename provider is not configured":"Постачальник перейменування папок не налаштований","Unexpected response when renaming folder":"Неочікувана відповідь під час перейменування папки","Folder renamed":"Папку перейменовано","Failed to rename folder":"Не вдалося перейменувати папку","Failed to load folder items count":"Не вдалося отримати кількість елементів у папці","Failed to load subfolders":"Не вдалося завантажити підпапки",Download:"Завантажити","image URL":"URL зображення","Enter the URL of the image":"Введіть URL зображення","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Підтримувані формати: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Нова назва файлу","Enter a new file name":"Введіть нову назву файлу","Copy to folder":"Копіювати в папку",Added:"Додано {{date}}","File uploaded successfully":"Файл {{fileName}} успішно завантажено","Successfully uploaded":"Успішно завантажено {{successCount}} з {{count}} файлу","Successfully uploaded files":"Успішно завантажено {{successCount}} з {{count}} файлів",uploads_success_summary:"Завантажено {{successCount}} з {{totalCount}} файлів",uploads_fail_summary:"Не вдалося завантажити {{failCount}} з {{totalCount}} файлів","File with this name already exists.":"Файл з такою назвою вже існує.","File not found or no longer available.":"Файл не знайдено або його вже видалено.","You don't have permission to access this file.":"У вас немає прав доступу до цього файлу.","File is too large to upload.":"Файл занадто великий для завантаження.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"Файл занадто великий ({{fileSize}}). Дозволений максимальний розмір — {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Перевищено максимальну кількість файлів. Дозволено: {{allowed}}, обрано: {{received}}","This file type is not allowed.":"Цей тип файлу не підтримується.","File name is not valid.":"Неприпустима назва файлу.","File name is not valid. Allowed characters: {{allowedChars}}":"Неприпустима назва файлу. Допустимі символи: {{allowedChars}}","Failed to read the file.":"Не вдалося прочитати файл.","Failed to write the file.":"Не вдалося записати файл.","The file appears to be corrupted.":"Файл пошкоджений або має неправильний формат.","File integrity check failed.":"Перевірка цілісності файлу завершилась невдало.","Folder not found or no longer available.":"Папку не знайдено або її вже видалено.","Folder with this name already exists.":"Папка з такою назвою вже існує.","A folder with that name already exists. Please enter a different folder name.":"Папка з такою назвою вже існує. Введіть інше ім'я папки.","You don't have permission to access this folder.":"У вас немає прав доступу до цієї папки.","Folder name is not valid.":"Неприпустима назва папки.","Folder name is not valid. Allowed characters: {{allowedChars}}":"Не вдалося створити папку. Допустимі символи в назві папки: {{allowedChars}}","Failed to read the folder contents.":"Не вдалося прочитати вміст папки.","Failed to write to the folder.":"Не вдалося виконати операцію з папкою.","Folder storage quota exceeded.":"Перевищено квоту зберігання для папки.","Folder is not empty.":"Папка не порожня.","Server error while processing the folder.":"Помилка сервера під час обробки папки.","Folder operation took too long.":"Операція з папкою зайняла надто багато часу.","Network error. Please check your connection and try again.":"Помилка мережі. Перевірте підключення до інтернету та повторіть спробу.","The operation took too long. Please try again.":"Операція виконувалася надто довго. Спробуйте ще раз.","Server error. Please try again later.":"Помилка на сервері. Повторіть спробу пізніше.","Service is temporarily unavailable. Please try again later.":"Сервіс тимчасово недоступний. Повторіть спробу пізніше.","Too many requests. Please try again a bit later.":"Занадто багато запитів. Спробуйте ще раз пізніше.","Authentication failed. Please sign in again.":"Не вдалося пройти автентифікацію. Будь ласка, увійдіть знову.","You are not allowed to perform this action.":"У вас немає прав для виконання цієї дії.","Some of the provided data is invalid.":"Деякі з переданих даних є некоректними.","This operation is not supported.":"Ця операція не підтримується.","Request payload is too large.":"Тіло запиту занадто велике.","This media type is not supported.":"Цей тип даних не підтримується.","You have exceeded the upload quota.":"Перевищено квоту на завантаження файлів.","Network error while uploading the file.":"Помилка мережі під час завантаження файлу.","File upload took too long.":"Завантаження файлу тривало надто довго.","Server error while uploading the file.":"Помилка сервера під час завантаження файлу.","The specified URL is not valid.":"Вказано некоректну URL-адресу.","The specified URL is not reachable.":"Вказана URL-адреса недоступна.","Content type at the URL is not allowed.":"Тип вмісту за вказаною URL-адресою не підтримується.","Failed to download file from the URL.":"Не вдалося завантажити файл за вказаною URL-адресою.","Network error while downloading the file.":"Помилка мережі під час завантаження файлу.","File download took too long.":"Завантаження файлу тривало надто довго.","Server error while downloading the file.":"Помилка сервера під час завантаження файлу.","Some items could not be processed.":"Не всі елементи були оброблені успішно.","Failed to process all items in the batch.":"Не вдалося обробити жоден елемент у пакетній операції.","Some items in the batch are in a conflicting state.":"Деякі елементи в пакетній операції перебувають у конфліктному стані.","Some items in the batch did not pass validation.":"Деякі елементи в пакетній операції не пройшли валідацію.","AI service returned an invalid response.":"Сервіс ШІ повернув некоректну відповідь.","Failed to generate image using AI.":"Не вдалося створити зображення за допомогою ШІ.","You have reached the AI image generation limit.":"Досягнуто ліміту генерації зображень ШІ.","Error in external integration.":"Помилка у зовнішній інтеграції.","Error in a third-party service.":"Помилка у зовнішньому сервісі.","An unknown error occurred.":"Сталася невідома помилка.","Renaming is not allowed for this item.":"Перейменування не дозволено для цього елемента.","Moving is not allowed for this item.":"Переміщення не дозволено для цього елемента.","Copying is not allowed for this item.":"Копіювання не дозволено для цього елемента.","Deleting is not allowed for this item.":"Видалення не дозволено для цього елемента.","Cannot move an item into itself.":"Не можна перемістити елемент у самого себе.","Cannot move an item into its descendant folder.":"Не можна перемістити елемент у дочірню папку.","Cannot copy an item into itself.":"Не можна скопіювати елемент у самого себе.","Configuration error occurred.":"Сталася помилка конфігурації.","Storage quota exceeded. Please free up space.":"Перевищено квоту сховища. Звільніть місце.","File is locked by another process or user.":"Файл заблоковано іншим процесом або користувачем.","File version conflict. Please refresh and try again.":"Конфлікт версій файлу. Оновіть сторінку та спробуйте ще раз.","Batch operation exceeds the maximum number of items allowed.":"Пакетна операція перевищує максимально допустиму кількість елементів.",Moved:"Переміщено: {{names}}",move_success_summary:"Переміщено {{successCount}} з {{totalCount}} елементів",move_fail_summary:"Не вдалося перемістити {{failCount}} з {{totalCount}} елементів",Copied:"Скопійовано: {{names}}",copy_success_summary:"Скопійовано {{successCount}} з {{totalCount}} елементів",copy_fail_summary:"Не вдалося скопіювати {{failCount}} з {{totalCount}} елементів",Uploaded:"Завантажено: {{names}}",Failed:"Не вдалося завантажити: {{names}}","Failed to upload":"Не вдалося завантажити {{failCount}} з {{count}} файлу","Failed to upload files":"Не вдалося завантажити {{failCount}} з {{count}} файлів",months:{january:"січня",february:"лютого",march:"березня",april:"квітня",may:"травня",june:"червня",july:"липня",august:"серпня",september:"вересня",october:"жовтня",november:"листопада",december:"грудня"},files:"файлів","No available folders":"Немає доступних папок","My files":"Мої файли",GIF:"GIF","Stock images":"Стокові зображення",AI:"AI","AI image generation":"AI генерація зображень","Search GIFs":"Знайти GIF","That`s all we could find.":"Це все, що ми змогли знайти.","Search image":"Знайти зображення",All:"Всі",Landscape:"Горизонтальні",Portrait:"Вертикальні",Squarish:"Квадратні",Black:"Чорний","Black and White":"Чорно-білий",White:"Білий",Orange:"Помаранчевий",Red:"Червоний",Purple:"Фіолетовий",Magenta:"Пурпурний",Green:"Зелений",Teal:"Бірюзовий",Blue:"Синій","Photo by":"Фото",on:"на","File Manager":"Файловий менеджер","File Manager not configured":"Файловий менеджер не налаштовано","Filter by type":"Фільтр за типом","All types":"Всі типи","File name":"Назва файлу",Actions:"Дії","Add file":"Додати файл","Add folder":"Додати папку","Add file by URL":"Додати файл за URL","File moved":"Файл переміщено","Error when moving a file":"Помилка при переміщенні файлу","Failed to download file":"Не вдалося завантажити файл","Failed to load JSON data":"Не вдалося завантажити дані JSON","Invalid file URL":"Некоректний URL файлу","Unable to validate file URL":"Не вдалося перевірити файл за URL","Type to search...":"Введіть для пошуку...",Submit:"Надіслати","No folders yet":"Папок поки немає","Drag files to upload":"Перетягніть файли для завантаження","Drop files here to upload":"Відпустіть файли тут, щоб завантажити їх","Newest first":"Спочатку нові","Oldest first":"Спочатку старі","Largest first":"Спочатку великі","Smallest first":"Спочатку маленькі","A-Z":"За алфавітом А-Я","Z-A":"За алфавітом Я-А","By type":"За типом","Evaluating the task":"Оцінка завдання","Something went wrong, please try again":"Щось пішло не так, будь ласка, спробуйте ще раз","Sort by":"Сортувати за","preview text":"Зображення завантажується ...","Use this variant":"Використати цей варіант","Confirm deletion":"Підтвердити видалення","Are you sure you want to delete the selected items?":"Ви впевнені, що хочете видалити обрані елементи?","Move to Trash":"Перемістити в кошик","Are you sure you want to move the selected items to the Trash?":"Ви впевнені, що хочете перемістити обрані елементи в кошик?","Permanently delete":"Повне видалення","Delete permanently":"Видалити безповоротно","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Ви впевнені, що хочете безповоротно видалити обрані елементи? Цю дію не можна скасувати.",Clear:"Очистити","Clear Trash":"Очистити кошик","Are you sure you want to permanently delete all items from Trash?":"Ви впевнені, що хочете безповоротно видалити всі елементи з кошика?","Trash cleared successfully":"Кошик успішно очищено","{{count}} items permanently deleted":"{{count}} елементів безповоротно видалено","Trash partially cleared":"Кошик частково очищено","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} елементів видалено, {{failed}} не вдалося видалити","Failed to clear trash":"Не вдалося очистити кошик","Error clearing trash":"Помилка при очищенні кошика","Deleting items...":"Видалення елементів...",delete_files_permanent_one:"Ця дія безповоротно видалить {{count}} файл",delete_files_permanent_few:"Ця дія безповоротно видалить {{count}} файли",delete_files_permanent_many:"Ця дія безповоротно видалить {{count}} файлів",delete_files_permanent_other:"Ця дія безповоротно видалить {{count}} файлів",delete_folder_permanent:"Ця дія безповоротно видалить папку «{{name}}» і все її вміст, включаючи {{count}} елементів.",delete_mixed_permanent:"Ця дія безповоротно видалить {{total}} обраних елементів, включаючи {{folders}} папок і всі {{images}} зображень всередині них.",permanent_delete_warning:"Видалення файлів, які були використані в листах, призведе до проблем з відображенням зображень у старих листах. Ви впевнені, що хочете повністю видалити обране?",move_files_to_trash_one:"Ця дія перемістить у кошик {{count}} файл.",move_files_to_trash_few:"Ця дія перемістить у кошик {{count}} файли.",move_files_to_trash_many:"Ця дія перемістить у кошик {{count}} файлів.",move_files_to_trash_other:"Ця дія перемістить у кошик {{count}} файлів.",move_folder_to_trash:"Ця дія перемістить у кошик папку «{{name}}» і все її вміст ({{count}} елементів).",move_mixed_to_trash:"Ця дія перемістить у кошик {{total}} обраних елементів, включаючи {{folders}} папок і {{images}} зображень.",delete_count_confirm_trash_one:"Перемістити в кошик {{count}} файл?",delete_count_confirm_trash_few:"Перемістити в кошик {{count}} файли?",delete_count_confirm_trash_many:"Перемістити в кошик {{count}} файлів?",delete_count_confirm_trash_other:"Перемістити в кошик {{count}} файлів?",delete_count_confirm_permanent_one:"Видалити назавжди {{count}} файл?",delete_count_confirm_permanent_few:"Видалити назавжди {{count}} файли?",delete_count_confirm_permanent_many:"Видалити назавжди {{count}} файлів?",delete_count_confirm_permanent_other:"Видалити назавжди {{count}} файлів?",delete_count_confirm_one:"Видалити {{count}} файл?",delete_count_confirm_few:"Видалити {{count}} файли?",delete_count_confirm_many:"Видалити {{count}} файлів?",delete_count_confirm_other:"Видалити {{count}} файлів?",item:"файл",items:"файлів",Trash:"Видалені",Choose:"Обрати",Stock:"Фотосток","Select an image from our library":"Виберіть зображення з нашої бібліотеки","AI generation":"AI генерація","Creating an image on demand":"Створення зображення на замовлення","Search file or folder":"Знайти файл або папку","Click here to select a file":"Натисніть тут, щоб вибрати файл","Supported files:":"Підтримувані файли:","Create folder":"Створити папку",Done:"Готово","Move here":"Перемістити сюди","Copy here":"Копіювати сюди","File URL":"URL файлу","There's nothing here":"Тут нічого немає","Try using a different search query.":"Спробуйте використовувати інший пошуковий запит.","Millions of free stock images":"Мільйони безкоштовних стокових зображень","Enter a search query and we'll find the perfect image for you":"Введіть пошуковий запит, і ми знайдемо для вас ідеальне зображення","Millions of icons":"Мільйони іконок","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":"Введіть запит і ми знайдемо для вас відповідне","Over 350,000 live images":"Понад 350 000 живих зображень","The folder will be created in the root directory.":"Папка буде створена в кореневому каталозі.",undo:"СКАСУВАТИ",moved_to_trash_one:"Переміщено {{count}} елемент у кошик",moved_to_trash_few:"Переміщено {{count}} елементи у кошик",moved_to_trash_many:"Переміщено {{count}} елементів у кошик",moved_to_trash_other:"Переміщено {{count}} елементів у кошик",restored_items_one:"Відновлено {{count}} елемент",restored_items_few:"Відновлено {{count}} елементи",restored_items_many:"Відновлено {{count}} елементів",restored_items_other:"Відновлено {{count}} елементів",Type:"Тип","Generate image":"Створити зображення","A beautiful image of a sunset over a calm ocean.":"Красиве зображення заходу сонця над спокійним океаном.","For example:":"Наприклад:",Insert:"Вставити",Error:"Помилка","Upload progress":"Завантаження {{completed}}/{{total}}","Uploading files":"Завантаження {{completed}}/{{total}} файлів","Uploaded files":"Завантажено {{success}} з {{total}} файлів","Upload error files":"Помилка завантаження {{errorCount}} файлів","Applies to all {{count}} files":"(стосується всіх {{count}} файлів)","Some files failed to upload":"Деякі файли не вдалося завантажити. Перевірте розмір та формат файлів.",upload_error_hint_invalid_name:"Перейменуйте файл: використовуйте лише літери, цифри, дефіс та підкреслення.",upload_error_hint_size:"Зменшіть розмір файлу або оберіть інший.",upload_error_hint_format:"Оберіть дозволений формат: JPG, PNG або GIF.",upload_error_hint_exists:"Файл з такою назвою вже є в папці. Перейменуйте файл.","Images generated successfully":"Зображення успішно створено","Choose for template":"Вибрати для завантаження в шаблон","Trash is empty":"Кошик порожній","Deleted files will be displayed here":"Тут будуть відображатися видалені файли","Editing: {{name}}":"Редагування: {{name}}","Editing image":"Редагування зображення",Save:"Зберегти","Loading editor...":"Завантаження редактора…","Error loading image":"Помилка завантаження зображення","Error saving image":"Помилка при збереженні зображення","Error initializing editor":"Помилка ініціалізації редактора","Close File Manager":"Закрити файловий менеджер","Are you sure you want to close? Unsaved changes will be lost.":"Ви впевнені, що хочете закрити? Незбережені зміни будуть втрачені.","Are you sure you want to close the file manager?":"Ви впевнені, що хочете закрити файловий менеджер?",Close:"Закрити",KB:"КБ","No files":"Немає файлів","Folder is empty or files not found":"Папка порожня або файли не знайдені","Search files...":"Пошук файлів...",Success:"Успіх","Image updated successfully":"Зображення успішно оновлено","Failed to save changes":"Не вдалося зберегти зміни: {{error}}","Unknown error":"Невідома помилка","Select destination folder":"Виберіть папку призначення","Error moving":"Помилка при переміщенні","Error deleting":"Помилка при видаленні","Error copying":"Помилка при копіюванні","Error renaming":"Помилка при перейменуванні","Failed to refresh folder tree":"Не вдалося оновити дерево папок","Failed to refresh file list":"Не вдалося оновити список файлів","Errors occurred while moving":"Під час переміщення виникли помилки","Errors occurred while copying":"Під час копіювання виникли помилки","(error)":"(помилка)","(circular reference)":"(циклічне посилання)","File too large. Maximum size: {{size}}":"Файл занадто великий. Максимальний розмір: {{size}}","File too small. Minimum size: {{size}}":"Файл занадто маленький. Мінімальний розмір: {{size}}","Unsupported file type":"Непідтримуваний тип файлу","Unsupported file type: {{type}}":"Непідтримуваний тип файлу: {{type}}",unknown:"невідомий","Failed to load files":"Не вдалося завантажити файли","Failed to load files in folder":"Не вдалося завантажити вміст папки «{{folderName}}»","Failed to load subfolders in folder":"Не вдалося завантажити підпапки в «{{folderName}}»","Failed to load folder items count in folder":"Не вдалося отримати кількість елементів у «{{folderName}}»","DataProvider for folder deletion is not configured":"DataProvider для видалення папок не налаштовано","DataProvider for file upload is not configured":"DataProvider для завантаження файлів не налаштовано","Error uploading file {{fileName}}":"Помилка при завантаженні файлу {{fileName}}","Error uploading file":"Помилка при завантаженні файлу","Cannot upload files to Trash":"Не можна завантажувати файли в кошик","Please fill in all fields":"Заповніть усі поля","URL too long":"URL занадто довгий","Only http and https URLs are supported":"Підтримуються лише URL з протоколом http та https","Private and local URLs are not allowed":"Локальні та приватні URL заборонені","Upload by URL is not supported":"Завантаження за URL не підтримується","File name is too long. Maximum {{max}} characters":"Ім'я файлу занадто довге. Максимум {{max}} символів","File name contains invalid characters":"Ім'я файлу містить неприпустимі символи","Large file may take a long time to upload":"Великий файл може завантажуватися довго","File unavailable: {{status}} {{statusText}}":"Файл недоступний: {{status}} {{statusText}}","File too large: {{size}}":"Файл занадто великий: {{size}}","Unsupported file type: {{contentType}}":"Непідтримуваний тип файлу: {{contentType}}","Invalid server response: folder ID is missing":"Некорректна відповідь сервера: відсутній ID папки","Error: folder cannot be its own parent":"Помилка: папка не може бути батьком самої себе","Upload to Trash is forbidden":"Завантаження в кошик заборонено","renameFolder is not implemented in dataProviders":"renameFolder не реалізовано в dataProviders","renameFile is not implemented in dataProviders":"renameFile не реалізовано в dataProviders",Clean:"Очистити","Circular dependency detected: folder cannot be its own parent":"Виявлено циклічну залежність: папка не може бути батьком самої себе","Save as copy and choose":"Зберегти як копію і вибрати","Save and choose":"Зберегти і вибрати",pixie:{"added drawing":"Додавання малюнка","added frame":"Додавання рамки","added image":"Додавання зображення","added shape":"Додавання фігури","added sticker":"Додавання стікера","added text":"Додавання тексту","applied filters":"Застосування фільтр",apply:"Застосувати",background:"Фон","background color":"Фоновий колір",beach:"Пляж","brush color":"Колір кисті","brush size":"Розмір кисті","brush type":"Тип кисті",bubbles:"Пузирці",Cancel:"Скасувати","changed style":"Зміна стилю","Circle Brush":"Кола",close:"Закрити",color:"Колір",corners:"Кути",crop:"Обрізати",Custom:"Користувацький","deleted object":"Видалення об'єкта","Diamond Brush":"Алмаз",doodles:"Кольорові",draw:"Малюнок",emoticons:"Смайлики","Eraser Brush":"Гумка",filter:"Фільтр",font:"Шрифт","font size":"Розмір шрифту",frame:"Рамка",gradient:"Градієнт",height:"Висота",history:"Історія","H Line Brush":"Н-подібна",image:"Зображення",initial:"Початковий",landmarks:"Пам'ятки","loaded state":"Завантаження стану","loading canvas":"Завантаження","loading image":"Завантаження","loading state":"Завантаження","maintain aspect ratio":"Maintain aspect ratio",merge:"Об'єднання","merged objects":"Об'єднання об'єктів","new text":"Новий напис",objects:"Об'єкт",opacity:"Прозорість",outline:"Контур","outline color":"Колір контуру","Pencil Brush":"Олівець","processing image":"Завантаження",quality:"Якість",radius:"Радіус","replace image":"Replace Image","replaced background image":"Видалення фонового зображення",resize:"Розмір","resized image":"Зміна розміру","rounded corner":"Заокруглення кутів",save:"Зберегти",shadow:"Тінь","shadow color":"Колір тіні",shapes:"Фігури","Spray Brush":"Спрей",square:"Квадрат","Square Brush":"Квадрат",stickers:"Стікери",text:"Напис",texture:"Текстура",transportation:"Транспорт","V Line Brush":"V-подібна",width:"Ширина",grayscale:"Відтінки сірого","black & White":"Чорно-білий",sharpen:"Різкість",invert:"Інверсія",vintage:"Вінтаж",polaroid:"Полароїд",kodachrome:"Кодахром",technicolor:"Техніколор",brownie:"Коричневий",sepia:"Сепія","remove Color":"Видалити колір",brightness:"Яскравість",gamma:"Гамма",noise:"Шум",pixelate:"Пікселізація",blur:"Розмиття",emboss:"Тиснення","blend Color":"Змішати колір",distance:"Відстань",red:"Червоний",green:"Зелений",blue:"Синій",blocksize:"Розмір блоку",alpha:"Альфа",add:"Додати",multiply:"Помножити",subtract:"Відняти",diff:"Різниця",screen:"Екран",lighten:"Освітлити",darken:"Затемнити","select an option...":"Виберіть опцію..."}},ai={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 ícones","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ítulo",Size:"Tamanho",Dimensions:"Dimensões",Date:"Data",error:"erro",Folder:"Pasta",created:"criada","Failed to create folder":"Falha ao criar pasta","File deleted":"Arquivo excluído","Error when deleting a file":"Erro ao excluir arquivo","Folder deleted":"Pasta excluída","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ção também excluirá todos os arquivos e subpastas.","API-endpoint for file upload is not configured":"Endpoint da API para upload de arquivos não está 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ão 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á criada dentro de:","selected folder":"pasta selecionada","The folder will be created in the root directory":"A pasta será criada no diretório raiz","Failed to load folders":"Não foi possível carregar as pastas","Folder name cannot be empty":"O nome da pasta não pode estar vazio","Folder creation provider is not configured":"O provedor de criação de pastas não está configurado","Folder created":"Pasta criada","Folder rename is disabled by config":"Renomear pastas está desabilitado pela configuração","Folder rename provider is not configured":"O provedor de renomeação de pastas não está configurado","Unexpected response when renaming folder":"Resposta inesperada ao renomear a pasta","Folder renamed":"Pasta renomeada","Failed to rename folder":"Não foi possível renomear a pasta","Failed to load folder items count":"Não foi possível obter a contagem de itens da pasta","Failed to load subfolders":"Não foi possível 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á existe um arquivo com esse nome.","File not found or no longer available.":"O arquivo não foi encontrado ou já foi excluído.","You don't have permission to access this file.":"Você não tem permissão para acessar este arquivo.","File is too large to upload.":"O arquivo é grande demais para ser enviado.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"O arquivo é grande demais ({{fileSize}}). Tamanho máximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Número máximo de arquivos excedido. Permitido: {{allowed}}, recebido: {{received}}","This file type is not allowed.":"Este tipo de arquivo não é permitido.","File name is not valid.":"O nome do arquivo não é válido.","File name is not valid. Allowed characters: {{allowedChars}}":"O nome do arquivo não é válido. Caracteres permitidos: {{allowedChars}}","Failed to read the file.":"Não foi possível ler o arquivo.","Failed to write the file.":"Não foi possível gravar o arquivo.","The file appears to be corrupted.":"O arquivo parece estar corrompido.","File integrity check failed.":"A verificação de integridade do arquivo falhou.","Folder not found or no longer available.":"A pasta não foi encontrada ou já foi excluída.","Folder with this name already exists.":"Já existe uma pasta com esse nome.","A folder with that name already exists. Please enter a different folder name.":"Já existe uma pasta com esse nome. Digite um nome diferente para a pasta.","You don't have permission to access this folder.":"Você não tem permissão para acessar esta pasta.","Folder name is not valid.":"O nome da pasta não é válido.","Folder name is not valid. Allowed characters: {{allowedChars}}":"Não foi possível criar a pasta. Caracteres permitidos no nome: {{allowedChars}}","Failed to read the folder contents.":"Não foi possível ler o conteúdo da pasta.","Failed to write to the folder.":"Não foi possível gravar na pasta.","Folder storage quota exceeded.":"A cota de armazenamento da pasta foi excedida.","Folder is not empty.":"A pasta não está vazia.","Server error while processing the folder.":"Erro do servidor ao processar a pasta.","Folder operation took too long.":"A operação com a pasta demorou demais.","Network error. Please check your connection and try again.":"Erro de rede. Verifique sua conexão e tente novamente.","The operation took too long. Please try again.":"A operação 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ço está temporariamente indisponível. Tente novamente mais tarde.","Too many requests. Please try again a bit later.":"Muitas solicitações. Tente novamente mais tarde.","Authentication failed. Please sign in again.":"Falha na autenticação. Faça login novamente.","You are not allowed to perform this action.":"Você não tem permissão para executar esta ação.","Some of the provided data is invalid.":"Alguns dos dados fornecidos são inválidos.","This operation is not supported.":"Esta operação não é suportada.","Request payload is too large.":"O corpo da requisição é grande demais.","This media type is not supported.":"Este tipo de mídia não é suportado.","You have exceeded the upload quota.":"Você 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ão é válida.","The specified URL is not reachable.":"A URL especificada não está acessível.","Content type at the URL is not allowed.":"O tipo de conteúdo na URL não é permitido.","Failed to download file from the URL.":"Não foi possível 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ôde ser processado.","Some items in the batch are in a conflicting state.":"Alguns itens do lote estão em estado de conflito.","Some items in the batch did not pass validation.":"Alguns itens do lote não passaram na validação.","AI service returned an invalid response.":"O serviço de IA retornou uma resposta inválida.","Failed to generate image using AI.":"Falha ao gerar imagem usando IA.","You have reached the AI image generation limit.":"Você atingiu o limite de geração de imagens por IA.","Error in external integration.":"Erro em uma integração externa.","Error in a third-party service.":"Erro em um serviço de terceiros.","An unknown error occurred.":"Ocorreu um erro desconhecido.","Renaming is not allowed for this item.":"Renomear não é permitido para este item.","Moving is not allowed for this item.":"Mover não é permitido para este item.","Copying is not allowed for this item.":"Copiar não é permitido para este item.","Deleting is not allowed for this item.":"Excluir não é permitido para este item.","Cannot move an item into itself.":"Não é possível mover um item para dentro de si mesmo.","Cannot move an item into its descendant folder.":"Não é possível mover um item para sua pasta descendente.","Cannot copy an item into itself.":"Não é possível copiar um item para dentro de si mesmo.","Configuration error occurred.":"Ocorreu um erro de configuração.","Storage quota exceeded. Please free up space.":"Cota de armazenamento excedida. Libere espaço.","File is locked by another process or user.":"O arquivo está bloqueado por outro processo ou usuário.","File version conflict. Please refresh and try again.":"Conflito de versão do arquivo. Atualize a página e tente novamente.","Batch operation exceeds the maximum number of items allowed.":"A operação em lote excede o número máximo 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ço",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ível","My files":"Meus arquivos",GIF:"GIF","Stock images":"Imagens de stock",AI:"IA","AI image generation":"Geração de imagens por IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Isso é 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ão configurado","Filter by type":"Filtrar por tipo","All types":"Todos os tipos","File name":"Nome do arquivo",Actions:"Ações","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ão foi possível baixar o arquivo","Failed to load JSON data":"Não foi possível carregar os dados JSON","Invalid file URL":"URL de arquivo inválida","Unable to validate file URL":"Não foi possível 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á-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ão","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ão 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ção não 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ídos permanentemente","Trash partially cleared":"Lixeira parcialmente limpa","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} itens excluídos, {{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ção excluirá permanentemente {{count}} arquivo",delete_files_permanent_few:"Esta ação excluirá permanentemente {{count}} arquivos",delete_files_permanent_many:"Esta ação excluirá permanentemente {{count}} arquivos",delete_files_permanent_other:"Esta ação excluirá permanentemente {{count}} arquivos",delete_folder_permanent:"Esta ação excluirá permanentemente a pasta «{{name}}» e todo seu conteúdo, incluindo {{count}} itens.",delete_mixed_permanent:"Esta ação excluirá 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á problemas na exibição de imagens em e-mails antigos. Tem certeza de que deseja excluir permanentemente a seleção?",move_files_to_trash_one:"Esta ação moverá {{count}} arquivo para a lixeira.",move_files_to_trash_few:"Esta ação moverá {{count}} arquivos para a lixeira.",move_files_to_trash_many:"Esta ação moverá {{count}} arquivos para a lixeira.",move_files_to_trash_other:"Esta ação moverá {{count}} arquivos para a lixeira.",move_folder_to_trash:"Esta ação moverá a pasta «{{name}}» e todo seu conteúdo ({{count}} itens) para a lixeira.",move_mixed_to_trash:"Esta ação moverá {{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ção 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ído","Move here":"Mover aqui","Copy here":"Copiar aqui","File URL":"URL do arquivo","There's nothing here":"Não há nada aqui","Try using a different search query.":"Tente usar uma consulta de pesquisa diferente.","Millions of free stock images":"Milhões 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ê","Millions of icons":"Milhões de ícones","Enter a search query and we'll find the perfect icon for you":"Digite uma consulta de busca e encontraremos o ícone perfeito para você","Enter your query and we will find the right one for you":"Digite sua consulta e nós encontraremos a ideal para você","Over 350,000 live images":"Mais de 350.000 imagens ao vivo","The folder will be created in the root directory.":"A pasta será criada no diretório 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ôr 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ão puderam ser enviados. Verifique o tamanho e o formato dos arquivos.",upload_error_hint_invalid_name:"Renomeie o arquivo: use apenas letras, números, hífens 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á 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á vazia","Deleted files will be displayed here":"Os arquivos excluídos serão 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ções não salvas serão 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á vazia ou os arquivos não foram encontrados","Search files...":"Buscar arquivos...",Success:"Sucesso","Image updated successfully":"Imagem atualizada com sucesso","Failed to save changes":"Falha ao salvar alterações: {{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 árvore 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ência circular)","File too large. Maximum size: {{size}}":"Arquivo muito grande. Tamanho máximo: {{size}}","File too small. Minimum size: {{size}}":"Arquivo muito pequeno. Tamanho mínimo: {{size}}","Unsupported file type":"Tipo de arquivo não suportado","Unsupported file type: {{type}}":"Tipo de arquivo não suportado: {{type}}",unknown:"desconhecido","Failed to load files":"Falha ao carregar arquivos","Failed to load files in folder":"Não foi possível carregar o conteúdo da pasta ({{folderName}})","Failed to load subfolders in folder":'Não foi possível carregar subpastas em "{{folderName}}"',"Failed to load folder items count in folder":'Não foi possível obter a contagem de itens em "{{folderName}}"',"DataProvider for folder deletion is not configured":"DataProvider para exclusão de pastas não está configurado","DataProvider for file upload is not configured":"DataProvider para upload de arquivos não está 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ão é possível 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ão suportadas","Private and local URLs are not allowed":"URLs locais e privadas não são permitidas","Upload by URL is not supported":"Upload por URL não é suportado","File name is too long. Maximum {{max}} characters":"O nome do arquivo é muito longo. Máximo de {{max}} caracteres","File name contains invalid characters":"O nome do arquivo contém caracteres inválidos","Large file may take a long time to upload":"Um arquivo grande pode demorar muito para ser carregado","File unavailable: {{status}} {{statusText}}":"Arquivo indisponível: {{status}} {{statusText}}","File too large: {{size}}":"Arquivo muito grande: {{size}}","Unsupported file type: {{contentType}}":"Tipo de arquivo não suportado: {{contentType}}","Invalid server response: folder ID is missing":"Resposta do servidor inválida: ID da pasta ausente","Error: folder cannot be its own parent":"Erro: a pasta não pode ser seu próprio pai","Upload to Trash is forbidden":"Enviar para a lixeira é proibido","renameFolder is not implemented in dataProviders":"renameFolder não está implementado em dataProviders","renameFile is not implemented in dataProviders":"renameFile não está implementado em dataProviders",Clean:"Limpar","Circular dependency detected: folder cannot be its own parent":"Dependência circular detectada: a pasta não pode ser seu próprio pai","Save as copy and choose":"Salvar como cópia e escolher","Save and choose":"Salvar e escolher",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írculo",close:"Fechar",color:"Cor",corners:"Cantos",crop:"Cortar",Custom:"Personalizado","deleted object":"Objeto excluído","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órico","H Line Brush":"Linha H",image:"Imagem",initial:"Inicial",landmarks:"Pontos turísticos","loaded state":"Estado carregado","loading canvas":"Carregando tela","loading image":"Carregando imagem","loading state":"Carregando estado","maintain aspect ratio":"Manter proporção",merge:"Mesclar","merged objects":"Objetos mesclados","new text":"Novo texto",objects:"Objetos",opacity:"Opacidade",outline:"Contorno","outline color":"Cor do contorno","Pencil Brush":"Lápis","processing image":"Processando imagem",quality:"Qualidade",radius:"Raio","replace image":"Substituir imagem","replaced background image":"Imagem de fundo substituída",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épia quente",sepia:"Sépia","remove Color":"Remover cor",brightness:"Brilho",gamma:"Gamma",noise:"Ruído",pixelate:"Pixelar",blur:"Desfocar",emboss:"Relevo","blend Color":"Misturar cor",distance:"Distância",red:"Vermelho",green:"Verde",blue:"Azul",blocksize:"Tamanho do bloco",alpha:"Alfa",add:"Adicionar",multiply:"Multiplicar",subtract:"Subtrair",diff:"Diferença",screen:"Tela",lighten:"Clarear",darken:"Escurecer","select an option...":"Selecione uma opção..."}};const si={en:{translation:ni},ru:{translation:ii},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úsqueda de imágenes...","Search icons":"Buscar iconos","By name":"Por nombre","By size":"Por tamaño","By date":"Por fecha",List:"Lista",Grid:"Cuadrícula",Main:"Principal",Folders:"Carpetas","total pages":"{{total}} elementos en total",Name:"Nombre",Untitled:"Sin título",Size:"Tamaño",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.":"¿Está seguro de que desea eliminar esta carpeta? Esta acción también eliminará todos los archivos y subcarpetas.","API-endpoint for file upload is not configured":"El endpoint API para la carga de archivos no está 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á dentro de:","selected folder":"carpeta seleccionada","The folder will be created in the root directory":"La carpeta se creará en el directorio raíz","Failed to load folders":"No se pudieron cargar las carpetas","Folder name cannot be empty":"El nombre de la carpeta no puede estar vacío","Folder creation provider is not configured":"El proveedor de creación de carpetas no está configurado","Folder created":"Carpeta creada","Folder rename is disabled by config":"El renombrado de carpetas está deshabilitado por la configuración","Folder rename provider is not configured":"El proveedor para renombrar carpetas no está 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ñadido 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ó 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ño máximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Se ha superado el número máximo de archivos. Permitido: {{allowed}}, recibido: {{received}}","This file type is not allowed.":"Este tipo de archivo no está permitido.","File name is not valid.":"El nombre del archivo no es válido.","File name is not valid. Allowed characters: {{allowedChars}}":"El nombre del archivo no es válido. 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ñado.","File integrity check failed.":"La verificación de integridad del archivo falló.","Folder not found or no longer available.":"La carpeta no se encontró 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álido.","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ó la cuota de almacenamiento de la carpeta.","Folder is not empty.":"La carpeta no está vacía.","Server error while processing the folder.":"Error del servidor al procesar la carpeta.","Folder operation took too long.":"La operación con la carpeta tardó demasiado.","Network error. Please check your connection and try again.":"Error de red. Compruebe su conexión e inténtelo de nuevo.","The operation took too long. Please try again.":"La operación tardó demasiado. Inténtelo de nuevo.","Server error. Please try again later.":"Error del servidor. Inténtelo de nuevo más tarde.","Service is temporarily unavailable. Please try again later.":"El servicio no está disponible temporalmente. Inténtelo de nuevo más tarde.","Too many requests. Please try again a bit later.":"Demasiadas solicitudes. Inténtelo de nuevo más tarde.","Authentication failed. Please sign in again.":"Error de autenticación. Inicie sesión de nuevo.","You are not allowed to perform this action.":"No tiene permisos para realizar esta acción.","Some of the provided data is invalid.":"Algunos de los datos proporcionados no son válidos.","This operation is not supported.":"Esta operación no está 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á 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ó 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álida.","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á 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ó 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ún elemento del lote.","Some items in the batch are in a conflicting state.":"Algunos elementos del lote están en estado de conflicto.","Some items in the batch did not pass validation.":"Algunos elementos del lote no pasaron la validación.","AI service returned an invalid response.":"El servicio de IA devolvió una respuesta no válida.","Failed to generate image using AI.":"No se pudo generar la imagen usando IA.","You have reached the AI image generation limit.":"Se alcanzó el límite de generación de imágenes con IA.","Error in external integration.":"Error en la integración 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í 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í mismo.","Configuration error occurred.":"Se produjo un error de configuración.","Storage quota exceeded. Please free up space.":"Se superó la cuota de almacenamiento. Libere espacio.","File is locked by another process or user.":"El archivo está bloqueado por otro proceso o usuario.","File version conflict. Please refresh and try again.":"Conflicto de versión del archivo. Actualice la página e inténtelo de nuevo.","Batch operation exceeds the maximum number of items allowed.":"La operación por lotes excede el número máximo 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ágenes de stock",AI:"IA","AI image generation":"Generación de imágenes 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ñadir archivo","Add folder":"Añadir carpeta","Add file by URL":"Añadir 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álida","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ún no hay carpetas","Drag files to upload":"Arrastre archivos para cargarlos","Drop files here to upload":"Suelte los archivos aquí para cargarlos","Newest first":"Los más nuevos primero","Oldest first":"Los más antiguos primero","Largest first":"Los más grandes primero","Smallest first":"Los más pequeños 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ó mal, por favor intente nuevamente","Sort by":"Ordenar por","preview text":"Cargando imagen...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar eliminación","Are you sure you want to delete the selected items?":"¿Está 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?":"¿Está seguro de que desea mover los elementos seleccionados a la papelera?","Permanently delete":"Eliminación permanente","Delete permanently":"Eliminar permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"¿Está seguro de que desea eliminar permanentemente los elementos seleccionados? Esta acción no se puede deshacer.",Clear:"Limpiar","Clear Trash":"Vaciar papelera","Are you sure you want to permanently delete all items from Trash?":"¿Está seguro de que desea eliminar permanentemente todos los elementos de la papelera?","Trash cleared successfully":"Papelera vaciada con éxito","{{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ón eliminará permanentemente {{count}} archivo",delete_files_permanent_few:"Esta acción eliminará permanentemente {{count}} archivos",delete_files_permanent_many:"Esta acción eliminará permanentemente {{count}} archivos",delete_files_permanent_other:"Esta acción eliminará permanentemente {{count}} archivos",delete_folder_permanent:"Esta acción eliminará permanentemente la carpeta «{{name}}» y todo su contenido, incluyendo {{count}} elementos.",delete_mixed_permanent:"Esta acción eliminará permanentemente {{total}} elementos seleccionados, incluyendo {{folders}} carpetas y todas las {{images}} imágenes dentro de ellas.",permanent_delete_warning:"Eliminar archivos que se usaron en correos provocará problemas para mostrar imágenes en correos antiguos. ¿Está seguro de que desea eliminar permanentemente la selección?",move_files_to_trash_one:"Esta acción moverá {{count}} archivo a la papelera.",move_files_to_trash_few:"Esta acción moverá {{count}} archivos a la papelera.",move_files_to_trash_many:"Esta acción moverá {{count}} archivos a la papelera.",move_files_to_trash_other:"Esta acción moverá {{count}} archivos a la papelera.",move_folder_to_trash:"Esta acción moverá la carpeta «{{name}}» y todo su contenido ({{count}} elementos) a la papelera.",move_mixed_to_trash:"Esta acción moverá {{total}} elementos seleccionados a la papelera, incluyendo {{folders}} carpetas y {{images}} imágenes.",delete_count_confirm_trash_one:"¿Mover {{count}} archivo a la papelera?",delete_count_confirm_trash_few:"¿Mover {{count}} archivos a la papelera?",delete_count_confirm_trash_many:"¿Mover {{count}} archivos a la papelera?",delete_count_confirm_trash_other:"¿Mover {{count}} archivos a la papelera?",delete_count_confirm_permanent_one:"¿Eliminar permanentemente {{count}} archivo?",delete_count_confirm_permanent_few:"¿Eliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_many:"¿Eliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_other:"¿Eliminar permanentemente {{count}} archivos?",delete_count_confirm_one:"¿Eliminar {{count}} archivo?",delete_count_confirm_few:"¿Eliminar {{count}} archivos?",delete_count_confirm_many:"¿Eliminar {{count}} archivos?",delete_count_confirm_other:"¿Eliminar {{count}} archivos?",item:"archivo",items:"archivos",Trash:"Papelera",Choose:"Elegir",Stock:"Banco de imágenes","Select an image from our library":"Seleccione una imagen de nuestra biblioteca","AI generation":"Generación 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í para seleccionar un archivo","Supported files:":"Archivos admitidos:","Create folder":"Crear carpeta",Done:"Hecho","Move here":"Mover aquí","Copy here":"Copiar aquí","File URL":"URL del archivo","There's nothing here":"Aquí no hay nada","Try using a different search query.":"Prueba a utilizar una consulta de búsqueda diferente.","Millions of free stock images":"Millones de imágenes de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Ingrese una consulta de búsqueda 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úsqueda y encontraremos el ícono 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ás de 350,000 imágenes en vivo","The folder will be created in the root directory.":"La carpeta se creará en el directorio raíz.",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éano 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ño y el formato de los archivos.",upload_error_hint_invalid_name:"Renombre el archivo: use solo letras, números, guiones y guiones bajos.",upload_error_hint_size:"Reduzca el tamaño 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ágenes generadas correctamente","Choose for template":"Seleccionar para cargar en la plantilla","Trash is empty":"La papelera está vacía","Deleted files will be displayed here":"Los archivos eliminados se mostrarán aquí","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.":"¿Está seguro de que desea cerrar? Los cambios no guardados se perderán.","Are you sure you want to close the file manager?":"¿Está 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á vacía o no se encontraron archivos","Search files...":"Buscar archivos...",Success:"Éxito","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 árbol 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ño máximo: {{size}}","File too small. Minimum size: {{size}}":"El archivo es demasiado pequeño. Tamaño mínimo: {{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","Failed to load files in folder":"No se pudo cargar el contenido de la carpeta ({{folderName}})","Failed to load subfolders in folder":'No se pudieron cargar las subcarpetas en "{{folderName}}"',"Failed to load folder items count in folder":'No se pudo obtener el recuento de elementos en "{{folderName}}"',"DataProvider for folder deletion is not configured":"DataProvider para eliminar carpetas no está configurado","DataProvider for file upload is not configured":"DataProvider para cargar archivos no está 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á admitida","File name is too long. Maximum {{max}} characters":"El nombre del archivo es demasiado largo. Máximo {{max}} caracteres","File name contains invalid characters":"El nombre del archivo contiene caracteres no válidos","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álida: 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á prohibido","renameFolder is not implemented in dataProviders":"renameFolder no está implementado en dataProviders","renameFile is not implemented in dataProviders":"renameFile no está 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","Save as copy and choose":"Guardar como copia y elegir","Save and choose":"Guardar y elegir",pixie:{"added drawing":"Dibujo añadido","added frame":"Marco añadido","added image":"Imagen añadida","added shape":"Forma añadida","added sticker":"Pegatina añadida","added text":"Texto añadido","applied filters":"Filtros aplicados",apply:"Aplicar",background:"Fondo","background color":"Color de fondo",beach:"Playa","brush color":"Color del pincel","brush size":"Tamaño del pincel","brush type":"Tipo de pincel",bubbles:"Burbujas",Cancel:"Cancelar","changed style":"Estilo cambiado","Circle Brush":"Círculo",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ño de fuente",frame:"Marco",gradient:"Gradiente",height:"Alto",history:"Historial","H Line Brush":"Línea 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ón",merge:"Fusionar","merged objects":"Objetos fusionados","new text":"Nuevo texto",objects:"Objetos",opacity:"Opacidad",outline:"Contorno","outline color":"Color del contorno","Pencil Brush":"Lápiz","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ínea 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álido",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ño de bloque",alpha:"Alfa",add:"Añadir",multiply:"Multiplicar",subtract:"Restar",diff:"Diferencia",screen:"Pantalla",lighten:"Aclarar",darken:"Oscurecer","select an option...":"Seleccione una opción..."}}},uk:{translation:oi},"pt-br":{translation:ai},pt:{translation:ai},br:{translation:ai},"pt-BR":{translation:ai}};On.use($n).init({resources:si,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});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 li=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]},ci=e=>{if(!e||e<=0)return"";const t=1048576;if(e<t){return`${Math.round(e/1024)} Kb`}return`${(e/t).toFixed(2)} Mb`},ui=e=>{if(null==e)return"";if("number"==typeof e)return ci(e);const t=String(e).trim();if(!t)return"";const r=Number(t);return Number.isNaN(r)?t:ci(r)},di=(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};async function hi(e,t,r,n,i){if(!i||!(null==e?void 0:e.getFiles))return t;try{let i=[];const{files:o}=await e.getFiles({folderId:n?void 0:r||void 0,noFolder:n,itemType:"all",page:1,limit:1e4});if(i=(o||[]).map(e=>e.name).filter(e=>!!e),!n&&(null==e?void 0:e.getFolders)){const t=(await e.getFolders({parentId:null!=r?r:null,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);i=[...i,...t]}return di(t,i)}catch(e){return console.warn("Could not fetch files for duplicate check:",e),t}}const fi=({size:e=24,color:t="currentColor",...r})=>n.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},n.createElement("path",{d:"m6 9 6 6 6-6"}));fi.displayName="ChevronDown";const pi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));pi.displayName="Colors";const gi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));gi.displayName="Copy04";const mi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));mi.displayName="Crop02";const vi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));vi.displayName="DotsVertical";const yi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));yi.displayName="FolderDownload";const bi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));bi.displayName="FolderMinus";const wi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));wi.displayName="FolderPlus";const xi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));xi.displayName="FolderSearch";const Ci=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Ci.displayName="Grid01";const _i=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));_i.displayName="Image03";const Si=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Si.displayName="Link01";const ki=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));ki.displayName="List";const Ai=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}),n.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"}));Ai.displayName="PlaySquare";const Ii=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Ii.displayName="PlusCircle";const Ei=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Ei.displayName="RefreshCw05";const Fi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Fi.displayName="Scale01";const Ti=({size:e=24,color:t="currentColor",...r})=>n.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},n.createElement("path",{d:"m21 21-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"}));Ti.displayName="SearchMd";const Oi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Oi.displayName="Stars02";const Pi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Pi.displayName="TextInput";const Mi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Mi.displayName="ThumbsUp";const Ri=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Ri.displayName="Trash03";const Li=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Li.displayName="Trash04";const Ni=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),ji=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),Di=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),zi=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),Bi=()=>t("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[e("path",{d:"M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"}),e("path",{d:"M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"}),e("path",{d:"M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"}),e("path",{d:"M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"})]}),Ui=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"light-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("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"})}),Vi=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"dark-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("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"})}),Hi=()=>t("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"}),e("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"})]}),$i=()=>t("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"}),e("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"})]}),Wi=()=>e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),Gi=()=>e("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),qi=()=>t("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{width:"56",height:"56",rx:"24",fill:"#8946FB"}),e("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"})]}),Yi=()=>t("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{width:"56",height:"56",rx:"24",fill:"#7ED846"}),e("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"})]}),Xi=()=>t("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"})]}),Ki=()=>e("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),Zi=t=>e(ae,Object.assign({component:Ni},t)),Ji=t=>e(ae,Object.assign({component:ji},t)),Qi=t=>e(ae,Object.assign({component:Di},t)),eo=t=>e(ae,Object.assign({component:zi},t)),to=t=>e(ae,Object.assign({component:Bi},t)),ro=t=>e(ae,Object.assign({component:Ui},t)),no=t=>e(ae,Object.assign({component:Vi},t)),io=t=>e(ae,Object.assign({component:Hi},t)),oo=t=>e(ae,Object.assign({component:$i},t)),ao=t=>e(ae,Object.assign({component:Wi},t)),so=t=>e(ae,Object.assign({component:Gi},t)),lo=t=>e(ae,Object.assign({component:qi},t)),co=t=>e(ae,Object.assign({component:Yi},t)),uo=t=>e(ae,Object.assign({component:Xi},t)),ho=t=>e(ae,Object.assign({component:Ki},t)),fo=s({state:{},actions:{},options:{}}),po=()=>l(fo),go=({children:t,options:r})=>{var n,i,s;const[l,u]=o([]),[h,f]=o([]),[p,g]=o(null),[m,v]=o(r.searchQuery||""),[y,b]=o(r.sortBySize||"name"),{config:w}=r,x=c(e=>{var t,r,n;if(e===nr){const e=!1!==(null===(t=null==w?void 0:w.features)||void 0===t?void 0:t.enableGif),r=!(null==w?void 0:w.enabledTabs)||w.enabledTabs.includes("gif");return e&&r}if(e===ir){const e=!1!==(null===(r=null==w?void 0:w.features)||void 0===r?void 0:r.enableStockImages),t=!(null==w?void 0:w.enabledTabs)||w.enabledTabs.includes("stock");return e&&t}if(e===or){const e=!1!==(null===(n=null==w?void 0:w.features)||void 0===n?void 0:n.enableIconStock),t=!(null==w?void 0:w.enabledTabs)||w.enabledTabs.includes("icons");return e&&t}return!0},[null==w?void 0:w.enabledTabs,null===(n=null==w?void 0:w.features)||void 0===n?void 0:n.enableGif,null===(i=null==w?void 0:w.features)||void 0===i?void 0:i.enableIconStock,null===(s=null==w?void 0:w.features)||void 0===s?void 0:s.enableStockImages]),[C,_]=o("date"),[S,k]=o("desc"),[A,I]=o([{id:"folders",name:"Папки"}]),[F,T]=o(""),[O,P]=o(!1),[M,R]=o(rr);a(()=>{(null==w?void 0:w.activeLibraryItem)&&R&&R(x(w.activeLibraryItem)?w.activeLibraryItem:rr)},[null==w?void 0:w.activeLibraryItem,x,R]),a(()=>{x(M)||R(rr)},[M,x]);const[L,N]=o({current:1,pageSize:20,total:0}),[j]=E.useForm(),[D]=E.useForm(),[z]=E.useForm(),[B]=E.useForm(),[U]=E.useForm(),[V]=E.useForm(),[H,$]=o(!1),[W,G]=o(!1),[q,Y]=o(!1),[X,K]=o(!1),[Z,J]=o(!1),[Q,ee]=o(!1),[te,re]=o(!1),[ne,ie]=o(null),[oe,ae]=o(null),[se,le]=o(null),ce=(e,t)=>{I(r=>r.map(r=>r.id===e?Object.assign(Object.assign({},r),{name:t}):r))},ue=c(e=>{N(t=>Object.assign(Object.assign({},t),e))},[N]),de=d(()=>{var e;return{folders:l,files:h,selectedFolder:p,searchTerm:m,sortField:y,sortBy:C,sortOrder:S,pathHistory:A,currentMenuFile:F,loading:O,pagination:L,isModalVisible:H,isUrlModalVisible:W,isRenameModalVisible:q,isMoveModalVisible:X,isRenameFolderModalVisible:Z,isCopyModalVisible:Q,isDeleteConfirmVisible:te,form:j,urlForm:D,renameForm:z,moveForm:B,renameFolderForm:U,copyForm:V,fileToRename:ne,folderToRename:oe,activeLibraryItem:M,multiSelect:null===(e=null==w?void 0:w.multiSelect)||void 0===e||e,undoDeletion:se}},[M,null==w?void 0:w.multiSelect,V,F,ne,h,l,j,Q,te,H,X,Z,q,W,O,B,L,A,U,z,m,p,C,y,S,se,D,oe]),he=d(()=>({setFolders:u,setFiles:f,setSelectedFolder:g,setSearchTerm:v,setSortField:b,setSortBy:_,setSortOrder:k,setPathHistory:I,setLoading:P,setPagination:ue,setIsModalVisible:$,setIsUrlModalVisible:G,setIsRenameModalVisible:Y,setIsMoveModalVisible:K,setIsRenameFolderModalVisible:J,setIsCopyModalVisible:ee,setIsDeleteConfirmVisible:re,setFileToRename:ie,setFolderToRename:ae,setUndoDeletion:le,updatePathHistoryOnFolderRename:ce,setActiveLibraryItem:e=>R(x(e)?e:rr),setCurrentMenuFile:T}),[ue,x]),fe=d(()=>({state:de,actions:he,options:r}),[he,r,de]);return e(fo.Provider,{value:fe,children:t})},mo=()=>{const{options:e}=po(),{customIcons:t}=e,r=i.useCallback((e,r,n)=>{const o=null==t?void 0:t[e];return o?i.createElement(o,n):i.createElement(r,n)},[t]);return i.useMemo(()=>({RootFolderIcon:e=>r("rootFolder",ve,e),FolderIcon:e=>r("folder",io,e),FolderOpenIcon:e=>r("folderOpen",me,e),AddFolderIcon:e=>r("addFolder",ge,e),FileIcon:e=>r("file",pe,e),UploadIcon:e=>r("upload",fe,e),UploadByUrlIcon:e=>r("uploadByUrl",he,e),ExpandArrowIcon:e=>r("expandArrow",de,e),CollapseArrowIcon:e=>r("collapseArrow",ue,e),ExpandFolderIcon:e=>r("expandArrow",wi,e),CollapseFolderIcon:e=>r("collapseArrow",bi,e),FolderPreviewIcon:e=>r("folderPreview",oo,e),EmptyFolderIcon:e=>r("folderPreview",ao,e),GridViewIcon:e=>r("gridView",ce,e),ListViewIcon:e=>r("listView",le,e),DropZoneFileIcon:e=>r("folderPreview",so,e),BigStockIcon:e=>r("folderPreview",lo,e),BigAIIcon:e=>r("folderPreview",co,e),GifPlayIcon:e=>r("folderPreview",uo,e),StockBigIcon:e=>r("folderPreview",ho,e),MixedViewIcon:e=>r("mixedView",Zi,e),LandscapeViewIcon:e=>r("landscapeView",Ji,e),PortraitViewIcon:e=>r("portraitView",Qi,e),SquareViewIcon:e=>r("squareView",eo,e),LightModeIcon:e=>r("lightMode",ro,e),DarkModeIcon:e=>r("darkMode",no,e),AiIcon_2:e=>r("aiIcon_2",to,e),NoFilesIcon:e=>r("noFiles",xi,e),ThumbsUpIcon:e=>r("thumbsUp",Mi,e),getCustomIcon:r}),[r])};var vo="noFilesContainer",yo="noFilesImage",bo="noFilesTitle",wo="noFilesDescription";const xo=()=>{const{t:r}=Yn(),{NoFilesIcon:n}=mo();return t("div",{className:vo,children:[e(n,{className:yo,size:48,strokeWidth:1.4}),e("h2",{className:bo,children:r("There's nothing here")}),e("div",{className:wo,children:r("Try using a different search query.")})]})};var Co,_o={exports:{}},So=_o.exports;
1
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as n from"react";import i,{useState as o,useEffect as a,createContext as s,useContext as l,useCallback as c,useRef as u,useMemo as d,createElement as h,memo as f,forwardRef as p,useImperativeHandle as g,Children as m,isValidElement as v,Fragment as y,useId as b,cloneElement as w,useLayoutEffect as x,useInsertionEffect as C}from"react";import{createRoot as _}from"react-dom/client";import{Spin as S,theme as k,ConfigProvider as A,App as I,Form as E,Input as F,Typography as T,Select as O,Tooltip as P,Button as M,Space as R,Segmented as L,Checkbox as N,Dropdown as j,Image as D,Col as z,Card as B,Row as U,Table as V,Empty as H,Pagination as $,Tree as W,Modal as G,Progress as q,Menu as Y,Divider as X,List as K,Avatar as Z,Layout as J,Radio as Q,Tag as ee,Carousel as te,InputNumber as re,ColorPicker as ne,message as ie}from"antd";import oe from"antd/es/alert/ErrorBoundary";import ae,{LoadingOutlined as se,BarsOutlined as le,AppstoreOutlined as ce,DownOutlined as ue,RightOutlined as de,LinkOutlined as he,UploadOutlined as fe,FileOutlined as pe,FolderAddOutlined as ge,FolderOpenOutlined as me,FolderOutlined as ve,EyeOutlined as ye,CloseOutlined as be,LikeOutlined as we,HistoryOutlined as xe,ExclamationCircleOutlined as Ce,FileImageOutlined as _e,CheckCircleOutlined as Se,ArrowRightOutlined as ke,ArrowLeftOutlined as Ae,CheckOutlined as Ie}from"@ant-design/icons";import*as Ee from"react-dom";import{createPortal as Fe,flushSync as Te}from"react-dom";function Oe(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 Oe(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)?Oe(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 Me(e){return Me="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},Me(e)}function Re(e){var t=function(e,t){if("object"!=Me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Me(t)?t:t+""}function Le(e,t,r){return(t=Re(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ne(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 je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(r),!0).forEach(function(t){Le(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var De={},ze=[];function Be(e,t){if("production"!==process.env.NODE_ENV&&!e&&void 0!==console){var r=ze.reduce(function(e,t){return t(null!=e?e:"","warning")},t);r&&console.error("Warning: ".concat(r))}}function Ue(e,t){if("production"!==process.env.NODE_ENV&&!e&&void 0!==console){var r=ze.reduce(function(e,t){return t(null!=e?e:"","note")},t);r&&console.warn("Note: ".concat(r))}}function Ve(e,t,r){t||De[r]||(e(!1,r),De[r]=!0)}function He(e,t){Ve(Be,e,t)}function $e(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(He(!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"===Me(t)&&"object"===Me(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 We(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ge(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,Re(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}He.preMessage=function(e){ze.push(e)},He.resetWarned=function(){De={}},He.noteOnce=function(e,t){Ve(Ue,e,t)};function qe(e){return e.join("%")}var Ye=function(){function e(t){We(this,e),Le(this,"instanceId",void 0),Le(this,"cache",new Map),Le(this,"extracted",new Set),this.instanceId=t}return Ge(e,[{key:"get",value:function(e){return this.opGet(qe(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(qe(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}(),Xe=["children"],Ke="data-css-hash",Ze="__cssinjs_instance__";function Je(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(Ke,"]"))||[],r=document.head.firstChild;Array.from(t).forEach(function(t){t[Ze]=t[Ze]||e,t[Ze]===e&&document.head.insertBefore(t,r)});var n={};Array.from(document.querySelectorAll("style[".concat(Ke,"]"))).forEach(function(t){var r,i=t.getAttribute(Ke);n[i]?t[Ze]===e&&(null===(r=t.parentNode)||void 0===r||r.removeChild(t)):n[i]=!0})}return new Ye(e)}var Qe=n.createContext({hashPriority:"low",cache:Je(),defaultCache:!0}),et=function(e){var t,r,i,o,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,Xe),l=n.useContext(Qe),c=(t=function(){var e=je({},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||Je(),e.defaultCache=!t&&l.defaultCache,e},r=[l,s],i=function(e,t){return!$e(e[0],t[0],!0)||!$e(e[1],t[1],!0)},"value"in(o=n.useRef({})).current&&!i(o.current.condition,r)||(o.current.value=t(),o.current.condition=r),o.current.value);return n.createElement(Qe.Provider,{value:c},a)};var tt=function(){function e(){We(this,e),Le(this,"cache",void 0),Le(this,"keys",void 0),Le(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Ge(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):i=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 rt(e,t,r){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4])return e;var n=je(je({},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),{},Le(Le({},"data-token-hash",t),Ke,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>")}Le(tt,"MAX_CACHE_SIZE",20),Le(tt,"MAX_CACHE_OFFSET",5),new tt,"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,je({},n).useInsertionEffect,je({},n).useInsertionEffect;if(process.env.NODE_ENV,"production"!==process.env.NODE_ENV&&"undefined"!=typeof module&&module&&module.hot&&"undefined"!=typeof window){var nt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:null;if(nt&&"function"==typeof nt.webpackHotUpdate){var it=nt.webpackHotUpdate;nt.webpackHotUpdate=function(){return setTimeout(function(){0},0),it.apply(void 0,arguments)}}}process.env.NODE_ENV;var ot="comm",at="rule",st="decl",lt=Math.abs,ct=String.fromCharCode;function ut(e){return e.trim()}function dt(e,t,r){return e.replace(t,r)}function ht(e,t,r){return e.indexOf(t,r)}function ft(e,t){return 0|e.charCodeAt(t)}function pt(e,t,r){return e.slice(t,r)}function gt(e){return e.length}function mt(e,t){return t.push(e),e}var vt=1,yt=1,bt=0,wt=0,xt=0,Ct="";function _t(e,t,r,n,i,o,a,s){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:vt,column:yt,length:a,return:"",siblings:s}}function St(){return xt=wt>0?ft(Ct,--wt):0,yt--,10===xt&&(yt=1,vt--),xt}function kt(){return xt=wt<bt?ft(Ct,wt++):0,yt++,10===xt&&(yt=1,vt++),xt}function At(){return ft(Ct,wt)}function It(){return wt}function Et(e,t){return pt(Ct,e,t)}function Ft(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 Tt(e){return ut(Et(wt-1,Mt(91===e?e+2:40===e?e+1:e)))}function Ot(e){for(;(xt=At())&&xt<33;)kt();return Ft(e)>2||Ft(xt)>3?"":" "}function Pt(e,t){for(;--t&&kt()&&!(xt<48||xt>102||xt>57&&xt<65||xt>70&&xt<97););return Et(e,It()+(t<6&&32==At()&&32==kt()))}function Mt(e){for(;kt();)switch(xt){case e:return wt;case 34:case 39:34!==e&&39!==e&&Mt(xt);break;case 40:41===e&&Mt(e);break;case 92:kt()}return wt}function Rt(e,t){for(;kt()&&e+xt!==57&&(e+xt!==84||47!==At()););return"/*"+Et(t,wt-1)+"*"+ct(47===e?e:kt())}function Lt(e){for(;!Ft(At());)kt();return Et(e,wt)}function Nt(e){return function(e){return Ct="",e}(jt("",null,null,null,[""],e=function(e){return vt=yt=1,bt=gt(Ct=e),wt=0,[]}(e),0,[0],e))}function jt(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=kt()){case 40:if(108!=p&&58==ft(_,d-1)){-1!=ht(_+=dt(Tt(y),"&","&\f"),"&\f",lt(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:_+=Tt(y);break;case 9:case 10:case 13:case 32:_+=Ot(p);break;case 92:_+=Pt(It()-1,7);continue;case 47:switch(At()){case 42:case 47:mt(zt(Rt(kt(),It()),t,r,l),l),5!=Ft(p||1)&&5!=Ft(At()||1)||!gt(_)||" "===pt(_,-1,void 0)||(_+=" ");break;default:_+="/"}break;case 123*g:s[c++]=gt(_)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(_=dt(_,/\f/g,"")),f>0&&(gt(_)-d||0===g&&47===p)&&mt(f>32?Bt(_+";",n,r,d-1,l):Bt(dt(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(mt(C=Dt(_,t,r,c,u,i,s,b,w=[],x=[],d,o),o),123===y)if(0===u)jt(_,t,C,C,w,o,d,s,x);else{switch(h){case 99:if(110===ft(_,3))break;case 108:if(97===ft(_,2))break;default:u=0;case 100:case 109:case 115:}u?jt(e,C,C,n&&mt(Dt(e,C,C,0,0,i,s,b,i,w=[],d,x),x),i,x,d,s,n?w:x):jt(_,C,C,C,[""],x,0,s,x)}}c=u=f=0,g=v=1,b=_="",d=a;break;case 58:d=1+gt(_),f=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==St())continue;switch(_+=ct(y),y*g){case 38:v=u>0?1:(_+="\f",-1);break;case 44:s[c++]=(gt(_)-1)*v,v=1;break;case 64:45===At()&&(_+=Tt(kt())),h=At(),u=d=gt(b=_+=Lt(It())),y++;break;case 45:45===p&&2==gt(_)&&(g=0)}}return o}function Dt(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=pt(e,h+1,h=lt(m=a[g])),w=e;y<p;++y)(w=ut(m>0?f[y]+" "+b:dt(b,/&\f/g,f[y])))&&(l[v++]=w);return _t(e,t,r,0===i?at:s,l,c,u,d)}function zt(e,t,r,n){return _t(e,t,r,ot,ct(xt),pt(e,2,-2),0,n)}function Bt(e,t,r,n,i){return _t(e,t,r,st,pt(e,0,n),pt(e,n+1,-1),n,i)}function Ut(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function Vt(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case st:return e.return=e.return||e.value;case ot:return"";case"@keyframes":return e.return=e.value+"{"+Ut(e.children,n)+"}";case at:if(!gt(e.value=e.props.join(",")))return""}return gt(r=Ut(e.children,n))?e.return=e.value+"{"+r+"}":""}function Ht(e){return e.notSplit=!0,e}Le(Le(Le({},"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=rt(i,o,a,h,u),s&&Object.keys(s).forEach(function(e){if(!t[e]){t[e]=!0;var r=function(e){return Ut(Nt(e),Vt).replace(/\{%%%\:[^;];}/g,";")}(s[e]),n=rt(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,rt(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;if(!i)return null;return[-999,o,rt(i,a,o,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]}),Ht(["borderTop","borderBottom"]),Ht(["borderTop"]),Ht(["borderBottom"]),Ht(["borderLeft","borderRight"]),Ht(["borderLeft"]),Ht(["borderRight"]);const $t={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function Wt(e,t){return t}function Gt(e,t){return e.filter(e=>void 0!==e)}var qt;function Yt(e){return"object"!=typeof e||null===e?0:Array.isArray(e)?2:function(e){if(!Zt.includes(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(void 0===t)return!0;const r=t.prototype;if(null===r||"object"!=typeof r||!Zt.includes(Object.prototype.toString.call(r)))return!1;if(!r.hasOwnProperty("isPrototypeOf"))return!1;return!0}(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Xt(e,t){return"object"==typeof e&&Object.prototype.propertyIsEnumerable.call(e,t)}function Kt(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]()}}})}}!function(e){e[e.NOT=0]="NOT",e[e.RECORD=1]="RECORD",e[e.ARRAY=2]="ARRAY",e[e.SET=3]="SET",e[e.MAP=4]="MAP",e[e.OTHER=5]="OTHER"}(qt||(qt={}));const Zt=["[object Object]","[object Module]"];const Jt={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)Xt(t,i)&&o.push(t[i]);if(0===o.length)continue;const a=t.metaDataUpdater(r,{key:i,parents:e}),s=er(o,t,a);s!==$t.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(Kt(e))},mergeMaps:function(e){return new Map(Kt(e))},mergeOthers:function(e){return e.at(-1)}};function Qt(...e){return function(e,t){const r=function(e,t){return{defaultMergeFunctions:Jt,mergeFunctions:{...Jt,...Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(Jt,e)).map(([e,t])=>!1===t?[e,Jt.mergeOthers]:[e,t]))},metaDataUpdater:e.metaDataUpdater??Wt,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:!1===e.filterValues?void 0:e.filterValues??Gt,actions:$t}}(e,n);function n(...e){return er(e,r,t)}return n}({})(...e)}function er(e,t,r){const n=t.filterValues?.(e,r)??e;if(0===n.length)return;if(1===n.length)return tr(n,t,r);const i=Yt(n[0]);if(0!==i&&5!==i)for(let e=1;e<n.length;e++)if(Yt(n[e])!==i)return tr(n,t,r);switch(i){case 1:return function(e,t,r){const n=t.mergeFunctions.mergeRecords(e,t,r);if(n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords)return t.defaultMergeFunctions.mergeRecords(e,t,r);return n}(n,t,r);case 2:return function(e,t,r){const n=t.mergeFunctions.mergeArrays(e,t,r);if(n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays)return t.defaultMergeFunctions.mergeArrays(e);return n}(n,t,r);case 3:return function(e,t,r){const n=t.mergeFunctions.mergeSets(e,t,r);if(n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets)return t.defaultMergeFunctions.mergeSets(e);return n}(n,t,r);case 4:return function(e,t,r){const n=t.mergeFunctions.mergeMaps(e,t,r);if(n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps)return t.defaultMergeFunctions.mergeMaps(e);return n}(n,t,r);default:return tr(n,t,r)}}function tr(e,t,r){const n=t.mergeFunctions.mergeOthers(e,t,r);return n===$t.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):n}const rr="my_files",nr="gif",ir="stock_images",or="icons",ar="ai",sr="editor",lr="Trash",cr="light",ur="dark",dr="system",hr="(prefers-color-scheme: dark)",fr=!1,pr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",gr=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif"],mr=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif","gif"],vr={keywords:"",color:"",orientation:""};S.setDefaultIndicator(e(()=>e(se,{style:{fontSize:48,height:"100%"},spin:!0}),{}));const yr={hashed:!1,algorithm:k.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}}},br={hashed:!1,algorithm:k.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}}},wr=({externalTheme:t=cr,children:r,customThemeToken:n})=>{const i=matchMedia(hr).matches?ur:cr,s=t===dr?i:t,[l,c]=o(s),[u,d]=o("light"===l?yr:br);return a(()=>{c(s)},[s]),a(()=>{const e="light"===l?yr:br,t=n?Qt(e.token,n):e.token;d(Object.assign(Object.assign({},e),{token:t}))},[d,l,n]),e("div",{id:"file-manager-element-id",style:{height:"100%"},children:e(A,{theme:u,children:e(et,{transformers:[],children:e(I,{style:{height:"100%"},children:r})})})})},xr={fileManager:{locale:"en_US",mode:"fileManager",theme:"light",enabledTabs:["editor"]},imageCenter:{locale:"en_US",mode:"imageCenter",theme:"light",enabledTabs:["stock","gif","editor"]},plugin:{locale:"en_US",mode:"plugin",theme:"light",enabledTabs:["editor","stock","gif","ai"]}},Cr=(e="fileManager",t)=>"imageCenter"===e&&t?t:Object.assign({},xr[e]);let _r=!1;const Sr=()=>{if(_r)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]){const e=window.__webpack_require__;e&&"object"==typeof e&&null!==e&&"cache"in e&&console.warn("✅ Webpack detected, additional protection from ResizeObserver errors activated")}})}catch(e){console.warn("Error when searching for webpack objects:",e)}};e(),setTimeout(e,1e3)}_r=!0},kr=()=>{_r=!1},Ar=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},Er=(e,t="image/png")=>{let r=t;if("string"==typeof e&&e.startsWith("data:")){const t=Ir(e);t&&t.startsWith("image/")&&(r=t)}return Ar(r)},Fr=e=>{const t=Ar(e).split("/")[1];return"svg+xml"===t?"svg":t||"png"},Tr=/^data:(.+?);base64,(.+)$/i,Or=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 e=0;e<r;e++)n[e]=t.charCodeAt(e);return n},Pr=(e,t)=>{const r=e.replace(/\s/g,""),n=Or(r),i=new ArrayBuffer(n.length);return new Uint8Array(i).set(n),new Blob([i],{type:t})},Mr=(e,t="application/octet-stream")=>{if(e instanceof Blob)return e;if("string"==typeof e){const r=e.trim(),n=r.match(Tr);if(n){const[,e,t]=n;return Pr(t,e)}return Pr(r,t)}throw new Error("Unsupported data type. Expected Blob or base64 string.")},Rr={"а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"y","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"ts","ч":"ch","ш":"sh","щ":"sch","ъ":"","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"Y","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"Ts","Ч":"Ch","Ш":"Sh","Щ":"Sch","Ъ":"","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya"},Lr=/[<>:"/\\|?*()#\x00-\x1f]/g,Nr={transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0};function jr(e,t){let r=e;return t.transliterate&&(r=r.normalize("NFC").split("").map(e=>Rr[e]||e).join("")),t.removeForbiddenChars&&(r=r.replace(Lr,"_")),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 Dr(e,t){const r=Object.assign(Object.assign({},Nr),null==t?void 0:t.fileNameProcessing),n=e.lastIndexOf(".");let i,o;n>0?(i=e.substring(0,n),o=e.substring(n).toLowerCase()):(i=e,o="");return(jr(i,r)||"unnamed_file")+o}function zr(e,t){return jr(e,Object.assign(Object.assign({},Nr),null==t?void 0:t.folderNameProcessing))||"unnamed_folder"}function Br(e){return!0===(null==e?void 0:e.dedupeUploadNamesOnClient)}const Ur=e=>"string"==typeof e,Vr=()=>{let e,t;const r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},Hr=e=>null==e?"":""+e,$r=/###/g,Wr=e=>e&&e.indexOf("###")>-1?e.replace($r,"."):e,Gr=e=>!e||Ur(e),qr=(e,t,r)=>{const n=Ur(t)?t.split("."):t;let i=0;for(;i<n.length-1;){if(Gr(e))return{};const t=Wr(n[i]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Gr(e)?{}:{obj:e,k:Wr(n[i])}},Yr=(e,t,r)=>{const{obj:n,k:i}=qr(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=qr(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=qr(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=r},Xr=(e,t)=>{const{obj:r,k:n}=qr(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Kr=(e,t,r)=>{for(const n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?Ur(e[n])||e[n]instanceof String||Ur(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):Kr(e[n],t[n],r):e[n]=t[n]);return e},Zr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Jr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Qr=e=>Ur(e)?e.replace(/[&<>"'\/]/g,e=>Jr[e]):e;const en=[" ",",","?","!",";"],tn=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),rn=(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 e=0;e<n.length;){if(!i||"object"!=typeof i)return;let t,o="";for(let a=e;a<n.length;++a)if(a!==e&&(o+=r),o+=n[a],t=i[o],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<n.length-1)continue;e+=a-e+1;break}i=t}return i},nn=e=>e?.replace("_","-"),on={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class an{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||on,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:(Ur(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new an(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new an(this.logger,e)}}var sn=new an;class ln{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){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,r])=>{for(let n=0;n<r;n++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let i=0;i<n;i++)r.apply(r,[e,...t])})}}}class cn extends ln{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):Ur(r)&&i?a.push(...r.split(i)):a.push(r)));const s=Xr(this.data,a);return!s&&!t&&!r&&e.indexOf(".")>-1&&(e=a[0],t=a[1],r=a.slice(2).join(".")),!s&&o&&Ur(r)?rn(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),Yr(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(const n in r)(Ur(r[n])||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{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=Xr(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?Kr(s,r,i):s={...s,...r},Yr(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 un={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 dn=Symbol("i18next/PATH_KEY");function hn(e,t){const{[dn]:r}=e(function(){const e=[],t=Object.create(null);let r;return t.get=(n,i)=>(r?.revoke?.(),i===dn?e:(e.push(i),r=Proxy.revocable(n,t),r.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return r.join(t?.keySeparator??".")}const fn={},pn=e=>!Ur(e)&&"boolean"!=typeof e&&"number"!=typeof e;class gn extends ln{constructor(e,t={}){super(),((e,t,r)=>{e.forEach(e=>{t[e]&&(r[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=sn.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=en.filter(e=>t.indexOf(e)<0&&r.indexOf(e)<0);if(0===n.length)return!0;const i=tn.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:Ur(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:Ur(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=hn(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&&!Ur(n.count),b=gn.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 k=pn(S),A=Object.prototype.toString.apply(S);if(!(v&&S&&k&&["[object Number]","[object Function]","[object RegExp]"].indexOf(A)<0)||Ur(m)&&Array.isArray(S))if(v&&Ur(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 r=0;r<t.length;r++)e.push(t[r]);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 e in S)if(Object.prototype.hasOwnProperty.call(S,e)){const i=`${r}${o}${e}`;t[e]=b&&!f?this.translate(i,{...n,defaultValue:pn(_)?_[e]:void 0,joinArrays:!1,ns:s}):this.translate(i,{...n,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=S[e])}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=Ur(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&&!Ur(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=Ur(o)?[o]:o;return null!=e&&a?.length&&!1!==r.applyPostProcessor&&(e=un.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 Ur(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&&!Ur(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Ur(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,fn[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(fn[`${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&&!Ur(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){const t="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,12)&&void 0!==e[r])return!0;return!1}}class mn{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sn.create("languageUtils")}getScriptPartFromCode(e){if(!(e=nn(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=nn(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Ur(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)),Ur(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 Ur(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))):Ur(e)&&i(this.formatLanguageCode(e)),r.forEach(e=>{n.indexOf(e)<0&&i(this.formatLanguageCode(e))}),n}}const vn={zero:0,one:1,two:2,few:3,many:4,other:5},yn={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class bn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=sn.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const r=nn("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!"),yn;if(!e.match(/-|_/))return yn;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)=>vn[e]-vn[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 wn=(e,t,r,n=".",i=!0)=>{let o=((e,t,r)=>{const n=Xr(e,r);return void 0!==n?n:Xr(t,r)})(e,t,r);return!o&&i&&Ur(r)&&(o=rn(e,r,n),void 0===o&&(o=rn(t,r,n))),o},xn=e=>e.replace(/\$/g,"$$$$");class Cn{constructor(e={}){this.logger=sn.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:Qr,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?Zr(i):o||"{{",this.suffix=a?Zr(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Zr(d):h||Zr("$t("),this.nestingSuffix=f?Zr(f):p||Zr(")"),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=wn(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(wn(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=>xn(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?xn(this.escape(e)):xn(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=Ur(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 Ur(o)||this.useRawValueToEscape||(o=Hr(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&&!Ur(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&&!Ur(i))return i;Ur(i)||(i=Hr(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 _n=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(nn(n),i),t[a]=s),s(r)}},Sn=e=>(t,r,n)=>e(nn(r),n)(t);class kn{constructor(e={}){this.logger=sn.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const r=t.cacheInBuiltFormats?_n:Sn;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()]=_n(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 An extends ln{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=sn.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}=qr(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();Ur(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ur(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 In=()=>({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]),Ur(e[1])&&(t.defaultValue=e[1]),Ur(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}),En=e=>(Ur(e.ns)&&(e.ns=[e.ns]),Ur(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ur(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),Fn=()=>{};class Tn extends ln{constructor(e={},t){var r;if(super(),this.options=En(e),this.services={},this.logger=sn,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&&(Ur(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=In();this.options={...r,...this.options,...En(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?sn.init(n(this.modules.logger),this.options):sn.init(null,this.options),e=this.modules.formatter?this.modules.formatter:kn;const t=new mn(this.options);this.store=new cn(this.options.resources,this.options);const i=this.services;i.logger=sn,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new bn(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 An(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 gn(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=Fn),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=Vr(),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=Fn){let r=t;const n=Ur(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=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(n)t(n);else{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=Vr();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=Fn),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&&un.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=Vr();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=Ur(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(Ur(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=hn(e,{...this.options,...t})),`${o.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=hn(e,{...this.options,...t})),s=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(s,o)};return Ur(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=Vr();return this.options.ns?(Ur(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=Vr();Ur(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 mn(In());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 Tn(e,t)}cloneInstance(e={},t=Fn){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new Tn(n);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["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 cn(e,n),i.services.resourceStore=i.store}return i.translator=new gn(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 On=Tn.createInstance();On.createInstance=Tn.createInstance,On.createInstance,On.dir,On.init,On.loadResources,On.reloadResources,On.use,On.changeLanguage,On.getFixedT,On.t,On.exists,On.setDefaultNamespace,On.hasLoadedNamespace,On.loadNamespaces,On.loadLanguages;var Pn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};const Mn={},Rn=(e,t,r,n)=>{Dn(r)&&Mn[r]||(Dn(r)&&(Mn[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);Dn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)})(e,t,r,n))},Ln=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},Nn=(e,t,r)=>{e.loadNamespaces(t,Ln(e,r))},jn=(e,t,r,n)=>{if(Dn(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Nn(e,r,n);r.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Ln(e,n))},Dn=e=>"string"==typeof e,zn=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Bn={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Un=e=>Bn[e];let Vn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(zn,Un)};let Hn;const $n={type:"3rdParty",init(e){((e={})=>{Vn={...Vn,...e}})(e.options.react),(e=>{Hn=e})(e)}},Wn=s();class Gn{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const qn=(e,t,r,n)=>e.getFixedT(t,r,n),Yn=(e,t={})=>{const{i18n:r}=t,{i18n:n,defaultNS:i}=l(Wn)||{},s=r||n||Hn;if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Gn),!s){Rn(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return Dn(t)?t:"object"==typeof(r=t)&&null!==r&&Dn(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}s.options.react?.wait&&Rn(s,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const d={...Vn,...s.options.react,...t},{useSuspense:h,keyPrefix:f}=d;let p=i||s.options?.defaultNS;p=Dn(p)?[p]:p||["translation"],s.reportNamespaces.addUsedNamespaces?.(p);const g=(s.isInitialized||s.initializedStoreOnce)&&p.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}}):(Rn(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,s,d)),m=((e,t,r,n)=>c(qn(e,t,r,n),[e,t,r,n]))(s,t.lng||null,"fallback"===d.nsMode?p:p[0],f),v=()=>m,y=()=>qn(s,t.lng||null,"fallback"===d.nsMode?p:p[0],f),[b,w]=o(v);let x=p.join();t.lng&&(x=`${t.lng}${x}`);const C=((e,t)=>{const r=u();return a(()=>{r.current=e},[e,t]),r.current})(x),_=u(!0);a(()=>{const{bindI18n:e,bindI18nStore:r}=d;_.current=!0,g||h||(t.lng?jn(s,t.lng,p,()=>{_.current&&w(y)}):Nn(s,p,()=>{_.current&&w(y)})),g&&C&&C!==x&&_.current&&w(y);const n=()=>{_.current&&w(y)};return e&&s?.on(e,n),r&&s?.store.on(r,n),()=>{_.current=!1,s&&e&&e?.split(" ").forEach(e=>s.off(e,n)),r&&s&&r.split(" ").forEach(e=>s.store.off(e,n))}},[s,x]),a(()=>{_.current&&g&&w(v)},[s,f,g]);const S=[b,s,g];if(S.t=b,S.i18n=s,S.ready=g,g)return S;if(!g&&!h)return S;throw new Promise(e=>{t.lng?jn(s,t.lng,p,()=>e()):Nn(s,p,()=>e())})};function Xn({i18n:e,defaultNS:t,children:r}){const n=d(()=>({i18n:e,defaultNS:t}),[e,t]);return h(Wn.Provider,{value:n},r)}var Kn,Zn,Jn,Qn,ei,ti={};function ri(){if(Zn)return Kn;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},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,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)}function n(e,t){return function(e,t){if(t.get)return t.get.call(e);return 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)}Zn=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 Kn=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},Kn}!function(){if(ei)return ti;ei=1;var e=function(){if(Qn)return Jn;function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function t(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)}Qn=1;var r=e(ri());function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Pn||"undefined"!=typeof self&&self;var i={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})}(i);var o=n(i.exports),a=t({__proto__:null,default:o},[i.exports]),s={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})}(s);var l=n(s.exports),c=t({__proto__:null,default:l},[s.exports]),u={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}(u);var d=n(u.exports),h=o||a,f=l||c,p=d||t({__proto__:null,default:d},[u.exports]),g=function(e){return"pt-PT"===e?"pt_PT":e},m=r.default(Intl.NumberFormat,function(e){return h[g(e)]},function(e,t){return f[g(e)][t?"ordinal":"cardinal"]},function(e){return p[g(e)]});return Jn=m}();function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(e);if("undefined"==typeof Intl)void 0!==Pn?Pn.Intl={PluralRules:r.default}:"undefined"!=typeof window?window.Intl={PluralRules:r.default}:ti.Intl={PluralRules:r.default},r.default.polyfill=!0;else if(Intl.PluralRules&&Intl.PluralRules.prototype.selectRange){var n=["en","es","ru","zh"];Intl.PluralRules.supportedLocalesOf(n).length<n.length&&(Intl.PluralRules=r.default,r.default.polyfill=!0)}else Intl.PluralRules=r.default,r.default.polyfill=!0}();var ni={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","Failed to load files in folder":"Could not load folder contents ({{folderName}})","Failed to load subfolders in folder":'Could not load subfolders in "{{folderName}}"',"Failed to load folder items count in folder":'Could not get item count for "{{folderName}}"',"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","Save as copy and choose":"Save as copy and choose","Save and choose":"Save and choose",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..."}},ii={Files:"Файлы",selected:"выбрано",Deselected:"Отменить выбор",Refresh:"Обновить","Select all":"Выбрать все",Rename:"Переименовать","Rename file":"Переименовать файл {{currentFileName}}","Select the destination folder":"Выберите папку назначения","Selected files:":"Выбрано файлов:","Selected files":"Выбрано файлов: {{count}}",selected_files_one:"Выбран {{count}} файл",selected_files_few:"Выбрано {{count}} файла",selected_files_many:"Выбрано {{count}} файлов",selected_files_other:"Выбрано {{count}} файлов",Copy:"Дублировать",Edit:"Изменить",Move:"Переместить","Move to":"Переместить",Delete:"Удалить","New folder":"Новая папка","Image search...":"Поиск изображений...","Search icons":"Найти иконки","By name":"По имени","By size":"По размеру","By date":"По дате",List:"Список",Grid:"Плитки",Main:"Главная",Folders:"Папки","total pages":"Всего {{total}} элементов",Name:"Имя",Untitled:"Без названия",Size:"Размер",Dimensions:"Размер",Date:"Дата",error:"ошибка",Folder:"Папка",created:"создана","Failed to create folder":"Не удалось создать папку","File deleted":"Файл удален","Files deleted":"Файлы удалены","Error when deleting a file":"Ошибка при удалении файла","Folder deleted":"Папка удалена","Error when deleting a folder":"Ошибка при удалении папки","Delete folder":"Удалить папку","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Вы уверены, что хотите удалить эту папку? Это действие также удалит все файлы и подпапки.","API-endpoint for file upload is not configured":"API-endpoint для загрузки файлов не настроен","Please select an image file":"Пожалуйста, выберите файл изображения",File:"Файл","has been successfully uploaded":"успешно загружен","The URL must point to an image":"URL должен указывать на изображение","Image upload...":"Загрузка изображения...",Unknown:"Неизвестно","Error downloading file by URL":"Ошибка загрузки файла по URL","successfully uploaded":"успешно загружен","Error when downloading a file by URL":"Ошибка при загрузке файла по URL","Error when uploading a file":"Ошибка при загрузке файла","Error loading files":"Ошибка загрузки файлов","File not found":"Файл не найден","File renamed to":"Файл переименован на ","Failed to rename the file":"Не удалось переименовать файл","Folder renamed to":"Папка переименована на","Rename folder":"Переименовать папку","New folder name":"Новое название папки","Enter a new folder name":"Введите новое название папки","Please drag and drop image files only":"Пожалуйста, перетащите только файлы изображений","Upload file by URL":"Загрузить файл по URL","Upload file":"Загрузить файл","Creating a new folder":"Создание новой папки",Create:"Создать",Cancel:"Отмена","Folder name":"Название папки","Enter the name of the folder":"Введите название папки","Enter the name":"Введите название","A folder will be created inside:":"Папка будет создана внутри:","selected folder":"выбранной папки","The folder will be created in the root directory":"Папка будет создана в корневом каталоге","Failed to load folders":"Не удалось загрузить папки","Folder name cannot be empty":"Название папки не может быть пустым","Folder creation provider is not configured":"Провайдер создания папок не настроен","Folder created":"Папка создана","Folder rename is disabled by config":"Переименование папок отключено конфигурацией","Folder rename provider is not configured":"Провайдер переименования папок не настроен","Unexpected response when renaming folder":"Неожиданный ответ при переименовании папки","Folder renamed":"Папка переименована","Failed to rename folder":"Не удалось переименовать папку","Failed to load folder items count":"Не удалось получить количество файлов в папке","Failed to load subfolders":"Не удалось загрузить подпапки",Download:"Загрузить","image URL":"URL изображения","Enter the URL of the image":"Введите URL изображения","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Поддерживаемые форматы: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Новое имя файла","Enter a new file name":"Введите новое имя файла","Copy to folder":"Копировать в папку",Added:"Добавлено {{date}}","File uploaded successfully":"Файл {{fileName}} успешно загружен","Successfully uploaded":"Успешно загружено {{successCount}} из {{count}} файла","Successfully uploaded files":"Успешно загружено {{successCount}} из {{count}} файлов",uploads_success_summary:"Загружено {{successCount}} из {{totalCount}} файлов",uploads_fail_summary:"Не удалось загрузить {{failCount}} из {{totalCount}} файлов","File with this name already exists.":"Файл с таким именем уже существует.","File not found or no longer available.":"Файл не найден или уже был удалён.","You don't have permission to access this file.":"У вас нет прав доступа к этому файлу.","File is too large to upload.":"Файл слишком большой для загрузки.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"Файл слишком большой ({{fileSize}}). Максимально допустимый размер — {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Превышено максимальное количество файлов. Допустимо: {{allowed}}, выбрано: {{received}}","This file type is not allowed.":"Этот тип файла не поддерживается.","File name is not valid.":"Недопустимое имя файла.","File name is not valid. Allowed characters: {{allowedChars}}":"Недопустимое имя файла. Допустимые символы: {{allowedChars}}","Failed to read the file.":"Не удалось прочитать файл.","Failed to write the file.":"Не удалось записать файл.","The file appears to be corrupted.":"Файл повреждён или имеет неверный формат.","File integrity check failed.":"Проверка целостности файла завершилась неудачно.","Folder not found or no longer available.":"Папка не найдена или уже была удалена.","Folder with this name already exists.":"Папка с таким именем уже существует.","A folder with that name already exists. Please enter a different folder name.":"Папка с таким именем уже существует. Введите другое имя папки.","You don't have permission to access this folder.":"У вас нет прав доступа к этой папке.","Folder name is not valid.":"Недопустимое имя папки.","Folder name is not valid. Allowed characters: {{allowedChars}}":"Не удалось создать папку. Допустимые символы в названии папки: {{allowedChars}}","Failed to read the folder contents.":"Не удалось прочитать содержимое папки.","Failed to write to the folder.":"Не удалось выполнить операцию с папкой.","Folder storage quota exceeded.":"Превышена квота хранения для папки.","Folder is not empty.":"Папка не пуста.","Server error while processing the folder.":"Ошибка сервера при обработке папки.","Folder operation took too long.":"Операция с папкой выполнялась слишком долго.","Network error. Please check your connection and try again.":"Ошибка сети. Проверьте подключение к интернету и повторите попытку.","The operation took too long. Please try again.":"Операция выполнялась слишком долго. Попробуйте ещё раз.","Server error. Please try again later.":"Ошибка на сервере. Повторите попытку позже.","Service is temporarily unavailable. Please try again later.":"Сервис временно недоступен. Повторите попытку позже.","Too many requests. Please try again a bit later.":"Слишком много запросов. Попробуйте ещё раз немного позже.","Authentication failed. Please sign in again.":"Не удалось пройти аутентификацию. Пожалуйста, войдите снова.","You are not allowed to perform this action.":"У вас нет прав для выполнения этого действия.","Some of the provided data is invalid.":"Некоторые из переданных данных некорректны.","This operation is not supported.":"Эта операция не поддерживается.","Request payload is too large.":"Тело запроса слишком большое.","This media type is not supported.":"Этот тип данных не поддерживается.","You have exceeded the upload quota.":"Превышена квота на загрузку файлов.","Network error while uploading the file.":"Сетевая ошибка при загрузке файла.","File upload took too long.":"Загрузка файла выполнялась слишком долго.","Server error while uploading the file.":"Ошибка сервера при загрузке файла.","The specified URL is not valid.":"Указан некорректный URL.","The specified URL is not reachable.":"Указанный URL недоступен.","Content type at the URL is not allowed.":"Тип содержимого по указанному URL не поддерживается.","Failed to download file from the URL.":"Не удалось скачать файл по указанному URL.","Network error while downloading the file.":"Сетевая ошибка при скачивании файла.","File download took too long.":"Скачивание файла выполнялось слишком долго.","Server error while downloading the file.":"Ошибка сервера при скачивании файла.","Some items could not be processed.":"Не все элементы были обработаны успешно.","Failed to process all items in the batch.":"Не удалось обработать ни один элемент в пакетной операции.","Some items in the batch are in a conflicting state.":"Некоторые элементы в пакетной операции находятся в конфликтующем состоянии.","Some items in the batch did not pass validation.":"Некоторые элементы в пакетной операции не прошли валидацию.","AI service returned an invalid response.":"Сервис AI вернул некорректный ответ.","Failed to generate image using AI.":"Не удалось создать изображение с помощью AI.","You have reached the AI image generation limit.":"Достигнут лимит генерации изображений AI.","Error in external integration.":"Ошибка во внешней интеграции.","Error in a third-party service.":"Ошибка во внешнем сервисе.","An unknown error occurred.":"Произошла неизвестная ошибка.","Renaming is not allowed for this item.":"Переименование не разрешено для этого элемента.","Moving is not allowed for this item.":"Перемещение не разрешено для этого элемента.","Copying is not allowed for this item.":"Копирование не разрешено для этого элемента.","Deleting is not allowed for this item.":"Удаление не разрешено для этого элемента.","Cannot move an item into itself.":"Нельзя переместить элемент в самого себя.","Cannot move an item into its descendant folder.":"Нельзя переместить элемент в дочернюю папку.","Cannot copy an item into itself.":"Нельзя скопировать элемент в самого себя.","Configuration error occurred.":"Произошла ошибка конфигурации.","Storage quota exceeded. Please free up space.":"Превышена квота хранилища. Освободите место.","File is locked by another process or user.":"Файл заблокирован другим процессом или пользователем.","File version conflict. Please refresh and try again.":"Конфликт версий файла. Обновите страницу и попробуйте снова.","Batch operation exceeds the maximum number of items allowed.":"Пакетная операция превышает максимально допустимое количество элементов.",Moved:"Перемещены: {{names}}",move_success_summary:"Перемещено {{successCount}} из {{totalCount}} объектов",move_fail_summary:"Не удалось переместить {{failCount}} из {{totalCount}} объектов",Copied:"Скопированы: {{names}}",copy_success_summary:"Скопировано {{successCount}} из {{totalCount}} объектов",copy_fail_summary:"Не удалось скопировать {{failCount}} из {{totalCount}} объектов",Uploaded:"Загружены: {{names}}",Failed:"Не удалось: {{names}}","Failed to upload":"Не удалось загрузить {{failCount}} из {{count}} файла","Failed to upload files":"Не удалось загрузить {{failCount}} из {{count}} файлов",months:{january:"января",february:"февраля",march:"марта",april:"апреля",may:"мая",june:"июня",july:"июля",august:"августа",september:"сентября",october:"октября",november:"ноября",december:"декабря"},files:"файлов","No available folders":"Нет доступных папок","My files":"Мои файлы",GIF:"GIF","Stock images":"Стоковые изображения",Icons:"Иконки",AI:"AI","AI image generation":"AI генерация изображений","Search GIFs":"Найти GIF","That`s all we could find.":"Это все, что мы смогли найти.","Search image":"Найти изображение",All:"Все",Landscape:"Горизонтальные",Portrait:"Вертикальные",Squarish:"Квадратные",Black:"Черный","Black and White":"Черно-белый",White:"Белый",Orange:"Оранжевый",Red:"Красный",Purple:"Фиолетовый",Magenta:"Пурпурный",Green:"Зеленый",Teal:"Бирюзовый",Blue:"Синий","Photo by":"Фото",on:"на","File Manager":"Файловый менеджер","File Manager not configured":"Файловый менеджер не настроен","Filter by type":"Фильтр по типу","All types":"Все типы","File name":"Имя файла",Actions:"Действия","Add file":"Добавить файл","Add folder":"Добавить папку","Add file by URL":"Добавить файл по URL","File moved":"Файл перемещён","Files moved":"Файлы перемещены","Error when moving a file":"Ошибка при перемещении файла","Files copied":"Файлы скопированы","Failed to download file":"Не удалось скачать файл","Failed to load JSON data":"Не удалось загрузить данные JSON","Invalid file URL":"Некорректный URL файла","Unable to validate file URL":"Не удалось проверить файл по URL","Type to search...":"Введите для поиска...",Submit:"Отправить","No folders yet":"Папок пока нет","Drag files to upload":"Перетащите файлы для загрузки","Drop files here to upload":"Отпустите файлы здесь, чтобы загрузить их","Newest first":"Сначала новые","Oldest first":"Сначала старые","Largest first":"Сначала большие","Smallest first":"Сначала маленькие","A-Z":"По алфавиту А-Я","Z-A":"По алфавиту Я-А","By type":"По типу","Evaluating the task":"Оценка задания","Something went wrong, please try again":"Что-то пошло не так, пожалуйста, попробуйте еще раз","Sort by":"Сортировать по","preview text":"Изображение загружается ...","Use this variant":"Использовать этот вариант","Confirm deletion":"Подтвердить удаление","Are you sure you want to delete the selected items?":"Вы уверены, что хотите удалить выбранные элементы?","Move to Trash":"Переместить в корзину","Are you sure you want to move the selected items to the Trash?":"Вы уверены, что хотите переместить выбранные элементы в корзину?","Permanently delete":"Полное удаление","Delete permanently":"Удалить безвозвратно","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Вы уверены, что хотите безвозвратно удалить выбранные элементы? Это действие нельзя отменить.",Clear:"Очистить","Clear Trash":"Очистить корзину","Are you sure you want to permanently delete all items from Trash?":"Вы уверены, что хотите безвозвратно удалить все элементы из корзины?","Trash cleared successfully":"Корзина успешно очищена","{{count}} items permanently deleted":"{{count}} элементов безвозвратно удалено","Trash partially cleared":"Корзина частично очищена","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} элементов удалено, {{failed}} не удалось удалить","Failed to clear trash":"Не удалось очистить корзину","Error clearing trash":"Ошибка при очистке корзины","Deleting items...":"Удаление элементов...",delete_files_permanent_one:"Это действие безвозвратно удалит {{count}} файл",delete_files_permanent_few:"Это действие безвозвратно удалит {{count}} файла",delete_files_permanent_many:"Это действие безвозвратно удалит {{count}} файлов",delete_files_permanent_other:"Это действие безвозвратно удалит {{count}} файлов",delete_folder_permanent:"Это действие безвозвратно удалит папку «{{name}}» и всё её содержимое, включая {{count}} элементов.",delete_mixed_permanent:"Это действие безвозвратно удалит {{total}} выбранных элементов, включая {{folders}} папок и все {{images}} изображений внутри них.",permanent_delete_warning:"Удаление файлов, которые были использованы в письмах, приведет к проблемам с отображением картинок в старых письмах. Вы уверены, что хотите полностью удалить выбранное?",move_files_to_trash_one:"Это действие переместит в корзину {{count}} файл.",move_files_to_trash_few:"Это действие переместит в корзину {{count}} файла.",move_files_to_trash_many:"Это действие переместит в корзину {{count}} файлов.",move_files_to_trash_other:"Это действие переместит в корзину {{count}} файлов.",move_folder_to_trash:"Это действие переместит в корзину папку «{{name}}» и всё её содержимое ({{count}} элементов).",move_mixed_to_trash:"Это действие переместит в корзину {{total}} выбранных элементов, включая {{folders}} папок и {{images}} изображений.",delete_count_confirm_trash_one:"Переместить в корзину {{count}} файл?",delete_count_confirm_trash_few:"Переместить в корзину {{count}} файла?",delete_count_confirm_trash_many:"Переместить в корзину {{count}} файлов?",delete_count_confirm_trash_other:"Переместить в корзину {{count}} файлов?",delete_count_confirm_permanent_one:"Удалить навсегда {{count}} файл?",delete_count_confirm_permanent_few:"Удалить навсегда {{count}} файла?",delete_count_confirm_permanent_many:"Удалить навсегда {{count}} файлов?",delete_count_confirm_permanent_other:"Удалить навсегда {{count}} файлов?",delete_count_confirm_one:"Удалить {{count}} файл?",delete_count_confirm_few:"Удалить {{count}} файла?",delete_count_confirm_many:"Удалить {{count}} файлов?",delete_count_confirm_other:"Удалить {{count}} файлов?",item:"файл",items:"файлов",Trash:"Корзина",Choose:"Выбрать",Stock:"Фотосток","Select an image from our library":"Выберите изображение из нашей библиотеки","AI generation":"AI генерация","Creating an image on demand":"Создание изображения по запросу","Search file or folder":"Найти файл или папку","Click here to select a file":"Нажмите здесь, чтобы выбрать файл","Supported files:":"Поддерживаемые файлы:","Create folder":"Создать папку",Done:"Готово","Move here":"Переместить сюда","Copy here":"Копировать сюда","File URL":"URL файла","There's nothing here":"Здесь ничего нет","Try using a different search query.":"Попробуйте использовать другой поисковый запрос.","Millions of free stock images":"Миллионы бесплатных стоковых изображений","Enter a search query and we'll find the perfect image for you":"Введите поисковый запрос, и мы найдем для вас идеальное изображение","Millions of icons":"Миллионы иконок","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":"Введите запрос и мы найдем для вас подходящее","Over 350,000 live images":"Более 350 000 живых изображений","The folder will be created in the root directory.":"Папка будет создана в корневом каталоге.",undo:"ОТМЕНА",moved_to_trash_one:"Перемещён {{count}} элемент в корзину",moved_to_trash_few:"Перемещено {{count}} элемента в корзину",moved_to_trash_many:"Перемещено {{count}} элементов в корзину",moved_to_trash_other:"Перемещено {{count}} элементов в корзину",restored_items_one:"Восстановлён {{count}} элемент",restored_items_few:"Восстановлено {{count}} элемента",restored_items_many:"Восстановлено {{count}} элементов",restored_items_other:"Восстановлено {{count}} элементов",Type:"Тип","Generate image":"Cгенерировать изображение","A beautiful image of a sunset over a calm ocean.":"Красивое изображение заката над спокойным океаном.","For example:":"Например:",Insert:"Вставить",Error:"Ошибка","Upload progress":"Загрузка {{completed}}/{{total}}","Uploading files":"Загрузка {{completed}}/{{total}} файлов","Uploaded files":"Загружено {{success}} из {{total}} файлов","Upload error files":"Ошибка загрузки {{errorCount}} файлов","Applies to all {{count}} files":"(применительно ко всем {{count}} файлам)","Some files failed to upload":"Некоторые файлы не удалось загрузить. Проверьте размер и формат файлов.",upload_error_hint_invalid_name:"Переименуйте файл: используйте только буквы, цифры, дефис и подчёркивание.",upload_error_hint_size:"Уменьшите размер файла или выберите другой.",upload_error_hint_format:"Используйте допустимый формат: JPG, PNG или GIF.",upload_error_hint_exists:"Файл с таким именем уже есть в папке. Переименуйте файл.","Images generated successfully":"Изображения успешно сгенерированы","Trash is empty":"Корзина пуста","Deleted files will be displayed here":"Здесь будут отображаться удаленные файлы","Stroke width":"Толщина:",Style:"Стиль",Color1:"Цвет 1:",Color2:"Цвет 2:",Color3:"Цвет 3: ","Global search":"Глобальный поиск","Family search":"Поиск по семейству","Choose for template":"Выбрать для загрузки в шаблон",Back:"Назад","Editing: {{name}}":"Редактирование: {{name}}","Editing image":"Редактирование изображения",Save:"Сохранить","Loading editor...":"Загрузка редактора…","Error loading image":"Ошибка загрузки изображения","Error saving image":"Ошибка при сохранении изображения","Error initializing editor":"Ошибка инициализации редактора","Close File Manager":"Закрыть файловый менеджер","Are you sure you want to close? Unsaved changes will be lost.":"Вы уверены, что хотите закрыть? Несохраненные изменения будут потеряны.","Are you sure you want to close the file manager?":"Вы уверены, что хотите закрыть файловый менеджер?",Close:"Закрыть",KB:"КБ","No files":"Нет файлов","Folder is empty or files not found":"Папка пуста или файлы не найдены","Search files...":"Поиск файлов...",Success:"Успех","Image updated successfully":"Изображение успешно обновлено","Failed to save changes":"Не удалось сохранить изменения: {{error}}","Unknown error":"Неизвестная ошибка","Select destination folder":"Выберите папку назначения","Error moving":"Ошибка при перемещении","Error deleting":"Ошибка при удалении","Error copying":"Ошибка при копировании","Error renaming":"Ошибка при переименовании","Failed to refresh folder tree":"Не удалось обновить дерево папок","Failed to refresh file list":"Не удалось обновить список файлов","Errors occurred while moving":"При перемещении произошли ошибки","Errors occurred while copying":"При копировании произошли ошибки","(error)":"(ошибка)","(circular reference)":"(циклическая ссылка)","File too large. Maximum size: {{size}}":"Файл слишком большой. Максимальный размер: {{size}}","File too small. Minimum size: {{size}}":"Файл слишком маленький. Минимальный размер: {{size}}","Unsupported file type":"Неподдерживаемый тип файла","Unsupported file type: {{type}}":"Неподдерживаемый тип файла: {{type}}",unknown:"неизвестный","Failed to load files":"Не удалось загрузить файлы","Failed to load files in folder":"Не удалось загрузить содержимое папки «{{folderName}}»","Failed to load subfolders in folder":"Не удалось загрузить подпапки в «{{folderName}}»","Failed to load folder items count in folder":"Не удалось получить число элементов в «{{folderName}}»","DataProvider for folder deletion is not configured":"DataProvider для удаления папок не настроен","DataProvider for file upload is not configured":"DataProvider для загрузки файлов не настроен","Error uploading file {{fileName}}":"Ошибка при загрузке файла {{fileName}}","Error uploading file":"Ошибка при загрузке файла","Cannot upload files to Trash":"Нельзя загружать файлы в корзину","Please fill in all fields":"Заполните все поля","URL too long":"URL слишком длинный","Only http and https URLs are supported":"Поддерживаются только URL с протоколом http и https","Private and local URLs are not allowed":"Локальные и приватные URL запрещены","Upload by URL is not supported":"Загрузка по URL не поддерживается","File name is too long. Maximum {{max}} characters":"Имя файла слишком длинное. Максимум {{max}} символов","File name contains invalid characters":"Имя файла содержит недопустимые символы","Large file may take a long time to upload":"Большой файл может загружаться долго","File unavailable: {{status}} {{statusText}}":"Файл недоступен: {{status}} {{statusText}}","File too large: {{size}}":"Файл слишком большой: {{size}}","Unsupported file type: {{contentType}}":"Неподдерживаемый тип файла: {{contentType}}","Invalid server response: folder ID is missing":"Некорректный ответ от сервера: отсутствует ID папки","Error: folder cannot be its own parent":"Ошибка: папка не может быть родителем самой себя","Upload to Trash is forbidden":"Загрузка в корзину запрещена","renameFolder is not implemented in dataProviders":"renameFolder не реализован в dataProviders","renameFile is not implemented in dataProviders":"renameFile не реализован в dataProviders",Deleted:"Удаленные файлы",Clean:"Очистить","Circular dependency detected: folder cannot be its own parent":"Обнаружена циклическая зависимость: папка не может быть родителем самой себя","Save as copy and choose":"Сохранить как копию и выбрать","Save and choose":"Сохранить и выбрать",pixie:{"added drawing":"Добавление рисунка","added frame":"Добавление рамки","added image":"Добавление изображения","added shape":"Добавление фигуры","added sticker":"Добавление стикера","added text":"Добавление текста","applied filters":"Применение фильтр",apply:"Применить",background:"Фон","background color":"Фоновый цвет",beach:"Пляж","brush color":"Цвет кисти","brush size":"Размер кисти","brush type":"Тип кисти",bubbles:"Пузырьки",Cancel:"Отмена","changed style":"Изменение стиля","Circle Brush":"Круги",close:"Закрыть",color:"Цвет",corners:"Углы",crop:"Обрезать",Custom:"Пользовательский","deleted object":"Удаление объекта","Diamond Brush":"Алмаз",doodles:"Цветные",draw:"Рисунок",emoticons:"Смайлики","Eraser Brush":"Ластик",filter:"Фильтр",font:"Шрифт","font size":"Размер шрифта",frame:"Рамка",gradient:"Градиент",height:"Высота",history:"История","H Line Brush":"Н-образная",image:"Изображение",initial:"Начальный",landmarks:"Достопримечательности","loaded state":"Загрузка состояния","loading canvas":"Загрузка","loading image":"Загрузка","loading state":"Загрузка","maintain aspect ratio":"Maintain aspect ratio",merge:"Объединение","merged objects":"Объединение объектов","new text":"Новая надпись",objects:"Объект",opacity:"Прозрачность",outline:"Контур","outline color":"Цвет контура","Pencil Brush":"Карандаш","processing image":"Загрузка",quality:"Качество",radius:"Радиус","replace image":"Replace Image","replaced background image":"Удаление фонового изображения",resize:"Размер","resized image":"Изменение размера","rounded corner":"Загругление углов",save:"Сохранить",shadow:"Тень","shadow color":"Цвет тени",shapes:"Фигуры","Spray Brush":"Спрей",square:"Квардрат","Square Brush":"Квардрат",stickers:"Стикеры",text:"Надпись",texture:"Текстура",transportation:"Транспорт","V Line Brush":"V-образная",width:"Ширина",grayscale:"Оттенки серого","black & White":"Черно-белый",sharpen:"Резкость",invert:"Инверсия",vintage:"Винтаж",polaroid:"Полароид",kodachrome:"Кодахром",technicolor:"Техниколор",brownie:"Коричневый",sepia:"Сепия","remove Color":"Удалить цвет",brightness:"Яркость",gamma:"Гамма",noise:"Шум",pixelate:"Пиксельизация",blur:"Размытие",emboss:"Тиснение","blend Color":"Смешать цвет",distance:"Расстояние",red:"Красный",green:"Зеленый",blue:"Синий",blocksize:"Размер блока",alpha:"Альфа",add:"Добавить",multiply:"Умножить",subtract:"Вычесть",diff:"Разница",screen:"Экран",lighten:"Осветлить",darken:"Затемнить","select an option...":"Выберите опцию..."}},oi={Files:"Файли",selected:"обрано",Deselected:"Скасувати вибір",Refresh:"Оновити","Select all":"Вибрати все",Rename:"Перейменувати","Rename file":"Перейменувати файл {{currentFileName}}","Select the destination folder":"Виберіть папку призначення","Selected files:":"Обрано файлів:","Selected files":"Обрано файлів: {{count}}",selected_files_one:"Обрано {{count}} файл",selected_files_few:"Обрано {{count}} файли",selected_files_many:"Обрано {{count}} файлів",selected_files_other:"Обрано {{count}} файлів",Copy:"Дублювати",Edit:"Змінити",Move:"Перемістити","Move to":"Перемістити",Delete:"Видалити","New folder":"Нова папка","Image search...":"Пошук зображень...","Search icons":"Знайти іконки","By name":"За назвою","By size":"За розміром","By date":"За датою",List:"Список",Grid:"Плитки",Main:"Головна",Folders:"Папки","total pages":"Всього {{total}} елементів",Name:"Назва",Untitled:"Без назви",Size:"Розмір",Dimensions:"Розмір",Date:"Дата",error:"помилка",Folder:"Папка",created:"створена","Failed to create folder":"Не вдалося створити папку","File deleted":"Файл видалено","Error when deleting a file":"Помилка при видаленні файлу","Folder deleted":"Папку видалено","Error when deleting a folder":"Помилка при видаленні папки","Delete folder":"Видалити папку","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Ви впевнені, що хочете видалити цю папку? Ця дія також видалить усі файли та підпапки.","API-endpoint for file upload is not configured":"API-endpoint для завантаження файлів не налаштовано","Please select an image file":"Будь ласка, виберіть файл зображення",File:"Файл","has been successfully uploaded":"успішно завантажено","The URL must point to an image":"URL повинен вказувати на зображення","Image upload...":"Завантаження зображення...",Unknown:"Невідомо","Error downloading file by URL":"Помилка завантаження файлу за URL","successfully uploaded":"успішно завантажено","Error when downloading a file by URL":"Помилка при завантаженні файлу за URL","Error when uploading a file":"Помилка при завантаженні файлу","Error loading files":"Помилка завантаження файлів","File not found":"Файл не знайдено","File renamed to":"Файл перейменовано на ","Failed to rename the file":"Не вдалося перейменувати файл","Folder renamed to":"Папку перейменовано на","Rename folder":"Перейменувати папку","New folder name":"Нова назва папки","Enter a new folder name":"Введіть нову назву папки","Please drag and drop image files only":"Будь ласка, перетягуйте лише файли зображень","Upload file by URL":"Завантажити файл за URL","Upload file":"Завантажити файл","Creating a new folder":"Створення нової папки",Create:"Створити",Cancel:"Скасувати","Folder name":"Назва папки","Enter the name of the folder":"Введіть назву папки","Enter the name":"Введіть назву","A folder will be created inside:":"Папка буде створена всередині:","selected folder":"обраної папки","The folder will be created in the root directory":"Папка буде створена в кореневому каталозі","Failed to load folders":"Не вдалося завантажити папки","Folder name cannot be empty":"Назва папки не може бути порожньою","Folder creation provider is not configured":"Постачальник створення папок не налаштований","Folder created":"Папку створено","Folder rename is disabled by config":"Перейменування папок вимкнено в налаштуваннях","Folder rename provider is not configured":"Постачальник перейменування папок не налаштований","Unexpected response when renaming folder":"Неочікувана відповідь під час перейменування папки","Folder renamed":"Папку перейменовано","Failed to rename folder":"Не вдалося перейменувати папку","Failed to load folder items count":"Не вдалося отримати кількість елементів у папці","Failed to load subfolders":"Не вдалося завантажити підпапки",Download:"Завантажити","image URL":"URL зображення","Enter the URL of the image":"Введіть URL зображення","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Підтримувані формати: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Нова назва файлу","Enter a new file name":"Введіть нову назву файлу","Copy to folder":"Копіювати в папку",Added:"Додано {{date}}","File uploaded successfully":"Файл {{fileName}} успішно завантажено","Successfully uploaded":"Успішно завантажено {{successCount}} з {{count}} файлу","Successfully uploaded files":"Успішно завантажено {{successCount}} з {{count}} файлів",uploads_success_summary:"Завантажено {{successCount}} з {{totalCount}} файлів",uploads_fail_summary:"Не вдалося завантажити {{failCount}} з {{totalCount}} файлів","File with this name already exists.":"Файл з такою назвою вже існує.","File not found or no longer available.":"Файл не знайдено або його вже видалено.","You don't have permission to access this file.":"У вас немає прав доступу до цього файлу.","File is too large to upload.":"Файл занадто великий для завантаження.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"Файл занадто великий ({{fileSize}}). Дозволений максимальний розмір — {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Перевищено максимальну кількість файлів. Дозволено: {{allowed}}, обрано: {{received}}","This file type is not allowed.":"Цей тип файлу не підтримується.","File name is not valid.":"Неприпустима назва файлу.","File name is not valid. Allowed characters: {{allowedChars}}":"Неприпустима назва файлу. Допустимі символи: {{allowedChars}}","Failed to read the file.":"Не вдалося прочитати файл.","Failed to write the file.":"Не вдалося записати файл.","The file appears to be corrupted.":"Файл пошкоджений або має неправильний формат.","File integrity check failed.":"Перевірка цілісності файлу завершилась невдало.","Folder not found or no longer available.":"Папку не знайдено або її вже видалено.","Folder with this name already exists.":"Папка з такою назвою вже існує.","A folder with that name already exists. Please enter a different folder name.":"Папка з такою назвою вже існує. Введіть інше ім'я папки.","You don't have permission to access this folder.":"У вас немає прав доступу до цієї папки.","Folder name is not valid.":"Неприпустима назва папки.","Folder name is not valid. Allowed characters: {{allowedChars}}":"Не вдалося створити папку. Допустимі символи в назві папки: {{allowedChars}}","Failed to read the folder contents.":"Не вдалося прочитати вміст папки.","Failed to write to the folder.":"Не вдалося виконати операцію з папкою.","Folder storage quota exceeded.":"Перевищено квоту зберігання для папки.","Folder is not empty.":"Папка не порожня.","Server error while processing the folder.":"Помилка сервера під час обробки папки.","Folder operation took too long.":"Операція з папкою зайняла надто багато часу.","Network error. Please check your connection and try again.":"Помилка мережі. Перевірте підключення до інтернету та повторіть спробу.","The operation took too long. Please try again.":"Операція виконувалася надто довго. Спробуйте ще раз.","Server error. Please try again later.":"Помилка на сервері. Повторіть спробу пізніше.","Service is temporarily unavailable. Please try again later.":"Сервіс тимчасово недоступний. Повторіть спробу пізніше.","Too many requests. Please try again a bit later.":"Занадто багато запитів. Спробуйте ще раз пізніше.","Authentication failed. Please sign in again.":"Не вдалося пройти автентифікацію. Будь ласка, увійдіть знову.","You are not allowed to perform this action.":"У вас немає прав для виконання цієї дії.","Some of the provided data is invalid.":"Деякі з переданих даних є некоректними.","This operation is not supported.":"Ця операція не підтримується.","Request payload is too large.":"Тіло запиту занадто велике.","This media type is not supported.":"Цей тип даних не підтримується.","You have exceeded the upload quota.":"Перевищено квоту на завантаження файлів.","Network error while uploading the file.":"Помилка мережі під час завантаження файлу.","File upload took too long.":"Завантаження файлу тривало надто довго.","Server error while uploading the file.":"Помилка сервера під час завантаження файлу.","The specified URL is not valid.":"Вказано некоректну URL-адресу.","The specified URL is not reachable.":"Вказана URL-адреса недоступна.","Content type at the URL is not allowed.":"Тип вмісту за вказаною URL-адресою не підтримується.","Failed to download file from the URL.":"Не вдалося завантажити файл за вказаною URL-адресою.","Network error while downloading the file.":"Помилка мережі під час завантаження файлу.","File download took too long.":"Завантаження файлу тривало надто довго.","Server error while downloading the file.":"Помилка сервера під час завантаження файлу.","Some items could not be processed.":"Не всі елементи були оброблені успішно.","Failed to process all items in the batch.":"Не вдалося обробити жоден елемент у пакетній операції.","Some items in the batch are in a conflicting state.":"Деякі елементи в пакетній операції перебувають у конфліктному стані.","Some items in the batch did not pass validation.":"Деякі елементи в пакетній операції не пройшли валідацію.","AI service returned an invalid response.":"Сервіс ШІ повернув некоректну відповідь.","Failed to generate image using AI.":"Не вдалося створити зображення за допомогою ШІ.","You have reached the AI image generation limit.":"Досягнуто ліміту генерації зображень ШІ.","Error in external integration.":"Помилка у зовнішній інтеграції.","Error in a third-party service.":"Помилка у зовнішньому сервісі.","An unknown error occurred.":"Сталася невідома помилка.","Renaming is not allowed for this item.":"Перейменування не дозволено для цього елемента.","Moving is not allowed for this item.":"Переміщення не дозволено для цього елемента.","Copying is not allowed for this item.":"Копіювання не дозволено для цього елемента.","Deleting is not allowed for this item.":"Видалення не дозволено для цього елемента.","Cannot move an item into itself.":"Не можна перемістити елемент у самого себе.","Cannot move an item into its descendant folder.":"Не можна перемістити елемент у дочірню папку.","Cannot copy an item into itself.":"Не можна скопіювати елемент у самого себе.","Configuration error occurred.":"Сталася помилка конфігурації.","Storage quota exceeded. Please free up space.":"Перевищено квоту сховища. Звільніть місце.","File is locked by another process or user.":"Файл заблоковано іншим процесом або користувачем.","File version conflict. Please refresh and try again.":"Конфлікт версій файлу. Оновіть сторінку та спробуйте ще раз.","Batch operation exceeds the maximum number of items allowed.":"Пакетна операція перевищує максимально допустиму кількість елементів.",Moved:"Переміщено: {{names}}",move_success_summary:"Переміщено {{successCount}} з {{totalCount}} елементів",move_fail_summary:"Не вдалося перемістити {{failCount}} з {{totalCount}} елементів",Copied:"Скопійовано: {{names}}",copy_success_summary:"Скопійовано {{successCount}} з {{totalCount}} елементів",copy_fail_summary:"Не вдалося скопіювати {{failCount}} з {{totalCount}} елементів",Uploaded:"Завантажено: {{names}}",Failed:"Не вдалося завантажити: {{names}}","Failed to upload":"Не вдалося завантажити {{failCount}} з {{count}} файлу","Failed to upload files":"Не вдалося завантажити {{failCount}} з {{count}} файлів",months:{january:"січня",february:"лютого",march:"березня",april:"квітня",may:"травня",june:"червня",july:"липня",august:"серпня",september:"вересня",october:"жовтня",november:"листопада",december:"грудня"},files:"файлів","No available folders":"Немає доступних папок","My files":"Мої файли",GIF:"GIF","Stock images":"Стокові зображення",AI:"AI","AI image generation":"AI генерація зображень","Search GIFs":"Знайти GIF","That`s all we could find.":"Це все, що ми змогли знайти.","Search image":"Знайти зображення",All:"Всі",Landscape:"Горизонтальні",Portrait:"Вертикальні",Squarish:"Квадратні",Black:"Чорний","Black and White":"Чорно-білий",White:"Білий",Orange:"Помаранчевий",Red:"Червоний",Purple:"Фіолетовий",Magenta:"Пурпурний",Green:"Зелений",Teal:"Бірюзовий",Blue:"Синій","Photo by":"Фото",on:"на","File Manager":"Файловий менеджер","File Manager not configured":"Файловий менеджер не налаштовано","Filter by type":"Фільтр за типом","All types":"Всі типи","File name":"Назва файлу",Actions:"Дії","Add file":"Додати файл","Add folder":"Додати папку","Add file by URL":"Додати файл за URL","File moved":"Файл переміщено","Error when moving a file":"Помилка при переміщенні файлу","Failed to download file":"Не вдалося завантажити файл","Failed to load JSON data":"Не вдалося завантажити дані JSON","Invalid file URL":"Некоректний URL файлу","Unable to validate file URL":"Не вдалося перевірити файл за URL","Type to search...":"Введіть для пошуку...",Submit:"Надіслати","No folders yet":"Папок поки немає","Drag files to upload":"Перетягніть файли для завантаження","Drop files here to upload":"Відпустіть файли тут, щоб завантажити їх","Newest first":"Спочатку нові","Oldest first":"Спочатку старі","Largest first":"Спочатку великі","Smallest first":"Спочатку маленькі","A-Z":"За алфавітом А-Я","Z-A":"За алфавітом Я-А","By type":"За типом","Evaluating the task":"Оцінка завдання","Something went wrong, please try again":"Щось пішло не так, будь ласка, спробуйте ще раз","Sort by":"Сортувати за","preview text":"Зображення завантажується ...","Use this variant":"Використати цей варіант","Confirm deletion":"Підтвердити видалення","Are you sure you want to delete the selected items?":"Ви впевнені, що хочете видалити обрані елементи?","Move to Trash":"Перемістити в кошик","Are you sure you want to move the selected items to the Trash?":"Ви впевнені, що хочете перемістити обрані елементи в кошик?","Permanently delete":"Повне видалення","Delete permanently":"Видалити безповоротно","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Ви впевнені, що хочете безповоротно видалити обрані елементи? Цю дію не можна скасувати.",Clear:"Очистити","Clear Trash":"Очистити кошик","Are you sure you want to permanently delete all items from Trash?":"Ви впевнені, що хочете безповоротно видалити всі елементи з кошика?","Trash cleared successfully":"Кошик успішно очищено","{{count}} items permanently deleted":"{{count}} елементів безповоротно видалено","Trash partially cleared":"Кошик частково очищено","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} елементів видалено, {{failed}} не вдалося видалити","Failed to clear trash":"Не вдалося очистити кошик","Error clearing trash":"Помилка при очищенні кошика","Deleting items...":"Видалення елементів...",delete_files_permanent_one:"Ця дія безповоротно видалить {{count}} файл",delete_files_permanent_few:"Ця дія безповоротно видалить {{count}} файли",delete_files_permanent_many:"Ця дія безповоротно видалить {{count}} файлів",delete_files_permanent_other:"Ця дія безповоротно видалить {{count}} файлів",delete_folder_permanent:"Ця дія безповоротно видалить папку «{{name}}» і все її вміст, включаючи {{count}} елементів.",delete_mixed_permanent:"Ця дія безповоротно видалить {{total}} обраних елементів, включаючи {{folders}} папок і всі {{images}} зображень всередині них.",permanent_delete_warning:"Видалення файлів, які були використані в листах, призведе до проблем з відображенням зображень у старих листах. Ви впевнені, що хочете повністю видалити обране?",move_files_to_trash_one:"Ця дія перемістить у кошик {{count}} файл.",move_files_to_trash_few:"Ця дія перемістить у кошик {{count}} файли.",move_files_to_trash_many:"Ця дія перемістить у кошик {{count}} файлів.",move_files_to_trash_other:"Ця дія перемістить у кошик {{count}} файлів.",move_folder_to_trash:"Ця дія перемістить у кошик папку «{{name}}» і все її вміст ({{count}} елементів).",move_mixed_to_trash:"Ця дія перемістить у кошик {{total}} обраних елементів, включаючи {{folders}} папок і {{images}} зображень.",delete_count_confirm_trash_one:"Перемістити в кошик {{count}} файл?",delete_count_confirm_trash_few:"Перемістити в кошик {{count}} файли?",delete_count_confirm_trash_many:"Перемістити в кошик {{count}} файлів?",delete_count_confirm_trash_other:"Перемістити в кошик {{count}} файлів?",delete_count_confirm_permanent_one:"Видалити назавжди {{count}} файл?",delete_count_confirm_permanent_few:"Видалити назавжди {{count}} файли?",delete_count_confirm_permanent_many:"Видалити назавжди {{count}} файлів?",delete_count_confirm_permanent_other:"Видалити назавжди {{count}} файлів?",delete_count_confirm_one:"Видалити {{count}} файл?",delete_count_confirm_few:"Видалити {{count}} файли?",delete_count_confirm_many:"Видалити {{count}} файлів?",delete_count_confirm_other:"Видалити {{count}} файлів?",item:"файл",items:"файлів",Trash:"Видалені",Choose:"Обрати",Stock:"Фотосток","Select an image from our library":"Виберіть зображення з нашої бібліотеки","AI generation":"AI генерація","Creating an image on demand":"Створення зображення на замовлення","Search file or folder":"Знайти файл або папку","Click here to select a file":"Натисніть тут, щоб вибрати файл","Supported files:":"Підтримувані файли:","Create folder":"Створити папку",Done:"Готово","Move here":"Перемістити сюди","Copy here":"Копіювати сюди","File URL":"URL файлу","There's nothing here":"Тут нічого немає","Try using a different search query.":"Спробуйте використовувати інший пошуковий запит.","Millions of free stock images":"Мільйони безкоштовних стокових зображень","Enter a search query and we'll find the perfect image for you":"Введіть пошуковий запит, і ми знайдемо для вас ідеальне зображення","Millions of icons":"Мільйони іконок","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":"Введіть запит і ми знайдемо для вас відповідне","Over 350,000 live images":"Понад 350 000 живих зображень","The folder will be created in the root directory.":"Папка буде створена в кореневому каталозі.",undo:"СКАСУВАТИ",moved_to_trash_one:"Переміщено {{count}} елемент у кошик",moved_to_trash_few:"Переміщено {{count}} елементи у кошик",moved_to_trash_many:"Переміщено {{count}} елементів у кошик",moved_to_trash_other:"Переміщено {{count}} елементів у кошик",restored_items_one:"Відновлено {{count}} елемент",restored_items_few:"Відновлено {{count}} елементи",restored_items_many:"Відновлено {{count}} елементів",restored_items_other:"Відновлено {{count}} елементів",Type:"Тип","Generate image":"Створити зображення","A beautiful image of a sunset over a calm ocean.":"Красиве зображення заходу сонця над спокійним океаном.","For example:":"Наприклад:",Insert:"Вставити",Error:"Помилка","Upload progress":"Завантаження {{completed}}/{{total}}","Uploading files":"Завантаження {{completed}}/{{total}} файлів","Uploaded files":"Завантажено {{success}} з {{total}} файлів","Upload error files":"Помилка завантаження {{errorCount}} файлів","Applies to all {{count}} files":"(стосується всіх {{count}} файлів)","Some files failed to upload":"Деякі файли не вдалося завантажити. Перевірте розмір та формат файлів.",upload_error_hint_invalid_name:"Перейменуйте файл: використовуйте лише літери, цифри, дефіс та підкреслення.",upload_error_hint_size:"Зменшіть розмір файлу або оберіть інший.",upload_error_hint_format:"Оберіть дозволений формат: JPG, PNG або GIF.",upload_error_hint_exists:"Файл з такою назвою вже є в папці. Перейменуйте файл.","Images generated successfully":"Зображення успішно створено","Choose for template":"Вибрати для завантаження в шаблон","Trash is empty":"Кошик порожній","Deleted files will be displayed here":"Тут будуть відображатися видалені файли","Editing: {{name}}":"Редагування: {{name}}","Editing image":"Редагування зображення",Save:"Зберегти","Loading editor...":"Завантаження редактора…","Error loading image":"Помилка завантаження зображення","Error saving image":"Помилка при збереженні зображення","Error initializing editor":"Помилка ініціалізації редактора","Close File Manager":"Закрити файловий менеджер","Are you sure you want to close? Unsaved changes will be lost.":"Ви впевнені, що хочете закрити? Незбережені зміни будуть втрачені.","Are you sure you want to close the file manager?":"Ви впевнені, що хочете закрити файловий менеджер?",Close:"Закрити",KB:"КБ","No files":"Немає файлів","Folder is empty or files not found":"Папка порожня або файли не знайдені","Search files...":"Пошук файлів...",Success:"Успіх","Image updated successfully":"Зображення успішно оновлено","Failed to save changes":"Не вдалося зберегти зміни: {{error}}","Unknown error":"Невідома помилка","Select destination folder":"Виберіть папку призначення","Error moving":"Помилка при переміщенні","Error deleting":"Помилка при видаленні","Error copying":"Помилка при копіюванні","Error renaming":"Помилка при перейменуванні","Failed to refresh folder tree":"Не вдалося оновити дерево папок","Failed to refresh file list":"Не вдалося оновити список файлів","Errors occurred while moving":"Під час переміщення виникли помилки","Errors occurred while copying":"Під час копіювання виникли помилки","(error)":"(помилка)","(circular reference)":"(циклічне посилання)","File too large. Maximum size: {{size}}":"Файл занадто великий. Максимальний розмір: {{size}}","File too small. Minimum size: {{size}}":"Файл занадто маленький. Мінімальний розмір: {{size}}","Unsupported file type":"Непідтримуваний тип файлу","Unsupported file type: {{type}}":"Непідтримуваний тип файлу: {{type}}",unknown:"невідомий","Failed to load files":"Не вдалося завантажити файли","Failed to load files in folder":"Не вдалося завантажити вміст папки «{{folderName}}»","Failed to load subfolders in folder":"Не вдалося завантажити підпапки в «{{folderName}}»","Failed to load folder items count in folder":"Не вдалося отримати кількість елементів у «{{folderName}}»","DataProvider for folder deletion is not configured":"DataProvider для видалення папок не налаштовано","DataProvider for file upload is not configured":"DataProvider для завантаження файлів не налаштовано","Error uploading file {{fileName}}":"Помилка при завантаженні файлу {{fileName}}","Error uploading file":"Помилка при завантаженні файлу","Cannot upload files to Trash":"Не можна завантажувати файли в кошик","Please fill in all fields":"Заповніть усі поля","URL too long":"URL занадто довгий","Only http and https URLs are supported":"Підтримуються лише URL з протоколом http та https","Private and local URLs are not allowed":"Локальні та приватні URL заборонені","Upload by URL is not supported":"Завантаження за URL не підтримується","File name is too long. Maximum {{max}} characters":"Ім'я файлу занадто довге. Максимум {{max}} символів","File name contains invalid characters":"Ім'я файлу містить неприпустимі символи","Large file may take a long time to upload":"Великий файл може завантажуватися довго","File unavailable: {{status}} {{statusText}}":"Файл недоступний: {{status}} {{statusText}}","File too large: {{size}}":"Файл занадто великий: {{size}}","Unsupported file type: {{contentType}}":"Непідтримуваний тип файлу: {{contentType}}","Invalid server response: folder ID is missing":"Некорректна відповідь сервера: відсутній ID папки","Error: folder cannot be its own parent":"Помилка: папка не може бути батьком самої себе","Upload to Trash is forbidden":"Завантаження в кошик заборонено","renameFolder is not implemented in dataProviders":"renameFolder не реалізовано в dataProviders","renameFile is not implemented in dataProviders":"renameFile не реалізовано в dataProviders",Clean:"Очистити","Circular dependency detected: folder cannot be its own parent":"Виявлено циклічну залежність: папка не може бути батьком самої себе","Save as copy and choose":"Зберегти як копію і вибрати","Save and choose":"Зберегти і вибрати",pixie:{"added drawing":"Додавання малюнка","added frame":"Додавання рамки","added image":"Додавання зображення","added shape":"Додавання фігури","added sticker":"Додавання стікера","added text":"Додавання тексту","applied filters":"Застосування фільтр",apply:"Застосувати",background:"Фон","background color":"Фоновий колір",beach:"Пляж","brush color":"Колір кисті","brush size":"Розмір кисті","brush type":"Тип кисті",bubbles:"Пузирці",Cancel:"Скасувати","changed style":"Зміна стилю","Circle Brush":"Кола",close:"Закрити",color:"Колір",corners:"Кути",crop:"Обрізати",Custom:"Користувацький","deleted object":"Видалення об'єкта","Diamond Brush":"Алмаз",doodles:"Кольорові",draw:"Малюнок",emoticons:"Смайлики","Eraser Brush":"Гумка",filter:"Фільтр",font:"Шрифт","font size":"Розмір шрифту",frame:"Рамка",gradient:"Градієнт",height:"Висота",history:"Історія","H Line Brush":"Н-подібна",image:"Зображення",initial:"Початковий",landmarks:"Пам'ятки","loaded state":"Завантаження стану","loading canvas":"Завантаження","loading image":"Завантаження","loading state":"Завантаження","maintain aspect ratio":"Maintain aspect ratio",merge:"Об'єднання","merged objects":"Об'єднання об'єктів","new text":"Новий напис",objects:"Об'єкт",opacity:"Прозорість",outline:"Контур","outline color":"Колір контуру","Pencil Brush":"Олівець","processing image":"Завантаження",quality:"Якість",radius:"Радіус","replace image":"Replace Image","replaced background image":"Видалення фонового зображення",resize:"Розмір","resized image":"Зміна розміру","rounded corner":"Заокруглення кутів",save:"Зберегти",shadow:"Тінь","shadow color":"Колір тіні",shapes:"Фігури","Spray Brush":"Спрей",square:"Квадрат","Square Brush":"Квадрат",stickers:"Стікери",text:"Напис",texture:"Текстура",transportation:"Транспорт","V Line Brush":"V-подібна",width:"Ширина",grayscale:"Відтінки сірого","black & White":"Чорно-білий",sharpen:"Різкість",invert:"Інверсія",vintage:"Вінтаж",polaroid:"Полароїд",kodachrome:"Кодахром",technicolor:"Техніколор",brownie:"Коричневий",sepia:"Сепія","remove Color":"Видалити колір",brightness:"Яскравість",gamma:"Гамма",noise:"Шум",pixelate:"Пікселізація",blur:"Розмиття",emboss:"Тиснення","blend Color":"Змішати колір",distance:"Відстань",red:"Червоний",green:"Зелений",blue:"Синій",blocksize:"Розмір блоку",alpha:"Альфа",add:"Додати",multiply:"Помножити",subtract:"Відняти",diff:"Різниця",screen:"Екран",lighten:"Освітлити",darken:"Затемнити","select an option...":"Виберіть опцію..."}},ai={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 ícones","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ítulo",Size:"Tamanho",Dimensions:"Dimensões",Date:"Data",error:"erro",Folder:"Pasta",created:"criada","Failed to create folder":"Falha ao criar pasta","File deleted":"Arquivo excluído","Error when deleting a file":"Erro ao excluir arquivo","Folder deleted":"Pasta excluída","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ção também excluirá todos os arquivos e subpastas.","API-endpoint for file upload is not configured":"Endpoint da API para upload de arquivos não está 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ão 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á criada dentro de:","selected folder":"pasta selecionada","The folder will be created in the root directory":"A pasta será criada no diretório raiz","Failed to load folders":"Não foi possível carregar as pastas","Folder name cannot be empty":"O nome da pasta não pode estar vazio","Folder creation provider is not configured":"O provedor de criação de pastas não está configurado","Folder created":"Pasta criada","Folder rename is disabled by config":"Renomear pastas está desabilitado pela configuração","Folder rename provider is not configured":"O provedor de renomeação de pastas não está configurado","Unexpected response when renaming folder":"Resposta inesperada ao renomear a pasta","Folder renamed":"Pasta renomeada","Failed to rename folder":"Não foi possível renomear a pasta","Failed to load folder items count":"Não foi possível obter a contagem de itens da pasta","Failed to load subfolders":"Não foi possível 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á existe um arquivo com esse nome.","File not found or no longer available.":"O arquivo não foi encontrado ou já foi excluído.","You don't have permission to access this file.":"Você não tem permissão para acessar este arquivo.","File is too large to upload.":"O arquivo é grande demais para ser enviado.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"O arquivo é grande demais ({{fileSize}}). Tamanho máximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Número máximo de arquivos excedido. Permitido: {{allowed}}, recebido: {{received}}","This file type is not allowed.":"Este tipo de arquivo não é permitido.","File name is not valid.":"O nome do arquivo não é válido.","File name is not valid. Allowed characters: {{allowedChars}}":"O nome do arquivo não é válido. Caracteres permitidos: {{allowedChars}}","Failed to read the file.":"Não foi possível ler o arquivo.","Failed to write the file.":"Não foi possível gravar o arquivo.","The file appears to be corrupted.":"O arquivo parece estar corrompido.","File integrity check failed.":"A verificação de integridade do arquivo falhou.","Folder not found or no longer available.":"A pasta não foi encontrada ou já foi excluída.","Folder with this name already exists.":"Já existe uma pasta com esse nome.","A folder with that name already exists. Please enter a different folder name.":"Já existe uma pasta com esse nome. Digite um nome diferente para a pasta.","You don't have permission to access this folder.":"Você não tem permissão para acessar esta pasta.","Folder name is not valid.":"O nome da pasta não é válido.","Folder name is not valid. Allowed characters: {{allowedChars}}":"Não foi possível criar a pasta. Caracteres permitidos no nome: {{allowedChars}}","Failed to read the folder contents.":"Não foi possível ler o conteúdo da pasta.","Failed to write to the folder.":"Não foi possível gravar na pasta.","Folder storage quota exceeded.":"A cota de armazenamento da pasta foi excedida.","Folder is not empty.":"A pasta não está vazia.","Server error while processing the folder.":"Erro do servidor ao processar a pasta.","Folder operation took too long.":"A operação com a pasta demorou demais.","Network error. Please check your connection and try again.":"Erro de rede. Verifique sua conexão e tente novamente.","The operation took too long. Please try again.":"A operação 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ço está temporariamente indisponível. Tente novamente mais tarde.","Too many requests. Please try again a bit later.":"Muitas solicitações. Tente novamente mais tarde.","Authentication failed. Please sign in again.":"Falha na autenticação. Faça login novamente.","You are not allowed to perform this action.":"Você não tem permissão para executar esta ação.","Some of the provided data is invalid.":"Alguns dos dados fornecidos são inválidos.","This operation is not supported.":"Esta operação não é suportada.","Request payload is too large.":"O corpo da requisição é grande demais.","This media type is not supported.":"Este tipo de mídia não é suportado.","You have exceeded the upload quota.":"Você 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ão é válida.","The specified URL is not reachable.":"A URL especificada não está acessível.","Content type at the URL is not allowed.":"O tipo de conteúdo na URL não é permitido.","Failed to download file from the URL.":"Não foi possível 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ôde ser processado.","Some items in the batch are in a conflicting state.":"Alguns itens do lote estão em estado de conflito.","Some items in the batch did not pass validation.":"Alguns itens do lote não passaram na validação.","AI service returned an invalid response.":"O serviço de IA retornou uma resposta inválida.","Failed to generate image using AI.":"Falha ao gerar imagem usando IA.","You have reached the AI image generation limit.":"Você atingiu o limite de geração de imagens por IA.","Error in external integration.":"Erro em uma integração externa.","Error in a third-party service.":"Erro em um serviço de terceiros.","An unknown error occurred.":"Ocorreu um erro desconhecido.","Renaming is not allowed for this item.":"Renomear não é permitido para este item.","Moving is not allowed for this item.":"Mover não é permitido para este item.","Copying is not allowed for this item.":"Copiar não é permitido para este item.","Deleting is not allowed for this item.":"Excluir não é permitido para este item.","Cannot move an item into itself.":"Não é possível mover um item para dentro de si mesmo.","Cannot move an item into its descendant folder.":"Não é possível mover um item para sua pasta descendente.","Cannot copy an item into itself.":"Não é possível copiar um item para dentro de si mesmo.","Configuration error occurred.":"Ocorreu um erro de configuração.","Storage quota exceeded. Please free up space.":"Cota de armazenamento excedida. Libere espaço.","File is locked by another process or user.":"O arquivo está bloqueado por outro processo ou usuário.","File version conflict. Please refresh and try again.":"Conflito de versão do arquivo. Atualize a página e tente novamente.","Batch operation exceeds the maximum number of items allowed.":"A operação em lote excede o número máximo 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ço",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ível","My files":"Meus arquivos",GIF:"GIF","Stock images":"Imagens de stock",AI:"IA","AI image generation":"Geração de imagens por IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Isso é 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ão configurado","Filter by type":"Filtrar por tipo","All types":"Todos os tipos","File name":"Nome do arquivo",Actions:"Ações","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ão foi possível baixar o arquivo","Failed to load JSON data":"Não foi possível carregar os dados JSON","Invalid file URL":"URL de arquivo inválida","Unable to validate file URL":"Não foi possível 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á-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ão","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ão 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ção não 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ídos permanentemente","Trash partially cleared":"Lixeira parcialmente limpa","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} itens excluídos, {{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ção excluirá permanentemente {{count}} arquivo",delete_files_permanent_few:"Esta ação excluirá permanentemente {{count}} arquivos",delete_files_permanent_many:"Esta ação excluirá permanentemente {{count}} arquivos",delete_files_permanent_other:"Esta ação excluirá permanentemente {{count}} arquivos",delete_folder_permanent:"Esta ação excluirá permanentemente a pasta «{{name}}» e todo seu conteúdo, incluindo {{count}} itens.",delete_mixed_permanent:"Esta ação excluirá 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á problemas na exibição de imagens em e-mails antigos. Tem certeza de que deseja excluir permanentemente a seleção?",move_files_to_trash_one:"Esta ação moverá {{count}} arquivo para a lixeira.",move_files_to_trash_few:"Esta ação moverá {{count}} arquivos para a lixeira.",move_files_to_trash_many:"Esta ação moverá {{count}} arquivos para a lixeira.",move_files_to_trash_other:"Esta ação moverá {{count}} arquivos para a lixeira.",move_folder_to_trash:"Esta ação moverá a pasta «{{name}}» e todo seu conteúdo ({{count}} itens) para a lixeira.",move_mixed_to_trash:"Esta ação moverá {{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ção 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ído","Move here":"Mover aqui","Copy here":"Copiar aqui","File URL":"URL do arquivo","There's nothing here":"Não há nada aqui","Try using a different search query.":"Tente usar uma consulta de pesquisa diferente.","Millions of free stock images":"Milhões 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ê","Millions of icons":"Milhões de ícones","Enter a search query and we'll find the perfect icon for you":"Digite uma consulta de busca e encontraremos o ícone perfeito para você","Enter your query and we will find the right one for you":"Digite sua consulta e nós encontraremos a ideal para você","Over 350,000 live images":"Mais de 350.000 imagens ao vivo","The folder will be created in the root directory.":"A pasta será criada no diretório 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ôr 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ão puderam ser enviados. Verifique o tamanho e o formato dos arquivos.",upload_error_hint_invalid_name:"Renomeie o arquivo: use apenas letras, números, hífens 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á 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á vazia","Deleted files will be displayed here":"Os arquivos excluídos serão 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ções não salvas serão 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á vazia ou os arquivos não foram encontrados","Search files...":"Buscar arquivos...",Success:"Sucesso","Image updated successfully":"Imagem atualizada com sucesso","Failed to save changes":"Falha ao salvar alterações: {{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 árvore 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ência circular)","File too large. Maximum size: {{size}}":"Arquivo muito grande. Tamanho máximo: {{size}}","File too small. Minimum size: {{size}}":"Arquivo muito pequeno. Tamanho mínimo: {{size}}","Unsupported file type":"Tipo de arquivo não suportado","Unsupported file type: {{type}}":"Tipo de arquivo não suportado: {{type}}",unknown:"desconhecido","Failed to load files":"Falha ao carregar arquivos","Failed to load files in folder":"Não foi possível carregar o conteúdo da pasta ({{folderName}})","Failed to load subfolders in folder":'Não foi possível carregar subpastas em "{{folderName}}"',"Failed to load folder items count in folder":'Não foi possível obter a contagem de itens em "{{folderName}}"',"DataProvider for folder deletion is not configured":"DataProvider para exclusão de pastas não está configurado","DataProvider for file upload is not configured":"DataProvider para upload de arquivos não está 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ão é possível 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ão suportadas","Private and local URLs are not allowed":"URLs locais e privadas não são permitidas","Upload by URL is not supported":"Upload por URL não é suportado","File name is too long. Maximum {{max}} characters":"O nome do arquivo é muito longo. Máximo de {{max}} caracteres","File name contains invalid characters":"O nome do arquivo contém caracteres inválidos","Large file may take a long time to upload":"Um arquivo grande pode demorar muito para ser carregado","File unavailable: {{status}} {{statusText}}":"Arquivo indisponível: {{status}} {{statusText}}","File too large: {{size}}":"Arquivo muito grande: {{size}}","Unsupported file type: {{contentType}}":"Tipo de arquivo não suportado: {{contentType}}","Invalid server response: folder ID is missing":"Resposta do servidor inválida: ID da pasta ausente","Error: folder cannot be its own parent":"Erro: a pasta não pode ser seu próprio pai","Upload to Trash is forbidden":"Enviar para a lixeira é proibido","renameFolder is not implemented in dataProviders":"renameFolder não está implementado em dataProviders","renameFile is not implemented in dataProviders":"renameFile não está implementado em dataProviders",Clean:"Limpar","Circular dependency detected: folder cannot be its own parent":"Dependência circular detectada: a pasta não pode ser seu próprio pai","Save as copy and choose":"Salvar como cópia e escolher","Save and choose":"Salvar e escolher",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írculo",close:"Fechar",color:"Cor",corners:"Cantos",crop:"Cortar",Custom:"Personalizado","deleted object":"Objeto excluído","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órico","H Line Brush":"Linha H",image:"Imagem",initial:"Inicial",landmarks:"Pontos turísticos","loaded state":"Estado carregado","loading canvas":"Carregando tela","loading image":"Carregando imagem","loading state":"Carregando estado","maintain aspect ratio":"Manter proporção",merge:"Mesclar","merged objects":"Objetos mesclados","new text":"Novo texto",objects:"Objetos",opacity:"Opacidade",outline:"Contorno","outline color":"Cor do contorno","Pencil Brush":"Lápis","processing image":"Processando imagem",quality:"Qualidade",radius:"Raio","replace image":"Substituir imagem","replaced background image":"Imagem de fundo substituída",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épia quente",sepia:"Sépia","remove Color":"Remover cor",brightness:"Brilho",gamma:"Gamma",noise:"Ruído",pixelate:"Pixelar",blur:"Desfocar",emboss:"Relevo","blend Color":"Misturar cor",distance:"Distância",red:"Vermelho",green:"Verde",blue:"Azul",blocksize:"Tamanho do bloco",alpha:"Alfa",add:"Adicionar",multiply:"Multiplicar",subtract:"Subtrair",diff:"Diferença",screen:"Tela",lighten:"Clarear",darken:"Escurecer","select an option...":"Selecione uma opção..."}};const si={en:{translation:ni},ru:{translation:ii},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úsqueda de imágenes...","Search icons":"Buscar iconos","By name":"Por nombre","By size":"Por tamaño","By date":"Por fecha",List:"Lista",Grid:"Cuadrícula",Main:"Principal",Folders:"Carpetas","total pages":"{{total}} elementos en total",Name:"Nombre",Untitled:"Sin título",Size:"Tamaño",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.":"¿Está seguro de que desea eliminar esta carpeta? Esta acción también eliminará todos los archivos y subcarpetas.","API-endpoint for file upload is not configured":"El endpoint API para la carga de archivos no está 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á dentro de:","selected folder":"carpeta seleccionada","The folder will be created in the root directory":"La carpeta se creará en el directorio raíz","Failed to load folders":"No se pudieron cargar las carpetas","Folder name cannot be empty":"El nombre de la carpeta no puede estar vacío","Folder creation provider is not configured":"El proveedor de creación de carpetas no está configurado","Folder created":"Carpeta creada","Folder rename is disabled by config":"El renombrado de carpetas está deshabilitado por la configuración","Folder rename provider is not configured":"El proveedor para renombrar carpetas no está 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ñadido 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ó 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ño máximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Se ha superado el número máximo de archivos. Permitido: {{allowed}}, recibido: {{received}}","This file type is not allowed.":"Este tipo de archivo no está permitido.","File name is not valid.":"El nombre del archivo no es válido.","File name is not valid. Allowed characters: {{allowedChars}}":"El nombre del archivo no es válido. 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ñado.","File integrity check failed.":"La verificación de integridad del archivo falló.","Folder not found or no longer available.":"La carpeta no se encontró 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álido.","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ó la cuota de almacenamiento de la carpeta.","Folder is not empty.":"La carpeta no está vacía.","Server error while processing the folder.":"Error del servidor al procesar la carpeta.","Folder operation took too long.":"La operación con la carpeta tardó demasiado.","Network error. Please check your connection and try again.":"Error de red. Compruebe su conexión e inténtelo de nuevo.","The operation took too long. Please try again.":"La operación tardó demasiado. Inténtelo de nuevo.","Server error. Please try again later.":"Error del servidor. Inténtelo de nuevo más tarde.","Service is temporarily unavailable. Please try again later.":"El servicio no está disponible temporalmente. Inténtelo de nuevo más tarde.","Too many requests. Please try again a bit later.":"Demasiadas solicitudes. Inténtelo de nuevo más tarde.","Authentication failed. Please sign in again.":"Error de autenticación. Inicie sesión de nuevo.","You are not allowed to perform this action.":"No tiene permisos para realizar esta acción.","Some of the provided data is invalid.":"Algunos de los datos proporcionados no son válidos.","This operation is not supported.":"Esta operación no está 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á 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ó 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álida.","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á 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ó 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ún elemento del lote.","Some items in the batch are in a conflicting state.":"Algunos elementos del lote están en estado de conflicto.","Some items in the batch did not pass validation.":"Algunos elementos del lote no pasaron la validación.","AI service returned an invalid response.":"El servicio de IA devolvió una respuesta no válida.","Failed to generate image using AI.":"No se pudo generar la imagen usando IA.","You have reached the AI image generation limit.":"Se alcanzó el límite de generación de imágenes con IA.","Error in external integration.":"Error en la integración 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í 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í mismo.","Configuration error occurred.":"Se produjo un error de configuración.","Storage quota exceeded. Please free up space.":"Se superó la cuota de almacenamiento. Libere espacio.","File is locked by another process or user.":"El archivo está bloqueado por otro proceso o usuario.","File version conflict. Please refresh and try again.":"Conflicto de versión del archivo. Actualice la página e inténtelo de nuevo.","Batch operation exceeds the maximum number of items allowed.":"La operación por lotes excede el número máximo 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ágenes de stock",AI:"IA","AI image generation":"Generación de imágenes 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ñadir archivo","Add folder":"Añadir carpeta","Add file by URL":"Añadir 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álida","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ún no hay carpetas","Drag files to upload":"Arrastre archivos para cargarlos","Drop files here to upload":"Suelte los archivos aquí para cargarlos","Newest first":"Los más nuevos primero","Oldest first":"Los más antiguos primero","Largest first":"Los más grandes primero","Smallest first":"Los más pequeños 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ó mal, por favor intente nuevamente","Sort by":"Ordenar por","preview text":"Cargando imagen...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar eliminación","Are you sure you want to delete the selected items?":"¿Está 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?":"¿Está seguro de que desea mover los elementos seleccionados a la papelera?","Permanently delete":"Eliminación permanente","Delete permanently":"Eliminar permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"¿Está seguro de que desea eliminar permanentemente los elementos seleccionados? Esta acción no se puede deshacer.",Clear:"Limpiar","Clear Trash":"Vaciar papelera","Are you sure you want to permanently delete all items from Trash?":"¿Está seguro de que desea eliminar permanentemente todos los elementos de la papelera?","Trash cleared successfully":"Papelera vaciada con éxito","{{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ón eliminará permanentemente {{count}} archivo",delete_files_permanent_few:"Esta acción eliminará permanentemente {{count}} archivos",delete_files_permanent_many:"Esta acción eliminará permanentemente {{count}} archivos",delete_files_permanent_other:"Esta acción eliminará permanentemente {{count}} archivos",delete_folder_permanent:"Esta acción eliminará permanentemente la carpeta «{{name}}» y todo su contenido, incluyendo {{count}} elementos.",delete_mixed_permanent:"Esta acción eliminará permanentemente {{total}} elementos seleccionados, incluyendo {{folders}} carpetas y todas las {{images}} imágenes dentro de ellas.",permanent_delete_warning:"Eliminar archivos que se usaron en correos provocará problemas para mostrar imágenes en correos antiguos. ¿Está seguro de que desea eliminar permanentemente la selección?",move_files_to_trash_one:"Esta acción moverá {{count}} archivo a la papelera.",move_files_to_trash_few:"Esta acción moverá {{count}} archivos a la papelera.",move_files_to_trash_many:"Esta acción moverá {{count}} archivos a la papelera.",move_files_to_trash_other:"Esta acción moverá {{count}} archivos a la papelera.",move_folder_to_trash:"Esta acción moverá la carpeta «{{name}}» y todo su contenido ({{count}} elementos) a la papelera.",move_mixed_to_trash:"Esta acción moverá {{total}} elementos seleccionados a la papelera, incluyendo {{folders}} carpetas y {{images}} imágenes.",delete_count_confirm_trash_one:"¿Mover {{count}} archivo a la papelera?",delete_count_confirm_trash_few:"¿Mover {{count}} archivos a la papelera?",delete_count_confirm_trash_many:"¿Mover {{count}} archivos a la papelera?",delete_count_confirm_trash_other:"¿Mover {{count}} archivos a la papelera?",delete_count_confirm_permanent_one:"¿Eliminar permanentemente {{count}} archivo?",delete_count_confirm_permanent_few:"¿Eliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_many:"¿Eliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_other:"¿Eliminar permanentemente {{count}} archivos?",delete_count_confirm_one:"¿Eliminar {{count}} archivo?",delete_count_confirm_few:"¿Eliminar {{count}} archivos?",delete_count_confirm_many:"¿Eliminar {{count}} archivos?",delete_count_confirm_other:"¿Eliminar {{count}} archivos?",item:"archivo",items:"archivos",Trash:"Papelera",Choose:"Elegir",Stock:"Banco de imágenes","Select an image from our library":"Seleccione una imagen de nuestra biblioteca","AI generation":"Generación 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í para seleccionar un archivo","Supported files:":"Archivos admitidos:","Create folder":"Crear carpeta",Done:"Hecho","Move here":"Mover aquí","Copy here":"Copiar aquí","File URL":"URL del archivo","There's nothing here":"Aquí no hay nada","Try using a different search query.":"Prueba a utilizar una consulta de búsqueda diferente.","Millions of free stock images":"Millones de imágenes de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Ingrese una consulta de búsqueda 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úsqueda y encontraremos el ícono 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ás de 350,000 imágenes en vivo","The folder will be created in the root directory.":"La carpeta se creará en el directorio raíz.",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éano 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ño y el formato de los archivos.",upload_error_hint_invalid_name:"Renombre el archivo: use solo letras, números, guiones y guiones bajos.",upload_error_hint_size:"Reduzca el tamaño 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ágenes generadas correctamente","Choose for template":"Seleccionar para cargar en la plantilla","Trash is empty":"La papelera está vacía","Deleted files will be displayed here":"Los archivos eliminados se mostrarán aquí","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.":"¿Está seguro de que desea cerrar? Los cambios no guardados se perderán.","Are you sure you want to close the file manager?":"¿Está 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á vacía o no se encontraron archivos","Search files...":"Buscar archivos...",Success:"Éxito","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 árbol 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ño máximo: {{size}}","File too small. Minimum size: {{size}}":"El archivo es demasiado pequeño. Tamaño mínimo: {{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","Failed to load files in folder":"No se pudo cargar el contenido de la carpeta ({{folderName}})","Failed to load subfolders in folder":'No se pudieron cargar las subcarpetas en "{{folderName}}"',"Failed to load folder items count in folder":'No se pudo obtener el recuento de elementos en "{{folderName}}"',"DataProvider for folder deletion is not configured":"DataProvider para eliminar carpetas no está configurado","DataProvider for file upload is not configured":"DataProvider para cargar archivos no está 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á admitida","File name is too long. Maximum {{max}} characters":"El nombre del archivo es demasiado largo. Máximo {{max}} caracteres","File name contains invalid characters":"El nombre del archivo contiene caracteres no válidos","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álida: 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á prohibido","renameFolder is not implemented in dataProviders":"renameFolder no está implementado en dataProviders","renameFile is not implemented in dataProviders":"renameFile no está 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","Save as copy and choose":"Guardar como copia y elegir","Save and choose":"Guardar y elegir",pixie:{"added drawing":"Dibujo añadido","added frame":"Marco añadido","added image":"Imagen añadida","added shape":"Forma añadida","added sticker":"Pegatina añadida","added text":"Texto añadido","applied filters":"Filtros aplicados",apply:"Aplicar",background:"Fondo","background color":"Color de fondo",beach:"Playa","brush color":"Color del pincel","brush size":"Tamaño del pincel","brush type":"Tipo de pincel",bubbles:"Burbujas",Cancel:"Cancelar","changed style":"Estilo cambiado","Circle Brush":"Círculo",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ño de fuente",frame:"Marco",gradient:"Gradiente",height:"Alto",history:"Historial","H Line Brush":"Línea 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ón",merge:"Fusionar","merged objects":"Objetos fusionados","new text":"Nuevo texto",objects:"Objetos",opacity:"Opacidad",outline:"Contorno","outline color":"Color del contorno","Pencil Brush":"Lápiz","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ínea 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álido",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ño de bloque",alpha:"Alfa",add:"Añadir",multiply:"Multiplicar",subtract:"Restar",diff:"Diferencia",screen:"Pantalla",lighten:"Aclarar",darken:"Oscurecer","select an option...":"Seleccione una opción..."}}},uk:{translation:oi},"pt-br":{translation:ai},pt:{translation:ai},br:{translation:ai},"pt-BR":{translation:ai}};On.use($n).init({resources:si,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});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 li=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]},ci=e=>{if(!e||e<=0)return"";const t=1048576;if(e<t){return`${Math.round(e/1024)} Kb`}return`${(e/t).toFixed(2)} Mb`},ui=e=>{if(null==e)return"";if("number"==typeof e)return ci(e);const t=String(e).trim();if(!t)return"";const r=Number(t);return Number.isNaN(r)?t:ci(r)},di=(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};async function hi(e,t,r,n,i){if(!i||!(null==e?void 0:e.getFiles))return t;try{let i=[];const{files:o}=await e.getFiles({folderId:n?void 0:null!=r?r:void 0,noFolder:n,itemType:"all",page:1,limit:1e4});if(i=(o||[]).map(e=>e.name).filter(e=>!!e),!n&&(null==e?void 0:e.getFolders)){const t=(await e.getFolders({parentId:null!=r?r:null,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);i=[...i,...t]}return di(t,i)}catch(e){return console.warn("Could not fetch files for duplicate check:",e),t}}const fi=({size:e=24,color:t="currentColor",...r})=>n.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},n.createElement("path",{d:"m6 9 6 6 6-6"}));fi.displayName="ChevronDown";const pi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));pi.displayName="Colors";const gi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));gi.displayName="Copy04";const mi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));mi.displayName="Crop02";const vi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));vi.displayName="DotsVertical";const yi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));yi.displayName="FolderDownload";const bi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));bi.displayName="FolderMinus";const wi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));wi.displayName="FolderPlus";const xi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));xi.displayName="FolderSearch";const Ci=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Ci.displayName="Grid01";const _i=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));_i.displayName="Image03";const Si=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Si.displayName="Link01";const ki=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));ki.displayName="List";const Ai=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}),n.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"}));Ai.displayName="PlaySquare";const Ii=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Ii.displayName="PlusCircle";const Ei=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Ei.displayName="RefreshCw05";const Fi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Fi.displayName="Scale01";const Ti=({size:e=24,color:t="currentColor",...r})=>n.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},n.createElement("path",{d:"m21 21-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"}));Ti.displayName="SearchMd";const Oi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Oi.displayName="Stars02";const Pi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Pi.displayName="TextInput";const Mi=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Mi.displayName="ThumbsUp";const Ri=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Ri.displayName="Trash03";const Li=({size:e=24,color:t="currentColor",...r})=>n.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},n.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"}));Li.displayName="Trash04";const Ni=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),ji=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),Di=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),zi=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),Bi=()=>t("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[e("path",{d:"M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"}),e("path",{d:"M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"}),e("path",{d:"M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"}),e("path",{d:"M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"})]}),Ui=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"light-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("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"})}),Vi=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"dark-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("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"})}),Hi=()=>t("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"}),e("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"})]}),$i=()=>t("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"}),e("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"})]}),Wi=()=>e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),Gi=()=>e("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),qi=()=>t("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{width:"56",height:"56",rx:"24",fill:"#8946FB"}),e("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"})]}),Yi=()=>t("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{width:"56",height:"56",rx:"24",fill:"#7ED846"}),e("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"})]}),Xi=()=>t("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"})]}),Ki=()=>e("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),Zi=t=>e(ae,Object.assign({component:Ni},t)),Ji=t=>e(ae,Object.assign({component:ji},t)),Qi=t=>e(ae,Object.assign({component:Di},t)),eo=t=>e(ae,Object.assign({component:zi},t)),to=t=>e(ae,Object.assign({component:Bi},t)),ro=t=>e(ae,Object.assign({component:Ui},t)),no=t=>e(ae,Object.assign({component:Vi},t)),io=t=>e(ae,Object.assign({component:Hi},t)),oo=t=>e(ae,Object.assign({component:$i},t)),ao=t=>e(ae,Object.assign({component:Wi},t)),so=t=>e(ae,Object.assign({component:Gi},t)),lo=t=>e(ae,Object.assign({component:qi},t)),co=t=>e(ae,Object.assign({component:Yi},t)),uo=t=>e(ae,Object.assign({component:Xi},t)),ho=t=>e(ae,Object.assign({component:Ki},t)),fo=s({state:{},actions:{},options:{}}),po=()=>l(fo),go=({children:t,options:r})=>{var n,i,s;const[l,u]=o([]),[h,f]=o([]),[p,g]=o(null),[m,v]=o(r.searchQuery||""),[y,b]=o(r.sortBySize||"name"),{config:w}=r,x=c(e=>{var t,r,n;if(e===nr){const e=!1!==(null===(t=null==w?void 0:w.features)||void 0===t?void 0:t.enableGif),r=!(null==w?void 0:w.enabledTabs)||w.enabledTabs.includes("gif");return e&&r}if(e===ir){const e=!1!==(null===(r=null==w?void 0:w.features)||void 0===r?void 0:r.enableStockImages),t=!(null==w?void 0:w.enabledTabs)||w.enabledTabs.includes("stock");return e&&t}if(e===or){const e=!1!==(null===(n=null==w?void 0:w.features)||void 0===n?void 0:n.enableIconStock),t=!(null==w?void 0:w.enabledTabs)||w.enabledTabs.includes("icons");return e&&t}return!0},[null==w?void 0:w.enabledTabs,null===(n=null==w?void 0:w.features)||void 0===n?void 0:n.enableGif,null===(i=null==w?void 0:w.features)||void 0===i?void 0:i.enableIconStock,null===(s=null==w?void 0:w.features)||void 0===s?void 0:s.enableStockImages]),[C,_]=o("date"),[S,k]=o("desc"),[A,I]=o([{id:"folders",name:"Папки"}]),[F,T]=o(""),[O,P]=o(!1),[M,R]=o(rr);a(()=>{(null==w?void 0:w.activeLibraryItem)&&R&&R(x(w.activeLibraryItem)?w.activeLibraryItem:rr)},[null==w?void 0:w.activeLibraryItem,x,R]),a(()=>{x(M)||R(rr)},[M,x]);const[L,N]=o({current:1,pageSize:20,total:0}),[j]=E.useForm(),[D]=E.useForm(),[z]=E.useForm(),[B]=E.useForm(),[U]=E.useForm(),[V]=E.useForm(),[H,$]=o(!1),[W,G]=o(!1),[q,Y]=o(!1),[X,K]=o(!1),[Z,J]=o(!1),[Q,ee]=o(!1),[te,re]=o(!1),[ne,ie]=o(null),[oe,ae]=o(null),[se,le]=o(null),ce=(e,t)=>{I(r=>r.map(r=>r.id===e?Object.assign(Object.assign({},r),{name:t}):r))},ue=c(e=>{N(t=>Object.assign(Object.assign({},t),e))},[N]),de=d(()=>{var e;return{folders:l,files:h,selectedFolder:p,searchTerm:m,sortField:y,sortBy:C,sortOrder:S,pathHistory:A,currentMenuFile:F,loading:O,pagination:L,isModalVisible:H,isUrlModalVisible:W,isRenameModalVisible:q,isMoveModalVisible:X,isRenameFolderModalVisible:Z,isCopyModalVisible:Q,isDeleteConfirmVisible:te,form:j,urlForm:D,renameForm:z,moveForm:B,renameFolderForm:U,copyForm:V,fileToRename:ne,folderToRename:oe,activeLibraryItem:M,multiSelect:null===(e=null==w?void 0:w.multiSelect)||void 0===e||e,undoDeletion:se}},[M,null==w?void 0:w.multiSelect,V,F,ne,h,l,j,Q,te,H,X,Z,q,W,O,B,L,A,U,z,m,p,C,y,S,se,D,oe]),he=d(()=>({setFolders:u,setFiles:f,setSelectedFolder:g,setSearchTerm:v,setSortField:b,setSortBy:_,setSortOrder:k,setPathHistory:I,setLoading:P,setPagination:ue,setIsModalVisible:$,setIsUrlModalVisible:G,setIsRenameModalVisible:Y,setIsMoveModalVisible:K,setIsRenameFolderModalVisible:J,setIsCopyModalVisible:ee,setIsDeleteConfirmVisible:re,setFileToRename:ie,setFolderToRename:ae,setUndoDeletion:le,updatePathHistoryOnFolderRename:ce,setActiveLibraryItem:e=>R(x(e)?e:rr),setCurrentMenuFile:T}),[ue,x]),fe=d(()=>({state:de,actions:he,options:r}),[he,r,de]);return e(fo.Provider,{value:fe,children:t})},mo=()=>{const{options:e}=po(),{customIcons:t}=e,r=i.useCallback((e,r,n)=>{const o=null==t?void 0:t[e];return o?i.createElement(o,n):i.createElement(r,n)},[t]);return i.useMemo(()=>({RootFolderIcon:e=>r("rootFolder",ve,e),FolderIcon:e=>r("folder",io,e),FolderOpenIcon:e=>r("folderOpen",me,e),AddFolderIcon:e=>r("addFolder",ge,e),FileIcon:e=>r("file",pe,e),UploadIcon:e=>r("upload",fe,e),UploadByUrlIcon:e=>r("uploadByUrl",he,e),ExpandArrowIcon:e=>r("expandArrow",de,e),CollapseArrowIcon:e=>r("collapseArrow",ue,e),ExpandFolderIcon:e=>r("expandArrow",wi,e),CollapseFolderIcon:e=>r("collapseArrow",bi,e),FolderPreviewIcon:e=>r("folderPreview",oo,e),EmptyFolderIcon:e=>r("folderPreview",ao,e),GridViewIcon:e=>r("gridView",ce,e),ListViewIcon:e=>r("listView",le,e),DropZoneFileIcon:e=>r("folderPreview",so,e),BigStockIcon:e=>r("folderPreview",lo,e),BigAIIcon:e=>r("folderPreview",co,e),GifPlayIcon:e=>r("folderPreview",uo,e),StockBigIcon:e=>r("folderPreview",ho,e),MixedViewIcon:e=>r("mixedView",Zi,e),LandscapeViewIcon:e=>r("landscapeView",Ji,e),PortraitViewIcon:e=>r("portraitView",Qi,e),SquareViewIcon:e=>r("squareView",eo,e),LightModeIcon:e=>r("lightMode",ro,e),DarkModeIcon:e=>r("darkMode",no,e),AiIcon_2:e=>r("aiIcon_2",to,e),NoFilesIcon:e=>r("noFiles",xi,e),ThumbsUpIcon:e=>r("thumbsUp",Mi,e),getCustomIcon:r}),[r])};var vo="noFilesContainer",yo="noFilesImage",bo="noFilesTitle",wo="noFilesDescription";const xo=()=>{const{t:r}=Yn(),{NoFilesIcon:n}=mo();return t("div",{className:vo,children:[e(n,{className:yo,size:48,strokeWidth:1.4}),e("h2",{className:bo,children:r("There's nothing here")}),e("div",{className:wo,children:r("Try using a different search query.")})]})};var Co,_o={exports:{}},So=_o.exports;
2
2
  /**
3
3
  * @license
4
4
  * Lodash <https://lodash.com/>
@@ -6,7 +6,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as n from
6
6
  * Released under MIT license <https://lodash.com/license>
7
7
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
8
8
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
9
- */var ko=(Co||(Co=1,function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=256,c=1/0,u=9007199254740991,d=NaN,h=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],p="[object Arguments]",g="[object Array]",m="[object Boolean]",v="[object Date]",y="[object Error]",b="[object Function]",w="[object GeneratorFunction]",x="[object Map]",C="[object Number]",_="[object Object]",S="[object Promise]",k="[object RegExp]",A="[object Set]",I="[object String]",E="[object Symbol]",F="[object WeakMap]",T="[object ArrayBuffer]",O="[object DataView]",P="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",L="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",D="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",U=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,G=RegExp($.source),q=RegExp(W.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),re=/^\s+/,ne=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",ke="\\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",Ie="['’]",Ee="["+we+"]",Fe="["+Ae+"]",Te="["+xe+"]",Oe="\\d+",Pe="["+Ce+"]",Me="["+_e+"]",Re="[^"+we+Ae+Oe+Ce+_e+Se+"]",Le="\\ud83c[\\udffb-\\udfff]",Ne="[^"+we+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",De="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Se+"]",Be="\\u200d",Ue="(?:"+Me+"|"+Re+")",Ve="(?:"+ze+"|"+Re+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Te+"|"+Le+")?",Ge="["+ke+"]?",qe=Ge+We+"(?:"+Be+"(?:"+[Ne,je,De].join("|")+")"+Ge+We+")*",Ye="(?:"+[Pe,je,De].join("|")+")"+qe,Xe="(?:"+[Ne+Te+"?",Te,je,De,Ee].join("|")+")",Ke=RegExp(Ie,"g"),Ze=RegExp(Te,"g"),Je=RegExp(Le+"(?="+Le+")|"+Xe+qe,"g"),Qe=RegExp([ze+"?"+Me+"+"+He+"(?="+[Fe,ze,"$"].join("|")+")",Ve+"+"+$e+"(?="+[Fe,ze+Ue,"$"].join("|")+")",ze+"?"+Ue+"+"+He,ze+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ye].join("|"),"g"),et=RegExp("["+Be+we+xe+ke+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["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"],nt=-1,it={};it[P]=it[M]=it[R]=it[L]=it[N]=it[j]=it[D]=it[z]=it[B]=!0,it[p]=it[g]=it[T]=it[m]=it[O]=it[v]=it[y]=it[b]=it[x]=it[C]=it[_]=it[k]=it[A]=it[I]=it[F]=!1;var ot={};ot[p]=ot[g]=ot[T]=ot[O]=ot[m]=ot[v]=ot[P]=ot[M]=ot[R]=ot[L]=ot[N]=ot[x]=ot[C]=ot[_]=ot[k]=ot[A]=ot[I]=ot[E]=ot[j]=ot[D]=ot[z]=ot[B]=!0,ot[y]=ot[b]=ot[F]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Pn&&Pn&&Pn.Object===Object&&Pn,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),ht=t&&!t.nodeType&&t,ft=ht&&e&&!e.nodeType&&e,pt=ft&&ft.exports===ht,gt=pt&&ct.process,mt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),vt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,bt=mt&&mt.isMap,wt=mt&&mt.isRegExp,xt=mt&&mt.isSet,Ct=mt&&mt.isTypedArray;function _t(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 St(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 kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function At(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function It(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 Et(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 Ft(e,t){return!(null==e||!e.length)&&zt(e,t,0)>-1}function Tt(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 Ot(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 Pt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Mt(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 Rt(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 Lt(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 Nt=Ht("length");function jt(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function Dt(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 zt(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):Dt(e,Ut,r)}function Bt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Ut(e){return e!=e}function Vt(e,t){var r=null==e?0:e.length;return r?Gt(e,t)/r:d}function Ht(e){return function(t){return null==t?r:t[e]}}function $t(e){return function(t){return null==e?r:e[t]}}function Wt(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}function Gt(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 qt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Yt(e){return e?e.slice(0,dr(e)+1).replace(re,""):e}function Xt(e){return function(t){return e(t)}}function Kt(e,t){return Ot(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var r=-1,n=e.length;++r<n&&zt(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length;r--&&zt(t,e[r],0)>-1;);return r}var er=$t({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tr=$t({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rr(e){return"\\"+at[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function or(e,t){return function(r){return e(t(r))}}function ar(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 sr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function lr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}function cr(e){return nr(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Nt(e)}function ur(e){return nr(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function dr(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t}var hr=$t({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),fr=function e(t){var ne,we=(t=null==t?dt:fr.defaults(dt.Object(),t,fr.pick(dt,rt))).Array,xe=t.Date,Ce=t.Error,_e=t.Function,Se=t.Math,ke=t.Object,Ae=t.RegExp,Ie=t.String,Ee=t.TypeError,Fe=we.prototype,Te=_e.prototype,Oe=ke.prototype,Pe=t["__core-js_shared__"],Me=Te.toString,Re=Oe.hasOwnProperty,Le=0,Ne=(ne=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",je=Oe.toString,De=Me.call(ke),ze=dt._,Be=Ae("^"+Me.call(Re).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=pt?t.Buffer:r,Ve=t.Symbol,He=t.Uint8Array,$e=Ue?Ue.allocUnsafe:r,We=or(ke.getPrototypeOf,ke),Ge=ke.create,qe=Oe.propertyIsEnumerable,Ye=Fe.splice,Xe=Ve?Ve.isConcatSpreadable:r,Je=Ve?Ve.iterator:r,et=Ve?Ve.toStringTag:r,at=function(){try{var e=uo(ke,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=xe&&xe.now!==dt.Date.now&&xe.now,ht=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=Se.ceil,gt=Se.floor,mt=ke.getOwnPropertySymbols,Nt=Ue?Ue.isBuffer:r,$t=t.isFinite,pr=Fe.join,gr=or(ke.keys,ke),mr=Se.max,vr=Se.min,yr=xe.now,br=t.parseInt,wr=Se.random,xr=Fe.reverse,Cr=uo(t,"DataView"),_r=uo(t,"Map"),Sr=uo(t,"Promise"),kr=uo(t,"Set"),Ar=uo(t,"WeakMap"),Ir=uo(ke,"create"),Er=Ar&&new Ar,Fr={},Tr=jo(Cr),Or=jo(_r),Pr=jo(Sr),Mr=jo(kr),Rr=jo(Ar),Lr=Ve?Ve.prototype:r,Nr=Lr?Lr.valueOf:r,jr=Lr?Lr.toString:r;function Dr(e){if(es(e)&&!Ha(e)&&!(e instanceof Vr)){if(e instanceof Ur)return e;if(Re.call(e,"__wrapped__"))return Do(e)}return new Ur(e)}var zr=function(){function e(){}return function(t){if(!Qa(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Br(){}function Ur(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Vr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}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.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wr(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 Gr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Wr;++t<r;)this.add(e[t])}function qr(e){var t=this.__data__=new $r(e);this.size=t.size}function Yr(e,t){var r=Ha(e),n=!r&&Va(e),i=!r&&!n&&qa(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?qt(e.length,Ie):[],l=s.length;for(var c in e)!t&&!Re.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yo(c,l))||s.push(c);return s}function Xr(e){var t=e.length;return t?e[qn(0,t-1)]:r}function Kr(e,t){return Ro(Ei(e),an(t,0,e.length))}function Zr(e){return Ro(Ei(e))}function Jr(e,t,n){(n!==r&&!za(e[t],n)||n===r&&!(t in e))&&nn(e,t,n)}function Qr(e,t,n){var i=e[t];Re.call(e,t)&&za(i,n)&&(n!==r||t in e)||nn(e,t,n)}function en(e,t){for(var r=e.length;r--;)if(za(e[r][0],t))return r;return-1}function tn(e,t,r,n){return dn(e,function(e,i,o){t(n,e,r(e),o)}),n}function rn(e,t){return e&&Fi(t,Ts(t),e)}function nn(e,t,r){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function on(e,t){for(var n=-1,i=t.length,o=we(i),a=null==e;++n<i;)o[n]=a?r:ks(e,t[n]);return o}function an(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function sn(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(!Qa(e))return e;var d=Ha(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Re.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Ei(e,s)}else{var h=po(e),f=h==b||h==w;if(qa(e))return Ci(e,l);if(h==_||h==p||f&&!o){if(s=c||f?{}:mo(e),!l)return c?function(e,t){return Fi(e,fo(e),t)}(e,function(e,t){return e&&Fi(t,Os(t),e)}(s,e)):function(e,t){return Fi(e,ho(e),t)}(e,rn(s,e))}else{if(!ot[h])return o?e:{};s=function(e,t,r){var n,i=e.constructor;switch(t){case T:return _i(e);case m:case v:return new i(+e);case O:return function(e,t){var r=t?_i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case P:case M:case R:case L:case N:case j:case D:case z:case B:return Si(e,r);case x:return new i;case C:case I:return new i(e);case k:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new i;case E:return n=e,Nr?ke(Nr.call(n)):{}}}(e,h,l)}}a||(a=new qr);var g=a.get(e);if(g)return g;a.set(e,s),os(e)?e.forEach(function(r){s.add(sn(r,t,n,r,e,a))}):ts(e)&&e.forEach(function(r,i){s.set(i,sn(r,t,n,i,e,a))});var y=d?r:(u?c?no:ro:c?Os:Ts)(e);return kt(y||e,function(r,i){y&&(r=e[i=r]),Qr(s,i,sn(r,t,n,i,e,a))}),s}function ln(e,t,n){var i=n.length;if(null==e)return!i;for(e=ke(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 cn(e,t,i){if("function"!=typeof e)throw new Ee(n);return To(function(){e.apply(r,i)},t)}function un(e,t,r,n){var i=-1,o=Ft,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=Ot(t,Xt(r))),n?(o=Tt,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Gr(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}Dr.templateSettings={escape:Y,evaluate:X,interpolate:K,variable:"",imports:{_:Dr}},Dr.prototype=Br.prototype,Dr.prototype.constructor=Dr,Ur.prototype=zr(Br.prototype),Ur.prototype.constructor=Ur,Vr.prototype=zr(Br.prototype),Vr.prototype.constructor=Vr,Hr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Hr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hr.prototype.get=function(e){var t=this.__data__;if(Ir){var n=t[e];return n===i?r:n}return Re.call(t,e)?t[e]:r},Hr.prototype.has=function(e){var t=this.__data__;return Ir?t[e]!==r:Re.call(t,e)},Hr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ir&&t===r?i:t,this},$r.prototype.clear=function(){this.__data__=[],this.size=0},$r.prototype.delete=function(e){var t=this.__data__,r=en(t,e);return!(r<0||(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,0))},$r.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?r:t[n][1]},$r.prototype.has=function(e){return en(this.__data__,e)>-1},$r.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Hr,map:new(_r||$r),string:new Hr}},Wr.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return lo(this,e).get(e)},Wr.prototype.has=function(e){return lo(this,e).has(e)},Wr.prototype.set=function(e,t){var r=lo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.clear=function(){this.__data__=new $r,this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},qr.prototype.get=function(e){return this.__data__.get(e)},qr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof $r){var n=r.__data__;if(!_r||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var dn=Pi(bn),hn=Pi(wn,!0);function fn(e,t){var r=!0;return dn(e,function(e,n,i){return r=!!t(e,n,i)}),r}function pn(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&&!ss(s):n(s,l)))var l=s,c=a}return c}function gn(e,t){var r=[];return dn(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function mn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=vo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?mn(s,t-1,r,n,i):Pt(i,s):n||(i[i.length]=s)}return i}var vn=Mi(),yn=Mi(!0);function bn(e,t){return e&&vn(e,t,Ts)}function wn(e,t){return e&&yn(e,t,Ts)}function xn(e,t){return Et(t,function(t){return Ka(e[t])})}function Cn(e,t){for(var n=0,i=(t=yi(t,e)).length;null!=e&&n<i;)e=e[No(t[n++])];return n&&n==i?e:r}function _n(e,t,r){var n=t(e);return Ha(e)?n:Pt(n,r(e))}function Sn(e){return null==e?e===r?"[object Undefined]":"[object Null]":et&&et in ke(e)?function(e){var t=Re.call(e,et),n=e[et];try{e[et]=r;var i=!0}catch(e){}var o=je.call(e);return i&&(t?e[et]=n:delete e[et]),o}(e):function(e){return je.call(e)}(e)}function kn(e,t){return e>t}function An(e,t){return null!=e&&Re.call(e,t)}function In(e,t){return null!=e&&t in ke(e)}function En(e,t,n){for(var i=n?Tt:Ft,o=e[0].length,a=e.length,s=a,l=we(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Ot(d,Xt(t))),c=vr(d.length,c),l[s]=!n&&(t||o>=120&&d.length>=120)?new Gr(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?Zt(f,g):i(u,g,n))){for(s=a;--s;){var m=l[s];if(!(m?Zt(m,g):i(e[s],g,n)))continue e}f&&f.push(g),u.push(p)}}return u}function Fn(e,t,n){var i=null==(e=Io(e,t=yi(t,e)))?e:e[No(Xo(t))];return null==i?r:_t(i,e,n)}function Tn(e){return es(e)&&Sn(e)==p}function On(e,t,n,i,o){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=Ha(e),l=Ha(t),c=s?g:po(e),u=l?g:po(t),d=(c=c==p?_:c)==_,h=(u=u==p?_:u)==_,f=c==u;if(f&&qa(e)){if(!qa(t))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new qr),s||ls(e)?eo(e,t,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case m:case v:case C:return za(+e,+t);case y:return e.name==t.name&&e.message==t.message;case k:case I:return e==t+"";case x:var s=ir;case A:var l=1&n;if(s||(s=sr),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=eo(s(e),s(t),n,i,o,a);return a.delete(e),u;case E:if(Nr)return Nr.call(e)==Nr.call(t)}return!1}(e,t,c,n,i,o,a);if(!(1&n)){var b=d&&Re.call(e,"__wrapped__"),w=h&&Re.call(t,"__wrapped__");if(b||w){var S=b?e.value():e,F=w?t.value():t;return a||(a=new qr),o(S,F,n,i,a)}}return!!f&&(a||(a=new qr),function(e,t,n,i,o,a){var s=1&n,l=ro(e),c=l.length,u=ro(t),d=u.length;if(c!=d&&!s)return!1;for(var h=c;h--;){var f=l[h];if(!(s?f in t:Re.call(t,f)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=s;++h<c;){var y=e[f=l[h]],b=t[f];if(i)var w=s?i(b,y,f,t,e,a):i(y,b,f,e,t,a);if(!(w===r?y===b||o(y,b,n,i,a):w)){m=!1;break}v||(v="constructor"==f)}if(m&&!v){var x=e.constructor,C=t.constructor;x==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof C&&C instanceof C||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,i,o,a))}(e,t,n,i,On,o))}function Pn(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=ke(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 qr;if(i)var f=i(u,d,c,e,t,h);if(!(f===r?On(d,u,3,i,h):f))return!1}}return!0}function Mn(e){return!(!Qa(e)||(t=e,Ne&&Ne in t))&&(Ka(e)?Be:pe).test(jo(e));var t}function Rn(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?Ha(e)?Bn(e[0],e[1]):zn(e):dl(e)}function Ln(e){if(!_o(e))return gr(e);var t=[];for(var r in ke(e))Re.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Nn(e){if(!Qa(e))return function(e){var t=[];if(null!=e)for(var r in ke(e))t.push(r);return t}(e);var t=_o(e),r=[];for(var n in e)("constructor"!=n||!t&&Re.call(e,n))&&r.push(n);return r}function jn(e,t){return e<t}function Dn(e,t){var r=-1,n=Wa(e)?we(e.length):[];return dn(e,function(e,i,o){n[++r]=t(e,i,o)}),n}function zn(e){var t=co(e);return 1==t.length&&t[0][2]?ko(t[0][0],t[0][1]):function(r){return r===e||Pn(r,e,t)}}function Bn(e,t){return wo(e)&&So(t)?ko(No(e),t):function(n){var i=ks(n,e);return i===r&&i===t?As(n,e):On(t,i,3)}}function Un(e,t,n,i,o){e!==t&&vn(t,function(a,s){if(o||(o=new qr),Qa(a))!function(e,t,n,i,o,a,s){var l=Eo(e,n),c=Eo(t,n),u=s.get(c);if(u)Jr(e,n,u);else{var d=a?a(l,c,n+"",e,t,s):r,h=d===r;if(h){var f=Ha(c),p=!f&&qa(c),g=!f&&!p&&ls(c);d=c,f||p||g?Ha(l)?d=l:Ga(l)?d=Ei(l):p?(h=!1,d=Ci(c,!0)):g?(h=!1,d=Si(c,!0)):d=[]:ns(c)||Va(c)?(d=l,Va(l)?d=ms(l):Qa(l)&&!Ka(l)||(d=mo(c))):h=!1}h&&(s.set(c,d),o(d,c,i,a,s),s.delete(c)),Jr(e,n,d)}}(e,t,s,n,Un,i,o);else{var l=i?i(Eo(e,s),a,s+"",e,t,o):r;l===r&&(l=a),Jr(e,s,l)}},Os)}function Vn(e,t){var n=e.length;if(n)return yo(t+=t<0?n:0,n)?e[t]:r}function Hn(e,t,r){t=t.length?Ot(t,function(e){return Ha(e)?function(t){return Cn(t,1===e.length?e[0]:e)}:e}):[rl];var n=-1;t=Ot(t,Xt(so()));var i=Dn(e,function(e,r,i){var o=Ot(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=ki(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 $n(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=Cn(e,a);r(s,a)&&Jn(o,yi(a,e),s)}return o}function Wn(e,t,r,n){var i=n?Bt:zt,o=-1,a=t.length,s=e;for(e===t&&(t=Ei(t)),r&&(s=Ot(e,Xt(r)));++o<a;)for(var l=0,c=t[o],u=r?r(c):c;(l=i(s,u,l,n))>-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function Gn(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;yo(i)?Ye.call(e,i,1):ui(e,i)}}return e}function qn(e,t){return e+gt(wr()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(Ao(e,t,rl),e+"")}function Kn(e){return Xr(zs(e))}function Zn(e,t){var r=zs(e);return Ro(r,an(t,0,r.length))}function Jn(e,t,n,i){if(!Qa(e))return e;for(var o=-1,a=(t=yi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=No(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=Qa(d)?d:yo(t[o+1])?[]:{})}Qr(l,c,u),l=l[c]}return e}var Qn=Er?function(e,t){return Er.set(e,t),e}:rl,ei=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:Qs(t),writable:!0})}:rl;function ti(e){return Ro(zs(e))}function ri(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=we(i);++n<i;)o[n]=e[n+t];return o}function ni(e,t){var r;return dn(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function ii(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&&!ss(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return oi(e,t,rl,r)}function oi(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=ss(t),u=t===r;o<a;){var d=gt((o+a)/2),h=n(e[d]),f=h!==r,p=null===h,g=h==h,m=ss(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 vr(a,4294967294)}function ai(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||!za(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function si(e){return"number"==typeof e?e:ss(e)?d:+e}function li(e){if("string"==typeof e)return e;if(Ha(e))return Ot(e,li)+"";if(ss(e))return jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,r){var n=-1,i=Ft,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=Tt;else if(o>=200){var c=t?null:Yi(e);if(c)return sr(c);a=!1,i=Zt,l=new Gr}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 ui(e,t){return null==(e=Io(e,t=yi(t,e)))||delete e[No(Xo(t))]}function di(e,t,r,n){return Jn(e,t,r(Cn(e,t)),n)}function hi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ri(e,n?0:o,n?o+1:i):ri(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Vr&&(r=r.value()),Mt(t,function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))},r)}function pi(e,t,r){var n=e.length;if(n<2)return n?ci(e[0]):[];for(var i=-1,o=we(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=un(o[i]||a,e[s],t,r));return ci(mn(o,1),t,r)}function gi(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 mi(e){return Ga(e)?e:[]}function vi(e){return"function"==typeof e?e:rl}function yi(e,t){return Ha(e)?e:wo(e,t)?[e]:Lo(vs(e))}var bi=Xn;function wi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ri(e,t,n)}var xi=ct||function(e){return dt.clearTimeout(e)};function Ci(e,t){if(t)return e.slice();var r=e.length,n=$e?$e(r):new e.constructor(r);return e.copy(n),n}function _i(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Si(e,t){var r=t?_i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=ss(e),s=t!==r,l=null===t,c=t==t,u=ss(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 Ai(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,l=t.length,c=mr(o-a,0),u=we(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 Ii(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,l=-1,c=t.length,u=mr(o-s,0),d=we(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 Ei(e,t){var r=-1,n=e.length;for(t||(t=we(n));++r<n;)t[r]=e[r];return t}function Fi(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?nn(n,l,c):Qr(n,l,c)}return n}function Ti(e,t){return function(r,n){var i=Ha(r)?St:tn,o=t?t():{};return i(r,e,so(n,2),o)}}function Oi(e){return Xn(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&&bo(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=ke(t);++i<o;){var l=n[i];l&&e(t,l,i,a)}return t})}function Pi(e,t){return function(r,n){if(null==r)return r;if(!Wa(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=ke(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Mi(e){return function(t,r,n){for(var i=-1,o=ke(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 Ri(e){return function(t){var n=nr(t=vs(t))?ur(t):r,i=n?n[0]:t.charAt(0),o=n?wi(n,1).join(""):t.slice(1);return i[e]()+o}}function Li(e){return function(t){return Mt(Ks(Vs(t).replace(Ke,"")),e,"")}}function Ni(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=zr(e.prototype),n=e.apply(r,t);return Qa(n)?n:r}}function ji(e){return function(t,n,i){var o=ke(t);if(!Wa(t)){var a=so(n,3);t=Ts(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 Di(e){return to(function(t){var i=t.length,o=i,a=Ur.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ee(n);if(a&&!l&&"wrapper"==oo(s))var l=new Ur([],!0)}for(o=l?o:i;++o<i;){var c=oo(s=t[o]),u="wrapper"==c?io(s):r;l=u&&xo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[oo(u[0])].apply(l,u[3]):1==s.length&&xo(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ha(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 zi(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:Ni(e);return function s(){for(var y=arguments.length,b=we(y),w=y;w--;)b[w]=arguments[w];if(g)var x=ao(s),C=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,x);if(i&&(b=Ai(b,i,o,g)),a&&(b=Ii(b,a,l,g)),y-=C,g&&y<d){var _=ar(b,x);return Gi(e,t,zi,s.placeholder,n,b,_,c,u,d-y)}var S=f?n:this,k=p?S[e]:e;return y=b.length,c?b=function(e,t){for(var n=e.length,i=vr(t.length,n),o=Ei(e);i--;){var a=t[i];e[i]=yo(a,n)?o[a]:r}return e}(b,c):m&&y>1&&b.reverse(),h&&u<y&&(b.length=u),this&&this!==dt&&this instanceof s&&(k=v||Ni(k)),k.apply(S,b)}}function Bi(e,t){return function(r,n){return function(e,t,r,n){return bn(e,function(e,i,o){t(n,r(e),i,o)}),n}(r,e,t(n),{})}}function Ui(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=li(n),i=li(i)):(n=si(n),i=si(i)),o=e(n,i)}return o}}function Vi(e){return to(function(t){return t=Ot(t,Xt(so())),Xn(function(r){var n=this;return e(t,function(e){return _t(e,n,r)})})})}function Hi(e,t){var n=(t=t===r?" ":li(t)).length;if(n<2)return n?Yn(t,e):t;var i=Yn(t,ft(e/cr(t)));return nr(t)?wi(ur(i),0,e).join(""):i.slice(0,e)}function $i(e){return function(t,n,i){return i&&"number"!=typeof i&&bo(t,n,i)&&(n=i=r),t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,r,n){for(var i=-1,o=mr(ft((t-e)/(r||1)),0),a=we(o);o--;)a[n?o:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:hs(i),e)}}function Wi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gs(t),r=gs(r)),e(t,r)}}function Gi(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 xo(e)&&Fo(p,f),p.placeholder=i,Po(p,e,t)}function qi(e){var t=Se[e];return function(e,r){if(e=gs(e),(r=null==r?0:vr(fs(r),292))&&$t(e)){var n=(vs(e)+"e").split("e");return+((n=(vs(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=kr&&1/sr(new kr([,-0]))[1]==c?function(e){return new kr(e)}:sl;function Xi(e){return function(t){var r=po(t);return r==x?ir(t):r==A?lr(t):function(e,t){return Ot(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ki(e,t,i,c,u,d,h,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Ee(n);var g=c?c.length:0;if(g||(t&=-97,c=u=r),h=h===r?h:mr(fs(h),0),f=f===r?f:fs(f),g-=u?u.length:0,64&t){var m=c,v=u;c=u=r}var y=p?r:io(e),b=[e,t,i,c,u,m,v,d,h,f];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,c=n==s&&8==r||n==s&&r==l&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!c)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var d=e[3];e[3]=d?Ai(d,u,t[4]):u,e[4]=d?ar(e[3],o):t[4]}(u=t[5])&&(d=e[5],e[5]=d?Ii(d,u,t[6]):u,e[6]=d?ar(e[5],o):t[6]),(u=t[7])&&(e[7]=u),n&s&&(e[8]=null==e[8]?t[8]:vr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,y),e=b[0],t=b[1],i=b[2],c=b[3],u=b[4],!(f=b[9]=b[9]===r?p?0:e.length:mr(b[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)w=8==t||16==t?function(e,t,n){var i=Ni(e);return function o(){for(var a=arguments.length,s=we(a),l=a,c=ao(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:ar(s,c);return(a-=u.length)<n?Gi(e,t,zi,o.placeholder,r,s,u,r,r,n-a):_t(this&&this!==dt&&this instanceof o?i:e,this,s)}}(e,t,f):t!=a&&33!=t||u.length?zi.apply(r,b):function(e,t,r,n){var i=1&t,o=Ni(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=n.length,u=we(c+s),d=this&&this!==dt&&this instanceof t?o:e;++l<c;)u[l]=n[l];for(;s--;)u[l++]=arguments[++a];return _t(d,i?r:this,u)}}(e,t,i,c);else var w=function(e,t,r){var n=1&t,i=Ni(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return Po((y?Qn:Fo)(w,b),e,t)}function Zi(e,t,n,i){return e===r||za(e,Oe[n])&&!Re.call(i,n)?t:e}function Ji(e,t,n,i,o,a){return Qa(e)&&Qa(t)&&(a.set(t,e),Un(e,t,r,Ji,a),a.delete(t)),e}function Qi(e){return ns(e)?r:e}function eo(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 Gr: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(!Lt(t,function(e,t){if(!Zt(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 to(e){return Oo(Ao(e,r,$o),e+"")}function ro(e){return _n(e,Ts,ho)}function no(e){return _n(e,Os,fo)}var io=Er?function(e){return Er.get(e)}:sl;function oo(e){for(var t=e.name+"",r=Fr[t],n=Re.call(Fr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function ao(e){return(Re.call(Dr,"placeholder")?Dr:e).placeholder}function so(){var e=Dr.iteratee||nl;return e=e===nl?Rn:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(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 co(e){for(var t=Ts(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,So(i)]}return t}function uo(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Mn(n)?n:r}var ho=mt?function(e){return null==e?[]:(e=ke(e),Et(mt(e),function(t){return qe.call(e,t)}))}:pl,fo=mt?function(e){for(var t=[];e;)Pt(t,ho(e)),e=We(e);return t}:pl,po=Sn;function go(e,t,r){for(var n=-1,i=(t=yi(t,e)).length,o=!1;++n<i;){var a=No(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ja(i)&&yo(a,i)&&(Ha(e)||Va(e))}function mo(e){return"function"!=typeof e.constructor||_o(e)?{}:zr(We(e))}function vo(e){return Ha(e)||Va(e)||!!(Xe&&e&&e[Xe])}function yo(e,t){var r=typeof e;return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&me.test(e))&&e>-1&&e%1==0&&e<t}function bo(e,t,r){if(!Qa(r))return!1;var n=typeof t;return!!("number"==n?Wa(r)&&yo(t,r.length):"string"==n&&t in r)&&za(r[t],e)}function wo(e,t){if(Ha(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ss(e))||J.test(e)||!Z.test(e)||null!=t&&e in ke(t)}function xo(e){var t=oo(e),r=Dr[t];if("function"!=typeof r||!(t in Vr.prototype))return!1;if(e===r)return!0;var n=io(r);return!!n&&e===n[0]}(Cr&&po(new Cr(new ArrayBuffer(1)))!=O||_r&&po(new _r)!=x||Sr&&po(Sr.resolve())!=S||kr&&po(new kr)!=A||Ar&&po(new Ar)!=F)&&(po=function(e){var t=Sn(e),n=t==_?e.constructor:r,i=n?jo(n):"";if(i)switch(i){case Tr:return O;case Or:return x;case Pr:return S;case Mr:return A;case Rr:return F}return t});var Co=Pe?Ka:gl;function _o(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)}function So(e){return e==e&&!Qa(e)}function ko(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in ke(n))}}function Ao(e,t,n){return t=mr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=mr(r.length-t,0),a=we(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=we(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),_t(e,this,s)}}function Io(e,t){return t.length<2?e:Cn(e,ri(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Fo=Mo(Qn),To=ht||function(e,t){return dt.setTimeout(e,t)},Oo=Mo(ei);function Po(e,t,r){var n=t+"";return Oo(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(ie,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return kt(f,function(r){var n="_."+r[0];t&r[1]&&!Ft(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(n),r)))}function Mo(e){var t=0,n=0;return function(){var i=yr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ro(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=qn(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Lo=function(e){var t=Ma(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,r,n,i){t.push(n?i.replace(ce,"$1"):r||e)}),t});function No(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Do(e){if(e instanceof Vr)return e.clone();var t=new Ur(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var zo=Xn(function(e,t){return Ga(e)?un(e,mn(t,1,Ga,!0)):[]}),Bo=Xn(function(e,t){var n=Xo(t);return Ga(n)&&(n=r),Ga(e)?un(e,mn(t,1,Ga,!0),so(n,2)):[]}),Uo=Xn(function(e,t){var n=Xo(t);return Ga(n)&&(n=r),Ga(e)?un(e,mn(t,1,Ga,!0),r,n):[]});function Vo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fs(r);return i<0&&(i=mr(n+i,0)),Dt(e,so(t,3),i)}function Ho(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=fs(n),o=n<0?mr(i+o,0):vr(o,i-1)),Dt(e,so(t,3),o,!0)}function $o(e){return null!=e&&e.length?mn(e,1):[]}function Wo(e){return e&&e.length?e[0]:r}var Go=Xn(function(e){var t=Ot(e,mi);return t.length&&t[0]===e[0]?En(t):[]}),qo=Xn(function(e){var t=Xo(e),n=Ot(e,mi);return t===Xo(n)?t=r:n.pop(),n.length&&n[0]===e[0]?En(n,so(t,2)):[]}),Yo=Xn(function(e){var t=Xo(e),n=Ot(e,mi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?En(n,r,t):[]});function Xo(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ko=Xn(Zo);function Zo(e,t){return e&&e.length&&t&&t.length?Wn(e,t):e}var Jo=to(function(e,t){var r=null==e?0:e.length,n=on(e,t);return Gn(e,Ot(t,function(e){return yo(e,r)?+e:e}).sort(ki)),n});function Qo(e){return null==e?e:xr.call(e)}var ea=Xn(function(e){return ci(mn(e,1,Ga,!0))}),ta=Xn(function(e){var t=Xo(e);return Ga(t)&&(t=r),ci(mn(e,1,Ga,!0),so(t,2))}),ra=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,ci(mn(e,1,Ga,!0),r,t)});function na(e){if(!e||!e.length)return[];var t=0;return e=Et(e,function(e){if(Ga(e))return t=mr(e.length,t),!0}),qt(t,function(t){return Ot(e,Ht(t))})}function ia(e,t){if(!e||!e.length)return[];var n=na(e);return null==t?n:Ot(n,function(e){return _t(t,r,e)})}var oa=Xn(function(e,t){return Ga(e)?un(e,t):[]}),aa=Xn(function(e){return pi(Et(e,Ga))}),sa=Xn(function(e){var t=Xo(e);return Ga(t)&&(t=r),pi(Et(e,Ga),so(t,2))}),la=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,pi(Et(e,Ga),r,t)}),ca=Xn(na),ua=Xn(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ia(e,n)});function da(e){var t=Dr(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var fa=to(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Vr&&yo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ha,args:[o],thisArg:r}),new Ur(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),pa=Ti(function(e,t,r){Re.call(e,r)?++e[r]:nn(e,r,1)}),ga=ji(Vo),ma=ji(Ho);function va(e,t){return(Ha(e)?kt:dn)(e,so(t,3))}function ya(e,t){return(Ha(e)?At:hn)(e,so(t,3))}var ba=Ti(function(e,t,r){Re.call(e,r)?e[r].push(t):nn(e,r,[t])}),wa=Xn(function(e,t,r){var n=-1,i="function"==typeof t,o=Wa(e)?we(e.length):[];return dn(e,function(e){o[++n]=i?_t(t,e,r):Fn(e,t,r)}),o}),xa=Ti(function(e,t,r){nn(e,r,t)});function Ca(e,t){return(Ha(e)?Ot:Dn)(e,so(t,3))}var _a=Ti(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),Sa=Xn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&bo(e,t[0],t[1])?t=[]:r>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Hn(e,mn(t,1),[])}),ka=ut||function(){return dt.Date.now()};function Aa(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Ki(e,s,r,r,r,r,t)}function Ia(e,t){var i;if("function"!=typeof t)throw new Ee(n);return e=fs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ea=Xn(function(e,t,r){var n=1;if(r.length){var i=ar(r,ao(Ea));n|=a}return Ki(e,n,t,r,i)}),Fa=Xn(function(e,t,r){var n=3;if(r.length){var i=ar(r,ao(Fa));n|=a}return Ki(t,n,e,r,i)});function Ta(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=ka();if(m(e))return y(e);c=To(v,function(e){var r=t-(e-u);return f?vr(r,s-(e-d)):r}(e))}function y(e){return c=r,p&&o?g(e):(o=a=r,l)}function b(){var e=ka(),n=m(e);if(o=arguments,a=this,u=e,n){if(c===r)return function(e){return d=e,c=To(v,t),h?g(e):l}(u);if(f)return xi(c),c=To(v,t),g(u)}return c===r&&(c=To(v,t)),l}return t=gs(t)||0,Qa(i)&&(h=!!i.leading,s=(f="maxWait"in i)?mr(gs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),b.cancel=function(){c!==r&&xi(c),d=0,o=u=a=c=r},b.flush=function(){return c===r?l:y(ka())},b}var Oa=Xn(function(e,t){return cn(e,1,t)}),Pa=Xn(function(e,t,r){return cn(e,gs(t)||0,r)});function Ma(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(Ma.Cache||Wr),r}function Ra(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)}}Ma.Cache=Wr;var La=bi(function(e,t){var r=(t=1==t.length&&Ha(t[0])?Ot(t[0],Xt(so())):Ot(mn(t,1),Xt(so()))).length;return Xn(function(n){for(var i=-1,o=vr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return _t(e,this,n)})}),Na=Xn(function(e,t){var n=ar(t,ao(Na));return Ki(e,a,r,t,n)}),ja=Xn(function(e,t){var n=ar(t,ao(ja));return Ki(e,64,r,t,n)}),Da=to(function(e,t){return Ki(e,l,r,r,r,t)});function za(e,t){return e===t||e!=e&&t!=t}var Ba=Wi(kn),Ua=Wi(function(e,t){return e>=t}),Va=Tn(function(){return arguments}())?Tn:function(e){return es(e)&&Re.call(e,"callee")&&!qe.call(e,"callee")},Ha=we.isArray,$a=vt?Xt(vt):function(e){return es(e)&&Sn(e)==T};function Wa(e){return null!=e&&Ja(e.length)&&!Ka(e)}function Ga(e){return es(e)&&Wa(e)}var qa=Nt||gl,Ya=yt?Xt(yt):function(e){return es(e)&&Sn(e)==v};function Xa(e){if(!es(e))return!1;var t=Sn(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Ka(e){if(!Qa(e))return!1;var t=Sn(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==fs(e)}function Ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Xt(bt):function(e){return es(e)&&po(e)==x};function rs(e){return"number"==typeof e||es(e)&&Sn(e)==C}function ns(e){if(!es(e)||Sn(e)!=_)return!1;var t=We(e);if(null===t)return!0;var r=Re.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==De}var is=wt?Xt(wt):function(e){return es(e)&&Sn(e)==k},os=xt?Xt(xt):function(e){return es(e)&&po(e)==A};function as(e){return"string"==typeof e||!Ha(e)&&es(e)&&Sn(e)==I}function ss(e){return"symbol"==typeof e||es(e)&&Sn(e)==E}var ls=Ct?Xt(Ct):function(e){return es(e)&&Ja(e.length)&&!!it[Sn(e)]},cs=Wi(jn),us=Wi(function(e,t){return e<=t});function ds(e){if(!e)return[];if(Wa(e))return as(e)?ur(e):Ei(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=po(e);return(t==x?ir:t==A?sr:zs)(e)}function hs(e){return e?(e=gs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=hs(e),r=t%1;return t==t?r?t-r:t:0}function ps(e){return e?an(fs(e),0,h):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return d;if(Qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=fe.test(e);return r||ge.test(e)?lt(e.slice(2),r?2:8):he.test(e)?d:+e}function ms(e){return Fi(e,Os(e))}function vs(e){return null==e?"":li(e)}var ys=Oi(function(e,t){if(_o(t)||Wa(t))Fi(t,Ts(t),e);else for(var r in t)Re.call(t,r)&&Qr(e,r,t[r])}),bs=Oi(function(e,t){Fi(t,Os(t),e)}),ws=Oi(function(e,t,r,n){Fi(t,Os(t),e,n)}),xs=Oi(function(e,t,r,n){Fi(t,Ts(t),e,n)}),Cs=to(on),_s=Xn(function(e,t){e=ke(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&bo(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=Os(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===r||za(d,Oe[u])&&!Re.call(e,u))&&(e[u]=a[u])}return e}),Ss=Xn(function(e){return e.push(r,Ji),_t(Ms,r,e)});function ks(e,t,n){var i=null==e?r:Cn(e,t);return i===r?n:i}function As(e,t){return null!=e&&go(e,t,In)}var Is=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r},Qs(rl)),Es=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Re.call(e,t)?e[t].push(r):e[t]=[r]},so),Fs=Xn(Fn);function Ts(e){return Wa(e)?Yr(e):Ln(e)}function Os(e){return Wa(e)?Yr(e,!0):Nn(e)}var Ps=Oi(function(e,t,r){Un(e,t,r)}),Ms=Oi(function(e,t,r,n){Un(e,t,r,n)}),Rs=to(function(e,t){var r={};if(null==e)return r;var n=!1;t=Ot(t,function(t){return t=yi(t,e),n||(n=t.length>1),t}),Fi(e,no(e),r),n&&(r=sn(r,7,Qi));for(var i=t.length;i--;)ui(r,t[i]);return r}),Ls=to(function(e,t){return null==e?{}:function(e,t){return $n(e,t,function(t,r){return As(e,r)})}(e,t)});function Ns(e,t){if(null==e)return{};var r=Ot(no(e),function(e){return[e]});return t=so(t),$n(e,r,function(e,r){return t(e,r[0])})}var js=Xi(Ts),Ds=Xi(Os);function zs(e){return null==e?[]:Kt(e,Ts(e))}var Bs=Li(function(e,t,r){return t=t.toLowerCase(),e+(r?Us(t):t)});function Us(e){return Xs(vs(e).toLowerCase())}function Vs(e){return(e=vs(e))&&e.replace(ve,er).replace(Ze,"")}var Hs=Li(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),$s=Li(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),Ws=Ri("toLowerCase"),Gs=Li(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),qs=Li(function(e,t,r){return e+(r?" ":"")+Xs(t)}),Ys=Li(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Xs=Ri("toUpperCase");function Ks(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Zs=Xn(function(e,t){try{return _t(e,r,t)}catch(e){return Xa(e)?e:new Ce(e)}}),Js=to(function(e,t){return kt(t,function(t){t=No(t),nn(e,t,Ea(e[t],e))}),e});function Qs(e){return function(){return e}}var el=Di(),tl=Di(!0);function rl(e){return e}function nl(e){return Rn("function"==typeof e?e:sn(e,1))}var il=Xn(function(e,t){return function(r){return Fn(r,e,t)}}),ol=Xn(function(e,t){return function(r){return Fn(e,r,t)}});function al(e,t,r){var n=Ts(t),i=xn(t,n);null!=r||Qa(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=xn(t,Ts(t)));var o=!(Qa(r)&&"chain"in r&&!r.chain),a=Ka(e);return kt(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__=Ei(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Pt([this.value()],arguments))})}),e}function sl(){}var ll=Vi(Ot),cl=Vi(It),ul=Vi(Lt);function dl(e){return wo(e)?Ht(No(e)):function(e){return function(t){return Cn(t,e)}}(e)}var hl=$i(),fl=$i(!0);function pl(){return[]}function gl(){return!1}var ml,vl=Ui(function(e,t){return e+t},0),yl=qi("ceil"),bl=Ui(function(e,t){return e/t},1),wl=qi("floor"),xl=Ui(function(e,t){return e*t},1),Cl=qi("round"),_l=Ui(function(e,t){return e-t},0);return Dr.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Dr.ary=Aa,Dr.assign=ys,Dr.assignIn=bs,Dr.assignInWith=ws,Dr.assignWith=xs,Dr.at=Cs,Dr.before=Ia,Dr.bind=Ea,Dr.bindAll=Js,Dr.bindKey=Fa,Dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},Dr.chain=da,Dr.chunk=function(e,t,n){t=(n?bo(e,t,n):t===r)?1:mr(fs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=we(ft(i/t));o<i;)s[a++]=ri(e,o,o+=t);return s},Dr.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},Dr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=we(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Pt(Ha(r)?Ei(r):[r],mn(t,1))},Dr.cond=function(e){var t=null==e?0:e.length,r=so();return e=t?Ot(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[r(e[0]),e[1]]}):[],Xn(function(r){for(var n=-1;++n<t;){var i=e[n];if(_t(i[0],this,r))return _t(i[1],this,r)}})},Dr.conforms=function(e){return function(e){var t=Ts(e);return function(r){return ln(r,e,t)}}(sn(e,1))},Dr.constant=Qs,Dr.countBy=pa,Dr.create=function(e,t){var r=zr(e);return null==t?r:rn(r,t)},Dr.curry=function e(t,n,i){var o=Ki(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Dr.curryRight=function e(t,n,i){var o=Ki(t,16,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Dr.debounce=Ta,Dr.defaults=_s,Dr.defaultsDeep=Ss,Dr.defer=Oa,Dr.delay=Pa,Dr.difference=zo,Dr.differenceBy=Bo,Dr.differenceWith=Uo,Dr.drop=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,(t=n||t===r?1:fs(t))<0?0:t,i):[]},Dr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,0,(t=i-(t=n||t===r?1:fs(t)))<0?0:t):[]},Dr.dropRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0,!0):[]},Dr.dropWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0):[]},Dr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&bo(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=fs(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:fs(i))<0&&(i+=o),i=n>i?0:ps(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Dr.filter=function(e,t){return(Ha(e)?Et:gn)(e,so(t,3))},Dr.flatMap=function(e,t){return mn(Ca(e,t),1)},Dr.flatMapDeep=function(e,t){return mn(Ca(e,t),c)},Dr.flatMapDepth=function(e,t,n){return n=n===r?1:fs(n),mn(Ca(e,t),n)},Dr.flatten=$o,Dr.flattenDeep=function(e){return null!=e&&e.length?mn(e,c):[]},Dr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===r?1:fs(t)):[]},Dr.flip=function(e){return Ki(e,512)},Dr.flow=el,Dr.flowRight=tl,Dr.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},Dr.functions=function(e){return null==e?[]:xn(e,Ts(e))},Dr.functionsIn=function(e){return null==e?[]:xn(e,Os(e))},Dr.groupBy=ba,Dr.initial=function(e){return null!=e&&e.length?ri(e,0,-1):[]},Dr.intersection=Go,Dr.intersectionBy=qo,Dr.intersectionWith=Yo,Dr.invert=Is,Dr.invertBy=Es,Dr.invokeMap=wa,Dr.iteratee=nl,Dr.keyBy=xa,Dr.keys=Ts,Dr.keysIn=Os,Dr.map=Ca,Dr.mapKeys=function(e,t){var r={};return t=so(t,3),bn(e,function(e,n,i){nn(r,t(e,n,i),e)}),r},Dr.mapValues=function(e,t){var r={};return t=so(t,3),bn(e,function(e,n,i){nn(r,n,t(e,n,i))}),r},Dr.matches=function(e){return zn(sn(e,1))},Dr.matchesProperty=function(e,t){return Bn(e,sn(t,1))},Dr.memoize=Ma,Dr.merge=Ps,Dr.mergeWith=Ms,Dr.method=il,Dr.methodOf=ol,Dr.mixin=al,Dr.negate=Ra,Dr.nthArg=function(e){return e=fs(e),Xn(function(t){return Vn(t,e)})},Dr.omit=Rs,Dr.omitBy=function(e,t){return Ns(e,Ra(so(t)))},Dr.once=function(e){return Ia(2,e)},Dr.orderBy=function(e,t,n,i){return null==e?[]:(Ha(t)||(t=null==t?[]:[t]),Ha(n=i?r:n)||(n=null==n?[]:[n]),Hn(e,t,n))},Dr.over=ll,Dr.overArgs=La,Dr.overEvery=cl,Dr.overSome=ul,Dr.partial=Na,Dr.partialRight=ja,Dr.partition=_a,Dr.pick=Ls,Dr.pickBy=Ns,Dr.property=dl,Dr.propertyOf=function(e){return function(t){return null==e?r:Cn(e,t)}},Dr.pull=Ko,Dr.pullAll=Zo,Dr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Wn(e,t,so(r,2)):e},Dr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Wn(e,t,r,n):e},Dr.pullAt=Jo,Dr.range=hl,Dr.rangeRight=fl,Dr.rearg=Da,Dr.reject=function(e,t){return(Ha(e)?Et:gn)(e,Ra(so(t,3)))},Dr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=so(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Gn(e,i),r},Dr.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Xn(e,t=t===r?t:fs(t))},Dr.reverse=Qo,Dr.sampleSize=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),(Ha(e)?Kr:Zn)(e,t)},Dr.set=function(e,t,r){return null==e?e:Jn(e,t,r)},Dr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Jn(e,t,n,i)},Dr.shuffle=function(e){return(Ha(e)?Zr:ti)(e)},Dr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bo(e,t,n)?(t=0,n=i):(t=null==t?0:fs(t),n=n===r?i:fs(n)),ri(e,t,n)):[]},Dr.sortBy=Sa,Dr.sortedUniq=function(e){return e&&e.length?ai(e):[]},Dr.sortedUniqBy=function(e,t){return e&&e.length?ai(e,so(t,2)):[]},Dr.split=function(e,t,n){return n&&"number"!=typeof n&&bo(e,t,n)&&(t=n=r),(n=n===r?h:n>>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=li(t))&&nr(e)?wi(ur(e),0,n):e.split(t,n):[]},Dr.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:mr(fs(t),0),Xn(function(r){var n=r[t],i=wi(r,0,t);return n&&Pt(i,n),_t(e,this,i)})},Dr.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Dr.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Dr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,(t=i-(t=n||t===r?1:fs(t)))<0?0:t,i):[]},Dr.takeRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!1,!0):[]},Dr.takeWhile=function(e,t){return e&&e.length?hi(e,so(t,3)):[]},Dr.tap=function(e,t){return t(e),e},Dr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return Qa(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Ta(e,t,{leading:i,maxWait:t,trailing:o})},Dr.thru=ha,Dr.toArray=ds,Dr.toPairs=js,Dr.toPairsIn=Ds,Dr.toPath=function(e){return Ha(e)?Ot(e,No):ss(e)?[e]:Ei(Lo(vs(e)))},Dr.toPlainObject=ms,Dr.transform=function(e,t,r){var n=Ha(e),i=n||qa(e)||ls(e);if(t=so(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Qa(e)&&Ka(o)?zr(We(e)):{}}return(i?kt:bn)(e,function(e,n,i){return t(r,e,n,i)}),r},Dr.unary=function(e){return Aa(e,1)},Dr.union=ea,Dr.unionBy=ta,Dr.unionWith=ra,Dr.uniq=function(e){return e&&e.length?ci(e):[]},Dr.uniqBy=function(e,t){return e&&e.length?ci(e,so(t,2)):[]},Dr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ci(e,r,t):[]},Dr.unset=function(e,t){return null==e||ui(e,t)},Dr.unzip=na,Dr.unzipWith=ia,Dr.update=function(e,t,r){return null==e?e:di(e,t,vi(r))},Dr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:di(e,t,vi(n),i)},Dr.values=zs,Dr.valuesIn=function(e){return null==e?[]:Kt(e,Os(e))},Dr.without=oa,Dr.words=Ks,Dr.wrap=function(e,t){return Na(vi(t),e)},Dr.xor=aa,Dr.xorBy=sa,Dr.xorWith=la,Dr.zip=ca,Dr.zipObject=function(e,t){return gi(e||[],t||[],Qr)},Dr.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jn)},Dr.zipWith=ua,Dr.entries=js,Dr.entriesIn=Ds,Dr.extend=bs,Dr.extendWith=ws,al(Dr,Dr),Dr.add=vl,Dr.attempt=Zs,Dr.camelCase=Bs,Dr.capitalize=Us,Dr.ceil=yl,Dr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=gs(n))==n?n:0),t!==r&&(t=(t=gs(t))==t?t:0),an(gs(e),t,n)},Dr.clone=function(e){return sn(e,4)},Dr.cloneDeep=function(e){return sn(e,5)},Dr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:r)},Dr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:r)},Dr.conformsTo=function(e,t){return null==t||ln(e,t,Ts(t))},Dr.deburr=Vs,Dr.defaultTo=function(e,t){return null==e||e!=e?t:e},Dr.divide=bl,Dr.endsWith=function(e,t,n){e=vs(e),t=li(t);var i=e.length,o=n=n===r?i:an(fs(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Dr.eq=za,Dr.escape=function(e){return(e=vs(e))&&q.test(e)?e.replace(W,tr):e},Dr.escapeRegExp=function(e){return(e=vs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Dr.every=function(e,t,n){var i=Ha(e)?It:fn;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Dr.find=ga,Dr.findIndex=Vo,Dr.findKey=function(e,t){return jt(e,so(t,3),bn)},Dr.findLast=ma,Dr.findLastIndex=Ho,Dr.findLastKey=function(e,t){return jt(e,so(t,3),wn)},Dr.floor=wl,Dr.forEach=va,Dr.forEachRight=ya,Dr.forIn=function(e,t){return null==e?e:vn(e,so(t,3),Os)},Dr.forInRight=function(e,t){return null==e?e:yn(e,so(t,3),Os)},Dr.forOwn=function(e,t){return e&&bn(e,so(t,3))},Dr.forOwnRight=function(e,t){return e&&wn(e,so(t,3))},Dr.get=ks,Dr.gt=Ba,Dr.gte=Ua,Dr.has=function(e,t){return null!=e&&go(e,t,An)},Dr.hasIn=As,Dr.head=Wo,Dr.identity=rl,Dr.includes=function(e,t,r,n){e=Wa(e)?e:zs(e),r=r&&!n?fs(r):0;var i=e.length;return r<0&&(r=mr(i+r,0)),as(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&zt(e,t,r)>-1},Dr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fs(r);return i<0&&(i=mr(n+i,0)),zt(e,t,i)},Dr.inRange=function(e,t,n){return t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,r){return e>=vr(t,r)&&e<mr(t,r)}(e=gs(e),t,n)},Dr.invoke=Fs,Dr.isArguments=Va,Dr.isArray=Ha,Dr.isArrayBuffer=$a,Dr.isArrayLike=Wa,Dr.isArrayLikeObject=Ga,Dr.isBoolean=function(e){return!0===e||!1===e||es(e)&&Sn(e)==m},Dr.isBuffer=qa,Dr.isDate=Ya,Dr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Dr.isEmpty=function(e){if(null==e)return!0;if(Wa(e)&&(Ha(e)||"string"==typeof e||"function"==typeof e.splice||qa(e)||ls(e)||Va(e)))return!e.length;var t=po(e);if(t==x||t==A)return!e.size;if(_o(e))return!Ln(e).length;for(var r in e)if(Re.call(e,r))return!1;return!0},Dr.isEqual=function(e,t){return On(e,t)},Dr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?On(e,t,r,n):!!i},Dr.isError=Xa,Dr.isFinite=function(e){return"number"==typeof e&&$t(e)},Dr.isFunction=Ka,Dr.isInteger=Za,Dr.isLength=Ja,Dr.isMap=ts,Dr.isMatch=function(e,t){return e===t||Pn(e,t,co(t))},Dr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Pn(e,t,co(t),n)},Dr.isNaN=function(e){return rs(e)&&e!=+e},Dr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mn(e)},Dr.isNil=function(e){return null==e},Dr.isNull=function(e){return null===e},Dr.isNumber=rs,Dr.isObject=Qa,Dr.isObjectLike=es,Dr.isPlainObject=ns,Dr.isRegExp=is,Dr.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=u},Dr.isSet=os,Dr.isString=as,Dr.isSymbol=ss,Dr.isTypedArray=ls,Dr.isUndefined=function(e){return e===r},Dr.isWeakMap=function(e){return es(e)&&po(e)==F},Dr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Sn(e)},Dr.join=function(e,t){return null==e?"":pr.call(e,t)},Dr.kebabCase=Hs,Dr.last=Xo,Dr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=fs(n))<0?mr(i+o,0):vr(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):Dt(e,Ut,o,!0)},Dr.lowerCase=$s,Dr.lowerFirst=Ws,Dr.lt=cs,Dr.lte=us,Dr.max=function(e){return e&&e.length?pn(e,rl,kn):r},Dr.maxBy=function(e,t){return e&&e.length?pn(e,so(t,2),kn):r},Dr.mean=function(e){return Vt(e,rl)},Dr.meanBy=function(e,t){return Vt(e,so(t,2))},Dr.min=function(e){return e&&e.length?pn(e,rl,jn):r},Dr.minBy=function(e,t){return e&&e.length?pn(e,so(t,2),jn):r},Dr.stubArray=pl,Dr.stubFalse=gl,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=xl,Dr.nth=function(e,t){return e&&e.length?Vn(e,fs(t)):r},Dr.noConflict=function(){return dt._===this&&(dt._=ze),this},Dr.noop=sl,Dr.now=ka,Dr.pad=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Hi(gt(i),r)+e+Hi(ft(i),r)},Dr.padEnd=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;return t&&n<t?e+Hi(t-n,r):e},Dr.padStart=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;return t&&n<t?Hi(t-n,r)+e:e},Dr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),br(vs(e).replace(re,""),t||0)},Dr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bo(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=hs(e),t===r?(t=e,e=0):t=hs(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=wr();return vr(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return qn(e,t)},Dr.reduce=function(e,t,r){var n=Ha(e)?Mt:Wt,i=arguments.length<3;return n(e,so(t,4),r,i,dn)},Dr.reduceRight=function(e,t,r){var n=Ha(e)?Rt:Wt,i=arguments.length<3;return n(e,so(t,4),r,i,hn)},Dr.repeat=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),Yn(vs(e),t)},Dr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dr.result=function(e,t,n){var i=-1,o=(t=yi(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[No(t[i])];a===r&&(i=o,a=n),e=Ka(a)?a.call(e):a}return e},Dr.round=Cl,Dr.runInContext=e,Dr.sample=function(e){return(Ha(e)?Xr:Kn)(e)},Dr.size=function(e){if(null==e)return 0;if(Wa(e))return as(e)?cr(e):e.length;var t=po(e);return t==x||t==A?e.size:Ln(e).length},Dr.snakeCase=Gs,Dr.some=function(e,t,n){var i=Ha(e)?Lt:ni;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Dr.sortedIndex=function(e,t){return ii(e,t)},Dr.sortedIndexBy=function(e,t,r){return oi(e,t,so(r,2))},Dr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ii(e,t);if(n<r&&za(e[n],t))return n}return-1},Dr.sortedLastIndex=function(e,t){return ii(e,t,!0)},Dr.sortedLastIndexBy=function(e,t,r){return oi(e,t,so(r,2),!0)},Dr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ii(e,t,!0)-1;if(za(e[r],t))return r}return-1},Dr.startCase=qs,Dr.startsWith=function(e,t,r){return e=vs(e),r=null==r?0:an(fs(r),0,e.length),t=li(t),e.slice(r,r+t.length)==t},Dr.subtract=_l,Dr.sum=function(e){return e&&e.length?Gt(e,rl):0},Dr.sumBy=function(e,t){return e&&e.length?Gt(e,so(t,2)):0},Dr.template=function(e,t,n){var i=Dr.templateSettings;n&&bo(e,t,n)&&(t=r),e=vs(e),t=ws({},t,i,Zi);var o,a,s=ws({},t.imports,i.imports,Zi),l=Ts(s),c=Kt(s,l),u=0,d=t.interpolate||ye,h="__p += '",f=Ae((t.escape||ye).source+"|"+d.source+"|"+(d===K?ue:ye).source+"|"+(t.evaluate||ye).source+"|$","g"),p="//# sourceURL="+(Re.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(f,function(t,r,n,i,s,l){return n||(n=i),h+=e.slice(u,l).replace(be,rr),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=Re.call(t,"variable")&&t.variable;if(g){if(le.test(g))throw new Ce("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(U,""):h).replace(V,"$1").replace(H,"$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=Zs(function(){return _e(l,p+"return "+h).apply(r,c)});if(m.source=h,Xa(m))throw m;return m},Dr.times=function(e,t){if((e=fs(e))<1||e>u)return[];var r=h,n=vr(e,h);t=so(t),e-=h;for(var i=qt(n,t);++r<e;)t(r);return i},Dr.toFinite=hs,Dr.toInteger=fs,Dr.toLength=ps,Dr.toLower=function(e){return vs(e).toLowerCase()},Dr.toNumber=gs,Dr.toSafeInteger=function(e){return e?an(fs(e),-9007199254740991,u):0===e?e:0},Dr.toString=vs,Dr.toUpper=function(e){return vs(e).toUpperCase()},Dr.trim=function(e,t,n){if((e=vs(e))&&(n||t===r))return Yt(e);if(!e||!(t=li(t)))return e;var i=ur(e),o=ur(t);return wi(i,Jt(i,o),Qt(i,o)+1).join("")},Dr.trimEnd=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.slice(0,dr(e)+1);if(!e||!(t=li(t)))return e;var i=ur(e);return wi(i,0,Qt(i,ur(t))+1).join("")},Dr.trimStart=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.replace(re,"");if(!e||!(t=li(t)))return e;var i=ur(e);return wi(i,Jt(i,ur(t))).join("")},Dr.truncate=function(e,t){var n=30,i="...";if(Qa(t)){var o="separator"in t?t.separator:o;n="length"in t?fs(t.length):n,i="omission"in t?li(t.omission):i}var a=(e=vs(e)).length;if(nr(e)){var s=ur(e);a=s.length}if(n>=a)return e;var l=n-cr(i);if(l<1)return i;var c=s?wi(s,0,l).join(""):e.slice(0,l);if(o===r)return c+i;if(s&&(l+=c.length-l),is(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Ae(o.source,vs(de.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(li(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},Dr.unescape=function(e){return(e=vs(e))&&G.test(e)?e.replace($,hr):e},Dr.uniqueId=function(e){var t=++Le;return vs(e)+t},Dr.upperCase=Ys,Dr.upperFirst=Xs,Dr.each=va,Dr.eachRight=ya,Dr.first=Wo,al(Dr,(ml={},bn(Dr,function(e,t){Re.call(Dr.prototype,t)||(ml[t]=e)}),ml),{chain:!1}),Dr.VERSION="4.17.21",kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dr[e].placeholder=Dr}),kt(["drop","take"],function(e,t){Vr.prototype[e]=function(n){n=n===r?1:mr(fs(n),0);var i=this.__filtered__&&!t?new Vr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,h),type:e+(i.__dir__<0?"Right":"")}),i},Vr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),kt(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Vr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:so(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),kt(["head","last"],function(e,t){var r="take"+(t?"Right":"");Vr.prototype[e]=function(){return this[r](1).value()[0]}}),kt(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Vr.prototype[e]=function(){return this.__filtered__?new Vr(this):this[r](1)}}),Vr.prototype.compact=function(){return this.filter(rl)},Vr.prototype.find=function(e){return this.filter(e).head()},Vr.prototype.findLast=function(e){return this.reverse().find(e)},Vr.prototype.invokeMap=Xn(function(e,t){return"function"==typeof e?new Vr(this):this.map(function(r){return Fn(r,e,t)})}),Vr.prototype.reject=function(e){return this.filter(Ra(so(e)))},Vr.prototype.slice=function(e,t){e=fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vr.prototype.toArray=function(){return this.take(h)},bn(Vr.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Dr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Dr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Vr,c=s[0],u=l||Ha(t),d=function(e){var t=o.apply(Dr,Pt([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 Vr(this);var m=e.apply(t,s);return m.__actions__.push({func:ha,args:[d],thisArg:r}),new Ur(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),kt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Fe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ha(i)?i:[],e)}return this[r](function(r){return t.apply(Ha(r)?r:[],e)})}}),bn(Vr.prototype,function(e,t){var r=Dr[t];if(r){var n=r.name+"";Re.call(Fr,n)||(Fr[n]=[]),Fr[n].push({name:t,func:r})}}),Fr[zi(r,2).name]=[{name:"wrapper",func:r}],Vr.prototype.clone=function(){var e=new Vr(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Vr.prototype.reverse=function(){if(this.__filtered__){var e=new Vr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ha(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=vr(t,e+a);break;case"takeRight":e=mr(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=vr(l,this.__takeCount__);if(!r||!n&&i==l&&f==l)return fi(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},Dr.prototype.at=fa,Dr.prototype.chain=function(){return da(this)},Dr.prototype.commit=function(){return new Ur(this.value(),this.__chain__)},Dr.prototype.next=function(){this.__values__===r&&(this.__values__=ds(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Dr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var i=Do(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Dr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vr){var t=e;return this.__actions__.length&&(t=new Vr(this)),(t=t.reverse()).__actions__.push({func:ha,args:[Qo],thisArg:r}),new Ur(t,this.__chain__)}return this.thru(Qo)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,Je&&(Dr.prototype[Je]=function(){return this}),Dr}();ft?((ft.exports=fr)._=fr,ht._=fr):dt._=fr}).call(So)}(_o,_o.exports)),_o.exports);const Ao=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Io=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(Ao);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]},Eo=e=>{var t,r,n,i;const{state:o,actions:s,options:l}=po(),{searchTerm:d,sortBy:h,sortOrder:f,selectedFolder:p,pagination:g,pathHistory:m}=o,{setSearchTerm:v,setSortBy:y,setSortOrder:b,setPagination:w}=s,x=e||s.fetchFiles,C=u(null),_=u(ko.debounce(e=>{const t=JSON.stringify(e);C.current!==t&&(C.current=t,null==x||x(e))},150)).current,S=c(()=>{const e=p||"";if(!e)return;const t=[...Array.isArray(m)?m:[]].reverse().find(t=>t.id===e);return null==t?void 0:t.name},[p,m]),k=c(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:p||"",folderName:S(),search:(null==d?void 0:d.trim())||void 0,page:t?void 0:g.current,limit:t?void 0:g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}},[p,S,d,g.current,g.pageSize,h,f,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),A=c(e=>{var t,r;if(v&&v(e),w&&w({current:1,pageSize:g.pageSize,total:0}),x){const n={folderId:p||"",folderName:S(),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:g.pageSize,sortBy:h,sortOrder:f,itemType:"all"};x(n)}else console.error("🔎 useSortAndFilter: fetchFiles НЕ ОПРЕДЕЛЕНА!")},[v,w,g.pageSize,x,p,S,h,f,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),I=c((e,t)=>{var r,n;null==y||y(e),null==b||b(t),x&&_({folderId:p||"",folderName:S(),search:(null==d?void 0:d.trim())||void 0,page:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:g.current,limit:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:g.pageSize,sortBy:e,sortOrder:t,itemType:"all"})},[y,b,_,p,S,d,g.current,g.pageSize,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),E=c((e,t)=>{var r;(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)||(w&&w({current:e,pageSize:t||g.pageSize,total:g.total}),x&&_({folderId:p||"",folderName:S(),search:(null==d?void 0:d.trim())||void 0,page:e,limit:t||g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}))},[w,g.pageSize,g.total,_,p,S,d,h,f,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return a(()=>{if(x){const e=k();_(Object.assign(Object.assign({},e),{page:1}))}},[p]),a(()=>{x&&_(k())},[]),a(()=>()=>{var e;null===(e=_.cancel)||void 0===e||e.call(_)},[_]),{state:{searchTerm:d||"",sortBy:h||"name",sortOrder:f||"asc"},actions:{setSearchTerm:v||(()=>{}),setSortBy:y||(()=>{}),setSortOrder:b||(()=>{}),handleSearch:A,handleSort:I,handlePaginationChange:E,getCurrentQueryParams:k}}},Fo=new Map;function To(e){const t="id"in e&&void 0!==e.id?String(e.id):"unknown",r="data"in e?e.data:void 0;return`${e.type}:${t}:${function(e){if(null==e)return"";try{return JSON.stringify(e,Object.keys(e).sort())}catch(t){return String(e)}}(r)}`}const Oo=()=>{var e,t;const{notification:r}=I.useApp(),n=po(),{options:i}=n,o=c(async e=>{let t;if(i.handleNotify){try{t=await i.handleNotify(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&i.handleError){try{t=await i.handleError(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("success"===e.type&&i.handleSuccess){try{t=await i.handleSuccess(e)}catch(e){console.error(e)}if(t)return!1}return t},[i]),a=c(async function(e,t=!1){var n,a,s,l;try{void 0===e.visibility&&(e.visibility=!t);const c=await o(e);"object"==typeof c&&(e=c);const u=null!==(a=null===(n=i.config)||void 0===n?void 0:n.notificationDedupeTtlMs)&&void 0!==a?a:12e3,d="error"===e.type&&!0===e.notificationDedupe;d&&function(e,t){if(t<=0)return;const r=To(e),n=Date.now(),i=Fo.get(r);void 0!==i&&n-i<t&&(e.visibility=!1)}(e,u);if(!(!1!==e.visibility&&!1!==c&&!1!==(null===(s=i.config)||void 0===s?void 0:s.showNotifications)))return e;const h=r[e.type];"function"==typeof h?(h(e),d&&(l=e,u<=0||Fo.set(To(l),Date.now()))):console.warn(`Unknown notification type: ${e.type}`,e)}catch(e){console.error(e)}return e},[r,o,null===(e=i.config)||void 0===e?void 0:e.notificationDedupeTtlMs,null===(t=i.config)||void 0===t?void 0:t.showNotifications]);return d(()=>({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])},Po={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."},Mo={FileTooLarge:"File is too large to upload.",PayloadTooLarge:"File is too large to upload."},Ro=(e,t,r)=>{var n,i,o;if(!e)return;const a=Po[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=Mo[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})},Lo=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("размер")||t.includes("превышен")?"PayloadTooLarge":t.includes("403")||t.includes("forbidden")||t.includes("access denied")||t.includes("доступ запрещён")?"AuthorizationFailed":t.includes("404")||t.includes("not found")||t.includes("не найден")?"UploadUrlNotReachable":t.includes("already exists")||t.includes("уже существует")||t.includes("дубликат")?"FileAlreadyExists":t.includes("invalid")&&(t.includes("name")||t.includes("имя")||t.includes("назва"))?"FileInvalidName":t.includes("type")&&(t.includes("not allowed")||t.includes("не поддерживается"))?"FileTypeNotAllowed":void 0},No=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}};const jo=(e,t,r)=>{const n=No(e),i=null==n?void 0:n.code;if("FileTooLarge"===i&&null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize))return t("File too large ({{size}}). Maximum allowed size: {{maxSize}}",{size:li(r.fileSize),maxSize:li(r.maxSize)});if(("BatchItemLimitExceeded"===i||"exceeded_max_files"===i)&&(null==n?void 0:n.message)){const{allowed:e,received:r}=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}}(n.message);if(null!=e&&null!=r)return t("Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}",{allowed:e,received:r})}if((null==n?void 0:n.message)&&"Unknown error"!==n.message)return n.message;const o=null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize)?{fileSize:li(r.fileSize),maxSize:li(r.maxSize)}:void 0,a=Ro(i,t,o);return null!=a?a:t("Error uploading file")},Do=e=>{const t=No(e);return"path_folder_not_found"===(null==t?void 0:t.code)},zo=["file_get_contents","open stream","failed to open stream","http request failed","curl_error"];const Bo=(e,t,r)=>{var n;if(!e)return t("Error when downloading a file by URL");const i=null!==(n=(e=>{const t=Lo(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=Ro(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!zo.some(e=>t.includes(e))}(a)?a:t("Failed to download file from the URL.")},Uo=e=>Array.isArray(e)?e.filter(e=>(null==e?void 0:e.id)&&"folders"!==e.id).map(e=>e.name).filter(Boolean).join("/"):"",Vo=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},Ho=(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 Vo(a)||null}const o=No(e),a=null==o?void 0:o.message;if(!a)return null;const s=a.toLowerCase(),l=["не существует:","not exists:","not exist:","not found:"];for(const e of l){const t=s.indexOf(e);if(t>=0){const r=a.slice(t+e.length).trim();return Vo(r)||null}}const c=["not exists ","not exist ","not found "];for(const e of c){const t=s.indexOf(e);if(t>=0){const r=a.slice(t+e.length).trim();return Vo(r)||null}}return null})(e);return r?(e=>{const t=e.split("/").filter(Boolean);return t.length<=1?"":(t.pop(),t.join("/"))})(r):Uo(t)},$o=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}`)},Wo=()=>{var e,t;const{state:r,actions:i,options:o}=po(),{t:a}=Yn(),s=Oo(),{folders:l,selectedFolder:u,pathHistory:d,form:h,loading:f,isModalVisible:p}=r,{setFolders:g,setLoading:m,setIsModalVisible:v}=i,{dataProviders:y,config:b}=o,w=c(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})),[]),x=c(async(e=!1)=>{null==m||m(!0);try{let e=[];const t="lazy"===(null==b?void 0:b.folderTreeLoading);if(!(null==y?void 0:y.getFolders)){if(null==y?void 0:y.getFiles){const e=async r=>{const{files:n}=await y.getFiles({itemType:"folder",folderId:r||void 0}),i=w(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(g&&g(e=>{const n=Array.isArray(e)?e:[];if(!t){const e=r,t=e.filter(e=>e.id===e.parentId);return t.length>0&&console.warn("Folders with cyclic dependencies detected:",t),e}const i=n.filter(e=>e.parentId),o=[...i,...r],a=o.filter(e=>e.id===e.parentId);return a.length>0&&console.warn("Folders with cyclic dependencies detected:",a),o}))}return void console.error("DataProvider for folders is not defined")}{const r=!t;e=await y.getFolders({parentId:null,deep:r})}const r=Array.isArray(e)?e:[];null==g||g(r);const n=r.filter(e=>e.id===e.parentId);n.length>0&&console.warn("Folders with cyclic dependencies detected:",n)}catch(t){console.error("Error loading folders:",t);const r=No(t);if(!e&&(404===(null==r?void 0:r.status)||"FileNotFound"===(null==r?void 0:r.code))){const e=Ho(t,d||[]);try{return await $o({options:o,pathFolder:e,dataProviders:null==o?void 0:o.dataProviders}),void await x(!0)}catch(e){console.error("Cache clear failed:",e)}}const n=Ro(null==r?void 0:r.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=n?n:a("Failed to load folders"),description:a("Folders"),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{reason:t instanceof Error?t.message:String(t),folderId:null,folderName:a("Folders")}})}finally{null==m||m(!1)}},[null==y?void 0:y.getFiles,null==y?void 0:y.getFolders,g,m,null==b?void 0:b.folderTreeLoading,w,s,a,d,o]),C=c(()=>x(),[x]),_=c(async e=>{try{let t,r;if(null==y?void 0:y.getFolders){t=await y.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==y?void 0:y.getFiles))return[];{const{files:n}=await y.getFiles({itemType:"folder",folderId:e||void 0});t=w(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==g||g(n),t}catch(e){return console.error("Error loading child folders:",e),[]}},[y,l,g,w]),S=c(()=>{var e;const t=null!==(e=null==b?void 0:b.defaultFolderName)&&void 0!==e?e:a("New folder");h.setFieldsValue({folderName:t}),null==v||v(!0)},[h,v,a,null==b?void 0:b.defaultFolderName]),k=c(async(e,t)=>{const r=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==g||g(r),e.parentId&&(await _(e.parentId),await new Promise(e=>setTimeout(e,50))),!(null==t?void 0:t.preserveSelection)&&i.setSelectedFolder&&i.setSelectedFolder(e.id),!(null==t?void 0:t.preserveSelection)&&i.setPathHistory){const t=Array.isArray(r)?r:[],n=(e,r=new Set)=>{if(r.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const i=t.find(t=>t.id===e);if(!i)return[];const o=new Set(r);return o.add(e),i.parentId?[...n(i.parentId,o),{id:i.id,name:i.name}]:[{id:i.id,name:i.name}]},o=n(e.id),s=[{id:"folders",name:a("Folders")},...o];i.setPathHistory(s)}},[l,g,i,r.pathHistory,_,a]),A=c(async e=>{try{if(null==y?void 0:y.getFolders){const t=await y.getFolders(),r=Array.isArray(t)?t:[];return r.some(t=>t.id===e)}if(null==y?void 0:y.getFiles){const t=new Set,r=async n=>{const{files:i}=await y.getFiles({itemType:"folder",folderId:n||void 0}),o=w(i);for(const n of o){if(t.has(n.id))continue;if(t.add(n.id),n.id===e)return!0;if(await r(n.id))return!0}return!1};return await r(null)}}catch(e){console.warn("⚠️ Error checking the folder:",e)}return!1},[null==y?void 0:y.getFolders,null==y?void 0:y.getFiles,w]),I=c(async e=>{var t;let r,n,i=null;try{const o=await(e?e.validateFields():h.validateFields());if(r=o.folderName.trim(),!r){const e=o.targetFolder||(u&&"folders"!==u?u: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=zr(r,b);const c=o.targetFolder;if(c)i="folders"!==c?c:null;else if(u&&"folders"!==u)i=u;else if(Array.isArray(d)&&d.length>1){const e=d[d.length-1];i=(null==e?void 0:e.id)&&"folders"!==e.id?e.id:null}if(Br(b)&&(null==y?void 0:y.getFolders))try{const e=(await y.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==y?void 0:y.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 y.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 console.error("Circular dependency detected: folder cannot be its own parent"),new Error(a("Error: folder cannot be its own parent"))})(f);const p={id:f.id,name:f.name,parentId:null!=i?i:null,childCount:f.childCount},m=[...(Array.isArray(l)?l:[]).filter(e=>e.id!==p.id),p];if(null==g||g(m),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[p.id],folderId:null!==(t=p.parentId)&&void 0!==t?t:null,folderName:p.name}}),e||null==v||v(!1),(async()=>{try{await k(p,{preserveSelection:Boolean(e)}),await C(),await new Promise(e=>setTimeout(e,200));await A(f.id)||console.warn("⚠️ Could not confirm the creation of the folder on the server, but continuing...")}catch(e){console.error("Error performing background operations after creating the folder:",e)}})(),e)return f}catch(e){console.error("❌ Error creating the folder:",e);const t=No(e),o=Ro(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)}})}},[h,u,y,k,C,A,v,s,a,l,g,b,d]),E=c(()=>{null==v||v(!1)},[v]),F=c((e,t=new Set)=>{const r=Array.isArray(l)?l:[];return e.map(e=>{if(t.has(e.id))return console.warn(`Cycle detected in the folder structure with id=${e.id}. Skipping child elements processing.`),{key:e.id,label:e.name+" "+a("(error)"),icon:n.createElement(ve,{style:{color:"red"}})};const i=new Set(t);i.add(e.id);const o=r.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:o.length>0?F(o,i):void 0}})},[l]),T=c(()=>{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=F(r),[t]},[l,a,F]),O=c(async(e,t)=>{var r,n,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"}});d=zr(h,b);if(!(!1!==(null===(r=null==b?void 0:b.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!==(n=null==f?void 0:f.name)&&void 0!==n?n:d}});if(!(null===(c=o.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 o.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 C(),e!==p.id&&i.setSelectedFolder&&i.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){console.error("Error renaming the folder:",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)}}})}},[C,l,null===(e=o.dataProviders)||void 0===e?void 0:e.renameFolder,null===(t=null==b?void 0:b.features)||void 0===t?void 0:t.enableRenameFolder,b,i.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:p,loading:f},actions:{fetchFolders:C,fetchChildFolders:_,handleCreateFolder:S,handleModalOk:I,handleModalCancel:E,generateMenuItems:T,renameFolder:O}}},Go=()=>{const{options:e,actions:t}=po(),{dataProviders:r,config:n}=e,{setUndoDeletion:i}=t,{t:o}=Yn(),a=Oo(),s=c(async({items:e,selectedFolder:t,getItemNameById:s,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 Do(r)}),n=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return!Do(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=No(n);d.push({itemId:r,itemName:s(r),error:i})})}if(n.success)c+=e.length;else{const t=n.error;if(Do(t))c+=e.length;else if(t){u+=e.length;const r=No(t);d.push({error:r})}else u+=e.length}return}catch(r){if(Do(r))c+=e.length;else{const n=t?"Ошибка при удалении":"Ошибка при перемещении в корзину";console.error(n,r),u+=e.length;const i=No(r);d.push({error:i})}}const n=t?"DataProvider для удаления файлов не настроен":"DataProvider для перемещения не настроен";console.warn(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&&a.success({id:"FILES_DELETE_SUCCESS",message:o("Files deleted"),placement:"bottomRight",data:{successCount:c,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:t||null}}),u>0&&a.error({id:"FILES_DELETE_ERROR",message:o("Error when deleting a file"),placement:"bottomRight",data:{failCount:u,totalCount:e.length,itemIds:e.map(e=>e.id),itemNames:e.map(e=>s(e.id)),folderId:t||null,errors:d}})),{successCount:c,failCount:u,errorDetails:d}},[r,n,i,o,a]);return{deleteItems:s}};class qo 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,qo)}}const Yo=/^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i,Xo=/^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;function Ko(e,t){const r=e.trim();if(!r)throw new qo(t("Enter the URL of the image"),"UploadUrlInvalid");if(r.length>8192)throw new qo(t("URL too long"),"UploadUrlInvalid");let n;try{n=new URL(r)}catch(e){throw new qo(t("The specified URL is not valid."),"UploadUrlInvalid")}const i=n.protocol.toLowerCase();if("http:"!==i&&"https:"!==i)throw new qo(t("Only http and https URLs are supported"),"UploadUrlInvalid");const o=n.hostname.toLowerCase();if(Yo.test(o)&&("undefined"==typeof window||!Yo.test(window.location.hostname.toLowerCase())))throw new qo(t("Private and local URLs are not allowed"),"UploadUrlInvalid");if(Xo.test(o))throw new qo(t("Private and local URLs are not allowed"),"UploadUrlInvalid")}function Zo(e,t){return new Promise(function(r,n){let i;return Jo(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 Jo=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 Qo={},ea={get exports(){return Qo},set exports(e){Qo=e}};!function(){var e,t,r={};ea.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,k=65535&_;if(0!=_){k=65535&_;var A=s(S=_>>>16,a.of0);a.lhst[257+A]++;var I=s(k,a.df0);a.dhst[I]++,b+=a.exb[A]+a.dxb[I],f[m]=S<<23|c-d,f[m+1]=k<<16|A<<8|I,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 k=0;k<286;k++)b.lhst[k]=0;for(k=0;k<30;k++)b.dhst[k]=0;for(k=0;k<19;k++)b.ihst[k]=0;var A=C<_&&C<S?0:_<S?1:2;if(w(l,c,e),w(l,c+1,A),c+=3,0==A){for(;7&c;)c++;c=r.F._copyExact(o,a,s,l,c)}else{var I,E;if(1==A&&(I=b.fltree,E=b.fdtree),2==A){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),I=b.ltree,E=b.dtree,x(l,c,p-257),x(l,c+=5,g-1),x(l,c+=5,m-4),c+=4;for(var F=0;F<m;F++)x(l,c+3*F,b.itree[1+(b.ordr[F]<<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,O=0;O<n;O+=2){for(var P=t[O],M=P>>>23,R=T+(8388607&P);T<R;)c=r.F._writeLit(o[T++],I,l,c);if(0!=M){var L=t[O+1],N=L>>16,j=L>>8&255,D=255&L;x(l,c=r.F._writeLit(257+j,I,l,c),M-b.of0[j]),c+=b.exb[j],w(l,c=r.F._writeLit(D,E,l,c),N-b.df0[D]),c+=b.dxb[D],T+=M}}c=r.F._writeLit(256,I,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++);0!=o&&console.log("debt left")},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 k=1;for(S=0;S<b;S++){var A=a(e,_+3*S,3);d.itree[1+(d.ordr[S]<<1)]=A,A>k&&(k=A)}_+=3*b,l(d.itree,k),c(d.itree,k,d.imap),f=d.lmap,p=d.dmap,_=s(d.imap,(1<<k)-1,v+y,e,_,d.ttree);var I=i._copyOut(d.ttree,0,v,d.ltree);w=(1<<I)-1;var E=i._copyOut(d.ttree,v,y,d.dtree);x=(1<<E)-1,l(d.ltree,I),c(d.ltree,I,f),l(d.dtree,E),c(d.dtree,E,p)}for(;;){var F=f[u(e,_)&w];_+=15&F;var T=F>>>4;if(T>>>8==0)t[C++]=T;else{if(256==T)break;var O=C+T-254;if(T>264){var P=d.ldef[T-257];O=C+(P>>>3)+a(e,_,7&P),_+=7&P}var M=p[u(e,_)&x];_+=15&M;var R=M>>>4,L=d.ddef[R],N=(L>>>4)+o(e,_,15&L);for(_+=15&L,h&&(t=r.F._check(t,C+(1<<17)));C<O;)t[C]=t[C++-N],t[C]=t[C++-N],t[C]=t[C++-N],t[C]=t[C++-N];C=O}}}else{7&_&&(_+=8-(7&_));var j=4+(_>>>3),D=e[j-4]|e[j-3]<<8;h&&(t=r.F._check(t,C+D)),t.set(new n(e.buffer,e.byteOffset+j,D),C),_=j+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 ta=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:Qo},[Qo]);const ra=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 i=0;i<n;i++)o+=`%${e.pad(t[r+i].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 k=0;k<r;k++){var A=(_=255*(t[e+(k>>>3)]>>>7-(7&k)&1))==255*m?0:255;u[n+k]=A<<24|_<<16|_<<8|_}else if(2==h)for(k=0;k<r;k++)A=(_=85*(t[e+(k>>>2)]>>>6-((3&k)<<1)&3))==85*m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(4==h)for(k=0;k<r;k++)A=(_=17*(t[e+(k>>>1)]>>>4-((1&k)<<2)&15))==17*m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(8==h)for(k=0;k<r;k++)A=(_=t[e+k])==m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(16==h)for(k=0;k<r;k++)_=t[e+(k<<1)],A=f(t,e+(k<<1))==m?0:255,u[n+k]=A<<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 t=0;t<i;t++)if(c=r+t*l,u=c+t+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 r=0;r<u;r++)for(let o=0;o<c;o++)if(a>=0&&s>=0?(d=r*t+o<<2,h=(s+r)*i+a+o<<2):(d=(-s+r)*t-a+o<<2,h=r*i+o<<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 e=s.readUint(o,a);a+=4;const t=s.readASCII(o,a,4);if(a+=4,"IHDR"==t)l(o,a,d);else if("iCCP"==t){for(var y=a;0!=o[y];)y++;s.readASCII(o,a,y-a),o[y+1];const r=o.slice(y+2,a+e);let l=null;try{l=n(r)}catch(e){l=i(r)}d.tabs[t]=l}else if("CgBI"==t)d.tabs[t]=o.slice(a,a+4);else if("IDAT"==t){for(v=0;v<e;v++)h[p+v]=o[a+v];p+=e}else if("acTL"==t)d.tabs[t]={num_frames:u(o,a),num_plays:u(o,a+4)},f=new Uint8Array(o.length);else if("fcTL"==t){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"==t){for(v=0;v<e-4;v++)f[g+v]=o[a+v+4];g+=e-4}else if("pHYs"==t)d.tabs[t]=[s.readUint(o,a),s.readUint(o,a+4),o[a+8]];else if("cHRM"==t)for(d.tabs[t]=[],v=0;v<8;v++)d.tabs[t].push(s.readUint(o,a+4*v));else if("tEXt"==t||"zTXt"==t){null==d.tabs[t]&&(d.tabs[t]={});var b=s.nextZero(o,a),w=s.readASCII(o,a,b-a),x=a+e-b-1;if("tEXt"==t)_=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[t][w]=_}else if("iTXt"==t){null==d.tabs[t]&&(d.tabs[t]={}),b=0,y=a,b=s.nextZero(o,y),w=s.readASCII(o,y,b-y);const r=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=e-((y=b+1)-a),0==r?_=s.readUTF8(o,y,x):(C=n(o.slice(y,y+x)),_=s.readUTF8(C,0,C.length)),d.tabs[t][w]=_}else if("PLTE"==t)d.tabs[t]=s.readBytes(o,a,e);else if("hIST"==t){const e=d.tabs.PLTE.length/3;for(d.tabs[t]=[],v=0;v<e;v++)d.tabs[t].push(c(o,a+2*v))}else if("tRNS"==t)3==d.ctype?d.tabs[t]=s.readBytes(o,a,e):0==d.ctype?d.tabs[t]=c(o,a):2==d.ctype&&(d.tabs[t]=[c(o,a),c(o,a+2),c(o,a+4)]);else if("gAMA"==t)d.tabs[t]=s.readUint(o,a)/1e5;else if("sRGB"==t)d.tabs[t]=o[a];else if("bKGD"==t)0==d.ctype||4==d.ctype?d.tabs[t]=[c(o,a)]:2==d.ctype||6==d.ctype?d.tabs[t]=[c(o,a),c(o,a+2),c(o,a+4)]:3==d.ctype&&(d.tabs[t]=o[a]);else if("IEND"==t)break;a+=e,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}=ra,{_bin:t}=ra,r=ra._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 s=0;s<r;s++)for(let w=0;w<t;w++){var b;h=4*(s*t+w),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&s)+(3&w)],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&&(w!=t-1&&i(_,v,h+4,7),s!=r-1&&(0!=w&&i(_,v,h+4*t-4,3),i(_,v,h+4*t,5),w!=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={},k=[],A=[];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++)k.push(r.plte[x].est.rgba);let n=0;for(x=0;x<_.length;x++){const e=(E=_[x]).img.length;var I=new Uint8Array(r.inds.buffer,n>>2,e>>2);A.push(I);const t=new Uint8Array(r.abuf,n,e);p&&s(E.img,E.rect.width,E.rect.height,k,t,I),E.img.set(t),n+=e}}else for(b=0;b<_.length;b++){var E=_[b];const e=new Uint32Array(E.img.buffer);var F=E.rect.width;for(w=e.length,I=new Uint8Array(w),A.push(I),x=0;x<w;x++){const t=e[x];if(0!=x&&t==e[x-1])I[x]=I[x-1];else if(x>F&&t==e[x-F])I[x]=I[x-F];else{let e=S[t];if(null==e&&(S[t]=e=k.length,k.push(t),k.length>=300))break;I[x]=e}}}const T=k.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++){(E=_[b]).rect.x,E.rect.y,F=E.rect.width;const e=E.rect.height;let t=E.img;new Uint32Array(t.buffer);let r=4*F,n=4;if(T<=256&&0==f){r=Math.ceil(v*F/8);var O=new Uint8Array(r*e);const i=A[b];for(let t=0;t<e;t++){x=t*r;const e=t*F;if(8==v)for(var P=0;P<F;P++)O[x+P]=i[e+P];else if(4==v)for(P=0;P<F;P++)O[x+(P>>1)]|=i[e+P]<<4-4*(1&P);else if(2==v)for(P=0;P<F;P++)O[x+(P>>2)]|=i[e+P]<<6-2*(3&P);else if(1==v)for(P=0;P<F;P++)O[x+(P>>3)]|=i[e+P]<<7-1*(7&P)}t=O,m=3,n=1}else if(0==C&&1==_.length){O=new Uint8Array(F*e*3);const i=F*e;for(x=0;x<i;x++){const e=3*x,r=4*x;O[e]=t[r],O[e+1]=t[r+1],O[e+2]=t[r+2]}t=O,m=2,n=3,r=3*F}E.img=t,E.bpl=r,E.bpp=n}return{ctype:m,depth:v,plte:k,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=ta;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 o=t;o<r;o+=4){const t=e[o]*(1/255),r=e[o+1]*(1/255),a=e[o+2]*(1/255),s=e[o+3]*(1/255);i[0]+=t,i[1]+=r,i[2]+=a,i[3]+=s,n[0]+=t*t,n[1]+=t*r,n[2]+=t*a,n[3]+=t*s,n[5]+=r*r,n[6]+=r*a,n[7]+=r*s,n[10]+=a*a,n[11]+=a*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 e=0;e<16&&(h=d.multVec(u,h),p=Math.sqrt(d.dot(h,h)),h=d.sml(1/p,h),!(0!=e&&Math.abs(p-f)<1e-9));e++)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]]};ra.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)},ra.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 n=0;n<e.length;n++)u.frames.push({rect:{x:0,y:0,width:t,height:r},img:new Uint8Array(e[n]),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)},ra.encode.compress=u,ra.encode.dither=s,ra.quantize=g,ra.quantize.getKDtree=m,ra.quantize.getNearest=v}();const na={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,na._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var ia={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},oa={[ia.CHROME]:16384,[ia.FIREFOX]:11180,[ia.DESKTOP_SAFARI]:16384,[ia.IE]:8192,[ia.IOS]:4096,[ia.ETC]:8192};const aa="undefined"!=typeof window,sa="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,la=aa&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),ca=(aa||sa)&&(la&&la.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),ua=(aa||sa)&&(la&&la.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function da(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 ha(e){return new Promise((t,r)=>{const n=new ua;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function fa(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function pa(){if(void 0!==pa.cachedResult)return pa.cachedResult;let e=ia.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=ia.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=ia.IOS:/Safari/i.test(t)?e=ia.DESKTOP_SAFARI:/Firefox/i.test(t)?e=ia.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=ia.IE),pa.cachedResult=e,pa.cachedResult}function ga(e,t){const r=pa(),n=oa[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 ma(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 va(e,t){const{width:r,height:n}=ga(e.width,e.height),[i,o]=ma(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 ya(){return void 0!==ya.cachedResult||(ya.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),ya.cachedResult}function ba(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=va(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 ha(e).then(function(e){try{return t=e,fa(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(ya()||[ia.DESKTOP_SAFARI,ia.MOBILE_SAFARI].includes(pa()))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 wa(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=ra.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=>na.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),da(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 xa(e){e.width=0,e.height=0}function Ca(){return new Promise(function(e,t){let r,n,i,o;return void 0!==Ca.cachedResult?e(Ca.cachedResult):da("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,ba(r).then(function(a){try{return n=a[1],wa(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,xa(n),ba(i).then(function(r){try{return o=r[0],Ca.cachedResult=1===o.width&&2===o.height,e(Ca.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 _a(e){return new Promise((t,r)=>{const n=new ua;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 Sa(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]=ma(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),xa(e)),a}function ka(e,t){const{width:r}=e,{height:n}=e,[i,o]=ma(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),xa(e),i}function Aa(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 k(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=e,t.onProgress(Math.min(o,100))}function A(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,k(),ba(e,t).then(function(r){try{return[,l]=r,k(),c=Sa(l,t),k(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return _a(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,k(),Ca().then(function(r){try{return d=r?c:ka(c,u),k(),h=t.initialQuality||1,f=t.fileType||e.type,wa(d,f,e.name,e.lastModified,h).then(function(r){try{{if(p=r,k(),g=p.size>s,m=p.size>e.size,!g&&!m)return A(100),n(p);var o;function u(){if(a--&&(b>s||b>v)){let t,r;return t=S?.95*_.width:_.width,r=S?.95*_.height:_.height,[x,C]=ma(t,r),C.drawImage(_,0,0,t,r),h*="image/png"===f?.85:.95,wa(x,f,e.name,e.lastModified,h).then(function(e){try{return w=e,xa(_),_=x,b=w.size,A(Math.min(99,Math.floor((y-b)/(y-s)*100))),u}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=u}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(u);function I(){return xa(_),xa(x),xa(c),xa(d),xa(l),A(100),n(w)}}}catch(E){return i(E)}}.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 Ia;function Ea(e,t){return new Promise((r,n)=>{Ia||(Ia=function(e){const t=[];return t.push(e),URL.createObjectURL(new Blob(t))}("\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"));const i=new Worker(Ia);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}})})}function Fa(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 ca))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 Aa(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 Aa(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",Ea(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=Zo(e,o))}catch(e){}return r(o)}})}function Ta(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=Ar(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=Ar(t),r=Fr(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"}}Fa.getDataUrlFromFile=ha,Fa.getFilefromDataUrl=da,Fa.loadImage=fa,Fa.drawImageInCanvas=va,Fa.drawFileInCanvas=ba,Fa.canvasToFile=wa,Fa.getExifOrientation=_a,Fa.handleMaxWidthOrHeight=Sa,Fa.followExifOrientation=ka,Fa.cleanupCanvasMemory=xa,Fa.isAutoOrientationInBrowser=Ca,Fa.approximateBelowMaximumCanvasSizeOfBrowser=ga,Fa.copyExifWithoutOrientation=Zo,Fa.getBrowserName=pa,Fa.version="2.0.2";const Oa={MAX_SIZE_MB:.48,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8},Pa=["gif","svg"];function Ma(e,t,r,n){return new File([e],t,{type:r,lastModified:n})}function Ra(e,t){return t&&t!==e.name?Ma(e,t,e.type,e.lastModified):e}async function La(e,t={}){const{maxSizeMB:r=Oa.MAX_SIZE_MB,maxWidthOrHeight:n=Oa.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:o,libURL:a,enableCompression:s=!0}=t;if(!(e&&e instanceof File))return e;const l=Ar(e.type||i||"image/jpeg");if(!l.startsWith("image/"))return Ra(e,o);const c="image/webp"===(u=l)?"image/jpeg":u;var u;const d=Fr(l),h=Fr(c),f=c!==l?function(e,t){const r=t.startsWith(".")?t.slice(1):t,n=e.lastIndexOf(".");return n>0?`${e.substring(0,n)}.${r}`:`${e}.${r}`}(null!=o?o:e.name,h):null!=o?o:e.name,p=s&&(g=d,!Pa.includes(g));var g;if(!p&&!(c!==l))return Ra(e,f);try{const t={libURL:a,useWebWorker:!0,fileType:c};p?(t.maxSizeMB=r,t.maxWidthOrHeight=n):(t.maxSizeMB=Math.max(e.size/1048576+1,1),t.initialQuality=1,t.alwaysKeepResolution=!0);const i=await Fa(e,t);return function(e,t,r,n){const i=null!=n?n:t.name;return e instanceof File?e.type!==r||e.lastModified!==t.lastModified||e.name!==i?Ma(e,i,r,t.lastModified):e:Ma(e,i,r,t.lastModified)}(i,e,Ar(i.type||c),f)}catch(t){console.error("prepareImageForUpload failed",t);try{return Ra(e,f)}catch(t){return console.error("Failed to create File with normalized name after image preparation error",t),e}}}async function Na(e){const{folderId:t,dataProviders:r,folders:n,pathHistory:i,t:o}=e,a=null==t?"":String(t);if(!a||"folders"===a)return o("Folders");if("Trash"===a)return o("Trash");const s=i||[],l=s[s.length-1];if((null==l?void 0:l.id)===a&&l.name)return l.name;const c=[...s].reverse().find(e=>e.id===a);if(null==c?void 0:c.name)return c.name;const u=null==r?void 0:r.getItem;if(u)try{const e=await Promise.resolve(u(a));if(null==e?void 0:e.name)return e.name}catch(e){}const d=null==n?void 0:n.find(e=>e.id===a);return(null==d?void 0:d.name)?d.name:a}const ja=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function Da(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])=>!ja.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 za(e){return!!(null==e?void 0:e.startsWith("image/"))&&"image/gif"!==e}function Ba(e,t){if(t===e.name)return e;try{return new File([e],t,{type:e.type,lastModified:e.lastModified})}catch(t){return console.warn("Failed to create normalized File:",t),e}}function Ua(e){return null==e||""===e||"folders"===e?null:e}async function Va(e){const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new qo(`HTTP ${t.status}`,"UploadUrlDownloadFailed",t.status);return t.blob()}const Ha=()=>{var e,t,r,n;const{state:o,actions:a,options:s}=po(),l=Eo(),{sortBy:u,sortOrder:d}=l.state,{actions:{fetchFolders:h}}=Wo(),{t:f}=Yn(),p=Oo(),{deleteItems:g}=Go(),{selectedFolder:m,urlForm:v,pagination:y,files:b,pathHistory:w,folders:x}=o,C=i.useRef(null),_=i.useRef([]);C.current=y,_.current=Array.isArray(b)?b:[];const S=i.useRef(null),{setFiles:k,setLoading:A,setIsUrlModalVisible:I,setActiveLibraryItem:E,setPagination:F,setSelectedFolder:T,setPathHistory:O}=a,{dataProviders:P}=s,M=c(async e=>{var t,r,n;if(!(null==P?void 0:P.getFiles))return[];const i=null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.disablePagination,{files:o,pagination:a}=await P.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,noFolder:null==e?void 0:e.noFolder,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 F&&((null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.disablePagination)?F({current:1,pageSize:o.length||1,total:o.length||0}):a&&F({current:a.page,pageSize:a.limit,total:a.total})),o},[P,null===(e=null==s?void 0:s.config)||void 0===e?void 0:e.disablePagination,F]),R=c(async(e,t,r)=>hi(P,e,t,r,Br(null==s?void 0:s.config)),[P,null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient]),L=c(async(e,t=!1)=>{var r,n,i;try{null==A||A(!0);let t=[];if(!(null==P?void 0:P.getFiles))return void console.error("DataProvider for getting files is not defined");t=await M(e);const r=null!=e?e:{folderId:m||"",itemType:"all"};"file"!==r.itemType&&(t=await Io(t,r,null==P?void 0:P.getFolders)),"Trash"!==(m||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==k||k(t);const n=Ua(r.folderId);if(n===Ua(m)){const e=Array.isArray(w)?w:[];S.current={selectedFolder:null!=m?m:null,pathHistory:e.map(e=>Object.assign({},e))}}}catch(o){if("StaleLoad"===(null==o?void 0:o.name))return;const a=No(o),l=404===(null==a?void 0:a.status)||"FileNotFound"===(null==a?void 0:a.code)||"path_folder_not_found"===(null==a?void 0:a.code);if(l||console.error("Error loading files:",o),!t&&l){const t=Ho(o,w||[]);try{return await $o({options:s,pathFolder:t,dataProviders:null==s?void 0:s.dataProviders}),void await L(e,!0)}catch(e){console.error("Cache clear failed:",e)}}if(l&&T&&O){const t=Array.isArray(w)?w:[];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 O(n),T(o),await h(),p.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:f("Folder not found"),description:f("Navigated to parent folder"),placement:"bottomRight"}),void await L(Object.assign(Object.assign({},e),{folderId:o}),!1)}return O([{id:"folders",name:f("Folders")}]),T("folders"),await h(),p.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:f("Folder not found"),description:f("Navigated to root folder"),placement:"bottomRight"}),void await L(Object.assign(Object.assign({},e),{folderId:"folders"}),!1)}const c=S.current;if(c&&T&&O){const e=Array.isArray(w)?w:[],t=(null!==(n=c.selectedFolder)&&void 0!==n?n:null)===(null!=m?m:null),r=function(e,t){return e.length===t.length&&e.every((e,r)=>{var n;return e.id===(null===(n=t[r])||void 0===n?void 0:n.id)})}(c.pathHistory,e);t&&r||(T(c.selectedFolder),O(c.pathHistory.map(e=>Object.assign({},e))),s.onPathChange&&s.onPathChange(c.pathHistory.map(e=>e.name)))}const u=Ro(null==a?void 0:a.code,f),d=null!=e?e:{folderId:m||"",itemType:"all"},g=void 0!==d.folderId&&""!==d.folderId?d.folderId:m||"",v=Array.isArray(w)?w.map(e=>Object.assign({},e)):[],y=null===(i=d.folderName)||void 0===i?void 0:i.trim(),b=y&&y.length>0?y:await Na({folderId:g,dataProviders:P,folders:Array.isArray(x)?x:[],pathHistory:v,t:f}),C=f("Failed to load files"),_=f("Failed to load files in folder",{folderName:b}),k=u&&u!==C?u:void 0;p.error({id:"FILES_FETCH_FAILED",message:_,description:k,placement:"bottomRight",innerException:o,notificationDedupe:!0,data:{params:Object.assign(Object.assign({},d),{folderName:b}),folderName:b}})}finally{null==A||A(!1)}},[P,k,A,T,O,M,h,m,x,p,f,w,s]),N=c(e=>L(e),[L]),j=c(async(e,t)=>{var r;if(!(null==P?void 0:P.findFileByUrl))return null;const n=Da(e);try{return null!==(r=await P.findFileByUrl(n))&&void 0!==r?r:null}catch(e){return console.warn("findFileByUrl failed, falling back to direct loading",e),null}},[P]),D=c(async(e,t)=>{var r,n,i,o;Ko(e,f);const a=Da(e),l=await j(a,t);if(l)return{kind:"existing",file:l,normalizedUrl:a};let c,u;const d=null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.handleFileProxy,h=null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.handleProxyUrl,p=function(e){if("undefined"==typeof window)return!1;try{return new URL(e).origin===window.location.origin}catch(e){return!1}}(a);if(!p&&d)try{c=await Promise.resolve(d(a))}catch(e){u=e,console.warn("handleFileProxy failed, falling back to fetch",e)}if(!p&&!c&&h)try{const e=await Promise.resolve(h(a));c=await Va(e)}catch(e){u=e,console.warn("handleProxyUrl fetch failed, falling back to direct fetch",e)}if(!c)try{c=await Va(a)}catch(e){u=e}if(!(c instanceof Blob)||0===c.size)throw u instanceof Error?u:new qo(f("Failed to download file from the URL."),"UploadUrlDownloadFailed");const g=(null===(o=null===(i=c.type)||void 0===i?void 0:i.split(";")[0])||void 0===o?void 0:o.trim())||"image/png";if(!g.startsWith("image/"))throw new qo(f("Content type at the URL is not allowed."),"UploadUrlContentTypeNotAllowed");const m=Fr(g),v=function(e){try{const t=new URL(e).pathname.split("/").pop();return t?decodeURIComponent(t):void 0}catch(e){return}}(a)||"uploaded-file",y=v.replace(/\.[^.]+$/,"")||"uploaded-file";return{kind:"blob",blob:c,normalizedUrl:a,mimeType:g,extension:m,fileName:Dr(v.includes(".")?v:`${y}.${m}`,null==s?void 0:s.config)}},[j,null==s?void 0:s.config,f]),z=c(async(e,t)=>{var r,n;Ko(e,f);const i=Da(e);try{const e=await D(i,t);if("existing"===e.kind)return e.file;const r=await(s=e.blob,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(s)}));return{thumbnail:r,name:e.fileName,type:e.mimeType,extension:e.extension,size:e.blob.size,sourceUrl:e.normalizedUrl,saveWithoutFolder:!0}}catch(e){const s=No(e),l=(o=null==s?void 0:s.code,a="UploadUrlDownloadFailed","string"==typeof o?o:a),c=e instanceof qo?e:new qo(null!==(n=null!==(r=Ro(l,f))&&void 0!==r?r:null==s?void 0:s.message)&&void 0!==n?n:f("Failed to download file from the URL."),l,null==s?void 0:s.status);throw c.notificationShown=!0,await p.error({id:"EDITOR_PROXY_FILE_FAILED",message:c.message,placement:"bottomRight",data:{url:i,folderId:m||null,error:s,eventSource:"pixie"},innerException:e},t),c}var o,a,s},[j,p,null==s?void 0:s.config,m,f]),B=c(async e=>{const t=C.current;try{const r=_.current.find(t=>t.id===e),n=e=>{if(!e)return;const t=b.find(t=>t.id===e);return null==t?void 0:t.name};await g({items:[{id:e,isFolder:null==r?void 0:r.isFolder}],selectedFolder:m,getItemNameById:n,showNotifications:!0});const i=Object.assign({},t);let o=t.current;1===b.length&&(o=i.current>1?i.current-1:1),await N({folderId:m||"",page:o,limit:t.pageSize,sortBy:u,sortOrder:d})}catch(t){console.error("ОError when deleting a file:",t);const r=t;(null==r?void 0:r.notificationShown)||p.error({id:"FILES_DELETE_ERROR",message:f("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:m||null,errors:[{itemId:e,error:No(t)}]}})}},[g,N,m,f,p,b,u,d]),U=c(async e=>{try{const t=C.current;if(!(null==P?void 0:P.deleteFolder))return void p.error({id:"FOLDER_DELETE_ERROR",message:f("DataProvider for folder deletion is not configured"),placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await P.deleteFolder(e)){const e=new Error("Не удалось удалить папку");throw e.notificationShown=!1,e}p.success({id:"FOLDER_DELETE_SUCCESS",message:f("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}});m===e?await N({page:t.current,limit:t.pageSize,sortBy:u,sortOrder:d}):await N({folderId:m||"",sortBy:u,sortOrder:d,page:t.current,limit:t.pageSize})}catch(t){console.error("Error when deleting a folder:",t);const r=t;(null==r?void 0:r.notificationShown)||p.error({id:"FOLDER_DELETE_ERROR",message:f("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:No(t)}]}})}},[P,m,p,f,N,u,d]),V=c(async(e,t)=>{var r,n;try{if(null==P?void 0:P.getFileData){const t=await P.getFileData(e);if(t)return t;throw new Error(f("Failed to download file"))}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error(f("Error loading image"));return await t.blob()}}catch(i){console.error("Error when loading a file:",i);const o=_.current.find(t=>t.id===e);t||p.error({id:"FILE_DOWNLOAD_FAILED",message:f("Failed to download file"),placement:"bottomRight",description:(null==o?void 0:o.name)||e,innerException:i,notificationDedupe:!1,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)}},[P,p,f]),H=c(async(e,t,r,n)=>{var i,a,l,c,u,d,h,g,v,y,b,w,x,C,_;if("Trash"===(n?"":null!=t?t:m||""))throw new Error(f("Upload to Trash is forbidden"));const S=Dr(e.name,null==s?void 0:s.config),k=S.split(".").pop()||"",A=n?"":null!=t?t:m||"";let I=e;try{if(null===(a=null===(i=e.type)||void 0===i?void 0:i.startsWith)||void 0===a?void 0:a.call(i,"image/")){const t=null!==(c=null===(l=null==s?void 0:s.config)||void 0===l?void 0:l.compressMaxSize)&&void 0!==c?c:Oa.MAX_SIZE_MB,r=null!==(d=null===(u=null==s?void 0:s.config)||void 0===u?void 0:u.compressMaxWidthOrHeight)&&void 0!==d?d:2e3,n=null!==(g=null===(h=null==s?void 0:s.config)||void 0===h?void 0:h.compessorUrl)&&void 0!==g?g:null===(v=null==s?void 0:s.config)||void 0===v?void 0:v.compressorUrl;I=await La(e,{maxSizeMB:t,maxWidthOrHeight:r,mimeType:e.type,fileName:S,libURL:n,enableCompression:za(e.type)})}else I=Ba(e,S)}catch(t){console.warn("Image preparation failed, uploading original file",t),I=Ba(e,S)}let F=I.name;const T=Br(null==s?void 0:s.config);T&&(F=await R(F,A,n)),T&&(I=Ba(I,F));try{if(null==P?void 0:P.uploadFiles)try{const t=await P.uploadFiles({items:[{name:F,size:I.size,type:I.type||e.type,folderId:A,data:I,extension:k,noFolder:n}],folderId:A});if(t.success&&t.detailed&&t.detailed.length>0){const i=t.detailed[0];if(!i.success||!i.data){if(!r){const e=(null==i?void 0:i.error)?String(i.error):f("Failed to upload file");p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:S,innerException:null==i?void 0:i.error,data:{itemName:S,folderId:A||null,eventSource:"upload"}})}return void(E&&E(rr))}{const t=i.data;if(t.id){const r=(null!==(y=t.folderId)&&void 0!==y?y:A)||void 0;await N({folderId:r,noFolder:n});let i=o.files.find(e=>e.id===t.id);if(!i)try{i=(await M({folderId:r,noFolder:n,itemType:"file"})).find(e=>e.id===t.id)}catch(e){console.warn("uploadFileWithProvider: не удалось получить свежий список файлов",e)}return E&&E(rr),i||Object.assign(Object.assign({},t),{id:t.id,name:t.name||S,folderId:null!==(w=null!==(b=t.folderId)&&void 0!==b?b:A)&&void 0!==w?w:null,type:I.type||e.type,size:I.size,extension:k||S.split(".").pop()||"",thumbnail:null!==(x=t.thumbnail)&&void 0!==x?x:void 0,url:null!==(C=t.url)&&void 0!==C?C:void 0,thumbnailUrl:null!==(_=t.thumbnailUrl)&&void 0!==_?_:void 0,isFolder:!1,selected:!1})}}}else if(!t.success){if(!r){const e=t.error?String(t.error):f("Failed to upload file");p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:S,innerException:t.error,data:{itemName:S,folderId:A||null,eventSource:"upload"}})}return void(E&&E(rr))}return void(E&&E(rr))}catch(e){throw e}if(null==P?void 0:P.uploadFile){const t=await P.uploadFile({name:F,size:I.size,type:I.type||e.type,folderId:A,noFolder:n,data:I,extension:k});return E&&E(rr),t}return void(r||p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"}))}catch(e){const t=No(e),n=Ro(null==t?void 0:t.code,f);return r?void 0:void p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=n?n:f("Failed to upload file"),placement:"bottomRight",description:S,innerException:e,data:{itemName:S,folderId:A||null,error:No(e),eventSource:"upload"}})}},[P,m,E,o.files,N,M,p,f,null==s?void 0:s.config]),$=c(async(e,t)=>{var r;if(!(null==P?void 0:P.getFolders)||!(null==P?void 0:P.createFolder))return e||"";try{const n=await P.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 P.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 console.warn("ensureFolderPath: unable to guarantee the path",t),e||""}},[P]),W=c(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 $(t||"",r)||t||"")}return null!==(o=null!==(i=s)&&void 0!==i?i:t)&&void 0!==o?o:null},[$]);c(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 W(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)}},[W]);const G=c(async(e,t)=>{var r,n,i,o,a,l,c,u,d,h,g,v,y,b,w,x,C,_,S,k,A,I,F,T,O,M,R,L,N,j,D,z,B,U,V,H,$,G;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 q=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},Y=[];for(let r=0;r<e.length;r++){const w=e[r];if(!(null===(i=null===(n=w.type)||void 0===n?void 0:n.startsWith)||void 0===i?void 0:i.call(n,"image/"))){const e=await p.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:f("Unsupported file type"),placement:"bottomRight",data:{itemName:w.name,fileType:w.type,folderId:m||null}});null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,w.name,e.message);continue}const x=Dr(w.name,null==s?void 0:s.config);let C=w;try{if(null===(l=null===(a=w.type)||void 0===a?void 0:a.startsWith)||void 0===l?void 0:l.call(a,"image/")){const e=null!==(u=null===(c=null==s?void 0:s.config)||void 0===c?void 0:c.compressMaxSize)&&void 0!==u?u:Oa.MAX_SIZE_MB,t=null!==(h=null===(d=null==s?void 0:s.config)||void 0===d?void 0:d.compressMaxWidthOrHeight)&&void 0!==h?h:2e3,r=null!==(v=null===(g=null==s?void 0:s.config)||void 0===g?void 0:g.compessorUrl)&&void 0!==v?v:null===(y=null==s?void 0:s.config)||void 0===y?void 0:y.compressorUrl;C=await La(w,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:w.type,fileName:x,libURL:r,enableCompression:za(w.type)})}else C=Ba(w,x)}catch(e){console.warn("Image preparation failed, uploading original file",e),C=Ba(w,x)}const _=`${Date.now()}-${r}-${Math.random().toString(36).slice(2,8)}`,S=await W(C,m);null===(b=null==t?void 0:t.onStart)||void 0===b||b.call(t,C),Y.push({file:C,targetFolderId:S,requestId:_,originalFileName:w.name,originalIndex:r})}const X=Y.length;if(0===X)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const K=Br(null==s?void 0:s.config),Z=new Map;if(K&&(null==P?void 0:P.getFiles)){const e=[...new Set(Y.map(e=>{var t,r;return null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:m)&&void 0!==r?r:""}).filter(Boolean))];for(const t of e)try{const{files:e}=await P.getFiles({folderId:t||void 0,itemType:"file",page:1,limit:1e4});Z.set(t,(e||[]).map(e=>e.name))}catch(e){console.warn("Could not fetch files for duplicate check:",e)}}const J=new Map,Q=!t,ee=1===X&&Q,te=[],re=[],ne=[],ie=[],oe=new Map;let ae=0,se=0;const le=null!==(x=null===(w=null==s?void 0:s.config)||void 0===w?void 0:w.maxFileSize)&&void 0!==x?x:52428800,ce=async(e,r,n,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};ae++,te.push(e),re.push(null!=n?n:e),await((e,t,r,n)=>{var i;return p.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${f("File")} ${e} ${f("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:r,itemName:e,folderId:null!==(i=null!=t?t:m)&&void 0!==i?i:null,eventSource:"upload"}},n||!Q)})(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))},ue=async(e,r,n,i)=>{var o;const{emitProgress:a=!0,emitNotification:s=!0,fileSize:l,progressCallbackName:c,progressCallbackIndex:u}=null!=i?i:{};se++;const d=null!=l?{fileSize:l,maxSize:le}:void 0,h=await((e,t,r,n,i)=>{var o,a,s,l,c,u,d;const h=No(r),g=null!==(o=null==i?void 0:i.fileSize)&&void 0!==o?o:null==h?void 0:h.fileSize,v=null!==(s=null!==(a=null==i?void 0:i.maxSize)&&void 0!==a?a:null==h?void 0:h.maxSize)&&void 0!==s?s:le,y={allowedChars:"a-z A-Z 0-9 . _ -",fileSize:null!=g?li(Number(g)):void 0,maxSize:null!=v?li(Number(v)):void 0},b=null==h?void 0:h.code,w="BatchItemLimitExceeded"===b||"exceeded_max_files"===b?b:null!==(l=Lo(null==h?void 0:h.message))&&void 0!==l?l:b,x="BatchItemLimitExceeded"===w||"exceeded_max_files"===w?jo(r,f):Ro(w,f,y),C=(null==h?void 0:h.message)&&"string"==typeof h.message&&h.message.length>0?h.message:null,_=r instanceof Error?r.message:"string"==typeof r?r:null,S=_&&"[object Object]"!==_?_:null;return p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!==(u=null!==(c=null!=C?C:x)&&void 0!==c?c:S)&&void 0!==u?u:f("Error uploading file {{fileName}}",{fileName:e}),placement:"bottomRight",data:{itemName:e,folderId:null!==(d=null!=t?t:m)&&void 0!==d?d:null,error:No(r),eventSource:"upload"},innerException:r},n||!Q)})(e,r,n,!s,d);a&&(null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,null!=c?c:e,h.message,u)),ie.push({itemId:void 0,itemName:e,error:No(n)}),ne.push({fileName:e,error:h.message})};if(!(null==P?void 0:P.uploadFiles))return p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"}),{successCount:0,failCount:X,successes:[],errors:[],totalCount:X};{const e=[];try{(null==t?void 0:t.onProgress)&&Y.forEach(r=>{let n=0;const i=window.setInterval(()=>{var e;n=Math.min(n+10+Math.floor(Date.now()%10),90),null===(e=null==t?void 0:t.onProgress)||void 0===e||e.call(t,r.file.name,n)},200);e.push(i)});let r=await P.uploadFiles({items:Y.map(e=>{var t,r;const n=K?((e,t)=>{const r=null!=e?e:"";let n=Z.get(r)||[],i=J.get(r);i||(i=new Set(n.map(e=>e.toLowerCase())),J.set(r,i));const o=di(t,Array.from(i));return i.add(o.toLowerCase()),o})(e.targetFolderId,e.file.name):e.file.name,i=K?Ba(e.file,n):e.file;return{requestId:e.requestId,name:n,size:i.size,type:i.type,folderId:null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:m)&&void 0!==r?r:null,data:i,extension:i.name.split(".").pop()||""}}),folderId:null!=m?m:null});e.forEach(e=>window.clearInterval(e)),e.length=0;const n=null!==(C=r.detailed)&&void 0!==C?C:[],i=new Map(n.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(n.length>0)for(let e=0;e<Y.length;e++){const t=Y[e],r=null!==(_=t.requestId?i.get(t.requestId):void 0)&&void 0!==_?_:n[e];if(r&&r.success){const e=r.data,n=null!==(S=null==e?void 0:e.name)&&void 0!==S?S:Dr(t.file.name,null==s?void 0:s.config),i=null!==(I=null!==(A=null!==(k=null==e?void 0:e.folderId)&&void 0!==k?k:t.targetFolderId)&&void 0!==A?A:m)&&void 0!==I?I:null,o=null==e?void 0:e.id;oe.set(n,{id:o,name:n,folderId:i,size:null==e?void 0:e.size,originalFileName:t.originalFileName,originalIndex:t.originalIndex}),await ce(n,i,o,{emitNotification:ee})}else{const e=null==r?void 0:r.data,n=null!==(F=null==e?void 0:e.name)&&void 0!==F?F:Dr(t.file.name,null==s?void 0:s.config),i=null!==(M=null!==(O=null!==(T=null==e?void 0:e.folderId)&&void 0!==T?T:t.targetFolderId)&&void 0!==O?O:m)&&void 0!==M?M:null;await ue(n,i,null!==(R=null==r?void 0:r.error)&&void 0!==R?R:new Error(f("Error uploading file")),{emitNotification:ee,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}else if(r.success)for(const e of Y){const t=Dr(e.file.name,null==s?void 0:s.config),r=null!==(N=null!==(L=e.targetFolderId)&&void 0!==L?L:m)&&void 0!==N?N:null;await ce(t,r,void 0,{emitNotification:ee})}else{const e=null!==(j=r.error)&&void 0!==j?j:new Error(f("Error uploading file"));for(const t of Y){const r=Dr(t.file.name,null==s?void 0:s.config),n=null!==(z=null!==(D=t.targetFolderId)&&void 0!==D?D:m)&&void 0!==z?z:null;await ue(r,n,e,{emitNotification:ee,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}}catch(e){for(const t of Y){const r=Dr(t.file.name,null==s?void 0:s.config),n=null!==(U=null!==(B=t.targetFolderId)&&void 0!==B?B:m)&&void 0!==U?U:null;await ue(r,n,null!=e?e:new Error(f("Error uploading file")),{emitNotification:ee,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}finally{e.forEach(e=>window.clearInterval(e))}}if(ae>0&&(E&&E(rr),X>1&&Q)){const e=q(te),t=e?f("Uploaded",{names:e}):f("uploads_success_summary",{successCount:ae,totalCount:X});p.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:ae,totalCount:X,itemIds:re,itemNames:te,folderId:null!=m?m:null,eventSource:"upload"}})}if(se>0&&Q&&!ee)if(X>1){const e=ne.map(e=>e.fileName),t=q(e),r=t?f("Failed",{names:t}):f("uploads_fail_summary",{failCount:se,totalCount:X});p.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:se,totalCount:X,itemNames:e,folderId:null!=m?m:null,errors:ie,eventSource:"upload"}})}else if(1===X&&ie.length>0&&(null===(V=ie[0].error)||void 0===V?void 0:V.code)){const e=Ro(null===(H=ie[0].error)||void 0===H?void 0:H.code,f),t=null!==(G=null===($=ne[0])||void 0===$?void 0:$.fileName)&&void 0!==G?G:"",r=null!=e?e:t?`${f("Failed to upload files")}: ${t}`:f("Failed to upload files");p.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:se,totalCount:X,itemNames:[t],folderId:null!=m?m:null,errors:ie,eventSource:"upload"}})}return{successCount:ae,failCount:se,successes:te,errors:ne,totalCount:X,uploadedFiles:oe.size>0?oe:void 0}},[P,null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient,p,W,m,E,f,null==s?void 0:s.config]),q=c(async e=>{var t;if(!(null==P?void 0:P.uploadFiles))return void p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"});if("Trash"===m)return void p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}});const r=C.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==A||A(!0);const{successes:t,errors:i,uploadedFiles:a}=await G(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 h(),await N({folderId:m||"",sortBy:u,sortOrder:d,page:r.current,limit:r.pageSize})}catch(e){console.error("Error when loading files:",e)}finally{null==A||A(!1)}},n.click()},[null==P?void 0:P.uploadFiles,m,p,f,A,N,h,u,d,G,null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.features]),Y=c(async(e,t,r,n="uploadByUrl")=>{const i=C.current,o=Boolean(e&&String(e).trim());let a,l=null!=e?e:null;try{if(!t&&"Trash"===m)throw r||p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}}),new qo(f("Cannot upload files to Trash"),"UploadUrlDownloadFailed");let e,c;if(!l&&v&&(e=await v.validateFields(),l=null==e?void 0:e.fileUrl),!l)throw r||p.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:f("Please fill in all fields"),placement:"bottomRight",data:{url:null!=l?l:null,folderId:m||null,eventSource:n}}),new qo(f("Please fill in all fields"),"UploadUrlInvalid");if(Ko(l,f),l=Da(l),null==A||A(!0),l){const e=l.split("?")[0].split("#")[0].split("/");c=e[e.length-1]||"uploaded-file",c=Dr(c,null==s?void 0:s.config)}const h=t?"":m||"",g=Boolean((null==P?void 0:P.uploadFiles)||(null==P?void 0:P.uploadFile)),y=Boolean(null==P?void 0:P.uploadFileByUrl);let b=c;b&&y&&(b=await R(b,h,t));try{const e=await D(l,r);if("existing"===e.kind)a=e.file;else if(g){const r=new File([e.blob],e.fileName,{type:e.mimeType,lastModified:Date.now()});try{a=await H(r,h,!0,t)}catch(e){throw e.uploadUrlStage="binaryUpload",e}if(!a){const e=new qo(f("Failed to upload file"),"FileUploadBackendError");throw e.uploadUrlStage="binaryUpload",e}}else{if(!y)throw r||p.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:f("Upload by URL is not supported"),placement:"bottomRight",data:{url:l,folderId:m||null,eventSource:n}}),new qo(f("Upload by URL is not supported"),"UploadUrlDownloadFailed");a=await P.uploadFileByUrl({url:l,folderId:m||"",noFolder:t,name:b,eventSource:n})}}catch(e){const r=e;if("binaryUpload"===(null==r?void 0:r.uploadUrlStage)||!y)throw e;console.warn("Failed to fetch file by URL locally, falling back to uploadByUrl",e),a=await P.uploadFileByUrl({url:l,folderId:m||"",noFolder:t,name:b,eventSource:n})}const w=(null==e?void 0:e.name)||(null==a?void 0:a.name)||"unnamed file";return a&&p.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${f("File")} ${w} ${f("successfully uploaded")}`,placement:"bottomRight",data:{itemName:w,itemId:null==a?void 0:a.id,folderId:m||null,eventSource:n}},r),(e||o)&&(null==I||I(!1),null==v||v.resetFields()),E&&E(rr),await N({folderId:m||"",noFolder:t,sortBy:u,sortOrder:d,page:i.current,limit:i.pageSize}),a}catch(e){if(console.error("Error when loading a file by URL:",e),!r){const t=No(e),r=t,i=e,o=Number(null==r?void 0:r.fileSize),a=Number(null==r?void 0:r.maxSize),s=Number.isFinite(o)&&Number.isFinite(a)?{fileSize:o,maxSize:a}:void 0,c="binaryUpload"===(null==i?void 0:i.uploadUrlStage)?jo(t,f,s):Bo(t,f);p.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:c,placement:"bottomRight",data:{url:null!=l?l:null,folderId:m||null,error:t,eventSource:n},innerException:e})}throw e}finally{null==A||A(!1)}},[v,A,P,p,f,I,E,N,m,u,d,R,D,H,null==s?void 0:s.config]),X=c(async e=>{if(!e.length)return;const t=C.current;"Trash"!==m?(await G(e),await N({folderId:m||"",sortBy:u,sortOrder:d,page:t.current,limit:t.pageSize})):p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}})},[N,m,u,d,G,p,f]);return{fetchFiles:N,handleDeleteFile:B,handleDeleteFolder:U,handleAddFile:q,handleAddFileByUrl:Y,handleDroppedFiles:X,getFileData:V,findFileByUrl:j,resolveFileForEditByUrl:z,uploadFileWithProvider:H}},$a=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=(null!=n?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))},a=t=e(n,i,o);return o},Wa=e=>e;const Ga=e=>{const t=(e=>e?$a(e):$a)(e),r=e=>function(e,t=Wa){const r=i.useSyncExternalStore(e.subscribe,i.useCallback(()=>t(e.getState()),[e,t]),i.useCallback(()=>t(e.getInitialState()),[e,t]));return i.useDebugValue(r),r}(t,e);return Object.assign(r,t),r};function qa(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const Ya=(Xa=e=>({selectedFiles:new Set,visibleFileIds:[],anchorId:null,multiSelect:!0,setMultiSelect:t=>{e(e=>{var r;if(e.multiSelect===t)return e;if(t)return{multiSelect:!0};const n=null!==(r=Array.from(e.selectedFiles)[0])&&void 0!==r?r:null;return{multiSelect:!1,selectedFiles:n?new Set([n]):new Set,anchorId:n}})},syncVisibleFiles:t=>{const r=Array.isArray(t)?t.map(e=>e.id):[];e(e=>{const t=new Set(r),n=new Set(Array.from(e.selectedFiles).filter(e=>t.has(e))),i=e.anchorId&&t.has(e.anchorId)?e.anchorId:null,o=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}(e.visibleFileIds,r),a=qa(e.selectedFiles,n),s=e.anchorId===i;return o&&a&&s?e:{visibleFileIds:r,selectedFiles:n,anchorId:i}})},setSelectedFiles:t=>{e(e=>{var r;const n=new Set(e.visibleFileIds),i=new Set(Array.from(t).filter(e=>n.has(e)));return qa(e.selectedFiles,i)?e:{selectedFiles:i,anchorId:null!==(r=Array.from(i)[0])&&void 0!==r?r:null}})},clearSelection:()=>{e(e=>0===e.selectedFiles.size&&null===e.anchorId?e:{selectedFiles:new Set,anchorId:null})},selectAllVisible:()=>{e(e=>{var t;const r=new Set(e.visibleFileIds),n=null!==(t=e.visibleFileIds[0])&&void 0!==t?t:null;return qa(e.selectedFiles,r)&&e.anchorId===n?e:{selectedFiles:r,anchorId:n}})},toggleFileSelection:(t,r)=>{e(e=>{const n=!1!==e.multiSelect,i=Boolean(null==r?void 0:r.shiftKey)&&n,o=Boolean(null==r?void 0:r.metaKey)||Boolean(null==r?void 0:r.ctrlKey)||Boolean(null==r?void 0:r.forceToggle),a=e.visibleFileIds,s=new Set(a);if(a.length>0&&!s.has(t))return e;if(!n){const r=new Set([t]);return qa(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(i&&e.anchorId&&s.has(e.anchorId)){const r=a.indexOf(e.anchorId),n=a.indexOf(t);if(-1===r||-1===n)return e;const[i,s]=r<n?[r,n]:[n,r],l=a.slice(i,s+1),c=o?new Set(e.selectedFiles):new Set;return l.forEach(e=>{c.add(e)}),qa(e.selectedFiles,c)?e:{selectedFiles:c}}if(i&&!e.anchorId){const r=new Set([t]);return qa(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(o){const r=new Set(e.selectedFiles);return r.has(t)?r.delete(t):r.add(t),qa(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}const l=new Set([t]);return qa(e.selectedFiles,l)&&e.anchorId===t?e:{selectedFiles:l,anchorId:t}})}}),Xa?Ga(Xa):Ga);var Xa;const Ka=e=>{var t,r,n,i;const{state:o,actions:a,options:s}=po(),{t:l}=Yn(),u=Wo(),d=Oo(),{fetchFolders:h}=u.actions,{renameItem:f}=(()=>{const{options:e}=po(),{dataProviders:t}=e,{t:r}=Yn(),n=c(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=zr(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=Dr(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:No(e)}}},[t,r,e.config]);return{renameItem:n}})(),{files:p,selectedFolder:g,fileToRename:m,renameForm:v,isRenameModalVisible:y,pagination:b}=o,{setFileToRename:w,setIsRenameModalVisible:x}=a,{dataProviders:C,config:_}=s,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},k=(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)}},A=c(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:l("Folder rename is disabled by config"),placement:"bottomRight",data:k(n,e)});if(!(null==C?void 0:C.renameFolder))throw new Error(l("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:l("File rename is disabled by config"),placement:"bottomRight",data:k(n,e)});if(!(null==C?void 0:C.renameFile))throw new Error(l("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,l]),I=c(()=>{null==x||x(!1),null==w||w(null),null==v||v.resetFields()},[x,w,v]),E=c(async()=>{var t,r,n,i,o,s,c,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 A=(null==S?void 0:S.isFolder)||m.startsWith("folder_");if(A){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:l("Folder rename is disabled by config"),placement:"bottomRight",data:k(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:l("File rename is disabled by config"),placement:"bottomRight",data:k(S,m)})}const E=await f({itemId:m,newName:p.newFileName,isFolder:A});if(!E.success){const e=Ro(null===(n=E.error)||void 0===n?void 0:n.code,l);return void d.error({id:"ITEM_RENAME_FAILED",message:null!==(o=null!=e?e:null===(i=E.error)||void 0===i?void 0:i.message)&&void 0!==o?o:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{error:E.error}),innerException:E.error})}const F=E.renamedItem;A?(d.success({id:"FOLDER_RENAME_SUCCESS",message:l(`${l("Folder renamed to")} ${null!==(s=null==F?void 0:F.name)&&void 0!==s?s:p.newFileName}`),placement:"bottomRight",data:{itemId:null!==(c=null==F?void 0:F.id)&&void 0!==c?c:m,itemName:null!==(u=null==F?void 0:F.name)&&void 0!==u?u:p.newFileName,folderId:null!==(w=null!==(y=null==F?void 0:F.parentId)&&void 0!==y?y:null==F?void 0:F.folderId)&&void 0!==w?w:null}}),await h(),(null==F?void 0:F.id)&&F.id!==m&&a.setSelectedFolder&&a.setSelectedFolder(F.id)):d.success({id:"FILE_RENAME_SUCCESS",message:`${l("File renamed to")} ${null!==(x=null==F?void 0:F.name)&&void 0!==x?x:p.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{itemName:null!==(C=null==F?void 0:F.name)&&void 0!==C?C:p.newFileName})}),I(),await e({folderId:g||"",page:b.current,limit:b.pageSize})}catch(e){console.error("Error when renaming:",e);const t=No(e),r=Ro(null==t?void 0:t.code,l);d.error({id:"ITEM_RENAME_FAILED",message:null!=r?r:e instanceof Error?e.message:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{error:t}),innerException:e})}},[m,v,p,a,I,e,g,l,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:A,handleRenameCancel:I,handleRenameOk:E}}},Za=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}},Ja=(e,t,r,n,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:r,folderId:null!=n?n:null}),Qa=(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}),es=()=>{const e=Oo(),{t:t}=Yn(),{state:r,options:n}=po(),{folders:i,pathHistory:o}=r,{dataProviders:a}=n,{actions:{fetchFolders:s,fetchChildFolders:l}}=Wo();return{refreshFolders:c(async({parentIds:r,selectedFolder:n})=>{try{if(await s(),r&&l)for(const e of r)e&&await l(e)}catch(r){console.error("Error when updating the folder tree:",r);const n=t("Folders");e.error({id:"FOLDERS_FETCH_FAILED",message:t("Failed to refresh folder tree"),description:n,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{folderId:null,folderName:n,reason:r instanceof Error?r.message:String(r)}})}},[e,t,s,l]),refreshFiles:c(async({fetchFiles:r,selectedFolder:n,page:s,limit:l})=>{try{await r({folderId:n||"",page:s,limit:l})}catch(r){console.error("Ошибка при обновлении списка файлов:",r);const c=await Na({folderId:n||"",dataProviders:a,folders:Array.isArray(i)?i:[],pathHistory:o,t:t}),u=t("Failed to load files"),d=r instanceof Error?r.message:String(r);e.error({id:"FILES_FETCH_FAILED",message:t("Failed to load files in folder",{folderName:c}),description:d&&d!==u?d:void 0,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{params:{folderId:n||void 0,page:s,limit:l,folderName:c},folderName:c}})}},[e,t,a,i,o])}},ts=e=>{var t;const{state:r,actions:n,options:i}=po(),{t:o}=Yn(),a=Oo(),s=Ya(e=>e.selectedFiles),l=Ya(e=>e.clearSelection),{files:u,selectedFolder:d,moveForm:h,pagination:f,currentMenuFile:p}=r,{setIsMoveModalVisible:g,setPagination:m}=n,{dataProviders:v}=i,{moveItems:y}=(()=>{const{options:e}=po(),{dataProviders:t}=e,{t:r}=Yn(),n=Oo(),i=c(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=No(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=No(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=No(t);c.push({error:r})}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:b,refreshFiles:w}=es(),{getItemNameById:x,getItemNamesByIds:C,getNamesPreview:_}=Za(u),S=c(()=>{null==g||g(!0)},[g]),k=c(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),A=c(async t=>{var r,n,c,g,S,A,I,E;if(!((null==p?void 0:p.length)||s&&0!==s.size))return;const F=u.length,T=Object.assign({},f),O=Array.from((null==p?void 0:p.length)?[p]:s),P=O.length;let M=0,R=0;const L=[],N=O.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),j=N.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let s=t;if(!t){const e=await h.validateFields();s=null==e?void 0:e.targetFolder}if(!s)return void a.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:o("Select destination folder"),placement:"bottomRight"});const u="folders"===s?null:s,f=null!=u?u:d,p=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(p&&(null==v?void 0:v.getFolders))try{const e=await v.getFolders({parentId:u,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 e of N){if(!e.isFolder&&!(null===(c=(n=e.id).startsWith)||void 0===c?void 0:c.call(n,"folder_")))continue;const r=e.name||x(e.id)||"";if(r&&t.has(r.toLowerCase()))return void a.error({id:"FOLDER_ALREADY_EXISTS_MOVE",message:o("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,targetFolderId:s}})}}catch(e){console.warn("Could not check folder duplicates for move:",e)}if(p&&(null==v?void 0:v.getFiles)&&(null==v?void 0:v.renameFile))try{let e=[];if(null==v?void 0:v.getFiles){const{files:t}=await v.getFiles({folderId:u||void 0,itemType:"all",page:1,limit:1e4});e=(t||[]).map(e=>e.name).filter(e=>!!e)}if(null==v?void 0:v.getFolders){const t=(await v.getFolders({parentId:u,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 e of N){if(e.isFolder||(null===(S=(g=e.id).startsWith)||void 0===S?void 0:S.call(g,"folder_")))continue;const r=e.name||x(e.id)||"";if(!r||!t.has(r.toLowerCase())){t.add(r.toLowerCase());continue}const n=di(r,Array.from(t));await v.renameFile(e.id,n),t.add(n.toLowerCase())}}catch(e){console.warn("Could not check duplicates for move:",e)}const D=await y({items:N,targetFolderId:s,getItemNameById:x,showNotifications:!1});if(M=D.successCount,R=D.failCount,L.push(...D.errorDetails),M>0){const e=C(O),t=_(e),r=t?o("Moved",{names:t}):o("move_success_summary",{successCount:M,totalCount:P});a.success({id:"FILES_MOVE_SUCCESS",message:r,placement:"bottomRight",data:Ja(O,M,P,u,e)})}if(R>0){const e=C(O),t=_(e);let r;if(1===P&&L.length>0&&(null===(A=L[0].error)||void 0===A?void 0:A.code)){const e=Ro(null===(I=L[0].error)||void 0===I?void 0:I.code,o);r=null!=e?e:t?o("Failed",{names:t}):o("move_fail_summary",{failCount:R,totalCount:P})}else r=t?o("Failed",{names:t}):o("move_fail_summary",{failCount:R,totalCount:P});a.error({id:"FILES_MOVE_ERROR",message:r,placement:"bottomRight",innerException:L.length?L:void 0,data:Qa(O,R,P,u,L.length?L:void 0,e)})}k(),l();let z=T.current;if(M>0&&F>0&&M>=F&&T.current>1&&(z=T.current-1),M>0&&T.total>=M){const e=Math.max(0,(null!==(E=T.total)&&void 0!==E?E:0)-M);null==m||m({current:z,pageSize:T.pageSize,total:e})}j&&await b({parentIds:void 0,selectedFolder:f}),await w({fetchFiles:e,selectedFolder:d,page:z,limit:T.pageSize})}catch(e){console.error("Error when moving:",e);const t=Ro(No(e).code,o);a.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=t?t:o("Error moving"),placement:"bottomRight",data:Qa(O,P,P,d||null,[{error:No(e)}],C(O))})}},[p,s,h,e,d,f,u,a,m,o,y,l,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==v?void 0:v.getFiles,null==v?void 0:v.renameFile,x]);return{actions:{showMoveModal:S,handleMoveCancel:k,handleMoveOk:A}}},rs=e=>{var t;const{state:r,actions:n,options:i}=po(),{t:o}=Yn(),a=Oo(),s=Ya(e=>e.selectedFiles),l=Ya(e=>e.clearSelection),{files:u,selectedFolder:d,copyForm:h,pagination:f,currentMenuFile:p}=r,{setIsCopyModalVisible:g}=n,{dataProviders:m}=i,{copyItems:v}=(()=>{const{options:e}=po(),{dataProviders:t}=e,{t:r}=Yn(),n=Oo(),i=c(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=No(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=No(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=No(t);c.push({error:r})}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=No(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:y,refreshFiles:b}=es(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=Za(u),_=c(()=>{null==g||g(!0)},[g]),S=c(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),k=c(async t=>{var r,n,c,g,_;if(!((null==p?void 0:p.length)||s&&0!==s.size))return;const k=Array.from((null==p?void 0:p.length)?[p]:s),A=k.length;let I=0,E=0;const F=[],T=k.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),O=T.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let s=t;if(!t){const e=await h.validateFields();s=null==e?void 0:e.targetFolder}if(!s)return void a.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:o("Select destination folder"),placement:"bottomRight"});const u="folders"===s?null:s,p=null!=u?u:d;let P=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const M=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(M&&(null==m?void 0:m.getFolders))try{const e=await m.getFolders({parentId:u,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 e of T){if(!e.isFolder&&!(null===(c=(n=e.id).startsWith)||void 0===c?void 0:c.call(n,"folder_")))continue;const r=e.name||w(e.id)||"";if(r&&t.has(r.toLowerCase()))return void a.error({id:"FOLDER_ALREADY_EXISTS_COPY",message:o("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,targetFolderId:s}})}}catch(e){console.warn("Could not check folder duplicates for copy:",e)}if(M&&(null==m?void 0:m.getFiles))try{let e=[];const{files:t}=await m.getFiles({folderId:u||void 0,itemType:"all",page:1,limit:1e4});if(e=(t||[]).map(e=>e.name).filter(e=>!!e),null==m?void 0:m.getFolders){const t=(await m.getFolders({parentId:u,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const r=[...e];P=T.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=T.find(t=>t.id===e.id),o=(null==i?void 0:i.name)||w(e.id)||"",a=di(o,r);return r.push(a),{id:e.id,isFolder:!1,newName:a!==o?a:void 0}})}catch(e){console.warn("Could not check duplicates for copy:",e)}else P=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const R=await v({items:P,targetFolderId:s,getItemNameById:w,showNotifications:!1});if(I=R.successCount,E=R.failCount,F.push(...R.errorDetails),I>0){const e=x(k),t=C(e),r=t?o("Copied",{names:t}):o("copy_success_summary",{successCount:I,totalCount:A});a.success({id:"FILES_COPY_SUCCESS",message:r,placement:"bottomRight",data:Ja(k,I,A,u,e)})}if(E>0){const e=x(k),t=C(e);let r;if(1===A&&F.length>0&&(null===(g=F[0].error)||void 0===g?void 0:g.code)){const e=Ro(null===(_=F[0].error)||void 0===_?void 0:_.code,o);r=null!=e?e:t?o("Failed",{names:t}):o("copy_fail_summary",{failCount:E,totalCount:A})}else r=t?o("Failed",{names:t}):o("copy_fail_summary",{failCount:E,totalCount:A});a.error({id:"FILES_COPY_ERROR",message:r,placement:"bottomRight",innerException:F.length?F:void 0,data:Qa(k,E,A,u,F.length?F:void 0,e)})}S(),l(),O&&await y({parentIds:void 0,selectedFolder:p}),await b({fetchFiles:e,selectedFolder:d,page:f.current,limit:f.pageSize})}catch(e){console.error("Error when copying:",e);const t=Ro(No(e).code,o);a.error({id:"FILES_COPY_ERROR",message:null!=t?t:o("Error copying"),innerException:e,placement:"bottomRight",data:Qa(k,A,A,d||null,[{error:No(e)}],x(k))})}},[p,s,h,e,d,f,u,a,o,v,l,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==m?void 0:m.getFiles,w]);return{actions:{showCopyModal:_,handleCopyCancel:S,handleCopyOk:k}}},ns=e=>{const t=Ka(e),r=ts(e),n=rs(e),i=(e=>{const{state:t,actions:r,options:n}=po(),{t:i}=Yn(),o=Oo(),a=Ya(e=>e.selectedFiles),s=Ya(e=>e.clearSelection),{files:l,selectedFolder:u,pagination:d,currentMenuFile:h}=t,{setIsDeleteConfirmVisible:f,setUndoDeletion:p,setPagination:g}=r,{config:m}=n,{deleteItems:v}=Go(),{refreshFolders:y,refreshFiles:b}=es(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=Za(l),_=c(()=>{null==f||f(!0)},[f]),S=c(()=>{null==f||f(!1)},[f]),k=c(async()=>{var t,r,n;if(!((null==h?void 0:h.length)||a&&0!==a.size))return void(null==f||f(!1));const c=l.length,_=Object.assign({},d),S=Array.from(h?[h]:a),k=S.map(e=>l.find(t=>t.id===e)).filter(e=>Boolean(e)),A=new Set;k.forEach(e=>{(null==e?void 0:e.isFolder)&&A.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 I=0,E=0;const F=[];try{const a=await v({items:k,selectedFolder:u,getItemNameById:w,showNotifications:!1});I=a.successCount,E=a.failCount,F.push(...a.errorDetails);const l=(null==m?void 0:m.enableTrashFolder)&&"Trash"===u;if(I>0&&(null==m?void 0:m.enableTrashFolder)&&!l&&(null==p||p({itemIds:S,sourceFolderId:u||"folders"})),I>0){const e=S.length;(null==m?void 0:m.enableTrashFolder)&&!l?await o.success({id:"FILES_DELETE_SUCCESS",message:i("moved_to_trash",{count:I}),placement:"bottomRight",data:{successCount:I,totalCount:e,itemIds:S,folderId:u||null}}):await o.success({id:"FILES_DELETE_SUCCESS",message:i("Files deleted"),placement:"bottomRight",data:{successCount:I,totalCount:e,itemIds:S,folderId:u||null}})}if(E>0){const e=x(S),n=C(e),a=S.length,s=1===a&&F.length>0&&(null===(t=F[0].error)||void 0===t?void 0:t.code),c=(null==m?void 0:m.enableTrashFolder)&&!l,u=i(c?"При перемещении в корзину произошли ошибки":"При удалении произошли ошибки"),d=s?Ro(null===(r=F[0].error)||void 0===r?void 0:r.code,i):void 0,h=null!=d?d:n?i("Failed",{names:n}):u;o.error({id:"FILES_DELETE_ERROR",message:h,placement:"bottomRight",innerException:F.length?F:void 0,data:{failCount:E,isTrashMove:c,totalCount:a,itemNames:e,errors:F.length?F:void 0}})}s(),null==f||f(!1),await y({parentIds:Array.from(A),selectedFolder:u});let d=_.current;if(I>0&&c>0&&I>=c&&_.current>1&&(d=_.current-1),I>0&&_.total>=I){const e=Math.max(0,(null!==(n=_.total)&&void 0!==n?n:0)-I);null==g||g({current:d,pageSize:_.pageSize,total:e})}await b({fetchFiles:e,selectedFolder:u,page:d,limit:_.pageSize})}catch(e){console.error("Error when deleting:",e),o.error({id:"FILES_DELETE_ERROR",message:i("Error deleting"),placement:"bottomRight",innerException:e,data:{failCount:E,totalCount:k.length}})}},[h,a,f,e,u,d,p,g,l,i,o,v,s,null==m?void 0:m.enableTrashFolder]);return{actions:{showDeleteConfirm:_,handleDeleteConfirmCancel:S,handleDeleteConfirmOk:k}}})(e);return{state:t.state,actions:Object.assign(Object.assign(Object.assign(Object.assign({},t.actions),r.actions),n.actions),i.actions)}},is=()=>{const{state:e}=po(),{files:t,loading:r,isUrlModalVisible:n}=e,i=Ha(),o=(()=>{const{state:e}=po(),t=e.multiSelect,r=Ya(e=>e.selectedFiles),n=Ya(e=>e.toggleFileSelection),i=Ya(e=>e.setMultiSelect);return a(()=>{i(!1!==t)},[t,i]),{state:{selectedFiles:r},actions:{toggleFileSelection:n}}})(),s=ns(i.fetchFiles);return{state:{files:t||[],selectedFiles:o.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:o.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}}},os="filemanager_sidebar_width";function as({maxConcurrent:e=6}={}){const t=u(new Map),r=u([]),n=u(0),i=d(()=>{const i=e=>({status:e.status,shouldLoad:"loading"===e.status||"loaded"===e.status||"error"===e.status}),o=e=>{const t=i(e);e.listeners.forEach(e=>e(t))},a=e=>{0!==r.current.length&&(r.current=r.current.filter(t=>t!==e))},s=(e,r)=>{const n=t.current.get(e);if(!n){const n={id:e,src:r,status:"idle",listeners:new Set,active:!1};return t.current.set(e,n),n}return n.src!==r&&(a(e),n.src=r,n.status="idle"),n},l=()=>{for(;n.current<e&&r.current.length>0;){const e=r.current.shift();if(!e)break;const i=t.current.get(e);i&&i.active&&"queued"===i.status&&(i.status="loading",n.current+=1,o(i))}},c=(e,t)=>{"loading"===e.status&&(e.status=t,n.current=Math.max(0,n.current-1),o(e),l())};return{getSnapshot:(e,t)=>i(s(e,t)),subscribe:(e,r,n)=>{const o=s(e,r);return o.listeners.add(n),n(i(o)),()=>{const r=t.current.get(e);r&&(r.listeners.delete(n),r.active||0!==r.listeners.size||"loading"===r.status||t.current.delete(e))}},setActive:(e,t,i)=>{const c=s(e,t);c.active=i,i?"loaded"!==c.status&&"loading"!==c.status&&"queued"!==c.status?(c.status="queued",o(c),r.current.includes(e)||r.current.push(e),l()):o(c):"queued"===c.status?(a(e),c.status="idle",o(c)):"loading"===c.status&&(n.current=Math.max(0,n.current-1),c.status="idle",o(c),l())},markLoaded:e=>{const r=t.current.get(e);r&&c(r,"loaded")},markError:e=>{const r=t.current.get(e);r&&c(r,"error")},release:e=>{const r=t.current.get(e);r&&(r.active=!1,"queued"===r.status?(a(e),r.status="idle"):"loading"===r.status&&(n.current=Math.max(0,n.current-1),r.status="idle",l()),0===r.listeners.size&&t.current.delete(e))}}},[e]);return a(()=>()=>{r.current=[],t.current.clear(),n.current=0},[]),i}const ss=/(auto|scroll|overlay)/;function ls(e,t){const r=Math.max(0,null!=t?t:e.clientWidth);return Math.max(1,Math.round(r-function(e){if("undefined"==typeof window)return 0;const t=window.getComputedStyle(e);return(Number.parseFloat(t.paddingLeft||"0")||0)+(Number.parseFloat(t.paddingRight||"0")||0)}(e)))}function cs(e){if("undefined"==typeof window)return!1;const t=window.getComputedStyle(e);return ss.test(t.overflowY)||ss.test(t.overflow)||ss.test(t.overflowX)}function us(e){if("undefined"==typeof window)return e;let t=e;for(;t;){if(cs(t))return t;t=t.parentElement}return null}function ds(e){if("undefined"==typeof window)return[e];const t=us(e);return t?t===e?[window,e]:[window,t]:[window]}function hs(e,t,r){Math.max(0,e.clientHeight),Math.max(0,Math.round(e.getBoundingClientRect().height));return Math.max(1,t)}function fs(e,t){if(e===t){const r=function(e){var t;if("undefined"==typeof window)return Math.max(1,e.clientHeight);const r=e.getBoundingClientRect(),n=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,i=Math.max(0,r.top),o=Math.min(n,r.bottom);return Math.max(0,Math.round(o-i))}(t);return{scrollTop:t.scrollTop,viewportHeight:hs(e,Math.min(t.clientHeight,r||t.clientHeight)),viewportWidth:ls(t),scrollHeight:e.scrollHeight}}const r=t.getBoundingClientRect(),n=e.getBoundingClientRect(),i=Math.max(r.top,n.top),o=Math.min(r.bottom,n.bottom),a=Math.max(r.left,n.left),s=Math.min(r.right,n.right),l=Math.max(0,Math.round(o-i)),c=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(i-n.top)),viewportHeight:hs(e,l),viewportWidth:ls(e,c||t.clientWidth||e.clientWidth),scrollHeight:e.scrollHeight}}function ps(e){if("undefined"==typeof window)return{scrollTop:e.scrollTop,viewportHeight:Math.max(1,e.clientHeight),viewportWidth:ls(e),scrollHeight:e.scrollHeight};const t=us(e);return t&&function(e){return e.scrollHeight-e.clientHeight>1}(t)?fs(e,t):function(e){var t,r;const n=e.getBoundingClientRect(),i=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,o=window.innerWidth||(null===(r=document.documentElement)||void 0===r?void 0:r.clientWidth)||n.width,a=Math.max(0,n.top),s=Math.min(i,n.bottom),l=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(-n.top)),viewportHeight:hs(e,l),viewportWidth:ls(e,Math.min(Math.round(n.width),o)),scrollHeight:e.scrollHeight}}(e)}function gs(e,t){const r=u(null),n=c(t=>{e(ps(t))},[e]);return a(()=>{r.current&&n(r.current)},[n,...t]),a(()=>{if(!r.current||"undefined"==typeof ResizeObserver)return;const e=r.current,t=new ResizeObserver(()=>{n(e)});return t.observe(e),()=>t.disconnect()},[n]),a(()=>{const e=r.current;if(!e)return;const t=()=>{n(e)},i=ds(e);return i.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{i.forEach(e=>{e.removeEventListener("scroll",t)})}},[n,...t]),r}const ms=({onSearch:t,placeholder:r,className:n})=>{const{t:i}=Yn(),[s,l]=o(""),c=u(null),{options:d}=po(),{config:h}=d,f=r||i("Search files...");a(()=>(c.current=ko.debounce(e=>{t(e)},500),()=>{var e;null===(e=c.current)||void 0===e||e.cancel()}),[t]);return e(F,{value:s,onChange:e=>{var t;const r=e.target.value;l(r),null===(t=c.current)||void 0===t||t.call(c,r)},placeholder:f,prefix:e(Ti,{size:16,strokeWidth:null==h?void 0:h.iconStrokeWidth}),className:n,allowClear:!0,onClear:()=>{l(""),t("")}})},vs=[{value:"date-desc",labelKey:"Newest first"},{value:"date-asc",labelKey:"Oldest first"},{value:"size-desc",labelKey:"Largest first"},{value:"size-asc",labelKey:"Smallest first"},{value:"name-asc",labelKey:"A-Z"},{value:"name-desc",labelKey:"Z-A"},{value:"type-asc",labelKey:"By type"}];var ys={contentLayout:"contentLayout",headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",emptyStateWrapper:"emptyStateWrapper",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",tableLoadingWrapper:"tableLoadingWrapper",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:bs}=T,{Option:ws}=O;const xs=i.memo(({files:r,filesById:n,currentSortOption:i,isSmallScreen:o,iconStrokeWidth:a,multiSelectEnabled:s=!0,features:l,viewMode:c,setViewMode:u,handleSearch:h,handleSortOptionChange:f,sortOptions:p,onClearSelection:g,onRename:m,onDelete:v,onCopy:y,onMove:b,onEdit:w,t:x})=>{const C=d(()=>(null==p?void 0:p.length)?vs.filter(e=>p.includes(e.value)):vs,[p]),_=d(()=>C.map(e=>e.value).join("|")||"all",[C]),S=Ya(e=>e.selectedFiles),k=Ya(e=>e.selectedFiles.size),A=Ya(e=>e.selectAllVisible),I=r.length>0&&k===r.length,E=d(()=>Array.from(S)[0],[S]),F=d(()=>E?n.get(E):void 0,[n,E]),T=(null==F?void 0:F.isFolder)?!1!==(null==l?void 0:l.enableRenameFolder):!1!==(null==l?void 0:l.enableRenameFile),N=d(()=>Array.from(S).every(e=>{const t=n.get(e);return!!t&&(t.isFolder?!1!==(null==l?void 0:l.enableMoveFolder):!1!==(null==l?void 0:l.enableMoveItem))}),[l,n,S]),j=d(()=>Array.from(S).every(e=>{const t=n.get(e);return!!t&&(t.isFolder?!1!==(null==l?void 0:l.enableCopyFolder):!1!==(null==l?void 0:l.enableCopyItem))}),[l,n,S]),D=d(()=>1===k&&function(e){var t,r,n;if(!e||e.isFolder)return!1;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&gr.includes(i.toLowerCase()))}(F),[k,F]);return t("div",k>0?{className:`header-container ${ys.headerContainer}`,children:[t(bs,{type:"secondary",className:"selected-text",children:[t("div",{children:[k," ",x("selected")]}),s&&e(P,{title:o?x("Select all"):null,children:e(M,{className:ys.buttonSelectAll,onClick:A,disabled:I||0===r.length,children:x("Select all")})}),e(P,{title:o?x("Deselected"):null,children:e(M,{className:ys.buttonDeselected,icon:e(Fi,{size:16,strokeWidth:a}),onClick:g,children:x("Deselected")})})]}),t(R,{children:[D&&!1!==(null==l?void 0:l.enableEdit)&&e(P,{title:o?x("Edit"):null,children:e(M,{icon:e(mi,{size:16,strokeWidth:a}),onClick:()=>w(F),disabled:!D,children:x("Edit")})}),N&&e(P,{title:o?x("Move to"):null,children:e(M,{icon:e(yi,{size:16,strokeWidth:a}),onClick:b,children:x("Move to")})}),j&&e(P,{title:o?x("Copy"):null,children:e(M,{icon:e(gi,{size:16,strokeWidth:a}),onClick:y,children:x("Copy")})}),1===k&&T&&e(P,{title:o?x("Rename"):null,children:e(M,{icon:e(Pi,{size:16,strokeWidth:a}),onClick:()=>m(),disabled:1!==k||!T,children:x("Rename")})}),!1!==(null==l?void 0:l.enableDelete)&&e(P,{title:o?x("Delete"):null,children:e(M,{danger:!0,icon:e(Ri,{size:16,strokeWidth:a}),onClick:e=>{e.stopPropagation(),e.preventDefault(),v()},children:x("Delete")})})]})]}:{className:ys.headerContainer,children:[e("div",{className:"search-container",children:e(ms,{placeholder:x("Search file or folder"),onSearch:h,className:ys.searchInput})}),t("div",{className:ys.actionsBox,children:[e("div",{className:"sort-container",children:e(O,{value:i,onChange:f,className:ys.sortSelect,popupMatchSelectWidth:!1,suffixIcon:e(fi,{size:16,strokeWidth:a}),children:C.map(({value:t,labelKey:r})=>e(ws,{value:t,children:x(r)},t))},_)}),e("div",{className:ys.actionsContainer,children:e(L,{options:[{value:"grid",icon:e(Ci,{size:16,strokeWidth:a})},{value:"table",icon:e(ki,{size:20,strokeWidth:a})}],value:c,onChange:e=>u(e)})})]})]})});xs.displayName="FileContentHeader";const Cs=i.memo(({fileId:t,style:r})=>{const n=Ya(e=>e.selectedFiles.has(t)),i=Ya(e=>e.toggleFileSelection);return e(N,{checked:n,style:r,onClick:e=>{e.stopPropagation()},onChange:e=>{const r=e.nativeEvent;i(t,{metaKey:r.metaKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,forceToggle:!0})}})});function _s(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}Cs.displayName="FileSelectionCheckbox","function"==typeof SuppressedError&&SuppressedError;const Ss=i.memo(t=>{var{className:r}=t,n=_s(t,["className"]);const i=n["data-row-key"],o=null==i?"":String(i),a=[r,Ya(e=>!!o&&e.selectedFiles.has(o))?ys.selectedRow:""].filter(Boolean).join(" ");return e("tr",Object.assign({},n,{className:a}))});Ss.displayName="SelectableTableRow";const ks=i.memo(({item:t,variant:r="table",t:n,iconStrokeWidth:i,setCurrentMenuFile:a,showMoveModal:s,showCopyModal:l,showRenameModal:u,showDeleteConfirm:h,onEdit:f})=>{const[p,g]=o(!1),m=d(()=>{if(!p)return[];const r=[];return t.canEdit&&r.push({key:"edit",label:n("Edit"),icon:e(mi,{size:16,strokeWidth:i})}),t.canMove&&r.push({key:"move",label:n("Move to"),icon:e(yi,{size:16,strokeWidth:i})}),t.canCopy&&r.push({key:"copy",label:n("Copy"),icon:e(gi,{size:16,strokeWidth:i})}),t.canRename&&r.push({key:"rename",label:n("Rename"),icon:e(Pi,{size:16,strokeWidth:i})}),t.canDelete&&r.push({key:"delete",label:n("Delete"),icon:e(Ri,{size:16,strokeWidth:i}),style:{color:"#ff4d4f"}}),r},[i,p,t.canCopy,t.canDelete,t.canEdit,t.canMove,t.canRename,n]),v=c(({key:e})=>{switch(t.id&&(null==a||a(t.id)),e){case"edit":f(t.file);break;case"move":s();break;case"copy":l();break;case"rename":u(t.id);break;case"delete":null==h||h();break;default:null==a||a("")}},[t,f,a,l,h,s,u]),y=d(()=>({items:m,onClick:v}),[v,m]);return e(j,{arrow:!0,placement:"bottom",menu:y,trigger:["hover"],onOpenChange:g,children:"grid"===r?e(M,{type:"default",className:`${ys.gridFileMenuButton} gridFileMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(vi,{size:16,strokeWidth:i})}):e("span",{className:`${ys.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(vi,{size:16,strokeWidth:i})})})});ks.displayName="FileItemActionsDropdown";const As=({thumbnailSrc:t,previewSrc:r,lightboxSrc:n,alt:i,className:s,width:l,height:u,preview:h=!1})=>{const f=i,[p,g]=o(0),m=c(e=>{const t=e.split(",")[1];return!!(t&&t.length>20)},[]),v=c(e=>{var t;if(e&&"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=="!==e)return e.startsWith("data:image/")?m(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},[m]),y=d(()=>v(t),[t,v]),b=d(()=>v(r),[r,v]),w=d(()=>v(n),[n,v]),x=d(()=>[y,b].filter((e,t,r)=>Boolean(e)&&r.indexOf(e)===t),[y,b]);a(()=>{g(0)},[x]);const C=c((e,t)=>e&&e.toLowerCase().endsWith(".svg")||t&&(t.includes(".svg")||t.includes("image/svg+xml")),[]),_=x[p],S=null!=w?w:_,k=c(()=>{if(!_)return;const e=p+1;C(f,_),g(e)},[_,p,f,C]),A=null!=_?_:pr,I=!(!h||!S)&&{src:S,toolbarRender:()=>null,destroyOnHidden:!0,mask:e(ye,{style:{fontSize:"20px"}})};return e(D,{className:s,src:A,alt:i,width:l,height:u,preview:I,onError:k,fallback:pr})},Is=i.memo(({item:t,variant:r="table",FolderIcon:n,getFileData:i,className:o,width:a,height:s})=>t.isFolder?e("div","grid"===r?{className:ys.gridFolderIcon,children:e(n,{className:ys.gridFolderIconImage})}:{className:ys.fileManagerTableFolder,children:e("div",{className:ys.fileManagerTableFolderInner,children:e(n,{className:ys.tableFolderIcon,style:{width:null!=a?a:40,height:null!=s?s:40}})})}):t.thumbnailSrc||t.previewSrc?e(As,{className:o,thumbnailSrc:t.thumbnailSrc,previewSrc:t.previewSrc,lightboxSrc:t.lightboxSrc,alt:t.file.name,width:a,height:s,preview:!0,file:t.file,getFileData:i}):null);Is.displayName="FileItemPreview";const Es=i.memo(({item:r,t:n,iconStrokeWidth:i,FolderIcon:o,handleSingleClick:a,handleDoubleClick:s,handleItemClick:l,setCurrentMenuFile:c,showMoveModal:u,showCopyModal:d,showRenameModal:h,showDeleteConfirm:f,onEdit:p,onEditorOk:g,getFileData:m,showSelectionCheckbox:v=!0})=>{const y=Ya(e=>e.selectedFiles.has(r.id)),b=Ya(e=>e.toggleFileSelection);return e(z,{className:ys.gridCard_col,style:{padding:0},children:t(B,{hoverable:!0,cover:e("div",{className:r.isFolder?ys.gridPreviewContainerFolder:ys.gridPreviewContainer,onClick:e=>{e.stopPropagation(),r.isFolder&&a(()=>{b(r.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey})})},onDoubleClick:e=>{e.stopPropagation(),s(()=>{r.isFolder&&l(r.file)})},children:e(Is,{item:r,variant:"grid",FolderIcon:o,getFileData:m,className:ys.gridImagePreview})}),className:`${ys.gridCard} ${y?ys.gridCardSelected:""}`,onClick:e=>{e.stopPropagation(),e.preventDefault();const t=e.target;t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu")||a(()=>b(r.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}))},onDoubleClick:e=>{e.stopPropagation(),s(()=>{r.isFolder&&l(r.file)})},children:[t("div",{className:ys.gridCardContent,onDoubleClick:e=>{e.stopPropagation(),e.preventDefault(),s(()=>{r.isFolder?l(r.file):g&&g(r.file)})},onClick:e=>{e.stopPropagation(),e.preventDefault();const t=e.target;t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu")||a(()=>b(r.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}))},children:[e("div",{className:ys.gridFileName,children:r.nameText||n("Untitled")}),e("div",{className:ys.gridFileInfo,children:r.gridInfoText})]}),e("div",{className:ys.gridFileMenu,children:e(ks,{item:r,variant:"grid",t:n,iconStrokeWidth:i,setCurrentMenuFile:c,showMoveModal:u,showCopyModal:d,showRenameModal:h,showDeleteConfirm:f,onEdit:p})}),v?e("div",{onClick:e=>{e.stopPropagation()},className:ys.gridCheckbox,children:e(Cs,{fileId:r.id,style:{height:20}})}):null]})})});Es.displayName="FileGridItem";const Fs=i.memo(({rows:t,topOffset:n=0,bottomOffset:i=0,t:o,iconStrokeWidth:a,FolderIcon:s,handleSingleClick:l,handleDoubleClick:c,handleItemClick:u,setCurrentMenuFile:d,showMoveModal:h,showCopyModal:f,showRenameModal:p,showDeleteConfirm:g,onEdit:m,onEditorOk:v,getFileData:y,showSelectionCheckbox:b=!0})=>e(r,{children:e("div",{style:{paddingTop:n,paddingBottom:i},children:e(U,{gutter:[16,16],className:ys.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:t.map(t=>e(Es,{item:t,handleSingleClick:l,handleDoubleClick:c,handleItemClick:u,iconStrokeWidth:a,t:o,FolderIcon:s,setCurrentMenuFile:d,showMoveModal:h,showCopyModal:f,showRenameModal:p,showDeleteConfirm:g,onEdit:m,onEditorOk:v,getFileData:y,showSelectionCheckbox:b},t.id))})})}));Fs.displayName="FileGridView";const Ts=i.memo(({rows:t,columns:n,loading:i,topOffset:o=0,bottomOffset:a=0,onRow:s,components:l})=>{const c=d(()=>e("div",{style:{paddingTop:o,paddingBottom:a},children:e(A,{renderEmpty:()=>e(H,{image:e(r,{}),description:""}),children:e(V,{dataSource:t,columns:n,rowKey:"id",pagination:!1,tableLayout:"fixed",onRow:s,components:l,showHeader:!1})})}),[a,n,l,s,t,o]);return e(S,{spinning:i,className:ys.tableLoadingWrapper,children:c})});Ts.displayName="FileTableView";const Os=i.memo(({item:t})=>t.dateText?e(P,{title:t.dateText,placement:"bottom",className:ys.fileDate,children:t.dateText}):null);Os.displayName="FileItemDate";const Ps=i.memo(({item:r})=>t("div",{className:ys.fileName,children:[r.nameText,r.isFolder&&e("div",{className:ys.fileItemCount,children:r.folderItemsText})]}));Ps.displayName="FileItemName";const Ms="filemanager_view_mode";class Rs{constructor(){this.rowsById=new Map}reconcile(e,t,r){const n=new Map,i=[];for(const o of e){const e=t.getId(o),a=t.buildSignature(o,r),s=this.rowsById.get(e);if(s&&s.signature===a){n.set(e,s),i.push(s);continue}const l=t.buildRowModel(o,r,{id:e,signature:a});n.set(e,l),i.push(l)}return this.rowsById=n,i}}class Ls{createRenderWindow(e,t){var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y,b,w,x,C,_,S,k,A;const I=null!==(r=null==t?void 0:t.renderStrategy)&&void 0!==r?r:"full";if("windowed"!==I){if("positioned"===I){const r=null!==(i=null===(n=null==t?void 0:t.positioned)||void 0===n?void 0:n.layout)&&void 0!==i?i:[],v=null!==(a=null===(o=null==t?void 0:t.positioned)||void 0===o?void 0:o.viewportTop)&&void 0!==a?a:0,y=null!==(l=null===(s=null==t?void 0:t.positioned)||void 0===s?void 0:s.viewportBottom)&&void 0!==l?l:Number.MAX_SAFE_INTEGER,b=Math.max(0,null!==(u=null===(c=null==t?void 0:t.positioned)||void 0===c?void 0:c.overscanPx)&&void 0!==u?u:0),w=Math.max(0,null!==(h=null===(d=null==t?void 0:t.positioned)||void 0===d?void 0:d.containerHeight)&&void 0!==h?h:0),x=r.filter(e=>e.bottom>=v-b&&e.top<=y+b).map(t=>({row:e[t.index],layout:t})).filter(e=>Boolean(e.row)),C=null!==(p=null===(f=x[0])||void 0===f?void 0:f.layout.index)&&void 0!==p?p:-1,_=null!==(m=null===(g=x[x.length-1])||void 0===g?void 0:g.layout.index)&&void 0!==m?m:-1;return{rows:x.map(e=>e.row),startIndex:C,endIndex:_,topOffset:0,bottomOffset:0,totalCount:e.length,containerHeight:w,positionedItems:x}}return{rows:e,startIndex:0,endIndex:e.length>0?e.length-1:-1,topOffset:0,bottomOffset:0,totalCount:e.length}}const E=Math.max(0,null!==(y=null===(v=null==t?void 0:t.windowed)||void 0===v?void 0:v.startIndex)&&void 0!==y?y:0),F=null!==(w=null===(b=null==t?void 0:t.windowed)||void 0===b?void 0:b.endIndex)&&void 0!==w?w:e.length-1,T=Math.max(0,null!==(C=null===(x=null==t?void 0:t.windowed)||void 0===x?void 0:x.overscan)&&void 0!==C?C:0),O=Math.max(1,null!==(S=null===(_=null==t?void 0:t.windowed)||void 0===_?void 0:_.estimatedItemSize)&&void 0!==S?S:1),P=Math.max(1,null!==(A=null===(k=null==t?void 0:t.windowed)||void 0===k?void 0:k.itemsPerLane)&&void 0!==A?A:1),M=Math.ceil(e.length/P),R=Math.min(e.length-1,F),L=Math.floor(E/P),N=Math.floor(Math.max(E,R)/P),j=Math.max(0,L-T),D=Math.min(M-1,N+T),z=j*P,B=Math.min(e.length-1,(D+1)*P-1),U=Math.max(0,M-D-1);return{rows:e.slice(z,B+1),startIndex:z,endIndex:B,topOffset:j*O,bottomOffset:U*O,totalCount:e.length}}}function Ns({items:e,context:t,adapter:r,options:n}){const i=u(null),o=u(null);i.current||(i.current=new Rs),o.current||(o.current=new Ls);const a=d(()=>i.current.reconcile(e,r,t),[r,t,e]),s=d(()=>o.current.createRenderWindow(a,n),[n,a]);return{rowModels:a,renderWindow:s}}function js({totalCount:e,plan:t}){const[r,n]=o(null),i=d(()=>{var n,i;if(!t.enabled)return{renderStrategy:"full"};const o=function(e,t){var r;return Math.max(1,null!==(r=null==e?void 0:e.viewportHeight)&&void 0!==r?r:t)}(r,null!==(n=t.fallbackViewportHeight)&&void 0!==n?n:800),a=Math.max(1,Math.ceil(o/t.estimatedItemSize)),s=Math.max(1,Math.ceil(e/t.itemsPerLane)),l=Math.min(s-1,Math.max(0,Math.floor((null!==(i=null==r?void 0:r.scrollTop)&&void 0!==i?i:0)/t.estimatedItemSize))),c=l+a-1;return{renderStrategy:"windowed",windowed:{startIndex:l*t.itemsPerLane,endIndex:Math.min(e-1,(c+1)*t.itemsPerLane-1),overscan:t.overscan,estimatedItemSize:t.estimatedItemSize,itemsPerLane:t.itemsPerLane}}},[t.enabled,t.estimatedItemSize,t.fallbackViewportHeight,t.itemsPerLane,t.overscan,e,r]);return{engineOptions:i,handleViewportChange:c(e=>{n(t=>(null==t?void 0:t.viewportHeight)===e.viewportHeight&&(null==t?void 0:t.viewportWidth)===e.viewportWidth&&(null==t?void 0:t.scrollHeight)===e.scrollHeight&&(null==t?void 0:t.scrollTop)===e.scrollTop?t:e)},[])}}function Ds(e,t){if("number"==typeof e.childCount)return e.childCount;const r=t[e.id];return null===r?null:null!=r?r:0}function zs(e){var t,r,n;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&gr.includes(i.toLowerCase()))}function Bs(e,t){if(!e)return"";const r=new Date(e);if(Number.isNaN(r.getTime()))return"";const n=[t("months.january"),t("months.february"),t("months.march"),t("months.april"),t("months.may"),t("months.june"),t("months.july"),t("months.august"),t("months.september"),t("months.october"),t("months.november"),t("months.december")];return t("Added",{date:`${r.getDate()} ${n[r.getMonth()]} ${r.getFullYear()}`})}const Us={getId:e=>e.id,buildSignature:(e,t)=>function(e,t){var r,n,i,o,a,s,l,c;const u=Boolean(e.isFolder),d=u?Ds(e,t.folderFileCounts):null,h=u?null===d?"u":String(d):"0",f=Bs(e.date,t.t),p=!u&&e.size?String(e.size):"",g=e.thumbnailUrl||e.thumbnail,m=e.url&&zs(e)?e.url:"",v=t.previewFallbackToFileUrl?m:"",y=[!1!==(null===(r=t.features)||void 0===r?void 0:r.enableEdit),!1!==(null===(n=t.features)||void 0===n?void 0:n.enableMoveFolder),!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveItem),!1!==(null===(o=t.features)||void 0===o?void 0:o.enableCopyFolder),!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyItem),!1!==(null===(s=t.features)||void 0===s?void 0:s.enableRenameFolder),!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFile),!1!==(null===(c=t.features)||void 0===c?void 0:c.enableDelete)].join("|"),b=[g||"",v,m].join("::");return[e.id,e.name,e.folderId,e.type||"",e.extension||"",b,b,e.dimensions||"",p,f,u?"1":"0",h,y].join("::")}(e,t),buildRowModel:(e,t,r)=>{var n,i,o,a,s,l,c,u;const d=Boolean(e.isFolder),h=d?Ds(e,t.folderFileCounts):null,f=d&&null===h?"—":d?`${h} ${1===h?t.t("item"):t.t("items")}`:"",p=e.dimensions||"",g=!d&&e.size?ui(e.size):"",m=d?t.t("Folder"):function(e){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():"")||""}(e),v=Bs(e.date,t.t),y=d?f:[p,g,m].filter(Boolean).join(" • "),b=e.thumbnailUrl||e.thumbnail,w=e.url&&zs(e)?e.url:void 0,x=t.previewFallbackToFileUrl?w:void 0;return{id:r.id,signature:r.signature,item:e,file:e,isFolder:d,nameText:e.name||t.t("No name"),folderItemsText:f,dimensionsText:p,sizeText:g,typeText:m,dateText:v,gridInfoText:y,thumbnailSrc:b,previewSrc:x,lightboxSrc:w,canEdit:!d&&!1!==(null===(n=t.features)||void 0===n?void 0:n.enableEdit)&&zs(e),canMove:d?!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveFolder):!1!==(null===(o=t.features)||void 0===o?void 0:o.enableMoveItem),canCopy:d?!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyFolder):!1!==(null===(s=t.features)||void 0===s?void 0:s.enableCopyItem),canRename:d?!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFolder):!1!==(null===(c=t.features)||void 0===c?void 0:c.enableRenameFile),canDelete:!1!==(null===(u=t.features)||void 0===u?void 0:u.enableDelete)}}};const Vs=i.memo(({files:r,searchTerm:n,handleSearch:i,sortBy:s,sortOrder:l,handleSortOptionChange:h,pagination:f,setPagination:p,loading:g,handleItemClick:m,onClearSelection:v,onRename:y,onDelete:b,onCopy:w,onMove:x,showRenameModal:C,showDeleteConfirm:_,showCopyModal:S,showMoveModal:k,onEdit:A,getFileData:I,handleAddFile:E})=>{var F;const{t:T}=Yn(),O=Oo(),{DropZoneFileIcon:P,BigStockIcon:M,BigAIIcon:R,FolderIcon:L}=mo(),{options:N,actions:j,state:D}=po(),{dataProviders:z,config:B}=N,U=null==B?void 0:B.disablePagination,{setCurrentMenuFile:V,setActiveLibraryItem:H}=j,W="Trash"===(null==D?void 0:D.selectedFolder),G=!1!==(null==D?void 0:D.multiSelect),q=Ya(e=>e.toggleFileSelection),{viewMode:Y,setViewMode:X}=(()=>{const[e,t]=o(()=>{try{return localStorage.getItem(Ms)||"table"}catch(e){return"table"}}),r=c(e=>{t(e);try{localStorage.setItem(Ms,e)}catch(e){console.warn("Не удалось сохранить режим отображения:",e)}},[]),n=c(()=>{r("table"===e?"grid":"table")},[e,r]);return{viewMode:e,setViewMode:r,toggleViewMode:n}})(),[K,Z]=o({}),[J,Q]=o(!1),ee=u(null),te=u(0),re=u(null);a(()=>{const e=window.matchMedia("(max-width: 1199px)"),t=e=>{Q(e.matches)};t(e);const r=e=>t(e);return"function"==typeof e.addEventListener?(e.addEventListener("change",r),()=>e.removeEventListener("change",r)):(e.addListener(r),()=>e.removeListener(r))},[]);const ne=d(()=>(null==B?void 0:B.features)||{},[null==B?void 0:B.features]),ie=null==B?void 0:B.iconStrokeWidth,oe=null==B?void 0:B.sortOptions,ae=d(()=>(null==oe?void 0:oe.length)?new Set(oe):null,[oe]),se=`${s}-${l}`;a(()=>{var e;if(ae&&!ae.has(se)){const t=null===(e=vs.find(e=>ae.has(e.value)))||void 0===e?void 0:e.value;t&&h(t)}},[ae,se,h]);const le=d(()=>new Map(r.map(e=>[e.id,e])),[r]),{renderRows:ce,renderWindow:ue,hasAnyValidDate:de,handleViewportChange:he}=function({files:e,folderFileCounts:t,features:r,t:n,viewMode:i,previewFallbackToFileUrl:a}){const s=d(()=>({folderFileCounts:t,features:r,t:n,previewFallbackToFileUrl:a}),[r,t,n,a]),[l,u]=o(()=>Math.max(1,Math.floor(5))),h=d(()=>{const t=e.length>150;return"table"===i?{enabled:t,estimatedItemSize:56,overscan:10,itemsPerLane:1,fallbackViewportHeight:800}:{enabled:t,estimatedItemSize:320,overscan:2,itemsPerLane:l,fallbackViewportHeight:800}},[e.length,l,i]),{engineOptions:f,handleViewportChange:p}=js({totalCount:e.length,plan:h}),{rowModels:g,renderWindow:m}=Ns({items:e,context:s,adapter:Us,options:f}),v=d(()=>g.some(e=>Boolean(e.dateText)),[g]),y=c(e=>{if("grid"===i){const t=Math.max(1,Math.floor(e.viewportWidth/240));u(e=>e===t?e:t)}p(e)},[p,i]);return{rowModels:g,renderRows:m.rows,renderWindow:m,hasAnyValidDate:v,handleViewportChange:y}}({files:r,folderFileCounts:K,features:ne,t:T,viewMode:Y,previewFallbackToFileUrl:null==B?void 0:B.previewFallbackToFileUrl}),fe=c(async e=>{var t,r,n,i;try{if(null==z?void 0:z.getChildrenCount)return await z.getChildrenCount("folders"===e?void 0:e);if(null==z?void 0:z.getFiles){const{files:r,pagination:n}=await z.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:U?void 0:1,limit:U?void 0:1});return U?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;if(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))return 0;console.error(`Error getting the number of files for the folder ${e}:`,t);const a=await Na({folderId:e,dataProviders:z,folders:Array.isArray(D.folders)?D.folders:[],pathHistory:D.pathHistory,t:T});return O.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:T("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[z,U,O,D.folders,D.pathHistory,T]),pe=c(async()=>{const e=te.current+1;te.current=e;const t=r.filter(e=>e.isFolder);if(0===t.length)return void Z(e=>0===Object.keys(e).length?e:{});const n={},i=t.map(async e=>{"number"!=typeof e.childCount?n[e.id]=await fe(e.id):n[e.id]=e.childCount});await Promise.all(i),te.current===e&&Z(e=>{const t=Object.keys(e),r=Object.keys(n);return t.length===r.length&&t.every(t=>e[t]===n[t])?e:n})},[r,fe]);a(()=>{pe()},[pe]),a(()=>{re.current&&he(ps(re.current))},[r.length,he,Y]),a(()=>{if(!re.current||"undefined"==typeof ResizeObserver)return;const e=re.current,t=new ResizeObserver(()=>{he(ps(e))});return t.observe(e),()=>{t.disconnect()}},[he]);const ge=c((e=()=>{})=>{if(ee.current)return;const t=setTimeout(()=>{e(),ee.current=null},300);ee.current=t},[]),me=c(e=>{ee.current&&(clearTimeout(ee.current),ee.current=null),e()},[]),ve=c(e=>{const t=ps(e);he(t)},[he]);a(()=>{const e=re.current;if(!e)return;const t=()=>{ve(e)},r=ds(e);return r.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{r.forEach(e=>{e.removeEventListener("scroll",t)})}},[r.length,ve,Y]);const ye=c((e,t)=>e!==t,[]),be=d(()=>[...G?[{key:"selection",width:46,shouldCellUpdate:ye,render:(t,r)=>e(Cs,{fileId:r.id})}]:[],{key:"preview",width:60,shouldCellUpdate:ye,render:(t,r)=>e(Is,{item:r,variant:"table",FolderIcon:L,getFileData:I,className:`${ys.imagePreview} ${ys.tableImagePreview}`,width:40,height:40})},{title:T("Name"),width:"calc(100% - 430px)",dataIndex:"nameText",key:"name",className:ys.fileNameCol,shouldCellUpdate:ye,render:(t,r)=>e(Ps,{item:r})},{title:T("Dimensions"),key:"dimensions",width:100,shouldCellUpdate:ye,render:(t,r)=>r.dimensionsText&&e("div",{className:ys.fileSize,children:r.dimensionsText})},{title:T("Size"),key:"size",width:90,shouldCellUpdate:ye,render:(t,r)=>r.sizeText?e("div",{className:ys.fileSize,children:r.sizeText}):null},{title:T("Type"),key:"type",width:90,shouldCellUpdate:ye,render:(t,r)=>e("div",{className:ys.fileSize,children:r.typeText})},...de?[{title:T("Date"),dataIndex:"dateText",key:"date",width:200,shouldCellUpdate:ye,render:(t,r)=>e(Os,{item:r})}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),shouldCellUpdate:ye,render:(t,r)=>e(ks,{item:r,variant:"table",t:T,iconStrokeWidth:ie,setCurrentMenuFile:V,showMoveModal:k,showCopyModal:S,showRenameModal:C,showDeleteConfirm:_,onEdit:A})}],[L,I,de,ie,G,A,V,ye,S,_,k,C,T]);a(()=>()=>{ee.current&&clearTimeout(ee.current)},[]);const we=d(()=>({body:{row:Ss}}),[]),xe=c(e=>({onClick:t=>{const r=t.target;ge(()=>{t.stopPropagation(),t.preventDefault();const n=Boolean(r.closest(".ant-image"))||Boolean(r.closest(".ant-image-preview-wrap")),i=Boolean(r.closest(".tableMenuButton")),o=Boolean(r.closest(".ant-dropdown-menu"));n||i||o||q(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{me(()=>{t.stopPropagation(),t.preventDefault();const r=t.target;r.closest(".ant-checkbox-wrapper")||r.closest(".tableMenu")||(e.isFolder?m(e.file):r.closest(".ant-image")||r.closest(".ant-image-preview-wrap")||!N.onEditorOk||N.onEditorOk(e.file))})}}),[me,m,ge,N,q]);let Ce="table"===Y?e(Ts,{rows:ce,columns:be,loading:g,topOffset:ue.topOffset,bottomOffset:ue.bottomOffset,onRow:xe,components:we}):e(Fs,{rows:ce,topOffset:ue.topOffset,bottomOffset:ue.bottomOffset,t:T,iconStrokeWidth:ie,FolderIcon:L,handleSingleClick:ge,handleDoubleClick:me,handleItemClick:m,setCurrentMenuFile:V,showMoveModal:k,showCopyModal:S,showRenameModal:C,showDeleteConfirm:_,onEdit:A,onEditorOk:N.onEditorOk,getFileData:I,showSelectionCheckbox:G});n&&!r.length&&(Ce=e(xo,{}));const _e=null===(F=null==B?void 0:B.availableImageExtensions)||void 0===F?void 0:F.map(e=>"."+e).join(", "),Se=t("div",W?{className:`${ys.noFiles} ant-layout-sider-light`,children:[e(Li,{size:48,className:ys.noFilesIcon}),e("div",{className:`${ys.textTitle_trash} ant-menu-submenu-title`,children:T("Trash is empty")}),e("div",{className:`${ys.textDescription_trash} ant-menu-submenu-title`,children:T("Deleted files will be displayed here")})]}:{className:ys.uploadContainer,children:[t("div",{className:`${ys.uploadArea} `,onClick:E,children:[e("div",{className:ys.uploadIcon,children:e(P,{})}),e("div",{className:ys.textTitle,children:T("Click here to select a file")}),e("div",{className:ys.textDescription,children:T("Supported files:")+" "+(_e||"jpeg, .svg, .png")})]}),t("div",{className:ys.buttons,children:[t("button",{className:ys.btnPhoto,onClick:()=>{H&&H(ir)},children:[e("div",{className:ys.icon,children:e(M,{})}),t("div",{className:ys.blockText,children:[e("div",{className:ys.textTitle,children:T("Stock")}),e("div",{className:ys.textDescription,children:T("Select an image from our library")})]})]}),t("button",{className:ys.btnAi,onClick:()=>{H&&H(ar)},children:[e("div",{className:ys.icon,children:e(R,{})}),t("div",{className:ys.blockText,children:[e("div",{className:ys.textTitle,children:T("AI generation")}),e("div",{className:ys.textDescription,children:T("Creating an image on demand")})]})]})]})]});return e("div",{className:`content-layout ${ys.contentLayout}`,children:g||0!==(null==r?void 0:r.length)||n?t("div",{className:ys.tableContainer,children:[e(xs,{files:r,filesById:le,currentSortOption:se,isSmallScreen:J,iconStrokeWidth:ie,multiSelectEnabled:G,features:ne,viewMode:Y,setViewMode:X,handleSearch:i,handleSortOptionChange:h,sortOptions:oe,onClearSelection:v,onRename:y,onDelete:b,onCopy:w,onMove:x,onEdit:A,t:T}),e("div",{ref:re,className:ys.filesContainer,children:Ce}),!U&&f.total>f.pageSize&&e("div",{className:ys.paginationContainer,children:e($,{current:f.current,pageSize:f.pageSize,total:f.total,onChange:(e,t)=>p({current:e,pageSize:t,total:f.total}),showSizeChanger:!0,showTotal:e=>T("total pages",{total:e})})})]}):e("div",{className:ys.emptyStateWrapper,children:Se})})});Vs.displayName="FileContent";var Hs="folderTree",$s="emptyFolderContainer",Ws="folderItemContainer",Gs="folderLabel",qs="folderLabelItem",Ys="fileCount",Xs="foldersTitle",Ks="foldersTitleItem",Zs="folderMenu";const Js=({selectedFolder:r,onSelect:n,onExpand:i,generateMenuItems:s,fetchChildFolders:l,disabledFolders:u=[],showFileCounts:h=!1,folderFileCounts:f={},className:p="",expandedKeys:g,setExpandedKeys:m,showTrashFolder:v=!1,mode:y="navigation",defaultExpandAll:b=!1})=>{const{t:w}=Yn(),{options:x}=po(),{config:C}=x,{ExpandArrowIcon:_,CollapseArrowIcon:S,CollapseFolderIcon:k,ExpandFolderIcon:A,EmptyFolderIcon:I}=mo(),E=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[F,T]=o(()=>{if(b||"selection"===y&&b){const e=s();return E(e)}return[]}),O=void 0!==g?g:F,P=void 0!==m?m:T;a(()=>{if(b||"selection"===y&&b){const e=s(),t=E(e);void 0===g&&T(t)}},[b,y,s,E,g]);const M=c(async e=>{const t=e[0];t&&"empty"!==t&&!t.endsWith("_input")&&(null==n||n(e),await(null==l?void 0:l("folders"===t?null:t)))},[n,l]),R=c(async(e,t)=>{var r;P(e),null==i||i(e,t);if(!("lazy"===(null==C?void 0:C.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==l?void 0:l(n))}catch(e){console.warn("Failed to load child folders for",n,e)}},[null==C?void 0:C.folderTreeLoading,l,i,P]),L=c(()=>{var n,i;const o=s(),a=e=>e.filter(e=>"Trash"!==e.key).map(e=>Object.assign(Object.assign({},e),{children:e.children?a(e.children):void 0})),l=v?a(o):o,c=e=>{"selection"!==y?(O.includes(e)&&r===e?P(O.filter(t=>t!==e)):O.includes(e)||P([...O,e]),M([e])):M([e])},d=0===l.length||1===l.length&&(!l[0].children||0===l[0].children.length),p=r=>{var n;const i=h?f[r.key]:void 0,o=h&&null===i?null:h&&null!=i?i:0,a=O.includes(r.key),s=u.includes(r.key),l=(()=>{var t;return(null===(t=r.children)||void 0===t?void 0:t.length)?e(a?k:A,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}):e(I,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth})})(),d=t("div",{className:`${Ws} folder-item-container`,onClick:()=>!s&&c(r.key),style:{opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},children:[t("div",{className:Gs,children:[void 0!==r.icon?r.icon:l,e("span",{className:qs,children:r.label})]}),h&&e("div",{className:Ys,title:null===o?void 0:`${o} ${w(1===o?"item":"items")}`,children:null===o?"—":o})]});return{key:r.key,title:d,children:null===(n=r.children)||void 0===n?void 0:n.map(p),disabled:s}},g=O.includes("folders"),m=e("div",{className:Xs,onClick:()=>c("folders"),children:t("div",{className:Ks,children:[e(g?k:A,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:`${qs} folder-label-item`,children:"folders"===(null===(n=l[0])||void 0===n?void 0:n.key)?l[0].label:w("Folders")})]})}),b=()=>({key:"Trash",title:e("div",{className:Xs,onClick:()=>c("Trash"),children:t("div",{className:Ks,children:[e(Ri,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:qs,children:w("Trash")})]})}),children:void 0});if(d){if(!v)return[{key:"empty",title:e("div",{className:$s,children:w("No folders yet")}),disabled:!0}];const t=[];return l.length>0&&"folders"===l[0].key&&t.push({key:"folders",title:m,children:[]}),t.push(b()),t}if(l.length>0&&"folders"===l[0].key){const e=[{key:"folders",title:m,children:null===(i=l[0].children)||void 0===i?void 0:i.map(p)}];return v&&e.push(b()),e}return l.map(p)},[s,O,k,null==C?void 0:C.iconStrokeWidth,A,w,r,M,h,f,I,u,v,y,P]),N=d(()=>L(),[L]);return e(W,{className:`${Hs} ${Zs} ${p}`,selectedKeys:r?[r]:[],expandedKeys:O,onSelect:M,onExpand:R,treeData:N,switcherIcon:({expanded:t})=>e(t?S:_,{}),showLine:!1})},Qs=({style:t={},wrap:r=!1})=>{const n=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},t);return e(R,{size:"large",style:n,wrap:r,children:e(S,{})})};var el={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 tl=({folderId:n,activeFormField:i,EmptyFolderIcon:o,targetForm:a,handleModalOk:s,onComplete:l,setIsLoading:c,t:u})=>e(E.Item,{className:"form-item form-item-moveto "+(i===n?"form-item_active":""),name:"folderName",initialValue:u("New folder"),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(u("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{className:"form-input",autoFocus:!0,prefix:e(o,{style:{marginRight:6}}),suffix:t(r,{children:[e(P,{placement:"top",title:"Clean",children:e(M,{icon:e(be,{style:{fontSize:10}}),className:el.inputButtonClose,type:"text",onClick:()=>{a.setFieldsValue({folderName:""})}})}),e(M,{className:el.inputButtonOk,type:"text",onClick:()=>{c(!0),s(a).then(e=>{const t=null==e?void 0:e.id;l(t)}).finally(()=>c(!1))},children:u("Create")})]})})});function rl({folders:n,selectedFolder:o,EmptyFolderIcon:a,handleCreateFolderModalOk:s,setIsLoading:l,t:c}){const[u,d]=i.useState(""),h=i.useCallback((t,r)=>n=>e(tl,{folderId:n,activeFormField:u,EmptyFolderIcon:a,targetForm:t,handleModalOk:s,onComplete:r,setIsLoading:l,t:c},n),[a,u,s,l,c]),f=i.useCallback(e=>{const{folderId:t,targetForm:r,onTreeSelect:n,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),d(t),r.setFieldsValue({folderName:c("New folder"),targetFolder:t})},handleSelectFolder:e=>{e.preventDefault(),e.stopPropagation(),n([t]).then(()=>i(t))}}},[c]),p=i.useCallback(i=>{const{targetForm:a,onTreeSelect:s,onComplete:l,actionButtonText:d}=i,p=h(a,l),g=Array.isArray(n)?n:[],m=(n=null,i=new Set)=>g.filter(e=>{const t=null===n&&!e.parentId,r=e.parentId===n;return t||r}).map(n=>{if(i.has(n.id))return{key:n.id,label:`${n.name} (циклическая ссылка)`};const c=new Set(i);c.add(n.id);const h=m(n.id,c),{handleAddFolder:g,handleSelectFolder:v}=f({folderId:n.id,targetForm:a,onTreeSelect:s,onComplete:l}),y=u===n.id?[{key:`${n.id}_input`,label:p(n.id),icon:null},...h]:h;return{key:n.id,label:t(r,{children:[n.name,o!==n.id&&t("div",{className:`${el.folderToolsField} folder-tools-field`,children:[e(M,{onClick:g,children:"+"}),e(M,{onClick:v,children:d})]})]}),children:y}}),v=m(),{handleAddFolder:y,handleSelectFolder:b}=f({folderId:"folders",targetForm:a,onTreeSelect:s,onComplete:l}),w="folders"===u?[{key:"folders_input",label:p("folders"),icon:null},...v]:v;return[{key:"folders",label:t(r,{children:[c("Folders"),"folders"!==o&&null!==o&&t("div",{className:`${el.folderToolsField} folder-tools-field`,children:[e(M,{onClick:y,children:"+"}),e(M,{onClick:b,children:d})]})]}),children:w}]},[u,h,f,n,o,c]);return{activeFormField:u,setActiveFormField:d,generateMenuItemsFromFolders:p}}const nl=f(({folderId:t,activeFormField:r,EmptyFolderIcon:n,targetForm:i,handleModalOk:o,onComplete:a,t:s,setIsLoading:l,defaultFolderName:u})=>{const d=c(()=>{l(!0),o(i).then(e=>a(null==e?void 0:e.id)).finally(()=>l(!1))},[o,i,a,l]);return e(E.Item,{className:"form-item form-item-moveto "+(r===t?"form-item_active":""),name:"folderName",initialValue:u,rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(s("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{className:"form-input",autoFocus:!0,prefix:e(n,{style:{marginRight:6}}),suffix:e(M,{className:el.inputButtonOk,type:"text",onClick:()=>{l(!0),d()},children:s("Create")})})})});nl.displayName="CustomFolderInput";const il=({isModalVisible:n,handleModalOk:i,handleModalCancel:s,form:l,selectedFolder:u,folders:h,isUrlModalVisible:f,setIsUrlModalVisible:p,handleAddFileByUrl:g,urlForm:m,isRenameModalVisible:v,handleRenameOk:y,handleRenameCancel:b,renameForm:w,fileToRename:x,files:C,isMoveModalVisible:_,handleMoveOk:S,handleMoveCancel:k,moveForm:A,selectedFiles:I,isRenameFolderModalVisible:T,handleRenameFolderOk:O,handleRenameFolderCancel:P,renameFolderForm:R,folderToRename:L,isCopyModalVisible:N,handleCopyOk:j,handleCopyCancel:D,copyForm:z,isDeleteConfirmVisible:B,handleDeleteConfirmOk:U,handleDeleteConfirmCancel:V,isClearTrashConfirmVisible:H,handleClearTrashConfirm:$,handleClearTrashCancel:W,fetchChildFolders:Y})=>{var X,K,Z;const{t:J}=Yn(),{state:Q,actions:ee,options:te}=po(),{setCurrentMenuFile:re}=ee,{config:ne}=te,{currentMenuFile:ie}=Q,oe=E.useWatch("folderName",l),{EmptyFolderIcon:ae}=mo(),[se,le]=o(!1),ce=d(()=>{var e;return(null===(e=null==ne?void 0:ne.defaultFolderName)||void 0===e?void 0:e.trim())||J("New folder")},[null==ne?void 0:ne.defaultFolderName,J]),ue=!oe||0===String(oe).trim().length,de=d(()=>Array.isArray(C)?C:[],[C]),he=x?null===(X=de.find(e=>e.id===x))||void 0===X?void 0:X.name:"",fe=Array.isArray(h)?h:[],pe=L?null===(K=fe.find(e=>e.id===L))||void 0===K?void 0:K.name:"",{activeFormField:ge,setActiveFormField:me,generateMenuItemsFromFolders:ve}=rl({folders:fe,selectedFolder:u,EmptyFolderIcon:ae,handleCreateFolderModalOk:i,setIsLoading:e=>le(Boolean(e)),t:J});a(()=>{if(B){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)}},[B]);const ye=x?de.find(e=>e.id===x):null,we=(null==ye?void 0:ye.isFolder)||(null==x?void 0:x.startsWith("folder_")),xe=c(async e=>{e.length>0&&(A.setFieldsValue({targetFolder:e[0]}),ge!==e[0].toString()&&me(""))},[A,ge,me]),Ce=c(async e=>{e.length>0&&(z.setFieldsValue({targetFolder:e[0]}),ge!==e[0].toString()&&me(""))},[ge,z,me]),_e=c(async e=>{le(!0);try{await S(e)}finally{le(!1)}},[S]),Se=c(async e=>{le(!0);try{await j(e)}finally{le(!1)}},[j]),ke=d(()=>{const e=Array.from(I).filter(e=>{const t=de.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||h.some(t=>t.id===e)});return u&&"folders"!==u?e.push(u):u&&"folders"!==u||e.push("folders"),e},[I,de,h,u]);return t(r,{children:[e(G,{title:e("div",{className:"modal-title",children:J("Creating a new folder")}),open:n,onOk:()=>i(),onCancel:s,okText:J("Create"),cancelText:J("Cancel"),okButtonProps:{disabled:ue,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>le(!1),children:t(E,{form:l,layout:"vertical",children:[e(E.Item,{name:"folderName",label:e("div",{className:"form-label",children:J("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],initialValue:ce,className:"form-item",style:{marginBottom:5},children:e(F,{autoFocus:!0,className:"form-input",disabled:se,placeholder:J("Enter the name"),onPressEnter:async()=>{le(!0);try{await l.validateFields(),ue||await i()}catch(e){le(!1)}}})}),e("div",{children:u&&"folders"!==u?t("p",{className:"fm-note",children:[J("A folder will be created inside:")," ",(null===(Z=fe.find(e=>e.id===u))||void 0===Z?void 0:Z.name)||J("selected folder"),"."]}):e("p",{className:"fm-note",children:J("The folder will be created in the root directory.")})})]})}),e(G,{title:e("div",{className:"modal-title",children:J("Upload file by URL")}),open:f,onOk:async()=>{var e;le(!0);try{const t=await m.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await g(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{le(!1)}},onCancel:()=>p(!1),okText:J("Download"),okButtonProps:{loading:se},cancelText:J("Cancel"),cancelButtonProps:{disabled:se},afterClose:()=>le(!1),children:e(E,{form:m,layout:"vertical",children:e(E.Item,{name:"fileUrl",label:e("div",{className:"form-label",children:J("File URL")}),rules:[{required:!0,message:J("Enter the URL of the image")},{validator:(e,t)=>{if(!t||!String(t).trim())return Promise.resolve();try{return Ko(String(t),J),Promise.resolve()}catch(e){return Promise.reject(new Error(e instanceof Error?e.message:J("The specified URL is not valid.")))}}}],validateTrigger:"onBlur",className:"form-item",children:e(F,{className:"form-input",placeholder:"https://example.com/image.jpg",autoFocus:!0,disabled:se,onPressEnter:async()=>{var e;le(!0);try{const t=await m.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await g(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{le(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:we?`${J("Rename folder")} ${he}`:J("Rename file",{currentFileName:he})}),open:v,onOk:y,okText:J("Rename"),okButtonProps:{loading:se},onCancel:b,cancelText:J("Cancel"),cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},children:e(E,{form:w,layout:"vertical",children:e(E.Item,{name:"newFileName",label:e("div",{className:"form-label",children:J(we?"New folder name":"New file name")}),rules:[{required:!0,message:J(we?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:se,onPressEnter:async()=>{le(!0);try{await w.validateFields(),y()}catch(e){le(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:J("Move to")}),open:_,onCancel:k,footer:t("div",{className:el.formFooter,children:[t(M,{className:el.folderButton,onClick:()=>{const e=null!=u?u:"folders";me(e),A.setFieldsValue({folderName:ce,targetFolder:e})},loading:se,children:[e(wi,{size:18,strokeWidth:null==ne?void 0:ne.iconStrokeWidth}),J("Create folder")]}),e(M,{type:"primary",className:el.folderButton,onClick:k,loading:se,children:J("Done")})]}),afterClose:()=>{re&&re(""),me(""),le(!1)},loading:se,children:t("div",{className:el.modalContentWithLoader,children:[se&&e("div",{className:el.modalLoaderOverlay,children:e(Qs,{})}),e(E,{form:A,layout:"vertical",initialValues:{targetFolder:"folders",folderName:ce,is_force_create:!1},children:t("div",{className:el.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:J("Select the destination folder")}],className:el.formItem,children:e(Js,{onSelect:xe,generateMenuItems:()=>ve({targetForm:A,onTreeSelect:xe,onComplete:_e,actionButtonText:J("Move here")}),fetchChildFolders:Y,disabledFolders:ke,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:e("div",{className:"modal-title",children:J("Copy to folder")}),open:N,onCancel:D,footer:t("div",{className:el.formFooter,children:[t(M,{className:el.folderButton,onClick:()=>{const e=null!=u?u:"folders";me(e),z.setFieldsValue({folderName:ce,targetFolder:e})},loading:se,children:[e(wi,{size:18,strokeWidth:null==ne?void 0:ne.iconStrokeWidth}),J("Create folder")]}),e(M,{type:"primary",className:el.folderButton,onClick:D,loading:se,children:J("Done")})]}),afterClose:()=>{re&&re(""),me(""),le(!1)},loading:se,children:t("div",{className:el.modalContentWithLoader,children:[se&&e("div",{className:el.modalLoaderOverlay,children:e(Qs,{})}),e(E,{form:z,layout:"vertical",initialValues:{targetFolder:"folders",folderName:ce,is_force_create:!1},children:t("div",{className:el.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:J("Select the destination folder")}],className:el.formItem,children:e(Js,{onSelect:Ce,generateMenuItems:()=>ve({targetForm:z,onTreeSelect:Ce,onComplete:Se,actionButtonText:J("Copy here")}),fetchChildFolders:Y,disabledFolders:ke,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:t("div",{className:"modal-title",children:[J("Rename folder")," ",pe]}),open:T,onOk:O,onCancel:P,okText:J("Rename"),cancelText:J("Cancel"),okButtonProps:{loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},children:e(E,{form:R,layout:"vertical",children:e(E.Item,{name:"newFolderName",label:e("div",{className:"form-label",children:J("New folder name")}),rules:[{required:!0,message:J("Enter a new folder name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:se,onPressEnter:async()=>{le(!0);try{await R.validateFields(),O()}catch(e){le(!1)}}})})})}),e(G,{className:`${el.deleteModal} deleteModal`,title:(()=>{const t=!!(null==ne?void 0:ne.enableTrashFolder)&&"Trash"===u||!(null==ne?void 0:ne.enableTrashFolder),r=J(t?"Permanently delete":"Move to Trash");return e("div",{className:"modal-title",children:r})})(),open:!!B,onOk:()=>{le(!0);try{U&&U()}catch(e){console.error(e),le(!1)}},onCancel:()=>V&&V(),okText:(null==ne?void 0:ne.enableTrashFolder)&&"Trash"===u?J("Delete permanently"):(null==ne?void 0:ne.enableTrashFolder)?J("Move to Trash"):J("Delete"),cancelText:J("Cancel"),okButtonProps:{danger:!(null==ne?void 0:ne.enableTrashFolder)||"Trash"===u,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},closeIcon:e(be,{className:el.closeIcon}),children:(()=>{var r,n;const i=(ie?[ie]:Array.from(I||[])).map(e=>de.find(t=>t.id===e)).filter(e=>!!e),o=i.filter(e=>e.isFolder||e.id.startsWith("folder_")),a=i.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),s=i.length,l=o.length,c=a.length,d=!!(null==ne?void 0:ne.enableTrashFolder);if(!d||d&&"Trash"===u){let n;if(1===s&&1===l){const e=o[0],t=(null==e?void 0:e.name)||"",i=null!==(r=null==e?void 0:e.childCount)&&void 0!==r?r:0;n=J("delete_folder_permanent",{name:t,count:i})}else n=0===l&&c>0?J("delete_files_permanent",{count:c}):J("delete_mixed_permanent",{total:s,folders:l,images:c});return t("div",{children:[e("div",{children:n}),e("p",{className:el.permanentDeleteWarning,children:J("permanent_delete_warning")})]})}if(1===s&&1===l){const t=o[0],r=(null==t?void 0:t.name)||"",i=null!==(n=null==t?void 0:t.childCount)&&void 0!==n?n:0;return e("div",{children:J("move_folder_to_trash",{name:r,count:i})})}return e("div",0===l&&c>0?{children:J("move_files_to_trash",{count:c})}:{children:J("move_mixed_to_trash",{total:s,folders:l,images:c})})})()}),t(G,{className:`${el.deleteModal} deleteModal`,title:e("div",{className:"modal-title",children:J("Clear Trash")}),open:!!H,onOk:async()=>{le(!0),$&&await $(),le(!1)},onCancel:()=>W&&W(),okText:J("Delete permanently"),cancelText:J("Cancel"),okButtonProps:{danger:!0,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1)},closeIcon:e(be,{className:el.closeIcon}),children:[e("div",{children:J("Are you sure you want to permanently delete all items from Trash?")}),se&&t("div",{className:el.clearTrashProgress,children:[e(q,{percent:99,status:"active",showInfo:!1}),e("div",{className:el.progressText,children:J("Deleting items...")})]})]})]})};var ol={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const al=f(p(({selectedFolder:r,generateMenuItems:n,onFolderSelect:i,folders:s,fetchChildFolders:l,handleAddFile:h,setIsUrlModalVisible:f,handleCreateFolder:p,activeLibraryItem:m,setActiveLibraryItem:v},y)=>{var b,w,x;const C=d(()=>Array.isArray(s)?s:[],[s]),{t:_}=Yn(),S=Oo(),[k,A]=o({}),{options:I,state:E}=po(),{dataProviders:F,config:T}=I,O=E.pathHistory,P=!1!==(null===(b=null==T?void 0:T.features)||void 0===b?void 0:b.enableGif)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("gif")),R=!1!==(null===(w=null==T?void 0:T.features)||void 0===w?void 0:w.enableStockImages)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("stock")),L=!1!==(null===(x=null==T?void 0:T.features)||void 0===x?void 0:x.enableIconStock)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("icons")),N=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[j,D]=o(()=>{if(!0===(null==T?void 0:T.expandAllFoldersOnInit)&&"lazy"!==(null==T?void 0:T.folderTreeLoading)){const e=n();return N(e)}return!0===(null==T?void 0:T.expandRootFolderOnInit)?["folders"]:[]}),z=u(!1),B=u(!1);a(()=>{if(z.current)return;"lazy"===(null==T?void 0:T.folderTreeLoading)&&!0===(null==T?void 0:T.expandRootFolderOnInit)&&(z.current=!0,(async()=>{try{await(null==l?void 0:l(null))}catch(e){console.warn("Could not load the root child folders during initialization",e)}})())},[null==T?void 0:T.folderTreeLoading,null==T?void 0:T.expandRootFolderOnInit,l]),a(()=>{!0===(null==T?void 0:T.expandRootFolderOnInit)&&Array.isArray(C)&&C.length>0&&(B.current||j&&0!==j.length||(B.current=!0,D(["folders"])))},[null==T?void 0:T.expandRootFolderOnInit,C,j]),a(()=>{if(!0===(null==T?void 0:T.expandAllFoldersOnInit)&&"lazy"!==(null==T?void 0:T.folderTreeLoading)){const e=n(),t=N(e);return void D(t)}!0===(null==T?void 0:T.expandRootFolderOnInit)&&D(e=>e&&e.length>0?[...e]:["folders"])},[C,n,N,null==T?void 0:T.expandAllFoldersOnInit,null==T?void 0:T.folderTreeLoading,null==T?void 0:T.expandRootFolderOnInit]);const U=null==T?void 0:T.disablePagination,V=c(async e=>{var t,r,n,i;try{if(null==F?void 0:F.getChildrenCount)return await F.getChildrenCount("folders"===e?void 0:e);if(null==F?void 0:F.getFiles){const{files:r,pagination:n}=await F.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:U?void 0:1,limit:U?void 0:1});return U?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;if(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))return 0;console.error(`Error getting the number of files for the folder ${e}:`,t);const a=await Na({folderId:e,dataProviders:F,folders:C,pathHistory:O,t:_});return S.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:_("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[F,U,S,O,C,_]),H=c(async()=>{if(0===C.length)return;const e={};e.folders=await V("folders");const t=C.map(async t=>{"number"!=typeof t.childCount?e[t.id]=await V(t.id):e[t.id]=t.childCount});await Promise.all(t),A(e)},[C,V]),$=c(async e=>{const t=await V(e);A(r=>Object.assign(Object.assign({},r),{[e]:t}))},[V]);g(y,()=>({refreshFileCounts:H}),[H]),a(()=>{H()},[H]),a(()=>{if(!r||"folders"===r)return;const e=(t,r=new Set)=>{if(r.has(t))return console.warn(`Cycle detected in the path to the folder with id=${t}`),[];const n=C.find(e=>e.id===t);if(!n)return[];if(!n.parentId)return[];const i=new Set(r);i.add(t);return[...e(n.parentId,i),n.parentId]},t=e(r);t.length>0?D(e=>{const r=new Set(e);return t.forEach(e=>r.add(e)),r.add("folders"),Array.from(r)}):D(e=>e.includes("folders")?e:[...e,"folders"])},[r,C]);const W=c(async()=>{await h(),r?await $(r):await $("folders")},[h,r,$]),G=[{key:rr,label:_("My files"),icon:e(_i,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth})},{key:nr,label:_("GIF"),icon:e(Ai,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!P},{key:ir,label:_("Stock images"),icon:e(pi,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!R},{key:or,label:_("Icons"),icon:e(we,{size:20}),disabled:!L},{key:ar,label:_("AI"),icon:e(Oi,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!(null==T?void 0:T.sseQuery)}].filter(e=>!e.disabled),q=c(async e=>{const t=e[0];t&&"empty"!==t&&(m!==rr&&v(rr),null==i||i(t),await(null==l?void 0:l(t)))},[i,m,v,l]),K=c(({key:e})=>{v(e)},[v]),Z=c(async(e,t)=>{var r;D(e);if(!("lazy"===(null==T?void 0:T.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==l?void 0:l(n))}catch(e){console.warn("Could not load the child folders for",n,e);const t=await Na({folderId:n,dataProviders:F,folders:C,pathHistory:O,t:_});S.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:_("Failed to load subfolders in folder",{folderName:t}),placement:"bottomRight",innerException:e,notificationDedupe:!0,data:{folderId:n,folderName:t,reason:e instanceof Error?e.message:String(e)}})}},[null==T?void 0:T.folderTreeLoading,F,l,S,O,C,_]);return t("div",{className:"sidebar-container",children:[t("div",{className:ol.buttonWrapper,children:[e(M,{type:"primary",size:"large",icon:e(Ii,{size:24,strokeWidth:null==T?void 0:T.iconStrokeWidth}),onClick:W,className:ol.uploadButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r,children:e("span",{className:ol.uploadButtonTitle,children:_("Upload file")})}),e(M,{type:"primary",size:"large",icon:e(Si,{size:24,strokeWidth:null==T?void 0:T.iconStrokeWidth}),onClick:()=>null==f?void 0:f(!0),className:ol.uploadByURLButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r})]}),e(Y,{className:"folder-menu",items:G,defaultSelectedKeys:[rr],onSelect:({key:e})=>K({key:e}),selectedKeys:[m]}),e(X,{className:ol.divider}),t("div",{className:ol.foldersContainer,children:[e(Js,{selectedFolder:r,onSelect:q,onExpand:Z,generateMenuItems:n,fetchChildFolders:l,showFileCounts:!0,folderFileCounts:k,expandedKeys:j,setExpandedKeys:D,showTrashFolder:null==T?void 0:T.enableTrashFolder}),e("div",{className:ol.folderActions,children:e(M,{onClick:e=>{e.stopPropagation(),p()},className:ol.button,icon:e(wi,{size:18,strokeWidth:null==T?void 0:T.iconStrokeWidth}),size:"middle"})})]})]})}));al.displayName="FolderSidebar";var sl=Object.defineProperty,ll=(e,t,r)=>(((e,t,r)=>{t in e?sl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);function cl(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function ul(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function dl(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=ul(e);return t>0?cl(Number(e)*Math.pow(10,t)):Number(e)}function hl(e){yl&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&console.warn(e+" is beyond boundary when transfer to integer, the results may not be accurate")}function fl(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 pl=fl(function(e,t){var r=dl(e),n=dl(t),i=ul(e)+ul(t),o=r*n;return hl(o),o/Math.pow(10,i)}),gl=fl(function(e,t){var r=Math.pow(10,Math.max(ul(e),ul(t)));return(pl(e,r)+pl(t,r))/r}),ml=fl(function(e,t){var r=Math.pow(10,Math.max(ul(e),ul(t)));return(pl(e,r)-pl(t,r))/r}),vl=fl(function(e,t){var r=dl(e),n=dl(t);return hl(r),hl(n),pl(r/n,cl(Math.pow(10,ul(t)-ul(e))))});var yl=!0;var bl={strip:cl,plus:gl,minus:ml,times:pl,divide:vl,round:function(e,t){var r=Math.pow(10,t),n=vl(Math.round(Math.abs(pl(e,r))),r);return e<0&&0!==n&&(n=pl(n,-1)),n},digitLength:ul,float2Fixed:dl,enableBoundaryChecking:function(e){void 0===e&&(e=!0),yl=e}};const wl=Object.prototype.toString;function xl(e){switch(wl.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ol(e,Error)}}function Cl(e,t){return wl.call(e)===`[object ${t}]`}function _l(e){return Cl(e,"ErrorEvent")}function Sl(e){return Cl(e,"DOMError")}function kl(e){return Cl(e,"String")}function Al(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Il(e){return null===e||Al(e)||"object"!=typeof e&&"function"!=typeof e}function El(e){return Cl(e,"Object")}function Fl(e){return typeof Event<"u"&&Ol(e,Event)}function Tl(e){return!(!e||!e.then||"function"!=typeof e.then)}function Ol(e,t){try{return e instanceof t}catch{return!1}}function Pl(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function Ml(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function Rl(e,t){if(!Array.isArray(e))return"";const r=[];for(let t=0;t<e.length;t++){const n=e[t];try{Pl(n)?r.push("[VueViewModel]"):r.push(String(n))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function Ll(e,t,r=!1){return!!kl(e)&&(function(e){return Cl(e,"RegExp")}(t)?t.test(e):!!kl(t)&&(r?e===t:e.includes(t)))}function Nl(e,t=[],r=!1){return t.some(t=>Ll(e,t,r))}function jl(e,t,r=250,n,i,o,a){if(!(o.exception&&o.exception.values&&a&&Ol(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=Ml(e.value,t)),e))}(Dl(e,t,i,a.originalException,n,o.exception.values,s,0),r))}function Dl(e,t,r,n,i,o,a,s){if(o.length>=r+1)return o;let l=[...o];if(Ol(n[i],Error)){zl(a,s);const o=e(t,n[i]),c=l.length;Bl(o,i,c,s),l=Dl(e,t,r,n[i],i,[o,...l],o,c)}return Array.isArray(n.errors)&&n.errors.forEach((n,o)=>{if(Ol(n,Error)){zl(a,s);const c=e(t,n),u=l.length;Bl(c,`errors[${o}]`,u,s),l=Dl(e,t,r,n,i,[c,...l],c,u)}}),l}function zl(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 Bl(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 Ul(e){return e&&e.Math==Math?e:void 0}const Vl="object"==typeof globalThis&&Ul(globalThis)||"object"==typeof window&&Ul(window)||"object"==typeof self&&Ul(self)||"object"==typeof global&&Ul(global)||function(){return this}()||{};function Hl(){return Vl}function $l(e,t,r){const n=r||Vl,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const Wl=Hl();function Gl(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=ql(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 ql(e,t){const r=e,n=[];let i,o,a,s,l;if(!r||!r.tagName)return"";if(Wl.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&&kl(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 Yl=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Xl=["debug","info","warn","error","log","assert","trace"],Kl={};function Zl(e){if(!("console"in Vl))return e();const t=Vl.console,r={},n=Object.keys(Kl);n.forEach(e=>{const n=Kl[e];r[e]=t[e],t[e]=n});try{return e()}finally{n.forEach(e=>{t[e]=r[e]})}}const Jl=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Yl?Xl.forEach(r=>{t[r]=(...t)=>{e&&Zl(()=>{Vl.console[r](`Sentry Logger [${r}]:`,...t)})}}):Xl.forEach(e=>{t[e]=()=>{}}),t}(),Ql=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ec(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 tc(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function rc(e){const t="string"==typeof e?function(e){const t=Ql.exec(e);if(!t)return void Zl(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});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 tc({host:o,pass:i,path:l,projectId:c,port:a,protocol:r,publicKey:n})}(e):tc(e);if(t&&function(e){if(!Yl)return!0;const{port:t,projectId:r,protocol:n}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(Jl.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(r.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(n)?t&&isNaN(parseInt(t,10))&&(Jl.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(Jl.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),1):(Jl.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),1)))}(t))return t}class nc 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 ic(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);"function"==typeof i&&ac(i,n),e[t]=i}function oc(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{Yl&&Jl.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function ac(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,oc(e,"__sentry_original__",t)}catch{}}function sc(e){return e.__sentry_original__}function lc(e){if(xl(e))return{message:e.message,name:e.name,stack:e.stack,...uc(e)};if(Fl(e)){const t={type:e.type,target:cc(e.target),currentTarget:cc(e.currentTarget),...uc(e)};return typeof CustomEvent<"u"&&Ol(e,CustomEvent)&&(t.detail=e.detail),t}return e}function cc(e){try{return function(e){return typeof Element<"u"&&Ol(e,Element)}(e)?Gl(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function uc(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 dc(e){return hc(e,new Map)}function hc(e,t){if(function(e){if(!El(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 r of Object.keys(e))typeof e[r]<"u"&&(n[r]=hc(e[r],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(hc(e,t))}),n}return e}const fc=/\(error: (.*)\)/,pc=/captureMessage|captureException/;function gc(...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 e=r;e<i.length;e++){const r=i[e];if(r.length>1024)continue;const o=fc.test(r)?r.replace(fc,"$1"):r;if(!o.match(/\S*Error: /)){for(const e of t){const t=e(o);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(),pc.test(t[t.length-1].function||"")&&(t.pop(),pc.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 mc(e){return Array.isArray(e)?gc(...e):e}const vc="<anonymous>";function yc(e){try{return e&&"function"==typeof e&&e.name||vc}catch{return vc}}const bc={},wc={};function xc(e,t){bc[e]=bc[e]||[],bc[e].push(t)}function Cc(e,t){wc[e]||(t(),wc[e]=!0)}function _c(e,t){const r=e&&bc[e];if(r)for(const n of r)try{n(t)}catch(t){Yl&&Jl.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${yc(n)}\nError:`,t)}}function Sc(){"console"in Vl&&Xl.forEach(function(e){e in Vl.console&&ic(Vl.console,e,function(t){return Kl[e]=t,function(...t){_c("console",{args:t,level:e});const r=Kl[e];r&&r.apply(Vl.console,t)}})})}function kc(){const e=Vl,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 Ac(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Ic(e){const{message:t,event_id:r}=e;if(t)return t;const n=Ac(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Ec(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 Fc(e,t){const r=Ac(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 Tc(e){if(e&&e.__sentry_captured__)return!0;try{oc(e,"__sentry_captured__",!0)}catch{}return!1}function Oc(e){return Array.isArray(e)?e:[e]}const Pc=Vl;let Mc,Rc,Lc;function Nc(){if(!Pc.document)return;const e=_c.bind(null,"dom"),t=jc(e,!0);Pc.document.addEventListener("click",t,!1),Pc.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const r=Pc[t]&&Pc[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(ic(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=jc(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}}),ic(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 jc(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;oc(r,"_sentryCaptured",!0),n&&!n._sentryId&&oc(n,"_sentryId",kc());const i="keypress"===r.type?"input":r.type;(function(e){if(e.type!==Rc)return!1;try{if(!e.target||e.target._sentryId!==Lc)return!1}catch{}return!0})(r)||(e({event:r,name:i,global:t}),Rc=r.type,Lc=n?n._sentryId:void 0),clearTimeout(Mc),Mc=Pc.setTimeout(()=>{Lc=void 0,Rc=void 0},1e3)}}const Dc=Hl();function zc(){if(!("fetch"in Dc))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Bc(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Uc(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!zc())return!1;if(Bc(Dc.fetch))return!0;let e=!1;const t=Dc.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=Bc(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){Yl&&Jl.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&ic(Vl,"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:Hc(t),method:Vc(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Hc(t),method:Vc(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return _c("fetch",{...i}),e.apply(Vl,t).then(e=>(_c("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw _c("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function Vc(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Hc(e){return"string"==typeof e?e:e?Vc(e,"url")?e.url:e.toString?e.toString():"":""}let $c=null;function Wc(){$c=Vl.onerror,Vl.onerror=function(e,t,r,n,i){return _c("error",{column:n,error:i,line:r,msg:e,url:t}),!(!$c||$c.__SENTRY_LOADER__)&&$c.apply(this,arguments)},Vl.onerror.__SENTRY_INSTRUMENTED__=!0}let Gc=null;function qc(){Gc=Vl.onunhandledrejection,Vl.onunhandledrejection=function(e){return _c("unhandledrejection",e),!(Gc&&!Gc.__SENTRY_LOADER__)||Gc.apply(this,arguments)},Vl.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Yc=Hl();const Xc=Vl;let Kc;function Zc(e){const t="history";xc(t,e),Cc(t,Jc)}function Jc(){if(!function(){const e=Yc.chrome,t=e&&e.app&&e.app.runtime,r="history"in Yc&&!!Yc.history.pushState&&!!Yc.history.replaceState;return!t&&r}())return;const e=Xc.onpopstate;function t(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const e=Kc,t=String(r);Kc=t,_c("history",{from:e,to:t})}return e.apply(this,t)}}Xc.onpopstate=function(...t){const r=Xc.location.href,n=Kc;if(Kc=r,_c("history",{from:n,to:r}),e)try{return e.apply(this,t)}catch{}},ic(Xc.history,"pushState",t),ic(Xc.history,"replaceState",t)}const Qc=Vl,eu="__sentry_xhr_v3__";function tu(){if(!Qc.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;ic(e,"open",function(e){return function(...t){const r=Date.now(),n=kl(t[0])?t[0].toUpperCase():void 0,i=function(e){if(kl(e))return e;try{return e.toString()}catch{}}(t[1]);if(!n||!i)return e.apply(this,t);this[eu]={method:n,url:i,request_headers:{}},"POST"===n&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[eu];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}_c("xhr",{args:[n,i],endTimestamp:Date.now(),startTimestamp:r,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?ic(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),ic(this,"setRequestHeader",function(e){return function(...t){const[r,n]=t,i=this[eu];return i&&kl(r)&&kl(n)&&(i.request_headers[r.toLowerCase()]=n),e.apply(this,t)}}),e.apply(this,t)}}),ic(e,"send",function(e){return function(...t){const r=this[eu];if(!r)return e.apply(this,t);void 0!==t[0]&&(r.body=t[0]);return _c("xhr",{args:[r.method,r.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}function ru(e,t=100,r=1/0){try{return iu("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function nu(e,t=3,r=102400){const n=ru(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(n)>r?nu(e,t-1,r):n}function iu(e,t,r=1/0,n=1/0,i=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[o,a]=i;if(null==t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;const s=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Pl(t))return"[VueViewModel]";if(function(e){return El(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: ${yc(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;const l="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===l)return s.replace("object ","");if(o(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return iu("",c.toJSON(),l-1,n,i)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const h=lc(t);for(const e in h){if(!Object.prototype.hasOwnProperty.call(h,e))continue;if(d>=n){u[e]="[MaxProperties ~]";break}const t=h[e];u[e]=iu(e,t,l-1,n,i),d++}return a(t),u}var ou;function au(e){return new lu(t=>{t(e)})}function su(e){return new lu((t,r)=>{r(e)})}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(ou||(ou={}));class lu{constructor(e){lu.prototype.__init.call(this),lu.prototype.__init2.call(this),lu.prototype.__init3.call(this),lu.prototype.__init4.call(this),this._state=ou.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new lu((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 lu((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(ou.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(ou.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===ou.PENDING){if(Tl(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===ou.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===ou.RESOLVED&&e[1](this._value),this._state===ou.REJECTED&&e[2](this._value),e[0]=!0)})}}}function cu(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 su(new nc("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 lu((r,n)=>{let i=t.length;if(!i)return r(!0);const o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{au(e).then(()=>{--i||(clearTimeout(o),r(!0))},n)})})}}}function uu(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 du=["fatal","error","warning","log","info","debug"];function hu(e){return"warn"===e?"warning":du.includes(e)?e:"log"}function fu(){return Date.now()/1e3}const pu=function(){const{performance:e}=Vl;if(!e||!e.now)return fu;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/1e3}();function gu(e,t=[]){return[e,t]}function mu(e,t){const[r,n]=e;return[r,[...n,t]]}function vu(e,t){const r=e[1];for(const e of r){if(t(e,e[0].type))return!0}return!1}function yu(e,t){return(t||new TextEncoder).encode(e)}function bu(e,t){const[r,n]=e;let i=JSON.stringify(r);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[yu(i,t),e]:i.push("string"==typeof e?yu(e,t):e)}for(const e of n){const[t,r]=e;if(o(`\n${JSON.stringify(t)}\n`),"string"==typeof r||r instanceof Uint8Array)o(r);else{let e;try{e=JSON.stringify(r)}catch{e=JSON.stringify(ru(r))}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 t of e)r.set(t,n),n+=t.length;return r}(i)}function wu(e,t){const r="string"==typeof e.data?yu(e.data,t):e.data;return[dc({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}(()=>{const{performance:e}=Vl;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 xu={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 Cu(e){return xu[e]}function _u(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function Su(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 e of o.trim().split(",")){const[t,r,,,o]=e.split(":",5),a=parseInt(t,10),s=1e3*(isNaN(a)?60:a);if(r)for(const e of r.split(";"))"metric_bucket"===e?(!o||o.split(";").includes("custom"))&&(i[e]=n+s):i[e]=n+s;else i.all=n+s}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}const ku=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Au="production";function Iu(){return $l("globalEventProcessors",()=>[])}function Eu(e){Iu().push(e)}function Fu(e,t,r,n=0){return new lu((i,o)=>{const a=e[n];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},r);ku&&a.id&&null===s&&Jl.log(`Event processor "${a.id}" dropped event`),Tl(s)?s.then(t=>Fu(e,t,r,n+1).then(i)).then(null,o):Fu(e,s,r,n+1).then(i).then(null,o)}})}function Tu(e){const t=pu(),r={sid:kc(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return dc({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&&Ou(r,e),r}function Ou(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||pu(),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:kc()),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 Pu(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),Ou(e,r)}function Mu(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:o,status:a,tags:s,origin:l}=Ru(e);return dc({data:n,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:r,origin:l})}function Ru(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}function Lu(e,t,r,n,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||kc(),timestamp:t.timestamp||fu()},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:Au),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=Ml(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Ml(a.value,o));const s=e.request;s&&s.url&&(s.url=Ml(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=Vl._sentryDebugIds;if(!r)return;let n;const i=Nu.get(t);i?n=i:(n=new Map,Nu.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 Ju;return r.update(t),r}(n,r.captureContext);r.mechanism&&Fc(l,r.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(Zu||(Zu=new Ju),Zu).getScopeData();if(o){Xu(h,o.getScopeData())}if(u){Xu(h,u.getScopeData())}const f=[...r.attachments||[],...h.attachments];f.length&&(r.attachments=f),Yu(l,h);return Fu([...d,...Iu(),...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:ru(e.data,t,r)}}))},...e.user&&{user:ru(e.user,t,r)},...e.contexts&&{contexts:ru(e.contexts,t,r)},...e.extra&&{extra:ru(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=ru(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(e=>{const n=Ru(e).data;return n&&(e.data=ru(n,t,r)),e})),n}(e,a,s):e))}const Nu=new WeakMap;function ju(e,t){return ad().captureEvent(e,t)}function Du(e,t){ad().addBreadcrumb(e,t)}function zu(){return ad().getClient()}function Bu(){return ad().getScope()}function Uu(e){const t=zu(),r=sd(),n=Bu(),{release:i,environment:o=Au}=t&&t.getOptions()||{},{userAgent:a}=Vl.navigator||{},s=Tu({release:i,environment:o,user:n.getUser()||r.getUser(),...a&&{userAgent:a},...e}),l=r.getSession();return l&&"ok"===l.status&&Ou(l,{status:"exited"}),Vu(),r.setSession(s),n.setSession(s),s}function Vu(){const e=sd(),t=Bu(),r=t.getSession()||e.getSession();r&&Pu(r),Hu(),e.setSession(),t.setSession()}function Hu(){const e=sd(),t=Bu(),r=zu(),n=t.getSession()||e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}function $u(e=!1){e?Vu():Hu()}function Wu(e){return e.transaction}function Gu(e,t,r){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=r&&r.getUser()||{},a=dc({environment:n.environment||Au,release:n.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function qu(e){const t=zu();if(!t)return{};const r=Gu(Ru(e).trace_id||"",t,Bu()),n=Wu(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=Ru(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 Yu(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=dc(r);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=dc(n);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=dc(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=dc(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:Mu(t),...e.contexts};const r=Wu(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:qu(t),...e.sdkProcessingMetadata};const n=Ru(r).description;n&&(e.tags={transaction:n,...e.tags})}}(e,n),function(e,t){e.fingerprint=e.fingerprint?Oc(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 Xu(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;Ku(e,"extra",r),Ku(e,"tags",n),Ku(e,"user",i),Ku(e,"contexts",o),Ku(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 Ku(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 Zu;class Ju{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Qu()}static clone(e){return e?e.clone():new Ju}clone(){const e=new Ju;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&&Ou(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 Ju){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(El(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=Qu(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:100;if(r<=0)return this;const n={timestamp:fu(),...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=[]){Yu(e,this.getScopeData());return Fu([...r,...Iu(),...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:kc();if(!this._client)return Jl.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:kc();if(!this._client)return Jl.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:kc();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(Jl.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 Qu(){return{traceId:kc(),spanId:kc().substring(16)}}const ed="7.116.0",td=parseFloat(ed),rd=100;class nd{constructor(e,t,r,n=td){let i,o;this._version=n,t?i=t:(i=new Ju,i.setClient(e)),r?o=r:(o=new Ju,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 Tl(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:kc(),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:kc(),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:kc();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=rd}=n.getOptions&&n.getOptions()||{};if(o<=0)return;const a={timestamp:fu(),...e},s=i?Zl(()=>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=od(this);try{e(this)}finally{od(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return ku&&Jl.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const r=this._callExtensionMethod("startTransaction",e,t);return ku&&!r&&(this.getClient()?Jl.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):Jl.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&&Pu(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i=Au}=r&&r.getOptions()||{},{userAgent:o}=Vl.navigator||{},a=Tu({release:n,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&Ou(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=id().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);ku&&Jl.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function id(){return Vl.__SENTRY__=Vl.__SENTRY__||{extensions:{},hub:void 0},Vl}function od(e){const t=id(),r=ld(t);return cd(t,e),r}function ad(){const e=id();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=id()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||ld(e).isOlderThan(td))&&cd(e,new nd),ld(e)}(e)}function sd(){return ad().getIsolationScope()}function ld(e){return $l("hub",()=>new nd,e)}function cd(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}function ud(e,t,r,n){const i=_u(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:ec(n)},...i&&{trace:dc({...i})}}}(e,i,n,t);return delete e.sdkProcessingMetadata,gu(a,[[{type:o},e]])}function dd(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}`}})}const hd=[];function fd(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?Oc(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 pd(e,t){for(const r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function gd(e,t,r){if(r[t.name])ku&&Jl.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,-1===hd.indexOf(t.name)&&(t.setupOnce(Eu,ad),hd.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)}ku&&Jl.log(`Integration installed: ${t.name}`)}}function md(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}function vd(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=ec(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 gu(i,[o])}const yd="Not capturing exception because it's already been captured.";class bd{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=rc(e.dsn):ku&&Jl.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)}?${dd(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(Tc(e))return void(ku&&Jl.log(yd));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=Al(e)?e:String(e),a=Il(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&&Tc(t.originalException))return void(ku&&Jl.log(yd));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?ku&&Jl.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Ou(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))):au(!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 ku&&Jl.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];gd(this,e,this._integrations),t||pd(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=ud(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])r=mu(r,wu(e,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=_u(r);return gu({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:ec(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}`;ku&&Jl.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}captureAggregateMetrics(e){ku&&Jl.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=vd(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&&gd(e,t,r)}),r}(this,e),pd(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)&&(Ou(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new lu(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=sd()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),Lu(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||Gu(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(ku){const t=e;"log"===t.logLevel?Jl.log(t.message):Jl.warn(t)}})}_processEvent(e,t,r){const n=this.getOptions(),{sampleRate:i}=n,o=xd(e),a=wd(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),su(new nc(`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 nc("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 wd(t)&&n?n(t,r):xd(t)&&i?i(t,r):t}(n,r,t);return function(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Tl(e))return e.then(e=>{if(!El(e)&&null!==e)throw new nc(r);return e},e=>{throw new nc(`${t} rejected with ${e}`)});if(!El(e)&&null!==e)throw new nc(r);return e}(i,l)}).then(n=>{if(null===n)throw this.recordDroppedEvent("before_send",c,e),new nc(`${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 nc?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new nc(`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=>{ku&&Jl.error("Error while sending event:",e)});ku&&Jl.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 wd(e){return void 0===e.type}function xd(e){return"transaction"===e.type}function Cd(e,t){!0===t.debug&&(ku?Jl.enable():Zl(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Bu().update(t.initialScope);const r=new e(t);(function(e){const t=ad().getStackTop();t.client=e,t.scope.setClient(e)})(r),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(r)}function _d(e,t,r=cu(e.bufferSize||30)){let n={};function i(i){const o=[];if(vu(i,(t,r)=>{const i=Cu(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=Sd(t,r);e.recordDroppedEvent("ratelimit_backoff",i,n)}else o.push(t)}),0===o.length)return au();const a=gu(i[0],o),s=t=>{vu(a,(r,n)=>{const i=Sd(r,n);e.recordDroppedEvent(t,Cu(n),i)})};return r.add(()=>t({body:bu(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&ku&&Jl.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=Su(n,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof nc)return ku&&Jl.error("Skipped sending event because buffer is full."),s("queue_overflow"),au();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>r.drain(e)}}function Sd(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function kd(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:ed})),version:ed}),e._metadata=i}const Ad=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Id=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Ed="InboundFilters",Fd=(e={})=>({name:Ed,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?[]:Ad],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Id],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)?(ku&&Jl.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Ic(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}`)),ku&&0===t.length&&Jl.error(`Could not extract message for event ${Ic(e)}`),t}(e).some(e=>Nl(e,t))}(e,t.ignoreErrors)?(ku&&Jl.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Ic(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const r=e.transaction;return!!r&&Nl(r,t)}(e,t.ignoreTransactions)?(ku&&Jl.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Ic(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const r=Td(e);return!!r&&Nl(r,t)}(e,t.denyUrls)?(ku&&Jl.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Ic(e)}.\nUrl: ${Td(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const r=Td(e);return!r||Nl(r,t)}(e,t.allowUrls)&&(ku&&Jl.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Ic(e)}.\nUrl: ${Td(e)}`),!0)}(t,o)?null:t}});function Td(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 ku&&Jl.error(`Cannot extract url for event ${Ic(e)}`),null}}let Od;md(Ed,Fd);const Pd="FunctionToString",Md=new WeakMap,Rd=()=>({name:Pd,setupOnce(){Od=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=sc(this),r=Md.has(zu())&&void 0!==t?t:this;return Od.apply(r,e)}}catch{}},setup(e){Md.set(e,!0)}});md(Pd,Rd);const Ld=Vl;let Nd=0;function jd(){return Nd>0}function Dd(e,t={},r){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(sc(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=>Dd(e,t));return e.apply(this,i)}catch(e){throw Nd++,setTimeout(()=>{Nd--}),function(...e){const t=ad();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])}(r=>{r.addEventProcessor(e=>(t.mechanism&&(Ec(e,void 0),Fc(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),function(e){ad().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}ac(n,e),oc(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}const zd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Bd(e,t){const r=Vd(e,t),n={type:t&&t.name,value:$d(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function Ud(e,t){return{exception:{values:[Bd(e,t)]}}}function Vd(e,t){const r=t.stacktrace||t.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(Hd.test(e.message))return 1}return 0}(t);try{return e(r,n)}catch{}return[]}const Hd=/Minified React error #\d+;/i;function $d(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Wd(e,t,r,n,i){let o;if(_l(t)&&t.error)return Ud(e,t.error);if(Sl(t)||function(e){return Cl(e,"DOMException")}(t)){const i=t;if("stack"in t)o=Ud(e,t);else{const t=i.name||(Sl(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=Gd(e,a,r,n),Ec(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return xl(t)?Ud(e,t):El(t)||Fl(t)?(o=function(e,t,r,n){const i=zu(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:Fl(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:qd(t,{isUnhandledRejection:n})}]},extra:{__serialized__:nu(t,o)}};if(r){const t=Vd(e,r);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,r,i),Fc(o,{synthetic:!0}),o):(o=Gd(e,t,r,n),Ec(o,`${t}`),Fc(o,{synthetic:!0}),o)}function Gd(e,t,r,n){const i={};if(n&&r){const n=Vd(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]})}if(Al(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 qd(e,{isUnhandledRejection:t}){const r=function(e,t=40){const r=Object.keys(lc(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Ml(r[0],t);for(let e=r.length;e>0;e--){const n=r.slice(0,e).join(", ");if(!(n.length>t))return e===r.length?n:Ml(n,t)}return""}(e),n=t?"promise rejection":"exception";return _l(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:Fl(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 Yd extends bd{constructor(e){kd(e,"browser",["browser"],Ld.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&Ld.document&&Ld.document.addEventListener("visibilitychange",()=>{"hidden"===Ld.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,r,n){const i=Wd(e,t,r&&r.syntheticException||void 0,n);return Fc(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),au(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return function(e,t,r="info",n,i){const o=Gd(e,t,n&&n.syntheticException||void 0,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),au(o)}(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(zd&&Jl.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:ec(n)}},o=function(e){return[{type:"user_report"},e]}(e);return gu(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(zd&&Jl.log("No outcomes to send"));if(!this._dsn)return void(zd&&Jl.log("No dsn provided, will not send outcomes"));zd&&Jl.log("Sending outcomes:",e);const t=function(e,t){return gu(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:fu(),discarded_events:e}]])}(e,this._options.tunnel&&ec(this._dsn));this._sendEnvelope(t)}}let Xd;function Kd(e,t=function(){if(Xd)return Xd;if(Bc(Ld.fetch))return Xd=Ld.fetch.bind(Ld);const e=Ld.document;let t=Ld.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){zd&&Jl.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Xd=t.bind(Ld)}()){let r=0,n=0;return _d(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 Xd=void 0,r-=o,n--,su(e)}})}function Zd(e){return _d(e,function(t){return new lu((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 Jd="?";function Qd(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 eh=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,th=/\((\S*)(?::(\d+))(?::(\d+))\)/,rh=[30,e=>{const t=eh.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=th.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,r]=ch(t[1]||Jd,t[2]);return Qd(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],nh=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ih=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,oh=[50,e=>{const t=nh.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ih.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]||Jd;return[r,e]=ch(r,e),Qd(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],ah=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,sh=[40,e=>{const t=ah.exec(e);return t?Qd(t[2],t[1]||Jd,+t[3],t[4]?+t[4]:void 0):void 0}],lh=gc(...[rh,oh,sh]),ch=(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]:Jd,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},uh=1024,dh="Breadcrumbs",hh=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:dh,setupOnce(){},setup(e){t.console&&function(e){const t="console";xc(t,e),Cc(t,Sc)}(function(e){return function(t){if(zu()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:hu(t.level),message:Rl(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${Rl(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}Du(r,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){xc("dom",e),Cc("dom",Nc)}(function(e,t){return function(r){if(zu()!==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>uh&&(zd&&Jl.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=uh),"string"==typeof o&&(o=[o]);try{const e=r.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;n=Gl(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!Wl.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){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}),Du(s,{event:r.event,name:r.name,global:r.global})}}(e,t.dom)),t.xhr&&function(e){xc("xhr",e),Cc("xhr",tu)}(function(e){return function(t){if(zu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[eu];if(!r||!n||!i)return;const{method:o,url:a,status_code:s,body:l}=i;Du({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";xc(t,e),Cc(t,Uc)}(function(e){return function(t){if(zu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){Du({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:r,endTimestamp:n})}else{const e=t.response;Du({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:r,endTimestamp:n})}}}(e)),t.history&&Zc(function(e){return function(t){if(zu()!==e)return;let r=t.from,n=t.to;const i=uu(Ld.location.href);let o=r?uu(r):void 0;const a=uu(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),Du({category:"navigation",data:{from:r,to:n}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){zu()===e&&Du({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:Ic(t)},{event:t})}}(e))}}};md(dh,hh);const fh="Dedupe",ph=()=>{let e;return{name:fh,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||!mh(e,t)||!gh(e,t))}(e,t)&&!function(e,t){const r=vh(t),n=vh(e);return!!(r&&n&&r.type===n.type&&r.value===n.value&&mh(e,t)&&gh(e,t))}(e,t))}(t,e))return zd&&Jl.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function gh(e,t){let r=yh(e),n=yh(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const t=n[e],i=r[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function mh(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 vh(e){return e.exception&&e.exception.values&&e.exception.values[0]}function yh(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}md(fh,ph);const bh="GlobalHandlers",wh=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:bh,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";xc(t,e),Cc(t,Wc)}(t=>{const{stackParser:r,attachStacktrace:n}=_h();if(zu()!==e||jd())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&kl(i)?function(e,t,r,n){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=_l(e)?e.message:e,a="Error";const s=o.match(i);return s&&(a=s[1],o=s[2]),xh({exception:{values:[{type:a,value:o}]}},t,r,n)}(i,o,a,s):xh(Wd(r,l||i,void 0,n,!1),o,a,s);c.level="error",ju(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),Ch("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";xc(t,e),Cc(t,qc)}(t=>{const{stackParser:r,attachStacktrace:n}=_h();if(zu()!==e||jd())return;const i=function(e){if(Il(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=Il(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):Wd(r,i,void 0,n,!0);o.level="error",ju(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),Ch("onunhandledrejection"))}}};function xh(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=kl(t)&&t.length>0?t:function(){try{return Wl.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function Ch(e){zd&&Jl.log(`Global Handler attached: ${e}`)}function _h(){const e=zu();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}md(bh,wh);const Sh="HttpContext",kh=()=>({name:Sh,setupOnce(){},preprocessEvent(e){if(!Ld.navigator&&!Ld.location&&!Ld.document)return;const t=e.request&&e.request.url||Ld.location&&Ld.location.href,{referrer:r}=Ld.document||{},{userAgent:n}=Ld.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}});md(Sh,kh);const Ah="LinkedErrors",Ih=(e={})=>{const t=e.limit||5,r=e.key||"cause";return{name:Ah,setupOnce(){},preprocessEvent(e,n,i){const o=i.getOptions();jl(Bd,o.stackParser,o.maxValueLength,r,t,e,n)}}};md(Ah,Ih);const Eh=["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"],Fh="TryCatch",Th=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:Fh,setupOnce(){t.setTimeout&&ic(Ld,"setTimeout",Oh),t.setInterval&&ic(Ld,"setInterval",Oh),t.requestAnimationFrame&&ic(Ld,"requestAnimationFrame",Ph),t.XMLHttpRequest&&"XMLHttpRequest"in Ld&&ic(XMLHttpRequest.prototype,"send",Mh);const e=t.eventTarget;e&&(Array.isArray(e)?e:Eh).forEach(Rh)}}};function Oh(e){return function(...t){const r=t[0];return t[0]=Dd(r,{mechanism:{data:{function:yc(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Ph(e){return function(t){return e.apply(this,[Dd(t,{mechanism:{data:{function:"requestAnimationFrame",handler:yc(e)},handled:!1,type:"instrument"}})])}}function Mh(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in r&&"function"==typeof r[e]&&ic(r,e,function(t){const r={mechanism:{data:{function:e,handler:yc(t)},handled:!1,type:"instrument"}},n=sc(t);return n&&(r.mechanism.data.handler=yc(n)),Dd(t,r)})}),e.apply(this,t)}}function Rh(e){const t=Ld,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(ic(r,"addEventListener",function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=Dd(n.handleEvent,{mechanism:{data:{function:"handleEvent",handler:yc(n),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[r,Dd(n,{mechanism:{data:{function:"addEventListener",handler:yc(n),target:e},handled:!1,type:"instrument"}}),i])}}),ic(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)}}))}md(Fh,Th);const Lh=[Fd(),Rd(),Th(),hh(),wh(),Ih(),ph(),kh()];function Nh(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...Lh]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),Ld.SENTRY_RELEASE&&Ld.SENTRY_RELEASE.id&&(e.release=Ld.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:mc(e.stackParser||lh),integrations:fd(e),transport:e.transport||(zc()?Kd:Zd)};Cd(Yd,t),e.autoSessionTracking&&function(){if(typeof Ld.document>"u")return void(zd&&Jl.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));Uu({ignoreDuration:!0}),$u(),Zc(({from:e,to:t})=>{void 0!==e&&e!==t&&(Uu({ignoreDuration:!0}),$u())})}()}var jh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zh(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}var Bh=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(Bh||{}),Uh=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(Uh||{});function Vh(e,t){return{...t,message:e}}const Hh=[{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}],$h={emoticons:Vh("Emoticons"),doodles:Vh("Doodles"),landmarks:Vh("Landmarks"),bubbles:Vh("Bubbles"),transportation:Vh("Transportation"),beach:Vh("Beach")},Wh={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},Gh=[1,8,15,20,25];var qh=(e=>(e.DARK="dark",e.LIGHT="light",e))(qh||{});const Yh=[{name:qh.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:qh.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 Xh=(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))(Xh||{});function Kh(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=Kh(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Zh(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Kh(e))&&(n&&(n+=" "),n+=t);return n}const Jh=p((r,n)=>{const{attr:i,size:o,title:a,className:s,color:l,style:c,children:u,viewBox:d,width:h,height:f,...p}=r;return t("svg",{"aria-hidden":!a,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:d||"0 0 24 24",...i,...p,className:Zh("svg-icon",s,Qh(o)),style:{color:l,...c},ref:n,height:f||"1em",width:h||"1em",children:[a&&e("title",{children:a}),u]})});function Qh(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 ef(t,r="",n){return i.memo(i.forwardRef((i,o)=>e(Jh,{"data-testid":`${r}Icon`,ref:o,viewBox:n,...i,size:i.size||"md",children:t})))}function tf(e,t=""){return ef(rf(e),t)}function rf(e){return(null==e?void 0:e.map)&&e.map((e,t)=>i.createElement(e.tag,{key:t,...e.attr},rf(e.child)))}const nf=ef(e("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),of=ef(e("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"),af=ef(e("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),sf=ef(e("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),lf=ef(e("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"),cf=ef(e("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"),uf=ef(e("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"),df=ef(e("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"),hf=ef(e("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"),ff=ef(e("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"),pf=ef(e("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"),gf=ef([e("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"),e("circle",{cx:"11",cy:"9",r:"1"},"1"),e("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"},"2")],"StyleOutlined"),mf=ef(e("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"),vf=ef(e("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"),yf=ef(e("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),bf={[Xh.FILTER]:{name:Vh("Applied Filters"),icon:nf},[Xh.RESIZE]:{name:Vh("Resized Image"),icon:of},[Xh.CROP]:{name:Vh("Cropped Image"),icon:af},[Xh.DRAW]:{name:Vh("Added Drawing"),icon:vf},[Xh.TEXT]:{name:Vh("Added Text"),icon:sf},[Xh.SHAPES]:{name:Vh("Added Shape"),icon:lf},[Xh.STICKERS]:{name:Vh("Added Sticker"),icon:cf},[Xh.FRAME]:{name:Vh("Added Frame"),icon:uf},[Xh.MERGE]:{name:Vh("Merged Objects"),icon:df},[Xh.CORNERS]:{name:Vh("Rounded Corner"),icon:hf},bgImage:{name:Vh("Replaced Background Image"),icon:ff},overlayImage:{name:Vh("Added Image"),icon:ff},initial:{name:Vh("Initial"),icon:yf},loadedState:{name:Vh("Loaded State"),icon:pf},objectStyle:{name:Vh("Changed Style"),icon:gf},deletedObject:{name:Vh("Deleted object"),icon:mf}},wf=Object.values(Xh).map(e=>({name:e,icon:bf[e].icon,action:e===Xh.MERGE?e=>{e.tools.merge.apply()}:e})),xf={filter:Vh("filter"),resize:Vh("resize"),crop:Vh("crop"),draw:Vh("draw"),text:Vh("text"),shapes:Vh("shapes"),stickers:Vh("stickers"),frame:Vh("frame"),corners:Vh("corners"),merge:Vh("merge")},Cf=ef(e("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"),_f="3.0.5",Sf={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:Bh.INLINE,forceOverlayModeOnMobile:!0,activeTheme:qh.LIGHT,themes:Yh,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:pf,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:Cf,label:Vh("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:Uh.BOTTOM,items:[...wf]},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:{...Wh},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:Gh,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:Hh},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}}]}}},kf=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 Af={exports:{}},If={},Ef={exports:{}},Ff={},Tf=i;
9
+ */var ko=(Co||(Co=1,function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=256,c=1/0,u=9007199254740991,d=NaN,h=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],p="[object Arguments]",g="[object Array]",m="[object Boolean]",v="[object Date]",y="[object Error]",b="[object Function]",w="[object GeneratorFunction]",x="[object Map]",C="[object Number]",_="[object Object]",S="[object Promise]",k="[object RegExp]",A="[object Set]",I="[object String]",E="[object Symbol]",F="[object WeakMap]",T="[object ArrayBuffer]",O="[object DataView]",P="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",L="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",D="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",U=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,G=RegExp($.source),q=RegExp(W.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),re=/^\s+/,ne=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",ke="\\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",Ie="['’]",Ee="["+we+"]",Fe="["+Ae+"]",Te="["+xe+"]",Oe="\\d+",Pe="["+Ce+"]",Me="["+_e+"]",Re="[^"+we+Ae+Oe+Ce+_e+Se+"]",Le="\\ud83c[\\udffb-\\udfff]",Ne="[^"+we+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",De="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Se+"]",Be="\\u200d",Ue="(?:"+Me+"|"+Re+")",Ve="(?:"+ze+"|"+Re+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Te+"|"+Le+")?",Ge="["+ke+"]?",qe=Ge+We+"(?:"+Be+"(?:"+[Ne,je,De].join("|")+")"+Ge+We+")*",Ye="(?:"+[Pe,je,De].join("|")+")"+qe,Xe="(?:"+[Ne+Te+"?",Te,je,De,Ee].join("|")+")",Ke=RegExp(Ie,"g"),Ze=RegExp(Te,"g"),Je=RegExp(Le+"(?="+Le+")|"+Xe+qe,"g"),Qe=RegExp([ze+"?"+Me+"+"+He+"(?="+[Fe,ze,"$"].join("|")+")",Ve+"+"+$e+"(?="+[Fe,ze+Ue,"$"].join("|")+")",ze+"?"+Ue+"+"+He,ze+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ye].join("|"),"g"),et=RegExp("["+Be+we+xe+ke+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["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"],nt=-1,it={};it[P]=it[M]=it[R]=it[L]=it[N]=it[j]=it[D]=it[z]=it[B]=!0,it[p]=it[g]=it[T]=it[m]=it[O]=it[v]=it[y]=it[b]=it[x]=it[C]=it[_]=it[k]=it[A]=it[I]=it[F]=!1;var ot={};ot[p]=ot[g]=ot[T]=ot[O]=ot[m]=ot[v]=ot[P]=ot[M]=ot[R]=ot[L]=ot[N]=ot[x]=ot[C]=ot[_]=ot[k]=ot[A]=ot[I]=ot[E]=ot[j]=ot[D]=ot[z]=ot[B]=!0,ot[y]=ot[b]=ot[F]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Pn&&Pn&&Pn.Object===Object&&Pn,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),ht=t&&!t.nodeType&&t,ft=ht&&e&&!e.nodeType&&e,pt=ft&&ft.exports===ht,gt=pt&&ct.process,mt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),vt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,bt=mt&&mt.isMap,wt=mt&&mt.isRegExp,xt=mt&&mt.isSet,Ct=mt&&mt.isTypedArray;function _t(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 St(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 kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function At(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function It(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 Et(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 Ft(e,t){return!(null==e||!e.length)&&zt(e,t,0)>-1}function Tt(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 Ot(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 Pt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Mt(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 Rt(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 Lt(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 Nt=Ht("length");function jt(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function Dt(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 zt(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):Dt(e,Ut,r)}function Bt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Ut(e){return e!=e}function Vt(e,t){var r=null==e?0:e.length;return r?Gt(e,t)/r:d}function Ht(e){return function(t){return null==t?r:t[e]}}function $t(e){return function(t){return null==e?r:e[t]}}function Wt(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}function Gt(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 qt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Yt(e){return e?e.slice(0,dr(e)+1).replace(re,""):e}function Xt(e){return function(t){return e(t)}}function Kt(e,t){return Ot(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var r=-1,n=e.length;++r<n&&zt(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length;r--&&zt(t,e[r],0)>-1;);return r}var er=$t({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tr=$t({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rr(e){return"\\"+at[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function or(e,t){return function(r){return e(t(r))}}function ar(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 sr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function lr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}function cr(e){return nr(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Nt(e)}function ur(e){return nr(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function dr(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t}var hr=$t({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),fr=function e(t){var ne,we=(t=null==t?dt:fr.defaults(dt.Object(),t,fr.pick(dt,rt))).Array,xe=t.Date,Ce=t.Error,_e=t.Function,Se=t.Math,ke=t.Object,Ae=t.RegExp,Ie=t.String,Ee=t.TypeError,Fe=we.prototype,Te=_e.prototype,Oe=ke.prototype,Pe=t["__core-js_shared__"],Me=Te.toString,Re=Oe.hasOwnProperty,Le=0,Ne=(ne=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",je=Oe.toString,De=Me.call(ke),ze=dt._,Be=Ae("^"+Me.call(Re).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=pt?t.Buffer:r,Ve=t.Symbol,He=t.Uint8Array,$e=Ue?Ue.allocUnsafe:r,We=or(ke.getPrototypeOf,ke),Ge=ke.create,qe=Oe.propertyIsEnumerable,Ye=Fe.splice,Xe=Ve?Ve.isConcatSpreadable:r,Je=Ve?Ve.iterator:r,et=Ve?Ve.toStringTag:r,at=function(){try{var e=uo(ke,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=xe&&xe.now!==dt.Date.now&&xe.now,ht=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=Se.ceil,gt=Se.floor,mt=ke.getOwnPropertySymbols,Nt=Ue?Ue.isBuffer:r,$t=t.isFinite,pr=Fe.join,gr=or(ke.keys,ke),mr=Se.max,vr=Se.min,yr=xe.now,br=t.parseInt,wr=Se.random,xr=Fe.reverse,Cr=uo(t,"DataView"),_r=uo(t,"Map"),Sr=uo(t,"Promise"),kr=uo(t,"Set"),Ar=uo(t,"WeakMap"),Ir=uo(ke,"create"),Er=Ar&&new Ar,Fr={},Tr=jo(Cr),Or=jo(_r),Pr=jo(Sr),Mr=jo(kr),Rr=jo(Ar),Lr=Ve?Ve.prototype:r,Nr=Lr?Lr.valueOf:r,jr=Lr?Lr.toString:r;function Dr(e){if(es(e)&&!Ha(e)&&!(e instanceof Vr)){if(e instanceof Ur)return e;if(Re.call(e,"__wrapped__"))return Do(e)}return new Ur(e)}var zr=function(){function e(){}return function(t){if(!Qa(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Br(){}function Ur(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Vr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}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.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wr(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 Gr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Wr;++t<r;)this.add(e[t])}function qr(e){var t=this.__data__=new $r(e);this.size=t.size}function Yr(e,t){var r=Ha(e),n=!r&&Va(e),i=!r&&!n&&qa(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?qt(e.length,Ie):[],l=s.length;for(var c in e)!t&&!Re.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yo(c,l))||s.push(c);return s}function Xr(e){var t=e.length;return t?e[qn(0,t-1)]:r}function Kr(e,t){return Ro(Ei(e),an(t,0,e.length))}function Zr(e){return Ro(Ei(e))}function Jr(e,t,n){(n!==r&&!za(e[t],n)||n===r&&!(t in e))&&nn(e,t,n)}function Qr(e,t,n){var i=e[t];Re.call(e,t)&&za(i,n)&&(n!==r||t in e)||nn(e,t,n)}function en(e,t){for(var r=e.length;r--;)if(za(e[r][0],t))return r;return-1}function tn(e,t,r,n){return dn(e,function(e,i,o){t(n,e,r(e),o)}),n}function rn(e,t){return e&&Fi(t,Ts(t),e)}function nn(e,t,r){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function on(e,t){for(var n=-1,i=t.length,o=we(i),a=null==e;++n<i;)o[n]=a?r:ks(e,t[n]);return o}function an(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function sn(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(!Qa(e))return e;var d=Ha(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Re.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Ei(e,s)}else{var h=po(e),f=h==b||h==w;if(qa(e))return Ci(e,l);if(h==_||h==p||f&&!o){if(s=c||f?{}:mo(e),!l)return c?function(e,t){return Fi(e,fo(e),t)}(e,function(e,t){return e&&Fi(t,Os(t),e)}(s,e)):function(e,t){return Fi(e,ho(e),t)}(e,rn(s,e))}else{if(!ot[h])return o?e:{};s=function(e,t,r){var n,i=e.constructor;switch(t){case T:return _i(e);case m:case v:return new i(+e);case O:return function(e,t){var r=t?_i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case P:case M:case R:case L:case N:case j:case D:case z:case B:return Si(e,r);case x:return new i;case C:case I:return new i(e);case k:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new i;case E:return n=e,Nr?ke(Nr.call(n)):{}}}(e,h,l)}}a||(a=new qr);var g=a.get(e);if(g)return g;a.set(e,s),os(e)?e.forEach(function(r){s.add(sn(r,t,n,r,e,a))}):ts(e)&&e.forEach(function(r,i){s.set(i,sn(r,t,n,i,e,a))});var y=d?r:(u?c?no:ro:c?Os:Ts)(e);return kt(y||e,function(r,i){y&&(r=e[i=r]),Qr(s,i,sn(r,t,n,i,e,a))}),s}function ln(e,t,n){var i=n.length;if(null==e)return!i;for(e=ke(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 cn(e,t,i){if("function"!=typeof e)throw new Ee(n);return To(function(){e.apply(r,i)},t)}function un(e,t,r,n){var i=-1,o=Ft,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=Ot(t,Xt(r))),n?(o=Tt,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Gr(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}Dr.templateSettings={escape:Y,evaluate:X,interpolate:K,variable:"",imports:{_:Dr}},Dr.prototype=Br.prototype,Dr.prototype.constructor=Dr,Ur.prototype=zr(Br.prototype),Ur.prototype.constructor=Ur,Vr.prototype=zr(Br.prototype),Vr.prototype.constructor=Vr,Hr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Hr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hr.prototype.get=function(e){var t=this.__data__;if(Ir){var n=t[e];return n===i?r:n}return Re.call(t,e)?t[e]:r},Hr.prototype.has=function(e){var t=this.__data__;return Ir?t[e]!==r:Re.call(t,e)},Hr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ir&&t===r?i:t,this},$r.prototype.clear=function(){this.__data__=[],this.size=0},$r.prototype.delete=function(e){var t=this.__data__,r=en(t,e);return!(r<0||(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,0))},$r.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?r:t[n][1]},$r.prototype.has=function(e){return en(this.__data__,e)>-1},$r.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Hr,map:new(_r||$r),string:new Hr}},Wr.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return lo(this,e).get(e)},Wr.prototype.has=function(e){return lo(this,e).has(e)},Wr.prototype.set=function(e,t){var r=lo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.clear=function(){this.__data__=new $r,this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},qr.prototype.get=function(e){return this.__data__.get(e)},qr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof $r){var n=r.__data__;if(!_r||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var dn=Pi(bn),hn=Pi(wn,!0);function fn(e,t){var r=!0;return dn(e,function(e,n,i){return r=!!t(e,n,i)}),r}function pn(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&&!ss(s):n(s,l)))var l=s,c=a}return c}function gn(e,t){var r=[];return dn(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function mn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=vo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?mn(s,t-1,r,n,i):Pt(i,s):n||(i[i.length]=s)}return i}var vn=Mi(),yn=Mi(!0);function bn(e,t){return e&&vn(e,t,Ts)}function wn(e,t){return e&&yn(e,t,Ts)}function xn(e,t){return Et(t,function(t){return Ka(e[t])})}function Cn(e,t){for(var n=0,i=(t=yi(t,e)).length;null!=e&&n<i;)e=e[No(t[n++])];return n&&n==i?e:r}function _n(e,t,r){var n=t(e);return Ha(e)?n:Pt(n,r(e))}function Sn(e){return null==e?e===r?"[object Undefined]":"[object Null]":et&&et in ke(e)?function(e){var t=Re.call(e,et),n=e[et];try{e[et]=r;var i=!0}catch(e){}var o=je.call(e);return i&&(t?e[et]=n:delete e[et]),o}(e):function(e){return je.call(e)}(e)}function kn(e,t){return e>t}function An(e,t){return null!=e&&Re.call(e,t)}function In(e,t){return null!=e&&t in ke(e)}function En(e,t,n){for(var i=n?Tt:Ft,o=e[0].length,a=e.length,s=a,l=we(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Ot(d,Xt(t))),c=vr(d.length,c),l[s]=!n&&(t||o>=120&&d.length>=120)?new Gr(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?Zt(f,g):i(u,g,n))){for(s=a;--s;){var m=l[s];if(!(m?Zt(m,g):i(e[s],g,n)))continue e}f&&f.push(g),u.push(p)}}return u}function Fn(e,t,n){var i=null==(e=Io(e,t=yi(t,e)))?e:e[No(Xo(t))];return null==i?r:_t(i,e,n)}function Tn(e){return es(e)&&Sn(e)==p}function On(e,t,n,i,o){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=Ha(e),l=Ha(t),c=s?g:po(e),u=l?g:po(t),d=(c=c==p?_:c)==_,h=(u=u==p?_:u)==_,f=c==u;if(f&&qa(e)){if(!qa(t))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new qr),s||ls(e)?eo(e,t,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case m:case v:case C:return za(+e,+t);case y:return e.name==t.name&&e.message==t.message;case k:case I:return e==t+"";case x:var s=ir;case A:var l=1&n;if(s||(s=sr),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=eo(s(e),s(t),n,i,o,a);return a.delete(e),u;case E:if(Nr)return Nr.call(e)==Nr.call(t)}return!1}(e,t,c,n,i,o,a);if(!(1&n)){var b=d&&Re.call(e,"__wrapped__"),w=h&&Re.call(t,"__wrapped__");if(b||w){var S=b?e.value():e,F=w?t.value():t;return a||(a=new qr),o(S,F,n,i,a)}}return!!f&&(a||(a=new qr),function(e,t,n,i,o,a){var s=1&n,l=ro(e),c=l.length,u=ro(t),d=u.length;if(c!=d&&!s)return!1;for(var h=c;h--;){var f=l[h];if(!(s?f in t:Re.call(t,f)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=s;++h<c;){var y=e[f=l[h]],b=t[f];if(i)var w=s?i(b,y,f,t,e,a):i(y,b,f,e,t,a);if(!(w===r?y===b||o(y,b,n,i,a):w)){m=!1;break}v||(v="constructor"==f)}if(m&&!v){var x=e.constructor,C=t.constructor;x==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof C&&C instanceof C||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,i,o,a))}(e,t,n,i,On,o))}function Pn(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=ke(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 qr;if(i)var f=i(u,d,c,e,t,h);if(!(f===r?On(d,u,3,i,h):f))return!1}}return!0}function Mn(e){return!(!Qa(e)||(t=e,Ne&&Ne in t))&&(Ka(e)?Be:pe).test(jo(e));var t}function Rn(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?Ha(e)?Bn(e[0],e[1]):zn(e):dl(e)}function Ln(e){if(!_o(e))return gr(e);var t=[];for(var r in ke(e))Re.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Nn(e){if(!Qa(e))return function(e){var t=[];if(null!=e)for(var r in ke(e))t.push(r);return t}(e);var t=_o(e),r=[];for(var n in e)("constructor"!=n||!t&&Re.call(e,n))&&r.push(n);return r}function jn(e,t){return e<t}function Dn(e,t){var r=-1,n=Wa(e)?we(e.length):[];return dn(e,function(e,i,o){n[++r]=t(e,i,o)}),n}function zn(e){var t=co(e);return 1==t.length&&t[0][2]?ko(t[0][0],t[0][1]):function(r){return r===e||Pn(r,e,t)}}function Bn(e,t){return wo(e)&&So(t)?ko(No(e),t):function(n){var i=ks(n,e);return i===r&&i===t?As(n,e):On(t,i,3)}}function Un(e,t,n,i,o){e!==t&&vn(t,function(a,s){if(o||(o=new qr),Qa(a))!function(e,t,n,i,o,a,s){var l=Eo(e,n),c=Eo(t,n),u=s.get(c);if(u)Jr(e,n,u);else{var d=a?a(l,c,n+"",e,t,s):r,h=d===r;if(h){var f=Ha(c),p=!f&&qa(c),g=!f&&!p&&ls(c);d=c,f||p||g?Ha(l)?d=l:Ga(l)?d=Ei(l):p?(h=!1,d=Ci(c,!0)):g?(h=!1,d=Si(c,!0)):d=[]:ns(c)||Va(c)?(d=l,Va(l)?d=ms(l):Qa(l)&&!Ka(l)||(d=mo(c))):h=!1}h&&(s.set(c,d),o(d,c,i,a,s),s.delete(c)),Jr(e,n,d)}}(e,t,s,n,Un,i,o);else{var l=i?i(Eo(e,s),a,s+"",e,t,o):r;l===r&&(l=a),Jr(e,s,l)}},Os)}function Vn(e,t){var n=e.length;if(n)return yo(t+=t<0?n:0,n)?e[t]:r}function Hn(e,t,r){t=t.length?Ot(t,function(e){return Ha(e)?function(t){return Cn(t,1===e.length?e[0]:e)}:e}):[rl];var n=-1;t=Ot(t,Xt(so()));var i=Dn(e,function(e,r,i){var o=Ot(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=ki(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 $n(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=Cn(e,a);r(s,a)&&Jn(o,yi(a,e),s)}return o}function Wn(e,t,r,n){var i=n?Bt:zt,o=-1,a=t.length,s=e;for(e===t&&(t=Ei(t)),r&&(s=Ot(e,Xt(r)));++o<a;)for(var l=0,c=t[o],u=r?r(c):c;(l=i(s,u,l,n))>-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function Gn(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;yo(i)?Ye.call(e,i,1):ui(e,i)}}return e}function qn(e,t){return e+gt(wr()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(Ao(e,t,rl),e+"")}function Kn(e){return Xr(zs(e))}function Zn(e,t){var r=zs(e);return Ro(r,an(t,0,r.length))}function Jn(e,t,n,i){if(!Qa(e))return e;for(var o=-1,a=(t=yi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=No(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=Qa(d)?d:yo(t[o+1])?[]:{})}Qr(l,c,u),l=l[c]}return e}var Qn=Er?function(e,t){return Er.set(e,t),e}:rl,ei=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:Qs(t),writable:!0})}:rl;function ti(e){return Ro(zs(e))}function ri(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=we(i);++n<i;)o[n]=e[n+t];return o}function ni(e,t){var r;return dn(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function ii(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&&!ss(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return oi(e,t,rl,r)}function oi(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=ss(t),u=t===r;o<a;){var d=gt((o+a)/2),h=n(e[d]),f=h!==r,p=null===h,g=h==h,m=ss(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 vr(a,4294967294)}function ai(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||!za(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function si(e){return"number"==typeof e?e:ss(e)?d:+e}function li(e){if("string"==typeof e)return e;if(Ha(e))return Ot(e,li)+"";if(ss(e))return jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,r){var n=-1,i=Ft,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=Tt;else if(o>=200){var c=t?null:Yi(e);if(c)return sr(c);a=!1,i=Zt,l=new Gr}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 ui(e,t){return null==(e=Io(e,t=yi(t,e)))||delete e[No(Xo(t))]}function di(e,t,r,n){return Jn(e,t,r(Cn(e,t)),n)}function hi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ri(e,n?0:o,n?o+1:i):ri(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Vr&&(r=r.value()),Mt(t,function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))},r)}function pi(e,t,r){var n=e.length;if(n<2)return n?ci(e[0]):[];for(var i=-1,o=we(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=un(o[i]||a,e[s],t,r));return ci(mn(o,1),t,r)}function gi(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 mi(e){return Ga(e)?e:[]}function vi(e){return"function"==typeof e?e:rl}function yi(e,t){return Ha(e)?e:wo(e,t)?[e]:Lo(vs(e))}var bi=Xn;function wi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ri(e,t,n)}var xi=ct||function(e){return dt.clearTimeout(e)};function Ci(e,t){if(t)return e.slice();var r=e.length,n=$e?$e(r):new e.constructor(r);return e.copy(n),n}function _i(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Si(e,t){var r=t?_i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=ss(e),s=t!==r,l=null===t,c=t==t,u=ss(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 Ai(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,l=t.length,c=mr(o-a,0),u=we(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 Ii(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,l=-1,c=t.length,u=mr(o-s,0),d=we(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 Ei(e,t){var r=-1,n=e.length;for(t||(t=we(n));++r<n;)t[r]=e[r];return t}function Fi(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?nn(n,l,c):Qr(n,l,c)}return n}function Ti(e,t){return function(r,n){var i=Ha(r)?St:tn,o=t?t():{};return i(r,e,so(n,2),o)}}function Oi(e){return Xn(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&&bo(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=ke(t);++i<o;){var l=n[i];l&&e(t,l,i,a)}return t})}function Pi(e,t){return function(r,n){if(null==r)return r;if(!Wa(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=ke(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Mi(e){return function(t,r,n){for(var i=-1,o=ke(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 Ri(e){return function(t){var n=nr(t=vs(t))?ur(t):r,i=n?n[0]:t.charAt(0),o=n?wi(n,1).join(""):t.slice(1);return i[e]()+o}}function Li(e){return function(t){return Mt(Ks(Vs(t).replace(Ke,"")),e,"")}}function Ni(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=zr(e.prototype),n=e.apply(r,t);return Qa(n)?n:r}}function ji(e){return function(t,n,i){var o=ke(t);if(!Wa(t)){var a=so(n,3);t=Ts(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 Di(e){return to(function(t){var i=t.length,o=i,a=Ur.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ee(n);if(a&&!l&&"wrapper"==oo(s))var l=new Ur([],!0)}for(o=l?o:i;++o<i;){var c=oo(s=t[o]),u="wrapper"==c?io(s):r;l=u&&xo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[oo(u[0])].apply(l,u[3]):1==s.length&&xo(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ha(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 zi(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:Ni(e);return function s(){for(var y=arguments.length,b=we(y),w=y;w--;)b[w]=arguments[w];if(g)var x=ao(s),C=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,x);if(i&&(b=Ai(b,i,o,g)),a&&(b=Ii(b,a,l,g)),y-=C,g&&y<d){var _=ar(b,x);return Gi(e,t,zi,s.placeholder,n,b,_,c,u,d-y)}var S=f?n:this,k=p?S[e]:e;return y=b.length,c?b=function(e,t){for(var n=e.length,i=vr(t.length,n),o=Ei(e);i--;){var a=t[i];e[i]=yo(a,n)?o[a]:r}return e}(b,c):m&&y>1&&b.reverse(),h&&u<y&&(b.length=u),this&&this!==dt&&this instanceof s&&(k=v||Ni(k)),k.apply(S,b)}}function Bi(e,t){return function(r,n){return function(e,t,r,n){return bn(e,function(e,i,o){t(n,r(e),i,o)}),n}(r,e,t(n),{})}}function Ui(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=li(n),i=li(i)):(n=si(n),i=si(i)),o=e(n,i)}return o}}function Vi(e){return to(function(t){return t=Ot(t,Xt(so())),Xn(function(r){var n=this;return e(t,function(e){return _t(e,n,r)})})})}function Hi(e,t){var n=(t=t===r?" ":li(t)).length;if(n<2)return n?Yn(t,e):t;var i=Yn(t,ft(e/cr(t)));return nr(t)?wi(ur(i),0,e).join(""):i.slice(0,e)}function $i(e){return function(t,n,i){return i&&"number"!=typeof i&&bo(t,n,i)&&(n=i=r),t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,r,n){for(var i=-1,o=mr(ft((t-e)/(r||1)),0),a=we(o);o--;)a[n?o:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:hs(i),e)}}function Wi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gs(t),r=gs(r)),e(t,r)}}function Gi(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 xo(e)&&Fo(p,f),p.placeholder=i,Po(p,e,t)}function qi(e){var t=Se[e];return function(e,r){if(e=gs(e),(r=null==r?0:vr(fs(r),292))&&$t(e)){var n=(vs(e)+"e").split("e");return+((n=(vs(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=kr&&1/sr(new kr([,-0]))[1]==c?function(e){return new kr(e)}:sl;function Xi(e){return function(t){var r=po(t);return r==x?ir(t):r==A?lr(t):function(e,t){return Ot(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ki(e,t,i,c,u,d,h,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Ee(n);var g=c?c.length:0;if(g||(t&=-97,c=u=r),h=h===r?h:mr(fs(h),0),f=f===r?f:fs(f),g-=u?u.length:0,64&t){var m=c,v=u;c=u=r}var y=p?r:io(e),b=[e,t,i,c,u,m,v,d,h,f];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,c=n==s&&8==r||n==s&&r==l&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!c)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var d=e[3];e[3]=d?Ai(d,u,t[4]):u,e[4]=d?ar(e[3],o):t[4]}(u=t[5])&&(d=e[5],e[5]=d?Ii(d,u,t[6]):u,e[6]=d?ar(e[5],o):t[6]),(u=t[7])&&(e[7]=u),n&s&&(e[8]=null==e[8]?t[8]:vr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,y),e=b[0],t=b[1],i=b[2],c=b[3],u=b[4],!(f=b[9]=b[9]===r?p?0:e.length:mr(b[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)w=8==t||16==t?function(e,t,n){var i=Ni(e);return function o(){for(var a=arguments.length,s=we(a),l=a,c=ao(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:ar(s,c);return(a-=u.length)<n?Gi(e,t,zi,o.placeholder,r,s,u,r,r,n-a):_t(this&&this!==dt&&this instanceof o?i:e,this,s)}}(e,t,f):t!=a&&33!=t||u.length?zi.apply(r,b):function(e,t,r,n){var i=1&t,o=Ni(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=n.length,u=we(c+s),d=this&&this!==dt&&this instanceof t?o:e;++l<c;)u[l]=n[l];for(;s--;)u[l++]=arguments[++a];return _t(d,i?r:this,u)}}(e,t,i,c);else var w=function(e,t,r){var n=1&t,i=Ni(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return Po((y?Qn:Fo)(w,b),e,t)}function Zi(e,t,n,i){return e===r||za(e,Oe[n])&&!Re.call(i,n)?t:e}function Ji(e,t,n,i,o,a){return Qa(e)&&Qa(t)&&(a.set(t,e),Un(e,t,r,Ji,a),a.delete(t)),e}function Qi(e){return ns(e)?r:e}function eo(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 Gr: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(!Lt(t,function(e,t){if(!Zt(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 to(e){return Oo(Ao(e,r,$o),e+"")}function ro(e){return _n(e,Ts,ho)}function no(e){return _n(e,Os,fo)}var io=Er?function(e){return Er.get(e)}:sl;function oo(e){for(var t=e.name+"",r=Fr[t],n=Re.call(Fr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function ao(e){return(Re.call(Dr,"placeholder")?Dr:e).placeholder}function so(){var e=Dr.iteratee||nl;return e=e===nl?Rn:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(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 co(e){for(var t=Ts(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,So(i)]}return t}function uo(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Mn(n)?n:r}var ho=mt?function(e){return null==e?[]:(e=ke(e),Et(mt(e),function(t){return qe.call(e,t)}))}:pl,fo=mt?function(e){for(var t=[];e;)Pt(t,ho(e)),e=We(e);return t}:pl,po=Sn;function go(e,t,r){for(var n=-1,i=(t=yi(t,e)).length,o=!1;++n<i;){var a=No(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ja(i)&&yo(a,i)&&(Ha(e)||Va(e))}function mo(e){return"function"!=typeof e.constructor||_o(e)?{}:zr(We(e))}function vo(e){return Ha(e)||Va(e)||!!(Xe&&e&&e[Xe])}function yo(e,t){var r=typeof e;return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&me.test(e))&&e>-1&&e%1==0&&e<t}function bo(e,t,r){if(!Qa(r))return!1;var n=typeof t;return!!("number"==n?Wa(r)&&yo(t,r.length):"string"==n&&t in r)&&za(r[t],e)}function wo(e,t){if(Ha(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ss(e))||J.test(e)||!Z.test(e)||null!=t&&e in ke(t)}function xo(e){var t=oo(e),r=Dr[t];if("function"!=typeof r||!(t in Vr.prototype))return!1;if(e===r)return!0;var n=io(r);return!!n&&e===n[0]}(Cr&&po(new Cr(new ArrayBuffer(1)))!=O||_r&&po(new _r)!=x||Sr&&po(Sr.resolve())!=S||kr&&po(new kr)!=A||Ar&&po(new Ar)!=F)&&(po=function(e){var t=Sn(e),n=t==_?e.constructor:r,i=n?jo(n):"";if(i)switch(i){case Tr:return O;case Or:return x;case Pr:return S;case Mr:return A;case Rr:return F}return t});var Co=Pe?Ka:gl;function _o(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)}function So(e){return e==e&&!Qa(e)}function ko(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in ke(n))}}function Ao(e,t,n){return t=mr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=mr(r.length-t,0),a=we(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=we(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),_t(e,this,s)}}function Io(e,t){return t.length<2?e:Cn(e,ri(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Fo=Mo(Qn),To=ht||function(e,t){return dt.setTimeout(e,t)},Oo=Mo(ei);function Po(e,t,r){var n=t+"";return Oo(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(ie,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return kt(f,function(r){var n="_."+r[0];t&r[1]&&!Ft(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(n),r)))}function Mo(e){var t=0,n=0;return function(){var i=yr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ro(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=qn(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Lo=function(e){var t=Ma(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,r,n,i){t.push(n?i.replace(ce,"$1"):r||e)}),t});function No(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Do(e){if(e instanceof Vr)return e.clone();var t=new Ur(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var zo=Xn(function(e,t){return Ga(e)?un(e,mn(t,1,Ga,!0)):[]}),Bo=Xn(function(e,t){var n=Xo(t);return Ga(n)&&(n=r),Ga(e)?un(e,mn(t,1,Ga,!0),so(n,2)):[]}),Uo=Xn(function(e,t){var n=Xo(t);return Ga(n)&&(n=r),Ga(e)?un(e,mn(t,1,Ga,!0),r,n):[]});function Vo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fs(r);return i<0&&(i=mr(n+i,0)),Dt(e,so(t,3),i)}function Ho(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=fs(n),o=n<0?mr(i+o,0):vr(o,i-1)),Dt(e,so(t,3),o,!0)}function $o(e){return null!=e&&e.length?mn(e,1):[]}function Wo(e){return e&&e.length?e[0]:r}var Go=Xn(function(e){var t=Ot(e,mi);return t.length&&t[0]===e[0]?En(t):[]}),qo=Xn(function(e){var t=Xo(e),n=Ot(e,mi);return t===Xo(n)?t=r:n.pop(),n.length&&n[0]===e[0]?En(n,so(t,2)):[]}),Yo=Xn(function(e){var t=Xo(e),n=Ot(e,mi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?En(n,r,t):[]});function Xo(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ko=Xn(Zo);function Zo(e,t){return e&&e.length&&t&&t.length?Wn(e,t):e}var Jo=to(function(e,t){var r=null==e?0:e.length,n=on(e,t);return Gn(e,Ot(t,function(e){return yo(e,r)?+e:e}).sort(ki)),n});function Qo(e){return null==e?e:xr.call(e)}var ea=Xn(function(e){return ci(mn(e,1,Ga,!0))}),ta=Xn(function(e){var t=Xo(e);return Ga(t)&&(t=r),ci(mn(e,1,Ga,!0),so(t,2))}),ra=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,ci(mn(e,1,Ga,!0),r,t)});function na(e){if(!e||!e.length)return[];var t=0;return e=Et(e,function(e){if(Ga(e))return t=mr(e.length,t),!0}),qt(t,function(t){return Ot(e,Ht(t))})}function ia(e,t){if(!e||!e.length)return[];var n=na(e);return null==t?n:Ot(n,function(e){return _t(t,r,e)})}var oa=Xn(function(e,t){return Ga(e)?un(e,t):[]}),aa=Xn(function(e){return pi(Et(e,Ga))}),sa=Xn(function(e){var t=Xo(e);return Ga(t)&&(t=r),pi(Et(e,Ga),so(t,2))}),la=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,pi(Et(e,Ga),r,t)}),ca=Xn(na),ua=Xn(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ia(e,n)});function da(e){var t=Dr(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var fa=to(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Vr&&yo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ha,args:[o],thisArg:r}),new Ur(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),pa=Ti(function(e,t,r){Re.call(e,r)?++e[r]:nn(e,r,1)}),ga=ji(Vo),ma=ji(Ho);function va(e,t){return(Ha(e)?kt:dn)(e,so(t,3))}function ya(e,t){return(Ha(e)?At:hn)(e,so(t,3))}var ba=Ti(function(e,t,r){Re.call(e,r)?e[r].push(t):nn(e,r,[t])}),wa=Xn(function(e,t,r){var n=-1,i="function"==typeof t,o=Wa(e)?we(e.length):[];return dn(e,function(e){o[++n]=i?_t(t,e,r):Fn(e,t,r)}),o}),xa=Ti(function(e,t,r){nn(e,r,t)});function Ca(e,t){return(Ha(e)?Ot:Dn)(e,so(t,3))}var _a=Ti(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),Sa=Xn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&bo(e,t[0],t[1])?t=[]:r>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Hn(e,mn(t,1),[])}),ka=ut||function(){return dt.Date.now()};function Aa(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Ki(e,s,r,r,r,r,t)}function Ia(e,t){var i;if("function"!=typeof t)throw new Ee(n);return e=fs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ea=Xn(function(e,t,r){var n=1;if(r.length){var i=ar(r,ao(Ea));n|=a}return Ki(e,n,t,r,i)}),Fa=Xn(function(e,t,r){var n=3;if(r.length){var i=ar(r,ao(Fa));n|=a}return Ki(t,n,e,r,i)});function Ta(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=ka();if(m(e))return y(e);c=To(v,function(e){var r=t-(e-u);return f?vr(r,s-(e-d)):r}(e))}function y(e){return c=r,p&&o?g(e):(o=a=r,l)}function b(){var e=ka(),n=m(e);if(o=arguments,a=this,u=e,n){if(c===r)return function(e){return d=e,c=To(v,t),h?g(e):l}(u);if(f)return xi(c),c=To(v,t),g(u)}return c===r&&(c=To(v,t)),l}return t=gs(t)||0,Qa(i)&&(h=!!i.leading,s=(f="maxWait"in i)?mr(gs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),b.cancel=function(){c!==r&&xi(c),d=0,o=u=a=c=r},b.flush=function(){return c===r?l:y(ka())},b}var Oa=Xn(function(e,t){return cn(e,1,t)}),Pa=Xn(function(e,t,r){return cn(e,gs(t)||0,r)});function Ma(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(Ma.Cache||Wr),r}function Ra(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)}}Ma.Cache=Wr;var La=bi(function(e,t){var r=(t=1==t.length&&Ha(t[0])?Ot(t[0],Xt(so())):Ot(mn(t,1),Xt(so()))).length;return Xn(function(n){for(var i=-1,o=vr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return _t(e,this,n)})}),Na=Xn(function(e,t){var n=ar(t,ao(Na));return Ki(e,a,r,t,n)}),ja=Xn(function(e,t){var n=ar(t,ao(ja));return Ki(e,64,r,t,n)}),Da=to(function(e,t){return Ki(e,l,r,r,r,t)});function za(e,t){return e===t||e!=e&&t!=t}var Ba=Wi(kn),Ua=Wi(function(e,t){return e>=t}),Va=Tn(function(){return arguments}())?Tn:function(e){return es(e)&&Re.call(e,"callee")&&!qe.call(e,"callee")},Ha=we.isArray,$a=vt?Xt(vt):function(e){return es(e)&&Sn(e)==T};function Wa(e){return null!=e&&Ja(e.length)&&!Ka(e)}function Ga(e){return es(e)&&Wa(e)}var qa=Nt||gl,Ya=yt?Xt(yt):function(e){return es(e)&&Sn(e)==v};function Xa(e){if(!es(e))return!1;var t=Sn(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Ka(e){if(!Qa(e))return!1;var t=Sn(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==fs(e)}function Ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Xt(bt):function(e){return es(e)&&po(e)==x};function rs(e){return"number"==typeof e||es(e)&&Sn(e)==C}function ns(e){if(!es(e)||Sn(e)!=_)return!1;var t=We(e);if(null===t)return!0;var r=Re.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==De}var is=wt?Xt(wt):function(e){return es(e)&&Sn(e)==k},os=xt?Xt(xt):function(e){return es(e)&&po(e)==A};function as(e){return"string"==typeof e||!Ha(e)&&es(e)&&Sn(e)==I}function ss(e){return"symbol"==typeof e||es(e)&&Sn(e)==E}var ls=Ct?Xt(Ct):function(e){return es(e)&&Ja(e.length)&&!!it[Sn(e)]},cs=Wi(jn),us=Wi(function(e,t){return e<=t});function ds(e){if(!e)return[];if(Wa(e))return as(e)?ur(e):Ei(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=po(e);return(t==x?ir:t==A?sr:zs)(e)}function hs(e){return e?(e=gs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=hs(e),r=t%1;return t==t?r?t-r:t:0}function ps(e){return e?an(fs(e),0,h):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return d;if(Qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=fe.test(e);return r||ge.test(e)?lt(e.slice(2),r?2:8):he.test(e)?d:+e}function ms(e){return Fi(e,Os(e))}function vs(e){return null==e?"":li(e)}var ys=Oi(function(e,t){if(_o(t)||Wa(t))Fi(t,Ts(t),e);else for(var r in t)Re.call(t,r)&&Qr(e,r,t[r])}),bs=Oi(function(e,t){Fi(t,Os(t),e)}),ws=Oi(function(e,t,r,n){Fi(t,Os(t),e,n)}),xs=Oi(function(e,t,r,n){Fi(t,Ts(t),e,n)}),Cs=to(on),_s=Xn(function(e,t){e=ke(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&bo(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=Os(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===r||za(d,Oe[u])&&!Re.call(e,u))&&(e[u]=a[u])}return e}),Ss=Xn(function(e){return e.push(r,Ji),_t(Ms,r,e)});function ks(e,t,n){var i=null==e?r:Cn(e,t);return i===r?n:i}function As(e,t){return null!=e&&go(e,t,In)}var Is=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r},Qs(rl)),Es=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Re.call(e,t)?e[t].push(r):e[t]=[r]},so),Fs=Xn(Fn);function Ts(e){return Wa(e)?Yr(e):Ln(e)}function Os(e){return Wa(e)?Yr(e,!0):Nn(e)}var Ps=Oi(function(e,t,r){Un(e,t,r)}),Ms=Oi(function(e,t,r,n){Un(e,t,r,n)}),Rs=to(function(e,t){var r={};if(null==e)return r;var n=!1;t=Ot(t,function(t){return t=yi(t,e),n||(n=t.length>1),t}),Fi(e,no(e),r),n&&(r=sn(r,7,Qi));for(var i=t.length;i--;)ui(r,t[i]);return r}),Ls=to(function(e,t){return null==e?{}:function(e,t){return $n(e,t,function(t,r){return As(e,r)})}(e,t)});function Ns(e,t){if(null==e)return{};var r=Ot(no(e),function(e){return[e]});return t=so(t),$n(e,r,function(e,r){return t(e,r[0])})}var js=Xi(Ts),Ds=Xi(Os);function zs(e){return null==e?[]:Kt(e,Ts(e))}var Bs=Li(function(e,t,r){return t=t.toLowerCase(),e+(r?Us(t):t)});function Us(e){return Xs(vs(e).toLowerCase())}function Vs(e){return(e=vs(e))&&e.replace(ve,er).replace(Ze,"")}var Hs=Li(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),$s=Li(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),Ws=Ri("toLowerCase"),Gs=Li(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),qs=Li(function(e,t,r){return e+(r?" ":"")+Xs(t)}),Ys=Li(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Xs=Ri("toUpperCase");function Ks(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Zs=Xn(function(e,t){try{return _t(e,r,t)}catch(e){return Xa(e)?e:new Ce(e)}}),Js=to(function(e,t){return kt(t,function(t){t=No(t),nn(e,t,Ea(e[t],e))}),e});function Qs(e){return function(){return e}}var el=Di(),tl=Di(!0);function rl(e){return e}function nl(e){return Rn("function"==typeof e?e:sn(e,1))}var il=Xn(function(e,t){return function(r){return Fn(r,e,t)}}),ol=Xn(function(e,t){return function(r){return Fn(e,r,t)}});function al(e,t,r){var n=Ts(t),i=xn(t,n);null!=r||Qa(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=xn(t,Ts(t)));var o=!(Qa(r)&&"chain"in r&&!r.chain),a=Ka(e);return kt(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__=Ei(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Pt([this.value()],arguments))})}),e}function sl(){}var ll=Vi(Ot),cl=Vi(It),ul=Vi(Lt);function dl(e){return wo(e)?Ht(No(e)):function(e){return function(t){return Cn(t,e)}}(e)}var hl=$i(),fl=$i(!0);function pl(){return[]}function gl(){return!1}var ml,vl=Ui(function(e,t){return e+t},0),yl=qi("ceil"),bl=Ui(function(e,t){return e/t},1),wl=qi("floor"),xl=Ui(function(e,t){return e*t},1),Cl=qi("round"),_l=Ui(function(e,t){return e-t},0);return Dr.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Dr.ary=Aa,Dr.assign=ys,Dr.assignIn=bs,Dr.assignInWith=ws,Dr.assignWith=xs,Dr.at=Cs,Dr.before=Ia,Dr.bind=Ea,Dr.bindAll=Js,Dr.bindKey=Fa,Dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},Dr.chain=da,Dr.chunk=function(e,t,n){t=(n?bo(e,t,n):t===r)?1:mr(fs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=we(ft(i/t));o<i;)s[a++]=ri(e,o,o+=t);return s},Dr.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},Dr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=we(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Pt(Ha(r)?Ei(r):[r],mn(t,1))},Dr.cond=function(e){var t=null==e?0:e.length,r=so();return e=t?Ot(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[r(e[0]),e[1]]}):[],Xn(function(r){for(var n=-1;++n<t;){var i=e[n];if(_t(i[0],this,r))return _t(i[1],this,r)}})},Dr.conforms=function(e){return function(e){var t=Ts(e);return function(r){return ln(r,e,t)}}(sn(e,1))},Dr.constant=Qs,Dr.countBy=pa,Dr.create=function(e,t){var r=zr(e);return null==t?r:rn(r,t)},Dr.curry=function e(t,n,i){var o=Ki(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Dr.curryRight=function e(t,n,i){var o=Ki(t,16,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Dr.debounce=Ta,Dr.defaults=_s,Dr.defaultsDeep=Ss,Dr.defer=Oa,Dr.delay=Pa,Dr.difference=zo,Dr.differenceBy=Bo,Dr.differenceWith=Uo,Dr.drop=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,(t=n||t===r?1:fs(t))<0?0:t,i):[]},Dr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,0,(t=i-(t=n||t===r?1:fs(t)))<0?0:t):[]},Dr.dropRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0,!0):[]},Dr.dropWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0):[]},Dr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&bo(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=fs(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:fs(i))<0&&(i+=o),i=n>i?0:ps(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Dr.filter=function(e,t){return(Ha(e)?Et:gn)(e,so(t,3))},Dr.flatMap=function(e,t){return mn(Ca(e,t),1)},Dr.flatMapDeep=function(e,t){return mn(Ca(e,t),c)},Dr.flatMapDepth=function(e,t,n){return n=n===r?1:fs(n),mn(Ca(e,t),n)},Dr.flatten=$o,Dr.flattenDeep=function(e){return null!=e&&e.length?mn(e,c):[]},Dr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===r?1:fs(t)):[]},Dr.flip=function(e){return Ki(e,512)},Dr.flow=el,Dr.flowRight=tl,Dr.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},Dr.functions=function(e){return null==e?[]:xn(e,Ts(e))},Dr.functionsIn=function(e){return null==e?[]:xn(e,Os(e))},Dr.groupBy=ba,Dr.initial=function(e){return null!=e&&e.length?ri(e,0,-1):[]},Dr.intersection=Go,Dr.intersectionBy=qo,Dr.intersectionWith=Yo,Dr.invert=Is,Dr.invertBy=Es,Dr.invokeMap=wa,Dr.iteratee=nl,Dr.keyBy=xa,Dr.keys=Ts,Dr.keysIn=Os,Dr.map=Ca,Dr.mapKeys=function(e,t){var r={};return t=so(t,3),bn(e,function(e,n,i){nn(r,t(e,n,i),e)}),r},Dr.mapValues=function(e,t){var r={};return t=so(t,3),bn(e,function(e,n,i){nn(r,n,t(e,n,i))}),r},Dr.matches=function(e){return zn(sn(e,1))},Dr.matchesProperty=function(e,t){return Bn(e,sn(t,1))},Dr.memoize=Ma,Dr.merge=Ps,Dr.mergeWith=Ms,Dr.method=il,Dr.methodOf=ol,Dr.mixin=al,Dr.negate=Ra,Dr.nthArg=function(e){return e=fs(e),Xn(function(t){return Vn(t,e)})},Dr.omit=Rs,Dr.omitBy=function(e,t){return Ns(e,Ra(so(t)))},Dr.once=function(e){return Ia(2,e)},Dr.orderBy=function(e,t,n,i){return null==e?[]:(Ha(t)||(t=null==t?[]:[t]),Ha(n=i?r:n)||(n=null==n?[]:[n]),Hn(e,t,n))},Dr.over=ll,Dr.overArgs=La,Dr.overEvery=cl,Dr.overSome=ul,Dr.partial=Na,Dr.partialRight=ja,Dr.partition=_a,Dr.pick=Ls,Dr.pickBy=Ns,Dr.property=dl,Dr.propertyOf=function(e){return function(t){return null==e?r:Cn(e,t)}},Dr.pull=Ko,Dr.pullAll=Zo,Dr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Wn(e,t,so(r,2)):e},Dr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Wn(e,t,r,n):e},Dr.pullAt=Jo,Dr.range=hl,Dr.rangeRight=fl,Dr.rearg=Da,Dr.reject=function(e,t){return(Ha(e)?Et:gn)(e,Ra(so(t,3)))},Dr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=so(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Gn(e,i),r},Dr.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Xn(e,t=t===r?t:fs(t))},Dr.reverse=Qo,Dr.sampleSize=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),(Ha(e)?Kr:Zn)(e,t)},Dr.set=function(e,t,r){return null==e?e:Jn(e,t,r)},Dr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Jn(e,t,n,i)},Dr.shuffle=function(e){return(Ha(e)?Zr:ti)(e)},Dr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bo(e,t,n)?(t=0,n=i):(t=null==t?0:fs(t),n=n===r?i:fs(n)),ri(e,t,n)):[]},Dr.sortBy=Sa,Dr.sortedUniq=function(e){return e&&e.length?ai(e):[]},Dr.sortedUniqBy=function(e,t){return e&&e.length?ai(e,so(t,2)):[]},Dr.split=function(e,t,n){return n&&"number"!=typeof n&&bo(e,t,n)&&(t=n=r),(n=n===r?h:n>>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=li(t))&&nr(e)?wi(ur(e),0,n):e.split(t,n):[]},Dr.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:mr(fs(t),0),Xn(function(r){var n=r[t],i=wi(r,0,t);return n&&Pt(i,n),_t(e,this,i)})},Dr.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Dr.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Dr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,(t=i-(t=n||t===r?1:fs(t)))<0?0:t,i):[]},Dr.takeRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!1,!0):[]},Dr.takeWhile=function(e,t){return e&&e.length?hi(e,so(t,3)):[]},Dr.tap=function(e,t){return t(e),e},Dr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return Qa(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Ta(e,t,{leading:i,maxWait:t,trailing:o})},Dr.thru=ha,Dr.toArray=ds,Dr.toPairs=js,Dr.toPairsIn=Ds,Dr.toPath=function(e){return Ha(e)?Ot(e,No):ss(e)?[e]:Ei(Lo(vs(e)))},Dr.toPlainObject=ms,Dr.transform=function(e,t,r){var n=Ha(e),i=n||qa(e)||ls(e);if(t=so(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Qa(e)&&Ka(o)?zr(We(e)):{}}return(i?kt:bn)(e,function(e,n,i){return t(r,e,n,i)}),r},Dr.unary=function(e){return Aa(e,1)},Dr.union=ea,Dr.unionBy=ta,Dr.unionWith=ra,Dr.uniq=function(e){return e&&e.length?ci(e):[]},Dr.uniqBy=function(e,t){return e&&e.length?ci(e,so(t,2)):[]},Dr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ci(e,r,t):[]},Dr.unset=function(e,t){return null==e||ui(e,t)},Dr.unzip=na,Dr.unzipWith=ia,Dr.update=function(e,t,r){return null==e?e:di(e,t,vi(r))},Dr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:di(e,t,vi(n),i)},Dr.values=zs,Dr.valuesIn=function(e){return null==e?[]:Kt(e,Os(e))},Dr.without=oa,Dr.words=Ks,Dr.wrap=function(e,t){return Na(vi(t),e)},Dr.xor=aa,Dr.xorBy=sa,Dr.xorWith=la,Dr.zip=ca,Dr.zipObject=function(e,t){return gi(e||[],t||[],Qr)},Dr.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jn)},Dr.zipWith=ua,Dr.entries=js,Dr.entriesIn=Ds,Dr.extend=bs,Dr.extendWith=ws,al(Dr,Dr),Dr.add=vl,Dr.attempt=Zs,Dr.camelCase=Bs,Dr.capitalize=Us,Dr.ceil=yl,Dr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=gs(n))==n?n:0),t!==r&&(t=(t=gs(t))==t?t:0),an(gs(e),t,n)},Dr.clone=function(e){return sn(e,4)},Dr.cloneDeep=function(e){return sn(e,5)},Dr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:r)},Dr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:r)},Dr.conformsTo=function(e,t){return null==t||ln(e,t,Ts(t))},Dr.deburr=Vs,Dr.defaultTo=function(e,t){return null==e||e!=e?t:e},Dr.divide=bl,Dr.endsWith=function(e,t,n){e=vs(e),t=li(t);var i=e.length,o=n=n===r?i:an(fs(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Dr.eq=za,Dr.escape=function(e){return(e=vs(e))&&q.test(e)?e.replace(W,tr):e},Dr.escapeRegExp=function(e){return(e=vs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Dr.every=function(e,t,n){var i=Ha(e)?It:fn;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Dr.find=ga,Dr.findIndex=Vo,Dr.findKey=function(e,t){return jt(e,so(t,3),bn)},Dr.findLast=ma,Dr.findLastIndex=Ho,Dr.findLastKey=function(e,t){return jt(e,so(t,3),wn)},Dr.floor=wl,Dr.forEach=va,Dr.forEachRight=ya,Dr.forIn=function(e,t){return null==e?e:vn(e,so(t,3),Os)},Dr.forInRight=function(e,t){return null==e?e:yn(e,so(t,3),Os)},Dr.forOwn=function(e,t){return e&&bn(e,so(t,3))},Dr.forOwnRight=function(e,t){return e&&wn(e,so(t,3))},Dr.get=ks,Dr.gt=Ba,Dr.gte=Ua,Dr.has=function(e,t){return null!=e&&go(e,t,An)},Dr.hasIn=As,Dr.head=Wo,Dr.identity=rl,Dr.includes=function(e,t,r,n){e=Wa(e)?e:zs(e),r=r&&!n?fs(r):0;var i=e.length;return r<0&&(r=mr(i+r,0)),as(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&zt(e,t,r)>-1},Dr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fs(r);return i<0&&(i=mr(n+i,0)),zt(e,t,i)},Dr.inRange=function(e,t,n){return t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,r){return e>=vr(t,r)&&e<mr(t,r)}(e=gs(e),t,n)},Dr.invoke=Fs,Dr.isArguments=Va,Dr.isArray=Ha,Dr.isArrayBuffer=$a,Dr.isArrayLike=Wa,Dr.isArrayLikeObject=Ga,Dr.isBoolean=function(e){return!0===e||!1===e||es(e)&&Sn(e)==m},Dr.isBuffer=qa,Dr.isDate=Ya,Dr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Dr.isEmpty=function(e){if(null==e)return!0;if(Wa(e)&&(Ha(e)||"string"==typeof e||"function"==typeof e.splice||qa(e)||ls(e)||Va(e)))return!e.length;var t=po(e);if(t==x||t==A)return!e.size;if(_o(e))return!Ln(e).length;for(var r in e)if(Re.call(e,r))return!1;return!0},Dr.isEqual=function(e,t){return On(e,t)},Dr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?On(e,t,r,n):!!i},Dr.isError=Xa,Dr.isFinite=function(e){return"number"==typeof e&&$t(e)},Dr.isFunction=Ka,Dr.isInteger=Za,Dr.isLength=Ja,Dr.isMap=ts,Dr.isMatch=function(e,t){return e===t||Pn(e,t,co(t))},Dr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Pn(e,t,co(t),n)},Dr.isNaN=function(e){return rs(e)&&e!=+e},Dr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mn(e)},Dr.isNil=function(e){return null==e},Dr.isNull=function(e){return null===e},Dr.isNumber=rs,Dr.isObject=Qa,Dr.isObjectLike=es,Dr.isPlainObject=ns,Dr.isRegExp=is,Dr.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=u},Dr.isSet=os,Dr.isString=as,Dr.isSymbol=ss,Dr.isTypedArray=ls,Dr.isUndefined=function(e){return e===r},Dr.isWeakMap=function(e){return es(e)&&po(e)==F},Dr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Sn(e)},Dr.join=function(e,t){return null==e?"":pr.call(e,t)},Dr.kebabCase=Hs,Dr.last=Xo,Dr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=fs(n))<0?mr(i+o,0):vr(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):Dt(e,Ut,o,!0)},Dr.lowerCase=$s,Dr.lowerFirst=Ws,Dr.lt=cs,Dr.lte=us,Dr.max=function(e){return e&&e.length?pn(e,rl,kn):r},Dr.maxBy=function(e,t){return e&&e.length?pn(e,so(t,2),kn):r},Dr.mean=function(e){return Vt(e,rl)},Dr.meanBy=function(e,t){return Vt(e,so(t,2))},Dr.min=function(e){return e&&e.length?pn(e,rl,jn):r},Dr.minBy=function(e,t){return e&&e.length?pn(e,so(t,2),jn):r},Dr.stubArray=pl,Dr.stubFalse=gl,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=xl,Dr.nth=function(e,t){return e&&e.length?Vn(e,fs(t)):r},Dr.noConflict=function(){return dt._===this&&(dt._=ze),this},Dr.noop=sl,Dr.now=ka,Dr.pad=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Hi(gt(i),r)+e+Hi(ft(i),r)},Dr.padEnd=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;return t&&n<t?e+Hi(t-n,r):e},Dr.padStart=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;return t&&n<t?Hi(t-n,r)+e:e},Dr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),br(vs(e).replace(re,""),t||0)},Dr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bo(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=hs(e),t===r?(t=e,e=0):t=hs(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=wr();return vr(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return qn(e,t)},Dr.reduce=function(e,t,r){var n=Ha(e)?Mt:Wt,i=arguments.length<3;return n(e,so(t,4),r,i,dn)},Dr.reduceRight=function(e,t,r){var n=Ha(e)?Rt:Wt,i=arguments.length<3;return n(e,so(t,4),r,i,hn)},Dr.repeat=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),Yn(vs(e),t)},Dr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dr.result=function(e,t,n){var i=-1,o=(t=yi(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[No(t[i])];a===r&&(i=o,a=n),e=Ka(a)?a.call(e):a}return e},Dr.round=Cl,Dr.runInContext=e,Dr.sample=function(e){return(Ha(e)?Xr:Kn)(e)},Dr.size=function(e){if(null==e)return 0;if(Wa(e))return as(e)?cr(e):e.length;var t=po(e);return t==x||t==A?e.size:Ln(e).length},Dr.snakeCase=Gs,Dr.some=function(e,t,n){var i=Ha(e)?Lt:ni;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Dr.sortedIndex=function(e,t){return ii(e,t)},Dr.sortedIndexBy=function(e,t,r){return oi(e,t,so(r,2))},Dr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ii(e,t);if(n<r&&za(e[n],t))return n}return-1},Dr.sortedLastIndex=function(e,t){return ii(e,t,!0)},Dr.sortedLastIndexBy=function(e,t,r){return oi(e,t,so(r,2),!0)},Dr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ii(e,t,!0)-1;if(za(e[r],t))return r}return-1},Dr.startCase=qs,Dr.startsWith=function(e,t,r){return e=vs(e),r=null==r?0:an(fs(r),0,e.length),t=li(t),e.slice(r,r+t.length)==t},Dr.subtract=_l,Dr.sum=function(e){return e&&e.length?Gt(e,rl):0},Dr.sumBy=function(e,t){return e&&e.length?Gt(e,so(t,2)):0},Dr.template=function(e,t,n){var i=Dr.templateSettings;n&&bo(e,t,n)&&(t=r),e=vs(e),t=ws({},t,i,Zi);var o,a,s=ws({},t.imports,i.imports,Zi),l=Ts(s),c=Kt(s,l),u=0,d=t.interpolate||ye,h="__p += '",f=Ae((t.escape||ye).source+"|"+d.source+"|"+(d===K?ue:ye).source+"|"+(t.evaluate||ye).source+"|$","g"),p="//# sourceURL="+(Re.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(f,function(t,r,n,i,s,l){return n||(n=i),h+=e.slice(u,l).replace(be,rr),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=Re.call(t,"variable")&&t.variable;if(g){if(le.test(g))throw new Ce("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(U,""):h).replace(V,"$1").replace(H,"$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=Zs(function(){return _e(l,p+"return "+h).apply(r,c)});if(m.source=h,Xa(m))throw m;return m},Dr.times=function(e,t){if((e=fs(e))<1||e>u)return[];var r=h,n=vr(e,h);t=so(t),e-=h;for(var i=qt(n,t);++r<e;)t(r);return i},Dr.toFinite=hs,Dr.toInteger=fs,Dr.toLength=ps,Dr.toLower=function(e){return vs(e).toLowerCase()},Dr.toNumber=gs,Dr.toSafeInteger=function(e){return e?an(fs(e),-9007199254740991,u):0===e?e:0},Dr.toString=vs,Dr.toUpper=function(e){return vs(e).toUpperCase()},Dr.trim=function(e,t,n){if((e=vs(e))&&(n||t===r))return Yt(e);if(!e||!(t=li(t)))return e;var i=ur(e),o=ur(t);return wi(i,Jt(i,o),Qt(i,o)+1).join("")},Dr.trimEnd=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.slice(0,dr(e)+1);if(!e||!(t=li(t)))return e;var i=ur(e);return wi(i,0,Qt(i,ur(t))+1).join("")},Dr.trimStart=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.replace(re,"");if(!e||!(t=li(t)))return e;var i=ur(e);return wi(i,Jt(i,ur(t))).join("")},Dr.truncate=function(e,t){var n=30,i="...";if(Qa(t)){var o="separator"in t?t.separator:o;n="length"in t?fs(t.length):n,i="omission"in t?li(t.omission):i}var a=(e=vs(e)).length;if(nr(e)){var s=ur(e);a=s.length}if(n>=a)return e;var l=n-cr(i);if(l<1)return i;var c=s?wi(s,0,l).join(""):e.slice(0,l);if(o===r)return c+i;if(s&&(l+=c.length-l),is(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Ae(o.source,vs(de.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(li(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},Dr.unescape=function(e){return(e=vs(e))&&G.test(e)?e.replace($,hr):e},Dr.uniqueId=function(e){var t=++Le;return vs(e)+t},Dr.upperCase=Ys,Dr.upperFirst=Xs,Dr.each=va,Dr.eachRight=ya,Dr.first=Wo,al(Dr,(ml={},bn(Dr,function(e,t){Re.call(Dr.prototype,t)||(ml[t]=e)}),ml),{chain:!1}),Dr.VERSION="4.17.21",kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dr[e].placeholder=Dr}),kt(["drop","take"],function(e,t){Vr.prototype[e]=function(n){n=n===r?1:mr(fs(n),0);var i=this.__filtered__&&!t?new Vr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,h),type:e+(i.__dir__<0?"Right":"")}),i},Vr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),kt(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Vr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:so(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),kt(["head","last"],function(e,t){var r="take"+(t?"Right":"");Vr.prototype[e]=function(){return this[r](1).value()[0]}}),kt(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Vr.prototype[e]=function(){return this.__filtered__?new Vr(this):this[r](1)}}),Vr.prototype.compact=function(){return this.filter(rl)},Vr.prototype.find=function(e){return this.filter(e).head()},Vr.prototype.findLast=function(e){return this.reverse().find(e)},Vr.prototype.invokeMap=Xn(function(e,t){return"function"==typeof e?new Vr(this):this.map(function(r){return Fn(r,e,t)})}),Vr.prototype.reject=function(e){return this.filter(Ra(so(e)))},Vr.prototype.slice=function(e,t){e=fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vr.prototype.toArray=function(){return this.take(h)},bn(Vr.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Dr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Dr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Vr,c=s[0],u=l||Ha(t),d=function(e){var t=o.apply(Dr,Pt([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 Vr(this);var m=e.apply(t,s);return m.__actions__.push({func:ha,args:[d],thisArg:r}),new Ur(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),kt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Fe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ha(i)?i:[],e)}return this[r](function(r){return t.apply(Ha(r)?r:[],e)})}}),bn(Vr.prototype,function(e,t){var r=Dr[t];if(r){var n=r.name+"";Re.call(Fr,n)||(Fr[n]=[]),Fr[n].push({name:t,func:r})}}),Fr[zi(r,2).name]=[{name:"wrapper",func:r}],Vr.prototype.clone=function(){var e=new Vr(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Vr.prototype.reverse=function(){if(this.__filtered__){var e=new Vr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ha(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=vr(t,e+a);break;case"takeRight":e=mr(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=vr(l,this.__takeCount__);if(!r||!n&&i==l&&f==l)return fi(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},Dr.prototype.at=fa,Dr.prototype.chain=function(){return da(this)},Dr.prototype.commit=function(){return new Ur(this.value(),this.__chain__)},Dr.prototype.next=function(){this.__values__===r&&(this.__values__=ds(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Dr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var i=Do(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Dr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vr){var t=e;return this.__actions__.length&&(t=new Vr(this)),(t=t.reverse()).__actions__.push({func:ha,args:[Qo],thisArg:r}),new Ur(t,this.__chain__)}return this.thru(Qo)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,Je&&(Dr.prototype[Je]=function(){return this}),Dr}();ft?((ft.exports=fr)._=fr,ht._=fr):dt._=fr}).call(So)}(_o,_o.exports)),_o.exports);const Ao=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Io=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(Ao);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]},Eo=e=>{var t,r,n,i;const{state:o,actions:s,options:l}=po(),{searchTerm:d,sortBy:h,sortOrder:f,selectedFolder:p,pagination:g,pathHistory:m}=o,{setSearchTerm:v,setSortBy:y,setSortOrder:b,setPagination:w}=s,x=e||s.fetchFiles,C=u(null),_=u(ko.debounce(e=>{const t=JSON.stringify(e);C.current!==t&&(C.current=t,null==x||x(e))},150)).current,S=c(()=>{const e=p||"";if(!e)return;const t=[...Array.isArray(m)?m:[]].reverse().find(t=>t.id===e);return null==t?void 0:t.name},[p,m]),k=c(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:p||"",folderName:S(),search:(null==d?void 0:d.trim())||void 0,page:t?void 0:g.current,limit:t?void 0:g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}},[p,S,d,g.current,g.pageSize,h,f,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),A=c(e=>{var t,r;if(v&&v(e),w&&w({current:1,pageSize:g.pageSize,total:0}),x){const n={folderId:p||"",folderName:S(),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:g.pageSize,sortBy:h,sortOrder:f,itemType:"all"};x(n)}else console.error("🔎 useSortAndFilter: fetchFiles НЕ ОПРЕДЕЛЕНА!")},[v,w,g.pageSize,x,p,S,h,f,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),I=c((e,t)=>{var r,n;null==y||y(e),null==b||b(t),x&&_({folderId:p||"",folderName:S(),search:(null==d?void 0:d.trim())||void 0,page:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:g.current,limit:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:g.pageSize,sortBy:e,sortOrder:t,itemType:"all"})},[y,b,_,p,S,d,g.current,g.pageSize,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),E=c((e,t)=>{var r;(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)||(w&&w({current:e,pageSize:t||g.pageSize,total:g.total}),x&&_({folderId:p||"",folderName:S(),search:(null==d?void 0:d.trim())||void 0,page:e,limit:t||g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}))},[w,g.pageSize,g.total,_,p,S,d,h,f,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return a(()=>{if(x){const e=k();_(Object.assign(Object.assign({},e),{page:1}))}},[p]),a(()=>{x&&_(k())},[]),a(()=>()=>{var e;null===(e=_.cancel)||void 0===e||e.call(_)},[_]),{state:{searchTerm:d||"",sortBy:h||"name",sortOrder:f||"asc"},actions:{setSearchTerm:v||(()=>{}),setSortBy:y||(()=>{}),setSortOrder:b||(()=>{}),handleSearch:A,handleSort:I,handlePaginationChange:E,getCurrentQueryParams:k}}},Fo=new Map;function To(e){const t="id"in e&&void 0!==e.id?String(e.id):"unknown",r="data"in e?e.data:void 0;return`${e.type}:${t}:${function(e){if(null==e)return"";try{return JSON.stringify(e,Object.keys(e).sort())}catch(t){return String(e)}}(r)}`}const Oo=()=>{var e,t;const{notification:r}=I.useApp(),n=po(),{options:i}=n,o=c(async e=>{let t;if(i.handleNotify){try{t=await i.handleNotify(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&i.handleError){try{t=await i.handleError(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("success"===e.type&&i.handleSuccess){try{t=await i.handleSuccess(e)}catch(e){console.error(e)}if(t)return!1}return t},[i]),a=c(async function(e,t=!1){var n,a,s,l;try{void 0===e.visibility&&(e.visibility=!t);const c=await o(e);"object"==typeof c&&(e=c);const u=null!==(a=null===(n=i.config)||void 0===n?void 0:n.notificationDedupeTtlMs)&&void 0!==a?a:12e3,d="error"===e.type&&!0===e.notificationDedupe;d&&function(e,t){if(t<=0)return;const r=To(e),n=Date.now(),i=Fo.get(r);void 0!==i&&n-i<t&&(e.visibility=!1)}(e,u);if(!(!1!==e.visibility&&!1!==c&&!1!==(null===(s=i.config)||void 0===s?void 0:s.showNotifications)))return e;const h=r[e.type];"function"==typeof h?(h(e),d&&(l=e,u<=0||Fo.set(To(l),Date.now()))):console.warn(`Unknown notification type: ${e.type}`,e)}catch(e){console.error(e)}return e},[r,o,null===(e=i.config)||void 0===e?void 0:e.notificationDedupeTtlMs,null===(t=i.config)||void 0===t?void 0:t.showNotifications]);return d(()=>({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])},Po={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."},Mo={FileTooLarge:"File is too large to upload.",PayloadTooLarge:"File is too large to upload."},Ro=(e,t,r)=>{var n,i,o;if(!e)return;const a=Po[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=Mo[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})},Lo=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("размер")||t.includes("превышен")?"PayloadTooLarge":t.includes("403")||t.includes("forbidden")||t.includes("access denied")||t.includes("доступ запрещён")?"AuthorizationFailed":t.includes("404")||t.includes("not found")||t.includes("не найден")?"UploadUrlNotReachable":t.includes("already exists")||t.includes("уже существует")||t.includes("дубликат")?"FileAlreadyExists":t.includes("invalid")&&(t.includes("name")||t.includes("имя")||t.includes("назва"))?"FileInvalidName":t.includes("type")&&(t.includes("not allowed")||t.includes("не поддерживается"))?"FileTypeNotAllowed":void 0},No=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}};const jo=(e,t,r)=>{const n=No(e),i=null==n?void 0:n.code;if("FileTooLarge"===i&&null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize))return t("File too large ({{size}}). Maximum allowed size: {{maxSize}}",{size:li(r.fileSize),maxSize:li(r.maxSize)});if(("BatchItemLimitExceeded"===i||"exceeded_max_files"===i)&&(null==n?void 0:n.message)){const{allowed:e,received:r}=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}}(n.message);if(null!=e&&null!=r)return t("Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}",{allowed:e,received:r})}if((null==n?void 0:n.message)&&"Unknown error"!==n.message)return n.message;const o=null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize)?{fileSize:li(r.fileSize),maxSize:li(r.maxSize)}:void 0,a=Ro(i,t,o);return null!=a?a:t("Error uploading file")},Do=e=>{const t=No(e);return"path_folder_not_found"===(null==t?void 0:t.code)},zo=["file_get_contents","open stream","failed to open stream","http request failed","curl_error"];const Bo=(e,t,r)=>{var n;if(!e)return t("Error when downloading a file by URL");const i=null!==(n=(e=>{const t=Lo(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=Ro(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!zo.some(e=>t.includes(e))}(a)?a:t("Failed to download file from the URL.")},Uo=e=>Array.isArray(e)?e.filter(e=>(null==e?void 0:e.id)&&"folders"!==e.id).map(e=>e.name).filter(Boolean).join("/"):"",Vo=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},Ho=(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 Vo(a)||null}const o=No(e),a=null==o?void 0:o.message;if(!a)return null;const s=a.toLowerCase(),l=["не существует:","not exists:","not exist:","not found:"];for(const e of l){const t=s.indexOf(e);if(t>=0){const r=a.slice(t+e.length).trim();return Vo(r)||null}}const c=["not exists ","not exist ","not found "];for(const e of c){const t=s.indexOf(e);if(t>=0){const r=a.slice(t+e.length).trim();return Vo(r)||null}}return null})(e);return r?(e=>{const t=e.split("/").filter(Boolean);return t.length<=1?"":(t.pop(),t.join("/"))})(r):Uo(t)},$o=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}`)},Wo=()=>{var e,t;const{state:r,actions:i,options:o}=po(),{t:a}=Yn(),s=Oo(),{folders:l,selectedFolder:u,pathHistory:d,form:h,loading:f,isModalVisible:p}=r,{setFolders:g,setLoading:m,setIsModalVisible:v}=i,{dataProviders:y,config:b}=o,w=c(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})),[]),x=c(async(e=!1)=>{null==m||m(!0);try{let e=[];const t="lazy"===(null==b?void 0:b.folderTreeLoading);if(!(null==y?void 0:y.getFolders)){if(null==y?void 0:y.getFiles){const e=async r=>{const{files:n}=await y.getFiles({itemType:"folder",folderId:null!=r?r:void 0}),i=w(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(g&&g(e=>{const n=Array.isArray(e)?e:[];if(!t){const e=r,t=e.filter(e=>e.id===e.parentId);return t.length>0&&console.warn("Folders with cyclic dependencies detected:",t),e}const i=n.filter(e=>e.parentId),o=[...i,...r],a=o.filter(e=>e.id===e.parentId);return a.length>0&&console.warn("Folders with cyclic dependencies detected:",a),o}))}return void console.error("DataProvider for folders is not defined")}{const r=!t;e=await y.getFolders({parentId:null,deep:r})}const r=Array.isArray(e)?e:[];null==g||g(r);const n=r.filter(e=>e.id===e.parentId);n.length>0&&console.warn("Folders with cyclic dependencies detected:",n)}catch(t){console.error("Error loading folders:",t);const r=No(t);if(!e&&(404===(null==r?void 0:r.status)||"FileNotFound"===(null==r?void 0:r.code))){const e=Ho(t,d||[]);try{return await $o({options:o,pathFolder:e,dataProviders:null==o?void 0:o.dataProviders}),void await x(!0)}catch(e){console.error("Cache clear failed:",e)}}const n=Ro(null==r?void 0:r.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=n?n:a("Failed to load folders"),description:a("Folders"),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{reason:t instanceof Error?t.message:String(t),folderId:null,folderName:a("Folders")}})}finally{null==m||m(!1)}},[null==y?void 0:y.getFiles,null==y?void 0:y.getFolders,g,m,null==b?void 0:b.folderTreeLoading,w,s,a,d,o]),C=c(()=>x(),[x]),_=c(async e=>{try{let t,r;if(null==y?void 0:y.getFolders){t=await y.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==y?void 0:y.getFiles))return[];{const{files:n}=await y.getFiles({itemType:"folder",folderId:null!=e?e:void 0});t=w(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==g||g(n),t}catch(e){return console.error("Error loading child folders:",e),[]}},[y,l,g,w]),S=c(()=>{var e;const t=null!==(e=null==b?void 0:b.defaultFolderName)&&void 0!==e?e:a("New folder");h.setFieldsValue({folderName:t}),null==v||v(!0)},[h,v,a,null==b?void 0:b.defaultFolderName]),k=c(async(e,t)=>{const r=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==g||g(r),e.parentId&&(await _(e.parentId),await new Promise(e=>setTimeout(e,50))),!(null==t?void 0:t.preserveSelection)&&i.setSelectedFolder&&i.setSelectedFolder(e.id),!(null==t?void 0:t.preserveSelection)&&i.setPathHistory){const t=Array.isArray(r)?r:[],n=(e,r=new Set)=>{if(r.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const i=t.find(t=>t.id===e);if(!i)return[];const o=new Set(r);return o.add(e),i.parentId?[...n(i.parentId,o),{id:i.id,name:i.name}]:[{id:i.id,name:i.name}]},o=n(e.id),s=[{id:"folders",name:a("Folders")},...o];i.setPathHistory(s)}},[l,g,i,r.pathHistory,_,a]),A=c(async e=>{try{if(null==y?void 0:y.getFolders){const t=await y.getFolders(),r=Array.isArray(t)?t:[];return r.some(t=>t.id===e)}if(null==y?void 0:y.getFiles){const t=new Set,r=async n=>{const{files:i}=await y.getFiles({itemType:"folder",folderId:null!=n?n:void 0}),o=w(i);for(const n of o){if(t.has(n.id))continue;if(t.add(n.id),n.id===e)return!0;if(await r(n.id))return!0}return!1};return await r(null)}}catch(e){console.warn("⚠️ Error checking the folder:",e)}return!1},[null==y?void 0:y.getFolders,null==y?void 0:y.getFiles,w]),I=c(async e=>{var t;let r,n,i=null;try{const o=await(e?e.validateFields():h.validateFields());if(r=o.folderName.trim(),!r){const e=o.targetFolder||(u&&"folders"!==u?u: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=zr(r,b);const c=o.targetFolder;if(c)i="folders"!==c?c:null;else if(u&&"folders"!==u)i=u;else if(Array.isArray(d)&&d.length>1){const e=d[d.length-1];i=(null==e?void 0:e.id)&&"folders"!==e.id?e.id:null}if(Br(b)&&(null==y?void 0:y.getFolders))try{const e=(await y.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==y?void 0:y.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 y.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 console.error("Circular dependency detected: folder cannot be its own parent"),new Error(a("Error: folder cannot be its own parent"))})(f);const p={id:f.id,name:f.name,parentId:null!=i?i:null,childCount:f.childCount},m=[...(Array.isArray(l)?l:[]).filter(e=>e.id!==p.id),p];if(null==g||g(m),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[p.id],folderId:null!==(t=p.parentId)&&void 0!==t?t:null,folderName:p.name}}),e||null==v||v(!1),(async()=>{try{await k(p,{preserveSelection:Boolean(e)}),await C(),await new Promise(e=>setTimeout(e,200));await A(f.id)||console.warn("⚠️ Could not confirm the creation of the folder on the server, but continuing...")}catch(e){console.error("Error performing background operations after creating the folder:",e)}})(),e)return f}catch(e){console.error("❌ Error creating the folder:",e);const t=No(e),o=Ro(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)}})}},[h,u,y,k,C,A,v,s,a,l,g,b,d]),E=c(()=>{null==v||v(!1)},[v]),F=c((e,t=new Set)=>{const r=Array.isArray(l)?l:[];return e.map(e=>{if(t.has(e.id))return console.warn(`Cycle detected in the folder structure with id=${e.id}. Skipping child elements processing.`),{key:e.id,label:e.name+" "+a("(error)"),icon:n.createElement(ve,{style:{color:"red"}})};const i=new Set(t);i.add(e.id);const o=r.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:o.length>0?F(o,i):void 0}})},[l]),T=c(()=>{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=F(r),[t]},[l,a,F]),O=c(async(e,t)=>{var r,n,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"}});d=zr(h,b);if(!(!1!==(null===(r=null==b?void 0:b.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!==(n=null==f?void 0:f.name)&&void 0!==n?n:d}});if(!(null===(c=o.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 o.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 C(),e!==p.id&&i.setSelectedFolder&&i.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){console.error("Error renaming the folder:",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)}}})}},[C,l,null===(e=o.dataProviders)||void 0===e?void 0:e.renameFolder,null===(t=null==b?void 0:b.features)||void 0===t?void 0:t.enableRenameFolder,b,i.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:p,loading:f},actions:{fetchFolders:C,fetchChildFolders:_,handleCreateFolder:S,handleModalOk:I,handleModalCancel:E,generateMenuItems:T,renameFolder:O}}},Go=()=>{const{options:e,actions:t}=po(),{dataProviders:r,config:n}=e,{setUndoDeletion:i}=t,{t:o}=Yn(),a=Oo(),s=c(async({items:e,selectedFolder:t,getItemNameById:s,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 Do(r)}),n=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return!Do(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=No(n);d.push({itemId:r,itemName:s(r),error:i})})}if(n.success)c+=e.length;else{const t=n.error;if(Do(t))c+=e.length;else if(t){u+=e.length;const r=No(t);d.push({error:r})}else u+=e.length}return}catch(r){if(Do(r))c+=e.length;else{const n=t?"Ошибка при удалении":"Ошибка при перемещении в корзину";console.error(n,r),u+=e.length;const i=No(r);d.push({error:i})}}const n=t?"DataProvider для удаления файлов не настроен":"DataProvider для перемещения не настроен";console.warn(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&&a.success({id:"FILES_DELETE_SUCCESS",message:o("Files deleted"),placement:"bottomRight",data:{successCount:c,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:t||null}}),u>0&&a.error({id:"FILES_DELETE_ERROR",message:o("Error when deleting a file"),placement:"bottomRight",data:{failCount:u,totalCount:e.length,itemIds:e.map(e=>e.id),itemNames:e.map(e=>s(e.id)),folderId:t||null,errors:d}})),{successCount:c,failCount:u,errorDetails:d}},[r,n,i,o,a]);return{deleteItems:s}};class qo 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,qo)}}const Yo=/^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i,Xo=/^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;function Ko(e,t){const r=e.trim();if(!r)throw new qo(t("Enter the URL of the image"),"UploadUrlInvalid");if(r.length>8192)throw new qo(t("URL too long"),"UploadUrlInvalid");let n;try{n=new URL(r)}catch(e){throw new qo(t("The specified URL is not valid."),"UploadUrlInvalid")}const i=n.protocol.toLowerCase();if("http:"!==i&&"https:"!==i)throw new qo(t("Only http and https URLs are supported"),"UploadUrlInvalid");const o=n.hostname.toLowerCase();if(Yo.test(o)&&("undefined"==typeof window||!Yo.test(window.location.hostname.toLowerCase())))throw new qo(t("Private and local URLs are not allowed"),"UploadUrlInvalid");if(Xo.test(o))throw new qo(t("Private and local URLs are not allowed"),"UploadUrlInvalid")}function Zo(e,t){return new Promise(function(r,n){let i;return Jo(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 Jo=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 Qo={},ea={get exports(){return Qo},set exports(e){Qo=e}};!function(){var e,t,r={};ea.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,k=65535&_;if(0!=_){k=65535&_;var A=s(S=_>>>16,a.of0);a.lhst[257+A]++;var I=s(k,a.df0);a.dhst[I]++,b+=a.exb[A]+a.dxb[I],f[m]=S<<23|c-d,f[m+1]=k<<16|A<<8|I,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 k=0;k<286;k++)b.lhst[k]=0;for(k=0;k<30;k++)b.dhst[k]=0;for(k=0;k<19;k++)b.ihst[k]=0;var A=C<_&&C<S?0:_<S?1:2;if(w(l,c,e),w(l,c+1,A),c+=3,0==A){for(;7&c;)c++;c=r.F._copyExact(o,a,s,l,c)}else{var I,E;if(1==A&&(I=b.fltree,E=b.fdtree),2==A){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),I=b.ltree,E=b.dtree,x(l,c,p-257),x(l,c+=5,g-1),x(l,c+=5,m-4),c+=4;for(var F=0;F<m;F++)x(l,c+3*F,b.itree[1+(b.ordr[F]<<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,O=0;O<n;O+=2){for(var P=t[O],M=P>>>23,R=T+(8388607&P);T<R;)c=r.F._writeLit(o[T++],I,l,c);if(0!=M){var L=t[O+1],N=L>>16,j=L>>8&255,D=255&L;x(l,c=r.F._writeLit(257+j,I,l,c),M-b.of0[j]),c+=b.exb[j],w(l,c=r.F._writeLit(D,E,l,c),N-b.df0[D]),c+=b.dxb[D],T+=M}}c=r.F._writeLit(256,I,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++);0!=o&&console.log("debt left")},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 k=1;for(S=0;S<b;S++){var A=a(e,_+3*S,3);d.itree[1+(d.ordr[S]<<1)]=A,A>k&&(k=A)}_+=3*b,l(d.itree,k),c(d.itree,k,d.imap),f=d.lmap,p=d.dmap,_=s(d.imap,(1<<k)-1,v+y,e,_,d.ttree);var I=i._copyOut(d.ttree,0,v,d.ltree);w=(1<<I)-1;var E=i._copyOut(d.ttree,v,y,d.dtree);x=(1<<E)-1,l(d.ltree,I),c(d.ltree,I,f),l(d.dtree,E),c(d.dtree,E,p)}for(;;){var F=f[u(e,_)&w];_+=15&F;var T=F>>>4;if(T>>>8==0)t[C++]=T;else{if(256==T)break;var O=C+T-254;if(T>264){var P=d.ldef[T-257];O=C+(P>>>3)+a(e,_,7&P),_+=7&P}var M=p[u(e,_)&x];_+=15&M;var R=M>>>4,L=d.ddef[R],N=(L>>>4)+o(e,_,15&L);for(_+=15&L,h&&(t=r.F._check(t,C+(1<<17)));C<O;)t[C]=t[C++-N],t[C]=t[C++-N],t[C]=t[C++-N],t[C]=t[C++-N];C=O}}}else{7&_&&(_+=8-(7&_));var j=4+(_>>>3),D=e[j-4]|e[j-3]<<8;h&&(t=r.F._check(t,C+D)),t.set(new n(e.buffer,e.byteOffset+j,D),C),_=j+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 ta=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:Qo},[Qo]);const ra=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 i=0;i<n;i++)o+=`%${e.pad(t[r+i].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 k=0;k<r;k++){var A=(_=255*(t[e+(k>>>3)]>>>7-(7&k)&1))==255*m?0:255;u[n+k]=A<<24|_<<16|_<<8|_}else if(2==h)for(k=0;k<r;k++)A=(_=85*(t[e+(k>>>2)]>>>6-((3&k)<<1)&3))==85*m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(4==h)for(k=0;k<r;k++)A=(_=17*(t[e+(k>>>1)]>>>4-((1&k)<<2)&15))==17*m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(8==h)for(k=0;k<r;k++)A=(_=t[e+k])==m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(16==h)for(k=0;k<r;k++)_=t[e+(k<<1)],A=f(t,e+(k<<1))==m?0:255,u[n+k]=A<<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 t=0;t<i;t++)if(c=r+t*l,u=c+t+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 r=0;r<u;r++)for(let o=0;o<c;o++)if(a>=0&&s>=0?(d=r*t+o<<2,h=(s+r)*i+a+o<<2):(d=(-s+r)*t-a+o<<2,h=r*i+o<<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 e=s.readUint(o,a);a+=4;const t=s.readASCII(o,a,4);if(a+=4,"IHDR"==t)l(o,a,d);else if("iCCP"==t){for(var y=a;0!=o[y];)y++;s.readASCII(o,a,y-a),o[y+1];const r=o.slice(y+2,a+e);let l=null;try{l=n(r)}catch(e){l=i(r)}d.tabs[t]=l}else if("CgBI"==t)d.tabs[t]=o.slice(a,a+4);else if("IDAT"==t){for(v=0;v<e;v++)h[p+v]=o[a+v];p+=e}else if("acTL"==t)d.tabs[t]={num_frames:u(o,a),num_plays:u(o,a+4)},f=new Uint8Array(o.length);else if("fcTL"==t){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"==t){for(v=0;v<e-4;v++)f[g+v]=o[a+v+4];g+=e-4}else if("pHYs"==t)d.tabs[t]=[s.readUint(o,a),s.readUint(o,a+4),o[a+8]];else if("cHRM"==t)for(d.tabs[t]=[],v=0;v<8;v++)d.tabs[t].push(s.readUint(o,a+4*v));else if("tEXt"==t||"zTXt"==t){null==d.tabs[t]&&(d.tabs[t]={});var b=s.nextZero(o,a),w=s.readASCII(o,a,b-a),x=a+e-b-1;if("tEXt"==t)_=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[t][w]=_}else if("iTXt"==t){null==d.tabs[t]&&(d.tabs[t]={}),b=0,y=a,b=s.nextZero(o,y),w=s.readASCII(o,y,b-y);const r=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=e-((y=b+1)-a),0==r?_=s.readUTF8(o,y,x):(C=n(o.slice(y,y+x)),_=s.readUTF8(C,0,C.length)),d.tabs[t][w]=_}else if("PLTE"==t)d.tabs[t]=s.readBytes(o,a,e);else if("hIST"==t){const e=d.tabs.PLTE.length/3;for(d.tabs[t]=[],v=0;v<e;v++)d.tabs[t].push(c(o,a+2*v))}else if("tRNS"==t)3==d.ctype?d.tabs[t]=s.readBytes(o,a,e):0==d.ctype?d.tabs[t]=c(o,a):2==d.ctype&&(d.tabs[t]=[c(o,a),c(o,a+2),c(o,a+4)]);else if("gAMA"==t)d.tabs[t]=s.readUint(o,a)/1e5;else if("sRGB"==t)d.tabs[t]=o[a];else if("bKGD"==t)0==d.ctype||4==d.ctype?d.tabs[t]=[c(o,a)]:2==d.ctype||6==d.ctype?d.tabs[t]=[c(o,a),c(o,a+2),c(o,a+4)]:3==d.ctype&&(d.tabs[t]=o[a]);else if("IEND"==t)break;a+=e,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}=ra,{_bin:t}=ra,r=ra._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 s=0;s<r;s++)for(let w=0;w<t;w++){var b;h=4*(s*t+w),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&s)+(3&w)],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&&(w!=t-1&&i(_,v,h+4,7),s!=r-1&&(0!=w&&i(_,v,h+4*t-4,3),i(_,v,h+4*t,5),w!=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={},k=[],A=[];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++)k.push(r.plte[x].est.rgba);let n=0;for(x=0;x<_.length;x++){const e=(E=_[x]).img.length;var I=new Uint8Array(r.inds.buffer,n>>2,e>>2);A.push(I);const t=new Uint8Array(r.abuf,n,e);p&&s(E.img,E.rect.width,E.rect.height,k,t,I),E.img.set(t),n+=e}}else for(b=0;b<_.length;b++){var E=_[b];const e=new Uint32Array(E.img.buffer);var F=E.rect.width;for(w=e.length,I=new Uint8Array(w),A.push(I),x=0;x<w;x++){const t=e[x];if(0!=x&&t==e[x-1])I[x]=I[x-1];else if(x>F&&t==e[x-F])I[x]=I[x-F];else{let e=S[t];if(null==e&&(S[t]=e=k.length,k.push(t),k.length>=300))break;I[x]=e}}}const T=k.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++){(E=_[b]).rect.x,E.rect.y,F=E.rect.width;const e=E.rect.height;let t=E.img;new Uint32Array(t.buffer);let r=4*F,n=4;if(T<=256&&0==f){r=Math.ceil(v*F/8);var O=new Uint8Array(r*e);const i=A[b];for(let t=0;t<e;t++){x=t*r;const e=t*F;if(8==v)for(var P=0;P<F;P++)O[x+P]=i[e+P];else if(4==v)for(P=0;P<F;P++)O[x+(P>>1)]|=i[e+P]<<4-4*(1&P);else if(2==v)for(P=0;P<F;P++)O[x+(P>>2)]|=i[e+P]<<6-2*(3&P);else if(1==v)for(P=0;P<F;P++)O[x+(P>>3)]|=i[e+P]<<7-1*(7&P)}t=O,m=3,n=1}else if(0==C&&1==_.length){O=new Uint8Array(F*e*3);const i=F*e;for(x=0;x<i;x++){const e=3*x,r=4*x;O[e]=t[r],O[e+1]=t[r+1],O[e+2]=t[r+2]}t=O,m=2,n=3,r=3*F}E.img=t,E.bpl=r,E.bpp=n}return{ctype:m,depth:v,plte:k,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=ta;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 o=t;o<r;o+=4){const t=e[o]*(1/255),r=e[o+1]*(1/255),a=e[o+2]*(1/255),s=e[o+3]*(1/255);i[0]+=t,i[1]+=r,i[2]+=a,i[3]+=s,n[0]+=t*t,n[1]+=t*r,n[2]+=t*a,n[3]+=t*s,n[5]+=r*r,n[6]+=r*a,n[7]+=r*s,n[10]+=a*a,n[11]+=a*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 e=0;e<16&&(h=d.multVec(u,h),p=Math.sqrt(d.dot(h,h)),h=d.sml(1/p,h),!(0!=e&&Math.abs(p-f)<1e-9));e++)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]]};ra.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)},ra.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 n=0;n<e.length;n++)u.frames.push({rect:{x:0,y:0,width:t,height:r},img:new Uint8Array(e[n]),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)},ra.encode.compress=u,ra.encode.dither=s,ra.quantize=g,ra.quantize.getKDtree=m,ra.quantize.getNearest=v}();const na={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,na._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var ia={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},oa={[ia.CHROME]:16384,[ia.FIREFOX]:11180,[ia.DESKTOP_SAFARI]:16384,[ia.IE]:8192,[ia.IOS]:4096,[ia.ETC]:8192};const aa="undefined"!=typeof window,sa="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,la=aa&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),ca=(aa||sa)&&(la&&la.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),ua=(aa||sa)&&(la&&la.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function da(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 ha(e){return new Promise((t,r)=>{const n=new ua;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function fa(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function pa(){if(void 0!==pa.cachedResult)return pa.cachedResult;let e=ia.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=ia.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=ia.IOS:/Safari/i.test(t)?e=ia.DESKTOP_SAFARI:/Firefox/i.test(t)?e=ia.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=ia.IE),pa.cachedResult=e,pa.cachedResult}function ga(e,t){const r=pa(),n=oa[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 ma(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 va(e,t){const{width:r,height:n}=ga(e.width,e.height),[i,o]=ma(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 ya(){return void 0!==ya.cachedResult||(ya.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),ya.cachedResult}function ba(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=va(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 ha(e).then(function(e){try{return t=e,fa(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(ya()||[ia.DESKTOP_SAFARI,ia.MOBILE_SAFARI].includes(pa()))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 wa(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=ra.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=>na.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),da(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 xa(e){e.width=0,e.height=0}function Ca(){return new Promise(function(e,t){let r,n,i,o;return void 0!==Ca.cachedResult?e(Ca.cachedResult):da("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,ba(r).then(function(a){try{return n=a[1],wa(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,xa(n),ba(i).then(function(r){try{return o=r[0],Ca.cachedResult=1===o.width&&2===o.height,e(Ca.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 _a(e){return new Promise((t,r)=>{const n=new ua;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 Sa(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]=ma(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),xa(e)),a}function ka(e,t){const{width:r}=e,{height:n}=e,[i,o]=ma(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),xa(e),i}function Aa(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 k(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=e,t.onProgress(Math.min(o,100))}function A(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,k(),ba(e,t).then(function(r){try{return[,l]=r,k(),c=Sa(l,t),k(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return _a(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,k(),Ca().then(function(r){try{return d=r?c:ka(c,u),k(),h=t.initialQuality||1,f=t.fileType||e.type,wa(d,f,e.name,e.lastModified,h).then(function(r){try{{if(p=r,k(),g=p.size>s,m=p.size>e.size,!g&&!m)return A(100),n(p);var o;function u(){if(a--&&(b>s||b>v)){let t,r;return t=S?.95*_.width:_.width,r=S?.95*_.height:_.height,[x,C]=ma(t,r),C.drawImage(_,0,0,t,r),h*="image/png"===f?.85:.95,wa(x,f,e.name,e.lastModified,h).then(function(e){try{return w=e,xa(_),_=x,b=w.size,A(Math.min(99,Math.floor((y-b)/(y-s)*100))),u}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=u}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(u);function I(){return xa(_),xa(x),xa(c),xa(d),xa(l),A(100),n(w)}}}catch(E){return i(E)}}.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 Ia;function Ea(e,t){return new Promise((r,n)=>{Ia||(Ia=function(e){const t=[];return t.push(e),URL.createObjectURL(new Blob(t))}("\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"));const i=new Worker(Ia);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}})})}function Fa(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 ca))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 Aa(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 Aa(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",Ea(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=Zo(e,o))}catch(e){}return r(o)}})}function Ta(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=Ar(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=Ar(t),r=Fr(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"}}Fa.getDataUrlFromFile=ha,Fa.getFilefromDataUrl=da,Fa.loadImage=fa,Fa.drawImageInCanvas=va,Fa.drawFileInCanvas=ba,Fa.canvasToFile=wa,Fa.getExifOrientation=_a,Fa.handleMaxWidthOrHeight=Sa,Fa.followExifOrientation=ka,Fa.cleanupCanvasMemory=xa,Fa.isAutoOrientationInBrowser=Ca,Fa.approximateBelowMaximumCanvasSizeOfBrowser=ga,Fa.copyExifWithoutOrientation=Zo,Fa.getBrowserName=pa,Fa.version="2.0.2";const Oa={MAX_SIZE_MB:.48,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8},Pa=["gif","svg"];function Ma(e,t,r,n){return new File([e],t,{type:r,lastModified:n})}function Ra(e,t){return t&&t!==e.name?Ma(e,t,e.type,e.lastModified):e}async function La(e,t={}){const{maxSizeMB:r=Oa.MAX_SIZE_MB,maxWidthOrHeight:n=Oa.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:o,libURL:a,enableCompression:s=!0}=t;if(!(e&&e instanceof File))return e;const l=Ar(e.type||i||"image/jpeg");if(!l.startsWith("image/"))return Ra(e,o);const c="image/webp"===(u=l)?"image/jpeg":u;var u;const d=Fr(l),h=Fr(c),f=c!==l?function(e,t){const r=t.startsWith(".")?t.slice(1):t,n=e.lastIndexOf(".");return n>0?`${e.substring(0,n)}.${r}`:`${e}.${r}`}(null!=o?o:e.name,h):null!=o?o:e.name,p=s&&(g=d,!Pa.includes(g));var g;if(!p&&!(c!==l))return Ra(e,f);try{const t={libURL:a,useWebWorker:!0,fileType:c};p?(t.maxSizeMB=r,t.maxWidthOrHeight=n):(t.maxSizeMB=Math.max(e.size/1048576+1,1),t.initialQuality=1,t.alwaysKeepResolution=!0);const i=await Fa(e,t);return function(e,t,r,n){const i=null!=n?n:t.name;return e instanceof File?e.type!==r||e.lastModified!==t.lastModified||e.name!==i?Ma(e,i,r,t.lastModified):e:Ma(e,i,r,t.lastModified)}(i,e,Ar(i.type||c),f)}catch(t){console.error("prepareImageForUpload failed",t);try{return Ra(e,f)}catch(t){return console.error("Failed to create File with normalized name after image preparation error",t),e}}}async function Na(e){const{folderId:t,dataProviders:r,folders:n,pathHistory:i,t:o}=e,a=null==t?"":String(t);if(!a||"folders"===a)return o("Folders");if("Trash"===a)return o("Trash");const s=i||[],l=s[s.length-1];if((null==l?void 0:l.id)===a&&l.name)return l.name;const c=[...s].reverse().find(e=>e.id===a);if(null==c?void 0:c.name)return c.name;const u=null==r?void 0:r.getItem;if(u)try{const e=await Promise.resolve(u(a));if(null==e?void 0:e.name)return e.name}catch(e){}const d=null==n?void 0:n.find(e=>e.id===a);return(null==d?void 0:d.name)?d.name:a}const ja=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function Da(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])=>!ja.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 za(e){return!!(null==e?void 0:e.startsWith("image/"))&&"image/gif"!==e}function Ba(e,t){if(t===e.name)return e;try{return new File([e],t,{type:e.type,lastModified:e.lastModified})}catch(t){return console.warn("Failed to create normalized File:",t),e}}function Ua(e){return null==e||""===e||"folders"===e?null:e}async function Va(e){const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new qo(`HTTP ${t.status}`,"UploadUrlDownloadFailed",t.status);return t.blob()}const Ha=()=>{var e,t,r,n;const{state:o,actions:a,options:s}=po(),l=Eo(),{sortBy:u,sortOrder:d}=l.state,{actions:{fetchFolders:h}}=Wo(),{t:f}=Yn(),p=Oo(),{deleteItems:g}=Go(),{selectedFolder:m,urlForm:v,pagination:y,files:b,pathHistory:w,folders:x}=o,C=i.useRef(null),_=i.useRef([]);C.current=y,_.current=Array.isArray(b)?b:[];const S=i.useRef(null),{setFiles:k,setLoading:A,setIsUrlModalVisible:I,setActiveLibraryItem:E,setPagination:F,setSelectedFolder:T,setPathHistory:O}=a,{dataProviders:P}=s,M=c(async e=>{var t,r,n;if(!(null==P?void 0:P.getFiles))return[];const i=null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.disablePagination,{files:o,pagination:a}=await P.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,noFolder:null==e?void 0:e.noFolder,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 F&&((null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.disablePagination)?F({current:1,pageSize:o.length||1,total:o.length||0}):a&&F({current:a.page,pageSize:a.limit,total:a.total})),o},[P,null===(e=null==s?void 0:s.config)||void 0===e?void 0:e.disablePagination,F]),R=c(async(e,t,r)=>hi(P,e,t,r,Br(null==s?void 0:s.config)),[P,null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient]),L=c(async(e,t=!1)=>{var r,n,i;try{null==A||A(!0);let t=[];if(!(null==P?void 0:P.getFiles))return void console.error("DataProvider for getting files is not defined");t=await M(e);const r=null!=e?e:{folderId:m||"",itemType:"all"};"file"!==r.itemType&&(t=await Io(t,r,null==P?void 0:P.getFolders)),"Trash"!==(m||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==k||k(t);const n=Ua(r.folderId);if(n===Ua(m)){const e=Array.isArray(w)?w:[];S.current={selectedFolder:null!=m?m:null,pathHistory:e.map(e=>Object.assign({},e))}}}catch(o){if("StaleLoad"===(null==o?void 0:o.name))return;const a=No(o),l=404===(null==a?void 0:a.status)||"FileNotFound"===(null==a?void 0:a.code)||"path_folder_not_found"===(null==a?void 0:a.code);if(l||console.error("Error loading files:",o),!t&&l){const t=Ho(o,w||[]);try{return await $o({options:s,pathFolder:t,dataProviders:null==s?void 0:s.dataProviders}),void await L(e,!0)}catch(e){console.error("Cache clear failed:",e)}}if(l&&T&&O){const t=Array.isArray(w)?w:[];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 O(n),T(o),await h(),p.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:f("Folder not found"),description:f("Navigated to parent folder"),placement:"bottomRight"}),void await L(Object.assign(Object.assign({},e),{folderId:o}),!1)}return O([{id:"folders",name:f("Folders")}]),T("folders"),await h(),p.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:f("Folder not found"),description:f("Navigated to root folder"),placement:"bottomRight"}),void await L(Object.assign(Object.assign({},e),{folderId:"folders"}),!1)}const c=S.current;if(c&&T&&O){const e=Array.isArray(w)?w:[],t=(null!==(n=c.selectedFolder)&&void 0!==n?n:null)===(null!=m?m:null),r=function(e,t){return e.length===t.length&&e.every((e,r)=>{var n;return e.id===(null===(n=t[r])||void 0===n?void 0:n.id)})}(c.pathHistory,e);t&&r||(T(c.selectedFolder),O(c.pathHistory.map(e=>Object.assign({},e))),s.onPathChange&&s.onPathChange(c.pathHistory.map(e=>e.name)))}const u=Ro(null==a?void 0:a.code,f),d=null!=e?e:{folderId:m||"",itemType:"all"},g=void 0!==d.folderId&&""!==d.folderId?d.folderId:m||"",v=Array.isArray(w)?w.map(e=>Object.assign({},e)):[],y=null===(i=d.folderName)||void 0===i?void 0:i.trim(),b=y&&y.length>0?y:await Na({folderId:g,dataProviders:P,folders:Array.isArray(x)?x:[],pathHistory:v,t:f}),C=f("Failed to load files"),_=f("Failed to load files in folder",{folderName:b}),k=u&&u!==C?u:void 0;p.error({id:"FILES_FETCH_FAILED",message:_,description:k,placement:"bottomRight",innerException:o,notificationDedupe:!0,data:{params:Object.assign(Object.assign({},d),{folderName:b}),folderName:b}})}finally{null==A||A(!1)}},[P,k,A,T,O,M,h,m,x,p,f,w,s]),N=c(e=>L(e),[L]),j=c(async(e,t)=>{var r;if(!(null==P?void 0:P.findFileByUrl))return null;const n=Da(e);try{return null!==(r=await P.findFileByUrl(n))&&void 0!==r?r:null}catch(e){return console.warn("findFileByUrl failed, falling back to direct loading",e),null}},[P]),D=c(async(e,t)=>{var r,n,i,o;Ko(e,f);const a=Da(e),l=await j(a,t);if(l)return{kind:"existing",file:l,normalizedUrl:a};let c,u;const d=null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.handleFileProxy,h=null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.handleProxyUrl,p=function(e){if("undefined"==typeof window)return!1;try{return new URL(e).origin===window.location.origin}catch(e){return!1}}(a);if(!p&&d)try{c=await Promise.resolve(d(a))}catch(e){u=e,console.warn("handleFileProxy failed, falling back to fetch",e)}if(!p&&!c&&h)try{const e=await Promise.resolve(h(a));c=await Va(e)}catch(e){u=e,console.warn("handleProxyUrl fetch failed, falling back to direct fetch",e)}if(!c)try{c=await Va(a)}catch(e){u=e}if(!(c instanceof Blob)||0===c.size)throw u instanceof Error?u:new qo(f("Failed to download file from the URL."),"UploadUrlDownloadFailed");const g=(null===(o=null===(i=c.type)||void 0===i?void 0:i.split(";")[0])||void 0===o?void 0:o.trim())||"image/png";if(!g.startsWith("image/"))throw new qo(f("Content type at the URL is not allowed."),"UploadUrlContentTypeNotAllowed");const m=Fr(g),v=function(e){try{const t=new URL(e).pathname.split("/").pop();return t?decodeURIComponent(t):void 0}catch(e){return}}(a)||"uploaded-file",y=v.replace(/\.[^.]+$/,"")||"uploaded-file";return{kind:"blob",blob:c,normalizedUrl:a,mimeType:g,extension:m,fileName:Dr(v.includes(".")?v:`${y}.${m}`,null==s?void 0:s.config)}},[j,null==s?void 0:s.config,f]),z=c(async(e,t)=>{var r,n;Ko(e,f);const i=Da(e);try{const e=await D(i,t);if("existing"===e.kind)return e.file;const r=await(s=e.blob,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(s)}));return{thumbnail:r,name:e.fileName,type:e.mimeType,extension:e.extension,size:e.blob.size,sourceUrl:e.normalizedUrl,saveWithoutFolder:!0}}catch(e){const s=No(e),l=(o=null==s?void 0:s.code,a="UploadUrlDownloadFailed","string"==typeof o?o:a),c=e instanceof qo?e:new qo(null!==(n=null!==(r=Ro(l,f))&&void 0!==r?r:null==s?void 0:s.message)&&void 0!==n?n:f("Failed to download file from the URL."),l,null==s?void 0:s.status);throw c.notificationShown=!0,await p.error({id:"EDITOR_PROXY_FILE_FAILED",message:c.message,placement:"bottomRight",data:{url:i,folderId:m||null,error:s,eventSource:"pixie"},innerException:e},t),c}var o,a,s},[j,p,null==s?void 0:s.config,m,f]),B=c(async e=>{const t=C.current;try{const r=_.current.find(t=>t.id===e),n=e=>{if(!e)return;const t=b.find(t=>t.id===e);return null==t?void 0:t.name};await g({items:[{id:e,isFolder:null==r?void 0:r.isFolder}],selectedFolder:m,getItemNameById:n,showNotifications:!0});const i=Object.assign({},t);let o=t.current;1===b.length&&(o=i.current>1?i.current-1:1),await N({folderId:m||"",page:o,limit:t.pageSize,sortBy:u,sortOrder:d})}catch(t){console.error("ОError when deleting a file:",t);const r=t;(null==r?void 0:r.notificationShown)||p.error({id:"FILES_DELETE_ERROR",message:f("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:m||null,errors:[{itemId:e,error:No(t)}]}})}},[g,N,m,f,p,b,u,d]),U=c(async e=>{try{const t=C.current;if(!(null==P?void 0:P.deleteFolder))return void p.error({id:"FOLDER_DELETE_ERROR",message:f("DataProvider for folder deletion is not configured"),placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await P.deleteFolder(e)){const e=new Error("Не удалось удалить папку");throw e.notificationShown=!1,e}p.success({id:"FOLDER_DELETE_SUCCESS",message:f("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}});m===e?await N({page:t.current,limit:t.pageSize,sortBy:u,sortOrder:d}):await N({folderId:m||"",sortBy:u,sortOrder:d,page:t.current,limit:t.pageSize})}catch(t){console.error("Error when deleting a folder:",t);const r=t;(null==r?void 0:r.notificationShown)||p.error({id:"FOLDER_DELETE_ERROR",message:f("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:No(t)}]}})}},[P,m,p,f,N,u,d]),V=c(async(e,t)=>{var r,n;try{if(null==P?void 0:P.getFileData){const t=await P.getFileData(e);if(t)return t;throw new Error(f("Failed to download file"))}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error(f("Error loading image"));return await t.blob()}}catch(i){console.error("Error when loading a file:",i);const o=_.current.find(t=>t.id===e);t||p.error({id:"FILE_DOWNLOAD_FAILED",message:f("Failed to download file"),placement:"bottomRight",description:(null==o?void 0:o.name)||e,innerException:i,notificationDedupe:!1,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)}},[P,p,f]),H=c(async(e,t,r,n)=>{var i,a,l,c,u,d,h,g,v,y,b,w,x,C,_;if("Trash"===(n?"":null!=t?t:m||""))throw new Error(f("Upload to Trash is forbidden"));const S=Dr(e.name,null==s?void 0:s.config),k=S.split(".").pop()||"",A=n?"":null!=t?t:m||"";let I=e;try{if(null===(a=null===(i=e.type)||void 0===i?void 0:i.startsWith)||void 0===a?void 0:a.call(i,"image/")){const t=null!==(c=null===(l=null==s?void 0:s.config)||void 0===l?void 0:l.compressMaxSize)&&void 0!==c?c:Oa.MAX_SIZE_MB,r=null!==(d=null===(u=null==s?void 0:s.config)||void 0===u?void 0:u.compressMaxWidthOrHeight)&&void 0!==d?d:2e3,n=null!==(g=null===(h=null==s?void 0:s.config)||void 0===h?void 0:h.compessorUrl)&&void 0!==g?g:null===(v=null==s?void 0:s.config)||void 0===v?void 0:v.compressorUrl;I=await La(e,{maxSizeMB:t,maxWidthOrHeight:r,mimeType:e.type,fileName:S,libURL:n,enableCompression:za(e.type)})}else I=Ba(e,S)}catch(t){console.warn("Image preparation failed, uploading original file",t),I=Ba(e,S)}let F=I.name;const T=Br(null==s?void 0:s.config);T&&(F=await R(F,A,n)),T&&(I=Ba(I,F));try{if(null==P?void 0:P.uploadFiles)try{const t=await P.uploadFiles({items:[{name:F,size:I.size,type:I.type||e.type,folderId:A,data:I,extension:k,noFolder:n}],folderId:A});if(t.success&&t.detailed&&t.detailed.length>0){const i=t.detailed[0];if(!i.success||!i.data){if(!r){const e=(null==i?void 0:i.error)?String(i.error):f("Failed to upload file");p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:S,innerException:null==i?void 0:i.error,data:{itemName:S,folderId:A||null,eventSource:"upload"}})}return void(E&&E(rr))}{const t=i.data;if(t.id){const r=(null!==(y=t.folderId)&&void 0!==y?y:A)||void 0;await N({folderId:r,noFolder:n});let i=o.files.find(e=>e.id===t.id);if(!i)try{i=(await M({folderId:r,noFolder:n,itemType:"file"})).find(e=>e.id===t.id)}catch(e){console.warn("uploadFileWithProvider: не удалось получить свежий список файлов",e)}return E&&E(rr),i||Object.assign(Object.assign({},t),{id:t.id,name:t.name||S,folderId:null!==(w=null!==(b=t.folderId)&&void 0!==b?b:A)&&void 0!==w?w:null,type:I.type||e.type,size:I.size,extension:k||S.split(".").pop()||"",thumbnail:null!==(x=t.thumbnail)&&void 0!==x?x:void 0,url:null!==(C=t.url)&&void 0!==C?C:void 0,thumbnailUrl:null!==(_=t.thumbnailUrl)&&void 0!==_?_:void 0,isFolder:!1,selected:!1})}}}else if(!t.success){if(!r){const e=t.error?String(t.error):f("Failed to upload file");p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:S,innerException:t.error,data:{itemName:S,folderId:A||null,eventSource:"upload"}})}return void(E&&E(rr))}return void(E&&E(rr))}catch(e){throw e}if(null==P?void 0:P.uploadFile){const t=await P.uploadFile({name:F,size:I.size,type:I.type||e.type,folderId:A,noFolder:n,data:I,extension:k});return E&&E(rr),t}return void(r||p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"}))}catch(e){const t=No(e),n=Ro(null==t?void 0:t.code,f);return r?void 0:void p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=n?n:f("Failed to upload file"),placement:"bottomRight",description:S,innerException:e,data:{itemName:S,folderId:A||null,error:No(e),eventSource:"upload"}})}},[P,m,E,o.files,N,M,p,f,null==s?void 0:s.config]),$=c(async(e,t)=>{var r;if(!(null==P?void 0:P.getFolders)||!(null==P?void 0:P.createFolder))return e||"";try{const n=await P.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 P.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 console.warn("ensureFolderPath: unable to guarantee the path",t),e||""}},[P]),W=c(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 $(t||"",r)||t||"")}return null!==(o=null!==(i=s)&&void 0!==i?i:t)&&void 0!==o?o:null},[$]);c(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 W(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)}},[W]);const G=c(async(e,t)=>{var r,n,i,o,a,l,c,u,d,h,g,v,y,b,w,x,C,_,S,k,A,I,F,T,O,M,R,L,N,j,D,z,B,U,V,H,$,G;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 q=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},Y=[];for(let r=0;r<e.length;r++){const w=e[r];if(!(null===(i=null===(n=w.type)||void 0===n?void 0:n.startsWith)||void 0===i?void 0:i.call(n,"image/"))){const e=await p.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:f("Unsupported file type"),placement:"bottomRight",data:{itemName:w.name,fileType:w.type,folderId:m||null}});null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,w.name,e.message);continue}const x=Dr(w.name,null==s?void 0:s.config);let C=w;try{if(null===(l=null===(a=w.type)||void 0===a?void 0:a.startsWith)||void 0===l?void 0:l.call(a,"image/")){const e=null!==(u=null===(c=null==s?void 0:s.config)||void 0===c?void 0:c.compressMaxSize)&&void 0!==u?u:Oa.MAX_SIZE_MB,t=null!==(h=null===(d=null==s?void 0:s.config)||void 0===d?void 0:d.compressMaxWidthOrHeight)&&void 0!==h?h:2e3,r=null!==(v=null===(g=null==s?void 0:s.config)||void 0===g?void 0:g.compessorUrl)&&void 0!==v?v:null===(y=null==s?void 0:s.config)||void 0===y?void 0:y.compressorUrl;C=await La(w,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:w.type,fileName:x,libURL:r,enableCompression:za(w.type)})}else C=Ba(w,x)}catch(e){console.warn("Image preparation failed, uploading original file",e),C=Ba(w,x)}const _=`${Date.now()}-${r}-${Math.random().toString(36).slice(2,8)}`,S=await W(C,m);null===(b=null==t?void 0:t.onStart)||void 0===b||b.call(t,C),Y.push({file:C,targetFolderId:S,requestId:_,originalFileName:w.name,originalIndex:r})}const X=Y.length;if(0===X)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const K=Br(null==s?void 0:s.config),Z=new Map;if(K&&(null==P?void 0:P.getFiles)){const e=[...new Set(Y.map(e=>{var t,r;return null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:m)&&void 0!==r?r:""}).filter(e=>null!=e))];for(const t of e)try{const{files:e}=await P.getFiles({folderId:""===t?"":null!=t?t:void 0,itemType:"file",page:1,limit:1e4});Z.set(t,(e||[]).map(e=>e.name))}catch(e){console.warn("Could not fetch files for duplicate check:",e)}}const J=new Map,Q=!t,ee=1===X&&Q,te=[],re=[],ne=[],ie=[],oe=new Map;let ae=0,se=0;const le=null!==(x=null===(w=null==s?void 0:s.config)||void 0===w?void 0:w.maxFileSize)&&void 0!==x?x:52428800,ce=async(e,r,n,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};ae++,te.push(e),re.push(null!=n?n:e),await((e,t,r,n)=>{var i;return p.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${f("File")} ${e} ${f("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:r,itemName:e,folderId:null!==(i=null!=t?t:m)&&void 0!==i?i:null,eventSource:"upload"}},n||!Q)})(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))},ue=async(e,r,n,i)=>{var o;const{emitProgress:a=!0,emitNotification:s=!0,fileSize:l,progressCallbackName:c,progressCallbackIndex:u}=null!=i?i:{};se++;const d=null!=l?{fileSize:l,maxSize:le}:void 0,h=await((e,t,r,n,i)=>{var o,a,s,l,c,u,d;const h=No(r),g=null!==(o=null==i?void 0:i.fileSize)&&void 0!==o?o:null==h?void 0:h.fileSize,v=null!==(s=null!==(a=null==i?void 0:i.maxSize)&&void 0!==a?a:null==h?void 0:h.maxSize)&&void 0!==s?s:le,y={allowedChars:"a-z A-Z 0-9 . _ -",fileSize:null!=g?li(Number(g)):void 0,maxSize:null!=v?li(Number(v)):void 0},b=null==h?void 0:h.code,w="BatchItemLimitExceeded"===b||"exceeded_max_files"===b?b:null!==(l=Lo(null==h?void 0:h.message))&&void 0!==l?l:b,x="BatchItemLimitExceeded"===w||"exceeded_max_files"===w?jo(r,f):Ro(w,f,y),C=(null==h?void 0:h.message)&&"string"==typeof h.message&&h.message.length>0?h.message:null,_=r instanceof Error?r.message:"string"==typeof r?r:null,S=_&&"[object Object]"!==_?_:null;return p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!==(u=null!==(c=null!=C?C:x)&&void 0!==c?c:S)&&void 0!==u?u:f("Error uploading file {{fileName}}",{fileName:e}),placement:"bottomRight",data:{itemName:e,folderId:null!==(d=null!=t?t:m)&&void 0!==d?d:null,error:No(r),eventSource:"upload"},innerException:r},n||!Q)})(e,r,n,!s,d);a&&(null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,null!=c?c:e,h.message,u)),ie.push({itemId:void 0,itemName:e,error:No(n)}),ne.push({fileName:e,error:h.message})};if(!(null==P?void 0:P.uploadFiles))return p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"}),{successCount:0,failCount:X,successes:[],errors:[],totalCount:X};{const e=[];try{(null==t?void 0:t.onProgress)&&Y.forEach(r=>{let n=0;const i=window.setInterval(()=>{var e;n=Math.min(n+10+Math.floor(Date.now()%10),90),null===(e=null==t?void 0:t.onProgress)||void 0===e||e.call(t,r.file.name,n)},200);e.push(i)});let r=await P.uploadFiles({items:Y.map(e=>{var t,r;const n=K?((e,t)=>{const r=null!=e?e:"";let n=Z.get(r)||[],i=J.get(r);i||(i=new Set(n.map(e=>e.toLowerCase())),J.set(r,i));const o=di(t,Array.from(i));return i.add(o.toLowerCase()),o})(e.targetFolderId,e.file.name):e.file.name,i=K?Ba(e.file,n):e.file;return{requestId:e.requestId,name:n,size:i.size,type:i.type,folderId:null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:m)&&void 0!==r?r:null,data:i,extension:i.name.split(".").pop()||""}}),folderId:null!=m?m:null});e.forEach(e=>window.clearInterval(e)),e.length=0;const n=null!==(C=r.detailed)&&void 0!==C?C:[],i=new Map(n.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(n.length>0)for(let e=0;e<Y.length;e++){const t=Y[e],r=null!==(_=t.requestId?i.get(t.requestId):void 0)&&void 0!==_?_:n[e];if(r&&r.success){const e=r.data,n=null!==(S=null==e?void 0:e.name)&&void 0!==S?S:Dr(t.file.name,null==s?void 0:s.config),i=null!==(I=null!==(A=null!==(k=null==e?void 0:e.folderId)&&void 0!==k?k:t.targetFolderId)&&void 0!==A?A:m)&&void 0!==I?I:null,o=null==e?void 0:e.id;oe.set(n,{id:o,name:n,folderId:i,size:null==e?void 0:e.size,originalFileName:t.originalFileName,originalIndex:t.originalIndex}),await ce(n,i,o,{emitNotification:ee})}else{const e=null==r?void 0:r.data,n=null!==(F=null==e?void 0:e.name)&&void 0!==F?F:Dr(t.file.name,null==s?void 0:s.config),i=null!==(M=null!==(O=null!==(T=null==e?void 0:e.folderId)&&void 0!==T?T:t.targetFolderId)&&void 0!==O?O:m)&&void 0!==M?M:null;await ue(n,i,null!==(R=null==r?void 0:r.error)&&void 0!==R?R:new Error(f("Error uploading file")),{emitNotification:ee,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}else if(r.success)for(const e of Y){const t=Dr(e.file.name,null==s?void 0:s.config),r=null!==(N=null!==(L=e.targetFolderId)&&void 0!==L?L:m)&&void 0!==N?N:null;await ce(t,r,void 0,{emitNotification:ee})}else{const e=null!==(j=r.error)&&void 0!==j?j:new Error(f("Error uploading file"));for(const t of Y){const r=Dr(t.file.name,null==s?void 0:s.config),n=null!==(z=null!==(D=t.targetFolderId)&&void 0!==D?D:m)&&void 0!==z?z:null;await ue(r,n,e,{emitNotification:ee,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}}catch(e){for(const t of Y){const r=Dr(t.file.name,null==s?void 0:s.config),n=null!==(U=null!==(B=t.targetFolderId)&&void 0!==B?B:m)&&void 0!==U?U:null;await ue(r,n,null!=e?e:new Error(f("Error uploading file")),{emitNotification:ee,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}finally{e.forEach(e=>window.clearInterval(e))}}if(ae>0&&(E&&E(rr),X>1&&Q)){const e=q(te),t=e?f("Uploaded",{names:e}):f("uploads_success_summary",{successCount:ae,totalCount:X});p.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:ae,totalCount:X,itemIds:re,itemNames:te,folderId:null!=m?m:null,eventSource:"upload"}})}if(se>0&&Q&&!ee)if(X>1){const e=ne.map(e=>e.fileName),t=q(e),r=t?f("Failed",{names:t}):f("uploads_fail_summary",{failCount:se,totalCount:X});p.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:se,totalCount:X,itemNames:e,folderId:null!=m?m:null,errors:ie,eventSource:"upload"}})}else if(1===X&&ie.length>0&&(null===(V=ie[0].error)||void 0===V?void 0:V.code)){const e=Ro(null===(H=ie[0].error)||void 0===H?void 0:H.code,f),t=null!==(G=null===($=ne[0])||void 0===$?void 0:$.fileName)&&void 0!==G?G:"",r=null!=e?e:t?`${f("Failed to upload files")}: ${t}`:f("Failed to upload files");p.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:se,totalCount:X,itemNames:[t],folderId:null!=m?m:null,errors:ie,eventSource:"upload"}})}return{successCount:ae,failCount:se,successes:te,errors:ne,totalCount:X,uploadedFiles:oe.size>0?oe:void 0}},[P,null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient,p,W,m,E,f,null==s?void 0:s.config]),q=c(async e=>{var t;if(!(null==P?void 0:P.uploadFiles))return void p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"});if("Trash"===m)return void p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}});const r=C.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==A||A(!0);const{successes:t,errors:i,uploadedFiles:a}=await G(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 h(),await N({folderId:m||"",sortBy:u,sortOrder:d,page:r.current,limit:r.pageSize})}catch(e){console.error("Error when loading files:",e)}finally{null==A||A(!1)}},n.click()},[null==P?void 0:P.uploadFiles,m,p,f,A,N,h,u,d,G,null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.features]),Y=c(async(e,t,r,n="uploadByUrl")=>{const i=C.current,o=Boolean(e&&String(e).trim());let a,l=null!=e?e:null;try{if(!t&&"Trash"===m)throw r||p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}}),new qo(f("Cannot upload files to Trash"),"UploadUrlDownloadFailed");let e,c;if(!l&&v&&(e=await v.validateFields(),l=null==e?void 0:e.fileUrl),!l)throw r||p.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:f("Please fill in all fields"),placement:"bottomRight",data:{url:null!=l?l:null,folderId:m||null,eventSource:n}}),new qo(f("Please fill in all fields"),"UploadUrlInvalid");if(Ko(l,f),l=Da(l),null==A||A(!0),l){const e=l.split("?")[0].split("#")[0].split("/");c=e[e.length-1]||"uploaded-file",c=Dr(c,null==s?void 0:s.config)}const h=t?"":m||"",g=Boolean((null==P?void 0:P.uploadFiles)||(null==P?void 0:P.uploadFile)),y=Boolean(null==P?void 0:P.uploadFileByUrl);let b=c;b&&y&&(b=await R(b,h,t));try{const e=await D(l,r);if("existing"===e.kind)a=e.file;else if(g){const r=new File([e.blob],e.fileName,{type:e.mimeType,lastModified:Date.now()});try{a=await H(r,h,!0,t)}catch(e){throw e.uploadUrlStage="binaryUpload",e}if(!a){const e=new qo(f("Failed to upload file"),"FileUploadBackendError");throw e.uploadUrlStage="binaryUpload",e}}else{if(!y)throw r||p.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:f("Upload by URL is not supported"),placement:"bottomRight",data:{url:l,folderId:m||null,eventSource:n}}),new qo(f("Upload by URL is not supported"),"UploadUrlDownloadFailed");a=await P.uploadFileByUrl({url:l,folderId:m||"",noFolder:t,name:b,eventSource:n})}}catch(e){const r=e;if("binaryUpload"===(null==r?void 0:r.uploadUrlStage)||!y)throw e;console.warn("Failed to fetch file by URL locally, falling back to uploadByUrl",e),a=await P.uploadFileByUrl({url:l,folderId:m||"",noFolder:t,name:b,eventSource:n})}const w=(null==e?void 0:e.name)||(null==a?void 0:a.name)||"unnamed file";return a&&p.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${f("File")} ${w} ${f("successfully uploaded")}`,placement:"bottomRight",data:{itemName:w,itemId:null==a?void 0:a.id,folderId:m||null,eventSource:n}},r),(e||o)&&(null==I||I(!1),null==v||v.resetFields()),E&&E(rr),await N({folderId:m||"",noFolder:t,sortBy:u,sortOrder:d,page:i.current,limit:i.pageSize}),a}catch(e){if(console.error("Error when loading a file by URL:",e),!r){const t=No(e),r=t,i=e,o=Number(null==r?void 0:r.fileSize),a=Number(null==r?void 0:r.maxSize),s=Number.isFinite(o)&&Number.isFinite(a)?{fileSize:o,maxSize:a}:void 0,c="binaryUpload"===(null==i?void 0:i.uploadUrlStage)?jo(t,f,s):Bo(t,f);p.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:c,placement:"bottomRight",data:{url:null!=l?l:null,folderId:m||null,error:t,eventSource:n},innerException:e})}throw e}finally{null==A||A(!1)}},[v,A,P,p,f,I,E,N,m,u,d,R,D,H,null==s?void 0:s.config]),X=c(async e=>{if(!e.length)return;const t=C.current;"Trash"!==m?(await G(e),await N({folderId:m||"",sortBy:u,sortOrder:d,page:t.current,limit:t.pageSize})):p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}})},[N,m,u,d,G,p,f]);return{fetchFiles:N,handleDeleteFile:B,handleDeleteFolder:U,handleAddFile:q,handleAddFileByUrl:Y,handleDroppedFiles:X,getFileData:V,findFileByUrl:j,resolveFileForEditByUrl:z,uploadFileWithProvider:H}},$a=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=(null!=n?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))},a=t=e(n,i,o);return o},Wa=e=>e;const Ga=e=>{const t=(e=>e?$a(e):$a)(e),r=e=>function(e,t=Wa){const r=i.useSyncExternalStore(e.subscribe,i.useCallback(()=>t(e.getState()),[e,t]),i.useCallback(()=>t(e.getInitialState()),[e,t]));return i.useDebugValue(r),r}(t,e);return Object.assign(r,t),r};function qa(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const Ya=(Xa=e=>({selectedFiles:new Set,visibleFileIds:[],anchorId:null,multiSelect:!0,setMultiSelect:t=>{e(e=>{var r;if(e.multiSelect===t)return e;if(t)return{multiSelect:!0};const n=null!==(r=Array.from(e.selectedFiles)[0])&&void 0!==r?r:null;return{multiSelect:!1,selectedFiles:n?new Set([n]):new Set,anchorId:n}})},syncVisibleFiles:t=>{const r=Array.isArray(t)?t.map(e=>e.id):[];e(e=>{const t=new Set(r),n=new Set(Array.from(e.selectedFiles).filter(e=>t.has(e))),i=e.anchorId&&t.has(e.anchorId)?e.anchorId:null,o=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}(e.visibleFileIds,r),a=qa(e.selectedFiles,n),s=e.anchorId===i;return o&&a&&s?e:{visibleFileIds:r,selectedFiles:n,anchorId:i}})},setSelectedFiles:t=>{e(e=>{var r;const n=new Set(e.visibleFileIds),i=new Set(Array.from(t).filter(e=>n.has(e)));return qa(e.selectedFiles,i)?e:{selectedFiles:i,anchorId:null!==(r=Array.from(i)[0])&&void 0!==r?r:null}})},clearSelection:()=>{e(e=>0===e.selectedFiles.size&&null===e.anchorId?e:{selectedFiles:new Set,anchorId:null})},selectAllVisible:()=>{e(e=>{var t;const r=new Set(e.visibleFileIds),n=null!==(t=e.visibleFileIds[0])&&void 0!==t?t:null;return qa(e.selectedFiles,r)&&e.anchorId===n?e:{selectedFiles:r,anchorId:n}})},toggleFileSelection:(t,r)=>{e(e=>{const n=!1!==e.multiSelect,i=Boolean(null==r?void 0:r.shiftKey)&&n,o=Boolean(null==r?void 0:r.metaKey)||Boolean(null==r?void 0:r.ctrlKey)||Boolean(null==r?void 0:r.forceToggle),a=e.visibleFileIds,s=new Set(a);if(a.length>0&&!s.has(t))return e;if(!n){const r=new Set([t]);return qa(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(i&&e.anchorId&&s.has(e.anchorId)){const r=a.indexOf(e.anchorId),n=a.indexOf(t);if(-1===r||-1===n)return e;const[i,s]=r<n?[r,n]:[n,r],l=a.slice(i,s+1),c=o?new Set(e.selectedFiles):new Set;return l.forEach(e=>{c.add(e)}),qa(e.selectedFiles,c)?e:{selectedFiles:c}}if(i&&!e.anchorId){const r=new Set([t]);return qa(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(o){const r=new Set(e.selectedFiles);return r.has(t)?r.delete(t):r.add(t),qa(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}const l=new Set([t]);return qa(e.selectedFiles,l)&&e.anchorId===t?e:{selectedFiles:l,anchorId:t}})}}),Xa?Ga(Xa):Ga);var Xa;const Ka=e=>{var t,r,n,i;const{state:o,actions:a,options:s}=po(),{t:l}=Yn(),u=Wo(),d=Oo(),{fetchFolders:h}=u.actions,{renameItem:f}=(()=>{const{options:e}=po(),{dataProviders:t}=e,{t:r}=Yn(),n=c(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=zr(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=Dr(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:No(e)}}},[t,r,e.config]);return{renameItem:n}})(),{files:p,selectedFolder:g,fileToRename:m,renameForm:v,isRenameModalVisible:y,pagination:b}=o,{setFileToRename:w,setIsRenameModalVisible:x}=a,{dataProviders:C,config:_}=s,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},k=(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)}},A=c(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:l("Folder rename is disabled by config"),placement:"bottomRight",data:k(n,e)});if(!(null==C?void 0:C.renameFolder))throw new Error(l("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:l("File rename is disabled by config"),placement:"bottomRight",data:k(n,e)});if(!(null==C?void 0:C.renameFile))throw new Error(l("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,l]),I=c(()=>{null==x||x(!1),null==w||w(null),null==v||v.resetFields()},[x,w,v]),E=c(async()=>{var t,r,n,i,o,s,c,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 A=(null==S?void 0:S.isFolder)||m.startsWith("folder_");if(A){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:l("Folder rename is disabled by config"),placement:"bottomRight",data:k(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:l("File rename is disabled by config"),placement:"bottomRight",data:k(S,m)})}const E=await f({itemId:m,newName:p.newFileName,isFolder:A});if(!E.success){const e=Ro(null===(n=E.error)||void 0===n?void 0:n.code,l);return void d.error({id:"ITEM_RENAME_FAILED",message:null!==(o=null!=e?e:null===(i=E.error)||void 0===i?void 0:i.message)&&void 0!==o?o:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{error:E.error}),innerException:E.error})}const F=E.renamedItem;A?(d.success({id:"FOLDER_RENAME_SUCCESS",message:l(`${l("Folder renamed to")} ${null!==(s=null==F?void 0:F.name)&&void 0!==s?s:p.newFileName}`),placement:"bottomRight",data:{itemId:null!==(c=null==F?void 0:F.id)&&void 0!==c?c:m,itemName:null!==(u=null==F?void 0:F.name)&&void 0!==u?u:p.newFileName,folderId:null!==(w=null!==(y=null==F?void 0:F.parentId)&&void 0!==y?y:null==F?void 0:F.folderId)&&void 0!==w?w:null}}),await h(),(null==F?void 0:F.id)&&F.id!==m&&a.setSelectedFolder&&a.setSelectedFolder(F.id)):d.success({id:"FILE_RENAME_SUCCESS",message:`${l("File renamed to")} ${null!==(x=null==F?void 0:F.name)&&void 0!==x?x:p.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{itemName:null!==(C=null==F?void 0:F.name)&&void 0!==C?C:p.newFileName})}),I(),await e({folderId:g||"",page:b.current,limit:b.pageSize})}catch(e){console.error("Error when renaming:",e);const t=No(e),r=Ro(null==t?void 0:t.code,l);d.error({id:"ITEM_RENAME_FAILED",message:null!=r?r:e instanceof Error?e.message:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{error:t}),innerException:e})}},[m,v,p,a,I,e,g,l,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:A,handleRenameCancel:I,handleRenameOk:E}}},Za=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}},Ja=(e,t,r,n,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:r,folderId:null!=n?n:null}),Qa=(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}),es=()=>{const e=Oo(),{t:t}=Yn(),{state:r,options:n}=po(),{folders:i,pathHistory:o}=r,{dataProviders:a}=n,{actions:{fetchFolders:s,fetchChildFolders:l}}=Wo();return{refreshFolders:c(async({parentIds:r,selectedFolder:n})=>{try{if(await s(),r&&l)for(const e of r)e&&await l(e)}catch(r){console.error("Error when updating the folder tree:",r);const n=t("Folders");e.error({id:"FOLDERS_FETCH_FAILED",message:t("Failed to refresh folder tree"),description:n,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{folderId:null,folderName:n,reason:r instanceof Error?r.message:String(r)}})}},[e,t,s,l]),refreshFiles:c(async({fetchFiles:r,selectedFolder:n,page:s,limit:l})=>{try{await r({folderId:n||"",page:s,limit:l})}catch(r){console.error("Ошибка при обновлении списка файлов:",r);const c=await Na({folderId:n||"",dataProviders:a,folders:Array.isArray(i)?i:[],pathHistory:o,t:t}),u=t("Failed to load files"),d=r instanceof Error?r.message:String(r);e.error({id:"FILES_FETCH_FAILED",message:t("Failed to load files in folder",{folderName:c}),description:d&&d!==u?d:void 0,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{params:{folderId:n||void 0,page:s,limit:l,folderName:c},folderName:c}})}},[e,t,a,i,o])}},ts=e=>{var t;const{state:r,actions:n,options:i}=po(),{t:o}=Yn(),a=Oo(),s=Ya(e=>e.selectedFiles),l=Ya(e=>e.clearSelection),{files:u,selectedFolder:d,moveForm:h,pagination:f,currentMenuFile:p}=r,{setIsMoveModalVisible:g,setPagination:m}=n,{dataProviders:v}=i,{moveItems:y}=(()=>{const{options:e}=po(),{dataProviders:t}=e,{t:r}=Yn(),n=Oo(),i=c(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=No(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=No(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=No(t);c.push({error:r})}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:b,refreshFiles:w}=es(),{getItemNameById:x,getItemNamesByIds:C,getNamesPreview:_}=Za(u),S=c(()=>{null==g||g(!0)},[g]),k=c(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),A=c(async t=>{var r,n,c,g,S,A,I,E;if(!((null==p?void 0:p.length)||s&&0!==s.size))return;const F=u.length,T=Object.assign({},f),O=Array.from((null==p?void 0:p.length)?[p]:s),P=O.length;let M=0,R=0;const L=[],N=O.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),j=N.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let s=t;if(!t){const e=await h.validateFields();s=null==e?void 0:e.targetFolder}if(!s)return void a.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:o("Select destination folder"),placement:"bottomRight"});const u="folders"===s?null:s,f=null!=u?u:d,p=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(p&&(null==v?void 0:v.getFolders))try{const e=await v.getFolders({parentId:u,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 e of N){if(!e.isFolder&&!(null===(c=(n=e.id).startsWith)||void 0===c?void 0:c.call(n,"folder_")))continue;const r=e.name||x(e.id)||"";if(r&&t.has(r.toLowerCase()))return void a.error({id:"FOLDER_ALREADY_EXISTS_MOVE",message:o("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,targetFolderId:s}})}}catch(e){console.warn("Could not check folder duplicates for move:",e)}if(p&&(null==v?void 0:v.getFiles)&&(null==v?void 0:v.renameFile))try{let e=[];if(null==v?void 0:v.getFiles){const{files:t}=await v.getFiles({folderId:null!=u?u:void 0,itemType:"all",page:1,limit:1e4});e=(t||[]).map(e=>e.name).filter(e=>!!e)}if(null==v?void 0:v.getFolders){const t=(await v.getFolders({parentId:u,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 e of N){if(e.isFolder||(null===(S=(g=e.id).startsWith)||void 0===S?void 0:S.call(g,"folder_")))continue;const r=e.name||x(e.id)||"";if(!r||!t.has(r.toLowerCase())){t.add(r.toLowerCase());continue}const n=di(r,Array.from(t));await v.renameFile(e.id,n),t.add(n.toLowerCase())}}catch(e){console.warn("Could not check duplicates for move:",e)}const D=await y({items:N,targetFolderId:s,getItemNameById:x,showNotifications:!1});if(M=D.successCount,R=D.failCount,L.push(...D.errorDetails),M>0){const e=C(O),t=_(e),r=t?o("Moved",{names:t}):o("move_success_summary",{successCount:M,totalCount:P});a.success({id:"FILES_MOVE_SUCCESS",message:r,placement:"bottomRight",data:Ja(O,M,P,u,e)})}if(R>0){const e=C(O),t=_(e);let r;if(1===P&&L.length>0&&(null===(A=L[0].error)||void 0===A?void 0:A.code)){const e=Ro(null===(I=L[0].error)||void 0===I?void 0:I.code,o);r=null!=e?e:t?o("Failed",{names:t}):o("move_fail_summary",{failCount:R,totalCount:P})}else r=t?o("Failed",{names:t}):o("move_fail_summary",{failCount:R,totalCount:P});a.error({id:"FILES_MOVE_ERROR",message:r,placement:"bottomRight",innerException:L.length?L:void 0,data:Qa(O,R,P,u,L.length?L:void 0,e)})}k(),l();let z=T.current;if(M>0&&F>0&&M>=F&&T.current>1&&(z=T.current-1),M>0&&T.total>=M){const e=Math.max(0,(null!==(E=T.total)&&void 0!==E?E:0)-M);null==m||m({current:z,pageSize:T.pageSize,total:e})}j&&await b({parentIds:void 0,selectedFolder:f}),await w({fetchFiles:e,selectedFolder:d,page:z,limit:T.pageSize})}catch(e){console.error("Error when moving:",e);const t=Ro(No(e).code,o);a.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=t?t:o("Error moving"),placement:"bottomRight",data:Qa(O,P,P,d||null,[{error:No(e)}],C(O))})}},[p,s,h,e,d,f,u,a,m,o,y,l,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==v?void 0:v.getFiles,null==v?void 0:v.renameFile,x]);return{actions:{showMoveModal:S,handleMoveCancel:k,handleMoveOk:A}}},rs=e=>{var t;const{state:r,actions:n,options:i}=po(),{t:o}=Yn(),a=Oo(),s=Ya(e=>e.selectedFiles),l=Ya(e=>e.clearSelection),{files:u,selectedFolder:d,copyForm:h,pagination:f,currentMenuFile:p}=r,{setIsCopyModalVisible:g}=n,{dataProviders:m}=i,{copyItems:v}=(()=>{const{options:e}=po(),{dataProviders:t}=e,{t:r}=Yn(),n=Oo(),i=c(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=No(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=No(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=No(t);c.push({error:r})}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=No(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:y,refreshFiles:b}=es(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=Za(u),_=c(()=>{null==g||g(!0)},[g]),S=c(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),k=c(async t=>{var r,n,c,g,_;if(!((null==p?void 0:p.length)||s&&0!==s.size))return;const k=Array.from((null==p?void 0:p.length)?[p]:s),A=k.length;let I=0,E=0;const F=[],T=k.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),O=T.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let s=t;if(!t){const e=await h.validateFields();s=null==e?void 0:e.targetFolder}if(!s)return void a.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:o("Select destination folder"),placement:"bottomRight"});const u="folders"===s?null:s,p=null!=u?u:d;let P=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const M=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(M&&(null==m?void 0:m.getFolders))try{const e=await m.getFolders({parentId:u,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 e of T){if(!e.isFolder&&!(null===(c=(n=e.id).startsWith)||void 0===c?void 0:c.call(n,"folder_")))continue;const r=e.name||w(e.id)||"";if(r&&t.has(r.toLowerCase()))return void a.error({id:"FOLDER_ALREADY_EXISTS_COPY",message:o("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,targetFolderId:s}})}}catch(e){console.warn("Could not check folder duplicates for copy:",e)}if(M&&(null==m?void 0:m.getFiles))try{let e=[];const{files:t}=await m.getFiles({folderId:null!=u?u:void 0,itemType:"all",page:1,limit:1e4});if(e=(t||[]).map(e=>e.name).filter(e=>!!e),null==m?void 0:m.getFolders){const t=(await m.getFolders({parentId:u,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const r=[...e];P=T.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=T.find(t=>t.id===e.id),o=(null==i?void 0:i.name)||w(e.id)||"",a=di(o,r);return r.push(a),{id:e.id,isFolder:!1,newName:a!==o?a:void 0}})}catch(e){console.warn("Could not check duplicates for copy:",e)}else P=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const R=await v({items:P,targetFolderId:s,getItemNameById:w,showNotifications:!1});if(I=R.successCount,E=R.failCount,F.push(...R.errorDetails),I>0){const e=x(k),t=C(e),r=t?o("Copied",{names:t}):o("copy_success_summary",{successCount:I,totalCount:A});a.success({id:"FILES_COPY_SUCCESS",message:r,placement:"bottomRight",data:Ja(k,I,A,u,e)})}if(E>0){const e=x(k),t=C(e);let r;if(1===A&&F.length>0&&(null===(g=F[0].error)||void 0===g?void 0:g.code)){const e=Ro(null===(_=F[0].error)||void 0===_?void 0:_.code,o);r=null!=e?e:t?o("Failed",{names:t}):o("copy_fail_summary",{failCount:E,totalCount:A})}else r=t?o("Failed",{names:t}):o("copy_fail_summary",{failCount:E,totalCount:A});a.error({id:"FILES_COPY_ERROR",message:r,placement:"bottomRight",innerException:F.length?F:void 0,data:Qa(k,E,A,u,F.length?F:void 0,e)})}S(),l(),O&&await y({parentIds:void 0,selectedFolder:p}),await b({fetchFiles:e,selectedFolder:d,page:f.current,limit:f.pageSize})}catch(e){console.error("Error when copying:",e);const t=Ro(No(e).code,o);a.error({id:"FILES_COPY_ERROR",message:null!=t?t:o("Error copying"),innerException:e,placement:"bottomRight",data:Qa(k,A,A,d||null,[{error:No(e)}],x(k))})}},[p,s,h,e,d,f,u,a,o,v,l,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==m?void 0:m.getFiles,w]);return{actions:{showCopyModal:_,handleCopyCancel:S,handleCopyOk:k}}},ns=e=>{const t=Ka(e),r=ts(e),n=rs(e),i=(e=>{const{state:t,actions:r,options:n}=po(),{t:i}=Yn(),o=Oo(),a=Ya(e=>e.selectedFiles),s=Ya(e=>e.clearSelection),{files:l,selectedFolder:u,pagination:d,currentMenuFile:h}=t,{setIsDeleteConfirmVisible:f,setUndoDeletion:p,setPagination:g}=r,{config:m}=n,{deleteItems:v}=Go(),{refreshFolders:y,refreshFiles:b}=es(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=Za(l),_=c(()=>{null==f||f(!0)},[f]),S=c(()=>{null==f||f(!1)},[f]),k=c(async()=>{var t,r,n;if(!((null==h?void 0:h.length)||a&&0!==a.size))return void(null==f||f(!1));const c=l.length,_=Object.assign({},d),S=Array.from(h?[h]:a),k=S.map(e=>l.find(t=>t.id===e)).filter(e=>Boolean(e)),A=new Set;k.forEach(e=>{(null==e?void 0:e.isFolder)&&A.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 I=0,E=0;const F=[];try{const a=await v({items:k,selectedFolder:u,getItemNameById:w,showNotifications:!1});I=a.successCount,E=a.failCount,F.push(...a.errorDetails);const l=(null==m?void 0:m.enableTrashFolder)&&"Trash"===u;if(I>0&&(null==m?void 0:m.enableTrashFolder)&&!l&&(null==p||p({itemIds:S,sourceFolderId:u||"folders"})),I>0){const e=S.length;(null==m?void 0:m.enableTrashFolder)&&!l?await o.success({id:"FILES_DELETE_SUCCESS",message:i("moved_to_trash",{count:I}),placement:"bottomRight",data:{successCount:I,totalCount:e,itemIds:S,folderId:u||null}}):await o.success({id:"FILES_DELETE_SUCCESS",message:i("Files deleted"),placement:"bottomRight",data:{successCount:I,totalCount:e,itemIds:S,folderId:u||null}})}if(E>0){const e=x(S),n=C(e),a=S.length,s=1===a&&F.length>0&&(null===(t=F[0].error)||void 0===t?void 0:t.code),c=(null==m?void 0:m.enableTrashFolder)&&!l,u=i(c?"При перемещении в корзину произошли ошибки":"При удалении произошли ошибки"),d=s?Ro(null===(r=F[0].error)||void 0===r?void 0:r.code,i):void 0,h=null!=d?d:n?i("Failed",{names:n}):u;o.error({id:"FILES_DELETE_ERROR",message:h,placement:"bottomRight",innerException:F.length?F:void 0,data:{failCount:E,isTrashMove:c,totalCount:a,itemNames:e,errors:F.length?F:void 0}})}s(),null==f||f(!1),await y({parentIds:Array.from(A),selectedFolder:u});let d=_.current;if(I>0&&c>0&&I>=c&&_.current>1&&(d=_.current-1),I>0&&_.total>=I){const e=Math.max(0,(null!==(n=_.total)&&void 0!==n?n:0)-I);null==g||g({current:d,pageSize:_.pageSize,total:e})}await b({fetchFiles:e,selectedFolder:u,page:d,limit:_.pageSize})}catch(e){console.error("Error when deleting:",e),o.error({id:"FILES_DELETE_ERROR",message:i("Error deleting"),placement:"bottomRight",innerException:e,data:{failCount:E,totalCount:k.length}})}},[h,a,f,e,u,d,p,g,l,i,o,v,s,null==m?void 0:m.enableTrashFolder]);return{actions:{showDeleteConfirm:_,handleDeleteConfirmCancel:S,handleDeleteConfirmOk:k}}})(e);return{state:t.state,actions:Object.assign(Object.assign(Object.assign(Object.assign({},t.actions),r.actions),n.actions),i.actions)}},is=()=>{const{state:e}=po(),{files:t,loading:r,isUrlModalVisible:n}=e,i=Ha(),o=(()=>{const{state:e}=po(),t=e.multiSelect,r=Ya(e=>e.selectedFiles),n=Ya(e=>e.toggleFileSelection),i=Ya(e=>e.setMultiSelect);return a(()=>{i(!1!==t)},[t,i]),{state:{selectedFiles:r},actions:{toggleFileSelection:n}}})(),s=ns(i.fetchFiles);return{state:{files:t||[],selectedFiles:o.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:o.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}}},os="filemanager_sidebar_width";function as({maxConcurrent:e=6}={}){const t=u(new Map),r=u([]),n=u(0),i=d(()=>{const i=e=>({status:e.status,shouldLoad:"loading"===e.status||"loaded"===e.status||"error"===e.status}),o=e=>{const t=i(e);e.listeners.forEach(e=>e(t))},a=e=>{0!==r.current.length&&(r.current=r.current.filter(t=>t!==e))},s=(e,r)=>{const n=t.current.get(e);if(!n){const n={id:e,src:r,status:"idle",listeners:new Set,active:!1};return t.current.set(e,n),n}return n.src!==r&&(a(e),n.src=r,n.status="idle"),n},l=()=>{for(;n.current<e&&r.current.length>0;){const e=r.current.shift();if(!e)break;const i=t.current.get(e);i&&i.active&&"queued"===i.status&&(i.status="loading",n.current+=1,o(i))}},c=(e,t)=>{"loading"===e.status&&(e.status=t,n.current=Math.max(0,n.current-1),o(e),l())};return{getSnapshot:(e,t)=>i(s(e,t)),subscribe:(e,r,n)=>{const o=s(e,r);return o.listeners.add(n),n(i(o)),()=>{const r=t.current.get(e);r&&(r.listeners.delete(n),r.active||0!==r.listeners.size||"loading"===r.status||t.current.delete(e))}},setActive:(e,t,i)=>{const c=s(e,t);c.active=i,i?"loaded"!==c.status&&"loading"!==c.status&&"queued"!==c.status?(c.status="queued",o(c),r.current.includes(e)||r.current.push(e),l()):o(c):"queued"===c.status?(a(e),c.status="idle",o(c)):"loading"===c.status&&(n.current=Math.max(0,n.current-1),c.status="idle",o(c),l())},markLoaded:e=>{const r=t.current.get(e);r&&c(r,"loaded")},markError:e=>{const r=t.current.get(e);r&&c(r,"error")},release:e=>{const r=t.current.get(e);r&&(r.active=!1,"queued"===r.status?(a(e),r.status="idle"):"loading"===r.status&&(n.current=Math.max(0,n.current-1),r.status="idle",l()),0===r.listeners.size&&t.current.delete(e))}}},[e]);return a(()=>()=>{r.current=[],t.current.clear(),n.current=0},[]),i}const ss=/(auto|scroll|overlay)/;function ls(e,t){const r=Math.max(0,null!=t?t:e.clientWidth);return Math.max(1,Math.round(r-function(e){if("undefined"==typeof window)return 0;const t=window.getComputedStyle(e);return(Number.parseFloat(t.paddingLeft||"0")||0)+(Number.parseFloat(t.paddingRight||"0")||0)}(e)))}function cs(e){if("undefined"==typeof window)return!1;const t=window.getComputedStyle(e);return ss.test(t.overflowY)||ss.test(t.overflow)||ss.test(t.overflowX)}function us(e){if("undefined"==typeof window)return e;let t=e;for(;t;){if(cs(t))return t;t=t.parentElement}return null}function ds(e){if("undefined"==typeof window)return[e];const t=us(e);return t?t===e?[window,e]:[window,t]:[window]}function hs(e,t,r){Math.max(0,e.clientHeight),Math.max(0,Math.round(e.getBoundingClientRect().height));return Math.max(1,t)}function fs(e,t){if(e===t){const r=function(e){var t;if("undefined"==typeof window)return Math.max(1,e.clientHeight);const r=e.getBoundingClientRect(),n=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,i=Math.max(0,r.top),o=Math.min(n,r.bottom);return Math.max(0,Math.round(o-i))}(t);return{scrollTop:t.scrollTop,viewportHeight:hs(e,Math.min(t.clientHeight,r||t.clientHeight)),viewportWidth:ls(t),scrollHeight:e.scrollHeight}}const r=t.getBoundingClientRect(),n=e.getBoundingClientRect(),i=Math.max(r.top,n.top),o=Math.min(r.bottom,n.bottom),a=Math.max(r.left,n.left),s=Math.min(r.right,n.right),l=Math.max(0,Math.round(o-i)),c=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(i-n.top)),viewportHeight:hs(e,l),viewportWidth:ls(e,c||t.clientWidth||e.clientWidth),scrollHeight:e.scrollHeight}}function ps(e){if("undefined"==typeof window)return{scrollTop:e.scrollTop,viewportHeight:Math.max(1,e.clientHeight),viewportWidth:ls(e),scrollHeight:e.scrollHeight};const t=us(e);return t&&function(e){return e.scrollHeight-e.clientHeight>1}(t)?fs(e,t):function(e){var t,r;const n=e.getBoundingClientRect(),i=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,o=window.innerWidth||(null===(r=document.documentElement)||void 0===r?void 0:r.clientWidth)||n.width,a=Math.max(0,n.top),s=Math.min(i,n.bottom),l=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(-n.top)),viewportHeight:hs(e,l),viewportWidth:ls(e,Math.min(Math.round(n.width),o)),scrollHeight:e.scrollHeight}}(e)}function gs(e,t){const r=u(null),n=c(t=>{e(ps(t))},[e]);return a(()=>{r.current&&n(r.current)},[n,...t]),a(()=>{if(!r.current||"undefined"==typeof ResizeObserver)return;const e=r.current,t=new ResizeObserver(()=>{n(e)});return t.observe(e),()=>t.disconnect()},[n]),a(()=>{const e=r.current;if(!e)return;const t=()=>{n(e)},i=ds(e);return i.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{i.forEach(e=>{e.removeEventListener("scroll",t)})}},[n,...t]),r}const ms=({onSearch:t,placeholder:r,className:n})=>{const{t:i}=Yn(),[s,l]=o(""),c=u(null),{options:d}=po(),{config:h}=d,f=r||i("Search files...");a(()=>(c.current=ko.debounce(e=>{t(e)},500),()=>{var e;null===(e=c.current)||void 0===e||e.cancel()}),[t]);return e(F,{value:s,onChange:e=>{var t;const r=e.target.value;l(r),null===(t=c.current)||void 0===t||t.call(c,r)},placeholder:f,prefix:e(Ti,{size:16,strokeWidth:null==h?void 0:h.iconStrokeWidth}),className:n,allowClear:!0,onClear:()=>{l(""),t("")}})},vs=[{value:"date-desc",labelKey:"Newest first"},{value:"date-asc",labelKey:"Oldest first"},{value:"size-desc",labelKey:"Largest first"},{value:"size-asc",labelKey:"Smallest first"},{value:"name-asc",labelKey:"A-Z"},{value:"name-desc",labelKey:"Z-A"},{value:"type-asc",labelKey:"By type"}];var ys={contentLayout:"contentLayout",headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",emptyStateWrapper:"emptyStateWrapper",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",tableLoadingWrapper:"tableLoadingWrapper",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:bs}=T,{Option:ws}=O;const xs=i.memo(({files:r,filesById:n,currentSortOption:i,isSmallScreen:o,iconStrokeWidth:a,multiSelectEnabled:s=!0,features:l,viewMode:c,setViewMode:u,handleSearch:h,handleSortOptionChange:f,sortOptions:p,onClearSelection:g,onRename:m,onDelete:v,onCopy:y,onMove:b,onEdit:w,t:x})=>{const C=d(()=>(null==p?void 0:p.length)?vs.filter(e=>p.includes(e.value)):vs,[p]),_=d(()=>C.map(e=>e.value).join("|")||"all",[C]),S=Ya(e=>e.selectedFiles),k=Ya(e=>e.selectedFiles.size),A=Ya(e=>e.selectAllVisible),I=r.length>0&&k===r.length,E=d(()=>Array.from(S)[0],[S]),F=d(()=>E?n.get(E):void 0,[n,E]),T=(null==F?void 0:F.isFolder)?!1!==(null==l?void 0:l.enableRenameFolder):!1!==(null==l?void 0:l.enableRenameFile),N=d(()=>Array.from(S).every(e=>{const t=n.get(e);return!!t&&(t.isFolder?!1!==(null==l?void 0:l.enableMoveFolder):!1!==(null==l?void 0:l.enableMoveItem))}),[l,n,S]),j=d(()=>Array.from(S).every(e=>{const t=n.get(e);return!!t&&(t.isFolder?!1!==(null==l?void 0:l.enableCopyFolder):!1!==(null==l?void 0:l.enableCopyItem))}),[l,n,S]),D=d(()=>1===k&&function(e){var t,r,n;if(!e||e.isFolder)return!1;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&gr.includes(i.toLowerCase()))}(F),[k,F]);return t("div",k>0?{className:`header-container ${ys.headerContainer}`,children:[t(bs,{type:"secondary",className:"selected-text",children:[t("div",{children:[k," ",x("selected")]}),s&&e(P,{title:o?x("Select all"):null,children:e(M,{className:ys.buttonSelectAll,onClick:A,disabled:I||0===r.length,children:x("Select all")})}),e(P,{title:o?x("Deselected"):null,children:e(M,{className:ys.buttonDeselected,icon:e(Fi,{size:16,strokeWidth:a}),onClick:g,children:x("Deselected")})})]}),t(R,{children:[D&&!1!==(null==l?void 0:l.enableEdit)&&e(P,{title:o?x("Edit"):null,children:e(M,{icon:e(mi,{size:16,strokeWidth:a}),onClick:()=>w(F),disabled:!D,children:x("Edit")})}),N&&e(P,{title:o?x("Move to"):null,children:e(M,{icon:e(yi,{size:16,strokeWidth:a}),onClick:b,children:x("Move to")})}),j&&e(P,{title:o?x("Copy"):null,children:e(M,{icon:e(gi,{size:16,strokeWidth:a}),onClick:y,children:x("Copy")})}),1===k&&T&&e(P,{title:o?x("Rename"):null,children:e(M,{icon:e(Pi,{size:16,strokeWidth:a}),onClick:()=>m(),disabled:1!==k||!T,children:x("Rename")})}),!1!==(null==l?void 0:l.enableDelete)&&e(P,{title:o?x("Delete"):null,children:e(M,{danger:!0,icon:e(Ri,{size:16,strokeWidth:a}),onClick:e=>{e.stopPropagation(),e.preventDefault(),v()},children:x("Delete")})})]})]}:{className:ys.headerContainer,children:[e("div",{className:"search-container",children:e(ms,{placeholder:x("Search file or folder"),onSearch:h,className:ys.searchInput})}),t("div",{className:ys.actionsBox,children:[e("div",{className:"sort-container",children:e(O,{value:i,onChange:f,className:ys.sortSelect,popupMatchSelectWidth:!1,suffixIcon:e(fi,{size:16,strokeWidth:a}),children:C.map(({value:t,labelKey:r})=>e(ws,{value:t,children:x(r)},t))},_)}),e("div",{className:ys.actionsContainer,children:e(L,{options:[{value:"grid",icon:e(Ci,{size:16,strokeWidth:a})},{value:"table",icon:e(ki,{size:20,strokeWidth:a})}],value:c,onChange:e=>u(e)})})]})]})});xs.displayName="FileContentHeader";const Cs=i.memo(({fileId:t,style:r})=>{const n=Ya(e=>e.selectedFiles.has(t)),i=Ya(e=>e.toggleFileSelection);return e(N,{checked:n,style:r,onClick:e=>{e.stopPropagation()},onChange:e=>{const r=e.nativeEvent;i(t,{metaKey:r.metaKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,forceToggle:!0})}})});function _s(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}Cs.displayName="FileSelectionCheckbox","function"==typeof SuppressedError&&SuppressedError;const Ss=i.memo(t=>{var{className:r}=t,n=_s(t,["className"]);const i=n["data-row-key"],o=null==i?"":String(i),a=[r,Ya(e=>!!o&&e.selectedFiles.has(o))?ys.selectedRow:""].filter(Boolean).join(" ");return e("tr",Object.assign({},n,{className:a}))});Ss.displayName="SelectableTableRow";const ks=i.memo(({item:t,variant:r="table",t:n,iconStrokeWidth:i,setCurrentMenuFile:a,showMoveModal:s,showCopyModal:l,showRenameModal:u,showDeleteConfirm:h,onEdit:f})=>{const[p,g]=o(!1),m=d(()=>{if(!p)return[];const r=[];return t.canEdit&&r.push({key:"edit",label:n("Edit"),icon:e(mi,{size:16,strokeWidth:i})}),t.canMove&&r.push({key:"move",label:n("Move to"),icon:e(yi,{size:16,strokeWidth:i})}),t.canCopy&&r.push({key:"copy",label:n("Copy"),icon:e(gi,{size:16,strokeWidth:i})}),t.canRename&&r.push({key:"rename",label:n("Rename"),icon:e(Pi,{size:16,strokeWidth:i})}),t.canDelete&&r.push({key:"delete",label:n("Delete"),icon:e(Ri,{size:16,strokeWidth:i}),style:{color:"#ff4d4f"}}),r},[i,p,t.canCopy,t.canDelete,t.canEdit,t.canMove,t.canRename,n]),v=c(({key:e})=>{switch(t.id&&(null==a||a(t.id)),e){case"edit":f(t.file);break;case"move":s();break;case"copy":l();break;case"rename":u(t.id);break;case"delete":null==h||h();break;default:null==a||a("")}},[t,f,a,l,h,s,u]),y=d(()=>({items:m,onClick:v}),[v,m]);return e(j,{arrow:!0,placement:"bottom",menu:y,trigger:["hover"],onOpenChange:g,children:"grid"===r?e(M,{type:"default",className:`${ys.gridFileMenuButton} gridFileMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(vi,{size:16,strokeWidth:i})}):e("span",{className:`${ys.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(vi,{size:16,strokeWidth:i})})})});ks.displayName="FileItemActionsDropdown";const As=({thumbnailSrc:t,previewSrc:r,lightboxSrc:n,alt:i,className:s,width:l,height:u,preview:h=!1})=>{const f=i,[p,g]=o(0),m=c(e=>{const t=e.split(",")[1];return!!(t&&t.length>20)},[]),v=c(e=>{var t;if(e&&"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=="!==e)return e.startsWith("data:image/")?m(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},[m]),y=d(()=>v(t),[t,v]),b=d(()=>v(r),[r,v]),w=d(()=>v(n),[n,v]),x=d(()=>[y,b].filter((e,t,r)=>Boolean(e)&&r.indexOf(e)===t),[y,b]);a(()=>{g(0)},[x]);const C=c((e,t)=>e&&e.toLowerCase().endsWith(".svg")||t&&(t.includes(".svg")||t.includes("image/svg+xml")),[]),_=x[p],S=null!=w?w:_,k=c(()=>{if(!_)return;const e=p+1;C(f,_),g(e)},[_,p,f,C]),A=null!=_?_:pr,I=!(!h||!S)&&{src:S,toolbarRender:()=>null,destroyOnHidden:!0,mask:e(ye,{style:{fontSize:"20px"}})};return e(D,{className:s,src:A,alt:i,width:l,height:u,preview:I,onError:k,fallback:pr})},Is=i.memo(({item:t,variant:r="table",FolderIcon:n,getFileData:i,className:o,width:a,height:s})=>t.isFolder?e("div","grid"===r?{className:ys.gridFolderIcon,children:e(n,{className:ys.gridFolderIconImage})}:{className:ys.fileManagerTableFolder,children:e("div",{className:ys.fileManagerTableFolderInner,children:e(n,{className:ys.tableFolderIcon,style:{width:null!=a?a:40,height:null!=s?s:40}})})}):t.thumbnailSrc||t.previewSrc?e(As,{className:o,thumbnailSrc:t.thumbnailSrc,previewSrc:t.previewSrc,lightboxSrc:t.lightboxSrc,alt:t.file.name,width:a,height:s,preview:!0,file:t.file,getFileData:i}):null);Is.displayName="FileItemPreview";const Es=i.memo(({item:r,t:n,iconStrokeWidth:i,FolderIcon:o,handleSingleClick:a,handleDoubleClick:s,handleItemClick:l,setCurrentMenuFile:c,showMoveModal:u,showCopyModal:d,showRenameModal:h,showDeleteConfirm:f,onEdit:p,onEditorOk:g,getFileData:m,showSelectionCheckbox:v=!0})=>{const y=Ya(e=>e.selectedFiles.has(r.id)),b=Ya(e=>e.toggleFileSelection);return e(z,{className:ys.gridCard_col,style:{padding:0},children:t(B,{hoverable:!0,cover:e("div",{className:r.isFolder?ys.gridPreviewContainerFolder:ys.gridPreviewContainer,onClick:e=>{e.stopPropagation(),r.isFolder&&a(()=>{b(r.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey})})},onDoubleClick:e=>{e.stopPropagation(),s(()=>{r.isFolder&&l(r.file)})},children:e(Is,{item:r,variant:"grid",FolderIcon:o,getFileData:m,className:ys.gridImagePreview})}),className:`${ys.gridCard} ${y?ys.gridCardSelected:""}`,onClick:e=>{e.stopPropagation(),e.preventDefault();const t=e.target;t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu")||a(()=>b(r.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}))},onDoubleClick:e=>{e.stopPropagation(),s(()=>{r.isFolder&&l(r.file)})},children:[t("div",{className:ys.gridCardContent,onDoubleClick:e=>{e.stopPropagation(),e.preventDefault(),s(()=>{r.isFolder?l(r.file):g&&g(r.file)})},onClick:e=>{e.stopPropagation(),e.preventDefault();const t=e.target;t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu")||a(()=>b(r.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}))},children:[e("div",{className:ys.gridFileName,children:r.nameText||n("Untitled")}),e("div",{className:ys.gridFileInfo,children:r.gridInfoText})]}),e("div",{className:ys.gridFileMenu,children:e(ks,{item:r,variant:"grid",t:n,iconStrokeWidth:i,setCurrentMenuFile:c,showMoveModal:u,showCopyModal:d,showRenameModal:h,showDeleteConfirm:f,onEdit:p})}),v?e("div",{onClick:e=>{e.stopPropagation()},className:ys.gridCheckbox,children:e(Cs,{fileId:r.id,style:{height:20}})}):null]})})});Es.displayName="FileGridItem";const Fs=i.memo(({rows:t,topOffset:n=0,bottomOffset:i=0,t:o,iconStrokeWidth:a,FolderIcon:s,handleSingleClick:l,handleDoubleClick:c,handleItemClick:u,setCurrentMenuFile:d,showMoveModal:h,showCopyModal:f,showRenameModal:p,showDeleteConfirm:g,onEdit:m,onEditorOk:v,getFileData:y,showSelectionCheckbox:b=!0})=>e(r,{children:e("div",{style:{paddingTop:n,paddingBottom:i},children:e(U,{gutter:[16,16],className:ys.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:t.map(t=>e(Es,{item:t,handleSingleClick:l,handleDoubleClick:c,handleItemClick:u,iconStrokeWidth:a,t:o,FolderIcon:s,setCurrentMenuFile:d,showMoveModal:h,showCopyModal:f,showRenameModal:p,showDeleteConfirm:g,onEdit:m,onEditorOk:v,getFileData:y,showSelectionCheckbox:b},t.id))})})}));Fs.displayName="FileGridView";const Ts=i.memo(({rows:t,columns:n,loading:i,topOffset:o=0,bottomOffset:a=0,onRow:s,components:l})=>{const c=d(()=>e("div",{style:{paddingTop:o,paddingBottom:a},children:e(A,{renderEmpty:()=>e(H,{image:e(r,{}),description:""}),children:e(V,{dataSource:t,columns:n,rowKey:"id",pagination:!1,tableLayout:"fixed",onRow:s,components:l,showHeader:!1})})}),[a,n,l,s,t,o]);return e(S,{spinning:i,className:ys.tableLoadingWrapper,children:c})});Ts.displayName="FileTableView";const Os=i.memo(({item:t})=>t.dateText?e(P,{title:t.dateText,placement:"bottom",className:ys.fileDate,children:t.dateText}):null);Os.displayName="FileItemDate";const Ps=i.memo(({item:r})=>t("div",{className:ys.fileName,children:[r.nameText,r.isFolder&&e("div",{className:ys.fileItemCount,children:r.folderItemsText})]}));Ps.displayName="FileItemName";const Ms="filemanager_view_mode";class Rs{constructor(){this.rowsById=new Map}reconcile(e,t,r){const n=new Map,i=[];for(const o of e){const e=t.getId(o),a=t.buildSignature(o,r),s=this.rowsById.get(e);if(s&&s.signature===a){n.set(e,s),i.push(s);continue}const l=t.buildRowModel(o,r,{id:e,signature:a});n.set(e,l),i.push(l)}return this.rowsById=n,i}}class Ls{createRenderWindow(e,t){var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y,b,w,x,C,_,S,k,A;const I=null!==(r=null==t?void 0:t.renderStrategy)&&void 0!==r?r:"full";if("windowed"!==I){if("positioned"===I){const r=null!==(i=null===(n=null==t?void 0:t.positioned)||void 0===n?void 0:n.layout)&&void 0!==i?i:[],v=null!==(a=null===(o=null==t?void 0:t.positioned)||void 0===o?void 0:o.viewportTop)&&void 0!==a?a:0,y=null!==(l=null===(s=null==t?void 0:t.positioned)||void 0===s?void 0:s.viewportBottom)&&void 0!==l?l:Number.MAX_SAFE_INTEGER,b=Math.max(0,null!==(u=null===(c=null==t?void 0:t.positioned)||void 0===c?void 0:c.overscanPx)&&void 0!==u?u:0),w=Math.max(0,null!==(h=null===(d=null==t?void 0:t.positioned)||void 0===d?void 0:d.containerHeight)&&void 0!==h?h:0),x=r.filter(e=>e.bottom>=v-b&&e.top<=y+b).map(t=>({row:e[t.index],layout:t})).filter(e=>Boolean(e.row)),C=null!==(p=null===(f=x[0])||void 0===f?void 0:f.layout.index)&&void 0!==p?p:-1,_=null!==(m=null===(g=x[x.length-1])||void 0===g?void 0:g.layout.index)&&void 0!==m?m:-1;return{rows:x.map(e=>e.row),startIndex:C,endIndex:_,topOffset:0,bottomOffset:0,totalCount:e.length,containerHeight:w,positionedItems:x}}return{rows:e,startIndex:0,endIndex:e.length>0?e.length-1:-1,topOffset:0,bottomOffset:0,totalCount:e.length}}const E=Math.max(0,null!==(y=null===(v=null==t?void 0:t.windowed)||void 0===v?void 0:v.startIndex)&&void 0!==y?y:0),F=null!==(w=null===(b=null==t?void 0:t.windowed)||void 0===b?void 0:b.endIndex)&&void 0!==w?w:e.length-1,T=Math.max(0,null!==(C=null===(x=null==t?void 0:t.windowed)||void 0===x?void 0:x.overscan)&&void 0!==C?C:0),O=Math.max(1,null!==(S=null===(_=null==t?void 0:t.windowed)||void 0===_?void 0:_.estimatedItemSize)&&void 0!==S?S:1),P=Math.max(1,null!==(A=null===(k=null==t?void 0:t.windowed)||void 0===k?void 0:k.itemsPerLane)&&void 0!==A?A:1),M=Math.ceil(e.length/P),R=Math.min(e.length-1,F),L=Math.floor(E/P),N=Math.floor(Math.max(E,R)/P),j=Math.max(0,L-T),D=Math.min(M-1,N+T),z=j*P,B=Math.min(e.length-1,(D+1)*P-1),U=Math.max(0,M-D-1);return{rows:e.slice(z,B+1),startIndex:z,endIndex:B,topOffset:j*O,bottomOffset:U*O,totalCount:e.length}}}function Ns({items:e,context:t,adapter:r,options:n}){const i=u(null),o=u(null);i.current||(i.current=new Rs),o.current||(o.current=new Ls);const a=d(()=>i.current.reconcile(e,r,t),[r,t,e]),s=d(()=>o.current.createRenderWindow(a,n),[n,a]);return{rowModels:a,renderWindow:s}}function js({totalCount:e,plan:t}){const[r,n]=o(null),i=d(()=>{var n,i;if(!t.enabled)return{renderStrategy:"full"};const o=function(e,t){var r;return Math.max(1,null!==(r=null==e?void 0:e.viewportHeight)&&void 0!==r?r:t)}(r,null!==(n=t.fallbackViewportHeight)&&void 0!==n?n:800),a=Math.max(1,Math.ceil(o/t.estimatedItemSize)),s=Math.max(1,Math.ceil(e/t.itemsPerLane)),l=Math.min(s-1,Math.max(0,Math.floor((null!==(i=null==r?void 0:r.scrollTop)&&void 0!==i?i:0)/t.estimatedItemSize))),c=l+a-1;return{renderStrategy:"windowed",windowed:{startIndex:l*t.itemsPerLane,endIndex:Math.min(e-1,(c+1)*t.itemsPerLane-1),overscan:t.overscan,estimatedItemSize:t.estimatedItemSize,itemsPerLane:t.itemsPerLane}}},[t.enabled,t.estimatedItemSize,t.fallbackViewportHeight,t.itemsPerLane,t.overscan,e,r]);return{engineOptions:i,handleViewportChange:c(e=>{n(t=>(null==t?void 0:t.viewportHeight)===e.viewportHeight&&(null==t?void 0:t.viewportWidth)===e.viewportWidth&&(null==t?void 0:t.scrollHeight)===e.scrollHeight&&(null==t?void 0:t.scrollTop)===e.scrollTop?t:e)},[])}}function Ds(e,t){if("number"==typeof e.childCount)return e.childCount;const r=t[e.id];return null===r?null:null!=r?r:0}function zs(e){var t,r,n;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&gr.includes(i.toLowerCase()))}function Bs(e,t){if(!e)return"";const r=new Date(e);if(Number.isNaN(r.getTime()))return"";const n=[t("months.january"),t("months.february"),t("months.march"),t("months.april"),t("months.may"),t("months.june"),t("months.july"),t("months.august"),t("months.september"),t("months.october"),t("months.november"),t("months.december")];return t("Added",{date:`${r.getDate()} ${n[r.getMonth()]} ${r.getFullYear()}`})}const Us={getId:e=>e.id,buildSignature:(e,t)=>function(e,t){var r,n,i,o,a,s,l,c;const u=Boolean(e.isFolder),d=u?Ds(e,t.folderFileCounts):null,h=u?null===d?"u":String(d):"0",f=Bs(e.date,t.t),p=!u&&e.size?String(e.size):"",g=e.thumbnailUrl||e.thumbnail,m=e.url&&zs(e)?e.url:"",v=t.previewFallbackToFileUrl?m:"",y=[!1!==(null===(r=t.features)||void 0===r?void 0:r.enableEdit),!1!==(null===(n=t.features)||void 0===n?void 0:n.enableMoveFolder),!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveItem),!1!==(null===(o=t.features)||void 0===o?void 0:o.enableCopyFolder),!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyItem),!1!==(null===(s=t.features)||void 0===s?void 0:s.enableRenameFolder),!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFile),!1!==(null===(c=t.features)||void 0===c?void 0:c.enableDelete)].join("|"),b=[g||"",v,m].join("::");return[e.id,e.name,e.folderId,e.type||"",e.extension||"",b,b,e.dimensions||"",p,f,u?"1":"0",h,y].join("::")}(e,t),buildRowModel:(e,t,r)=>{var n,i,o,a,s,l,c,u;const d=Boolean(e.isFolder),h=d?Ds(e,t.folderFileCounts):null,f=d&&null===h?"—":d?`${h} ${1===h?t.t("item"):t.t("items")}`:"",p=e.dimensions||"",g=!d&&e.size?ui(e.size):"",m=d?t.t("Folder"):function(e){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():"")||""}(e),v=Bs(e.date,t.t),y=d?f:[p,g,m].filter(Boolean).join(" • "),b=e.thumbnailUrl||e.thumbnail,w=e.url&&zs(e)?e.url:void 0,x=t.previewFallbackToFileUrl?w:void 0;return{id:r.id,signature:r.signature,item:e,file:e,isFolder:d,nameText:e.name||t.t("No name"),folderItemsText:f,dimensionsText:p,sizeText:g,typeText:m,dateText:v,gridInfoText:y,thumbnailSrc:b,previewSrc:x,lightboxSrc:w,canEdit:!d&&!1!==(null===(n=t.features)||void 0===n?void 0:n.enableEdit)&&zs(e),canMove:d?!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveFolder):!1!==(null===(o=t.features)||void 0===o?void 0:o.enableMoveItem),canCopy:d?!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyFolder):!1!==(null===(s=t.features)||void 0===s?void 0:s.enableCopyItem),canRename:d?!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFolder):!1!==(null===(c=t.features)||void 0===c?void 0:c.enableRenameFile),canDelete:!1!==(null===(u=t.features)||void 0===u?void 0:u.enableDelete)}}};const Vs=i.memo(({files:r,searchTerm:n,handleSearch:i,sortBy:s,sortOrder:l,handleSortOptionChange:h,pagination:f,setPagination:p,loading:g,handleItemClick:m,onClearSelection:v,onRename:y,onDelete:b,onCopy:w,onMove:x,showRenameModal:C,showDeleteConfirm:_,showCopyModal:S,showMoveModal:k,onEdit:A,getFileData:I,handleAddFile:E})=>{var F;const{t:T}=Yn(),O=Oo(),{DropZoneFileIcon:P,BigStockIcon:M,BigAIIcon:R,FolderIcon:L}=mo(),{options:N,actions:j,state:D}=po(),{dataProviders:z,config:B}=N,U=null==B?void 0:B.disablePagination,{setCurrentMenuFile:V,setActiveLibraryItem:H}=j,W="Trash"===(null==D?void 0:D.selectedFolder),G=!1!==(null==D?void 0:D.multiSelect),q=Ya(e=>e.toggleFileSelection),{viewMode:Y,setViewMode:X}=(()=>{const[e,t]=o(()=>{try{return localStorage.getItem(Ms)||"table"}catch(e){return"table"}}),r=c(e=>{t(e);try{localStorage.setItem(Ms,e)}catch(e){console.warn("Не удалось сохранить режим отображения:",e)}},[]),n=c(()=>{r("table"===e?"grid":"table")},[e,r]);return{viewMode:e,setViewMode:r,toggleViewMode:n}})(),[K,Z]=o({}),[J,Q]=o(!1),ee=u(null),te=u(0),re=u(null);a(()=>{const e=window.matchMedia("(max-width: 1199px)"),t=e=>{Q(e.matches)};t(e);const r=e=>t(e);return"function"==typeof e.addEventListener?(e.addEventListener("change",r),()=>e.removeEventListener("change",r)):(e.addListener(r),()=>e.removeListener(r))},[]);const ne=d(()=>(null==B?void 0:B.features)||{},[null==B?void 0:B.features]),ie=null==B?void 0:B.iconStrokeWidth,oe=null==B?void 0:B.sortOptions,ae=d(()=>(null==oe?void 0:oe.length)?new Set(oe):null,[oe]),se=`${s}-${l}`;a(()=>{var e;if(ae&&!ae.has(se)){const t=null===(e=vs.find(e=>ae.has(e.value)))||void 0===e?void 0:e.value;t&&h(t)}},[ae,se,h]);const le=d(()=>new Map(r.map(e=>[e.id,e])),[r]),{renderRows:ce,renderWindow:ue,hasAnyValidDate:de,handleViewportChange:he}=function({files:e,folderFileCounts:t,features:r,t:n,viewMode:i,previewFallbackToFileUrl:a}){const s=d(()=>({folderFileCounts:t,features:r,t:n,previewFallbackToFileUrl:a}),[r,t,n,a]),[l,u]=o(()=>Math.max(1,Math.floor(5))),h=d(()=>{const t=e.length>150;return"table"===i?{enabled:t,estimatedItemSize:56,overscan:10,itemsPerLane:1,fallbackViewportHeight:800}:{enabled:t,estimatedItemSize:320,overscan:2,itemsPerLane:l,fallbackViewportHeight:800}},[e.length,l,i]),{engineOptions:f,handleViewportChange:p}=js({totalCount:e.length,plan:h}),{rowModels:g,renderWindow:m}=Ns({items:e,context:s,adapter:Us,options:f}),v=d(()=>g.some(e=>Boolean(e.dateText)),[g]),y=c(e=>{if("grid"===i){const t=Math.max(1,Math.floor(e.viewportWidth/240));u(e=>e===t?e:t)}p(e)},[p,i]);return{rowModels:g,renderRows:m.rows,renderWindow:m,hasAnyValidDate:v,handleViewportChange:y}}({files:r,folderFileCounts:K,features:ne,t:T,viewMode:Y,previewFallbackToFileUrl:null==B?void 0:B.previewFallbackToFileUrl}),fe=c(async e=>{var t,r,n,i;try{if(null==z?void 0:z.getChildrenCount)return await z.getChildrenCount("folders"===e?void 0:e);if(null==z?void 0:z.getFiles){const{files:r,pagination:n}=await z.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:U?void 0:1,limit:U?void 0:1});return U?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;if(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))return 0;console.error(`Error getting the number of files for the folder ${e}:`,t);const a=await Na({folderId:e,dataProviders:z,folders:Array.isArray(D.folders)?D.folders:[],pathHistory:D.pathHistory,t:T});return O.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:T("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[z,U,O,D.folders,D.pathHistory,T]),pe=c(async()=>{const e=te.current+1;te.current=e;const t=r.filter(e=>e.isFolder);if(0===t.length)return void Z(e=>0===Object.keys(e).length?e:{});const n={},i=t.map(async e=>{"number"!=typeof e.childCount?n[e.id]=await fe(e.id):n[e.id]=e.childCount});await Promise.all(i),te.current===e&&Z(e=>{const t=Object.keys(e),r=Object.keys(n);return t.length===r.length&&t.every(t=>e[t]===n[t])?e:n})},[r,fe]);a(()=>{pe()},[pe]),a(()=>{re.current&&he(ps(re.current))},[r.length,he,Y]),a(()=>{if(!re.current||"undefined"==typeof ResizeObserver)return;const e=re.current,t=new ResizeObserver(()=>{he(ps(e))});return t.observe(e),()=>{t.disconnect()}},[he]);const ge=c((e=()=>{})=>{if(ee.current)return;const t=setTimeout(()=>{e(),ee.current=null},300);ee.current=t},[]),me=c(e=>{ee.current&&(clearTimeout(ee.current),ee.current=null),e()},[]),ve=c(e=>{const t=ps(e);he(t)},[he]);a(()=>{const e=re.current;if(!e)return;const t=()=>{ve(e)},r=ds(e);return r.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{r.forEach(e=>{e.removeEventListener("scroll",t)})}},[r.length,ve,Y]);const ye=c((e,t)=>e!==t,[]),be=d(()=>[...G?[{key:"selection",width:46,shouldCellUpdate:ye,render:(t,r)=>e(Cs,{fileId:r.id})}]:[],{key:"preview",width:60,shouldCellUpdate:ye,render:(t,r)=>e(Is,{item:r,variant:"table",FolderIcon:L,getFileData:I,className:`${ys.imagePreview} ${ys.tableImagePreview}`,width:40,height:40})},{title:T("Name"),width:"calc(100% - 430px)",dataIndex:"nameText",key:"name",className:ys.fileNameCol,shouldCellUpdate:ye,render:(t,r)=>e(Ps,{item:r})},{title:T("Dimensions"),key:"dimensions",width:100,shouldCellUpdate:ye,render:(t,r)=>r.dimensionsText&&e("div",{className:ys.fileSize,children:r.dimensionsText})},{title:T("Size"),key:"size",width:90,shouldCellUpdate:ye,render:(t,r)=>r.sizeText?e("div",{className:ys.fileSize,children:r.sizeText}):null},{title:T("Type"),key:"type",width:90,shouldCellUpdate:ye,render:(t,r)=>e("div",{className:ys.fileSize,children:r.typeText})},...de?[{title:T("Date"),dataIndex:"dateText",key:"date",width:200,shouldCellUpdate:ye,render:(t,r)=>e(Os,{item:r})}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),shouldCellUpdate:ye,render:(t,r)=>e(ks,{item:r,variant:"table",t:T,iconStrokeWidth:ie,setCurrentMenuFile:V,showMoveModal:k,showCopyModal:S,showRenameModal:C,showDeleteConfirm:_,onEdit:A})}],[L,I,de,ie,G,A,V,ye,S,_,k,C,T]);a(()=>()=>{ee.current&&clearTimeout(ee.current)},[]);const we=d(()=>({body:{row:Ss}}),[]),xe=c(e=>({onClick:t=>{const r=t.target;ge(()=>{t.stopPropagation(),t.preventDefault();const n=Boolean(r.closest(".ant-image"))||Boolean(r.closest(".ant-image-preview-wrap")),i=Boolean(r.closest(".tableMenuButton")),o=Boolean(r.closest(".ant-dropdown-menu"));n||i||o||q(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{me(()=>{t.stopPropagation(),t.preventDefault();const r=t.target;r.closest(".ant-checkbox-wrapper")||r.closest(".tableMenu")||(e.isFolder?m(e.file):r.closest(".ant-image")||r.closest(".ant-image-preview-wrap")||!N.onEditorOk||N.onEditorOk(e.file))})}}),[me,m,ge,N,q]);let Ce="table"===Y?e(Ts,{rows:ce,columns:be,loading:g,topOffset:ue.topOffset,bottomOffset:ue.bottomOffset,onRow:xe,components:we}):e(Fs,{rows:ce,topOffset:ue.topOffset,bottomOffset:ue.bottomOffset,t:T,iconStrokeWidth:ie,FolderIcon:L,handleSingleClick:ge,handleDoubleClick:me,handleItemClick:m,setCurrentMenuFile:V,showMoveModal:k,showCopyModal:S,showRenameModal:C,showDeleteConfirm:_,onEdit:A,onEditorOk:N.onEditorOk,getFileData:I,showSelectionCheckbox:G});n&&!r.length&&(Ce=e(xo,{}));const _e=null===(F=null==B?void 0:B.availableImageExtensions)||void 0===F?void 0:F.map(e=>"."+e).join(", "),Se=t("div",W?{className:`${ys.noFiles} ant-layout-sider-light`,children:[e(Li,{size:48,className:ys.noFilesIcon}),e("div",{className:`${ys.textTitle_trash} ant-menu-submenu-title`,children:T("Trash is empty")}),e("div",{className:`${ys.textDescription_trash} ant-menu-submenu-title`,children:T("Deleted files will be displayed here")})]}:{className:ys.uploadContainer,children:[t("div",{className:`${ys.uploadArea} `,onClick:E,children:[e("div",{className:ys.uploadIcon,children:e(P,{})}),e("div",{className:ys.textTitle,children:T("Click here to select a file")}),e("div",{className:ys.textDescription,children:T("Supported files:")+" "+(_e||"jpeg, .svg, .png")})]}),t("div",{className:ys.buttons,children:[t("button",{className:ys.btnPhoto,onClick:()=>{H&&H(ir)},children:[e("div",{className:ys.icon,children:e(M,{})}),t("div",{className:ys.blockText,children:[e("div",{className:ys.textTitle,children:T("Stock")}),e("div",{className:ys.textDescription,children:T("Select an image from our library")})]})]}),t("button",{className:ys.btnAi,onClick:()=>{H&&H(ar)},children:[e("div",{className:ys.icon,children:e(R,{})}),t("div",{className:ys.blockText,children:[e("div",{className:ys.textTitle,children:T("AI generation")}),e("div",{className:ys.textDescription,children:T("Creating an image on demand")})]})]})]})]});return e("div",{className:`content-layout ${ys.contentLayout}`,children:g||0!==(null==r?void 0:r.length)||n?t("div",{className:ys.tableContainer,children:[e(xs,{files:r,filesById:le,currentSortOption:se,isSmallScreen:J,iconStrokeWidth:ie,multiSelectEnabled:G,features:ne,viewMode:Y,setViewMode:X,handleSearch:i,handleSortOptionChange:h,sortOptions:oe,onClearSelection:v,onRename:y,onDelete:b,onCopy:w,onMove:x,onEdit:A,t:T}),e("div",{ref:re,className:ys.filesContainer,children:Ce}),!U&&f.total>f.pageSize&&e("div",{className:ys.paginationContainer,children:e($,{current:f.current,pageSize:f.pageSize,total:f.total,onChange:(e,t)=>p({current:e,pageSize:t,total:f.total}),showSizeChanger:!0,showTotal:e=>T("total pages",{total:e})})})]}):e("div",{className:ys.emptyStateWrapper,children:Se})})});Vs.displayName="FileContent";var Hs="folderTree",$s="emptyFolderContainer",Ws="folderItemContainer",Gs="folderLabel",qs="folderLabelItem",Ys="fileCount",Xs="foldersTitle",Ks="foldersTitleItem",Zs="folderMenu";const Js=({selectedFolder:r,onSelect:n,onExpand:i,generateMenuItems:s,fetchChildFolders:l,disabledFolders:u=[],showFileCounts:h=!1,folderFileCounts:f={},className:p="",expandedKeys:g,setExpandedKeys:m,showTrashFolder:v=!1,mode:y="navigation",defaultExpandAll:b=!1})=>{const{t:w}=Yn(),{options:x}=po(),{config:C}=x,{ExpandArrowIcon:_,CollapseArrowIcon:S,CollapseFolderIcon:k,ExpandFolderIcon:A,EmptyFolderIcon:I}=mo(),E=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[F,T]=o(()=>{if(b||"selection"===y&&b){const e=s();return E(e)}return[]}),O=void 0!==g?g:F,P=void 0!==m?m:T;a(()=>{if(b||"selection"===y&&b){const e=s(),t=E(e);void 0===g&&T(t)}},[b,y,s,E,g]);const M=c(async e=>{const t=e[0];t&&"empty"!==t&&!t.endsWith("_input")&&(null==n||n(e),await(null==l?void 0:l("folders"===t?null:t)))},[n,l]),R=c(async(e,t)=>{var r;P(e),null==i||i(e,t);if(!("lazy"===(null==C?void 0:C.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==l?void 0:l(n))}catch(e){console.warn("Failed to load child folders for",n,e)}},[null==C?void 0:C.folderTreeLoading,l,i,P]),L=c(()=>{var n,i;const o=s(),a=e=>e.filter(e=>"Trash"!==e.key).map(e=>Object.assign(Object.assign({},e),{children:e.children?a(e.children):void 0})),l=v?a(o):o,c=e=>{"selection"!==y?(O.includes(e)&&r===e?P(O.filter(t=>t!==e)):O.includes(e)||P([...O,e]),M([e])):M([e])},d=0===l.length||1===l.length&&(!l[0].children||0===l[0].children.length),p=r=>{var n;const i=h?f[r.key]:void 0,o=h&&null===i?null:h&&null!=i?i:0,a=O.includes(r.key),s=u.includes(r.key),l=(()=>{var t;return(null===(t=r.children)||void 0===t?void 0:t.length)?e(a?k:A,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}):e(I,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth})})(),d=t("div",{className:`${Ws} folder-item-container`,onClick:()=>!s&&c(r.key),style:{opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},children:[t("div",{className:Gs,children:[void 0!==r.icon?r.icon:l,e("span",{className:qs,children:r.label})]}),h&&e("div",{className:Ys,title:null===o?void 0:`${o} ${w(1===o?"item":"items")}`,children:null===o?"—":o})]});return{key:r.key,title:d,children:null===(n=r.children)||void 0===n?void 0:n.map(p),disabled:s}},g=O.includes("folders"),m=e("div",{className:Xs,onClick:()=>c("folders"),children:t("div",{className:Ks,children:[e(g?k:A,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:`${qs} folder-label-item`,children:"folders"===(null===(n=l[0])||void 0===n?void 0:n.key)?l[0].label:w("Folders")})]})}),b=()=>({key:"Trash",title:e("div",{className:Xs,onClick:()=>c("Trash"),children:t("div",{className:Ks,children:[e(Ri,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:qs,children:w("Trash")})]})}),children:void 0});if(d){if(!v)return[{key:"empty",title:e("div",{className:$s,children:w("No folders yet")}),disabled:!0}];const t=[];return l.length>0&&"folders"===l[0].key&&t.push({key:"folders",title:m,children:[]}),t.push(b()),t}if(l.length>0&&"folders"===l[0].key){const e=[{key:"folders",title:m,children:null===(i=l[0].children)||void 0===i?void 0:i.map(p)}];return v&&e.push(b()),e}return l.map(p)},[s,O,k,null==C?void 0:C.iconStrokeWidth,A,w,r,M,h,f,I,u,v,y,P]),N=d(()=>L(),[L]);return e(W,{className:`${Hs} ${Zs} ${p}`,selectedKeys:r?[r]:[],expandedKeys:O,onSelect:M,onExpand:R,treeData:N,switcherIcon:({expanded:t})=>e(t?S:_,{}),showLine:!1})},Qs=({style:t={},wrap:r=!1})=>{const n=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},t);return e(R,{size:"large",style:n,wrap:r,children:e(S,{})})};var el={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 tl=({folderId:n,activeFormField:i,EmptyFolderIcon:o,targetForm:a,handleModalOk:s,onComplete:l,setIsLoading:c,t:u})=>e(E.Item,{className:"form-item form-item-moveto "+(i===n?"form-item_active":""),name:"folderName",initialValue:u("New folder"),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(u("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{className:"form-input",autoFocus:!0,prefix:e(o,{style:{marginRight:6}}),suffix:t(r,{children:[e(P,{placement:"top",title:"Clean",children:e(M,{icon:e(be,{style:{fontSize:10}}),className:el.inputButtonClose,type:"text",onClick:()=>{a.setFieldsValue({folderName:""})}})}),e(M,{className:el.inputButtonOk,type:"text",onClick:()=>{c(!0),s(a).then(e=>{const t=null==e?void 0:e.id;l(t)}).finally(()=>c(!1))},children:u("Create")})]})})});function rl({folders:n,selectedFolder:o,EmptyFolderIcon:a,handleCreateFolderModalOk:s,setIsLoading:l,t:c}){const[u,d]=i.useState(""),h=i.useCallback((t,r)=>n=>e(tl,{folderId:n,activeFormField:u,EmptyFolderIcon:a,targetForm:t,handleModalOk:s,onComplete:r,setIsLoading:l,t:c},n),[a,u,s,l,c]),f=i.useCallback(e=>{const{folderId:t,targetForm:r,onTreeSelect:n,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),d(t),r.setFieldsValue({folderName:c("New folder"),targetFolder:t})},handleSelectFolder:e=>{e.preventDefault(),e.stopPropagation(),n([t]).then(()=>i(t))}}},[c]),p=i.useCallback(i=>{const{targetForm:a,onTreeSelect:s,onComplete:l,actionButtonText:d}=i,p=h(a,l),g=Array.isArray(n)?n:[],m=(n=null,i=new Set)=>g.filter(e=>{const t=null===n&&!e.parentId,r=e.parentId===n;return t||r}).map(n=>{if(i.has(n.id))return{key:n.id,label:`${n.name} (циклическая ссылка)`};const c=new Set(i);c.add(n.id);const h=m(n.id,c),{handleAddFolder:g,handleSelectFolder:v}=f({folderId:n.id,targetForm:a,onTreeSelect:s,onComplete:l}),y=u===n.id?[{key:`${n.id}_input`,label:p(n.id),icon:null},...h]:h;return{key:n.id,label:t(r,{children:[n.name,o!==n.id&&t("div",{className:`${el.folderToolsField} folder-tools-field`,children:[e(M,{onClick:g,children:"+"}),e(M,{onClick:v,children:d})]})]}),children:y}}),v=m(),{handleAddFolder:y,handleSelectFolder:b}=f({folderId:"folders",targetForm:a,onTreeSelect:s,onComplete:l}),w="folders"===u?[{key:"folders_input",label:p("folders"),icon:null},...v]:v;return[{key:"folders",label:t(r,{children:[c("Folders"),"folders"!==o&&null!==o&&t("div",{className:`${el.folderToolsField} folder-tools-field`,children:[e(M,{onClick:y,children:"+"}),e(M,{onClick:b,children:d})]})]}),children:w}]},[u,h,f,n,o,c]);return{activeFormField:u,setActiveFormField:d,generateMenuItemsFromFolders:p}}const nl=f(({folderId:t,activeFormField:r,EmptyFolderIcon:n,targetForm:i,handleModalOk:o,onComplete:a,t:s,setIsLoading:l,defaultFolderName:u})=>{const d=c(()=>{l(!0),o(i).then(e=>a(null==e?void 0:e.id)).finally(()=>l(!1))},[o,i,a,l]);return e(E.Item,{className:"form-item form-item-moveto "+(r===t?"form-item_active":""),name:"folderName",initialValue:u,rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(s("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{className:"form-input",autoFocus:!0,prefix:e(n,{style:{marginRight:6}}),suffix:e(M,{className:el.inputButtonOk,type:"text",onClick:()=>{l(!0),d()},children:s("Create")})})})});nl.displayName="CustomFolderInput";const il=({isModalVisible:n,handleModalOk:i,handleModalCancel:s,form:l,selectedFolder:u,folders:h,isUrlModalVisible:f,setIsUrlModalVisible:p,handleAddFileByUrl:g,urlForm:m,isRenameModalVisible:v,handleRenameOk:y,handleRenameCancel:b,renameForm:w,fileToRename:x,files:C,isMoveModalVisible:_,handleMoveOk:S,handleMoveCancel:k,moveForm:A,selectedFiles:I,isRenameFolderModalVisible:T,handleRenameFolderOk:O,handleRenameFolderCancel:P,renameFolderForm:R,folderToRename:L,isCopyModalVisible:N,handleCopyOk:j,handleCopyCancel:D,copyForm:z,isDeleteConfirmVisible:B,handleDeleteConfirmOk:U,handleDeleteConfirmCancel:V,isClearTrashConfirmVisible:H,handleClearTrashConfirm:$,handleClearTrashCancel:W,fetchChildFolders:Y})=>{var X,K,Z;const{t:J}=Yn(),{state:Q,actions:ee,options:te}=po(),{setCurrentMenuFile:re}=ee,{config:ne}=te,{currentMenuFile:ie}=Q,oe=E.useWatch("folderName",l),{EmptyFolderIcon:ae}=mo(),[se,le]=o(!1),ce=d(()=>{var e;return(null===(e=null==ne?void 0:ne.defaultFolderName)||void 0===e?void 0:e.trim())||J("New folder")},[null==ne?void 0:ne.defaultFolderName,J]),ue=!oe||0===String(oe).trim().length,de=d(()=>Array.isArray(C)?C:[],[C]),he=x?null===(X=de.find(e=>e.id===x))||void 0===X?void 0:X.name:"",fe=Array.isArray(h)?h:[],pe=L?null===(K=fe.find(e=>e.id===L))||void 0===K?void 0:K.name:"",{activeFormField:ge,setActiveFormField:me,generateMenuItemsFromFolders:ve}=rl({folders:fe,selectedFolder:u,EmptyFolderIcon:ae,handleCreateFolderModalOk:i,setIsLoading:e=>le(Boolean(e)),t:J});a(()=>{if(B){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)}},[B]);const ye=x?de.find(e=>e.id===x):null,we=(null==ye?void 0:ye.isFolder)||(null==x?void 0:x.startsWith("folder_")),xe=c(async e=>{e.length>0&&(A.setFieldsValue({targetFolder:e[0]}),ge!==e[0].toString()&&me(""))},[A,ge,me]),Ce=c(async e=>{e.length>0&&(z.setFieldsValue({targetFolder:e[0]}),ge!==e[0].toString()&&me(""))},[ge,z,me]),_e=c(async e=>{le(!0);try{await S(e)}finally{le(!1)}},[S]),Se=c(async e=>{le(!0);try{await j(e)}finally{le(!1)}},[j]),ke=d(()=>{const e=Array.from(I).filter(e=>{const t=de.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||h.some(t=>t.id===e)});return u&&"folders"!==u?e.push(u):u&&"folders"!==u||e.push("folders"),e},[I,de,h,u]);return t(r,{children:[e(G,{title:e("div",{className:"modal-title",children:J("Creating a new folder")}),open:n,onOk:()=>i(),onCancel:s,okText:J("Create"),cancelText:J("Cancel"),okButtonProps:{disabled:ue,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>le(!1),children:t(E,{form:l,layout:"vertical",children:[e(E.Item,{name:"folderName",label:e("div",{className:"form-label",children:J("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],initialValue:ce,className:"form-item",style:{marginBottom:5},children:e(F,{autoFocus:!0,className:"form-input",disabled:se,placeholder:J("Enter the name"),onPressEnter:async()=>{le(!0);try{await l.validateFields(),ue||await i()}catch(e){le(!1)}}})}),e("div",{children:u&&"folders"!==u?t("p",{className:"fm-note",children:[J("A folder will be created inside:")," ",(null===(Z=fe.find(e=>e.id===u))||void 0===Z?void 0:Z.name)||J("selected folder"),"."]}):e("p",{className:"fm-note",children:J("The folder will be created in the root directory.")})})]})}),e(G,{title:e("div",{className:"modal-title",children:J("Upload file by URL")}),open:f,onOk:async()=>{var e;le(!0);try{const t=await m.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await g(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{le(!1)}},onCancel:()=>p(!1),okText:J("Download"),okButtonProps:{loading:se},cancelText:J("Cancel"),cancelButtonProps:{disabled:se},afterClose:()=>le(!1),children:e(E,{form:m,layout:"vertical",children:e(E.Item,{name:"fileUrl",label:e("div",{className:"form-label",children:J("File URL")}),rules:[{required:!0,message:J("Enter the URL of the image")},{validator:(e,t)=>{if(!t||!String(t).trim())return Promise.resolve();try{return Ko(String(t),J),Promise.resolve()}catch(e){return Promise.reject(new Error(e instanceof Error?e.message:J("The specified URL is not valid.")))}}}],validateTrigger:"onBlur",className:"form-item",children:e(F,{className:"form-input",placeholder:"https://example.com/image.jpg",autoFocus:!0,disabled:se,onPressEnter:async()=>{var e;le(!0);try{const t=await m.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await g(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{le(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:we?`${J("Rename folder")} ${he}`:J("Rename file",{currentFileName:he})}),open:v,onOk:y,okText:J("Rename"),okButtonProps:{loading:se},onCancel:b,cancelText:J("Cancel"),cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},children:e(E,{form:w,layout:"vertical",children:e(E.Item,{name:"newFileName",label:e("div",{className:"form-label",children:J(we?"New folder name":"New file name")}),rules:[{required:!0,message:J(we?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:se,onPressEnter:async()=>{le(!0);try{await w.validateFields(),y()}catch(e){le(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:J("Move to")}),open:_,onCancel:k,footer:t("div",{className:el.formFooter,children:[t(M,{className:el.folderButton,onClick:()=>{const e=null!=u?u:"folders";me(e),A.setFieldsValue({folderName:ce,targetFolder:e})},loading:se,children:[e(wi,{size:18,strokeWidth:null==ne?void 0:ne.iconStrokeWidth}),J("Create folder")]}),e(M,{type:"primary",className:el.folderButton,onClick:k,loading:se,children:J("Done")})]}),afterClose:()=>{re&&re(""),me(""),le(!1)},loading:se,children:t("div",{className:el.modalContentWithLoader,children:[se&&e("div",{className:el.modalLoaderOverlay,children:e(Qs,{})}),e(E,{form:A,layout:"vertical",initialValues:{targetFolder:"folders",folderName:ce,is_force_create:!1},children:t("div",{className:el.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:J("Select the destination folder")}],className:el.formItem,children:e(Js,{onSelect:xe,generateMenuItems:()=>ve({targetForm:A,onTreeSelect:xe,onComplete:_e,actionButtonText:J("Move here")}),fetchChildFolders:Y,disabledFolders:ke,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:e("div",{className:"modal-title",children:J("Copy to folder")}),open:N,onCancel:D,footer:t("div",{className:el.formFooter,children:[t(M,{className:el.folderButton,onClick:()=>{const e=null!=u?u:"folders";me(e),z.setFieldsValue({folderName:ce,targetFolder:e})},loading:se,children:[e(wi,{size:18,strokeWidth:null==ne?void 0:ne.iconStrokeWidth}),J("Create folder")]}),e(M,{type:"primary",className:el.folderButton,onClick:D,loading:se,children:J("Done")})]}),afterClose:()=>{re&&re(""),me(""),le(!1)},loading:se,children:t("div",{className:el.modalContentWithLoader,children:[se&&e("div",{className:el.modalLoaderOverlay,children:e(Qs,{})}),e(E,{form:z,layout:"vertical",initialValues:{targetFolder:"folders",folderName:ce,is_force_create:!1},children:t("div",{className:el.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:J("Select the destination folder")}],className:el.formItem,children:e(Js,{onSelect:Ce,generateMenuItems:()=>ve({targetForm:z,onTreeSelect:Ce,onComplete:Se,actionButtonText:J("Copy here")}),fetchChildFolders:Y,disabledFolders:ke,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:t("div",{className:"modal-title",children:[J("Rename folder")," ",pe]}),open:T,onOk:O,onCancel:P,okText:J("Rename"),cancelText:J("Cancel"),okButtonProps:{loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},children:e(E,{form:R,layout:"vertical",children:e(E.Item,{name:"newFolderName",label:e("div",{className:"form-label",children:J("New folder name")}),rules:[{required:!0,message:J("Enter a new folder name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:se,onPressEnter:async()=>{le(!0);try{await R.validateFields(),O()}catch(e){le(!1)}}})})})}),e(G,{className:`${el.deleteModal} deleteModal`,title:(()=>{const t=!!(null==ne?void 0:ne.enableTrashFolder)&&"Trash"===u||!(null==ne?void 0:ne.enableTrashFolder),r=J(t?"Permanently delete":"Move to Trash");return e("div",{className:"modal-title",children:r})})(),open:!!B,onOk:()=>{le(!0);try{U&&U()}catch(e){console.error(e),le(!1)}},onCancel:()=>V&&V(),okText:(null==ne?void 0:ne.enableTrashFolder)&&"Trash"===u?J("Delete permanently"):(null==ne?void 0:ne.enableTrashFolder)?J("Move to Trash"):J("Delete"),cancelText:J("Cancel"),okButtonProps:{danger:!(null==ne?void 0:ne.enableTrashFolder)||"Trash"===u,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},closeIcon:e(be,{className:el.closeIcon}),children:(()=>{var r,n;const i=(ie?[ie]:Array.from(I||[])).map(e=>de.find(t=>t.id===e)).filter(e=>!!e),o=i.filter(e=>e.isFolder||e.id.startsWith("folder_")),a=i.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),s=i.length,l=o.length,c=a.length,d=!!(null==ne?void 0:ne.enableTrashFolder);if(!d||d&&"Trash"===u){let n;if(1===s&&1===l){const e=o[0],t=(null==e?void 0:e.name)||"",i=null!==(r=null==e?void 0:e.childCount)&&void 0!==r?r:0;n=J("delete_folder_permanent",{name:t,count:i})}else n=0===l&&c>0?J("delete_files_permanent",{count:c}):J("delete_mixed_permanent",{total:s,folders:l,images:c});return t("div",{children:[e("div",{children:n}),e("p",{className:el.permanentDeleteWarning,children:J("permanent_delete_warning")})]})}if(1===s&&1===l){const t=o[0],r=(null==t?void 0:t.name)||"",i=null!==(n=null==t?void 0:t.childCount)&&void 0!==n?n:0;return e("div",{children:J("move_folder_to_trash",{name:r,count:i})})}return e("div",0===l&&c>0?{children:J("move_files_to_trash",{count:c})}:{children:J("move_mixed_to_trash",{total:s,folders:l,images:c})})})()}),t(G,{className:`${el.deleteModal} deleteModal`,title:e("div",{className:"modal-title",children:J("Clear Trash")}),open:!!H,onOk:async()=>{le(!0),$&&await $(),le(!1)},onCancel:()=>W&&W(),okText:J("Delete permanently"),cancelText:J("Cancel"),okButtonProps:{danger:!0,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1)},closeIcon:e(be,{className:el.closeIcon}),children:[e("div",{children:J("Are you sure you want to permanently delete all items from Trash?")}),se&&t("div",{className:el.clearTrashProgress,children:[e(q,{percent:99,status:"active",showInfo:!1}),e("div",{className:el.progressText,children:J("Deleting items...")})]})]})]})};var ol={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const al=f(p(({selectedFolder:r,generateMenuItems:n,onFolderSelect:i,folders:s,fetchChildFolders:l,handleAddFile:h,setIsUrlModalVisible:f,handleCreateFolder:p,activeLibraryItem:m,setActiveLibraryItem:v},y)=>{var b,w,x;const C=d(()=>Array.isArray(s)?s:[],[s]),{t:_}=Yn(),S=Oo(),[k,A]=o({}),{options:I,state:E}=po(),{dataProviders:F,config:T}=I,O=E.pathHistory,P=!1!==(null===(b=null==T?void 0:T.features)||void 0===b?void 0:b.enableGif)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("gif")),R=!1!==(null===(w=null==T?void 0:T.features)||void 0===w?void 0:w.enableStockImages)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("stock")),L=!1!==(null===(x=null==T?void 0:T.features)||void 0===x?void 0:x.enableIconStock)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("icons")),N=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[j,D]=o(()=>{if(!0===(null==T?void 0:T.expandAllFoldersOnInit)&&"lazy"!==(null==T?void 0:T.folderTreeLoading)){const e=n();return N(e)}return!0===(null==T?void 0:T.expandRootFolderOnInit)?["folders"]:[]}),z=u(!1),B=u(!1);a(()=>{if(z.current)return;"lazy"===(null==T?void 0:T.folderTreeLoading)&&!0===(null==T?void 0:T.expandRootFolderOnInit)&&(z.current=!0,(async()=>{try{await(null==l?void 0:l(null))}catch(e){console.warn("Could not load the root child folders during initialization",e)}})())},[null==T?void 0:T.folderTreeLoading,null==T?void 0:T.expandRootFolderOnInit,l]),a(()=>{!0===(null==T?void 0:T.expandRootFolderOnInit)&&Array.isArray(C)&&C.length>0&&(B.current||j&&0!==j.length||(B.current=!0,D(["folders"])))},[null==T?void 0:T.expandRootFolderOnInit,C,j]),a(()=>{if(!0===(null==T?void 0:T.expandAllFoldersOnInit)&&"lazy"!==(null==T?void 0:T.folderTreeLoading)){const e=n(),t=N(e);return void D(t)}!0===(null==T?void 0:T.expandRootFolderOnInit)&&D(e=>e&&e.length>0?[...e]:["folders"])},[C,n,N,null==T?void 0:T.expandAllFoldersOnInit,null==T?void 0:T.folderTreeLoading,null==T?void 0:T.expandRootFolderOnInit]);const U=null==T?void 0:T.disablePagination,V=c(async e=>{var t,r,n,i;try{if(null==F?void 0:F.getChildrenCount)return await F.getChildrenCount("folders"===e?void 0:e);if(null==F?void 0:F.getFiles){const{files:r,pagination:n}=await F.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:U?void 0:1,limit:U?void 0:1});return U?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;if(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))return 0;console.error(`Error getting the number of files for the folder ${e}:`,t);const a=await Na({folderId:e,dataProviders:F,folders:C,pathHistory:O,t:_});return S.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:_("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[F,U,S,O,C,_]),H=c(async()=>{if(0===C.length)return;const e={};e.folders=await V("folders");const t=C.map(async t=>{"number"!=typeof t.childCount?e[t.id]=await V(t.id):e[t.id]=t.childCount});await Promise.all(t),A(e)},[C,V]),$=c(async e=>{const t=await V(e);A(r=>Object.assign(Object.assign({},r),{[e]:t}))},[V]);g(y,()=>({refreshFileCounts:H}),[H]),a(()=>{H()},[H]),a(()=>{if(!r||"folders"===r)return;const e=(t,r=new Set)=>{if(r.has(t))return console.warn(`Cycle detected in the path to the folder with id=${t}`),[];const n=C.find(e=>e.id===t);if(!n)return[];if(!n.parentId)return[];const i=new Set(r);i.add(t);return[...e(n.parentId,i),n.parentId]},t=e(r);t.length>0?D(e=>{const r=new Set(e);return t.forEach(e=>r.add(e)),r.add("folders"),Array.from(r)}):D(e=>e.includes("folders")?e:[...e,"folders"])},[r,C]);const W=c(async()=>{await h(),r?await $(r):await $("folders")},[h,r,$]),G=[{key:rr,label:_("My files"),icon:e(_i,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth})},{key:nr,label:_("GIF"),icon:e(Ai,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!P},{key:ir,label:_("Stock images"),icon:e(pi,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!R},{key:or,label:_("Icons"),icon:e(we,{size:20}),disabled:!L},{key:ar,label:_("AI"),icon:e(Oi,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!(null==T?void 0:T.sseQuery)}].filter(e=>!e.disabled),q=c(async e=>{const t=e[0];t&&"empty"!==t&&(m!==rr&&v(rr),null==i||i(t),await(null==l?void 0:l(t)))},[i,m,v,l]),K=c(({key:e})=>{v(e)},[v]),Z=c(async(e,t)=>{var r;D(e);if(!("lazy"===(null==T?void 0:T.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==l?void 0:l(n))}catch(e){console.warn("Could not load the child folders for",n,e);const t=await Na({folderId:n,dataProviders:F,folders:C,pathHistory:O,t:_});S.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:_("Failed to load subfolders in folder",{folderName:t}),placement:"bottomRight",innerException:e,notificationDedupe:!0,data:{folderId:n,folderName:t,reason:e instanceof Error?e.message:String(e)}})}},[null==T?void 0:T.folderTreeLoading,F,l,S,O,C,_]);return t("div",{className:"sidebar-container",children:[t("div",{className:ol.buttonWrapper,children:[e(M,{type:"primary",size:"large",icon:e(Ii,{size:24,strokeWidth:null==T?void 0:T.iconStrokeWidth}),onClick:W,className:ol.uploadButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r,children:e("span",{className:ol.uploadButtonTitle,children:_("Upload file")})}),e(M,{type:"primary",size:"large",icon:e(Si,{size:24,strokeWidth:null==T?void 0:T.iconStrokeWidth}),onClick:()=>null==f?void 0:f(!0),className:ol.uploadByURLButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r})]}),e(Y,{className:"folder-menu",items:G,defaultSelectedKeys:[rr],onSelect:({key:e})=>K({key:e}),selectedKeys:[m]}),e(X,{className:ol.divider}),t("div",{className:ol.foldersContainer,children:[e(Js,{selectedFolder:r,onSelect:q,onExpand:Z,generateMenuItems:n,fetchChildFolders:l,showFileCounts:!0,folderFileCounts:k,expandedKeys:j,setExpandedKeys:D,showTrashFolder:null==T?void 0:T.enableTrashFolder}),e("div",{className:ol.folderActions,children:e(M,{onClick:e=>{e.stopPropagation(),p()},className:ol.button,icon:e(wi,{size:18,strokeWidth:null==T?void 0:T.iconStrokeWidth}),size:"middle"})})]})]})}));al.displayName="FolderSidebar";var sl=Object.defineProperty,ll=(e,t,r)=>(((e,t,r)=>{t in e?sl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);function cl(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function ul(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function dl(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=ul(e);return t>0?cl(Number(e)*Math.pow(10,t)):Number(e)}function hl(e){yl&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&console.warn(e+" is beyond boundary when transfer to integer, the results may not be accurate")}function fl(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 pl=fl(function(e,t){var r=dl(e),n=dl(t),i=ul(e)+ul(t),o=r*n;return hl(o),o/Math.pow(10,i)}),gl=fl(function(e,t){var r=Math.pow(10,Math.max(ul(e),ul(t)));return(pl(e,r)+pl(t,r))/r}),ml=fl(function(e,t){var r=Math.pow(10,Math.max(ul(e),ul(t)));return(pl(e,r)-pl(t,r))/r}),vl=fl(function(e,t){var r=dl(e),n=dl(t);return hl(r),hl(n),pl(r/n,cl(Math.pow(10,ul(t)-ul(e))))});var yl=!0;var bl={strip:cl,plus:gl,minus:ml,times:pl,divide:vl,round:function(e,t){var r=Math.pow(10,t),n=vl(Math.round(Math.abs(pl(e,r))),r);return e<0&&0!==n&&(n=pl(n,-1)),n},digitLength:ul,float2Fixed:dl,enableBoundaryChecking:function(e){void 0===e&&(e=!0),yl=e}};const wl=Object.prototype.toString;function xl(e){switch(wl.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ol(e,Error)}}function Cl(e,t){return wl.call(e)===`[object ${t}]`}function _l(e){return Cl(e,"ErrorEvent")}function Sl(e){return Cl(e,"DOMError")}function kl(e){return Cl(e,"String")}function Al(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Il(e){return null===e||Al(e)||"object"!=typeof e&&"function"!=typeof e}function El(e){return Cl(e,"Object")}function Fl(e){return typeof Event<"u"&&Ol(e,Event)}function Tl(e){return!(!e||!e.then||"function"!=typeof e.then)}function Ol(e,t){try{return e instanceof t}catch{return!1}}function Pl(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function Ml(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function Rl(e,t){if(!Array.isArray(e))return"";const r=[];for(let t=0;t<e.length;t++){const n=e[t];try{Pl(n)?r.push("[VueViewModel]"):r.push(String(n))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function Ll(e,t,r=!1){return!!kl(e)&&(function(e){return Cl(e,"RegExp")}(t)?t.test(e):!!kl(t)&&(r?e===t:e.includes(t)))}function Nl(e,t=[],r=!1){return t.some(t=>Ll(e,t,r))}function jl(e,t,r=250,n,i,o,a){if(!(o.exception&&o.exception.values&&a&&Ol(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=Ml(e.value,t)),e))}(Dl(e,t,i,a.originalException,n,o.exception.values,s,0),r))}function Dl(e,t,r,n,i,o,a,s){if(o.length>=r+1)return o;let l=[...o];if(Ol(n[i],Error)){zl(a,s);const o=e(t,n[i]),c=l.length;Bl(o,i,c,s),l=Dl(e,t,r,n[i],i,[o,...l],o,c)}return Array.isArray(n.errors)&&n.errors.forEach((n,o)=>{if(Ol(n,Error)){zl(a,s);const c=e(t,n),u=l.length;Bl(c,`errors[${o}]`,u,s),l=Dl(e,t,r,n,i,[c,...l],c,u)}}),l}function zl(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 Bl(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 Ul(e){return e&&e.Math==Math?e:void 0}const Vl="object"==typeof globalThis&&Ul(globalThis)||"object"==typeof window&&Ul(window)||"object"==typeof self&&Ul(self)||"object"==typeof global&&Ul(global)||function(){return this}()||{};function Hl(){return Vl}function $l(e,t,r){const n=r||Vl,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const Wl=Hl();function Gl(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=ql(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 ql(e,t){const r=e,n=[];let i,o,a,s,l;if(!r||!r.tagName)return"";if(Wl.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&&kl(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 Yl=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Xl=["debug","info","warn","error","log","assert","trace"],Kl={};function Zl(e){if(!("console"in Vl))return e();const t=Vl.console,r={},n=Object.keys(Kl);n.forEach(e=>{const n=Kl[e];r[e]=t[e],t[e]=n});try{return e()}finally{n.forEach(e=>{t[e]=r[e]})}}const Jl=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Yl?Xl.forEach(r=>{t[r]=(...t)=>{e&&Zl(()=>{Vl.console[r](`Sentry Logger [${r}]:`,...t)})}}):Xl.forEach(e=>{t[e]=()=>{}}),t}(),Ql=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ec(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 tc(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function rc(e){const t="string"==typeof e?function(e){const t=Ql.exec(e);if(!t)return void Zl(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});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 tc({host:o,pass:i,path:l,projectId:c,port:a,protocol:r,publicKey:n})}(e):tc(e);if(t&&function(e){if(!Yl)return!0;const{port:t,projectId:r,protocol:n}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(Jl.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(r.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(n)?t&&isNaN(parseInt(t,10))&&(Jl.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(Jl.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),1):(Jl.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),1)))}(t))return t}class nc 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 ic(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);"function"==typeof i&&ac(i,n),e[t]=i}function oc(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{Yl&&Jl.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function ac(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,oc(e,"__sentry_original__",t)}catch{}}function sc(e){return e.__sentry_original__}function lc(e){if(xl(e))return{message:e.message,name:e.name,stack:e.stack,...uc(e)};if(Fl(e)){const t={type:e.type,target:cc(e.target),currentTarget:cc(e.currentTarget),...uc(e)};return typeof CustomEvent<"u"&&Ol(e,CustomEvent)&&(t.detail=e.detail),t}return e}function cc(e){try{return function(e){return typeof Element<"u"&&Ol(e,Element)}(e)?Gl(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function uc(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 dc(e){return hc(e,new Map)}function hc(e,t){if(function(e){if(!El(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 r of Object.keys(e))typeof e[r]<"u"&&(n[r]=hc(e[r],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(hc(e,t))}),n}return e}const fc=/\(error: (.*)\)/,pc=/captureMessage|captureException/;function gc(...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 e=r;e<i.length;e++){const r=i[e];if(r.length>1024)continue;const o=fc.test(r)?r.replace(fc,"$1"):r;if(!o.match(/\S*Error: /)){for(const e of t){const t=e(o);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(),pc.test(t[t.length-1].function||"")&&(t.pop(),pc.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 mc(e){return Array.isArray(e)?gc(...e):e}const vc="<anonymous>";function yc(e){try{return e&&"function"==typeof e&&e.name||vc}catch{return vc}}const bc={},wc={};function xc(e,t){bc[e]=bc[e]||[],bc[e].push(t)}function Cc(e,t){wc[e]||(t(),wc[e]=!0)}function _c(e,t){const r=e&&bc[e];if(r)for(const n of r)try{n(t)}catch(t){Yl&&Jl.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${yc(n)}\nError:`,t)}}function Sc(){"console"in Vl&&Xl.forEach(function(e){e in Vl.console&&ic(Vl.console,e,function(t){return Kl[e]=t,function(...t){_c("console",{args:t,level:e});const r=Kl[e];r&&r.apply(Vl.console,t)}})})}function kc(){const e=Vl,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 Ac(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Ic(e){const{message:t,event_id:r}=e;if(t)return t;const n=Ac(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Ec(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 Fc(e,t){const r=Ac(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 Tc(e){if(e&&e.__sentry_captured__)return!0;try{oc(e,"__sentry_captured__",!0)}catch{}return!1}function Oc(e){return Array.isArray(e)?e:[e]}const Pc=Vl;let Mc,Rc,Lc;function Nc(){if(!Pc.document)return;const e=_c.bind(null,"dom"),t=jc(e,!0);Pc.document.addEventListener("click",t,!1),Pc.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const r=Pc[t]&&Pc[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(ic(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=jc(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}}),ic(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 jc(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;oc(r,"_sentryCaptured",!0),n&&!n._sentryId&&oc(n,"_sentryId",kc());const i="keypress"===r.type?"input":r.type;(function(e){if(e.type!==Rc)return!1;try{if(!e.target||e.target._sentryId!==Lc)return!1}catch{}return!0})(r)||(e({event:r,name:i,global:t}),Rc=r.type,Lc=n?n._sentryId:void 0),clearTimeout(Mc),Mc=Pc.setTimeout(()=>{Lc=void 0,Rc=void 0},1e3)}}const Dc=Hl();function zc(){if(!("fetch"in Dc))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Bc(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Uc(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!zc())return!1;if(Bc(Dc.fetch))return!0;let e=!1;const t=Dc.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=Bc(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){Yl&&Jl.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&ic(Vl,"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:Hc(t),method:Vc(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Hc(t),method:Vc(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return _c("fetch",{...i}),e.apply(Vl,t).then(e=>(_c("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw _c("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function Vc(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Hc(e){return"string"==typeof e?e:e?Vc(e,"url")?e.url:e.toString?e.toString():"":""}let $c=null;function Wc(){$c=Vl.onerror,Vl.onerror=function(e,t,r,n,i){return _c("error",{column:n,error:i,line:r,msg:e,url:t}),!(!$c||$c.__SENTRY_LOADER__)&&$c.apply(this,arguments)},Vl.onerror.__SENTRY_INSTRUMENTED__=!0}let Gc=null;function qc(){Gc=Vl.onunhandledrejection,Vl.onunhandledrejection=function(e){return _c("unhandledrejection",e),!(Gc&&!Gc.__SENTRY_LOADER__)||Gc.apply(this,arguments)},Vl.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Yc=Hl();const Xc=Vl;let Kc;function Zc(e){const t="history";xc(t,e),Cc(t,Jc)}function Jc(){if(!function(){const e=Yc.chrome,t=e&&e.app&&e.app.runtime,r="history"in Yc&&!!Yc.history.pushState&&!!Yc.history.replaceState;return!t&&r}())return;const e=Xc.onpopstate;function t(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const e=Kc,t=String(r);Kc=t,_c("history",{from:e,to:t})}return e.apply(this,t)}}Xc.onpopstate=function(...t){const r=Xc.location.href,n=Kc;if(Kc=r,_c("history",{from:n,to:r}),e)try{return e.apply(this,t)}catch{}},ic(Xc.history,"pushState",t),ic(Xc.history,"replaceState",t)}const Qc=Vl,eu="__sentry_xhr_v3__";function tu(){if(!Qc.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;ic(e,"open",function(e){return function(...t){const r=Date.now(),n=kl(t[0])?t[0].toUpperCase():void 0,i=function(e){if(kl(e))return e;try{return e.toString()}catch{}}(t[1]);if(!n||!i)return e.apply(this,t);this[eu]={method:n,url:i,request_headers:{}},"POST"===n&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[eu];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}_c("xhr",{args:[n,i],endTimestamp:Date.now(),startTimestamp:r,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?ic(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),ic(this,"setRequestHeader",function(e){return function(...t){const[r,n]=t,i=this[eu];return i&&kl(r)&&kl(n)&&(i.request_headers[r.toLowerCase()]=n),e.apply(this,t)}}),e.apply(this,t)}}),ic(e,"send",function(e){return function(...t){const r=this[eu];if(!r)return e.apply(this,t);void 0!==t[0]&&(r.body=t[0]);return _c("xhr",{args:[r.method,r.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}function ru(e,t=100,r=1/0){try{return iu("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function nu(e,t=3,r=102400){const n=ru(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(n)>r?nu(e,t-1,r):n}function iu(e,t,r=1/0,n=1/0,i=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[o,a]=i;if(null==t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;const s=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Pl(t))return"[VueViewModel]";if(function(e){return El(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: ${yc(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;const l="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===l)return s.replace("object ","");if(o(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return iu("",c.toJSON(),l-1,n,i)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const h=lc(t);for(const e in h){if(!Object.prototype.hasOwnProperty.call(h,e))continue;if(d>=n){u[e]="[MaxProperties ~]";break}const t=h[e];u[e]=iu(e,t,l-1,n,i),d++}return a(t),u}var ou;function au(e){return new lu(t=>{t(e)})}function su(e){return new lu((t,r)=>{r(e)})}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(ou||(ou={}));class lu{constructor(e){lu.prototype.__init.call(this),lu.prototype.__init2.call(this),lu.prototype.__init3.call(this),lu.prototype.__init4.call(this),this._state=ou.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new lu((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 lu((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(ou.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(ou.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===ou.PENDING){if(Tl(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===ou.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===ou.RESOLVED&&e[1](this._value),this._state===ou.REJECTED&&e[2](this._value),e[0]=!0)})}}}function cu(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 su(new nc("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 lu((r,n)=>{let i=t.length;if(!i)return r(!0);const o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{au(e).then(()=>{--i||(clearTimeout(o),r(!0))},n)})})}}}function uu(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 du=["fatal","error","warning","log","info","debug"];function hu(e){return"warn"===e?"warning":du.includes(e)?e:"log"}function fu(){return Date.now()/1e3}const pu=function(){const{performance:e}=Vl;if(!e||!e.now)return fu;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/1e3}();function gu(e,t=[]){return[e,t]}function mu(e,t){const[r,n]=e;return[r,[...n,t]]}function vu(e,t){const r=e[1];for(const e of r){if(t(e,e[0].type))return!0}return!1}function yu(e,t){return(t||new TextEncoder).encode(e)}function bu(e,t){const[r,n]=e;let i=JSON.stringify(r);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[yu(i,t),e]:i.push("string"==typeof e?yu(e,t):e)}for(const e of n){const[t,r]=e;if(o(`\n${JSON.stringify(t)}\n`),"string"==typeof r||r instanceof Uint8Array)o(r);else{let e;try{e=JSON.stringify(r)}catch{e=JSON.stringify(ru(r))}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 t of e)r.set(t,n),n+=t.length;return r}(i)}function wu(e,t){const r="string"==typeof e.data?yu(e.data,t):e.data;return[dc({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}(()=>{const{performance:e}=Vl;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 xu={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 Cu(e){return xu[e]}function _u(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function Su(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 e of o.trim().split(",")){const[t,r,,,o]=e.split(":",5),a=parseInt(t,10),s=1e3*(isNaN(a)?60:a);if(r)for(const e of r.split(";"))"metric_bucket"===e?(!o||o.split(";").includes("custom"))&&(i[e]=n+s):i[e]=n+s;else i.all=n+s}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}const ku=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Au="production";function Iu(){return $l("globalEventProcessors",()=>[])}function Eu(e){Iu().push(e)}function Fu(e,t,r,n=0){return new lu((i,o)=>{const a=e[n];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},r);ku&&a.id&&null===s&&Jl.log(`Event processor "${a.id}" dropped event`),Tl(s)?s.then(t=>Fu(e,t,r,n+1).then(i)).then(null,o):Fu(e,s,r,n+1).then(i).then(null,o)}})}function Tu(e){const t=pu(),r={sid:kc(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return dc({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&&Ou(r,e),r}function Ou(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||pu(),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:kc()),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 Pu(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),Ou(e,r)}function Mu(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:o,status:a,tags:s,origin:l}=Ru(e);return dc({data:n,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:r,origin:l})}function Ru(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}function Lu(e,t,r,n,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||kc(),timestamp:t.timestamp||fu()},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:Au),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=Ml(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Ml(a.value,o));const s=e.request;s&&s.url&&(s.url=Ml(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=Vl._sentryDebugIds;if(!r)return;let n;const i=Nu.get(t);i?n=i:(n=new Map,Nu.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 Ju;return r.update(t),r}(n,r.captureContext);r.mechanism&&Fc(l,r.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(Zu||(Zu=new Ju),Zu).getScopeData();if(o){Xu(h,o.getScopeData())}if(u){Xu(h,u.getScopeData())}const f=[...r.attachments||[],...h.attachments];f.length&&(r.attachments=f),Yu(l,h);return Fu([...d,...Iu(),...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:ru(e.data,t,r)}}))},...e.user&&{user:ru(e.user,t,r)},...e.contexts&&{contexts:ru(e.contexts,t,r)},...e.extra&&{extra:ru(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=ru(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(e=>{const n=Ru(e).data;return n&&(e.data=ru(n,t,r)),e})),n}(e,a,s):e))}const Nu=new WeakMap;function ju(e,t){return ad().captureEvent(e,t)}function Du(e,t){ad().addBreadcrumb(e,t)}function zu(){return ad().getClient()}function Bu(){return ad().getScope()}function Uu(e){const t=zu(),r=sd(),n=Bu(),{release:i,environment:o=Au}=t&&t.getOptions()||{},{userAgent:a}=Vl.navigator||{},s=Tu({release:i,environment:o,user:n.getUser()||r.getUser(),...a&&{userAgent:a},...e}),l=r.getSession();return l&&"ok"===l.status&&Ou(l,{status:"exited"}),Vu(),r.setSession(s),n.setSession(s),s}function Vu(){const e=sd(),t=Bu(),r=t.getSession()||e.getSession();r&&Pu(r),Hu(),e.setSession(),t.setSession()}function Hu(){const e=sd(),t=Bu(),r=zu(),n=t.getSession()||e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}function $u(e=!1){e?Vu():Hu()}function Wu(e){return e.transaction}function Gu(e,t,r){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=r&&r.getUser()||{},a=dc({environment:n.environment||Au,release:n.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function qu(e){const t=zu();if(!t)return{};const r=Gu(Ru(e).trace_id||"",t,Bu()),n=Wu(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=Ru(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 Yu(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=dc(r);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=dc(n);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=dc(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=dc(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:Mu(t),...e.contexts};const r=Wu(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:qu(t),...e.sdkProcessingMetadata};const n=Ru(r).description;n&&(e.tags={transaction:n,...e.tags})}}(e,n),function(e,t){e.fingerprint=e.fingerprint?Oc(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 Xu(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;Ku(e,"extra",r),Ku(e,"tags",n),Ku(e,"user",i),Ku(e,"contexts",o),Ku(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 Ku(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 Zu;class Ju{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Qu()}static clone(e){return e?e.clone():new Ju}clone(){const e=new Ju;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&&Ou(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 Ju){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(El(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=Qu(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:100;if(r<=0)return this;const n={timestamp:fu(),...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=[]){Yu(e,this.getScopeData());return Fu([...r,...Iu(),...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:kc();if(!this._client)return Jl.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:kc();if(!this._client)return Jl.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:kc();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(Jl.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 Qu(){return{traceId:kc(),spanId:kc().substring(16)}}const ed="7.116.0",td=parseFloat(ed),rd=100;class nd{constructor(e,t,r,n=td){let i,o;this._version=n,t?i=t:(i=new Ju,i.setClient(e)),r?o=r:(o=new Ju,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 Tl(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:kc(),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:kc(),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:kc();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=rd}=n.getOptions&&n.getOptions()||{};if(o<=0)return;const a={timestamp:fu(),...e},s=i?Zl(()=>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=od(this);try{e(this)}finally{od(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return ku&&Jl.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const r=this._callExtensionMethod("startTransaction",e,t);return ku&&!r&&(this.getClient()?Jl.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):Jl.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&&Pu(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i=Au}=r&&r.getOptions()||{},{userAgent:o}=Vl.navigator||{},a=Tu({release:n,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&Ou(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=id().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);ku&&Jl.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function id(){return Vl.__SENTRY__=Vl.__SENTRY__||{extensions:{},hub:void 0},Vl}function od(e){const t=id(),r=ld(t);return cd(t,e),r}function ad(){const e=id();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=id()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||ld(e).isOlderThan(td))&&cd(e,new nd),ld(e)}(e)}function sd(){return ad().getIsolationScope()}function ld(e){return $l("hub",()=>new nd,e)}function cd(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}function ud(e,t,r,n){const i=_u(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:ec(n)},...i&&{trace:dc({...i})}}}(e,i,n,t);return delete e.sdkProcessingMetadata,gu(a,[[{type:o},e]])}function dd(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}`}})}const hd=[];function fd(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?Oc(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 pd(e,t){for(const r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function gd(e,t,r){if(r[t.name])ku&&Jl.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,-1===hd.indexOf(t.name)&&(t.setupOnce(Eu,ad),hd.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)}ku&&Jl.log(`Integration installed: ${t.name}`)}}function md(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}function vd(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=ec(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 gu(i,[o])}const yd="Not capturing exception because it's already been captured.";class bd{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=rc(e.dsn):ku&&Jl.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)}?${dd(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(Tc(e))return void(ku&&Jl.log(yd));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=Al(e)?e:String(e),a=Il(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&&Tc(t.originalException))return void(ku&&Jl.log(yd));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?ku&&Jl.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Ou(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))):au(!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 ku&&Jl.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];gd(this,e,this._integrations),t||pd(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=ud(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])r=mu(r,wu(e,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=_u(r);return gu({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:ec(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}`;ku&&Jl.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}captureAggregateMetrics(e){ku&&Jl.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=vd(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&&gd(e,t,r)}),r}(this,e),pd(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)&&(Ou(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new lu(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=sd()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),Lu(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||Gu(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(ku){const t=e;"log"===t.logLevel?Jl.log(t.message):Jl.warn(t)}})}_processEvent(e,t,r){const n=this.getOptions(),{sampleRate:i}=n,o=xd(e),a=wd(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),su(new nc(`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 nc("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 wd(t)&&n?n(t,r):xd(t)&&i?i(t,r):t}(n,r,t);return function(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Tl(e))return e.then(e=>{if(!El(e)&&null!==e)throw new nc(r);return e},e=>{throw new nc(`${t} rejected with ${e}`)});if(!El(e)&&null!==e)throw new nc(r);return e}(i,l)}).then(n=>{if(null===n)throw this.recordDroppedEvent("before_send",c,e),new nc(`${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 nc?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new nc(`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=>{ku&&Jl.error("Error while sending event:",e)});ku&&Jl.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 wd(e){return void 0===e.type}function xd(e){return"transaction"===e.type}function Cd(e,t){!0===t.debug&&(ku?Jl.enable():Zl(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Bu().update(t.initialScope);const r=new e(t);(function(e){const t=ad().getStackTop();t.client=e,t.scope.setClient(e)})(r),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(r)}function _d(e,t,r=cu(e.bufferSize||30)){let n={};function i(i){const o=[];if(vu(i,(t,r)=>{const i=Cu(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=Sd(t,r);e.recordDroppedEvent("ratelimit_backoff",i,n)}else o.push(t)}),0===o.length)return au();const a=gu(i[0],o),s=t=>{vu(a,(r,n)=>{const i=Sd(r,n);e.recordDroppedEvent(t,Cu(n),i)})};return r.add(()=>t({body:bu(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&ku&&Jl.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=Su(n,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof nc)return ku&&Jl.error("Skipped sending event because buffer is full."),s("queue_overflow"),au();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>r.drain(e)}}function Sd(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function kd(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:ed})),version:ed}),e._metadata=i}const Ad=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Id=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Ed="InboundFilters",Fd=(e={})=>({name:Ed,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?[]:Ad],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Id],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)?(ku&&Jl.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Ic(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}`)),ku&&0===t.length&&Jl.error(`Could not extract message for event ${Ic(e)}`),t}(e).some(e=>Nl(e,t))}(e,t.ignoreErrors)?(ku&&Jl.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Ic(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const r=e.transaction;return!!r&&Nl(r,t)}(e,t.ignoreTransactions)?(ku&&Jl.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Ic(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const r=Td(e);return!!r&&Nl(r,t)}(e,t.denyUrls)?(ku&&Jl.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Ic(e)}.\nUrl: ${Td(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const r=Td(e);return!r||Nl(r,t)}(e,t.allowUrls)&&(ku&&Jl.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Ic(e)}.\nUrl: ${Td(e)}`),!0)}(t,o)?null:t}});function Td(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 ku&&Jl.error(`Cannot extract url for event ${Ic(e)}`),null}}let Od;md(Ed,Fd);const Pd="FunctionToString",Md=new WeakMap,Rd=()=>({name:Pd,setupOnce(){Od=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=sc(this),r=Md.has(zu())&&void 0!==t?t:this;return Od.apply(r,e)}}catch{}},setup(e){Md.set(e,!0)}});md(Pd,Rd);const Ld=Vl;let Nd=0;function jd(){return Nd>0}function Dd(e,t={},r){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(sc(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=>Dd(e,t));return e.apply(this,i)}catch(e){throw Nd++,setTimeout(()=>{Nd--}),function(...e){const t=ad();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])}(r=>{r.addEventProcessor(e=>(t.mechanism&&(Ec(e,void 0),Fc(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),function(e){ad().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}ac(n,e),oc(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}const zd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Bd(e,t){const r=Vd(e,t),n={type:t&&t.name,value:$d(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function Ud(e,t){return{exception:{values:[Bd(e,t)]}}}function Vd(e,t){const r=t.stacktrace||t.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(Hd.test(e.message))return 1}return 0}(t);try{return e(r,n)}catch{}return[]}const Hd=/Minified React error #\d+;/i;function $d(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Wd(e,t,r,n,i){let o;if(_l(t)&&t.error)return Ud(e,t.error);if(Sl(t)||function(e){return Cl(e,"DOMException")}(t)){const i=t;if("stack"in t)o=Ud(e,t);else{const t=i.name||(Sl(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=Gd(e,a,r,n),Ec(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return xl(t)?Ud(e,t):El(t)||Fl(t)?(o=function(e,t,r,n){const i=zu(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:Fl(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:qd(t,{isUnhandledRejection:n})}]},extra:{__serialized__:nu(t,o)}};if(r){const t=Vd(e,r);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,r,i),Fc(o,{synthetic:!0}),o):(o=Gd(e,t,r,n),Ec(o,`${t}`),Fc(o,{synthetic:!0}),o)}function Gd(e,t,r,n){const i={};if(n&&r){const n=Vd(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]})}if(Al(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 qd(e,{isUnhandledRejection:t}){const r=function(e,t=40){const r=Object.keys(lc(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Ml(r[0],t);for(let e=r.length;e>0;e--){const n=r.slice(0,e).join(", ");if(!(n.length>t))return e===r.length?n:Ml(n,t)}return""}(e),n=t?"promise rejection":"exception";return _l(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:Fl(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 Yd extends bd{constructor(e){kd(e,"browser",["browser"],Ld.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&Ld.document&&Ld.document.addEventListener("visibilitychange",()=>{"hidden"===Ld.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,r,n){const i=Wd(e,t,r&&r.syntheticException||void 0,n);return Fc(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),au(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return function(e,t,r="info",n,i){const o=Gd(e,t,n&&n.syntheticException||void 0,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),au(o)}(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(zd&&Jl.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:ec(n)}},o=function(e){return[{type:"user_report"},e]}(e);return gu(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(zd&&Jl.log("No outcomes to send"));if(!this._dsn)return void(zd&&Jl.log("No dsn provided, will not send outcomes"));zd&&Jl.log("Sending outcomes:",e);const t=function(e,t){return gu(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:fu(),discarded_events:e}]])}(e,this._options.tunnel&&ec(this._dsn));this._sendEnvelope(t)}}let Xd;function Kd(e,t=function(){if(Xd)return Xd;if(Bc(Ld.fetch))return Xd=Ld.fetch.bind(Ld);const e=Ld.document;let t=Ld.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){zd&&Jl.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Xd=t.bind(Ld)}()){let r=0,n=0;return _d(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 Xd=void 0,r-=o,n--,su(e)}})}function Zd(e){return _d(e,function(t){return new lu((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 Jd="?";function Qd(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 eh=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,th=/\((\S*)(?::(\d+))(?::(\d+))\)/,rh=[30,e=>{const t=eh.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=th.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,r]=ch(t[1]||Jd,t[2]);return Qd(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],nh=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ih=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,oh=[50,e=>{const t=nh.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ih.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]||Jd;return[r,e]=ch(r,e),Qd(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],ah=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,sh=[40,e=>{const t=ah.exec(e);return t?Qd(t[2],t[1]||Jd,+t[3],t[4]?+t[4]:void 0):void 0}],lh=gc(...[rh,oh,sh]),ch=(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]:Jd,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},uh=1024,dh="Breadcrumbs",hh=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:dh,setupOnce(){},setup(e){t.console&&function(e){const t="console";xc(t,e),Cc(t,Sc)}(function(e){return function(t){if(zu()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:hu(t.level),message:Rl(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${Rl(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}Du(r,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){xc("dom",e),Cc("dom",Nc)}(function(e,t){return function(r){if(zu()!==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>uh&&(zd&&Jl.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=uh),"string"==typeof o&&(o=[o]);try{const e=r.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;n=Gl(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!Wl.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){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}),Du(s,{event:r.event,name:r.name,global:r.global})}}(e,t.dom)),t.xhr&&function(e){xc("xhr",e),Cc("xhr",tu)}(function(e){return function(t){if(zu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[eu];if(!r||!n||!i)return;const{method:o,url:a,status_code:s,body:l}=i;Du({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";xc(t,e),Cc(t,Uc)}(function(e){return function(t){if(zu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){Du({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:r,endTimestamp:n})}else{const e=t.response;Du({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:r,endTimestamp:n})}}}(e)),t.history&&Zc(function(e){return function(t){if(zu()!==e)return;let r=t.from,n=t.to;const i=uu(Ld.location.href);let o=r?uu(r):void 0;const a=uu(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),Du({category:"navigation",data:{from:r,to:n}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){zu()===e&&Du({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:Ic(t)},{event:t})}}(e))}}};md(dh,hh);const fh="Dedupe",ph=()=>{let e;return{name:fh,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||!mh(e,t)||!gh(e,t))}(e,t)&&!function(e,t){const r=vh(t),n=vh(e);return!!(r&&n&&r.type===n.type&&r.value===n.value&&mh(e,t)&&gh(e,t))}(e,t))}(t,e))return zd&&Jl.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function gh(e,t){let r=yh(e),n=yh(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const t=n[e],i=r[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function mh(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 vh(e){return e.exception&&e.exception.values&&e.exception.values[0]}function yh(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}md(fh,ph);const bh="GlobalHandlers",wh=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:bh,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";xc(t,e),Cc(t,Wc)}(t=>{const{stackParser:r,attachStacktrace:n}=_h();if(zu()!==e||jd())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&kl(i)?function(e,t,r,n){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=_l(e)?e.message:e,a="Error";const s=o.match(i);return s&&(a=s[1],o=s[2]),xh({exception:{values:[{type:a,value:o}]}},t,r,n)}(i,o,a,s):xh(Wd(r,l||i,void 0,n,!1),o,a,s);c.level="error",ju(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),Ch("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";xc(t,e),Cc(t,qc)}(t=>{const{stackParser:r,attachStacktrace:n}=_h();if(zu()!==e||jd())return;const i=function(e){if(Il(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=Il(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):Wd(r,i,void 0,n,!0);o.level="error",ju(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),Ch("onunhandledrejection"))}}};function xh(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=kl(t)&&t.length>0?t:function(){try{return Wl.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function Ch(e){zd&&Jl.log(`Global Handler attached: ${e}`)}function _h(){const e=zu();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}md(bh,wh);const Sh="HttpContext",kh=()=>({name:Sh,setupOnce(){},preprocessEvent(e){if(!Ld.navigator&&!Ld.location&&!Ld.document)return;const t=e.request&&e.request.url||Ld.location&&Ld.location.href,{referrer:r}=Ld.document||{},{userAgent:n}=Ld.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}});md(Sh,kh);const Ah="LinkedErrors",Ih=(e={})=>{const t=e.limit||5,r=e.key||"cause";return{name:Ah,setupOnce(){},preprocessEvent(e,n,i){const o=i.getOptions();jl(Bd,o.stackParser,o.maxValueLength,r,t,e,n)}}};md(Ah,Ih);const Eh=["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"],Fh="TryCatch",Th=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:Fh,setupOnce(){t.setTimeout&&ic(Ld,"setTimeout",Oh),t.setInterval&&ic(Ld,"setInterval",Oh),t.requestAnimationFrame&&ic(Ld,"requestAnimationFrame",Ph),t.XMLHttpRequest&&"XMLHttpRequest"in Ld&&ic(XMLHttpRequest.prototype,"send",Mh);const e=t.eventTarget;e&&(Array.isArray(e)?e:Eh).forEach(Rh)}}};function Oh(e){return function(...t){const r=t[0];return t[0]=Dd(r,{mechanism:{data:{function:yc(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Ph(e){return function(t){return e.apply(this,[Dd(t,{mechanism:{data:{function:"requestAnimationFrame",handler:yc(e)},handled:!1,type:"instrument"}})])}}function Mh(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in r&&"function"==typeof r[e]&&ic(r,e,function(t){const r={mechanism:{data:{function:e,handler:yc(t)},handled:!1,type:"instrument"}},n=sc(t);return n&&(r.mechanism.data.handler=yc(n)),Dd(t,r)})}),e.apply(this,t)}}function Rh(e){const t=Ld,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(ic(r,"addEventListener",function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=Dd(n.handleEvent,{mechanism:{data:{function:"handleEvent",handler:yc(n),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[r,Dd(n,{mechanism:{data:{function:"addEventListener",handler:yc(n),target:e},handled:!1,type:"instrument"}}),i])}}),ic(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)}}))}md(Fh,Th);const Lh=[Fd(),Rd(),Th(),hh(),wh(),Ih(),ph(),kh()];function Nh(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...Lh]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),Ld.SENTRY_RELEASE&&Ld.SENTRY_RELEASE.id&&(e.release=Ld.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:mc(e.stackParser||lh),integrations:fd(e),transport:e.transport||(zc()?Kd:Zd)};Cd(Yd,t),e.autoSessionTracking&&function(){if(typeof Ld.document>"u")return void(zd&&Jl.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));Uu({ignoreDuration:!0}),$u(),Zc(({from:e,to:t})=>{void 0!==e&&e!==t&&(Uu({ignoreDuration:!0}),$u())})}()}var jh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zh(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}var Bh=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(Bh||{}),Uh=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(Uh||{});function Vh(e,t){return{...t,message:e}}const Hh=[{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}],$h={emoticons:Vh("Emoticons"),doodles:Vh("Doodles"),landmarks:Vh("Landmarks"),bubbles:Vh("Bubbles"),transportation:Vh("Transportation"),beach:Vh("Beach")},Wh={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},Gh=[1,8,15,20,25];var qh=(e=>(e.DARK="dark",e.LIGHT="light",e))(qh||{});const Yh=[{name:qh.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:qh.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 Xh=(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))(Xh||{});function Kh(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=Kh(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Zh(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Kh(e))&&(n&&(n+=" "),n+=t);return n}const Jh=p((r,n)=>{const{attr:i,size:o,title:a,className:s,color:l,style:c,children:u,viewBox:d,width:h,height:f,...p}=r;return t("svg",{"aria-hidden":!a,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:d||"0 0 24 24",...i,...p,className:Zh("svg-icon",s,Qh(o)),style:{color:l,...c},ref:n,height:f||"1em",width:h||"1em",children:[a&&e("title",{children:a}),u]})});function Qh(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 ef(t,r="",n){return i.memo(i.forwardRef((i,o)=>e(Jh,{"data-testid":`${r}Icon`,ref:o,viewBox:n,...i,size:i.size||"md",children:t})))}function tf(e,t=""){return ef(rf(e),t)}function rf(e){return(null==e?void 0:e.map)&&e.map((e,t)=>i.createElement(e.tag,{key:t,...e.attr},rf(e.child)))}const nf=ef(e("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),of=ef(e("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"),af=ef(e("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),sf=ef(e("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),lf=ef(e("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"),cf=ef(e("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"),uf=ef(e("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"),df=ef(e("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"),hf=ef(e("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"),ff=ef(e("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"),pf=ef(e("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"),gf=ef([e("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"),e("circle",{cx:"11",cy:"9",r:"1"},"1"),e("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"},"2")],"StyleOutlined"),mf=ef(e("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"),vf=ef(e("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"),yf=ef(e("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),bf={[Xh.FILTER]:{name:Vh("Applied Filters"),icon:nf},[Xh.RESIZE]:{name:Vh("Resized Image"),icon:of},[Xh.CROP]:{name:Vh("Cropped Image"),icon:af},[Xh.DRAW]:{name:Vh("Added Drawing"),icon:vf},[Xh.TEXT]:{name:Vh("Added Text"),icon:sf},[Xh.SHAPES]:{name:Vh("Added Shape"),icon:lf},[Xh.STICKERS]:{name:Vh("Added Sticker"),icon:cf},[Xh.FRAME]:{name:Vh("Added Frame"),icon:uf},[Xh.MERGE]:{name:Vh("Merged Objects"),icon:df},[Xh.CORNERS]:{name:Vh("Rounded Corner"),icon:hf},bgImage:{name:Vh("Replaced Background Image"),icon:ff},overlayImage:{name:Vh("Added Image"),icon:ff},initial:{name:Vh("Initial"),icon:yf},loadedState:{name:Vh("Loaded State"),icon:pf},objectStyle:{name:Vh("Changed Style"),icon:gf},deletedObject:{name:Vh("Deleted object"),icon:mf}},wf=Object.values(Xh).map(e=>({name:e,icon:bf[e].icon,action:e===Xh.MERGE?e=>{e.tools.merge.apply()}:e})),xf={filter:Vh("filter"),resize:Vh("resize"),crop:Vh("crop"),draw:Vh("draw"),text:Vh("text"),shapes:Vh("shapes"),stickers:Vh("stickers"),frame:Vh("frame"),corners:Vh("corners"),merge:Vh("merge")},Cf=ef(e("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"),_f="3.0.5",Sf={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:Bh.INLINE,forceOverlayModeOnMobile:!0,activeTheme:qh.LIGHT,themes:Yh,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:pf,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:Cf,label:Vh("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:Uh.BOTTOM,items:[...wf]},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:{...Wh},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:Gh,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:Hh},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}}]}}},kf=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 Af={exports:{}},If={},Ef={exports:{}},Ff={},Tf=i;
10
10
  /**
11
11
  * @license React
12
12
  * use-sync-external-store-shim.production.min.js
@@ -58,5 +58,5 @@ function VM(){return VM=Object.assign?Object.assign.bind():function(e){for(var t
58
58
  *
59
59
  * @license MIT
60
60
  */
61
- function eR(){return eR=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},eR.apply(this,arguments)}new Promise(()=>{});const tR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch{}const rR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,iR=n.forwardRef(function(e,t){let r,{onClick:i,relative:o,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,tR),{basename:p}=n.useContext($M),g=!1;if("string"==typeof u&&nR.test(u)&&(r=u,rR))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;qM()||TM(!1);let{basename:i,navigator:o}=n.useContext($M),{hash:a,pathname:s,search:l}=ZM(e,{relative:r}),c=s;return"/"!==i&&(c="/"===s?i:jM([i,s])),o.createHref({pathname:c,search:l,hash:a})}(u,{relative:o}),v=function(e,t){let{target:r,replace:i,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=KM(),u=YM(),d=ZM(e,{relative:s});return n.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!==i?i:OM(u)===OM(d);c(e,{replace:r,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l})}},[u,c,d,i,o,r,e,a,s,l])}(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:o,unstable_viewTransition:h});return n.createElement("a",eR({},f,{href:r||m,onClick:g||a?i:function(e){i&&i(e),e.defaultPrevented||v(e)},ref:t,target:c}))});var oR,aR;!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(oR||(oR={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(aR||(aR={}));const sR=ef(e("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"),lR=ef(e("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"),cR={opacity:0,y:50,scale:.3},uR={opacity:1,y:0,scale:1},dR={opacity:0,scale:.5};function hR(){const r=Am(e=>e.toasts);return e("div",{className:"pointer-events-none relative",children:e(_x,{initial:!1,children:r.map(r=>e("div",{className:Zh("fixed z-toast mx-auto p-20","bottom-center"===r.position?"bottom-0 left-0 right-0":"bottom-0 right-0"),children:t(mx.div,{initial:r.disableEnterAnimation?void 0:cR,animate:r.disableEnterAnimation?void 0:uR,exit:r.disableExitAnimation?void 0:dR,className:Zh("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 e;return null==(e=r.timer)?void 0:e.pause()},onPointerLeave:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},role:"alert","aria-live":"danger"===r.type?"assertive":"polite",children:["danger"===r.type&&e(sR,{className:"flex-shrink-0 text-danger",size:"md"}),"loading"===r.type&&e(nO,{size:"sm",className:"flex-shrink-0",isIndeterminate:!0}),"positive"===r.type&&e(lR,{className:"flex-shrink-0 text-positive",size:"md"}),e("div",{className:"mr-auto w-max overflow-hidden overflow-ellipsis","data-testid":"toast-message",children:e(GA,{value:r.message})}),r.action&&e(P_,{variant:"text",color:"primary",size:"sm",className:"flex-shrink-0",onFocus:()=>{var e;return null==(e=r.timer)?void 0:e.pause()},onBlur:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},onClick:()=>Im().remove(r.id),elementType:iR,to:r.action.action,children:e(GA,{value:r.action.label})}),"loading"!==r.type&&e($A,{onFocus:()=>{var e;return null==(e=r.timer)?void 0:e.pause()},onBlur:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},type:"button",className:"flex-shrink-0",onClick:()=>{Im().remove(r.id)},size:"sm",children:e(oI,{})})]})},r.id))})})}function fR(e){return Ux()?e.metaKey:e.ctrlKey}function pR(e){switch(e.key){case"z":fR(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?mm().history.redo():mm().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),mm().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),mm().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),mm().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),mm().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),mm().objects.delete();break;case"v":fR(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&&mm().import.addImageFromData(e.target.result)},void n.readAsDataURL(r)}}catch(e){console.error(e)}}())}}const gR=new Map,mR=new Map,vR={};async function*yR(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 bR(e);yield new i_(t,e.fullPath)}else e.isDirectory&&(yield*yR(e))}while(r.length>0)}function bR(e){return new Promise((t,r)=>e.file(t,r))}function wR(e){return null!=vR.dragTargetId?gR.get(vR.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 e of t)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await bR(e);yield new i_(t,e.fullPath)}else e.isDirectory&&(yield*yR(e))}(e.dataTransfer))}:void 0}function xR(){const r=pm(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible})??!0,n=pm(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.nav)?void 0:r.position})??"bottom",i=pm(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.menubar)?void 0:r.position})??"top",o=pm(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,s=u(null),l=u(null),{isModal:d,isMobile:h}=aI(),f=c(async e=>{var t,r;if(gm().activeTool||gm().dirty||"nativeFile"!==e.type)return;const n=await e.getData();mm().import.fileIsValid(n[0])&&((null==(r=null==(t=gm().config.tools)?void 0:t.import)?void 0:r.openDroppedImageAsBackground)?await mm().import.openBackgroundImage(n[0]):await mm().import.openUploadedFile(n[0]))},[]),{droppableProps:p}=function({id:e,disabled:t,ref:r,...n}){const i=u({dragOverElements:new Set,dropActivateTimer:void 0}).current,o=u(n);o.current=n,x(()=>(mR.set(e,{...mR.get(e),disabled:t,id:e,ref:r}),()=>{mR.delete(e)}),[e,o,t,r]);const a=e=>{var t;const n=o.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))},s=e=>{var t,r;const n=wR(e);n&&(null==(r=(t=o.current).onDragLeave)||r.call(t,n))};return{droppableProps:t?{}:{onDragOver:e=>{var t,r;e.preventDefault(),e.stopPropagation();const n=wR(e);n&&a(n)&&(null==(r=(t=o.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=wR(e);n&&a(n)&&(null==(r=(t=o.current).onDragEnter)||r.call(t,n),clearTimeout(i.dropActivateTimer),"function"==typeof o.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;n&&(null==(t=(e=o.current).onDropActivate)||t.call(e,n))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const t of i.dragOverElements)e.currentTarget.contains(t)||i.dragOverElements.delete(t);if(i.dragOverElements.size>0)return;const t=wR(e);t&&a(t)&&(s(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,r,n,l;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),s(e),clearTimeout(i.dropActivateTimer);const c=wR(e);c&&(null==(r=(t=o.current).onDragLeave)||r.call(t,c),a(c)&&(null==(l=(n=o.current).onDrop)||l.call(n,c)))}}}}({id:"pixie-root",ref:l,types:["nativeFile"],onDrop:f});a(()=>{var e,t;gm().fabric||(pm.setState({canvasRef:s}),__(s.current),null!=(e=gm().config.ui)&&e.defaultTool&&gm().setActiveTool(null==(t=gm().config.ui)?void 0:t.defaultTool,null),mm().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=gm().config).onLoad)||t.call(e,gm().editor)}));const r=S_(l,()=>{gm().setStageSize(k_(l.current))}),n=S_(s,()=>{gm().setCanvasSize(k_(s.current))});return()=>{r(),n()}},[l]);const g=Zh("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!d,"fixed inset-0 w-full h-full z-20":d,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":d&&!h});return t(Sx,{features:Ax,strict:!0,children:[d&&r&&!h&&o&&e($A,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{gm().editor.close()},children:e(oI,{})}),d&&r&&e(qk,{position:"fixed",disableInitialTransition:!0}),t(mx.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:r?"visible":"hidden",className:g,children:["top"===i&&e(fI,{}),"top"===n&&e(lM,{className:"pt-14"}),t("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...Dx(p,{onKeyDownCapture:pR}),ref:l,children:[e(gI,{}),e(qE,{ref:s})]}),e(ZO,{}),"bottom"===n&&e(lM,{}),"bottom"===i&&e(fI,{}),e(AM,{}),e(hR,{})]})]})}!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:[]};if(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);else if(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})}})}(),bl.enableBoundaryChecking(!1);const CR=class t{constructor(t){if(ll(this,"tools",{}),ll(this,"fabric",null),t.sentryDsn&&function(e){const t={...e};kd(t,"react"),Nh(t)}({dsn:t.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'),!t.selector)throw new Error('Pixie required "selector" option.');const r=document.querySelector(t.selector);r&&(r.classList.add("pi"),function(e){sm=e,lm=e}(r),this.setConfig(t),pm.setState({editor:this}),_(r).render(e(i.StrictMode,{children:e(xR,{})})))}get state(){return gm()}get defaultConfig(){return t.defaultConfig}open(e={}){return new Promise(async t=>{var r;Object.keys(e).length?await this.resetEditor({...Zp(e,{ui:{visible:!0},image:e.image||gm().config.image,state:e.state||gm().config.state,blankCanvasSize:e.blankCanvasSize||gm().config.blankCanvasSize})}):null!=(r=gm().config.ui)&&r.visible||gm().setConfig({ui:{visible:!0}}),t()})}close(){var e,t,r;null!=(e=gm().config.ui)&&e.visible&&(this.setConfig({ui:{visible:!1}}),null==(r=(t=gm().config).onClose)||r.call(t))}setConfig(e){gm().setConfig(e)}uploadAndAddImage(){return mm().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return mm().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return mm().import.uploadAndOpenStateFile()}newCanvas(e,t,r){return mm().canvas.openNew(e,t,r)}getState(e){return JSON.stringify(xm(e))}setState(e){return mm().import.loadState(e)}async setStateFromUrl(e){const t=await bm(e);return mm().import.loadState(t)}openTool(e){Cm(e)}applyChanges(){gm().applyChanges()}cancelChanges(){gm().cancelChanges()}async resetEditor(e){await ym(e),await mm().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&gm().togglePanel("history",!1),"history"===e&&gm().togglePanel("objects",!1),gm().togglePanel(e,t)}on(e,t){var r;null==(r=this.fabric)||r.on(e,t)}isDirty(){return gm().dirty}get(e){return this.tools[e]}notify(e){return Em(e)}static init(e){return new Promise(t=>{const r=e.onLoad;e.onLoad=e=>{null==r||r(e),t(e)},new this(e)})}};ll(CR,"defaultConfig",Sf),ll(CR,"version",_f);let _R=CR;function SR(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 kR="fm-pixie-editor";const AR=new class{constructor(){this._container=document.createElement("div"),this._instance=null,this._container.classList.add(kR),this._container.style.width="100%",this._container.style.height="85vh",this._container.style.minHeight="400px"}get className(){return`.${kR}`}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 _R.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=SR)}):console.warn("Pixie fabric instance is not available")}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 IR(e,t){if(!e)return t;if(!t)return e;return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function ER(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;const r=function(e){const t="undefined"!=typeof __webpack_public_path__?__webpack_public_path__:"";if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let r=IR(t,e||"");return!r||r.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(r)||(r="/"+r),r}(e),n=IR(r,t);return!n||n.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(n)?n:"/"+n}var FR,TR;!function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(FR||(FR={})),function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(TR||(TR={}));const OR=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob());function PR(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>{var e;return r(null!==(e=n.error)&&void 0!==e?e:new Error("Failed to convert blob to data URL"))},n.readAsDataURL(e)})}const MR=({visible:r,onClose:n,file:o,onSave:a,onSaveCopy:s})=>{var l;const{t:c}=Yn(),u=i.useRef(null),d=Oo(),h=Ha(),{options:f,actions:p}=po(),{i18n:g}=Yn(),{config:m}=f,{setCurrentMenuFile:v}=p,{getFileData:y,resolveFileForEditByUrl:b}=h,[w,x]=i.useState(!1),[C,_]=i.useState(null),[S,k]=i.useState(""),[A,I]=i.useState(!1),[E,F]=i.useState(!1),[T,O]=i.useState(null),P=i.useRef(!1),R=i.useRef(),L=i.useRef(),N=i.useRef("saveCopy"),j=i.useRef(void 0);R.current=a,L.current=s,i.useEffect(()=>{o&&!P.current&&(async()=>{if(j.current!==o)if("object"!=typeof o){j.current=o,x(!0);try{if(o.startsWith("data:"))O({thumbnail:o,saveWithoutFolder:!0});else{const e=await b(o);j.current===o&&O(e)}}catch(e){console.error("Failed to load file for editor:",e),j.current===o&&(j.current=null),null==n||n()}finally{x(!1)}}else O(o)})()},[o,n,b]);const D=i.useCallback(async e=>{try{if("string"==typeof e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await y(e.id,!0);if(!t)throw new Error(c("Error loading image"));return new Promise(e=>{const r=new FileReader;r.onload=()=>e(r.result),r.readAsDataURL(t)})}catch(e){throw console.error("Error getting the image data:",e),e}},[y,c]);i.useEffect(()=>{if(!C&&r&&T){let e=!1;const t=async()=>{var t,r,i;x(!0);try{const t=await D(T);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=Ta(T,"image/png");k(e.mimeType)}}catch(o){e||(d.error({id:"IMAGE_DOWNLOAD_FAILED",innerException:o,message:c("Error loading image"),placement:"bottomRight",data:{itemId:null!==(t=null==T?void 0:T.id)&&void 0!==t?t:void 0,itemName:null!==(r=null==T?void 0:T.name)&&void 0!==r?r:void 0,folderId:null!==(i=null==T?void 0:T.folderId)&&void 0!==i?i:null,thumbnail:null==T?void 0:T.thumbnail}}),null==n||n())}finally{x(!1)}};return t(),()=>{e=!0}}},[T,D,C,n,c,r]);const z=i.useCallback(async(e,t,r)=>{var n;let i=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 OR(n,Ar(r))}return OR(t,Ar(r))}(r,e),o=Ar(i.type||`image/${r}`);const a=null!==(n=null==m?void 0:m.compessorUrl)&&void 0!==n?n:null==m?void 0:m.compressorUrl;if(o.startsWith("image/"))try{const e=new File([i],t,{type:o}),r=await La(e,{maxSizeMB:null==m?void 0:m.compressMaxSize,maxWidthOrHeight:null==m?void 0:m.compressMaxWidthOrHeight,mimeType:o,fileName:t,libURL:a,enableCompression:Boolean(m)&&"image/gif"!==o});i=r,o=r.type}catch(e){console.warn("Image preparation failed, using original:",e)}return{blob:i,mimeType:o,thumbnailDataUrl:await PR(i)}},[m]),B=i.useCallback(async(e,t,r,n)=>{var i,o,a,s,l,u;const h="save"===n?R.current:L.current;if(!T||!h)return;const f="object"==typeof T&&null!==T?T:null;let p=null;try{x(!0);const{blob:o,mimeType:a,thumbnailDataUrl:s}=await z(e,t,r),l=Object.assign(Object.assign({},T),{thumbnail:s,size:o.size,date:(new Date).toISOString().split("T")[0],type:a,folderId:T.folderId||"",name:T.name||t,extension:T.extension||(null===(i=(T.name||t).split(".").pop())||void 0===i?void 0:i.toLowerCase())||""});p=l;const u={blob:o,mimeType:a,thumbnail:s,mode:n},d=await h(l,u);if(d)return x(!1),d;throw new Error(c("saveCopy"===n?"Failed to save image copy":"Failed to save changes"))}catch(e){console.error("Error saving:",e);const r=null!=p?p:f,i=e;if(!(null==i?void 0:i.notificationShown)){const i=No(e),h=null!==(a=null!==(o=Ro(null==i?void 0:i.code,c))&&void 0!==o?o:null==i?void 0:i.message)&&void 0!==a?a:c("saveCopy"===n?"Failed to save image copy":"Error saving image");d.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!==(l=null==r?void 0:r.name)&&void 0!==l?l:t,folderId:null!==(u=null==r?void 0:r.folderId)&&void 0!==u?u:null,thumbnail:null==r?void 0:r.thumbnail},innerException:e})}x(!1)}},[T,d,z,c]),U=i.useCallback(async e=>{var t;if(!AR.isLoaded()||!T)return void console.error("❌ Pixie instance or file is missing");N.current=e;const r=T.name||"edited-image",n=Ta(T,S);try{await(null===(t=AR.tools)||void 0===t?void 0:t.export.save(r.replace(/\.[^/.]+$/,""),n.pixieFormat,Oa.QUALITY))}catch(t){console.error("🎨 Error saving through the button:",t);try{const t=AR.canvas,i=t?t.toDataURL(n.mimeType):null;i&&await B(i,r,n.extension,e)}catch(e){console.error("🎨 Alternative method also did not work:",e)}}},[T,S,B]),V=i.useCallback(async()=>{var t;if(C&&r&&A&&!P.current)try{P.current=!0;const r=u.current;let i=0;for(;i<20&&(0===r.clientWidth||0===r.clientHeight);)await new Promise(e=>setTimeout(e,50)),i++;const o=(null==m?void 0:m.locale)?null==m?void 0:m.locale.replace("_","-"):"en",a=matchMedia(hr).matches?ur:cr,s=(null==m?void 0:m.theme)===dr?a:null==m?void 0:m.theme,l=((null==m?void 0:m.locale)||g.language||"en").split("-")[0].split("_")[0],c=(g.getResourceBundle(l,"translation")||{}).pixie||{},d=e=>e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),h={};Object.entries(c).forEach(([e,t])=>{const r=d(e);h[r]=t,h[e]=t});const f={[o]:h},p=Ta(T,S),v={selector:"#pixie-editor",baseUrl:ER((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:FR.TOP,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",align:"right",desktopOnly:!0,icon:()=>e(xe,{style:{fontSize:20}}),action:e=>{e.togglePanel("history")}},{type:"button",icon:()=>e(be,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:n}]},nav:{position:TR.TOP}},tools:{export:{defaultFormat:p.pixieFormat,defaultQuality:Oa.QUALITY,defaultName:(null===(t=null==T?void 0:T.name)||void 0===t?void 0:t.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{x(!0);return await B(e,t,r,N.current)}catch(e){throw console.error("🎨 PIXIE onSave ERROR:",e),x(!1),e}}};try{F(!1),await AR.show(v,u.current);const e=AR.canvas;e&&e.focus(),F(!0),x(!1)}catch(e){console.error("init pixie failed:",e)}}catch(e){console.error("Error initializing Pixie:",e),d.error({id:"EDITOR_INIT_FAILED",message:c("Error initializing editor"),placement:"bottomRight",innerException:e}),P.current=!1,null==n||n()}},[T,S,C,r,A,null==m?void 0:m.locale,null==m?void 0:m.theme,null==m?void 0:m.baseUrl,null==m?void 0:m.assetsUrl,n,B,d,g,c]);i.useEffect(()=>{r&&C&&A&&V()},[r,C,A,V]),i.useEffect(()=>{if(!r){try{AR.close()}catch(e){console.warn("Error closing Pixie:",e)}x(!1),_(null),k(""),P.current=!1,I(!1),F(!1)}return()=>{try{AR.close()}catch(e){console.warn("Error closing Pixie when unmounting:",e)}}},[r]);const H=Boolean(null==T?void 0:T.id)&&!1!==(null===(l=null==m?void 0:m.features)||void 0===l?void 0:l.enableUpdateFile);return e(G,{title:(null==T?void 0:T.name)?c("Editing: {{name}}",{name:T.name}):c("Editing image"),open:r,closeIcon:null,onCancel:n,afterOpenChange:e=>I(e),forceRender:!0,width:"100vw",style:{top:0,height:"100vh",maxWidth:"none",padding:10},styles:{body:{height:"85vh",padding:0}},footer:[e(M,{onClick:n,disabled:!A||w,children:c("Cancel")},"cancel"),e(M,{type:"primary",onClick:()=>U("saveCopy"),loading:w,children:c("Save as copy and choose")},"save-copy"),...H?[e(M,{type:"primary",onClick:()=>U("save"),loading:w,children:c("Save and choose")},"save")]:[]],maskClosable:!1,destroyOnHidden:!1,afterClose:()=>{v&&v("")},children:t("div",{ref:u,style:{position:"relative",width:"100%",height:"100%"},children:[r&&!E?e("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.45)",backdropFilter:"blur(1px)",pointerEvents:"all",zIndex:10},children:e("span",{style:{fontSize:14,color:"#555"},children:c("Loading editor...")})}):null,w&&E&&e(Qs,{style:{position:"absolute",top:0,background:"var(--colorBgLayout)",zIndex:100,opacity:.7}})]})})};var RR="uploadProgress",LR="uploadProgress__card",NR="uploadProgress__header",jR="uploadProgress__header-title",DR="uploadProgress__header-buttons",zR="uploadProgress__header-button",BR="uploadProgress__close-icon",UR="uploadProgress__body",VR="uploadProgress__common-error",HR="uploadProgress__common-error-row",$R="uploadProgress__common-error-hint",WR="uploadProgress__list-wrapper",GR="uploadProgress__status-icon",qR="uploadProgress__file-item",YR="uploadProgress__file-item--error",XR="uploadProgress__body--error",KR="uploadProgress__error-item",ZR="uploadProgress__error-message",JR="uploadProgress__error-hint",QR="uploadProgress__file-avatar",eL="uploadProgress__file-info",tL="uploadProgress__file-name",rL="uploadProgress__file-size",nL="uploadProgress__progress-bar",iL="uploadProgress__minimized",oL="uploadProgress__minimized-button",aL="uploadProgress__file-list";const{Text:sL}=T,lL=({visible:r,files:n,totalFiles:i,completedFiles:o,onClose:a,onMinimize:s,onInsert:l,minimized:c=!1})=>{var u;const{token:d}=k.useToken(),{t:h}=Yn();if(!r)return null;const f=t=>{switch(t){case"success":return e("div",{className:GR,children:e(Se,{style:{color:d.colorSuccess}})});case"error":return e(Ce,{style:{color:d.colorError}});default:return e(_e,{style:{color:"#1890ff"}})}},p=t=>"success"===t.status?[e(M,{type:"primary",size:"small",onClick:()=>l(t),children:h("Insert")},"insert")]:[];if(c)return e("div",{className:iL,children:e(M,{type:"primary",size:"small",onClick:s,className:oL,children:h("Upload progress",{completed:o,total:i})})});const g=n.filter(e=>"uploading"===e.status).length,m=n.filter(e=>"success"===e.status).length,v=n.filter(e=>"error"===e.status).length,y=n.filter(e=>"error"===e.status),b=y.length>1&&y.every(e=>{var t;return e.error&&e.error===(null===(t=y[0])||void 0===t?void 0:t.error)}),w=b?null===(u=y[0])||void 0===u?void 0:u.error:null;return e("div",{className:RR+" fm-upload-progress",children:t("div",{className:LR,children:[t("div",{className:NR,children:[e(sL,{strong:!0,className:jR,children:g>0?h("Uploading files",{completed:o,total:i}):m>0?h("Uploaded files",{success:m,total:i}):h("Upload error files",{errorCount:v})}),e("div",{className:DR,children:e(M,{type:"text",size:"small",icon:e(be,{className:BR}),onClick:a,className:zR})})]}),t("div",{className:`${UR} ${n.some(e=>"error"===e.status)?XR:""}`,children:[e("div",{className:WR,children:e(K,{className:aL,size:"small",dataSource:n,renderItem:r=>{const n="error"===r.status,i=n?(e=>{if(!e)return null;const t=e.toLowerCase();return t.includes("type")||t.includes("format")||t.includes("формат")||t.includes("тип")||t.includes("not allowed")||t.includes("дозволен")||t.includes("name")||t.includes("invalid")||t.includes("назва")||t.includes("неприпустим")||t.includes("allowed characters")?null:t.includes("large")||t.includes("size")||t.includes("розмір")||t.includes("размер")?h("upload_error_hint_size"):t.includes("exists")||t.includes("вже існує")||t.includes("уже существует")?h("upload_error_hint_exists"):null})(r.error):null;return e(K.Item,{className:`${qR} ${n?YR:""}`,actions:p(r),children:e(K.Item.Meta,{avatar:e(Z,{size:"small",icon:f(r.status),className:QR}),title:t("div",{className:eL,children:[e(sL,{ellipsis:!0,className:tL,children:r.name}),e(sL,{type:"secondary",className:rL,children:void 0!==r.size?ui(r.size):""})]}),description:"uploading"===r.status?e(q,{percent:r.progress,size:"small",status:"active",showInfo:!1,className:nL}):n?b?null:t("div",{className:KR,children:[e(sL,{type:"danger",className:ZR,children:r.error||h("Error")}),i&&e(sL,{type:"secondary",className:JR,children:i})]}):null})})}})}),w&&t("div",{className:VR,children:[t("div",{className:HR,children:[e(Ce,{style:{color:d.colorError,marginRight:8,flexShrink:0}}),e(sL,{type:"danger",children:w})]}),e(sL,{type:"secondary",className:$R,children:h("Applies to all {{count}} files",{count:y.length})})]})]})]})})},{Header:cL}=J,{Title:uL}=T,dL=({activeLibraryItem:r,selectedFolder:i,isTrashFolder:o,onClearTrash:a,files:s,loading:l,onRefresh:c,refreshDisabled:u,showRefresh:d=!1})=>{const{t:h}=Yn(),f=r===rr&&(null!=o?o:i===lr),[p,g]=n.useState(!1),m={[rr]:h("My files"),[nr]:h("GIF"),[ir]:h("Stock images"),[or]:h("Icons"),[ar]:h("AI image generation")};let v;return n.useEffect(()=>{const e=setTimeout(()=>{g(f&&s.length>0&&!l)},200);return()=>clearTimeout(e)},[f,s.length,l]),v=r===rr?f?h("Trash"):i:m[r],e(cL,{className:"actions-header",children:t("div",{className:"header-title-container",children:[e(uL,{level:5,className:"header-title",children:v}),p&&a&&e(M,{type:"default",onClick:a,className:"clear-trash-button","aria-label":h("Clear Trash"),children:h("Clear")}),r===rr&&d&&c&&e(P,{title:h("Refresh"),children:e(M,{type:"text",className:"folder-refresh-button",icon:e(Ei,{size:16}),onClick:c,disabled:u})})]})})};function hL(e,t){return!e||!t||e<=0||t<=0?1:e/t}const fL=1200;function pL({items:e,getId:t,getPreviewSrc:r,getAltText:n,getWidth:i,getHeight:a,layoutMode:s="masonry",minColumnWidth:l=240,estimatedItemHeight:c=240,gap:u=20,overscanPx:h=800,prefetchThresholdPx:f=1200,resolveColumnCount:p,virtualizationThreshold:g=40}){var m,v;const[y,b]=o({scrollTop:0,viewportHeight:800,viewportWidth:fL,scrollHeight:0}),w=d(()=>function(e){return{getId:e,buildSignature:(t,r)=>{var n,i;const o=r.getPreviewSrc(t)||"",a=r.getAltText(t),s=null===(n=r.getWidth)||void 0===n?void 0:n.call(r,t),l=null===(i=r.getHeight)||void 0===i?void 0:i.call(r,t);return[e(t),o,a,null!=s?s:"",null!=l?l:""].join("::")},buildRowModel:(e,t,r)=>{var n,i;const o=null===(n=t.getWidth)||void 0===n?void 0:n.call(t,e),a=null===(i=t.getHeight)||void 0===i?void 0:i.call(t,e);return{id:r.id,signature:r.signature,item:e,previewSrc:t.getPreviewSrc(e),altText:t.getAltText(e),width:o,height:a,aspectRatio:hL(o,a)}}}}(t),[t]),x=d(()=>({getPreviewSrc:r,getAltText:n,getWidth:i,getHeight:a}),[n,a,r,i]),C=d(()=>{const e=Math.max(1,y.viewportWidth||fL);return p?Math.max(1,p(e)):Math.max(1,Math.floor((e+u)/(l+u)))},[u,l,p,y.viewportWidth]),_=d(()=>{const e=Math.max(1,y.viewportWidth||fL);return Math.max(1,(e-u*Math.max(0,C-1))/C)},[C,u,y.viewportWidth]),S=d(()=>{const t=new Array(C).fill(0),r=[];e:for(let n=0;n<e.length;n+=1){const o=e[n],l=null==i?void 0:i(o),d=null==a?void 0:a(o),h=l&&d&&l>0&&d>0?l/d:void 0,f=h?_/h:c;if("grid"===s){const e=Math.floor(n/C)*(f+u),t=n%C*(_+u);r.push({index:n,top:e,left:t,width:_,height:f,bottom:e+f});continue e}let p=0;for(let e=1;e<t.length;e+=1)t[e]<t[p]&&(p=e);const g=t[p],m=p*(_+u);t[p]=g+f+u,r.push({index:n,top:g,left:m,width:_,height:f,bottom:g+f})}const n=0===r.length?0:"grid"===s?Math.max(...r.map(e=>e.bottom)):Math.max(0,...t.map(e=>e-u));return{positionedItems:r,containerHeight:n}},[C,_,c,u,a,i,e,s]),k=d(()=>e.length<=g?{renderStrategy:"full"}:{renderStrategy:"positioned",positioned:{layout:S.positionedItems,viewportTop:y.scrollTop,viewportBottom:y.scrollTop+y.viewportHeight,overscanPx:h,containerHeight:S.containerHeight}},[e.length,S.containerHeight,S.positionedItems,h,y.scrollTop,y.viewportHeight,g]),{rowModels:A,renderWindow:I}=Ns({items:e,context:x,adapter:w,options:k}),E=null!==(m=I.positionedItems)&&void 0!==m?m:A.map((e,t)=>{var r;return{row:e,layout:null!==(r=S.positionedItems[t])&&void 0!==r?r:{index:t,top:0,left:0,width:_,height:c,bottom:c}}}),F=null!==(v=I.containerHeight)&&void 0!==v?v:S.containerHeight,T=F>0&&y.scrollTop+y.viewportHeight>=F-f;return{rowModels:A,renderRows:I.rows,renderWindow:I,positionedItems:E,containerHeight:F,isNearEnd:T,viewportMetrics:y,handleViewportChange:e=>{b(t=>t.scrollTop===e.scrollTop&&t.viewportHeight===e.viewportHeight&&t.viewportWidth===e.viewportWidth&&t.scrollHeight===e.scrollHeight?t:e)}}}const gL=t=>{var r,{imageId:n,sourceUrl:i,shouldLoad:s=!0,loader:l,onLoad:c}=t,d=_s(t,["imageId","sourceUrl","shouldLoad","loader","onLoad"]);const[h,f]=o(()=>l.getSnapshot(n,i)),p=u(null);return a(()=>(f(l.getSnapshot(n,i)),l.subscribe(n,i,f)),[n,l,i]),a(()=>(l.setActive(n,i,s),()=>{l.setActive(n,i,!1),l.release(n)}),[n,l,s,i]),h.shouldLoad?e("img",Object.assign({},d,{ref:p,src:i,loading:null!==(r=d.loading)&&void 0!==r?r:"lazy",onLoad:e=>{l.markLoaded(n),null==c||c(e)},onError:e=>{var t;l.markError(n),null===(t=d.onError)||void 0===t||t.call(d,e)}})):null};var mL={gifTab:"gifTab",scrollableDiv:"scrollableDiv",gifSearchInput:"gifSearchInput",search:"search",searchResults:"searchResults",virtualCanvas:"virtualCanvas",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",searchOutputWrapper:"searchOutputWrapper",divider:"divider",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const vL=e=>{const t="undefined"!=typeof window?window.innerWidth:e;return t<=700?1:t<=1100?2:t<=1600?3:4},yL=e=>e.images.downsized.url,bL=({setImageGifList:n,imageGifList:i=[],currentReqGif:s,setCurrentReqGif:l,inputRef:d,customRequest:h})=>{const{t:f}=Yn(),{GifPlayIcon:p}=mo(),{options:g}=po(),{config:m}=g,v=as({maxConcurrent:6}),[y,b]=o(null),[w,x]=o(new Set),[C,_]=o(!1),[k,A]=o(!1),[I,T]=o(!1),[O]=E.useForm(),P=u(s),M=u(null),R=u(null),L=u(null),N=u(0),j=u(0),D=u(new Set);a(()=>{P.current=s},[s]),a(()=>{O.setFieldsValue({keywords:s.keywords})},[]);const z=null==m?void 0:m.handleProxyUrl,B=async e=>z?Promise.resolve(z(e)):e,U=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 B(e.images.downsized.url)}),fixed_width:e.images.fixed_width?Object.assign(Object.assign({},e.images.fixed_width),{url:await B(e.images.fixed_width.url)}):void 0,fixed_width_downsampled:e.images.fixed_width_downsampled?Object.assign(Object.assign({},e.images.fixed_width_downsampled),{url:await B(e.images.fixed_width_downsampled.url)}):void 0})}))),V=async function({query:e,page:t}){var r;const n=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null!==(r=null==m?void 0:m.REACT_APP_GIPHY_KEY)&&void 0!==r?r:"Nh77eBlPeMn1ed9MBAvL542NUGeNO26F"}&q=${encodeURIComponent(n)}&limit=50&offset=${t}&lang=en`,i=await fetch(await B(e));return{data:await i.json()}}catch(e){console.warn(e)}},{positionedItems:H,containerHeight:$,isNearEnd:W,viewportMetrics:G,handleViewportChange:q}=pL({items:i,getId:e=>e.id,getPreviewSrc:yL,getAltText:e=>e.title,getWidth:e=>e.images.downsized.width?Number(e.images.downsized.width):void 0,getHeight:e=>e.images.downsized.height?Number(e.images.downsized.height):void 0,layoutMode:"masonry",minColumnWidth:240,estimatedItemHeight:220,prefetchThresholdPx:320,resolveColumnCount:vL}),Y=gs(q,[i.length]),X=()=>{M.current&&(clearTimeout(M.current),M.current=null)},K=e=>!D.current.has(e)&&(D.current.add(e),!0),Z=e=>{D.current.delete(e)},J=c(async()=>{var e,t,r;const i=null===(e=P.current.keywords)||void 0===e?void 0:e.trim();if(!i||C||k||!I)return;const o=`gif:${i}:${j.current}`;if(!K(o))return;const a=N.current;A(!0);try{const e=await V({query:P.current,page:j.current});if(a!==N.current)return;const i=null!==(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.data)&&void 0!==r?r:[];if(!Array.isArray(i)||0===i.length)return void T(!1);const o=await U(i);if(a!==N.current)return;n(e=>{const t=new Set(e.map(e=>e.id)),r=o.filter(e=>!t.has(e.id));return r.length>0?[...e,...r]:e}),j.current+=i.length,T(50===i.length)}finally{Z(o),a===N.current&&A(!1)}},[I,C,k,n]),Q=async()=>{var e,t;X();const r=null===(e=P.current.keywords)||void 0===e?void 0:e.trim();if(!r)return R.current=null,L.current=null,N.current+=1,j.current=0,n([]),x(new Set),T(!1),void A(!1);if(L.current===r)return;if(R.current===r||C&&R.current===r)return;const i=`gif:${r}:0`;if(!K(i))return;const o=N.current+1;N.current=o,R.current=r,j.current=0,n([]),x(new Set),T(!1),A(!1),_(!0);try{const e=await V({query:P.current,page:0});if(o!==N.current)return;const i=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.data;if(Array.isArray(i)&&i.length>0){const e=await U(i);if(o!==N.current)return;n(e),j.current=i.length,T(50===i.length)}else n([]),T(!1);L.current=r}catch(e){T(!1)}finally{Z(i),R.current===r&&(R.current=null),_(!1)}};return a(()=>()=>{X()},[]),a(()=>{!C&&!k&&I&&i.length>0&&W&&J()},[I,i.length,W,J,C,k]),e("div",{className:mL.gifTab,children:e("div",{className:mL.searchOutputWrapper,children:t("div",{id:"scrollableDiv",ref:Y,className:mL.scrollableDiv,children:[t(E,{form:O,onValuesChange:e=>{if(void 0!==e.keywords){const t=Object.assign(Object.assign({},P.current),{keywords:e.keywords});l(t),P.current=t,X(),M.current=setTimeout(Q,800)}},className:i.length>0?mL.searchResults:mL.search,children:[e(E.Item,{name:"keywords",className:mL.gifSearchInput,children:e(F,{onPressEnter:()=>{Q()},allowClear:!0,placeholder:f("Search GIFs"),ref:d,spellCheck:"false",prefix:e(Ti,{size:16,strokeWidth:null==m?void 0:m.iconStrokeWidth,onClick:()=>{Q()}})})}),i.length>0&&!C&&e("div",{className:`ant-divider ${mL.divider}`,role:"separator"})]}),!i.length&&!C&&e(r,{children:s.keywords?e(xo,{}):t("div",{className:mL.resultsContainer,children:[e("div",{className:mL.videoIcon,children:e(p,{className:mL.playButton})}),e("h1",{className:mL.title,children:f("Over 350,000 live images")}),e("p",{className:mL.subtitle,children:f("Enter a search query and we'll find the perfect image for you")})]})}),!i.length&&C&&e(Qs,{}),i.length>0&&t(r,{children:[e("div",{className:mL.virtualCanvas,style:{height:$},children:H.map(({row:r,layout:n})=>{const i=r.item,o=w.has(i.id),a=yL(i),s=n.bottom>=G.scrollTop-240&&n.top<=G.scrollTop+G.viewportHeight+240;return t("div",{className:`${mL.listItem} ${o?mL.loaded:""}`,onClick:()=>(async(e,t)=>{var r;b(t),setTimeout(()=>{b(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"),h(e,i)})(i.images.downsized.url,i.id,i.title),style:{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height,minHeight:n.height,maxHeight:"none",marginBottom:0},children:[e(gL,{imageId:i.id,sourceUrl:a,shouldLoad:s,loader:v,className:y===i.id?mL.loadedImage:"",width:"100%",height:"100%",alt:i.title,decoding:"async",onLoad:()=>{x(e=>{if(e.has(i.id))return e;const t=new Set(e);return t.add(i.id),t})}}),e("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),y===i.id&&e(S,{className:mL.antSpin})]},i.id)})}),k&&e(Qs,{})]})]})})})};var wL={stockTab:"stockTab",stockSearchInput:"stockSearchInput",searchOutputWrapper:"searchOutputWrapper",divider:"divider",search:"search",searchResults:"searchResults",virtualCanvas:"virtualCanvas",scrollableDiv:"scrollableDiv",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 xL=e=>{const t="undefined"!=typeof window?window.innerWidth:e;return t<=650?1:t<=1e3?2:t<=1450?3:4},CL=(e,t)=>{const r=new URL(e);return r.searchParams.set("w",t.toString()),r.toString()},_L=({imageStockList:n,setImageStockList:i,currentReq:s,setCurrentReq:l,inputRef:d,customRequest:h})=>{var f,p;const{t:g}=Yn(),{StockBigIcon:m,MixedViewIcon:v,LandscapeViewIcon:y,PortraitViewIcon:b,SquareViewIcon:w}=mo(),{options:x}=po(),{config:C}=x,_=as({maxConcurrent:6}),[k,A]=o(!1),[I,T]=o(!1),[O,M]=o(!1),[R,L]=o(null),[N,j]=o(new Set),[D]=E.useForm(),B=null==C?void 0:C.handleProxyUrl,V=null!==(f=null==C?void 0:C.UNSPLASH_KEY)&&void 0!==f?f:"HX2_qqq3F3ljmtYtfmb9P6h0dn2u9mnnOl36IdV8el0",H=(null===(p=null==C?void 0:C.locale)||void 0===p?void 0:p.slice(0,2))||"ru",$=u(s),W=u(null),G=u(null),q=u(0),Y=u(1),X=u(new Set),K=async e=>B?Promise.resolve(B(e)):e,Z=()=>{W.current&&(clearTimeout(W.current),W.current=null)},J=e=>!X.current.has(e)&&(X.current.add(e),!0),ee=e=>{X.current.delete(e)},te=async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{urls:{raw:await K(CL(e.urls.raw,1200)),small:await K(CL(e.urls.raw,540))}})));a(()=>{$.current=s},[s]),a(()=>{0===n.length&&D.setFieldsValue({color:"",orientation:""})},[n,D]),a(()=>{D.setFieldsValue({keywords:s.keywords,color:s.color,orientation:s.orientation})},[]);const re=async function({query:e,page:t}){const r=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{let n=`https://api.unsplash.com/search/photos?client_id=${V}&lang=${H}&per_page=30&query=${encodeURIComponent(r)}&page=${t}`;""!==e.color&&(n+=`&color=${e.color}`),""!==e.orientation&&(n+=`&orientation=${e.orientation}`);const i=await fetch(await K(n));return{data:await i.json()}}catch(e){console.warn(e)}},{positionedItems:ne,containerHeight:ie,isNearEnd:oe,viewportMetrics:ae,handleViewportChange:se}=pL({items:n,getId:e=>e.id,getPreviewSrc:e=>e.urls.small,getAltText:e=>e.description||e.user.name,getWidth:e=>e.width,getHeight:e=>e.height,layoutMode:"masonry",minColumnWidth:240,estimatedItemHeight:220,prefetchThresholdPx:320,resolveColumnCount:xL}),le=gs(se,[n.length]),ce=c(async()=>{var e,t;if(k||I||!O||!$.current.keywords.trim())return;const r=q.current,n=Y.current,o=`stock:${`${$.current.keywords.trim()}|${$.current.color}|${$.current.orientation}`}:${n}`;if(J(o)){T(!0);try{const o=await re({query:$.current,page:n});if(r!==q.current)return;const a=null!==(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.results)&&void 0!==t?t:[];if(0===a.length)return void M(!1);const s=await te(a);if(r!==q.current)return;i(e=>{const t=new Set(e.map(e=>e.id)),r=s.filter(e=>!t.has(e.id));return r.length>0?[...e,...r]:e}),Y.current=n+1,M(30===a.length)}finally{ee(o),r===q.current&&T(!1)}}},[O,k,I,i]),ue=async()=>{var e,t;Z();const r=`${$.current.keywords.trim()}|${$.current.color}|${$.current.orientation}`;if(!$.current.keywords.trim())return void(G.current=null);if(G.current===r)return;const n=`stock:${r}:1`;if(!J(n))return;const o=q.current+1;q.current=o,A(!0),T(!1),M(!1),Y.current=1,i([]),j(new Set);try{const n=await re({query:$.current,page:1});if(o!==q.current)return;const a=null!==(t=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.results)&&void 0!==t?t:[];if(a.length>0){const e=await te(a);if(o!==q.current)return;i(e),Y.current=2,M(30===a.length)}else M(!1);G.current=r}finally{ee(n),A(!1)}};a(()=>()=>{Z()},[]),a(()=>{!k&&!I&&O&&n.length>0&&oe&&ce()},[O,n.length,oe,ce,k,I]);const de=async(e,t,r,n)=>{var i;!async function(e){try{const t=`${e}${e.includes("?")?"&":"?"}client_id=${V}`,r=await K(t),n=await fetch(r);return{data:await n.json()}}catch(e){console.warn(e)}}(t.download_location),L(r),setTimeout(()=>L(null),2e3);const o=e.raw,a=o.split("?")[0].split("#")[0].split("/");let s=a[a.length-1]||"uploaded-file";s.includes(".")&&(null===(i=s.split(".").pop())||void 0===i?void 0:i.length)&&s.split(".").pop().length<=5||(s+=".jpg"),h(o,s)};return e("div",{className:wL.stockTab,children:e("div",{className:wL.searchOutputWrapper,children:t("div",{className:wL.scrollableDiv,id:"scrollableDiv",ref:le,children:[t(E,{form:D,initialValues:vr,onValuesChange:(e,t)=>{const r=Object.assign(Object.assign({},vr),t);l(r),$.current=r,Z(),""!==r.keywords?W.current=setTimeout(ue,800):(G.current=null,q.current+=1,Y.current=1,i([]),j(new Set),M(!1),T(!1),l(Object.assign({},vr)),$.current=vr,D.resetFields())},className:n.length>0?wL.searchResults:wL.search,children:[t(U,{gutter:24,children:[e(z,{span:n.length>0?void 0:24,children:e(E.Item,{name:"keywords",className:wL.stockSearchInput,children:e(F,{allowClear:!0,placeholder:g("Search image"),ref:d,spellCheck:"false",prefix:e(Ti,{size:16,strokeWidth:null==C?void 0:C.iconStrokeWidth})})})}),!!n.length&&t(r,{children:[e(z,{children:e(E.Item,{name:"orientation",children:t(Q.Group,{onChange:e=>l(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[e(P,{title:g("All"),placement:"top",children:e(Q.Button,{value:"",children:e(v,{})})}),e(P,{title:g("Landscape"),placement:"top",children:e(Q.Button,{value:"landscape",children:e(y,{})})}),e(P,{title:g("Portrait"),placement:"top",children:e(Q.Button,{value:"portrait",children:e(b,{})})}),e(P,{title:g("Squarish"),placement:"top",children:e(Q.Button,{value:"squarish",children:e(w,{})})})]})})}),e(z,{children:e(E.Item,{name:"color",children:t(Q.Group,{className:wL.stockColorFilter,onChange:e=>l(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[e(P,{title:g("All"),placement:"top",children:e(Q.Button,{className:wL.allColors,value:"",children:"All"})}),e(P,{title:g("Black"),placement:"top",children:e(Q.Button,{className:wL.blackColor,value:"black",children:"B"})}),e(P,{title:g("Black and White"),placement:"top",children:e(Q.Button,{className:wL.bwColor,value:"black_and_white",children:"B&W"})}),e(P,{title:g("White"),placement:"top",children:e(Q.Button,{className:wL.whiteColor,value:"white",children:"W"})}),e(P,{title:g("Orange"),placement:"top",children:e(Q.Button,{className:wL.orangeColor,value:"orange",children:"O"})}),e(P,{title:g("Red"),placement:"top",children:e(Q.Button,{className:wL.redColor,value:"red",children:"R"})}),e(P,{title:g("Purple"),placement:"top",children:e(Q.Button,{className:wL.purpleColor,value:"purple",children:"P"})}),e(P,{title:g("Magenta"),placement:"top",children:e(Q.Button,{className:wL.magentaColor,value:"magenta",children:"M"})}),e(P,{title:g("Green"),placement:"top",children:e(Q.Button,{className:wL.greenColor,value:"green",children:"G"})}),e(P,{title:g("Teal"),placement:"top",children:e(Q.Button,{className:wL.tealColor,value:"teal",children:"T"})}),e(P,{title:g("Blue"),placement:"top",children:e(Q.Button,{className:wL.blueColor,value:"blue",children:"B"})})]})})})]})]}),n.length>0&&!k&&e("div",{className:`ant-divider ${wL.divider}`,role:"separator"})]}),!n.length&&!k&&e(r,{children:s.keywords?e(xo,{}):t("div",{className:wL.resultsContainer,children:[e("div",{className:wL.videoIcon,children:e(m,{className:wL.playButton})}),e("h1",{className:wL.title,children:g("Millions of free stock images")}),e("p",{className:wL.subtitle,children:g("Enter a search query and we'll find the perfect image for you")})]})}),!n.length&&k&&e(Qs,{}),n.length>0&&t(r,{children:[e("div",{className:wL.virtualCanvas,style:{height:ie},children:ne.map(({row:r,layout:n})=>{const i=r.item,o=N.has(i.id),a=n.bottom>=ae.scrollTop-240&&n.top<=ae.scrollTop+ae.viewportHeight+240;return t("div",{className:`${wL.listItem} ${o?wL.loaded:""}`,onClick:()=>de(i.urls,i.links,i.id,i.description),style:{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height,minHeight:n.height,maxHeight:"none",marginBottom:0},children:[e(gL,{imageId:i.id,sourceUrl:i.urls.small,shouldLoad:a,loader:_,className:R===i.id?wL.loadedImage:"",width:"100%",height:"100%",alt:i.description,decoding:"async",onLoad:()=>{j(e=>{if(e.has(i.id))return e;const t=new Set(e);return t.add(i.id),t})}}),t("p",{className:wL.creatorInfo,onClick:e=>e.stopPropagation(),children:[g("Photo by")," ",e("a",{target:"_blank",href:`${i.user.links.html}?utm_source=${null==C?void 0:C.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:i.user.name})," ",g("on")," ",e("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==C?void 0:C.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),R===i.id&&e(S,{className:wL.antSpin})]},i.id)})}),I&&e(Qs,{})]})]})})})},SL=()=>{const{options:e}=po(),t=e.config;return c((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){console.error("Ошибка при вызове GTM:",e)}};t?setTimeout(r,t):r()})(e,r)},[null==t?void 0:t.pushToGTM])};var kL="slideshowContainer",AL="slideshowImage";const IL=({images:t,transitionDuration:r=1e3,frameHeight:n})=>{const[i,s]=o([]),[l,c]=o(n);a(()=>{const e=()=>{if("undefined"==typeof window)return void c(n);const e=window.innerHeight,t=Math.max(e-260,130);if("number"==typeof n){const e=Math.min(n,t);c(e)}else c(t)};if(e(),"undefined"!=typeof window)return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n]);const u=()=>{s(e=>e.map((t,r)=>r===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return a(()=>{if(t.length>0){const e=t[t.length-1];s(t=>[...t,{src:e,opacity:0}]),setTimeout(u,1e3)}else s([])},[t]),e("div",{className:kL,style:{height:l,minHeight:130},children:i.map((t,n)=>e("img",{src:`data:image/jpeg;base64, ${t.src}`,alt:`Slide ${n+1}`,className:AL,style:{opacity:t.opacity,transition:`opacity ${r}ms linear`,display:"block"}},n))})},EL=t=>{var{className:r,style:n,color:i,text:o,bordered:a}=t,s=_s(t,["className","style","color","text","bordered"]);const l=o||"";return e(ee,Object.assign({style:n,color:i,bordered:a,className:r},s,{children:l}))},FL=({text:r,counter:n,limits:i,wrapperStyles:o})=>{const{t:a}=Yn(),{options:s}=po(),l=s.config,{token:c}=k.useToken(),u=+i>0,d=!u||n<+i,h=(null==l?void 0:l.billingPageUrl)||"/billing",f=n+" "+a("of")+" "+(u?i:"∞")+" "+(r||a("tests",{count:i}))+" "+a("was used",{count:n});return t("div",{className:"limits-couter-wrapper",style:o,children:[e(EL,{bordered:!1,text:f,className:"limit-counter",style:{color:d?c.colorText:"white"},color:d?c.colorFillSecondary:"rgb(255, 77, 79)"}),u&&e("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(h),children:a("Need more?")})]})};var TL={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 OL=f(({className:t,onClick:r})=>e("div",{className:`${TL.arrow} ${TL.arrowNext} ${t||""}`,onClick:r,children:e(M,{className:`${TL.arrowBtn} ${TL.arrowBtnNext}`,size:"large",icon:e(ke,{})})}));OL.displayName="SampleNextArrow";const PL=f(({className:t,onClick:r})=>e("div",{className:`${TL.arrow} ${TL.arrowPrev} ${t||""}`,onClick:r,children:e(M,{className:`${TL.arrowBtn} ${TL.arrowBtnPrev}`,size:"large",icon:e(Ae,{})})}));PL.displayName="SamplePrevArrow";const ML=({customRequest:r,inputAiRef:n,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:h,setAiImageRequest:f,imageAiList:p,setImageAiList:g,isLoadingAi:m,setIsLoadingAi:v})=>{const{t:y}=Yn(),{AiIcon_2:b}=mo(),w=i.useRef(null),[x,C]=o("auto"),{aiImageCounter:_,currentAiImgLimits:S,loadingDuringGeneration:k,requestStatus:A,handleGenerate:I,convertBase64ToFile:T,isShiftPressed:O,setIsShiftPressed:P,limitsInPlugin:R}=function({setFrameHeight:e,customRequest:t,aiTabRef:r,isImageUploaded:n,setIsImageUploaded:i,aiImageRequest:s,imageAiList:l,setImageAiList:h,isLoadingAi:f,setIsLoadingAi:p}){const{t:g}=Yn(),{options:m}=po(),v=m.config,y=Oo(),b=SL(),{messages:w}=m.config,[x,C]=o([]),[_,S]=o(0),[k,A]=o(null),[I,E]=o(!1),[F,T]=o(g("Evaluating the task")),[O,P]=o(!1),M=u(new Set),R=u(new Set),L=u(new Set);a(()=>{C(w)},[w]),a(()=>{l.length||k||(C([]),M.current.clear(),R.current.clear(),L.current.clear(),D.current=-1)},[l,k]);const N=d(()=>v&&"function"==typeof(null==v?void 0:v.sendAIImageRequest)?null==v?void 0:v.sendAIImageRequest:()=>Promise.resolve({}),[v]),j=c(e=>{const t=`${k}-${e.progress}-${JSON.stringify(e.images||e.data)}`;if(!L.current.has(t))if(L.current.add(t),"error"!==e.status&&"Canceled"!==e.status){if(e.images){if(T(String(e.status)),100===e.progress){p(!1),h(e.images);const t=k,r=Array.isArray(e.images)?e.images:[];r.length>0&&t&&!M.current.has(t)&&(M.current.add(t),y.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:g("Images generated successfully"),placement:"bottomRight",data:{request:s,taskId:t,images:r}})),A(null),P(!1)}}else if(e.data&&(h([String(e.data)]),100===e.progress)){p(!1);const t=k,r=e.data?[String(e.data)]:[];r.length>0&&t&&!M.current.has(t)&&(M.current.add(t),y.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:g("Images generated successfully"),placement:"bottomRight",data:{request:s,taskId:t,images:r}})),A(null),P(!1)}}else p(!1),P(!1),k&&!R.current.has(k)&&(R.current.add(k),y.error({id:"AI_RESPONSE_INVALID",message:g("Something went wrong, please try again"),placement:"bottomRight",description:String(k)||void 0,data:{requestId:k,request:s,response:e},innerException:e}))},[s,h,T,g,p,k,y,P]),D=u(-1);a(()=>{if(x.length>0){const e=x.length-1;e>D.current&&(D.current=e,j(x[e]))}},[j,x]);const z=d(()=>{if(v&&"function"==typeof(null==v?void 0:v.sseQuery)){const e=null==v?void 0:v.sseQuery;return t=>e(t)}return e=>{}},[v]),B=d(()=>v&&"object"==typeof(null==v?void 0:v.handleLimitUsageEmitter)?null==v?void 0:v.handleLimitUsageEmitter:{fire:()=>{}},[v]),U=null==v?void 0:v.elementId,{projectId:V}=v,{limits:H}=(null==v?void 0:v.limits)?v:{limits:{ai_img_limit:0}},{ai_img_limit:$}=H,W=$>0&&_>=$,G=!(!(null==v?void 0:v.limits)||!v.counters)&&fr,q=c(()=>{B.fire({name:"AiImgCount",count:_+1})},[B,_]),Y=d(()=>!W&&!G,[W,G,_,$]),X=c(async()=>{T(g("Evaluating the task")),""===s||f||(p(!0),P(!0),h([]),C([]),b({event:"submit_form",action:"ai_image_generation",entity_id:U,project_id:V}),N({body:{project_id:V,request:"create-image",connection:"midjourney",message:s}}).then(e=>{var t,r,n,i,o;const{data:a,error:l}=e||{};if(l)throw l;const c=a;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 u=(null==c?void 0:c.task)||(null===(r=null==c?void 0:c.data)||void 0===r?void 0:r.task),d=null!==(i=null!==(n=null==u?void 0:u.id)&&void 0!==n?n:k)&&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==u?void 0:u.id)&&(T(u.message),A(u.id)),(null==c?void 0:c.message)&&y.success({id:"AI_IMAGE_GENERATION_STARTED",message:c.message,placement:"bottomRight",data:{request:s,taskId:d,response:null==c?void 0:c.data}}),z({task_id:null==u?void 0:u.id,entity_id:U})):(p(!1),P(!1),d&&!R.current.has(d)&&(R.current.add(d),y.error({id:"AI_IMAGE_GENERATION_FAILED",message:(null==c?void 0:c.message)||g("Something went wrong, please try again"),placement:"bottomRight",description:s,data:{request:s,taskId:d,response:c},innerException:c})))}).catch(e=>{p(!1),P(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&k&&!R.current.has(k)&&(R.current.add(k),null==y||y.error({id:"AI_IMAGE_GENERATION_FAILED",message:g("Something went wrong, please try again"),placement:"bottomRight",description:s,innerException:e,data:{request:s,taskId:k,response:null==t?void 0:t.data,error:No(null==t?void 0:t.error)}})),t}))},[s,f,p,P,h,b,U,V,N,y,z,g,k]),K=c(()=>{Y&&X()},[Y,G,S,q,X,y,g]);a(()=>{},[v,G]);const Z=c(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 e=0;e<s.length;e++)l[e]=s.charCodeAt(e);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){console.error("FM AI: customRequest error",e)}finally{i(!1)}})()},[n,i,t]);return a(()=>{(f||l.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,l.length,f,e]),{aiImageCounter:_,setAiImageCounter:S,currentAiImgLimits:$,isFieldsDisabled:W,canGenerateImage:Y,aiImageRequest:s,imageAiList:l,setImageAiList:h,isLoadingAi:f,setIsLoadingAi:p,loadingDuringGeneration:O,setLoadingDuringGeneration:P,requestStatus:F,setRequestStatus:T,handleGenerate:K,handleLimitAiImgCount:q,convertBase64ToFile:Z,isShiftPressed:I,setIsShiftPressed:E,currentReqId:k,setCurrentReqId:A,limitsInPlugin:G}}({setFrameHeight:C,customRequest:r,aiTabRef:w,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:h,imageAiList:p,setImageAiList:g,isLoadingAi:m,setIsLoadingAi:v});a(()=>{},[s]);const[L,N]=o(!1),j=c(()=>N(!0),[]),D=c(()=>N(!1),[]),B=c(e=>f(e.target.value),[f]),V=c(e=>{"Shift"===e.key?P(!0):"Enter"!==e.key||O||(e.preventDefault(),I())},[O,I,P]),H=c(e=>{"Shift"===e.key&&P(!1)},[P]);return t("div",{className:TL.imageAi,ref:w,children:[R&&e(FL,{text:"images",counter:_,limits:S,wrapperStyles:{marginTop:-25}}),e(U,{gutter:24,className:TL.row,children:t(z,{span:24,children:[e(E.Item,{children:t("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${TL.inputAffixWrapper}${L?" ant-input-affix-wrapper-focused":""}`,children:[e(F.TextArea,{ref:n,onKeyDown:V,onKeyUp:H,onFocus:j,onBlur:D,autoSize:!0,allowClear:!0,className:`${TL.textAreaInputHybrid} ${TL.textarea}`,placeholder:y("Generate image"),value:h,onChange:B,spellCheck:"false"}),e("span",{className:`ant-input-suffix ${TL.inputSuffix}`,children:m||k?e(se,{className:`${TL.inputIcon} input-icon`,spin:!0}):e(b,{className:`${TL.inputIcon} input-icon`,onClick:I})})]})}),t("div",{className:TL.imageAiExample,children:[e("span",{children:y("For example:")})," ",y("A beautiful image of a sunset over a calm ocean.")]})]})}),(m||p.length>0)&&t(te,{dotPosition:"top",arrows:!0,nextArrow:e(OL,{}),prevArrow:e(PL,{}),className:TL.carousel,infinite:!1,children:[m&&!p.length&&e("div",{className:TL.loading,children:t("div",{className:"spin",children:[e(se,{style:{fontSize:48},spin:!0}),e("p",{className:"status",children:A})]})}),p.length>0&&p.map((r,n)=>t("div",{className:TL.imageItem,children:[e(IL,{images:p,frameHeight:x}),e("div",{className:"buttons",children:p.length>0&&!m&&e(M,{onClick:()=>T(`data:image/jpeg;base64, ${r}`),loading:s,icon:e(Ie,{}),children:y("Use this variant")})})]},n))]})]})};var RL={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",iconsGridLoadingMore:"iconsGridLoadingMore",iconsGridVirtualCanvas:"iconsGridVirtualCanvas",iconsGridItem:"iconsGridItem",iconsGridItemThumbnail:"iconsGridItemThumbnail",iconsGridItemSvg:"iconsGridItemSvg",iconsGridItemImg:"iconsGridItemImg",iconsGridItemName:"iconsGridItemName",iconsGridItemSelected:"iconsGridItemSelected",iconsGridLoading:"iconsGridLoading",iconsControlsBackButton:"iconsControlsBackButton",iconsGridCheckbox:"iconsGridCheckbox",iconsGridShowCheckboxes:"iconsGridShowCheckboxes",iconsHeaderContainer:"iconsHeaderContainer",iconsHeaderContainerLeft:"iconsHeaderContainerLeft",copyToFolderModalBody:"copyToFolderModalBody",copyToFolderModalLoadingOverlay:"copyToFolderModalLoadingOverlay"};const LL=[{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"}],NL=({query:r,onQueryChange:n,onSubmit:i,styleFilter:o,onStyleChange:a,hasResults:s=!1,inputRef:l})=>{const{t:c}=Yn(),{options:u}=po(),{config:d}=u,h=r.length>0&&s;return t("div",{className:RL.iconsSearchFormCenteredContainer,children:[t(E,{layout:"inline",onFinish:i,className:h?RL.iconsSearchResults:RL.iconsSearchFormCentered,children:[e(E.Item,{className:RL.iconsSearchFormInput,children:e(F,{ref:l,className:RL.iconsSearchFormInputInput,allowClear:!0,prefix:e(Ti,{size:16,strokeWidth:null==d?void 0:d.iconStrokeWidth,onClick:i}),placeholder:c("Search icons"),value:r,onChange:e=>n(e.target.value),onKeyDown:e=>"Space"===e.code&&i(),onPressEnter:i,spellCheck:"false"})}),h&&e(E.Item,{className:RL.iconsSearchFormStyleItem,children:e(O,{allowClear:!0,placeholder:c("Style"),value:null!=o?o:void 0,onChange:e=>a(null!=e?e:null),className:RL.iconsSearchFormSelect,options:LL.map(e=>({label:c(e.label),value:e.value}))})})]}),h&&e("div",{className:`ant-divider ${RL.iconsSearchDivider}`,role:"separator"})]})},jL=n=>{const{t:i}=Yn(),{mode:o,colorHex:a,setColorHex:s,colorHex2:l,setColorHex2:c,colorHex3:u,setColorHex3:d,sizePx:h,setSizePx:f,strokeWidth:p,setStrokeWidth:g,showSecondColor:m,showThirdColor:v,onBack:y,styleFilter:b}=n;return t("div",{className:RL.iconsControls,children:[e("div",{className:RL.iconsControlsControls,children:"family"===o&&t(r,{children:[t("div",{className:RL.iconsControlsStrokeWidth,children:[e("span",{children:i("Size")}),e(re,{min:20,max:200,value:h,formatter:e=>`${e}px`,parser:e=>e?e.replace("px",""):"",onChange:e=>f("number"==typeof e?e:50)})]}),t("div",{className:RL.iconsControlsStrokeWidth,children:[e("span",{children:i("Stroke width")}),e(re,{min:.3,max:3,step:.1,value:"number"==typeof p?p:1,formatter:e=>`${e}px`,parser:e=>e?e.replace("px",""):"",onChange:e=>g("number"==typeof e?e:1)})]}),"gradient"===b?e(R,{size:8,children:e(ne,{defaultValue:[{color:a||"#108ee9",percent:0},{color:l||"#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]&&s(t[0]),t[1]&&c(t[1])}catch(e){console.warn("ColorPicker gradient parsing error",e)}},size:"small"})}):t(r,{children:[t("div",{className:RL.iconsControlElement,children:[e("span",{children:i("Color1")}),e(ne,{value:a,format:"hex",disabledAlpha:!0,onChange:(e,t)=>s(t),size:"middle"})]}),m&&t("div",{className:RL.iconsControlElement,children:[e("span",{children:i("Color2")}),e(ne,{value:l,format:"hex",disabledAlpha:!0,onChange:(e,t)=>c(t),size:"middle"})]}),v&&t("div",{className:RL.iconsControlElement,children:[e("span",{children:i("Color3")}),e(ne,{value:u,format:"hex",disabledAlpha:!0,onChange:(e,t)=>d(t),size:"middle"})]})]})]})}),e("div",{className:RL.iconsControlsHeader,children:e("div",{children:"family"===o?e(M,{className:RL.iconsControlsBackButton,type:"default",onClick:y,title:i("Back"),children:i("Back")}):null})})]})},DL=e(se,{style:{fontSize:20},spin:!0}),zL=({items:n,loading:o,isCollectingResults:a=!1,hasMore:s=!1,hasQuery:l,mode:c,selectedHash:u,onItemClick:d,onInsert:h,onLoadMore:f,colorVars:p,svgTextMap:g,previewSize:m,selectedHashes:v,onToggleSelect:y})=>{const{t:b}=Yn(),{ThumbsUpIcon:w}=mo(),x=as({maxConcurrent:6}),C=Boolean(v&&v.size>0),_=i.useRef(null),k=Math.max(100,(null!=m?m:50)+48),{positionedItems:A,containerHeight:I,isNearEnd:E,viewportMetrics:F,handleViewportChange:T}=pL({items:n,getId:e=>e.hash,getPreviewSrc:e=>e.imagePreviewUrl,getAltText:e=>e.name,getWidth:()=>1,getHeight:()=>1,layoutMode:"grid",minColumnWidth:k,gap:16,prefetchThresholdPx:240}),O=gs(T,[n.length,null!=m?m:50]);i.useEffect(()=>{s||(_.current=null)},[s,n.length]),i.useEffect(()=>{if(!o&&!a&&s&&n.length>0&&E){if(_.current===n.length)return;_.current=n.length,null==f||f()}},[s,a,E,n.length,o,f]);const P=e("div",l?{className:RL.iconsGridEmptyState,children:e(xo,{})}:{className:RL.iconsGridEmptyState,children:t("div",{className:RL.resultsContainer,children:[e("span",{className:RL.videoIcon,children:e(w,{className:RL.playButton,style:{width:48,height:49,marginBottom:10}})}),e("h1",{className:RL.title,children:b("Millions of icons")}),e("p",{className:RL.subtitle,children:b("Enter a search query and we'll find the perfect icon for you")})]})});return t("div",{id:"iconsScrollableDiv",ref:O,className:RL.iconsGrid,children:[0!==n.length||o?t(r,{children:[e("div",{className:RL.iconsGridVirtualCanvas,style:{height:I},children:A.map(({row:r,layout:n})=>{var i,o,a,s,l,h,f,b,w,_,S;const k=r.item,A=Boolean(v&&v.has(k.hash)||u===k.hash),I=n.bottom>=F.scrollTop-180&&n.top<=F.scrollTop+F.viewportHeight+180;return t("div",{style:{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height},className:`${RL.iconsGridItem} ${A?RL.iconsGridItemSelected:""} ${C?RL.iconsGridShowCheckboxes:""}`,onClick:()=>{d(k),y&&"family"===c&&y(k.hash)},children:[e("div",{style:{height:null!=m?m:50},className:RL.iconsGridItemThumbnail,children:"family"===c&&g[k.hash]?e("div",{style:{color:null==p?void 0:p.colorHex,"--icon-grad-1":null!==(i=null==p?void 0:p.colorHex)&&void 0!==i?i:"#000","--icon-grad-2":null!==(o=null==p?void 0:p.colorHex2)&&void 0!==o?o:"#ff007a","--icon-color-1":null!==(a=null==p?void 0:p.colorHex)&&void 0!==a?a:"#000","--icon-color-2":null!==(s=null==p?void 0:p.colorHex2)&&void 0!==s?s:"#ff007a","--icon-color-3":null!==(l=null==p?void 0:p.colorHex3)&&void 0!==l?l:"#00C2FF","--icon-stroke-1":null!==(h=null==p?void 0:p.colorHex)&&void 0!==h?h:"#000","--icon-stroke-2":null!==(f=null==p?void 0:p.colorHex2)&&void 0!==f?f:"#ff007a","--icon-stroke-3":null!==(b=null==p?void 0:p.colorHex3)&&void 0!==b?b:"#00C2FF","--icon-fill-1":null!==(w=null==p?void 0:p.colorHex)&&void 0!==w?w:"#000","--icon-fill-2":null!==(_=null==p?void 0:p.colorHex2)&&void 0!==_?_:"#ff007a","--icon-fill-3":null!==(S=null==p?void 0:p.colorHex3)&&void 0!==S?S:"#00C2FF"},dangerouslySetInnerHTML:{__html:g[k.hash]},className:RL.iconsGridItemSvg}):e(gL,{imageId:k.hash,sourceUrl:k.imagePreviewUrl,shouldLoad:I,loader:x,alt:k.name,style:{maxHeight:null!=m?m:96},className:RL.iconsGridItemImg,decoding:"async"})}),e("div",{className:RL.iconsGridItemName,title:k.name,children:k.name}),y?e("div",{onClick:e=>{e.stopPropagation()},className:RL.iconsGridCheckbox,children:e(N,{checked:Boolean(v&&v.has(k.hash)),onChange:()=>y(k.hash)})}):null]},k.hash)})}),a&&e("div",{className:RL.iconsGridLoadingMore,children:e(S,{indicator:DL})})]}):P,o&&0===n.length&&e("div",{className:RL.iconsGridLoading,children:e(S,{indicator:DL})})]})},BL="path|rect|circle|ellipse|polygon|line|polyline|g";function UL(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 VL(e,t){const r=new RegExp(`${t}\\s*:\\s*([^;]+)`,"i"),n=e.match(r);return n?n[1].trim():null}function HL(e){let t=0;const r=new RegExp(`<(?:${BL})([^>]*)>`,"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&&VL(i[1],"fill")&&!/^none$/i.test(VL(i[1],"fill"));(o||a)&&(t+=1)}return t}function $L(e){let t=0;const r=new RegExp(`<(?:${BL})([^>]*)>`,"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&&VL(i[1],"stroke")&&!/^none$/i.test(VL(i[1],"stroke"));(o||a)&&(t+=1)}return t}function WL(e){return/<linearGradient/i.test(e)||/<radialGradient/i.test(e)||/fill="url\(#|stroke="url\(#/i.test(e)}function GL(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 qL(e){const t=[],r=e.indexOf("</defs>"),n=r>=0?e.slice(r):e,i=new RegExp(`<(?:${BL})[^>]*stroke-width\\s*=\\s*["']([^"']+)["']`,"gi");let o;for(;null!==(o=i.exec(n));){const e=GL(o[1]);null!=e&&t.push(e)}const a=new RegExp(`<(?:${BL})[^>]*style\\s*=\\s*["'][^"']*stroke-width\\s*:\\s*([^;"]+)[^"']*["']`,"gi");for(;null!==(o=a.exec(n));){const e=GL(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 YL(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=UL(e);n&&!r.has(n)&&(r.add(n),t.push(e))});const n=new RegExp(`<(?:${BL})([^>]*)>`,"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=UL(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=UL(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=VL(a[1],"fill");if(e){const n=UL(e);n&&!r.has(n)&&(r.add(n),t.push(e))}const n=VL(a[1],"stroke");if(n){const e=UL(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[n,i]of[["fill",/fill\s*=\s*["']([^"']*)["']/i],["stroke",/stroke\s*=\s*["']([^"']*)["']/i]]){const n=e.match(i);if(n&&n[1]){const e=UL(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 e of["fill","stroke"]){const i=VL(n[1],e);if(i){const e=UL(i);e&&!r.has(e)&&(r.add(e),t.push(i))}}}return t}(e);return{colors:t,fillsCount:HL(e),strokesCount:$L(e),hasGradient:WL(e),strokeWidth:qL(e)}}const XL=new Map,KL="https://public-api.streamlinehq.com/v1";function ZL(e,t,r,n){const o=i.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=i.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`${KL}/${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,"")}(o,e),[o,r]),c=i.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=i.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=UL(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(`<(?:${BL})([^>]*)>`,"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=UL(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)";if(n+=1,/stop-color\s*=/.test(t)){return"<stop"+t.replace(/stop-color="[^"]*"/i,'stop-color="'+r+'"')+">"}return"<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)";if(n+=1,/stop-color\s*=/.test(t)){return"<stop"+t.replace(/stop-color="[^"]*"/i,'stop-color="'+r+'"')+">"}return"<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=i.useCallback(async(t,n)=>{const i=[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=XL.get(i);if(l)return l;const c=await(async(e,t)=>{var n,i;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===(i=null==t?void 0:t.responsive)||void 0===i||i)),null!=(null==t?void 0:t.strokeToFill)&&s.set("strokeToFill",String(t.strokeToFill));const l=`${KL}/icons/${encodeURIComponent(e)}/download/svg?${s.toString()}`;if(r)return a(l);const c=new URL(`${o}/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 XL.set(i,g),g},[o,u,e,r,a,s]),h=i.useCallback(async(e,t)=>{const n=await(async(e,t)=>{var n;const i=new URLSearchParams;i.set("size",String(null!==(n=null==t?void 0:t.size)&&void 0!==n?n:96)),(null==t?void 0:t.colors)&&i.set("colors",t.colors),(null==t?void 0:t.backgroundColor)&&i.set("backgroundColor",t.backgroundColor),null!=(null==t?void 0:t.strokeWidth)&&i.set("strokeWidth",String(t.strokeWidth));const s=`${KL}/icons/${encodeURIComponent(e)}/download/png?${i.toString()}`;if(r)return a(s);const l=new URL(`${o}/icons/${encodeURIComponent(e)}/download/png`,window.location.origin);return i.forEach((e,t)=>l.searchParams.set(t,e)),l.toString().replace(window.location.origin,"")})(e,t),i={Accept:"image/png"};s&&(i["x-api-key"]=s);const l=await fetch(n,{method:"GET",headers:i,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)})},[o,r,a,s]);return{buildUrl:l,performSearch:c,fetchSvgDataUrl:d,fetchPngDataUrl:h,normalizeSvgForCss:u}}const JL=({apiKey:n,customRequest:o,query:a,setQuery:s,inputRef:l})=>{var c,u,d,h,f,p,g,m,v;const{t:y}=Yn(),[b,w]=i.useState(""),x=void 0!==a?a:b,C=void 0!==s?s:w,[_,k]=i.useState(""),[A,I]=i.useState("global"),[O,P]=i.useState(null),[L,N]=i.useState(null),[j,D]=i.useState(null),[z,B]=i.useState(null),[U,V]=i.useState([]),[H,$]=i.useState(0),[W,q]=i.useState(!1),[Y,K]=i.useState(!1),[Z,J]=i.useState(!1),[Q,ee]=i.useState(null),[te,re]=i.useState({}),[ne,oe]=i.useState({}),[ae,se]=i.useState({}),[le,ce]=i.useState("#000000"),[ue,de]=i.useState("#ff007a"),[he,fe]=i.useState("#00C2FF"),[pe,ge]=i.useState(1),[me,ve]=i.useState(50),[ye,be]=i.useState(!0),[we,xe]=i.useState(!0),[Ce,_e]=i.useState(!1),Se=po(),{options:ke}=Se,Ae=i.useRef(!1),Ie=i.useRef(null),Ee=i.useRef(0),Fe=i.useRef(null),Te=i.useRef(!1),Oe=i.useRef(null),Pe=i.useRef(null===(c=null==ke?void 0:ke.config)||void 0===c?void 0:c.handleTranslate),Me=i.useRef(null===(u=null==ke?void 0:ke.config)||void 0===u?void 0:u.locale);i.useEffect(()=>{var e,t;Pe.current=null===(e=null==ke?void 0:ke.config)||void 0===e?void 0:e.handleTranslate,Me.current=null===(t=null==ke?void 0:ke.config)||void 0===t?void 0:t.locale},[null===(d=null==ke?void 0:ke.config)||void 0===d?void 0:d.handleTranslate,null===(h=null==ke?void 0:ke.config)||void 0===h?void 0:h.locale]);const Re=i.useRef(null),Le=i.useRef(null),Ne=i.useRef(null),je=i.useRef(new Set),[De,ze]=i.useState(new Set),Be=null!==(p=null===(f=null==ke?void 0:ke.config)||void 0===f?void 0:f.STREAMLINE_API_KEY)&&void 0!==p?p:"3pAQQzwUNMmcgSr2.f4eb08cd5886d44b1fc6a701a3ba797c",Ue=null===(g=null==ke?void 0:ke.config)||void 0===g?void 0:g.handleProxyUrl,Ve=async e=>Ue?Promise.resolve(Ue(e)):e,{performSearch:He,fetchSvgDataUrl:$e,fetchPngDataUrl:We,normalizeSvgForCss:Ge}=ZL(we,null===(m=null==ke?void 0:ke.config)||void 0===m?void 0:m.STREAMLINE_BASE_URL,Ue,Be),qe=i.useMemo(()=>{if("family"!==A||0===U.length)return null;const e=new Set(U.map(e=>e.hash)),t=Object.keys(ae).some(t=>e.has(t))?ae:ne,r=U.map(e=>t[e.hash]).filter(e=>Boolean(e));if(0===r.length)return null;return 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=UL(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=>YL(e)))},[U,A,ae,ne]);i.useMemo(()=>"family"===A&&(!!(null==qe?void 0:qe.hasGradient)||!!(O||"").toLowerCase().includes("gradient")),[qe,O,A]);const Ye=i.useMemo(()=>"family"===A&&U.some(e=>{const t=ne[e.hash];return t&&/var\(--icon-color-2\)/i.test(t)}),[U,A,ne]),Xe=i.useMemo(()=>"family"===A&&U.some(e=>{const t=ne[e.hash];return t&&/var\(--icon-color-3\)/i.test(t)}),[U,A,ne]),Ke=i.useMemo(()=>!!we&&(!!qe&&(qe.hasGradient||qe.colors.length>=2&&Ye)),[qe,we,Ye]),Ze=i.useMemo(()=>!!we&&(!!qe&&(qe.colors.length>=3&&Xe)),[qe,we,Xe]);i.useEffect(()=>(Ae.current=!0,()=>{var e,t,r;Ae.current=!1;try{null===(e=Re.current)||void 0===e||e.abort(),null===(t=Le.current)||void 0===t||t.abort(),null===(r=Ne.current)||void 0===r||r.abort()}catch(e){}}),[]);const Je=i.useRef(x),Qe=i.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:_;if(!c||0===c.trim().length)return;if(e.initial?Y:Z||Y)return;if(!Ae.current)return;e.initial&&(null===(n=Re.current)||void 0===n||n.abort());const u=new AbortController;Re.current=u,e.initial?(K(!0),V([]),$(0),q(!1)):J(!0);const d=e.initial?0:H,h=(e.initial,30),f=null!==(o=null===(i=e.override)||void 0===i?void 0:i.mode)&&void 0!==o?o:A,p=null!==(s=null===(a=e.override)||void 0===a?void 0:a.familySlug)&&void 0!==s?s:O,g=c.trim(),m=`${f}|${p||""}|${g}|${j||""}|${d}|${h}`;if(!je.current.has(m)){je.current.add(m);try{const t=await He({mode:f,familySlug:p||null,query:g,offset:d,limit:h,style:j,signal:u.signal});if(!Ae.current)return;const r=await(async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{imagePreviewUrl:await Ve(e.imagePreviewUrl)}))))(t.results);if(e.initial){const e=r.filter((e,t,r)=>r.findIndex(t=>t.hash===e.hash)===t);V(e)}else V(e=>{const t=new Set(e.map(e=>e.hash)),n=r.filter(e=>!t.has(e.hash));return n.length>0?[...e,...n]:e});q(Boolean(null===(l=t.pagination)||void 0===l?void 0:l.hasMore)),$(d+r.length)}catch(e){if("AbortError"===(null==e?void 0:e.name))return;console.error(e),ie.error(y("Request error"))}finally{Ae.current&&(e.initial?K(!1):J(!1)),je.current.delete(m)}}},[_,O,Z,Y,A,H,He,j,y]);i.useEffect(()=>{Oe.current=Qe},[Qe]),i.useEffect(()=>{if("family"===A){const e=window.setTimeout(()=>{Te.current=!1},100);return()=>window.clearTimeout(e)}Te.current=!1},[A]);const et=i.useCallback(async e=>{var t;if(!e||0===e.trim().length)return;const r=`${e.trim()}|${j||""}`;if(Fe.current===r&&"global"===A)return;const n=++Ee.current;let i=e.trim();if(Pe.current)try{i=await Pe.current(e,{locale:Me.current})}catch(t){console.error("IconsTab: translation error",t),i=e}n===Ee.current&&(I("global"),P(null),B(null),V([]),q(!1),$(0),ee(null),ze(new Set),k(i),await(null===(t=Oe.current)||void 0===t?void 0:t.call(Oe,{initial:!0,override:{query:i}})),Fe.current=r)},[A,j]),tt=i.useCallback(async()=>{x&&0!==x.trim().length&&(Ie.current&&(window.clearTimeout(Ie.current),Ie.current=null),await et(x))},[x,et]),rt=i.useCallback(()=>{Ee.current+=1,I("global"),P(null),N(null),B(null),D(null),k(""),V([]),J(!1),q(!1),$(0),Fe.current=null,ee(null),ze(new Set),ce("#000000"),de("#ff007a"),fe("#00C2FF")},[]);i.useEffect(()=>{const e=Je.current;e&&e.trim().length>=3&&et(e)},[]),i.useEffect(()=>{const e=x.trim();Ie.current&&(window.clearTimeout(Ie.current),Ie.current=null),e.length<3?rt():Ie.current=window.setTimeout(()=>{et(e)},700)},[x,j,rt,et]);const nt=i.useCallback(e=>{if("global"===A){if(!e.familySlug||!_)return;return Ie.current&&(window.clearTimeout(Ie.current),Ie.current=null),Te.current=!0,I("family"),P(e.familySlug),N(e.hash),B(e.categoryName||null),V([]),J(!1),q(!1),$(0),ee(null),ze(new Set),ce("#000000"),de("#ff007a"),fe("#00C2FF"),void Qe({initial:!0,override:{mode:"family",familySlug:e.familySlug,query:_}})}ee(e.hash)},[_,Qe,A]),it=i.useCallback(()=>{const e=_.trim();I("global"),P(null),N(null),B(null),V([]),J(!1),q(!1),$(0),ee(null),ze(new Set),ce("#000000"),de("#ff007a"),fe("#00C2FF"),e&&Qe({initial:!0,override:{mode:"global",familySlug:null,query:e}})},[_,Qe]);i.useEffect(()=>{var e;if("family"!==A||0===U.length)return;const t=new Set(U.map(e=>e.hash));let r=U.map(e=>e.hash).filter(e=>!te[e]||!ne[e]);if(!L||t.has(L)||ae[L]||(r=[L,...r]),0===r.length)return;let n=!1;null===(e=Le.current)||void 0===e||e.abort();const i=new AbortController;return Le.current=i,Promise.all(r.map(e=>$e(e,{colors:we?void 0:le,strokeWidth:pe,size:me,responsive:ye,signal:i.signal}).then(t=>({h:e,r:t})).catch(()=>null))).then(e=>{if(n||!Ae.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&&re(e=>Object.assign(Object.assign({},e),t)),Object.keys(r).length>0&&oe(e=>Object.assign(Object.assign({},e),r)),Object.keys(i).length>0&&se(e=>Object.assign(Object.assign({},e),i))}),()=>{n=!0,i.abort()}},[le,L,$e,U,A,ae,ye,me,pe,ne,te,we]),i.useEffect(()=>{if("family"!==A)return;if(0===U.length)return;const e=U.map(e=>e.hash),t={},r={};let n=!1;e.forEach(e=>{const i=ae[e]||ne[e];if(!i)return;const o=Ge(i,{strokeWidth:"number"==typeof pe?pe:void 0});o&&o!==ne[e]&&(t[e]=o,r[e]=`data:image/svg+xml;utf8,${encodeURIComponent(o)}`,n=!0)}),n&&(Object.keys(t).length>0&&oe(e=>Object.assign(Object.assign({},e),t)),Object.keys(r).length>0&&re(e=>Object.assign(Object.assign({},e),r)))},[U,A,Ge,ae,pe,ne]);const ot=i.useRef(null);i.useEffect(()=>{var e;if("family"!==A||0===U.length)return;const t=L&&ae[L]?L:null===(e=U[0])||void 0===e?void 0:e.hash;if(!t||!ae[t])return;if(ot.current===O)return;const r=ae[t];if(!r)return;ot.current=O;const n=function(e){var t,r,n,i,o,a,s,l;const c=[],u=new Set,d=e=>{const t=UL(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(`<(?:${BL})([^>]*)>`,"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})$/);if(t){return"#"+(3===t[1].length?t[1].replace(/(.)/g,"$1$1"):t[1]).toLowerCase()}return 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:UL(r)||"#000000"}(e)};n[0]&&ce(i(n[0])),n[1]&&de(i(n[1])),n[2]&&fe(i(n[2]))},[U,A,ae,O,L]),i.useEffect(()=>{"family"!==A&&(ot.current=null)},[A]);const at=i.useRef(null);i.useEffect(()=>{if("family"!==A||!O||0===U.length)return;const e=U[0];if(!e||!ae[e.hash])return;if(at.current===O)return;const t=ae[e.hash];if(!t)return;const r=YL(t);"number"==typeof r.strokeWidth&&r.strokeWidth>0&&(at.current=O,ge(r.strokeWidth))},[U,A,ae,O]),i.useEffect(()=>{"family"!==A&&(at.current=null)},[A]);const st=i.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:le,colorHex2:ue,colorHex3:he}),[le,ue,he]),lt=i.useCallback(e=>{ze(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]),ct=i.useCallback(()=>{ze(new Set)},[]),ut=i.useMemo(()=>{if(1===De.size){const[e]=Array.from(De);return U.find(t=>t.hash===e)||null}return 0===De.size&&Q&&U.find(e=>e.hash===Q)||null},[U,Q,De]),dt=i.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})}},[]),ht=i.useCallback(async(e,t)=>{try{const r=async e=>{const t="family"===A?st(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,me);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 $e(e,{colors:we?void 0:le,strokeWidth:"number"==typeof pe?pe:void 0,size:me,responsive:ye,signal:t}),i=n.original||n.text;return r(i)};if("family"!==A)try{return await We(e.hash,{size:me,colors:we?void 0:le,strokeWidth:"number"==typeof pe?pe:void 0,signal:t})}catch(t){return e.hash?await n(e.hash):null}const i=ne[e.hash]||ae[e.hash];return i?r(i):e.hash?await n(e.hash):null}catch(e){return null}},[st,le,$e,We,A,ae,ye,me,pe,ne,we]),ft=i.useCallback(async e=>{var t;try{if(!Ae.current)return;_e(!0),null===(t=Ne.current)||void 0===t||t.abort();const r=new AbortController;Ne.current=r;const n=await ht(e,r.signal);if(!Ae.current||!n)return;await Promise.resolve(o(n))}catch(e){console.error("IconsTab: insert error",e),ie.error(y("Request error"))}finally{Ae.current&&_e(!1)}},[o,ht,y]);i.useCallback(()=>{var e;ee(null),ct();const t=null===(e=null==ke?void 0:ke.config)||void 0===e?void 0:e.onClose;"function"==typeof t&&t()},[ct,ke]);const{isCopyIconsModalVisible:pt,isCopyLoading:gt,copyForm:mt,openCopyModal:vt,closeCopyModal:yt,resetAfterClose:bt,handleCopyTreeSelect:wt,handleIconsCopyOk:xt,fetchChildFolders:Ct,generateMenuItemsFromFolders:_t,handleCreateFolderAndCopy:St}=(({items:e,selectedHashes:t,getPngDataUrlForItem:r,dataUrlToBlob:n,clearSelection:o})=>{const{t:a}=Yn(),{options:s,state:l}=po(),c=Oo(),[u,d]=i.useState(!1),[h]=E.useForm(),[f,p]=i.useState(!1),g=i.useRef(!1),{state:m,actions:{fetchFolders:v,fetchChildFolders:y,handleModalOk:b}}=Wo(),{EmptyFolderIcon:w}=mo(),{activeFormField:x,setActiveFormField:C,generateMenuItemsFromFolders:_}=rl({folders:Array.isArray(m.folders)?m.folders:[],selectedFolder:l.selectedFolder,EmptyFolderIcon:w,handleCreateFolderModalOk:b,setIsLoading:p,t:a}),S=i.useCallback(async()=>{await v(),d(!0)},[v]),k=i.useCallback(async e=>{e.length>0&&(h.setFieldsValue({targetFolder:e[0]}),x!==e[0].toString()&&C(""))},[x,h,C]),A=i.useCallback(async i=>{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=i||(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 e of r){const r=n.find(t=>t.hash===e);if(!r){c+=1;continue}const u=await a(r);if(!u){c+=1;continue}const d=`${(null===(t=r.name)||void 0===t?void 0:t.trim())||`icon-${e}`}.png`,h=s(u,"image/png");try{await o.uploadFile({name:d,size:h.size,type:"image/png",folderId:i,data:h,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("При копировании произошли ошибки"),placement:"bottomRight",data:{failCount:m,totalCount:f.length,itemIds:f,folderId:null!=h?h:null}}),o()}catch(e){console.error(e),c.error({id:"FILES_COPY_ERROR",message:a("При копировании произошли ошибки"),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}})}},[o,n,r,e,c,s,t,null==l?void 0:l.selectedFolder,a]),I=i.useCallback(()=>{f||g.current||(d(!1),C(""),p(!1))},[f,C]),F=i.useCallback(()=>{C(""),p(!1)},[C]),T=i.useCallback(async e=>{if(!g.current){g.current=!0,p(!0);try{await A(null!=e?e:null),d(!1),C("")}finally{g.current=!1,p(!1)}}},[A,C]),O=i.useCallback(()=>{var e;const t=null!==(e=l.selectedFolder)&&void 0!==e?e:"folders";C(t),h.setFieldsValue({folderName:a("New folder"),targetFolder:t})},[h,l.selectedFolder,C,a]);return{isCopyIconsModalVisible:u,isCopyLoading:f,copyForm:h,openCopyModal:S,closeCopyModal:I,resetAfterClose:F,handleCopyTreeSelect:k,handleIconsCopyOk:T,handleCreateFolderAndCopy:O,fetchChildFolders:y,generateMenuItemsFromFolders:_}})({items:U,selectedHashes:De,getPngDataUrlForItem:ht,dataUrlToBlob:dt,clearSelection:ct}),kt=Boolean(_.trim())&&(U.length>0||Y),At=kt&&De.size>0;return t(r,{children:[t("div",{className:`${RL.iconsTab} ${_.trim()?RL.hasSearch:""}`,children:[kt&&At?t("div",{className:RL.iconsHeaderContainer,children:[t("div",{className:RL.iconsHeaderContainerLeft,children:[t(T.Text,{type:"secondary",children:[De.size," ",y("selected")]}),e(M,{icon:e(Fi,{size:16}),onClick:ct,children:y("Deselected")})]}),e(R,{children:e(M,{icon:e(gi,{size:16}),onClick:vt,children:y("Copy to folder")})})]}):e(NL,{query:x,onQueryChange:C,onSubmit:tt,styleFilter:j,onStyleChange:D,hasResults:U.length>0||Y,inputRef:l}),"family"===A?e(jL,{mode:A,familySlug:O,categoryName:z,colorHex:le,setColorHex:ce,colorHex2:ue,setColorHex2:de,colorHex3:he,setColorHex3:fe,sizePx:me,setSizePx:ve,strokeWidth:pe,setStrokeWidth:ge,responsiveSvg:ye,setResponsiveSvg:be,useCssColor:we,setUseCssColor:xe,showSecondColor:Ke,showThirdColor:Ze,styleFilter:j,onBack:it}):null,e(zL,{items:U,loading:Y,isCollectingResults:Z,hasMore:W,hasQuery:Boolean(_.trim()),mode:A,selectedHash:Q,onItemClick:nt,onInsert:ft,onLoadMore:()=>{Qe({initial:!1})},colorVars:{colorHex:le,colorHex2:ue,colorHex3:he},svgTextMap:ne,previewSize:me,selectedHashes:De,onToggleSelect:lt}),ut?t("div",{className:RL.iconsBottomBar,children:[e(X,{className:"zero-divider"}),e("div",{className:RL.iconsBottomBarContent,children:e(R,{children:e(M,{size:"large",type:"primary",style:{height:40},loading:Ce,onClick:()=>ft(ut),children:y("Choose")})})})]}):null]}),e(G,{title:e("div",{className:"modal-title",children:y("Copy to folder")}),open:pt,onCancel:()=>{gt||yt()},maskClosable:!gt,closable:!gt,keyboard:!gt,footer:t("div",{className:el.formFooter,children:[t(M,{className:el.folderButton,onClick:St,loading:gt,children:[e(wi,{size:18,strokeWidth:null===(v=ke.config)||void 0===v?void 0:v.iconStrokeWidth}),y("Create folder")]}),e(M,{type:"primary",className:el.folderButton,onClick:()=>{yt()},loading:gt,children:y("Done")})]}),afterClose:()=>bt(),children:t("div",{className:RL.copyToFolderModalBody,children:[gt?e("div",{className:RL.copyToFolderModalLoadingOverlay,children:e(S,{size:"large"})}):null,e(E,{form:mt,layout:"vertical",initialValues:{targetFolder:"folders",folderName:y("New folder"),is_force_create:!1},children:t("div",{className:el.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:y("Select the destination folder")}],className:el.formItem,children:e(Js,{onSelect:wt,generateMenuItems:()=>_t({targetForm:mt,onTreeSelect:wt,onComplete:xt,actionButtonText:y("Copy here")}),fetchChildFolders:Ct,disabledFolders:[],mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(y("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})})]})},QL=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)},{Sider:eN,Content:tN}=J,rN={keywords:""},nN=()=>{var s,l,d;const h=Wo(),f=is(),p=(()=>{var e,t;const{state:r,actions:n,options:i}=po(),{selectedFolder:o,pathHistory:a,folders:s}=r,{t:l}=Yn(),{setSelectedFolder:u,setPathHistory:d}=n,h=c(()=>{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=c((e,t=new Set)=>{if(t.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const r=(Array.isArray(s)?s:[]).find(t=>t.id===e);if(!r)return[];const n=new Set(t);return n.add(e),r.parentId?r.parentId===r.id?(console.warn(`Cycle detected: folder ${r.id} is a parent of itself`),[{id:r.id,name:r.name+" (ошибка)"}]):[...f(r.parentId,n),{id:r.id,name:r.name}]:[{id:r.id,name:r.name}]},[s]),p=c(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=c(e=>{if("folders"===e){const e=[{id:"folders",name:l("Folders")}];return null==d||d(e),void(i.onPathChange&&i.onPathChange([]))}const t=(Array.isArray(s)?s:[]).find(t=>t.id===e);if(!t)return void console.warn("⚠️ Folder not found:",e);const r=f(e),n=[{id:"folders",name:l("Folders")},...r];null==d||d(n),i.onPathChange&&i.onPathChange(n.map(e=>e.name))},[s,f,d,i,l]),m=c(e=>{const t="folders"===e?null:e;t!==o&&(null==u||u(t),p(t),g(e))},[p,o,u,g]),v=c(e=>{if(-1===e)null==u||u(null),null==d||d([{id:"folders",name:l("Folders")}]),i.onPathChange&&i.onPathChange([]);else{const t=a.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,a,d,u,l]),y=c(e=>{if(!e.isFolder)return;null==u||u(e.id);const t={id:e.id,name:e.name};if(d){const e=[...a,t];d(e)}if(i.onPathChange){const t=[...a.map(e=>e.name),e.name];i.onPathChange(t)}},[i,a,d,u]);return{state:{selectedFolder:o,pathHistory:a},actions:{handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y},selectedFolder:o,pathHistory:a,handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y}})(),g=(()=>{const{state:e,actions:t}=po(),{pagination:r}=e,{setPagination:n}=t,i=c((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}}})(),m=(()=>{const[e,t]=n.useState(()=>{const e=localStorage.getItem(os);return e?Math.max(290,parseInt(e,10)):298}),[r,i]=n.useState(!1),[o,a]=n.useState(!1),[s,l]=n.useState(0),c=n.useCallback(()=>{t(298),localStorage.setItem(os,298..toString())},[]),u=n.useCallback(r=>{r.preventDefault(),r.stopPropagation(),i(!0),document.body.classList.add("resizing");const n=r.clientX,o=e;let s=o;const c=e=>{e.preventDefault();const r=Math.max(Math.min(o+e.clientX-n,600),290);s=r,t(r),l(e.clientX),a(!0)},u=()=>{i(!1),document.body.classList.remove("resizing"),a(!1),localStorage.setItem(os,s.toString()),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)},[e]);return n.useEffect(()=>()=>{document.body.classList.remove("resizing")},[]),{sidebarWidth:e,isResizing:r,showResizeGuide:o,resizeGuidePosition:s,handleResizeStart:u,handleDoubleClick:c}})(),v=(()=>{const[e,t]=o([]),[r,n]=o(!1),[i,a]=o(!1),s=u(0),l=u(new Map),d=c(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),h=c(e=>ui(e.size),[]),f=c((e,r)=>{const i=r.map(t=>({id:d(),folderId:e,name:t.name,size:h(t),status:"uploading",progress:0}));return t(i),n(!0),a(!1),i.map(e=>e.id)},[d,h]),p=c((e,r)=>{const i={id:d(),folderId:e,name:r,size:void 0,status:"uploading",progress:0};return t(e=>[...e,i]),n(!0),a(!1),i.id},[d]),g=c((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,r))}):t))},[]),m=c((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.name)&&(e.name=r.name),(null==r?void 0:r.size)&&void 0===t.size&&(e.size=ui(r.size)),e}return t}))},[]),v=c((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:r}):t))},[]),y=c(()=>{n(!1),a(!1),setTimeout(()=>{t([]),l.current.clear()},300)},[]),b=c(()=>{a(e=>!e)},[]),w=c(e=>l.current.get(e),[]),x=e.length,C=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:r,isUploadMinimized:i,totalFiles:x,completedFiles:C,startUpload:f,startUploadByUrl:p,updateProgress:g,markAsSuccess:m,markAsError:v,getUploadedFile:w,closeUpload:y,minimizeUpload:b}})(),y=Ha(),{deleteItems:b}=Go(),w=Oo(),{t:C}=Yn(),{options:_,state:k,actions:A}=po(),I=_,E=null==I?void 0:I.onChangeSelection,F=k,T=null==I?void 0:I.config,{dataProviders:O}=I,{form:P,urlForm:R,renameForm:L,moveForm:N,renameFolderForm:j,copyForm:D,isModalVisible:z,isUrlModalVisible:B,isMoveModalVisible:U,isRenameFolderModalVisible:V,isCopyModalVisible:H,isDeleteConfirmVisible:$,folderToRename:W,activeLibraryItem:G}=k,{setIsUrlModalVisible:q,setActiveLibraryItem:Y}=A,{config:K}=_,{DropZoneFileIcon:Z}=mo(),[Q,ee]=o(!1),[te,re]=o(!1),[ne,ie]=o(!1),oe=u(0),ae=u(!1);ae.current=te;const se=i.useRef(null),le=i.useRef([]),[ce,ue]=o(!1),[de,he]=o(!1),fe=Ya(e=>e.selectedFiles),pe=Ya(e=>e.clearSelection),ge=Ya(e=>e.syncVisibleFiles),{folders:me,loading:ve}=h.state,{fetchFolders:ye,fetchChildFolders:be,handleCreateFolder:we,handleModalOk:xe,handleModalCancel:Ce,generateMenuItems:_e}=h.actions,Se=(e=>{var t;const{state:r,actions:n,options:i}=po(),{t:o}=Yn(),a=Oo(),{folders:s,folderToRename:l,renameFolderForm:u,isRenameFolderModalVisible:d}=r,{setFolderToRename:h,setIsRenameFolderModalVisible:f}=n,{apiEndpoints:p,dataProviders:g,config:m}=i,v=c(e=>{null==h||h(e),null==f||f(!0);const t=null==s?void 0:s.find(t=>t.id===e);t&&u&&u.setFieldsValue({newFolderName:t.name})},[h,f,s,u]),y=c(()=>{null==f||f(!1),null==h||h(null),null==u||u.resetFields()},[f,h,u]),b=c(async()=>{var t,r;if(l&&u)try{const i=await u.validateFields();if(!(null==i?void 0:i.newFolderName))return void a.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:o("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:l,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 a.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:o("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:null!=l?l:void 0,itemName:null==i?void 0:i.newFolderName}});if(!(null==g?void 0:g.renameFolder))throw new Error(o("renameFolder is not implemented in dataProviders"));const s=await g.renameFolder(l,i.newFolderName.trim());if(!(null==s?void 0:s.id))return void a.error({id:"FOLDER_RENAME_FAILED",message:o("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:null!=l?l:void 0,itemName:i.newFolderName,error:{message:"invalidResponse"}}});a.success({id:"FOLDER_RENAME_SUCCESS",message:o("Folder renamed"),placement:"bottomRight",data:{itemId:s.id,itemName:s.name,folderId:null!==(r=s.parentId)&&void 0!==r?r:null}}),y(),await e(),l!==s.id&&n.setSelectedFolder&&n.setSelectedFolder(s.id)}catch(e){console.error("Ошибка при переименовании папки:",e),a.error({id:"FOLDER_RENAME_FAILED",message:o("Failed to rename folder"),placement:"bottomRight",innerException:e,data:{itemId:null!=l?l:void 0,itemName:null==u?void 0:u.getFieldValue("newFolderName"),error:{message:e instanceof Error?e.message:String(e)}}})}},[l,u,p,y,e,o,null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder,a]);return{state:{isRenamingFolder:d||!1,folderToRename:l},actions:{showRenameFolderModal:v,handleRenameFolderCancel:y,handleRenameFolderOk:b}}})(ye),{files:ke,loading:Ae,isRenamingFile:Ie,fileToRename:Ee}=f.state,{fetchFiles:Te,handleDeleteFile:Oe,handleDeleteFolder:Pe,handleAddFile:Me,handleAddFileByUrl:Re,showRenameModal:Le,handleRenameCancel:Ne,handleRenameOk:je,handleDroppedFiles:De,showMoveModal:ze,handleMoveCancel:Be,handleMoveOk:Ue,handleCopyOk:Ve,handleCopyCancel:He,showDeleteConfirm:$e,handleDeleteConfirmCancel:We,handleDeleteConfirmOk:Ge}=f.actions,{selectedFolder:qe,pathHistory:Ye}=p.state,{handleFolderSelect:Xe,handleItemClick:Ke}=p.actions,{pagination:Ze}=g.state,Je=Eo(Te),{searchTerm:Qe,sortBy:et,sortOrder:tt}=Je.state,{handleSearch:rt,handleSort:nt,handlePaginationChange:it}=Je.actions,ot=c(async()=>{const e=(e=>Uo(e))(Ye||[]);try{await $o({options:I,pathFolder:e,dataProviders:null==I?void 0:I.dataProviders})}catch(e){console.error("Cache clear failed:",e)}await ye(),await Te({folderId:qe||"",page:Ze.current,limit:Ze.pageSize,search:Qe,sortBy:et,sortOrder:tt,itemType:"all"})},[Te,ye,I,Ze,Ye,Qe,qe,et,tt]),at=(({files:e,fetchFiles:t,selectedFolder:r})=>{var i;const{t:o}=Yn(),a=Oo(),{options:s,actions:l,state:c}=n.useContext(fo),{setActiveLibraryItem:u}=l,{activeLibraryItem:d}=c,h=Ha(),[f,p]=n.useState(!1),[g,m]=n.useState(null),v=n.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return gr.includes(t)}const r=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!r&&gr.includes(r)},[]),y=n.useCallback(async(e,t)=>{var r,n;const{dataProviders:i}=s;if(!1===(null===(n=null===(r=s.config)||void 0===r?void 0:r.features)||void 0===n?void 0:n.enableUpdateFile))throw new qo(o("Updating files is disabled by configuration"),"UnsupportedOperation");if(!e.id||!e.thumbnail||!(null==i?void 0:i.updateFile))throw new qo(o("Failed to save changes"),"UnsupportedOperation");const a=(null==t?void 0:t.mimeType)||Er(e.thumbnail,e.type),l=Fr(a),c=e.name.lastIndexOf("."),u=`${c>0?e.name.substring(0,c):e.name}.${l}`,d=(null==t?void 0:t.blob)||Mr(e.thumbnail,a);return i.updateFile(e.id,{name:u,type:a,data:d})},[s,o]),b=n.useCallback(async(e,t)=>{var r,n;if(!e.thumbnail)throw new qo(o("Failed to save changes"),"ValidationError");const i=!(!0===(null===(r=s.config)||void 0===r?void 0:r.saveCopyToCurrentFolder))||(null!==(n=e.saveWithoutFolder)&&void 0!==n?n:!e.id),a=i?void 0:e.folderId||void 0,l=(null==t?void 0:t.mimeType)||Er(e.thumbnail,e.type),c=(null==t?void 0:t.blob)||Mr(e.thumbnail,l),u=new File([c],e.name,{type:l,lastModified:Date.now()}),d=await h.uploadFileWithProvider(u,a,void 0,i);if(!d)throw new qo(o("Failed to save image copy"),"FileWriteError");return d},[h,null===(i=s.config)||void 0===i?void 0:i.saveCopyToCurrentFolder,o]),w=n.useCallback(t=>{let r;if(t)r=t;else{const t=Ya.getState().selectedFiles;if(1!==t.size)return;const n=Array.from(t)[0];if(r=e.find(e=>e.id===n),!r||r.isFolder||!v(r))return}u&&u(sr),m(r),p(!0)},[e,v,p,u]),x=n.useCallback(()=>{u&&d===sr&&u(rr),p(!1),m(null)},[d,u]),C=n.useCallback(async(e,n)=>{var i,l,c,u,d,h;try{const c=await y(e,n);return a.success({id:"IMAGE_UPDATE_SUCCESS",message:o("Success"),description:o("Image updated successfully"),placement:"bottomRight",data:{itemId:null!==(i=null==c?void 0:c.id)&&void 0!==i?i:void 0,itemName:null==c?void 0:c.name,folderId:null!==(l=null==c?void 0:c.folderId)&&void 0!==l?l:null,thumbnail:null==c?void 0:c.thumbnail}}),c&&s.onEditorOk&&s.onEditorOk(c,{mode:n.mode}),await t({folderId:r||""}),x(),null!=c?c:void 0}catch(t){const r=No(t),n=null!==(u=null!==(c=Ro(null==r?void 0:r.code,o))&&void 0!==c?c:null==r?void 0:r.message)&&void 0!==u?u:o("Failed to save changes");throw a.error({id:"IMAGE_SAVE_FAILED",message:n,innerException:t,placement:"bottomRight",data:{itemId:null!==(d=e.id)&&void 0!==d?d:void 0,itemName:e.name,folderId:null!==(h=e.folderId)&&void 0!==h?h:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[y,s,t,r,a,x,o]),_=n.useCallback(async(e,n)=>{var i,l,c,u,d,h;try{const c=await b(e,n);return a.success({id:"IMAGE_SAVE_COPY_SUCCESS",message:o("Success"),description:o("Image copy saved successfully"),placement:"bottomRight",data:{itemId:null!==(i=null==c?void 0:c.id)&&void 0!==i?i:void 0,itemName:null==c?void 0:c.name,folderId:null!==(l=null==c?void 0:c.folderId)&&void 0!==l?l:null,thumbnail:null==c?void 0:c.thumbnail}}),c&&s.onEditorOk&&s.onEditorOk(c,{mode:n.mode}),await t({folderId:r||""}),x(),null!=c?c:void 0}catch(t){const r=No(t),n=null!==(u=null!==(c=Ro(null==r?void 0:r.code,o))&&void 0!==c?c:null==r?void 0:r.message)&&void 0!==u?u:o("Failed to save image copy");throw a.error({id:"IMAGE_SAVE_COPY_FAILED",message:n,innerException:t,placement:"bottomRight",data:{itemId:null!==(d=e.id)&&void 0!==d?d:void 0,itemName:e.name,folderId:null!==(h=e.folderId)&&void 0!==h?h:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[b,s,t,r,a,x,o]);return{isPixieEditorVisible:f,editingFile:g,handleEdit:w,handlePixieEditorSave:C,handlePixieEditorSaveCopy:_,handlePixieEditorClose:x}})({files:ke||[],fetchFiles:Te,selectedFolder:qe||null}),[st,lt]=o(!1),ct=c(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)||(oe.current+=1,oe.current>0&&ee(!0))},[]),ut=c(e=>{e.preventDefault(),e.stopPropagation();const t=e.relatedTarget,r=e.currentTarget;if(t&&!r.contains(t))oe.current=Math.max(0,oe.current-1),oe.current<=0&&ee(!1);else if(t){const e=t.closest('[class*="dragOverlay"]');if(e&&r.contains(e))return}},[]),dt=c(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},[]),ht=c(e=>{e.preventDefault(),e.stopPropagation(),ee(!1),oe.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&&(lt(!0),De(t).catch(e=>{"StaleLoad"!==(null==e?void 0:e.name)&&console.error("Ошибка при загрузке файлов:",e)}).finally(()=>{lt(!1)}))},[De]),ft=c(()=>{ee(!1),oe.current=0,document.body.removeAttribute("data-fm-dragging"),ie(!1),re(!1)},[]);i.useEffect(()=>{le.current=ke||[]},[ke]);const pt=null==F?void 0:F.activeLibraryItem;a(()=>{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,ie(!0),e(!0),pt===rr&&re(!0))},n=r=>{const n=r.relatedTarget;(!n||!document.documentElement.contains(n))&&t&&(t=!1,ie(!1),re(!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")}},[pt]),a(()=>{const e=e=>{var t,r;if(document.body.removeAttribute("data-fm-dragging"),ie(!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 t=0;t<e.items.length;t++){const n=e.items[t].getAsFile();n&&r.push(n)}return r})(e.dataTransfer);if(!n.length)return;const i=e.target,o=i.closest(`.${ys.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]");(ae.current||Q||o||a)&&(e.preventDefault(),e.stopPropagation(),re(!1),ee(!1),oe.current=0,lt(!0),De(n).catch(e=>{"StaleLoad"!==(null==e?void 0:e.name)&&console.error("Ошибка при загрузке файлов:",e)}).finally(()=>lt(!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"),ie(!0)),pt!==rr||ae.current||re(!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"),ie(!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)}},[Q,De,pt]),a(()=>{const e=e=>{Q&&ft(),re(!1),ie(!1),document.body.removeAttribute("data-fm-dragging")};return window.addEventListener("dragend",e,!0),()=>window.removeEventListener("dragend",e,!0)},[Q,ft]),a(()=>{let e=null;const t=t=>{Q&&(e=setTimeout(()=>{Q&&ft()},200))};return document.addEventListener("mouseup",t,!0),()=>{document.removeEventListener("mouseup",t,!0),e&&clearTimeout(e)}},[Q,ft]),a(()=>{const e=e=>{"Escape"===e.key&&Q&&ft()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[Q,ft]),a(()=>{const e=e=>{Q&&setTimeout(()=>{Q&&ft()},100)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[Q,ft]);const gt=i.useCallback(async()=>{await Ge(),await ye(),qe===lr&&be&&await be(lr),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var e,t;return null===(t=null===(e=se.current)||void 0===e?void 0:e.refreshFileCounts)||void 0===t?void 0:t.call(e)})})},[ye,be,Ge,qe]),mt=i.useCallback(()=>{he(!0)},[]),vt=i.useCallback(async()=>{var e,t;if(qe!==lr)return console.error("Clear trash called outside of trash folder"),void he(!1);try{if(null==O?void 0:O.cleanTrash){const t=await O.cleanTrash();await Te({folderId:lr}),await(null===(e=se.current)||void 0===e?void 0:e.refreshFileCounts()),t.success?w.success({id:"TRASH_CLEARED_SUCCESS",message:C("Trash cleared successfully"),description:C("{{count}} items permanently deleted",{count:t.deletedCount||0}),placement:"bottomRight"}):w.error({id:"TRASH_CLEAR_FAILED",message:C("Failed to clear trash"),placement:"bottomRight"})}else{const e=le.current||[];if(0===e.length)return void he(!1);const r=e.map(e=>({id:e.id,isFolder:e.isFolder})),n=await b({items:r,selectedFolder:lr,getItemNameById:t=>{var r;return(null===(r=e.find(e=>e.id===t))||void 0===r?void 0:r.name)||t||""},showNotifications:!1});await Te({folderId:lr}),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts());const{successCount:i,failCount:o}=n;0===o?w.success({id:"TRASH_CLEARED_SUCCESS",message:C("Trash cleared successfully"),description:C("{{count}} items permanently deleted",{count:i}),placement:"bottomRight"}):i>0?w.warning({id:"TRASH_CLEARED_PARTIAL",message:C("Trash partially cleared"),description:C("{{succeeded}} items deleted, {{failed}} items failed",{succeeded:i,failed:o}),placement:"bottomRight"}):w.error({id:"TRASH_CLEAR_FAILED",message:C("Failed to clear trash"),placement:"bottomRight"})}he(!1)}catch(e){console.error("Error clearing trash:",e),w.error({id:"TRASH_CLEAR_ERROR",message:C("Error clearing trash"),placement:"bottomRight"}),he(!1)}},[qe,O,Te,w,C,b]),yt=i.useCallback(()=>{he(!1)},[]),bt=i.useCallback(async e=>{var t;await Ue(e),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())},[Ue]),wt=i.useCallback(async e=>{var t;await Ve(e),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())},[Ve]),xt=i.useCallback(async()=>{let e=[],t=new Map;const r=null==I?void 0:I.config;await Me({onStartBatch:n=>{e=v.startUpload(qe||void 0,n),t=new Map,n.forEach((n,i)=>{const o=e[i];o&&(t.set(n.name,o),t.set(Dr(n.name,r),o))})},onStart:n=>{if(0===e.length){e=v.startUpload(qe||void 0,[n]);const i=e[0];i&&(t.set(n.name,i),t.set(Dr(n.name,r),i))}},onProgress:(e,r)=>{const n=t.get(e);n&&v.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==ke?void 0:ke.find(t=>t.name===e&&!t.isFolder);v.markAsSuccess(n,t)}await(null===(r=se.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&&v.markAsError(a,n)},onBatchComplete:async r=>{var n,i,o,a,s,l,c,u;for(let u=0;u<r.successes.length;u++){const d=r.successes[u],h=null===(n=r.uploadedFiles)||void 0===n?void 0:n.get(d),f=null!==(a=null!==(o=null!==(i=t.get(d))&&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:u<e.length?e[u]:void 0;if(f){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:d,folderId:null!==(c=null!==(l=t.folderId)&&void 0!==l?l:qe)&&void 0!==c?c:null,isFolder:!1,size:t.size}}else await new Promise(e=>setTimeout(e,100)),e=null==ke?void 0:ke.find(e=>e.name===d&&!e.isFolder);v.updateProgress(f,100),v.markAsSuccess(f,e)}}r.errors.forEach(({fileName:e,error:r})=>{const n=t.get(e);n&&v.markAsError(n,r)}),await(null===(u=se.current)||void 0===u?void 0:u.refreshFileCounts())}})},[Me,v,ke,qe,null==I?void 0:I.config]),Ct=i.useCallback(async(e,t,r,n)=>{var i,o;try{ue(!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=v.startUploadByUrl(qe||void 0,a);try{const r=await Re(e,t,!0,null!=n?n:"uploadByUrl");if(v.updateProgress(s,100),r){await new Promise(e=>setTimeout(e,100));const e=(null==ke?void 0:ke.find(e=>e.id===r.id&&!e.isFolder))||r;v.markAsSuccess(s,e)}else v.markAsSuccess(s);await(null===(o=se.current)||void 0===o?void 0:o.refreshFileCounts())}catch(e){const t=No(e),r=Bo(t,C);v.markAsError(s,r)}}finally{ue(!1)}},[Re,v,qe,ke,C]),_t=i.useCallback(async({file:e})=>{var t;const r=v.startUpload(qe||void 0,[e])[0];let n=0;const i=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),v.updateProgress(r,n)},200);try{const n=await y.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),v.updateProgress(r,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==ke?void 0:ke.find(e=>e.id===n.id&&!e.isFolder))||n;v.markAsSuccess(r,e)}else v.markAsSuccess(r);const o=n&&n.folderId||qe||null;return Xe&&Xe(o&&"folders"!==o?o:"folders"),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts()),n}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw v.markAsError(r,t),e}},[y,v,qe,ke,Xe]),St=i.useCallback(async e=>{var t;if(De){const r=v.startUpload(qe||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),v.updateProgress(n,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await De(e),r.forEach(e=>{v.updateProgress(e,100),v.markAsSuccess(e)}),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())}},[De,v,qe]),kt=i.useCallback(async e=>{var t;await Pe(e),await ye(),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())},[Pe,ye]),At=(({files:e,clearSelection:t,showRenameModal:r,showMoveModal:i,showCopyModal:o,handleDeleteFile:a,handleDeleteFolder:s,showDeleteConfirm:l,onEdit:c})=>{const u=n.useCallback(()=>{t()},[t]),d=n.useCallback(e=>{const t=Ya.getState().selectedFiles;if(t&&1===t.size||e){const n=e||Array.from(t)[0];r(n)}},[r]),h=n.useCallback(t=>{const r=Ya.getState().selectedFiles;if(r&&r.size>0||(null==t?void 0:t.id)){if(l)return void l();(t?[t.id]:r).forEach(t=>{const r=e.find(e=>e.id===t);r?r.isFolder?s(t):a(t):console.warn(`Объект с ID ${t} не найден в списке файлов`)})}},[e,a,s,l]);return{handleClearSelection:u,handleRename:d,handleDeleteSelected:h,handleCopy:n.useCallback(()=>{o()},[o]),handleMove:n.useCallback(()=>{i()},[i]),handleEdit:n.useCallback(()=>{c()},[c])}})({files:ke||[],clearSelection:pe,showRenameModal:Le,showMoveModal:ze,showCopyModal:f.actions.showCopyModal||(()=>{}),handleDeleteFile:Oe,handleDeleteFolder:kt,showDeleteConfirm:$e,onEdit:at.handleEdit}),It=ve||Ae||st;a(()=>{Sr()},[]),x(()=>{G!==rr?pe():ge(ke||[])},[G,ke,ge,pe]),a(()=>{if(!E||G!==rr)return;if(!ur.current)return void(ur.current=!0);const e=(Array.isArray(ke)?ke:[]).filter(e=>fe.has(e.id));E(e)},[G,ke,fe,E]),i.useEffect(()=>{if(!Xe||0===me.length)return;const e=!1!==(null==T?void 0:T.rememberLastFolder),t=`em_fm:lastFolder:${(null==T?void 0:T.projectId)||"default"}`;if(e&&"undefined"!=typeof window)try{const e=localStorage.getItem(t),r=e&&me.some(t=>t.id===e);if(r)return void Xe(e)}catch(e){}qe||Xe("folders")},[qe,Xe,me,null==T?void 0:T.rememberLastFolder,null==T?void 0:T.projectId]);const{handleRenameFolderCancel:Et,handleRenameFolderOk:Ft}=Se.actions;a(()=>{const e=async e=>{if(G!==rr)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 St(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 Ct(r);else if(r.includes("<meta")||r.includes("http")){const t=r.match(/https?:\/\/[^\s"']+/);t&&(e.preventDefault(),await Ct(t[0]))}})};return document.addEventListener("paste",e),()=>{document.removeEventListener("paste",e)}},[G,Ct,St]);const Tt=u(Ze);a(()=>{Tt.current=Ze},[Ze]);const Ot=c(e=>{it(e.current||Tt.current.current,e.pageSize||Tt.current.pageSize)},[it]),Pt=c(e=>{null==Ke||Ke(e)},[Ke]),Mt=i.useCallback(e=>{const{sortBy:t,sortOrder:r}=(e=>{const[t,r]=e.split("-");return{sortBy:t,sortOrder:r}})(e);nt(t,r)},[nt]),[Rt,Lt]=o(rN),[Nt,jt]=o([]),Dt=u(null),[zt,Bt]=o(vr),[Ut,Vt]=o([]),Ht=u(null),[$t,Wt]=o(""),Gt=u(null),[qt,Yt]=o(""),[Xt,Kt]=o([]),Zt=i.useRef(void 0),[Jt,Qt]=o(!1),[er,tr]=o(!1),cr=i.useRef(null),ur=i.useRef(!1),dr=i.useRef(G),hr=i.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})},[]),fr=i.useCallback(async e=>{var t;const r=v.startUpload(qe||void 0,[e])[0];let n=0;const i=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),v.updateProgress(r,n)},200);try{const n=await y.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),v.updateProgress(r,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==ke?void 0:ke.find(e=>e.id===n.id&&!e.isFolder))||n;v.markAsSuccess(r,e)}else v.markAsSuccess(r);await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw v.markAsError(r,t),e}},[v,ke,y,qe]),pr=c(async e=>{if(Boolean(e&&e.startsWith("data:"))){const t=hr(e);if(!t)return;return void await fr(t)}e&&await Ct(e,void 0,void 0,"iconStock")},[hr,Ct,fr]),yr=c(async()=>{const e=null==K?void 0:K.fileForEdit;if(Zt.current===e)return;if(G===sr&&e&&!at.editingFile){Zt.current=e;try{if("string"==typeof e){if(e.startsWith("data:"))return void(null==at||at.handleEdit({thumbnail:e,saveWithoutFolder:!0}));const t=await y.resolveFileForEditByUrl(e);Zt.current===e&&(null==at||at.handleEdit(t))}}catch(t){Zt.current===e&&(Zt.current=null),console.error("Failed to open file in editor:",t),null==at||at.handlePixieEditorClose()}}},[null==K?void 0:K.fileForEdit,G,at,y]);a(()=>{yr()},[yr]),a(()=>{var e,t,r,n;const i=dr.current;dr.current=G,G===rr?(jt([]),Lt(rN),Vt([]),Bt(vr),Kt([]),Yt(""),tr(!1),Qt(!1),i===rr||i!==ir&&i!==nr&&i!==ar||rt("")):G===ar?null===(e=cr.current)||void 0===e||e.focus():G===nr?null===(t=Dt.current)||void 0===t||t.focus():G===ir?null===(r=Ht.current)||void 0===r||r.focus():G===or&&(null===(n=Gt.current)||void 0===n||n.focus())},[G,rt]);const br=i.useCallback(async()=>{var e;await Ft(),await(null===(e=se.current)||void 0===e?void 0:e.refreshFileCounts())},[Ft]),wr=fe.size,xr=i.useMemo(()=>{var e,t,r;if(1!==wr)return!1;const[n]=Array.from(fe),i=ke.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&&mr.includes(s)},[wr,fe,ke]),Cr=c(e=>{var t;return e?(null===(t=e.files)||void 0===t?void 0:t.length)?Array.from(e.files):e.items?Array.from(e.items).map(e=>e.getAsFile()).filter(e=>Boolean(e)):[]:[]},[]);return t(r,{children:[ne&&pt===rr&&Fe(e("div",{className:ys.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"))&&!ae.current&&re(!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"))&&re(!0)},onDragLeave:e=>{const t=e.relatedTarget;t&&document.documentElement.contains(t)||(re(!1),ie(!1),document.body.removeAttribute("data-fm-dragging"))},onDrop:e=>{e.preventDefault(),e.stopPropagation(),ie(!1),re(!1),document.body.removeAttribute("data-fm-dragging");const t=Cr(e.dataTransfer);t.length&&(lt(!0),De(t).catch(e=>{"StaleLoad"!==(null==e?void 0:e.name)&&console.error(e)}).finally(()=>lt(!1)))},"aria-hidden":"true"}),document.body),te&&Fe(e("div",{className:ys.dragOverlayGlobal,"data-drop-overlay":"true",onDragOver:e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},onDragEnter:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),e.stopPropagation(),re(!1),ie(!1),document.body.removeAttribute("data-fm-dragging");const t=Cr(e.dataTransfer);t.length&&(lt(!0),De(t).catch(e=>{"StaleLoad"!==(null==e?void 0:e.name)&&console.error(e)}).finally(()=>lt(!1)))},"aria-hidden":"true",children:t("div",{className:ys.dragOverlayInner,children:[e("div",{className:ys.uploadIcon,children:e(Z,{})}),e("div",{className:ys.textTitle,children:C("Drop files here to upload")}),e("div",{className:ys.textDescription,children:C("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),document.body),e(J,{className:"file-manager__layout",children:t("div",{className:ys.filesContainer,"data-files-container":"true",onDragOver:dt,onDragLeave:ut,onDragEnter:ct,onDrop:ht,children:[Q&&e("div",{className:ys.dragOverlay,children:t("div",{className:ys.dragOverlayInner,children:[e("div",{className:ys.uploadIcon,children:e(Z,{})}),e("div",{className:ys.textTitle,children:C("Drop files here to upload")}),e("div",{className:ys.textDescription,children:C("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),m.showResizeGuide&&e("div",{className:"resize-guide",style:{left:`${m.resizeGuidePosition}px`}}),t(J,{className:"file-manager__content",children:[t(eN,{width:320,theme:"light",className:"file-manager-sider",children:[e(al,{ref:se,selectedFolder:qe||"folders",generateMenuItems:_e,onFolderSelect:e=>null==Xe?void 0:Xe(e),folders:me||[],fetchFolders:ye,fetchChildFolders:be,handleAddFile:xt,setIsUrlModalVisible:e=>null==q?void 0:q(e),handleDeleteFolder:kt,handleCreateFolder:we,activeLibraryItem:G,setActiveLibraryItem:e=>null==Y?void 0:Y(e)}),e("div",{className:"sidebar-resizer "+(m.isResizing?"resizing":""),onMouseDown:m.handleResizeStart,onDoubleClick:m.handleDoubleClick,children:e("div",{className:"sidebar-resizer-indicator"})})]}),t(J,{className:"file-manager__main-content",children:[st&&e(Qs,{style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,zIndex:100,background:"var(--colorBgLayout)"}}),t(tN,{className:"main-content",children:[e(dL,{activeLibraryItem:G,selectedFolder:(null===(s=null==me?void 0:me.find(e=>(null==e?void 0:e.id)===qe))||void 0===s?void 0:s.name)||C("Folders"),isTrashFolder:"Trash"===qe,onClearTrash:mt,files:ke||[],loading:It,onRefresh:ot,refreshDisabled:Ae||ve,showRefresh:!(!(null===(l=null==I?void 0:I.apiEndpoints)||void 0===l?void 0:l.clearCache)&&!(null===(d=null==I?void 0:I.dataProviders)||void 0===d?void 0:d.clearCache))}),e(X,{className:"zero-divider"}),G===rr&&e(Vs,{searchTerm:Qe,handleAddFile:xt,files:ke||[],handleSearch:rt,sortBy:et,sortOrder:tt,handleSortOptionChange:Mt,pagination:Ze,setPagination:Ot,loading:It,handleItemClick:Pt,onClearSelection:At.handleClearSelection,onRename:At.handleRename,onCopy:At.handleCopy,onMove:At.handleMove,onDelete:At.handleDeleteSelected,showRenameModal:Le,showDeleteConfirm:$e,showCopyModal:f.actions.showCopyModal||(()=>{}),showMoveModal:ze,onEdit:at.handleEdit,getFileData:y.getFileData}),G===nr&&e(bL,{imageGifList:Nt,setImageGifList:jt,currentReqGif:Rt,setCurrentReqGif:Lt,inputRef:Dt,customRequest:(e,t)=>Ct(e,void 0,t,"gif")}),G===ir&&e(_L,{imageStockList:Ut,setImageStockList:Vt,currentReq:zt,setCurrentReq:Bt,inputRef:Ht,customRequest:(e,t)=>Ct(e,void 0,t,"imageStock")}),G===or&&e(JL,{apiKey:null==K?void 0:K.STREAMLINE_API_KEY,customRequest:pr,query:$t,setQuery:Wt,inputRef:Gt}),G===ar&&!!(null==K?void 0:K.sseQuery)&&e(ML,{imageAiList:Xt,setImageAiList:Kt,aiImageRequest:qt,setAiImageRequest:Yt,inputAiRef:cr,customRequest:_t,isLoadingAi:Jt,setIsLoadingAi:Qt,isImageUploaded:er,setIsImageUploaded:tr}),G===sr&&e(r,{}),e(r,{children:xr&&t(r,{children:[e(X,{className:"zero-divider"}),e("div",{style:{display:"flex",justifyContent:"right",padding:"17px 24px",alignItems:"center"},children:e(M,{size:"large",type:"primary",style:{height:40},onClick:()=>{if(_.onEditorOk){const e=Array.from(fe)[0],t=ke.find(t=>t.id===e);t&&_.onEditorOk(t)}},children:C("Choose")})})]})})]})]})]}),ce&&!v.isUploadVisible&&e("div",{style:{position:"fixed",inset:0,zIndex:1500,backgroundColor:"rgba(255, 255, 255, 0.5)",pointerEvents:"all",display:"flex",alignItems:"center",justifyContent:"center"},children:e(S,{size:"large"})}),e(il,{isModalVisible:z,handleModalOk:xe,handleModalCancel:Ce,form:P,selectedFolder:qe||null,folders:me||[],isUrlModalVisible:B,setIsUrlModalVisible:e=>null==q?void 0:q(e),handleAddFileByUrl:Ct,urlForm:R,isRenameModalVisible:Ie,handleRenameOk:()=>null==je?void 0:je(),handleRenameCancel:()=>null==Ne?void 0:Ne(),renameForm:L,fileToRename:Ee,files:ke||[],isMoveModalVisible:U,handleMoveOk:bt,handleMoveCancel:Be,moveForm:N,selectedFiles:fe||new Set,isRenameFolderModalVisible:V,handleRenameFolderOk:br,handleRenameFolderCancel:Et,renameFolderForm:j,folderToRename:W,isCopyModalVisible:H,handleCopyOk:wt,handleCopyCancel:He,copyForm:D,isDeleteConfirmVisible:$,handleDeleteConfirmOk:gt,handleDeleteConfirmCancel:()=>null==We?void 0:We(),isClearTrashConfirmVisible:de,handleClearTrashConfirm:vt,handleClearTrashCancel:yt,fetchChildFolders:be}),e(MR,{visible:at.isPixieEditorVisible,onClose:at.handlePixieEditorClose,file:at.editingFile,onSave:at.handlePixieEditorSave,onSaveCopy:at.handlePixieEditorSaveCopy}),e(lL,{files:v.uploadFiles,visible:v.isUploadVisible,minimized:v.isUploadMinimized,totalFiles:v.totalFiles,completedFiles:v.completedFiles,onClose:v.closeUpload,onMinimize:v.minimizeUpload,onInsert:e=>{var t;const r=v.getUploadedFile(e.id)||e;null===(t=_.onEditorOk)||void 0===t||t.call(_,r)}})]})})]})},iN=f(({config:n={},onPathChange:o,onChangeSelection:s,onEditorOk:l,searchQuery:c="",sortBySize:d="name",apiEndpoints:h={},customIcons:f,dragDropIcon:p,dataProviders:g,handleNotify:m,handleError:v,handleSuccess:y})=>{const b=i.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}),n.fileNameProcessing),folderNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),n.folderNameProcessing)},n),[n]);i.useEffect(()=>{b.theme&&(e=>{if("system"===e){const t=matchMedia(hr).matches?ur:cr;e=e===dr?t:e}document.documentElement.setAttribute("data-theme",e)})(b.theme),QL(b)},[b]),a(()=>{b.locale&&b.locale!==On.language&&On.changeLanguage(b.locale),b.customLocale&&b.locale&&On.addResourceBundle(b.locale,"translation",b.customLocale,!0,!0)},[b.locale,b.customLocale]);const w=u(null),x=i.useMemo(()=>({apiEndpoints:h,searchQuery:c,sortBySize:d,onPathChange:o,onChangeSelection:s,onEditorOk:l,config:b,customIcons:f,dragDropIcon:p,dataProviders:g,handleNotify:m,handleError:v,handleSuccess:y}),[h,c,d,o,s,l,b,f,p,g,m,v,y]);return e(I,{className:"em-filemanager",children:t(r,{children:[e(A,{getPopupContainer:()=>w.current||document.body,children:e(go,{options:x,children:e(nN,{})})}),e("div",{ref:w,className:"file-manager-modal-root"})]})})});iN.displayName="FileManagerApp";const oN=t=>{var r,n,i;return e(Xn,{i18n:On,children:e(wr,{externalTheme:null!==(n=null===(r=t.config)||void 0===r?void 0:r.theme)&&void 0!==n?n:"light",customThemeToken:null===(i=t.config)||void 0===i?void 0:i.customTheme,children:e(oe,{children:e(iN,Object.assign({},t))})})})},aN=new Map,sN=(t,r)=>{var n;let i;Sr();let o={};const a=e=>{const t=!e||"fileManager"!==e.mode&&"imageCenter"!==e.mode&&"plugin"!==e.mode?void 0:e.mode;return"imageCenter"===t?Cr("imageCenter",e):Cr(t)};if(t instanceof HTMLElement){i=t;o={config:a(r),apiEndpoints:null==r?void 0:r.apiEndpoints}}else{i=t.element;const e=a(t.config),r=Object.assign(Object.assign({},null===(n=t.config)||void 0===n?void 0:n.apiEndpoints),t.apiEndpoints);o={config:e,currentPath:t.currentPath,onPathChange:t.onPathChange,onChangeSelection:t.onChangeSelection,searchQuery:t.searchQuery,sortBySize:t.sortBySize,apiEndpoints:r,dataProviders:t.dataProviders,customIcons:t.customIcons,dragDropIcon:t.dragDropIcon,handleNotify:t.handleNotify,handleError:t.handleError,handleSuccess:t.handleSuccess}}const s=_(i);s.render(e(oN,Object.assign({},o))),aN.set(i.id||`container_${Date.now()}`,s)},lN=e=>{const t=e.id||Object.keys(aN).find(e=>e.startsWith("container_"));if(t&&aN.has(t)){const e=aN.get(t);null==e||e.unmount(),aN.delete(t)}else{console.warn("Couldn t find the root to unmount");try{_(e).unmount()}catch(e){console.error("Error unmounting the component:",e)}}},cN=new Map,uN=n=>{const{onClose:o,onSave:s,dataProviders:l,theme:c,locale:d,hasPagination:h,disablePagination:f,paginationAvailable:p,dedupeUploadNamesOnClient:g,saveCopyToCurrentFolder:m}=n,v=i.useMemo(()=>{var e,t;return{theme:null!=c?c:"light",locale:d,baseUrl:n.baseUrl,assetsUrl:n.assetsUrl,compressMaxSize:n.compressMaxSize,compressMaxWidthOrHeight:n.compressMaxWidthOrHeight,compessorUrl:null!==(e=n.compessorUrl)&&void 0!==e?e:n.compressorUrl,compressorUrl:null!==(t=n.compressorUrl)&&void 0!==t?t:n.compessorUrl,showNotifications:n.showNotifications,handleFileProxy:n.handleFileProxy,hasPagination:h,disablePagination:f,paginationAvailable:p,dedupeUploadNamesOnClient:g,saveCopyToCurrentFolder:m}},[c,d,n.baseUrl,n.assetsUrl,n.compressMaxSize,n.compressMaxWidthOrHeight,n.compessorUrl,n.compressorUrl,n.showNotifications,n.handleFileProxy,h,f,p,g,m]),y=i.useCallback(async(e,t,r,n)=>{if(!e&&!t||!(null==l?void 0:l.getFiles))return null;try{const i=await l.getFiles({folderId:n?void 0:r||void 0,noFolder:n,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 console.warn("Standalone Pixie: failed to resolve uploaded file from provider",e),null}},[l]),b=i.useMemo(()=>{if(n.file)return n.file;const e=n.name||"edited-image",t=n.extension||(n.type?n.type.split("/")[1]:"png"),r=n.type||`image/${t}`;return{thumbnail:n.imageDataUrl||"",name:e,id:void 0,type:r,extension:t,saveWithoutFolder:!0}},[n.file,n.imageDataUrl,n.name,n.extension,n.type]),w=i.useCallback(async(e,t)=>{if((null==l?void 0:l.updateFile)&&e.thumbnail)try{const r=(null==t?void 0:t.mimeType)||Er(e.thumbnail,e.type),n=Fr(r),i=e.name.substring(0,e.name.lastIndexOf("."))+"."+n,o=(null==t?void 0:t.blob)||Mr(e.thumbnail,r);return await l.updateFile(e.id,{name:i,type:r,data:o})}catch(e){return console.error("Error updating the file through updateFile:",e),null}return console.warn("DataProvider for updating files is not configured"),null},[l]),x=i.useCallback(async(e,t)=>{var r,n,i,o,a,s;if(!e.thumbnail)return null;try{const c=!0!==v.saveCopyToCurrentFolder||(null!==(r=e.saveWithoutFolder)&&void 0!==r?r:!e.id),u=c?"":e.folderId||"",d=(null==t?void 0:t.mimeType)||Er(e.thumbnail,e.type),h=(null==t?void 0:t.blob)||Mr(e.thumbnail,d),f=Dr(e.name,v),p=await hi(l,f,u,c,Br(v)),g=new File([h],p,{type:d,lastModified:Date.now()});if(null==l?void 0:l.uploadFiles){const t=await l.uploadFiles({items:[{name:g.name,size:g.size,type:g.type,folderId:u,noFolder:c,data:g,extension:Fr(d)}],folderId:u}),r=null===(n=t.detailed)||void 0===n?void 0:n[0];if(t.success&&(null==r?void 0:r.success)&&r.data){const t=r.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||g.type,size:null!==(o=t.size)&&void 0!==o?o:g.size,extension:t.extension||Fr(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};const n=await y(r.data.id,r.data.name||g.name,null!==(a=r.data.folderId)&&void 0!==a?a:u,c);return n||{id:r.data.id||e.id||"",name:r.data.name||e.name,folderId:null!==(s=r.data.folderId)&&void 0!==s?s:u,type:g.type,size:g.size,extension:Fr(d),url:r.data.url,thumbnailUrl:r.data.thumbnailUrl,thumbnail:r.data.thumbnail,isFolder:!1,selected:!1}}}return(null==l?void 0:l.uploadFile)?await l.uploadFile({name:g.name,size:g.size,type:g.type,folderId:u,noFolder:c,data:g,extension:Fr(d)}):null}catch(e){return console.error("Error saving file copy:",e),null}},[l,y,v]),C=i.useCallback(async(e,t)=>{if((null==l?void 0:l.updateFile)&&e.id&&e.thumbnail)try{const r=await w(e,t);r&&(e=r)}catch(e){console.error("Standalone Pixie: saveFileToServer error",e)}return s&&await s(e,t),o&&o(),e},[l,s,o,w]),_=i.useCallback(async(e,t)=>{let r=e;if(e.thumbnail)try{const n=await x(e,t);n&&(r=n)}catch(e){console.error("Standalone Pixie: saveFileCopyToServer error",e)}return s&&await s(r,t),o&&o(),r},[o,s,x]),S=u(null);return a(()=>{d&&d!==On.language&&On.changeLanguage(d)},[d]),e(I,{className:"em-filemanager",children:t(r,{children:[e(A,{getPopupContainer:()=>S.current||document.body,children:e(Xn,{i18n:On,children:e(wr,{externalTheme:null!=c?c:"light",children:e(oe,{children:e(go,{options:{dataProviders:l,handleNotify:n.handleNotify,handleError:n.handleError,handleSuccess:n.handleSuccess,config:v},children:e(MR,{visible:!0,onClose:o,file:b,onSave:C,onSaveCopy:_})})})})})}),e("div",{ref:S,className:"file-manager-modal-root"})]})})},dN=t=>{Sr();const r=t.element,n=_(r);n.render(e(uN,Object.assign({},t))),cN.set(r.id||`pixie_container_${Date.now()}`,n)},hN=e=>{const t=Array.from(cN.keys()).find(e=>e.startsWith("pixie_container_")),r=e.id||t;if(r&&cN.has(r)){const e=cN.get(r);null==e||e.unmount(),cN.delete(r)}else{console.warn("Couldn t find the root to unmount Pixie");try{_(e).unmount()}catch(e){console.error("Error unmounting Pixie:",e)}}},fN=e=>{var t,r;const{mode:n,element:i,fileManager:o,pixieEditor:a,theme:s,dataProviders:l}=e;let c,u;const d={unmount:()=>{c&&lN(c),u&&hN(u)},unmountFileManager:void 0,unmountPixieEditor:void 0};switch(n){case"fileManager":c=i,sN(i,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),d.unmountFileManager=()=>lN(c);break;case"pixieEditor":u=i,dN(Object.assign({element:i,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),d.unmountPixieEditor=()=>hN(u);break;case"both":{const e=document.createElement("div");e.id="file-manager-container",e.style.cssText="height: 50%; border-bottom: 1px solid #d9d9d9;";const t=document.createElement("div");t.id="pixie-editor-container",t.style.cssText="height: 50%;",i.appendChild(e),i.appendChild(t),c=e,u=t,sN(c,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(r=null==o?void 0:o.config)||void 0===r?void 0:r.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),dN(Object.assign({element:u,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),d.unmountFileManager=()=>lN(c),d.unmountPixieEditor=()=>hN(u);break}}return d};function pN(e,t="BackendError"){switch(e){case 400:return"ValidationError";case 401:return"AuthenticationFailed";case 403:return"AuthorizationFailed";case 404:return"FileNotFound";case 413:return"PayloadTooLarge";case 415:return"UnsupportedMediaType";case 429:return"RateLimitExceeded";case 500:return"BackendError";case 503:return"ServiceUnavailable";case 504:return"Timeout";default:return t}}var gN={init:sN,unmount:lN,initPixieEditor:dN,unmountPixieEditor:hN,initFileManager:fN};export{Vs as FileContent,qo as FileManagerApiError,iN as FileManagerApp,oN as FileManagerAppWithContext,il as FileModals,al as FolderSidebar,uN as PixieOnlyApp,gN as default,sN as init,fN as initFileManager,dN as initPixieEditor,Sr as installResizeObserverErrorHandler,pN as mapHttpStatusToErrorCode,kr as uninstallResizeObserverErrorHandler,lN as unmount,hN as unmountPixieEditor};
61
+ function eR(){return eR=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},eR.apply(this,arguments)}new Promise(()=>{});const tR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch{}const rR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,iR=n.forwardRef(function(e,t){let r,{onClick:i,relative:o,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,tR),{basename:p}=n.useContext($M),g=!1;if("string"==typeof u&&nR.test(u)&&(r=u,rR))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;qM()||TM(!1);let{basename:i,navigator:o}=n.useContext($M),{hash:a,pathname:s,search:l}=ZM(e,{relative:r}),c=s;return"/"!==i&&(c="/"===s?i:jM([i,s])),o.createHref({pathname:c,search:l,hash:a})}(u,{relative:o}),v=function(e,t){let{target:r,replace:i,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=KM(),u=YM(),d=ZM(e,{relative:s});return n.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!==i?i:OM(u)===OM(d);c(e,{replace:r,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l})}},[u,c,d,i,o,r,e,a,s,l])}(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:o,unstable_viewTransition:h});return n.createElement("a",eR({},f,{href:r||m,onClick:g||a?i:function(e){i&&i(e),e.defaultPrevented||v(e)},ref:t,target:c}))});var oR,aR;!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(oR||(oR={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(aR||(aR={}));const sR=ef(e("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"),lR=ef(e("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"),cR={opacity:0,y:50,scale:.3},uR={opacity:1,y:0,scale:1},dR={opacity:0,scale:.5};function hR(){const r=Am(e=>e.toasts);return e("div",{className:"pointer-events-none relative",children:e(_x,{initial:!1,children:r.map(r=>e("div",{className:Zh("fixed z-toast mx-auto p-20","bottom-center"===r.position?"bottom-0 left-0 right-0":"bottom-0 right-0"),children:t(mx.div,{initial:r.disableEnterAnimation?void 0:cR,animate:r.disableEnterAnimation?void 0:uR,exit:r.disableExitAnimation?void 0:dR,className:Zh("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 e;return null==(e=r.timer)?void 0:e.pause()},onPointerLeave:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},role:"alert","aria-live":"danger"===r.type?"assertive":"polite",children:["danger"===r.type&&e(sR,{className:"flex-shrink-0 text-danger",size:"md"}),"loading"===r.type&&e(nO,{size:"sm",className:"flex-shrink-0",isIndeterminate:!0}),"positive"===r.type&&e(lR,{className:"flex-shrink-0 text-positive",size:"md"}),e("div",{className:"mr-auto w-max overflow-hidden overflow-ellipsis","data-testid":"toast-message",children:e(GA,{value:r.message})}),r.action&&e(P_,{variant:"text",color:"primary",size:"sm",className:"flex-shrink-0",onFocus:()=>{var e;return null==(e=r.timer)?void 0:e.pause()},onBlur:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},onClick:()=>Im().remove(r.id),elementType:iR,to:r.action.action,children:e(GA,{value:r.action.label})}),"loading"!==r.type&&e($A,{onFocus:()=>{var e;return null==(e=r.timer)?void 0:e.pause()},onBlur:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},type:"button",className:"flex-shrink-0",onClick:()=>{Im().remove(r.id)},size:"sm",children:e(oI,{})})]})},r.id))})})}function fR(e){return Ux()?e.metaKey:e.ctrlKey}function pR(e){switch(e.key){case"z":fR(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?mm().history.redo():mm().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),mm().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),mm().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),mm().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),mm().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),mm().objects.delete();break;case"v":fR(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&&mm().import.addImageFromData(e.target.result)},void n.readAsDataURL(r)}}catch(e){console.error(e)}}())}}const gR=new Map,mR=new Map,vR={};async function*yR(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 bR(e);yield new i_(t,e.fullPath)}else e.isDirectory&&(yield*yR(e))}while(r.length>0)}function bR(e){return new Promise((t,r)=>e.file(t,r))}function wR(e){return null!=vR.dragTargetId?gR.get(vR.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 e of t)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await bR(e);yield new i_(t,e.fullPath)}else e.isDirectory&&(yield*yR(e))}(e.dataTransfer))}:void 0}function xR(){const r=pm(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible})??!0,n=pm(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.nav)?void 0:r.position})??"bottom",i=pm(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.menubar)?void 0:r.position})??"top",o=pm(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,s=u(null),l=u(null),{isModal:d,isMobile:h}=aI(),f=c(async e=>{var t,r;if(gm().activeTool||gm().dirty||"nativeFile"!==e.type)return;const n=await e.getData();mm().import.fileIsValid(n[0])&&((null==(r=null==(t=gm().config.tools)?void 0:t.import)?void 0:r.openDroppedImageAsBackground)?await mm().import.openBackgroundImage(n[0]):await mm().import.openUploadedFile(n[0]))},[]),{droppableProps:p}=function({id:e,disabled:t,ref:r,...n}){const i=u({dragOverElements:new Set,dropActivateTimer:void 0}).current,o=u(n);o.current=n,x(()=>(mR.set(e,{...mR.get(e),disabled:t,id:e,ref:r}),()=>{mR.delete(e)}),[e,o,t,r]);const a=e=>{var t;const n=o.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))},s=e=>{var t,r;const n=wR(e);n&&(null==(r=(t=o.current).onDragLeave)||r.call(t,n))};return{droppableProps:t?{}:{onDragOver:e=>{var t,r;e.preventDefault(),e.stopPropagation();const n=wR(e);n&&a(n)&&(null==(r=(t=o.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=wR(e);n&&a(n)&&(null==(r=(t=o.current).onDragEnter)||r.call(t,n),clearTimeout(i.dropActivateTimer),"function"==typeof o.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;n&&(null==(t=(e=o.current).onDropActivate)||t.call(e,n))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const t of i.dragOverElements)e.currentTarget.contains(t)||i.dragOverElements.delete(t);if(i.dragOverElements.size>0)return;const t=wR(e);t&&a(t)&&(s(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,r,n,l;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),s(e),clearTimeout(i.dropActivateTimer);const c=wR(e);c&&(null==(r=(t=o.current).onDragLeave)||r.call(t,c),a(c)&&(null==(l=(n=o.current).onDrop)||l.call(n,c)))}}}}({id:"pixie-root",ref:l,types:["nativeFile"],onDrop:f});a(()=>{var e,t;gm().fabric||(pm.setState({canvasRef:s}),__(s.current),null!=(e=gm().config.ui)&&e.defaultTool&&gm().setActiveTool(null==(t=gm().config.ui)?void 0:t.defaultTool,null),mm().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=gm().config).onLoad)||t.call(e,gm().editor)}));const r=S_(l,()=>{gm().setStageSize(k_(l.current))}),n=S_(s,()=>{gm().setCanvasSize(k_(s.current))});return()=>{r(),n()}},[l]);const g=Zh("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!d,"fixed inset-0 w-full h-full z-20":d,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":d&&!h});return t(Sx,{features:Ax,strict:!0,children:[d&&r&&!h&&o&&e($A,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{gm().editor.close()},children:e(oI,{})}),d&&r&&e(qk,{position:"fixed",disableInitialTransition:!0}),t(mx.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:r?"visible":"hidden",className:g,children:["top"===i&&e(fI,{}),"top"===n&&e(lM,{className:"pt-14"}),t("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...Dx(p,{onKeyDownCapture:pR}),ref:l,children:[e(gI,{}),e(qE,{ref:s})]}),e(ZO,{}),"bottom"===n&&e(lM,{}),"bottom"===i&&e(fI,{}),e(AM,{}),e(hR,{})]})]})}!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:[]};if(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);else if(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})}})}(),bl.enableBoundaryChecking(!1);const CR=class t{constructor(t){if(ll(this,"tools",{}),ll(this,"fabric",null),t.sentryDsn&&function(e){const t={...e};kd(t,"react"),Nh(t)}({dsn:t.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'),!t.selector)throw new Error('Pixie required "selector" option.');const r=document.querySelector(t.selector);r&&(r.classList.add("pi"),function(e){sm=e,lm=e}(r),this.setConfig(t),pm.setState({editor:this}),_(r).render(e(i.StrictMode,{children:e(xR,{})})))}get state(){return gm()}get defaultConfig(){return t.defaultConfig}open(e={}){return new Promise(async t=>{var r;Object.keys(e).length?await this.resetEditor({...Zp(e,{ui:{visible:!0},image:e.image||gm().config.image,state:e.state||gm().config.state,blankCanvasSize:e.blankCanvasSize||gm().config.blankCanvasSize})}):null!=(r=gm().config.ui)&&r.visible||gm().setConfig({ui:{visible:!0}}),t()})}close(){var e,t,r;null!=(e=gm().config.ui)&&e.visible&&(this.setConfig({ui:{visible:!1}}),null==(r=(t=gm().config).onClose)||r.call(t))}setConfig(e){gm().setConfig(e)}uploadAndAddImage(){return mm().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return mm().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return mm().import.uploadAndOpenStateFile()}newCanvas(e,t,r){return mm().canvas.openNew(e,t,r)}getState(e){return JSON.stringify(xm(e))}setState(e){return mm().import.loadState(e)}async setStateFromUrl(e){const t=await bm(e);return mm().import.loadState(t)}openTool(e){Cm(e)}applyChanges(){gm().applyChanges()}cancelChanges(){gm().cancelChanges()}async resetEditor(e){await ym(e),await mm().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&gm().togglePanel("history",!1),"history"===e&&gm().togglePanel("objects",!1),gm().togglePanel(e,t)}on(e,t){var r;null==(r=this.fabric)||r.on(e,t)}isDirty(){return gm().dirty}get(e){return this.tools[e]}notify(e){return Em(e)}static init(e){return new Promise(t=>{const r=e.onLoad;e.onLoad=e=>{null==r||r(e),t(e)},new this(e)})}};ll(CR,"defaultConfig",Sf),ll(CR,"version",_f);let _R=CR;function SR(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 kR="fm-pixie-editor";const AR=new class{constructor(){this._container=document.createElement("div"),this._instance=null,this._container.classList.add(kR),this._container.style.width="100%",this._container.style.height="85vh",this._container.style.minHeight="400px"}get className(){return`.${kR}`}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 _R.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=SR)}):console.warn("Pixie fabric instance is not available")}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 IR(e,t){if(!e)return t;if(!t)return e;return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function ER(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;const r=function(e){const t="undefined"!=typeof __webpack_public_path__?__webpack_public_path__:"";if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let r=IR(t,e||"");return!r||r.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(r)||(r="/"+r),r}(e),n=IR(r,t);return!n||n.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(n)?n:"/"+n}var FR,TR;!function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(FR||(FR={})),function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(TR||(TR={}));const OR=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob());function PR(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>{var e;return r(null!==(e=n.error)&&void 0!==e?e:new Error("Failed to convert blob to data URL"))},n.readAsDataURL(e)})}const MR=({visible:r,onClose:n,file:o,onSave:a,onSaveCopy:s})=>{var l;const{t:c}=Yn(),u=i.useRef(null),d=Oo(),h=Ha(),{options:f,actions:p}=po(),{i18n:g}=Yn(),{config:m}=f,{setCurrentMenuFile:v}=p,{getFileData:y,resolveFileForEditByUrl:b}=h,[w,x]=i.useState(!1),[C,_]=i.useState(null),[S,k]=i.useState(""),[A,I]=i.useState(!1),[E,F]=i.useState(!1),[T,O]=i.useState(null),P=i.useRef(!1),R=i.useRef(),L=i.useRef(),N=i.useRef("saveCopy"),j=i.useRef(void 0);R.current=a,L.current=s,i.useEffect(()=>{o&&!P.current&&(async()=>{if(j.current!==o)if("object"!=typeof o){j.current=o,x(!0);try{if(o.startsWith("data:"))O({thumbnail:o,saveWithoutFolder:!0});else{const e=await b(o);j.current===o&&O(e)}}catch(e){console.error("Failed to load file for editor:",e),j.current===o&&(j.current=null),null==n||n()}finally{x(!1)}}else O(o)})()},[o,n,b]);const D=i.useCallback(async e=>{try{if("string"==typeof e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await y(e.id,!0);if(!t)throw new Error(c("Error loading image"));return new Promise(e=>{const r=new FileReader;r.onload=()=>e(r.result),r.readAsDataURL(t)})}catch(e){throw console.error("Error getting the image data:",e),e}},[y,c]);i.useEffect(()=>{if(!C&&r&&T){let e=!1;const t=async()=>{var t,r,i;x(!0);try{const t=await D(T);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=Ta(T,"image/png");k(e.mimeType)}}catch(o){e||(d.error({id:"IMAGE_DOWNLOAD_FAILED",innerException:o,message:c("Error loading image"),placement:"bottomRight",data:{itemId:null!==(t=null==T?void 0:T.id)&&void 0!==t?t:void 0,itemName:null!==(r=null==T?void 0:T.name)&&void 0!==r?r:void 0,folderId:null!==(i=null==T?void 0:T.folderId)&&void 0!==i?i:null,thumbnail:null==T?void 0:T.thumbnail}}),null==n||n())}finally{x(!1)}};return t(),()=>{e=!0}}},[T,D,C,n,c,r]);const z=i.useCallback(async(e,t,r)=>{var n;let i=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 OR(n,Ar(r))}return OR(t,Ar(r))}(r,e),o=Ar(i.type||`image/${r}`);const a=null!==(n=null==m?void 0:m.compessorUrl)&&void 0!==n?n:null==m?void 0:m.compressorUrl;if(o.startsWith("image/"))try{const e=new File([i],t,{type:o}),r=await La(e,{maxSizeMB:null==m?void 0:m.compressMaxSize,maxWidthOrHeight:null==m?void 0:m.compressMaxWidthOrHeight,mimeType:o,fileName:t,libURL:a,enableCompression:Boolean(m)&&"image/gif"!==o});i=r,o=r.type}catch(e){console.warn("Image preparation failed, using original:",e)}return{blob:i,mimeType:o,thumbnailDataUrl:await PR(i)}},[m]),B=i.useCallback(async(e,t,r,n)=>{var i,o,a,s,l,u;const h="save"===n?R.current:L.current;if(!T||!h)return;const f="object"==typeof T&&null!==T?T:null;let p=null;try{x(!0);const{blob:o,mimeType:a,thumbnailDataUrl:s}=await z(e,t,r),l=Object.assign(Object.assign({},T),{thumbnail:s,size:o.size,date:(new Date).toISOString().split("T")[0],type:a,folderId:T.folderId||"",name:T.name||t,extension:T.extension||(null===(i=(T.name||t).split(".").pop())||void 0===i?void 0:i.toLowerCase())||""});p=l;const u={blob:o,mimeType:a,thumbnail:s,mode:n},d=await h(l,u);if(d)return x(!1),d;throw new Error(c("saveCopy"===n?"Failed to save image copy":"Failed to save changes"))}catch(e){console.error("Error saving:",e);const r=null!=p?p:f,i=e;if(!(null==i?void 0:i.notificationShown)){const i=No(e),h=null!==(a=null!==(o=Ro(null==i?void 0:i.code,c))&&void 0!==o?o:null==i?void 0:i.message)&&void 0!==a?a:c("saveCopy"===n?"Failed to save image copy":"Error saving image");d.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!==(l=null==r?void 0:r.name)&&void 0!==l?l:t,folderId:null!==(u=null==r?void 0:r.folderId)&&void 0!==u?u:null,thumbnail:null==r?void 0:r.thumbnail},innerException:e})}x(!1)}},[T,d,z,c]),U=i.useCallback(async e=>{var t;if(!AR.isLoaded()||!T)return void console.error("❌ Pixie instance or file is missing");N.current=e;const r=T.name||"edited-image",n=Ta(T,S);try{await(null===(t=AR.tools)||void 0===t?void 0:t.export.save(r.replace(/\.[^/.]+$/,""),n.pixieFormat,Oa.QUALITY))}catch(t){console.error("🎨 Error saving through the button:",t);try{const t=AR.canvas,i=t?t.toDataURL(n.mimeType):null;i&&await B(i,r,n.extension,e)}catch(e){console.error("🎨 Alternative method also did not work:",e)}}},[T,S,B]),V=i.useCallback(async()=>{var t;if(C&&r&&A&&!P.current)try{P.current=!0;const r=u.current;let i=0;for(;i<20&&(0===r.clientWidth||0===r.clientHeight);)await new Promise(e=>setTimeout(e,50)),i++;const o=(null==m?void 0:m.locale)?null==m?void 0:m.locale.replace("_","-"):"en",a=matchMedia(hr).matches?ur:cr,s=(null==m?void 0:m.theme)===dr?a:null==m?void 0:m.theme,l=((null==m?void 0:m.locale)||g.language||"en").split("-")[0].split("_")[0],c=(g.getResourceBundle(l,"translation")||{}).pixie||{},d=e=>e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),h={};Object.entries(c).forEach(([e,t])=>{const r=d(e);h[r]=t,h[e]=t});const f={[o]:h},p=Ta(T,S),v={selector:"#pixie-editor",baseUrl:ER((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:FR.TOP,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",align:"right",desktopOnly:!0,icon:()=>e(xe,{style:{fontSize:20}}),action:e=>{e.togglePanel("history")}},{type:"button",icon:()=>e(be,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:n}]},nav:{position:TR.TOP}},tools:{export:{defaultFormat:p.pixieFormat,defaultQuality:Oa.QUALITY,defaultName:(null===(t=null==T?void 0:T.name)||void 0===t?void 0:t.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{x(!0);return await B(e,t,r,N.current)}catch(e){throw console.error("🎨 PIXIE onSave ERROR:",e),x(!1),e}}};try{F(!1),await AR.show(v,u.current);const e=AR.canvas;e&&e.focus(),F(!0),x(!1)}catch(e){console.error("init pixie failed:",e)}}catch(e){console.error("Error initializing Pixie:",e),d.error({id:"EDITOR_INIT_FAILED",message:c("Error initializing editor"),placement:"bottomRight",innerException:e}),P.current=!1,null==n||n()}},[T,S,C,r,A,null==m?void 0:m.locale,null==m?void 0:m.theme,null==m?void 0:m.baseUrl,null==m?void 0:m.assetsUrl,n,B,d,g,c]);i.useEffect(()=>{r&&C&&A&&V()},[r,C,A,V]),i.useEffect(()=>{if(!r){try{AR.close()}catch(e){console.warn("Error closing Pixie:",e)}x(!1),_(null),k(""),P.current=!1,I(!1),F(!1)}return()=>{try{AR.close()}catch(e){console.warn("Error closing Pixie when unmounting:",e)}}},[r]);const H=Boolean(null==T?void 0:T.id)&&!1!==(null===(l=null==m?void 0:m.features)||void 0===l?void 0:l.enableUpdateFile);return e(G,{title:(null==T?void 0:T.name)?c("Editing: {{name}}",{name:T.name}):c("Editing image"),open:r,closeIcon:null,onCancel:n,afterOpenChange:e=>I(e),forceRender:!0,width:"100vw",style:{top:0,height:"100vh",maxWidth:"none",padding:10},styles:{body:{height:"85vh",padding:0}},footer:[e(M,{onClick:n,disabled:!A||w,children:c("Cancel")},"cancel"),e(M,{type:"primary",onClick:()=>U("saveCopy"),loading:w,children:c("Save as copy and choose")},"save-copy"),...H?[e(M,{type:"primary",onClick:()=>U("save"),loading:w,children:c("Save and choose")},"save")]:[]],maskClosable:!1,destroyOnHidden:!1,afterClose:()=>{v&&v("")},children:t("div",{ref:u,style:{position:"relative",width:"100%",height:"100%"},children:[r&&!E?e("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.45)",backdropFilter:"blur(1px)",pointerEvents:"all",zIndex:10},children:e("span",{style:{fontSize:14,color:"#555"},children:c("Loading editor...")})}):null,w&&E&&e(Qs,{style:{position:"absolute",top:0,background:"var(--colorBgLayout)",zIndex:100,opacity:.7}})]})})};var RR="uploadProgress",LR="uploadProgress__card",NR="uploadProgress__header",jR="uploadProgress__header-title",DR="uploadProgress__header-buttons",zR="uploadProgress__header-button",BR="uploadProgress__close-icon",UR="uploadProgress__body",VR="uploadProgress__common-error",HR="uploadProgress__common-error-row",$R="uploadProgress__common-error-hint",WR="uploadProgress__list-wrapper",GR="uploadProgress__status-icon",qR="uploadProgress__file-item",YR="uploadProgress__file-item--error",XR="uploadProgress__body--error",KR="uploadProgress__error-item",ZR="uploadProgress__error-message",JR="uploadProgress__error-hint",QR="uploadProgress__file-avatar",eL="uploadProgress__file-info",tL="uploadProgress__file-name",rL="uploadProgress__file-size",nL="uploadProgress__progress-bar",iL="uploadProgress__minimized",oL="uploadProgress__minimized-button",aL="uploadProgress__file-list";const{Text:sL}=T,lL=({visible:r,files:n,totalFiles:i,completedFiles:o,onClose:a,onMinimize:s,onInsert:l,minimized:c=!1})=>{var u;const{token:d}=k.useToken(),{t:h}=Yn();if(!r)return null;const f=t=>{switch(t){case"success":return e("div",{className:GR,children:e(Se,{style:{color:d.colorSuccess}})});case"error":return e(Ce,{style:{color:d.colorError}});default:return e(_e,{style:{color:"#1890ff"}})}},p=t=>"success"===t.status?[e(M,{type:"primary",size:"small",onClick:()=>l(t),children:h("Insert")},"insert")]:[];if(c)return e("div",{className:iL,children:e(M,{type:"primary",size:"small",onClick:s,className:oL,children:h("Upload progress",{completed:o,total:i})})});const g=n.filter(e=>"uploading"===e.status).length,m=n.filter(e=>"success"===e.status).length,v=n.filter(e=>"error"===e.status).length,y=n.filter(e=>"error"===e.status),b=y.length>1&&y.every(e=>{var t;return e.error&&e.error===(null===(t=y[0])||void 0===t?void 0:t.error)}),w=b?null===(u=y[0])||void 0===u?void 0:u.error:null;return e("div",{className:RR+" fm-upload-progress",children:t("div",{className:LR,children:[t("div",{className:NR,children:[e(sL,{strong:!0,className:jR,children:g>0?h("Uploading files",{completed:o,total:i}):m>0?h("Uploaded files",{success:m,total:i}):h("Upload error files",{errorCount:v})}),e("div",{className:DR,children:e(M,{type:"text",size:"small",icon:e(be,{className:BR}),onClick:a,className:zR})})]}),t("div",{className:`${UR} ${n.some(e=>"error"===e.status)?XR:""}`,children:[e("div",{className:WR,children:e(K,{className:aL,size:"small",dataSource:n,renderItem:r=>{const n="error"===r.status,i=n?(e=>{if(!e)return null;const t=e.toLowerCase();return t.includes("type")||t.includes("format")||t.includes("формат")||t.includes("тип")||t.includes("not allowed")||t.includes("дозволен")||t.includes("name")||t.includes("invalid")||t.includes("назва")||t.includes("неприпустим")||t.includes("allowed characters")?null:t.includes("large")||t.includes("size")||t.includes("розмір")||t.includes("размер")?h("upload_error_hint_size"):t.includes("exists")||t.includes("вже існує")||t.includes("уже существует")?h("upload_error_hint_exists"):null})(r.error):null;return e(K.Item,{className:`${qR} ${n?YR:""}`,actions:p(r),children:e(K.Item.Meta,{avatar:e(Z,{size:"small",icon:f(r.status),className:QR}),title:t("div",{className:eL,children:[e(sL,{ellipsis:!0,className:tL,children:r.name}),e(sL,{type:"secondary",className:rL,children:void 0!==r.size?ui(r.size):""})]}),description:"uploading"===r.status?e(q,{percent:r.progress,size:"small",status:"active",showInfo:!1,className:nL}):n?b?null:t("div",{className:KR,children:[e(sL,{type:"danger",className:ZR,children:r.error||h("Error")}),i&&e(sL,{type:"secondary",className:JR,children:i})]}):null})})}})}),w&&t("div",{className:VR,children:[t("div",{className:HR,children:[e(Ce,{style:{color:d.colorError,marginRight:8,flexShrink:0}}),e(sL,{type:"danger",children:w})]}),e(sL,{type:"secondary",className:$R,children:h("Applies to all {{count}} files",{count:y.length})})]})]})]})})},{Header:cL}=J,{Title:uL}=T,dL=({activeLibraryItem:r,selectedFolder:i,isTrashFolder:o,onClearTrash:a,files:s,loading:l,onRefresh:c,refreshDisabled:u,showRefresh:d=!1})=>{const{t:h}=Yn(),f=r===rr&&(null!=o?o:i===lr),[p,g]=n.useState(!1),m={[rr]:h("My files"),[nr]:h("GIF"),[ir]:h("Stock images"),[or]:h("Icons"),[ar]:h("AI image generation")};let v;return n.useEffect(()=>{const e=setTimeout(()=>{g(f&&s.length>0&&!l)},200);return()=>clearTimeout(e)},[f,s.length,l]),v=r===rr?f?h("Trash"):i:m[r],e(cL,{className:"actions-header",children:t("div",{className:"header-title-container",children:[e(uL,{level:5,className:"header-title",children:v}),p&&a&&e(M,{type:"default",onClick:a,className:"clear-trash-button","aria-label":h("Clear Trash"),children:h("Clear")}),r===rr&&d&&c&&e(P,{title:h("Refresh"),children:e(M,{type:"text",className:"folder-refresh-button",icon:e(Ei,{size:16}),onClick:c,disabled:u})})]})})};function hL(e,t){return!e||!t||e<=0||t<=0?1:e/t}const fL=1200;function pL({items:e,getId:t,getPreviewSrc:r,getAltText:n,getWidth:i,getHeight:a,layoutMode:s="masonry",minColumnWidth:l=240,estimatedItemHeight:c=240,gap:u=20,overscanPx:h=800,prefetchThresholdPx:f=1200,resolveColumnCount:p,virtualizationThreshold:g=40}){var m,v;const[y,b]=o({scrollTop:0,viewportHeight:800,viewportWidth:fL,scrollHeight:0}),w=d(()=>function(e){return{getId:e,buildSignature:(t,r)=>{var n,i;const o=r.getPreviewSrc(t)||"",a=r.getAltText(t),s=null===(n=r.getWidth)||void 0===n?void 0:n.call(r,t),l=null===(i=r.getHeight)||void 0===i?void 0:i.call(r,t);return[e(t),o,a,null!=s?s:"",null!=l?l:""].join("::")},buildRowModel:(e,t,r)=>{var n,i;const o=null===(n=t.getWidth)||void 0===n?void 0:n.call(t,e),a=null===(i=t.getHeight)||void 0===i?void 0:i.call(t,e);return{id:r.id,signature:r.signature,item:e,previewSrc:t.getPreviewSrc(e),altText:t.getAltText(e),width:o,height:a,aspectRatio:hL(o,a)}}}}(t),[t]),x=d(()=>({getPreviewSrc:r,getAltText:n,getWidth:i,getHeight:a}),[n,a,r,i]),C=d(()=>{const e=Math.max(1,y.viewportWidth||fL);return p?Math.max(1,p(e)):Math.max(1,Math.floor((e+u)/(l+u)))},[u,l,p,y.viewportWidth]),_=d(()=>{const e=Math.max(1,y.viewportWidth||fL);return Math.max(1,(e-u*Math.max(0,C-1))/C)},[C,u,y.viewportWidth]),S=d(()=>{const t=new Array(C).fill(0),r=[];e:for(let n=0;n<e.length;n+=1){const o=e[n],l=null==i?void 0:i(o),d=null==a?void 0:a(o),h=l&&d&&l>0&&d>0?l/d:void 0,f=h?_/h:c;if("grid"===s){const e=Math.floor(n/C)*(f+u),t=n%C*(_+u);r.push({index:n,top:e,left:t,width:_,height:f,bottom:e+f});continue e}let p=0;for(let e=1;e<t.length;e+=1)t[e]<t[p]&&(p=e);const g=t[p],m=p*(_+u);t[p]=g+f+u,r.push({index:n,top:g,left:m,width:_,height:f,bottom:g+f})}const n=0===r.length?0:"grid"===s?Math.max(...r.map(e=>e.bottom)):Math.max(0,...t.map(e=>e-u));return{positionedItems:r,containerHeight:n}},[C,_,c,u,a,i,e,s]),k=d(()=>e.length<=g?{renderStrategy:"full"}:{renderStrategy:"positioned",positioned:{layout:S.positionedItems,viewportTop:y.scrollTop,viewportBottom:y.scrollTop+y.viewportHeight,overscanPx:h,containerHeight:S.containerHeight}},[e.length,S.containerHeight,S.positionedItems,h,y.scrollTop,y.viewportHeight,g]),{rowModels:A,renderWindow:I}=Ns({items:e,context:x,adapter:w,options:k}),E=null!==(m=I.positionedItems)&&void 0!==m?m:A.map((e,t)=>{var r;return{row:e,layout:null!==(r=S.positionedItems[t])&&void 0!==r?r:{index:t,top:0,left:0,width:_,height:c,bottom:c}}}),F=null!==(v=I.containerHeight)&&void 0!==v?v:S.containerHeight,T=F>0&&y.scrollTop+y.viewportHeight>=F-f;return{rowModels:A,renderRows:I.rows,renderWindow:I,positionedItems:E,containerHeight:F,isNearEnd:T,viewportMetrics:y,handleViewportChange:e=>{b(t=>t.scrollTop===e.scrollTop&&t.viewportHeight===e.viewportHeight&&t.viewportWidth===e.viewportWidth&&t.scrollHeight===e.scrollHeight?t:e)}}}const gL=t=>{var r,{imageId:n,sourceUrl:i,shouldLoad:s=!0,loader:l,onLoad:c}=t,d=_s(t,["imageId","sourceUrl","shouldLoad","loader","onLoad"]);const[h,f]=o(()=>l.getSnapshot(n,i)),p=u(null);return a(()=>(f(l.getSnapshot(n,i)),l.subscribe(n,i,f)),[n,l,i]),a(()=>(l.setActive(n,i,s),()=>{l.setActive(n,i,!1),l.release(n)}),[n,l,s,i]),h.shouldLoad?e("img",Object.assign({},d,{ref:p,src:i,loading:null!==(r=d.loading)&&void 0!==r?r:"lazy",onLoad:e=>{l.markLoaded(n),null==c||c(e)},onError:e=>{var t;l.markError(n),null===(t=d.onError)||void 0===t||t.call(d,e)}})):null};var mL={gifTab:"gifTab",scrollableDiv:"scrollableDiv",gifSearchInput:"gifSearchInput",search:"search",searchResults:"searchResults",virtualCanvas:"virtualCanvas",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",searchOutputWrapper:"searchOutputWrapper",divider:"divider",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const vL=e=>{const t="undefined"!=typeof window?window.innerWidth:e;return t<=700?1:t<=1100?2:t<=1600?3:4},yL=e=>e.images.downsized.url,bL=({setImageGifList:n,imageGifList:i=[],currentReqGif:s,setCurrentReqGif:l,inputRef:d,customRequest:h})=>{const{t:f}=Yn(),{GifPlayIcon:p}=mo(),{options:g}=po(),{config:m}=g,v=as({maxConcurrent:6}),[y,b]=o(null),[w,x]=o(new Set),[C,_]=o(!1),[k,A]=o(!1),[I,T]=o(!1),[O]=E.useForm(),P=u(s),M=u(null),R=u(null),L=u(null),N=u(0),j=u(0),D=u(new Set);a(()=>{P.current=s},[s]),a(()=>{O.setFieldsValue({keywords:s.keywords})},[]);const z=null==m?void 0:m.handleProxyUrl,B=async e=>z?Promise.resolve(z(e)):e,U=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 B(e.images.downsized.url)}),fixed_width:e.images.fixed_width?Object.assign(Object.assign({},e.images.fixed_width),{url:await B(e.images.fixed_width.url)}):void 0,fixed_width_downsampled:e.images.fixed_width_downsampled?Object.assign(Object.assign({},e.images.fixed_width_downsampled),{url:await B(e.images.fixed_width_downsampled.url)}):void 0})}))),V=async function({query:e,page:t}){var r;const n=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null!==(r=null==m?void 0:m.REACT_APP_GIPHY_KEY)&&void 0!==r?r:"Nh77eBlPeMn1ed9MBAvL542NUGeNO26F"}&q=${encodeURIComponent(n)}&limit=50&offset=${t}&lang=en`,i=await fetch(await B(e));return{data:await i.json()}}catch(e){console.warn(e)}},{positionedItems:H,containerHeight:$,isNearEnd:W,viewportMetrics:G,handleViewportChange:q}=pL({items:i,getId:e=>e.id,getPreviewSrc:yL,getAltText:e=>e.title,getWidth:e=>e.images.downsized.width?Number(e.images.downsized.width):void 0,getHeight:e=>e.images.downsized.height?Number(e.images.downsized.height):void 0,layoutMode:"masonry",minColumnWidth:240,estimatedItemHeight:220,prefetchThresholdPx:320,resolveColumnCount:vL}),Y=gs(q,[i.length]),X=()=>{M.current&&(clearTimeout(M.current),M.current=null)},K=e=>!D.current.has(e)&&(D.current.add(e),!0),Z=e=>{D.current.delete(e)},J=c(async()=>{var e,t,r;const i=null===(e=P.current.keywords)||void 0===e?void 0:e.trim();if(!i||C||k||!I)return;const o=`gif:${i}:${j.current}`;if(!K(o))return;const a=N.current;A(!0);try{const e=await V({query:P.current,page:j.current});if(a!==N.current)return;const i=null!==(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.data)&&void 0!==r?r:[];if(!Array.isArray(i)||0===i.length)return void T(!1);const o=await U(i);if(a!==N.current)return;n(e=>{const t=new Set(e.map(e=>e.id)),r=o.filter(e=>!t.has(e.id));return r.length>0?[...e,...r]:e}),j.current+=i.length,T(50===i.length)}finally{Z(o),a===N.current&&A(!1)}},[I,C,k,n]),Q=async()=>{var e,t;X();const r=null===(e=P.current.keywords)||void 0===e?void 0:e.trim();if(!r)return R.current=null,L.current=null,N.current+=1,j.current=0,n([]),x(new Set),T(!1),void A(!1);if(L.current===r)return;if(R.current===r||C&&R.current===r)return;const i=`gif:${r}:0`;if(!K(i))return;const o=N.current+1;N.current=o,R.current=r,j.current=0,n([]),x(new Set),T(!1),A(!1),_(!0);try{const e=await V({query:P.current,page:0});if(o!==N.current)return;const i=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.data;if(Array.isArray(i)&&i.length>0){const e=await U(i);if(o!==N.current)return;n(e),j.current=i.length,T(50===i.length)}else n([]),T(!1);L.current=r}catch(e){T(!1)}finally{Z(i),R.current===r&&(R.current=null),_(!1)}};return a(()=>()=>{X()},[]),a(()=>{!C&&!k&&I&&i.length>0&&W&&J()},[I,i.length,W,J,C,k]),e("div",{className:mL.gifTab,children:e("div",{className:mL.searchOutputWrapper,children:t("div",{id:"scrollableDiv",ref:Y,className:mL.scrollableDiv,children:[t(E,{form:O,onValuesChange:e=>{if(void 0!==e.keywords){const t=Object.assign(Object.assign({},P.current),{keywords:e.keywords});l(t),P.current=t,X(),M.current=setTimeout(Q,800)}},className:i.length>0?mL.searchResults:mL.search,children:[e(E.Item,{name:"keywords",className:mL.gifSearchInput,children:e(F,{onPressEnter:()=>{Q()},allowClear:!0,placeholder:f("Search GIFs"),ref:d,spellCheck:"false",prefix:e(Ti,{size:16,strokeWidth:null==m?void 0:m.iconStrokeWidth,onClick:()=>{Q()}})})}),i.length>0&&!C&&e("div",{className:`ant-divider ${mL.divider}`,role:"separator"})]}),!i.length&&!C&&e(r,{children:s.keywords?e(xo,{}):t("div",{className:mL.resultsContainer,children:[e("div",{className:mL.videoIcon,children:e(p,{className:mL.playButton})}),e("h1",{className:mL.title,children:f("Over 350,000 live images")}),e("p",{className:mL.subtitle,children:f("Enter a search query and we'll find the perfect image for you")})]})}),!i.length&&C&&e(Qs,{}),i.length>0&&t(r,{children:[e("div",{className:mL.virtualCanvas,style:{height:$},children:H.map(({row:r,layout:n})=>{const i=r.item,o=w.has(i.id),a=yL(i),s=n.bottom>=G.scrollTop-240&&n.top<=G.scrollTop+G.viewportHeight+240;return t("div",{className:`${mL.listItem} ${o?mL.loaded:""}`,onClick:()=>(async(e,t)=>{var r;b(t),setTimeout(()=>{b(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"),h(e,i)})(i.images.downsized.url,i.id,i.title),style:{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height,minHeight:n.height,maxHeight:"none",marginBottom:0},children:[e(gL,{imageId:i.id,sourceUrl:a,shouldLoad:s,loader:v,className:y===i.id?mL.loadedImage:"",width:"100%",height:"100%",alt:i.title,decoding:"async",onLoad:()=>{x(e=>{if(e.has(i.id))return e;const t=new Set(e);return t.add(i.id),t})}}),e("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),y===i.id&&e(S,{className:mL.antSpin})]},i.id)})}),k&&e(Qs,{})]})]})})})};var wL={stockTab:"stockTab",stockSearchInput:"stockSearchInput",searchOutputWrapper:"searchOutputWrapper",divider:"divider",search:"search",searchResults:"searchResults",virtualCanvas:"virtualCanvas",scrollableDiv:"scrollableDiv",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 xL=e=>{const t="undefined"!=typeof window?window.innerWidth:e;return t<=650?1:t<=1e3?2:t<=1450?3:4},CL=(e,t)=>{const r=new URL(e);return r.searchParams.set("w",t.toString()),r.toString()},_L=({imageStockList:n,setImageStockList:i,currentReq:s,setCurrentReq:l,inputRef:d,customRequest:h})=>{var f,p;const{t:g}=Yn(),{StockBigIcon:m,MixedViewIcon:v,LandscapeViewIcon:y,PortraitViewIcon:b,SquareViewIcon:w}=mo(),{options:x}=po(),{config:C}=x,_=as({maxConcurrent:6}),[k,A]=o(!1),[I,T]=o(!1),[O,M]=o(!1),[R,L]=o(null),[N,j]=o(new Set),[D]=E.useForm(),B=null==C?void 0:C.handleProxyUrl,V=null!==(f=null==C?void 0:C.UNSPLASH_KEY)&&void 0!==f?f:"HX2_qqq3F3ljmtYtfmb9P6h0dn2u9mnnOl36IdV8el0",H=(null===(p=null==C?void 0:C.locale)||void 0===p?void 0:p.slice(0,2))||"ru",$=u(s),W=u(null),G=u(null),q=u(0),Y=u(1),X=u(new Set),K=async e=>B?Promise.resolve(B(e)):e,Z=()=>{W.current&&(clearTimeout(W.current),W.current=null)},J=e=>!X.current.has(e)&&(X.current.add(e),!0),ee=e=>{X.current.delete(e)},te=async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{urls:{raw:await K(CL(e.urls.raw,1200)),small:await K(CL(e.urls.raw,540))}})));a(()=>{$.current=s},[s]),a(()=>{0===n.length&&D.setFieldsValue({color:"",orientation:""})},[n,D]),a(()=>{D.setFieldsValue({keywords:s.keywords,color:s.color,orientation:s.orientation})},[]);const re=async function({query:e,page:t}){const r=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{let n=`https://api.unsplash.com/search/photos?client_id=${V}&lang=${H}&per_page=30&query=${encodeURIComponent(r)}&page=${t}`;""!==e.color&&(n+=`&color=${e.color}`),""!==e.orientation&&(n+=`&orientation=${e.orientation}`);const i=await fetch(await K(n));return{data:await i.json()}}catch(e){console.warn(e)}},{positionedItems:ne,containerHeight:ie,isNearEnd:oe,viewportMetrics:ae,handleViewportChange:se}=pL({items:n,getId:e=>e.id,getPreviewSrc:e=>e.urls.small,getAltText:e=>e.description||e.user.name,getWidth:e=>e.width,getHeight:e=>e.height,layoutMode:"masonry",minColumnWidth:240,estimatedItemHeight:220,prefetchThresholdPx:320,resolveColumnCount:xL}),le=gs(se,[n.length]),ce=c(async()=>{var e,t;if(k||I||!O||!$.current.keywords.trim())return;const r=q.current,n=Y.current,o=`stock:${`${$.current.keywords.trim()}|${$.current.color}|${$.current.orientation}`}:${n}`;if(J(o)){T(!0);try{const o=await re({query:$.current,page:n});if(r!==q.current)return;const a=null!==(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.results)&&void 0!==t?t:[];if(0===a.length)return void M(!1);const s=await te(a);if(r!==q.current)return;i(e=>{const t=new Set(e.map(e=>e.id)),r=s.filter(e=>!t.has(e.id));return r.length>0?[...e,...r]:e}),Y.current=n+1,M(30===a.length)}finally{ee(o),r===q.current&&T(!1)}}},[O,k,I,i]),ue=async()=>{var e,t;Z();const r=`${$.current.keywords.trim()}|${$.current.color}|${$.current.orientation}`;if(!$.current.keywords.trim())return void(G.current=null);if(G.current===r)return;const n=`stock:${r}:1`;if(!J(n))return;const o=q.current+1;q.current=o,A(!0),T(!1),M(!1),Y.current=1,i([]),j(new Set);try{const n=await re({query:$.current,page:1});if(o!==q.current)return;const a=null!==(t=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.results)&&void 0!==t?t:[];if(a.length>0){const e=await te(a);if(o!==q.current)return;i(e),Y.current=2,M(30===a.length)}else M(!1);G.current=r}finally{ee(n),A(!1)}};a(()=>()=>{Z()},[]),a(()=>{!k&&!I&&O&&n.length>0&&oe&&ce()},[O,n.length,oe,ce,k,I]);const de=async(e,t,r,n)=>{var i;!async function(e){try{const t=`${e}${e.includes("?")?"&":"?"}client_id=${V}`,r=await K(t),n=await fetch(r);return{data:await n.json()}}catch(e){console.warn(e)}}(t.download_location),L(r),setTimeout(()=>L(null),2e3);const o=e.raw,a=o.split("?")[0].split("#")[0].split("/");let s=a[a.length-1]||"uploaded-file";s.includes(".")&&(null===(i=s.split(".").pop())||void 0===i?void 0:i.length)&&s.split(".").pop().length<=5||(s+=".jpg"),h(o,s)};return e("div",{className:wL.stockTab,children:e("div",{className:wL.searchOutputWrapper,children:t("div",{className:wL.scrollableDiv,id:"scrollableDiv",ref:le,children:[t(E,{form:D,initialValues:vr,onValuesChange:(e,t)=>{const r=Object.assign(Object.assign({},vr),t);l(r),$.current=r,Z(),""!==r.keywords?W.current=setTimeout(ue,800):(G.current=null,q.current+=1,Y.current=1,i([]),j(new Set),M(!1),T(!1),l(Object.assign({},vr)),$.current=vr,D.resetFields())},className:n.length>0?wL.searchResults:wL.search,children:[t(U,{gutter:24,children:[e(z,{span:n.length>0?void 0:24,children:e(E.Item,{name:"keywords",className:wL.stockSearchInput,children:e(F,{allowClear:!0,placeholder:g("Search image"),ref:d,spellCheck:"false",prefix:e(Ti,{size:16,strokeWidth:null==C?void 0:C.iconStrokeWidth})})})}),!!n.length&&t(r,{children:[e(z,{children:e(E.Item,{name:"orientation",children:t(Q.Group,{onChange:e=>l(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[e(P,{title:g("All"),placement:"top",children:e(Q.Button,{value:"",children:e(v,{})})}),e(P,{title:g("Landscape"),placement:"top",children:e(Q.Button,{value:"landscape",children:e(y,{})})}),e(P,{title:g("Portrait"),placement:"top",children:e(Q.Button,{value:"portrait",children:e(b,{})})}),e(P,{title:g("Squarish"),placement:"top",children:e(Q.Button,{value:"squarish",children:e(w,{})})})]})})}),e(z,{children:e(E.Item,{name:"color",children:t(Q.Group,{className:wL.stockColorFilter,onChange:e=>l(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[e(P,{title:g("All"),placement:"top",children:e(Q.Button,{className:wL.allColors,value:"",children:"All"})}),e(P,{title:g("Black"),placement:"top",children:e(Q.Button,{className:wL.blackColor,value:"black",children:"B"})}),e(P,{title:g("Black and White"),placement:"top",children:e(Q.Button,{className:wL.bwColor,value:"black_and_white",children:"B&W"})}),e(P,{title:g("White"),placement:"top",children:e(Q.Button,{className:wL.whiteColor,value:"white",children:"W"})}),e(P,{title:g("Orange"),placement:"top",children:e(Q.Button,{className:wL.orangeColor,value:"orange",children:"O"})}),e(P,{title:g("Red"),placement:"top",children:e(Q.Button,{className:wL.redColor,value:"red",children:"R"})}),e(P,{title:g("Purple"),placement:"top",children:e(Q.Button,{className:wL.purpleColor,value:"purple",children:"P"})}),e(P,{title:g("Magenta"),placement:"top",children:e(Q.Button,{className:wL.magentaColor,value:"magenta",children:"M"})}),e(P,{title:g("Green"),placement:"top",children:e(Q.Button,{className:wL.greenColor,value:"green",children:"G"})}),e(P,{title:g("Teal"),placement:"top",children:e(Q.Button,{className:wL.tealColor,value:"teal",children:"T"})}),e(P,{title:g("Blue"),placement:"top",children:e(Q.Button,{className:wL.blueColor,value:"blue",children:"B"})})]})})})]})]}),n.length>0&&!k&&e("div",{className:`ant-divider ${wL.divider}`,role:"separator"})]}),!n.length&&!k&&e(r,{children:s.keywords?e(xo,{}):t("div",{className:wL.resultsContainer,children:[e("div",{className:wL.videoIcon,children:e(m,{className:wL.playButton})}),e("h1",{className:wL.title,children:g("Millions of free stock images")}),e("p",{className:wL.subtitle,children:g("Enter a search query and we'll find the perfect image for you")})]})}),!n.length&&k&&e(Qs,{}),n.length>0&&t(r,{children:[e("div",{className:wL.virtualCanvas,style:{height:ie},children:ne.map(({row:r,layout:n})=>{const i=r.item,o=N.has(i.id),a=n.bottom>=ae.scrollTop-240&&n.top<=ae.scrollTop+ae.viewportHeight+240;return t("div",{className:`${wL.listItem} ${o?wL.loaded:""}`,onClick:()=>de(i.urls,i.links,i.id,i.description),style:{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height,minHeight:n.height,maxHeight:"none",marginBottom:0},children:[e(gL,{imageId:i.id,sourceUrl:i.urls.small,shouldLoad:a,loader:_,className:R===i.id?wL.loadedImage:"",width:"100%",height:"100%",alt:i.description,decoding:"async",onLoad:()=>{j(e=>{if(e.has(i.id))return e;const t=new Set(e);return t.add(i.id),t})}}),t("p",{className:wL.creatorInfo,onClick:e=>e.stopPropagation(),children:[g("Photo by")," ",e("a",{target:"_blank",href:`${i.user.links.html}?utm_source=${null==C?void 0:C.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:i.user.name})," ",g("on")," ",e("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==C?void 0:C.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),R===i.id&&e(S,{className:wL.antSpin})]},i.id)})}),I&&e(Qs,{})]})]})})})},SL=()=>{const{options:e}=po(),t=e.config;return c((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){console.error("Ошибка при вызове GTM:",e)}};t?setTimeout(r,t):r()})(e,r)},[null==t?void 0:t.pushToGTM])};var kL="slideshowContainer",AL="slideshowImage";const IL=({images:t,transitionDuration:r=1e3,frameHeight:n})=>{const[i,s]=o([]),[l,c]=o(n);a(()=>{const e=()=>{if("undefined"==typeof window)return void c(n);const e=window.innerHeight,t=Math.max(e-260,130);if("number"==typeof n){const e=Math.min(n,t);c(e)}else c(t)};if(e(),"undefined"!=typeof window)return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n]);const u=()=>{s(e=>e.map((t,r)=>r===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return a(()=>{if(t.length>0){const e=t[t.length-1];s(t=>[...t,{src:e,opacity:0}]),setTimeout(u,1e3)}else s([])},[t]),e("div",{className:kL,style:{height:l,minHeight:130},children:i.map((t,n)=>e("img",{src:`data:image/jpeg;base64, ${t.src}`,alt:`Slide ${n+1}`,className:AL,style:{opacity:t.opacity,transition:`opacity ${r}ms linear`,display:"block"}},n))})},EL=t=>{var{className:r,style:n,color:i,text:o,bordered:a}=t,s=_s(t,["className","style","color","text","bordered"]);const l=o||"";return e(ee,Object.assign({style:n,color:i,bordered:a,className:r},s,{children:l}))},FL=({text:r,counter:n,limits:i,wrapperStyles:o})=>{const{t:a}=Yn(),{options:s}=po(),l=s.config,{token:c}=k.useToken(),u=+i>0,d=!u||n<+i,h=(null==l?void 0:l.billingPageUrl)||"/billing",f=n+" "+a("of")+" "+(u?i:"∞")+" "+(r||a("tests",{count:i}))+" "+a("was used",{count:n});return t("div",{className:"limits-couter-wrapper",style:o,children:[e(EL,{bordered:!1,text:f,className:"limit-counter",style:{color:d?c.colorText:"white"},color:d?c.colorFillSecondary:"rgb(255, 77, 79)"}),u&&e("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(h),children:a("Need more?")})]})};var TL={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 OL=f(({className:t,onClick:r})=>e("div",{className:`${TL.arrow} ${TL.arrowNext} ${t||""}`,onClick:r,children:e(M,{className:`${TL.arrowBtn} ${TL.arrowBtnNext}`,size:"large",icon:e(ke,{})})}));OL.displayName="SampleNextArrow";const PL=f(({className:t,onClick:r})=>e("div",{className:`${TL.arrow} ${TL.arrowPrev} ${t||""}`,onClick:r,children:e(M,{className:`${TL.arrowBtn} ${TL.arrowBtnPrev}`,size:"large",icon:e(Ae,{})})}));PL.displayName="SamplePrevArrow";const ML=({customRequest:r,inputAiRef:n,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:h,setAiImageRequest:f,imageAiList:p,setImageAiList:g,isLoadingAi:m,setIsLoadingAi:v})=>{const{t:y}=Yn(),{AiIcon_2:b}=mo(),w=i.useRef(null),[x,C]=o("auto"),{aiImageCounter:_,currentAiImgLimits:S,loadingDuringGeneration:k,requestStatus:A,handleGenerate:I,convertBase64ToFile:T,isShiftPressed:O,setIsShiftPressed:P,limitsInPlugin:R}=function({setFrameHeight:e,customRequest:t,aiTabRef:r,isImageUploaded:n,setIsImageUploaded:i,aiImageRequest:s,imageAiList:l,setImageAiList:h,isLoadingAi:f,setIsLoadingAi:p}){const{t:g}=Yn(),{options:m}=po(),v=m.config,y=Oo(),b=SL(),{messages:w}=m.config,[x,C]=o([]),[_,S]=o(0),[k,A]=o(null),[I,E]=o(!1),[F,T]=o(g("Evaluating the task")),[O,P]=o(!1),M=u(new Set),R=u(new Set),L=u(new Set);a(()=>{C(w)},[w]),a(()=>{l.length||k||(C([]),M.current.clear(),R.current.clear(),L.current.clear(),D.current=-1)},[l,k]);const N=d(()=>v&&"function"==typeof(null==v?void 0:v.sendAIImageRequest)?null==v?void 0:v.sendAIImageRequest:()=>Promise.resolve({}),[v]),j=c(e=>{const t=`${k}-${e.progress}-${JSON.stringify(e.images||e.data)}`;if(!L.current.has(t))if(L.current.add(t),"error"!==e.status&&"Canceled"!==e.status){if(e.images){if(T(String(e.status)),100===e.progress){p(!1),h(e.images);const t=k,r=Array.isArray(e.images)?e.images:[];r.length>0&&t&&!M.current.has(t)&&(M.current.add(t),y.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:g("Images generated successfully"),placement:"bottomRight",data:{request:s,taskId:t,images:r}})),A(null),P(!1)}}else if(e.data&&(h([String(e.data)]),100===e.progress)){p(!1);const t=k,r=e.data?[String(e.data)]:[];r.length>0&&t&&!M.current.has(t)&&(M.current.add(t),y.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:g("Images generated successfully"),placement:"bottomRight",data:{request:s,taskId:t,images:r}})),A(null),P(!1)}}else p(!1),P(!1),k&&!R.current.has(k)&&(R.current.add(k),y.error({id:"AI_RESPONSE_INVALID",message:g("Something went wrong, please try again"),placement:"bottomRight",description:String(k)||void 0,data:{requestId:k,request:s,response:e},innerException:e}))},[s,h,T,g,p,k,y,P]),D=u(-1);a(()=>{if(x.length>0){const e=x.length-1;e>D.current&&(D.current=e,j(x[e]))}},[j,x]);const z=d(()=>{if(v&&"function"==typeof(null==v?void 0:v.sseQuery)){const e=null==v?void 0:v.sseQuery;return t=>e(t)}return e=>{}},[v]),B=d(()=>v&&"object"==typeof(null==v?void 0:v.handleLimitUsageEmitter)?null==v?void 0:v.handleLimitUsageEmitter:{fire:()=>{}},[v]),U=null==v?void 0:v.elementId,{projectId:V}=v,{limits:H}=(null==v?void 0:v.limits)?v:{limits:{ai_img_limit:0}},{ai_img_limit:$}=H,W=$>0&&_>=$,G=!(!(null==v?void 0:v.limits)||!v.counters)&&fr,q=c(()=>{B.fire({name:"AiImgCount",count:_+1})},[B,_]),Y=d(()=>!W&&!G,[W,G,_,$]),X=c(async()=>{T(g("Evaluating the task")),""===s||f||(p(!0),P(!0),h([]),C([]),b({event:"submit_form",action:"ai_image_generation",entity_id:U,project_id:V}),N({body:{project_id:V,request:"create-image",connection:"midjourney",message:s}}).then(e=>{var t,r,n,i,o;const{data:a,error:l}=e||{};if(l)throw l;const c=a;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 u=(null==c?void 0:c.task)||(null===(r=null==c?void 0:c.data)||void 0===r?void 0:r.task),d=null!==(i=null!==(n=null==u?void 0:u.id)&&void 0!==n?n:k)&&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==u?void 0:u.id)&&(T(u.message),A(u.id)),(null==c?void 0:c.message)&&y.success({id:"AI_IMAGE_GENERATION_STARTED",message:c.message,placement:"bottomRight",data:{request:s,taskId:d,response:null==c?void 0:c.data}}),z({task_id:null==u?void 0:u.id,entity_id:U})):(p(!1),P(!1),d&&!R.current.has(d)&&(R.current.add(d),y.error({id:"AI_IMAGE_GENERATION_FAILED",message:(null==c?void 0:c.message)||g("Something went wrong, please try again"),placement:"bottomRight",description:s,data:{request:s,taskId:d,response:c},innerException:c})))}).catch(e=>{p(!1),P(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&k&&!R.current.has(k)&&(R.current.add(k),null==y||y.error({id:"AI_IMAGE_GENERATION_FAILED",message:g("Something went wrong, please try again"),placement:"bottomRight",description:s,innerException:e,data:{request:s,taskId:k,response:null==t?void 0:t.data,error:No(null==t?void 0:t.error)}})),t}))},[s,f,p,P,h,b,U,V,N,y,z,g,k]),K=c(()=>{Y&&X()},[Y,G,S,q,X,y,g]);a(()=>{},[v,G]);const Z=c(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 e=0;e<s.length;e++)l[e]=s.charCodeAt(e);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){console.error("FM AI: customRequest error",e)}finally{i(!1)}})()},[n,i,t]);return a(()=>{(f||l.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,l.length,f,e]),{aiImageCounter:_,setAiImageCounter:S,currentAiImgLimits:$,isFieldsDisabled:W,canGenerateImage:Y,aiImageRequest:s,imageAiList:l,setImageAiList:h,isLoadingAi:f,setIsLoadingAi:p,loadingDuringGeneration:O,setLoadingDuringGeneration:P,requestStatus:F,setRequestStatus:T,handleGenerate:K,handleLimitAiImgCount:q,convertBase64ToFile:Z,isShiftPressed:I,setIsShiftPressed:E,currentReqId:k,setCurrentReqId:A,limitsInPlugin:G}}({setFrameHeight:C,customRequest:r,aiTabRef:w,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:h,imageAiList:p,setImageAiList:g,isLoadingAi:m,setIsLoadingAi:v});a(()=>{},[s]);const[L,N]=o(!1),j=c(()=>N(!0),[]),D=c(()=>N(!1),[]),B=c(e=>f(e.target.value),[f]),V=c(e=>{"Shift"===e.key?P(!0):"Enter"!==e.key||O||(e.preventDefault(),I())},[O,I,P]),H=c(e=>{"Shift"===e.key&&P(!1)},[P]);return t("div",{className:TL.imageAi,ref:w,children:[R&&e(FL,{text:"images",counter:_,limits:S,wrapperStyles:{marginTop:-25}}),e(U,{gutter:24,className:TL.row,children:t(z,{span:24,children:[e(E.Item,{children:t("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${TL.inputAffixWrapper}${L?" ant-input-affix-wrapper-focused":""}`,children:[e(F.TextArea,{ref:n,onKeyDown:V,onKeyUp:H,onFocus:j,onBlur:D,autoSize:!0,allowClear:!0,className:`${TL.textAreaInputHybrid} ${TL.textarea}`,placeholder:y("Generate image"),value:h,onChange:B,spellCheck:"false"}),e("span",{className:`ant-input-suffix ${TL.inputSuffix}`,children:m||k?e(se,{className:`${TL.inputIcon} input-icon`,spin:!0}):e(b,{className:`${TL.inputIcon} input-icon`,onClick:I})})]})}),t("div",{className:TL.imageAiExample,children:[e("span",{children:y("For example:")})," ",y("A beautiful image of a sunset over a calm ocean.")]})]})}),(m||p.length>0)&&t(te,{dotPosition:"top",arrows:!0,nextArrow:e(OL,{}),prevArrow:e(PL,{}),className:TL.carousel,infinite:!1,children:[m&&!p.length&&e("div",{className:TL.loading,children:t("div",{className:"spin",children:[e(se,{style:{fontSize:48},spin:!0}),e("p",{className:"status",children:A})]})}),p.length>0&&p.map((r,n)=>t("div",{className:TL.imageItem,children:[e(IL,{images:p,frameHeight:x}),e("div",{className:"buttons",children:p.length>0&&!m&&e(M,{onClick:()=>T(`data:image/jpeg;base64, ${r}`),loading:s,icon:e(Ie,{}),children:y("Use this variant")})})]},n))]})]})};var RL={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",iconsGridLoadingMore:"iconsGridLoadingMore",iconsGridVirtualCanvas:"iconsGridVirtualCanvas",iconsGridItem:"iconsGridItem",iconsGridItemThumbnail:"iconsGridItemThumbnail",iconsGridItemSvg:"iconsGridItemSvg",iconsGridItemImg:"iconsGridItemImg",iconsGridItemName:"iconsGridItemName",iconsGridItemSelected:"iconsGridItemSelected",iconsGridLoading:"iconsGridLoading",iconsControlsBackButton:"iconsControlsBackButton",iconsGridCheckbox:"iconsGridCheckbox",iconsGridShowCheckboxes:"iconsGridShowCheckboxes",iconsHeaderContainer:"iconsHeaderContainer",iconsHeaderContainerLeft:"iconsHeaderContainerLeft",copyToFolderModalBody:"copyToFolderModalBody",copyToFolderModalLoadingOverlay:"copyToFolderModalLoadingOverlay"};const LL=[{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"}],NL=({query:r,onQueryChange:n,onSubmit:i,styleFilter:o,onStyleChange:a,hasResults:s=!1,inputRef:l})=>{const{t:c}=Yn(),{options:u}=po(),{config:d}=u,h=r.length>0&&s;return t("div",{className:RL.iconsSearchFormCenteredContainer,children:[t(E,{layout:"inline",onFinish:i,className:h?RL.iconsSearchResults:RL.iconsSearchFormCentered,children:[e(E.Item,{className:RL.iconsSearchFormInput,children:e(F,{ref:l,className:RL.iconsSearchFormInputInput,allowClear:!0,prefix:e(Ti,{size:16,strokeWidth:null==d?void 0:d.iconStrokeWidth,onClick:i}),placeholder:c("Search icons"),value:r,onChange:e=>n(e.target.value),onKeyDown:e=>"Space"===e.code&&i(),onPressEnter:i,spellCheck:"false"})}),h&&e(E.Item,{className:RL.iconsSearchFormStyleItem,children:e(O,{allowClear:!0,placeholder:c("Style"),value:null!=o?o:void 0,onChange:e=>a(null!=e?e:null),className:RL.iconsSearchFormSelect,options:LL.map(e=>({label:c(e.label),value:e.value}))})})]}),h&&e("div",{className:`ant-divider ${RL.iconsSearchDivider}`,role:"separator"})]})},jL=n=>{const{t:i}=Yn(),{mode:o,colorHex:a,setColorHex:s,colorHex2:l,setColorHex2:c,colorHex3:u,setColorHex3:d,sizePx:h,setSizePx:f,strokeWidth:p,setStrokeWidth:g,showSecondColor:m,showThirdColor:v,onBack:y,styleFilter:b}=n;return t("div",{className:RL.iconsControls,children:[e("div",{className:RL.iconsControlsControls,children:"family"===o&&t(r,{children:[t("div",{className:RL.iconsControlsStrokeWidth,children:[e("span",{children:i("Size")}),e(re,{min:20,max:200,value:h,formatter:e=>`${e}px`,parser:e=>e?e.replace("px",""):"",onChange:e=>f("number"==typeof e?e:50)})]}),t("div",{className:RL.iconsControlsStrokeWidth,children:[e("span",{children:i("Stroke width")}),e(re,{min:.3,max:3,step:.1,value:"number"==typeof p?p:1,formatter:e=>`${e}px`,parser:e=>e?e.replace("px",""):"",onChange:e=>g("number"==typeof e?e:1)})]}),"gradient"===b?e(R,{size:8,children:e(ne,{defaultValue:[{color:a||"#108ee9",percent:0},{color:l||"#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]&&s(t[0]),t[1]&&c(t[1])}catch(e){console.warn("ColorPicker gradient parsing error",e)}},size:"small"})}):t(r,{children:[t("div",{className:RL.iconsControlElement,children:[e("span",{children:i("Color1")}),e(ne,{value:a,format:"hex",disabledAlpha:!0,onChange:(e,t)=>s(t),size:"middle"})]}),m&&t("div",{className:RL.iconsControlElement,children:[e("span",{children:i("Color2")}),e(ne,{value:l,format:"hex",disabledAlpha:!0,onChange:(e,t)=>c(t),size:"middle"})]}),v&&t("div",{className:RL.iconsControlElement,children:[e("span",{children:i("Color3")}),e(ne,{value:u,format:"hex",disabledAlpha:!0,onChange:(e,t)=>d(t),size:"middle"})]})]})]})}),e("div",{className:RL.iconsControlsHeader,children:e("div",{children:"family"===o?e(M,{className:RL.iconsControlsBackButton,type:"default",onClick:y,title:i("Back"),children:i("Back")}):null})})]})},DL=e(se,{style:{fontSize:20},spin:!0}),zL=({items:n,loading:o,isCollectingResults:a=!1,hasMore:s=!1,hasQuery:l,mode:c,selectedHash:u,onItemClick:d,onInsert:h,onLoadMore:f,colorVars:p,svgTextMap:g,previewSize:m,selectedHashes:v,onToggleSelect:y})=>{const{t:b}=Yn(),{ThumbsUpIcon:w}=mo(),x=as({maxConcurrent:6}),C=Boolean(v&&v.size>0),_=i.useRef(null),k=Math.max(100,(null!=m?m:50)+48),{positionedItems:A,containerHeight:I,isNearEnd:E,viewportMetrics:F,handleViewportChange:T}=pL({items:n,getId:e=>e.hash,getPreviewSrc:e=>e.imagePreviewUrl,getAltText:e=>e.name,getWidth:()=>1,getHeight:()=>1,layoutMode:"grid",minColumnWidth:k,gap:16,prefetchThresholdPx:240}),O=gs(T,[n.length,null!=m?m:50]);i.useEffect(()=>{s||(_.current=null)},[s,n.length]),i.useEffect(()=>{if(!o&&!a&&s&&n.length>0&&E){if(_.current===n.length)return;_.current=n.length,null==f||f()}},[s,a,E,n.length,o,f]);const P=e("div",l?{className:RL.iconsGridEmptyState,children:e(xo,{})}:{className:RL.iconsGridEmptyState,children:t("div",{className:RL.resultsContainer,children:[e("span",{className:RL.videoIcon,children:e(w,{className:RL.playButton,style:{width:48,height:49,marginBottom:10}})}),e("h1",{className:RL.title,children:b("Millions of icons")}),e("p",{className:RL.subtitle,children:b("Enter a search query and we'll find the perfect icon for you")})]})});return t("div",{id:"iconsScrollableDiv",ref:O,className:RL.iconsGrid,children:[0!==n.length||o?t(r,{children:[e("div",{className:RL.iconsGridVirtualCanvas,style:{height:I},children:A.map(({row:r,layout:n})=>{var i,o,a,s,l,h,f,b,w,_,S;const k=r.item,A=Boolean(v&&v.has(k.hash)||u===k.hash),I=n.bottom>=F.scrollTop-180&&n.top<=F.scrollTop+F.viewportHeight+180;return t("div",{style:{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height},className:`${RL.iconsGridItem} ${A?RL.iconsGridItemSelected:""} ${C?RL.iconsGridShowCheckboxes:""}`,onClick:()=>{d(k),y&&"family"===c&&y(k.hash)},children:[e("div",{style:{height:null!=m?m:50},className:RL.iconsGridItemThumbnail,children:"family"===c&&g[k.hash]?e("div",{style:{color:null==p?void 0:p.colorHex,"--icon-grad-1":null!==(i=null==p?void 0:p.colorHex)&&void 0!==i?i:"#000","--icon-grad-2":null!==(o=null==p?void 0:p.colorHex2)&&void 0!==o?o:"#ff007a","--icon-color-1":null!==(a=null==p?void 0:p.colorHex)&&void 0!==a?a:"#000","--icon-color-2":null!==(s=null==p?void 0:p.colorHex2)&&void 0!==s?s:"#ff007a","--icon-color-3":null!==(l=null==p?void 0:p.colorHex3)&&void 0!==l?l:"#00C2FF","--icon-stroke-1":null!==(h=null==p?void 0:p.colorHex)&&void 0!==h?h:"#000","--icon-stroke-2":null!==(f=null==p?void 0:p.colorHex2)&&void 0!==f?f:"#ff007a","--icon-stroke-3":null!==(b=null==p?void 0:p.colorHex3)&&void 0!==b?b:"#00C2FF","--icon-fill-1":null!==(w=null==p?void 0:p.colorHex)&&void 0!==w?w:"#000","--icon-fill-2":null!==(_=null==p?void 0:p.colorHex2)&&void 0!==_?_:"#ff007a","--icon-fill-3":null!==(S=null==p?void 0:p.colorHex3)&&void 0!==S?S:"#00C2FF"},dangerouslySetInnerHTML:{__html:g[k.hash]},className:RL.iconsGridItemSvg}):e(gL,{imageId:k.hash,sourceUrl:k.imagePreviewUrl,shouldLoad:I,loader:x,alt:k.name,style:{maxHeight:null!=m?m:96},className:RL.iconsGridItemImg,decoding:"async"})}),e("div",{className:RL.iconsGridItemName,title:k.name,children:k.name}),y?e("div",{onClick:e=>{e.stopPropagation()},className:RL.iconsGridCheckbox,children:e(N,{checked:Boolean(v&&v.has(k.hash)),onChange:()=>y(k.hash)})}):null]},k.hash)})}),a&&e("div",{className:RL.iconsGridLoadingMore,children:e(S,{indicator:DL})})]}):P,o&&0===n.length&&e("div",{className:RL.iconsGridLoading,children:e(S,{indicator:DL})})]})},BL="path|rect|circle|ellipse|polygon|line|polyline|g";function UL(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 VL(e,t){const r=new RegExp(`${t}\\s*:\\s*([^;]+)`,"i"),n=e.match(r);return n?n[1].trim():null}function HL(e){let t=0;const r=new RegExp(`<(?:${BL})([^>]*)>`,"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&&VL(i[1],"fill")&&!/^none$/i.test(VL(i[1],"fill"));(o||a)&&(t+=1)}return t}function $L(e){let t=0;const r=new RegExp(`<(?:${BL})([^>]*)>`,"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&&VL(i[1],"stroke")&&!/^none$/i.test(VL(i[1],"stroke"));(o||a)&&(t+=1)}return t}function WL(e){return/<linearGradient/i.test(e)||/<radialGradient/i.test(e)||/fill="url\(#|stroke="url\(#/i.test(e)}function GL(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 qL(e){const t=[],r=e.indexOf("</defs>"),n=r>=0?e.slice(r):e,i=new RegExp(`<(?:${BL})[^>]*stroke-width\\s*=\\s*["']([^"']+)["']`,"gi");let o;for(;null!==(o=i.exec(n));){const e=GL(o[1]);null!=e&&t.push(e)}const a=new RegExp(`<(?:${BL})[^>]*style\\s*=\\s*["'][^"']*stroke-width\\s*:\\s*([^;"]+)[^"']*["']`,"gi");for(;null!==(o=a.exec(n));){const e=GL(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 YL(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=UL(e);n&&!r.has(n)&&(r.add(n),t.push(e))});const n=new RegExp(`<(?:${BL})([^>]*)>`,"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=UL(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=UL(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=VL(a[1],"fill");if(e){const n=UL(e);n&&!r.has(n)&&(r.add(n),t.push(e))}const n=VL(a[1],"stroke");if(n){const e=UL(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[n,i]of[["fill",/fill\s*=\s*["']([^"']*)["']/i],["stroke",/stroke\s*=\s*["']([^"']*)["']/i]]){const n=e.match(i);if(n&&n[1]){const e=UL(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 e of["fill","stroke"]){const i=VL(n[1],e);if(i){const e=UL(i);e&&!r.has(e)&&(r.add(e),t.push(i))}}}return t}(e);return{colors:t,fillsCount:HL(e),strokesCount:$L(e),hasGradient:WL(e),strokeWidth:qL(e)}}const XL=new Map,KL="https://public-api.streamlinehq.com/v1";function ZL(e,t,r,n){const o=i.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=i.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`${KL}/${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,"")}(o,e),[o,r]),c=i.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=i.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=UL(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(`<(?:${BL})([^>]*)>`,"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=UL(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)";if(n+=1,/stop-color\s*=/.test(t)){return"<stop"+t.replace(/stop-color="[^"]*"/i,'stop-color="'+r+'"')+">"}return"<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)";if(n+=1,/stop-color\s*=/.test(t)){return"<stop"+t.replace(/stop-color="[^"]*"/i,'stop-color="'+r+'"')+">"}return"<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=i.useCallback(async(t,n)=>{const i=[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=XL.get(i);if(l)return l;const c=await(async(e,t)=>{var n,i;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===(i=null==t?void 0:t.responsive)||void 0===i||i)),null!=(null==t?void 0:t.strokeToFill)&&s.set("strokeToFill",String(t.strokeToFill));const l=`${KL}/icons/${encodeURIComponent(e)}/download/svg?${s.toString()}`;if(r)return a(l);const c=new URL(`${o}/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 XL.set(i,g),g},[o,u,e,r,a,s]),h=i.useCallback(async(e,t)=>{const n=await(async(e,t)=>{var n;const i=new URLSearchParams;i.set("size",String(null!==(n=null==t?void 0:t.size)&&void 0!==n?n:96)),(null==t?void 0:t.colors)&&i.set("colors",t.colors),(null==t?void 0:t.backgroundColor)&&i.set("backgroundColor",t.backgroundColor),null!=(null==t?void 0:t.strokeWidth)&&i.set("strokeWidth",String(t.strokeWidth));const s=`${KL}/icons/${encodeURIComponent(e)}/download/png?${i.toString()}`;if(r)return a(s);const l=new URL(`${o}/icons/${encodeURIComponent(e)}/download/png`,window.location.origin);return i.forEach((e,t)=>l.searchParams.set(t,e)),l.toString().replace(window.location.origin,"")})(e,t),i={Accept:"image/png"};s&&(i["x-api-key"]=s);const l=await fetch(n,{method:"GET",headers:i,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)})},[o,r,a,s]);return{buildUrl:l,performSearch:c,fetchSvgDataUrl:d,fetchPngDataUrl:h,normalizeSvgForCss:u}}const JL=({apiKey:n,customRequest:o,query:a,setQuery:s,inputRef:l})=>{var c,u,d,h,f,p,g,m,v;const{t:y}=Yn(),[b,w]=i.useState(""),x=void 0!==a?a:b,C=void 0!==s?s:w,[_,k]=i.useState(""),[A,I]=i.useState("global"),[O,P]=i.useState(null),[L,N]=i.useState(null),[j,D]=i.useState(null),[z,B]=i.useState(null),[U,V]=i.useState([]),[H,$]=i.useState(0),[W,q]=i.useState(!1),[Y,K]=i.useState(!1),[Z,J]=i.useState(!1),[Q,ee]=i.useState(null),[te,re]=i.useState({}),[ne,oe]=i.useState({}),[ae,se]=i.useState({}),[le,ce]=i.useState("#000000"),[ue,de]=i.useState("#ff007a"),[he,fe]=i.useState("#00C2FF"),[pe,ge]=i.useState(1),[me,ve]=i.useState(50),[ye,be]=i.useState(!0),[we,xe]=i.useState(!0),[Ce,_e]=i.useState(!1),Se=po(),{options:ke}=Se,Ae=i.useRef(!1),Ie=i.useRef(null),Ee=i.useRef(0),Fe=i.useRef(null),Te=i.useRef(!1),Oe=i.useRef(null),Pe=i.useRef(null===(c=null==ke?void 0:ke.config)||void 0===c?void 0:c.handleTranslate),Me=i.useRef(null===(u=null==ke?void 0:ke.config)||void 0===u?void 0:u.locale);i.useEffect(()=>{var e,t;Pe.current=null===(e=null==ke?void 0:ke.config)||void 0===e?void 0:e.handleTranslate,Me.current=null===(t=null==ke?void 0:ke.config)||void 0===t?void 0:t.locale},[null===(d=null==ke?void 0:ke.config)||void 0===d?void 0:d.handleTranslate,null===(h=null==ke?void 0:ke.config)||void 0===h?void 0:h.locale]);const Re=i.useRef(null),Le=i.useRef(null),Ne=i.useRef(null),je=i.useRef(new Set),[De,ze]=i.useState(new Set),Be=null!==(p=null===(f=null==ke?void 0:ke.config)||void 0===f?void 0:f.STREAMLINE_API_KEY)&&void 0!==p?p:"3pAQQzwUNMmcgSr2.f4eb08cd5886d44b1fc6a701a3ba797c",Ue=null===(g=null==ke?void 0:ke.config)||void 0===g?void 0:g.handleProxyUrl,Ve=async e=>Ue?Promise.resolve(Ue(e)):e,{performSearch:He,fetchSvgDataUrl:$e,fetchPngDataUrl:We,normalizeSvgForCss:Ge}=ZL(we,null===(m=null==ke?void 0:ke.config)||void 0===m?void 0:m.STREAMLINE_BASE_URL,Ue,Be),qe=i.useMemo(()=>{if("family"!==A||0===U.length)return null;const e=new Set(U.map(e=>e.hash)),t=Object.keys(ae).some(t=>e.has(t))?ae:ne,r=U.map(e=>t[e.hash]).filter(e=>Boolean(e));if(0===r.length)return null;return 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=UL(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=>YL(e)))},[U,A,ae,ne]);i.useMemo(()=>"family"===A&&(!!(null==qe?void 0:qe.hasGradient)||!!(O||"").toLowerCase().includes("gradient")),[qe,O,A]);const Ye=i.useMemo(()=>"family"===A&&U.some(e=>{const t=ne[e.hash];return t&&/var\(--icon-color-2\)/i.test(t)}),[U,A,ne]),Xe=i.useMemo(()=>"family"===A&&U.some(e=>{const t=ne[e.hash];return t&&/var\(--icon-color-3\)/i.test(t)}),[U,A,ne]),Ke=i.useMemo(()=>!!we&&(!!qe&&(qe.hasGradient||qe.colors.length>=2&&Ye)),[qe,we,Ye]),Ze=i.useMemo(()=>!!we&&(!!qe&&(qe.colors.length>=3&&Xe)),[qe,we,Xe]);i.useEffect(()=>(Ae.current=!0,()=>{var e,t,r;Ae.current=!1;try{null===(e=Re.current)||void 0===e||e.abort(),null===(t=Le.current)||void 0===t||t.abort(),null===(r=Ne.current)||void 0===r||r.abort()}catch(e){}}),[]);const Je=i.useRef(x),Qe=i.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:_;if(!c||0===c.trim().length)return;if(e.initial?Y:Z||Y)return;if(!Ae.current)return;e.initial&&(null===(n=Re.current)||void 0===n||n.abort());const u=new AbortController;Re.current=u,e.initial?(K(!0),V([]),$(0),q(!1)):J(!0);const d=e.initial?0:H,h=(e.initial,30),f=null!==(o=null===(i=e.override)||void 0===i?void 0:i.mode)&&void 0!==o?o:A,p=null!==(s=null===(a=e.override)||void 0===a?void 0:a.familySlug)&&void 0!==s?s:O,g=c.trim(),m=`${f}|${p||""}|${g}|${j||""}|${d}|${h}`;if(!je.current.has(m)){je.current.add(m);try{const t=await He({mode:f,familySlug:p||null,query:g,offset:d,limit:h,style:j,signal:u.signal});if(!Ae.current)return;const r=await(async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{imagePreviewUrl:await Ve(e.imagePreviewUrl)}))))(t.results);if(e.initial){const e=r.filter((e,t,r)=>r.findIndex(t=>t.hash===e.hash)===t);V(e)}else V(e=>{const t=new Set(e.map(e=>e.hash)),n=r.filter(e=>!t.has(e.hash));return n.length>0?[...e,...n]:e});q(Boolean(null===(l=t.pagination)||void 0===l?void 0:l.hasMore)),$(d+r.length)}catch(e){if("AbortError"===(null==e?void 0:e.name))return;console.error(e),ie.error(y("Request error"))}finally{Ae.current&&(e.initial?K(!1):J(!1)),je.current.delete(m)}}},[_,O,Z,Y,A,H,He,j,y]);i.useEffect(()=>{Oe.current=Qe},[Qe]),i.useEffect(()=>{if("family"===A){const e=window.setTimeout(()=>{Te.current=!1},100);return()=>window.clearTimeout(e)}Te.current=!1},[A]);const et=i.useCallback(async e=>{var t;if(!e||0===e.trim().length)return;const r=`${e.trim()}|${j||""}`;if(Fe.current===r&&"global"===A)return;const n=++Ee.current;let i=e.trim();if(Pe.current)try{i=await Pe.current(e,{locale:Me.current})}catch(t){console.error("IconsTab: translation error",t),i=e}n===Ee.current&&(I("global"),P(null),B(null),V([]),q(!1),$(0),ee(null),ze(new Set),k(i),await(null===(t=Oe.current)||void 0===t?void 0:t.call(Oe,{initial:!0,override:{query:i}})),Fe.current=r)},[A,j]),tt=i.useCallback(async()=>{x&&0!==x.trim().length&&(Ie.current&&(window.clearTimeout(Ie.current),Ie.current=null),await et(x))},[x,et]),rt=i.useCallback(()=>{Ee.current+=1,I("global"),P(null),N(null),B(null),D(null),k(""),V([]),J(!1),q(!1),$(0),Fe.current=null,ee(null),ze(new Set),ce("#000000"),de("#ff007a"),fe("#00C2FF")},[]);i.useEffect(()=>{const e=Je.current;e&&e.trim().length>=3&&et(e)},[]),i.useEffect(()=>{const e=x.trim();Ie.current&&(window.clearTimeout(Ie.current),Ie.current=null),e.length<3?rt():Ie.current=window.setTimeout(()=>{et(e)},700)},[x,j,rt,et]);const nt=i.useCallback(e=>{if("global"===A){if(!e.familySlug||!_)return;return Ie.current&&(window.clearTimeout(Ie.current),Ie.current=null),Te.current=!0,I("family"),P(e.familySlug),N(e.hash),B(e.categoryName||null),V([]),J(!1),q(!1),$(0),ee(null),ze(new Set),ce("#000000"),de("#ff007a"),fe("#00C2FF"),void Qe({initial:!0,override:{mode:"family",familySlug:e.familySlug,query:_}})}ee(e.hash)},[_,Qe,A]),it=i.useCallback(()=>{const e=_.trim();I("global"),P(null),N(null),B(null),V([]),J(!1),q(!1),$(0),ee(null),ze(new Set),ce("#000000"),de("#ff007a"),fe("#00C2FF"),e&&Qe({initial:!0,override:{mode:"global",familySlug:null,query:e}})},[_,Qe]);i.useEffect(()=>{var e;if("family"!==A||0===U.length)return;const t=new Set(U.map(e=>e.hash));let r=U.map(e=>e.hash).filter(e=>!te[e]||!ne[e]);if(!L||t.has(L)||ae[L]||(r=[L,...r]),0===r.length)return;let n=!1;null===(e=Le.current)||void 0===e||e.abort();const i=new AbortController;return Le.current=i,Promise.all(r.map(e=>$e(e,{colors:we?void 0:le,strokeWidth:pe,size:me,responsive:ye,signal:i.signal}).then(t=>({h:e,r:t})).catch(()=>null))).then(e=>{if(n||!Ae.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&&re(e=>Object.assign(Object.assign({},e),t)),Object.keys(r).length>0&&oe(e=>Object.assign(Object.assign({},e),r)),Object.keys(i).length>0&&se(e=>Object.assign(Object.assign({},e),i))}),()=>{n=!0,i.abort()}},[le,L,$e,U,A,ae,ye,me,pe,ne,te,we]),i.useEffect(()=>{if("family"!==A)return;if(0===U.length)return;const e=U.map(e=>e.hash),t={},r={};let n=!1;e.forEach(e=>{const i=ae[e]||ne[e];if(!i)return;const o=Ge(i,{strokeWidth:"number"==typeof pe?pe:void 0});o&&o!==ne[e]&&(t[e]=o,r[e]=`data:image/svg+xml;utf8,${encodeURIComponent(o)}`,n=!0)}),n&&(Object.keys(t).length>0&&oe(e=>Object.assign(Object.assign({},e),t)),Object.keys(r).length>0&&re(e=>Object.assign(Object.assign({},e),r)))},[U,A,Ge,ae,pe,ne]);const ot=i.useRef(null);i.useEffect(()=>{var e;if("family"!==A||0===U.length)return;const t=L&&ae[L]?L:null===(e=U[0])||void 0===e?void 0:e.hash;if(!t||!ae[t])return;if(ot.current===O)return;const r=ae[t];if(!r)return;ot.current=O;const n=function(e){var t,r,n,i,o,a,s,l;const c=[],u=new Set,d=e=>{const t=UL(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(`<(?:${BL})([^>]*)>`,"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})$/);if(t){return"#"+(3===t[1].length?t[1].replace(/(.)/g,"$1$1"):t[1]).toLowerCase()}return 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:UL(r)||"#000000"}(e)};n[0]&&ce(i(n[0])),n[1]&&de(i(n[1])),n[2]&&fe(i(n[2]))},[U,A,ae,O,L]),i.useEffect(()=>{"family"!==A&&(ot.current=null)},[A]);const at=i.useRef(null);i.useEffect(()=>{if("family"!==A||!O||0===U.length)return;const e=U[0];if(!e||!ae[e.hash])return;if(at.current===O)return;const t=ae[e.hash];if(!t)return;const r=YL(t);"number"==typeof r.strokeWidth&&r.strokeWidth>0&&(at.current=O,ge(r.strokeWidth))},[U,A,ae,O]),i.useEffect(()=>{"family"!==A&&(at.current=null)},[A]);const st=i.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:le,colorHex2:ue,colorHex3:he}),[le,ue,he]),lt=i.useCallback(e=>{ze(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]),ct=i.useCallback(()=>{ze(new Set)},[]),ut=i.useMemo(()=>{if(1===De.size){const[e]=Array.from(De);return U.find(t=>t.hash===e)||null}return 0===De.size&&Q&&U.find(e=>e.hash===Q)||null},[U,Q,De]),dt=i.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})}},[]),ht=i.useCallback(async(e,t)=>{try{const r=async e=>{const t="family"===A?st(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,me);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 $e(e,{colors:we?void 0:le,strokeWidth:"number"==typeof pe?pe:void 0,size:me,responsive:ye,signal:t}),i=n.original||n.text;return r(i)};if("family"!==A)try{return await We(e.hash,{size:me,colors:we?void 0:le,strokeWidth:"number"==typeof pe?pe:void 0,signal:t})}catch(t){return e.hash?await n(e.hash):null}const i=ne[e.hash]||ae[e.hash];return i?r(i):e.hash?await n(e.hash):null}catch(e){return null}},[st,le,$e,We,A,ae,ye,me,pe,ne,we]),ft=i.useCallback(async e=>{var t;try{if(!Ae.current)return;_e(!0),null===(t=Ne.current)||void 0===t||t.abort();const r=new AbortController;Ne.current=r;const n=await ht(e,r.signal);if(!Ae.current||!n)return;await Promise.resolve(o(n))}catch(e){console.error("IconsTab: insert error",e),ie.error(y("Request error"))}finally{Ae.current&&_e(!1)}},[o,ht,y]);i.useCallback(()=>{var e;ee(null),ct();const t=null===(e=null==ke?void 0:ke.config)||void 0===e?void 0:e.onClose;"function"==typeof t&&t()},[ct,ke]);const{isCopyIconsModalVisible:pt,isCopyLoading:gt,copyForm:mt,openCopyModal:vt,closeCopyModal:yt,resetAfterClose:bt,handleCopyTreeSelect:wt,handleIconsCopyOk:xt,fetchChildFolders:Ct,generateMenuItemsFromFolders:_t,handleCreateFolderAndCopy:St}=(({items:e,selectedHashes:t,getPngDataUrlForItem:r,dataUrlToBlob:n,clearSelection:o})=>{const{t:a}=Yn(),{options:s,state:l}=po(),c=Oo(),[u,d]=i.useState(!1),[h]=E.useForm(),[f,p]=i.useState(!1),g=i.useRef(!1),{state:m,actions:{fetchFolders:v,fetchChildFolders:y,handleModalOk:b}}=Wo(),{EmptyFolderIcon:w}=mo(),{activeFormField:x,setActiveFormField:C,generateMenuItemsFromFolders:_}=rl({folders:Array.isArray(m.folders)?m.folders:[],selectedFolder:l.selectedFolder,EmptyFolderIcon:w,handleCreateFolderModalOk:b,setIsLoading:p,t:a}),S=i.useCallback(async()=>{await v(),d(!0)},[v]),k=i.useCallback(async e=>{e.length>0&&(h.setFieldsValue({targetFolder:e[0]}),x!==e[0].toString()&&C(""))},[x,h,C]),A=i.useCallback(async i=>{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=i||(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 e of r){const r=n.find(t=>t.hash===e);if(!r){c+=1;continue}const u=await a(r);if(!u){c+=1;continue}const d=`${(null===(t=r.name)||void 0===t?void 0:t.trim())||`icon-${e}`}.png`,h=s(u,"image/png");try{await o.uploadFile({name:d,size:h.size,type:"image/png",folderId:i,data:h,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("При копировании произошли ошибки"),placement:"bottomRight",data:{failCount:m,totalCount:f.length,itemIds:f,folderId:null!=h?h:null}}),o()}catch(e){console.error(e),c.error({id:"FILES_COPY_ERROR",message:a("При копировании произошли ошибки"),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}})}},[o,n,r,e,c,s,t,null==l?void 0:l.selectedFolder,a]),I=i.useCallback(()=>{f||g.current||(d(!1),C(""),p(!1))},[f,C]),F=i.useCallback(()=>{C(""),p(!1)},[C]),T=i.useCallback(async e=>{if(!g.current){g.current=!0,p(!0);try{await A(null!=e?e:null),d(!1),C("")}finally{g.current=!1,p(!1)}}},[A,C]),O=i.useCallback(()=>{var e;const t=null!==(e=l.selectedFolder)&&void 0!==e?e:"folders";C(t),h.setFieldsValue({folderName:a("New folder"),targetFolder:t})},[h,l.selectedFolder,C,a]);return{isCopyIconsModalVisible:u,isCopyLoading:f,copyForm:h,openCopyModal:S,closeCopyModal:I,resetAfterClose:F,handleCopyTreeSelect:k,handleIconsCopyOk:T,handleCreateFolderAndCopy:O,fetchChildFolders:y,generateMenuItemsFromFolders:_}})({items:U,selectedHashes:De,getPngDataUrlForItem:ht,dataUrlToBlob:dt,clearSelection:ct}),kt=Boolean(_.trim())&&(U.length>0||Y),At=kt&&De.size>0;return t(r,{children:[t("div",{className:`${RL.iconsTab} ${_.trim()?RL.hasSearch:""}`,children:[kt&&At?t("div",{className:RL.iconsHeaderContainer,children:[t("div",{className:RL.iconsHeaderContainerLeft,children:[t(T.Text,{type:"secondary",children:[De.size," ",y("selected")]}),e(M,{icon:e(Fi,{size:16}),onClick:ct,children:y("Deselected")})]}),e(R,{children:e(M,{icon:e(gi,{size:16}),onClick:vt,children:y("Copy to folder")})})]}):e(NL,{query:x,onQueryChange:C,onSubmit:tt,styleFilter:j,onStyleChange:D,hasResults:U.length>0||Y,inputRef:l}),"family"===A?e(jL,{mode:A,familySlug:O,categoryName:z,colorHex:le,setColorHex:ce,colorHex2:ue,setColorHex2:de,colorHex3:he,setColorHex3:fe,sizePx:me,setSizePx:ve,strokeWidth:pe,setStrokeWidth:ge,responsiveSvg:ye,setResponsiveSvg:be,useCssColor:we,setUseCssColor:xe,showSecondColor:Ke,showThirdColor:Ze,styleFilter:j,onBack:it}):null,e(zL,{items:U,loading:Y,isCollectingResults:Z,hasMore:W,hasQuery:Boolean(_.trim()),mode:A,selectedHash:Q,onItemClick:nt,onInsert:ft,onLoadMore:()=>{Qe({initial:!1})},colorVars:{colorHex:le,colorHex2:ue,colorHex3:he},svgTextMap:ne,previewSize:me,selectedHashes:De,onToggleSelect:lt}),ut?t("div",{className:RL.iconsBottomBar,children:[e(X,{className:"zero-divider"}),e("div",{className:RL.iconsBottomBarContent,children:e(R,{children:e(M,{size:"large",type:"primary",style:{height:40},loading:Ce,onClick:()=>ft(ut),children:y("Choose")})})})]}):null]}),e(G,{title:e("div",{className:"modal-title",children:y("Copy to folder")}),open:pt,onCancel:()=>{gt||yt()},maskClosable:!gt,closable:!gt,keyboard:!gt,footer:t("div",{className:el.formFooter,children:[t(M,{className:el.folderButton,onClick:St,loading:gt,children:[e(wi,{size:18,strokeWidth:null===(v=ke.config)||void 0===v?void 0:v.iconStrokeWidth}),y("Create folder")]}),e(M,{type:"primary",className:el.folderButton,onClick:()=>{yt()},loading:gt,children:y("Done")})]}),afterClose:()=>bt(),children:t("div",{className:RL.copyToFolderModalBody,children:[gt?e("div",{className:RL.copyToFolderModalLoadingOverlay,children:e(S,{size:"large"})}):null,e(E,{form:mt,layout:"vertical",initialValues:{targetFolder:"folders",folderName:y("New folder"),is_force_create:!1},children:t("div",{className:el.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:y("Select the destination folder")}],className:el.formItem,children:e(Js,{onSelect:wt,generateMenuItems:()=>_t({targetForm:mt,onTreeSelect:wt,onComplete:xt,actionButtonText:y("Copy here")}),fetchChildFolders:Ct,disabledFolders:[],mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(y("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})})]})},QL=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)},{Sider:eN,Content:tN}=J,rN={keywords:""},nN=()=>{var s,l,d;const h=Wo(),f=is(),p=(()=>{var e,t;const{state:r,actions:n,options:i}=po(),{selectedFolder:o,pathHistory:a,folders:s}=r,{t:l}=Yn(),{setSelectedFolder:u,setPathHistory:d}=n,h=c(()=>{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=c((e,t=new Set)=>{if(t.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const r=(Array.isArray(s)?s:[]).find(t=>t.id===e);if(!r)return[];const n=new Set(t);return n.add(e),r.parentId?r.parentId===r.id?(console.warn(`Cycle detected: folder ${r.id} is a parent of itself`),[{id:r.id,name:r.name+" (ошибка)"}]):[...f(r.parentId,n),{id:r.id,name:r.name}]:[{id:r.id,name:r.name}]},[s]),p=c(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=c(e=>{if("folders"===e){const e=[{id:"folders",name:l("Folders")}];return null==d||d(e),void(i.onPathChange&&i.onPathChange([]))}const t=(Array.isArray(s)?s:[]).find(t=>t.id===e);if(!t)return void console.warn("⚠️ Folder not found:",e);const r=f(e),n=[{id:"folders",name:l("Folders")},...r];null==d||d(n),i.onPathChange&&i.onPathChange(n.map(e=>e.name))},[s,f,d,i,l]),m=c(e=>{const t="folders"===e?null:e;t!==o&&(null==u||u(t),p(t),g(e))},[p,o,u,g]),v=c(e=>{if(-1===e)null==u||u(null),null==d||d([{id:"folders",name:l("Folders")}]),i.onPathChange&&i.onPathChange([]);else{const t=a.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,a,d,u,l]),y=c(e=>{if(!e.isFolder)return;null==u||u(e.id);const t={id:e.id,name:e.name};if(d){const e=[...a,t];d(e)}if(i.onPathChange){const t=[...a.map(e=>e.name),e.name];i.onPathChange(t)}},[i,a,d,u]);return{state:{selectedFolder:o,pathHistory:a},actions:{handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y},selectedFolder:o,pathHistory:a,handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y}})(),g=(()=>{const{state:e,actions:t}=po(),{pagination:r}=e,{setPagination:n}=t,i=c((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}}})(),m=(()=>{const[e,t]=n.useState(()=>{const e=localStorage.getItem(os);return e?Math.max(290,parseInt(e,10)):298}),[r,i]=n.useState(!1),[o,a]=n.useState(!1),[s,l]=n.useState(0),c=n.useCallback(()=>{t(298),localStorage.setItem(os,298..toString())},[]),u=n.useCallback(r=>{r.preventDefault(),r.stopPropagation(),i(!0),document.body.classList.add("resizing");const n=r.clientX,o=e;let s=o;const c=e=>{e.preventDefault();const r=Math.max(Math.min(o+e.clientX-n,600),290);s=r,t(r),l(e.clientX),a(!0)},u=()=>{i(!1),document.body.classList.remove("resizing"),a(!1),localStorage.setItem(os,s.toString()),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)},[e]);return n.useEffect(()=>()=>{document.body.classList.remove("resizing")},[]),{sidebarWidth:e,isResizing:r,showResizeGuide:o,resizeGuidePosition:s,handleResizeStart:u,handleDoubleClick:c}})(),v=(()=>{const[e,t]=o([]),[r,n]=o(!1),[i,a]=o(!1),s=u(0),l=u(new Map),d=c(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),h=c(e=>ui(e.size),[]),f=c((e,r)=>{const i=r.map(t=>({id:d(),folderId:e,name:t.name,size:h(t),status:"uploading",progress:0}));return t(i),n(!0),a(!1),i.map(e=>e.id)},[d,h]),p=c((e,r)=>{const i={id:d(),folderId:e,name:r,size:void 0,status:"uploading",progress:0};return t(e=>[...e,i]),n(!0),a(!1),i.id},[d]),g=c((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,r))}):t))},[]),m=c((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.name)&&(e.name=r.name),(null==r?void 0:r.size)&&void 0===t.size&&(e.size=ui(r.size)),e}return t}))},[]),v=c((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:r}):t))},[]),y=c(()=>{n(!1),a(!1),setTimeout(()=>{t([]),l.current.clear()},300)},[]),b=c(()=>{a(e=>!e)},[]),w=c(e=>l.current.get(e),[]),x=e.length,C=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:r,isUploadMinimized:i,totalFiles:x,completedFiles:C,startUpload:f,startUploadByUrl:p,updateProgress:g,markAsSuccess:m,markAsError:v,getUploadedFile:w,closeUpload:y,minimizeUpload:b}})(),y=Ha(),{deleteItems:b}=Go(),w=Oo(),{t:C}=Yn(),{options:_,state:k,actions:A}=po(),I=_,E=null==I?void 0:I.onChangeSelection,F=k,T=null==I?void 0:I.config,{dataProviders:O}=I,{form:P,urlForm:R,renameForm:L,moveForm:N,renameFolderForm:j,copyForm:D,isModalVisible:z,isUrlModalVisible:B,isMoveModalVisible:U,isRenameFolderModalVisible:V,isCopyModalVisible:H,isDeleteConfirmVisible:$,folderToRename:W,activeLibraryItem:G}=k,{setIsUrlModalVisible:q,setActiveLibraryItem:Y}=A,{config:K}=_,{DropZoneFileIcon:Z}=mo(),[Q,ee]=o(!1),[te,re]=o(!1),[ne,ie]=o(!1),oe=u(0),ae=u(!1);ae.current=te;const se=i.useRef(null),le=i.useRef([]),[ce,ue]=o(!1),[de,he]=o(!1),fe=Ya(e=>e.selectedFiles),pe=Ya(e=>e.clearSelection),ge=Ya(e=>e.syncVisibleFiles),{folders:me,loading:ve}=h.state,{fetchFolders:ye,fetchChildFolders:be,handleCreateFolder:we,handleModalOk:xe,handleModalCancel:Ce,generateMenuItems:_e}=h.actions,Se=(e=>{var t;const{state:r,actions:n,options:i}=po(),{t:o}=Yn(),a=Oo(),{folders:s,folderToRename:l,renameFolderForm:u,isRenameFolderModalVisible:d}=r,{setFolderToRename:h,setIsRenameFolderModalVisible:f}=n,{apiEndpoints:p,dataProviders:g,config:m}=i,v=c(e=>{null==h||h(e),null==f||f(!0);const t=null==s?void 0:s.find(t=>t.id===e);t&&u&&u.setFieldsValue({newFolderName:t.name})},[h,f,s,u]),y=c(()=>{null==f||f(!1),null==h||h(null),null==u||u.resetFields()},[f,h,u]),b=c(async()=>{var t,r;if(l&&u)try{const i=await u.validateFields();if(!(null==i?void 0:i.newFolderName))return void a.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:o("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:l,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 a.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:o("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:null!=l?l:void 0,itemName:null==i?void 0:i.newFolderName}});if(!(null==g?void 0:g.renameFolder))throw new Error(o("renameFolder is not implemented in dataProviders"));const s=await g.renameFolder(l,i.newFolderName.trim());if(!(null==s?void 0:s.id))return void a.error({id:"FOLDER_RENAME_FAILED",message:o("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:null!=l?l:void 0,itemName:i.newFolderName,error:{message:"invalidResponse"}}});a.success({id:"FOLDER_RENAME_SUCCESS",message:o("Folder renamed"),placement:"bottomRight",data:{itemId:s.id,itemName:s.name,folderId:null!==(r=s.parentId)&&void 0!==r?r:null}}),y(),await e(),l!==s.id&&n.setSelectedFolder&&n.setSelectedFolder(s.id)}catch(e){console.error("Ошибка при переименовании папки:",e),a.error({id:"FOLDER_RENAME_FAILED",message:o("Failed to rename folder"),placement:"bottomRight",innerException:e,data:{itemId:null!=l?l:void 0,itemName:null==u?void 0:u.getFieldValue("newFolderName"),error:{message:e instanceof Error?e.message:String(e)}}})}},[l,u,p,y,e,o,null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder,a]);return{state:{isRenamingFolder:d||!1,folderToRename:l},actions:{showRenameFolderModal:v,handleRenameFolderCancel:y,handleRenameFolderOk:b}}})(ye),{files:ke,loading:Ae,isRenamingFile:Ie,fileToRename:Ee}=f.state,{fetchFiles:Te,handleDeleteFile:Oe,handleDeleteFolder:Pe,handleAddFile:Me,handleAddFileByUrl:Re,showRenameModal:Le,handleRenameCancel:Ne,handleRenameOk:je,handleDroppedFiles:De,showMoveModal:ze,handleMoveCancel:Be,handleMoveOk:Ue,handleCopyOk:Ve,handleCopyCancel:He,showDeleteConfirm:$e,handleDeleteConfirmCancel:We,handleDeleteConfirmOk:Ge}=f.actions,{selectedFolder:qe,pathHistory:Ye}=p.state,{handleFolderSelect:Xe,handleItemClick:Ke}=p.actions,{pagination:Ze}=g.state,Je=Eo(Te),{searchTerm:Qe,sortBy:et,sortOrder:tt}=Je.state,{handleSearch:rt,handleSort:nt,handlePaginationChange:it}=Je.actions,ot=c(async()=>{const e=(e=>Uo(e))(Ye||[]);try{await $o({options:I,pathFolder:e,dataProviders:null==I?void 0:I.dataProviders})}catch(e){console.error("Cache clear failed:",e)}await ye(),await Te({folderId:qe||"",page:Ze.current,limit:Ze.pageSize,search:Qe,sortBy:et,sortOrder:tt,itemType:"all"})},[Te,ye,I,Ze,Ye,Qe,qe,et,tt]),at=(({files:e,fetchFiles:t,selectedFolder:r})=>{var i;const{t:o}=Yn(),a=Oo(),{options:s,actions:l,state:c}=n.useContext(fo),{setActiveLibraryItem:u}=l,{activeLibraryItem:d}=c,h=Ha(),[f,p]=n.useState(!1),[g,m]=n.useState(null),v=n.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return gr.includes(t)}const r=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!r&&gr.includes(r)},[]),y=n.useCallback(async(e,t)=>{var r,n;const{dataProviders:i}=s;if(!1===(null===(n=null===(r=s.config)||void 0===r?void 0:r.features)||void 0===n?void 0:n.enableUpdateFile))throw new qo(o("Updating files is disabled by configuration"),"UnsupportedOperation");if(!e.id||!e.thumbnail||!(null==i?void 0:i.updateFile))throw new qo(o("Failed to save changes"),"UnsupportedOperation");const a=(null==t?void 0:t.mimeType)||Er(e.thumbnail,e.type),l=Fr(a),c=e.name.lastIndexOf("."),u=`${c>0?e.name.substring(0,c):e.name}.${l}`,d=(null==t?void 0:t.blob)||Mr(e.thumbnail,a);return i.updateFile(e.id,{name:u,type:a,data:d})},[s,o]),b=n.useCallback(async(e,t)=>{var r,n,i;if(!e.thumbnail)throw new qo(o("Failed to save changes"),"ValidationError");const a=!(!0===(null===(r=s.config)||void 0===r?void 0:r.saveCopyToCurrentFolder))||(null!==(n=e.saveWithoutFolder)&&void 0!==n?n:!e.id),l=a?void 0:null!==(i=e.folderId)&&void 0!==i?i:void 0,c=(null==t?void 0:t.mimeType)||Er(e.thumbnail,e.type),u=(null==t?void 0:t.blob)||Mr(e.thumbnail,c),d=new File([u],e.name,{type:c,lastModified:Date.now()}),f=await h.uploadFileWithProvider(d,l,void 0,a);if(!f)throw new qo(o("Failed to save image copy"),"FileWriteError");return f},[h,null===(i=s.config)||void 0===i?void 0:i.saveCopyToCurrentFolder,o]),w=n.useCallback(t=>{let r;if(t)r=t;else{const t=Ya.getState().selectedFiles;if(1!==t.size)return;const n=Array.from(t)[0];if(r=e.find(e=>e.id===n),!r||r.isFolder||!v(r))return}u&&u(sr),m(r),p(!0)},[e,v,p,u]),x=n.useCallback(()=>{u&&d===sr&&u(rr),p(!1),m(null)},[d,u]),C=n.useCallback(async(e,n)=>{var i,l,c,u,d,h;try{const c=await y(e,n);return a.success({id:"IMAGE_UPDATE_SUCCESS",message:o("Success"),description:o("Image updated successfully"),placement:"bottomRight",data:{itemId:null!==(i=null==c?void 0:c.id)&&void 0!==i?i:void 0,itemName:null==c?void 0:c.name,folderId:null!==(l=null==c?void 0:c.folderId)&&void 0!==l?l:null,thumbnail:null==c?void 0:c.thumbnail}}),c&&s.onEditorOk&&s.onEditorOk(c,{mode:n.mode}),await t({folderId:r||""}),x(),null!=c?c:void 0}catch(t){const r=No(t),n=null!==(u=null!==(c=Ro(null==r?void 0:r.code,o))&&void 0!==c?c:null==r?void 0:r.message)&&void 0!==u?u:o("Failed to save changes");throw a.error({id:"IMAGE_SAVE_FAILED",message:n,innerException:t,placement:"bottomRight",data:{itemId:null!==(d=e.id)&&void 0!==d?d:void 0,itemName:e.name,folderId:null!==(h=e.folderId)&&void 0!==h?h:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[y,s,t,r,a,x,o]),_=n.useCallback(async(e,n)=>{var i,l,c,u,d,h;try{const c=await b(e,n);return a.success({id:"IMAGE_SAVE_COPY_SUCCESS",message:o("Success"),description:o("Image copy saved successfully"),placement:"bottomRight",data:{itemId:null!==(i=null==c?void 0:c.id)&&void 0!==i?i:void 0,itemName:null==c?void 0:c.name,folderId:null!==(l=null==c?void 0:c.folderId)&&void 0!==l?l:null,thumbnail:null==c?void 0:c.thumbnail}}),c&&s.onEditorOk&&s.onEditorOk(c,{mode:n.mode}),await t({folderId:r||""}),x(),null!=c?c:void 0}catch(t){const r=No(t),n=null!==(u=null!==(c=Ro(null==r?void 0:r.code,o))&&void 0!==c?c:null==r?void 0:r.message)&&void 0!==u?u:o("Failed to save image copy");throw a.error({id:"IMAGE_SAVE_COPY_FAILED",message:n,innerException:t,placement:"bottomRight",data:{itemId:null!==(d=e.id)&&void 0!==d?d:void 0,itemName:e.name,folderId:null!==(h=e.folderId)&&void 0!==h?h:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[b,s,t,r,a,x,o]);return{isPixieEditorVisible:f,editingFile:g,handleEdit:w,handlePixieEditorSave:C,handlePixieEditorSaveCopy:_,handlePixieEditorClose:x}})({files:ke||[],fetchFiles:Te,selectedFolder:qe||null}),[st,lt]=o(!1),ct=c(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)||(oe.current+=1,oe.current>0&&ee(!0))},[]),ut=c(e=>{e.preventDefault(),e.stopPropagation();const t=e.relatedTarget,r=e.currentTarget;if(t&&!r.contains(t))oe.current=Math.max(0,oe.current-1),oe.current<=0&&ee(!1);else if(t){const e=t.closest('[class*="dragOverlay"]');if(e&&r.contains(e))return}},[]),dt=c(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},[]),ht=c(e=>{e.preventDefault(),e.stopPropagation(),ee(!1),oe.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&&(lt(!0),De(t).catch(e=>{"StaleLoad"!==(null==e?void 0:e.name)&&console.error("Ошибка при загрузке файлов:",e)}).finally(()=>{lt(!1)}))},[De]),ft=c(()=>{ee(!1),oe.current=0,document.body.removeAttribute("data-fm-dragging"),ie(!1),re(!1)},[]);i.useEffect(()=>{le.current=ke||[]},[ke]);const pt=null==F?void 0:F.activeLibraryItem;a(()=>{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,ie(!0),e(!0),pt===rr&&re(!0))},n=r=>{const n=r.relatedTarget;(!n||!document.documentElement.contains(n))&&t&&(t=!1,ie(!1),re(!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")}},[pt]),a(()=>{const e=e=>{var t,r;if(document.body.removeAttribute("data-fm-dragging"),ie(!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 t=0;t<e.items.length;t++){const n=e.items[t].getAsFile();n&&r.push(n)}return r})(e.dataTransfer);if(!n.length)return;const i=e.target,o=i.closest(`.${ys.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]");(ae.current||Q||o||a)&&(e.preventDefault(),e.stopPropagation(),re(!1),ee(!1),oe.current=0,lt(!0),De(n).catch(e=>{"StaleLoad"!==(null==e?void 0:e.name)&&console.error("Ошибка при загрузке файлов:",e)}).finally(()=>lt(!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"),ie(!0)),pt!==rr||ae.current||re(!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"),ie(!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)}},[Q,De,pt]),a(()=>{const e=e=>{Q&&ft(),re(!1),ie(!1),document.body.removeAttribute("data-fm-dragging")};return window.addEventListener("dragend",e,!0),()=>window.removeEventListener("dragend",e,!0)},[Q,ft]),a(()=>{let e=null;const t=t=>{Q&&(e=setTimeout(()=>{Q&&ft()},200))};return document.addEventListener("mouseup",t,!0),()=>{document.removeEventListener("mouseup",t,!0),e&&clearTimeout(e)}},[Q,ft]),a(()=>{const e=e=>{"Escape"===e.key&&Q&&ft()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[Q,ft]),a(()=>{const e=e=>{Q&&setTimeout(()=>{Q&&ft()},100)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[Q,ft]);const gt=i.useCallback(async()=>{await Ge(),await ye(),qe===lr&&be&&await be(lr),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var e,t;return null===(t=null===(e=se.current)||void 0===e?void 0:e.refreshFileCounts)||void 0===t?void 0:t.call(e)})})},[ye,be,Ge,qe]),mt=i.useCallback(()=>{he(!0)},[]),vt=i.useCallback(async()=>{var e,t;if(qe!==lr)return console.error("Clear trash called outside of trash folder"),void he(!1);try{if(null==O?void 0:O.cleanTrash){const t=await O.cleanTrash();await Te({folderId:lr}),await(null===(e=se.current)||void 0===e?void 0:e.refreshFileCounts()),t.success?w.success({id:"TRASH_CLEARED_SUCCESS",message:C("Trash cleared successfully"),description:C("{{count}} items permanently deleted",{count:t.deletedCount||0}),placement:"bottomRight"}):w.error({id:"TRASH_CLEAR_FAILED",message:C("Failed to clear trash"),placement:"bottomRight"})}else{const e=le.current||[];if(0===e.length)return void he(!1);const r=e.map(e=>({id:e.id,isFolder:e.isFolder})),n=await b({items:r,selectedFolder:lr,getItemNameById:t=>{var r;return(null===(r=e.find(e=>e.id===t))||void 0===r?void 0:r.name)||t||""},showNotifications:!1});await Te({folderId:lr}),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts());const{successCount:i,failCount:o}=n;0===o?w.success({id:"TRASH_CLEARED_SUCCESS",message:C("Trash cleared successfully"),description:C("{{count}} items permanently deleted",{count:i}),placement:"bottomRight"}):i>0?w.warning({id:"TRASH_CLEARED_PARTIAL",message:C("Trash partially cleared"),description:C("{{succeeded}} items deleted, {{failed}} items failed",{succeeded:i,failed:o}),placement:"bottomRight"}):w.error({id:"TRASH_CLEAR_FAILED",message:C("Failed to clear trash"),placement:"bottomRight"})}he(!1)}catch(e){console.error("Error clearing trash:",e),w.error({id:"TRASH_CLEAR_ERROR",message:C("Error clearing trash"),placement:"bottomRight"}),he(!1)}},[qe,O,Te,w,C,b]),yt=i.useCallback(()=>{he(!1)},[]),bt=i.useCallback(async e=>{var t;await Ue(e),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())},[Ue]),wt=i.useCallback(async e=>{var t;await Ve(e),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())},[Ve]),xt=i.useCallback(async()=>{let e=[],t=new Map;const r=null==I?void 0:I.config;await Me({onStartBatch:n=>{e=v.startUpload(qe||void 0,n),t=new Map,n.forEach((n,i)=>{const o=e[i];o&&(t.set(n.name,o),t.set(Dr(n.name,r),o))})},onStart:n=>{if(0===e.length){e=v.startUpload(qe||void 0,[n]);const i=e[0];i&&(t.set(n.name,i),t.set(Dr(n.name,r),i))}},onProgress:(e,r)=>{const n=t.get(e);n&&v.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==ke?void 0:ke.find(t=>t.name===e&&!t.isFolder);v.markAsSuccess(n,t)}await(null===(r=se.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&&v.markAsError(a,n)},onBatchComplete:async r=>{var n,i,o,a,s,l,c,u;for(let u=0;u<r.successes.length;u++){const d=r.successes[u],h=null===(n=r.uploadedFiles)||void 0===n?void 0:n.get(d),f=null!==(a=null!==(o=null!==(i=t.get(d))&&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:u<e.length?e[u]:void 0;if(f){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:d,folderId:null!==(c=null!==(l=t.folderId)&&void 0!==l?l:qe)&&void 0!==c?c:null,isFolder:!1,size:t.size}}else await new Promise(e=>setTimeout(e,100)),e=null==ke?void 0:ke.find(e=>e.name===d&&!e.isFolder);v.updateProgress(f,100),v.markAsSuccess(f,e)}}r.errors.forEach(({fileName:e,error:r})=>{const n=t.get(e);n&&v.markAsError(n,r)}),await(null===(u=se.current)||void 0===u?void 0:u.refreshFileCounts())}})},[Me,v,ke,qe,null==I?void 0:I.config]),Ct=i.useCallback(async(e,t,r,n)=>{var i,o;try{ue(!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=v.startUploadByUrl(qe||void 0,a);try{const r=await Re(e,t,!0,null!=n?n:"uploadByUrl");if(v.updateProgress(s,100),r){await new Promise(e=>setTimeout(e,100));const e=(null==ke?void 0:ke.find(e=>e.id===r.id&&!e.isFolder))||r;v.markAsSuccess(s,e)}else v.markAsSuccess(s);await(null===(o=se.current)||void 0===o?void 0:o.refreshFileCounts())}catch(e){const t=No(e),r=Bo(t,C);v.markAsError(s,r)}}finally{ue(!1)}},[Re,v,qe,ke,C]),_t=i.useCallback(async({file:e})=>{var t;const r=v.startUpload(qe||void 0,[e])[0];let n=0;const i=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),v.updateProgress(r,n)},200);try{const n=await y.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),v.updateProgress(r,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==ke?void 0:ke.find(e=>e.id===n.id&&!e.isFolder))||n;v.markAsSuccess(r,e)}else v.markAsSuccess(r);const o=n&&n.folderId||qe||null;return Xe&&Xe(o&&"folders"!==o?o:"folders"),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts()),n}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw v.markAsError(r,t),e}},[y,v,qe,ke,Xe]),St=i.useCallback(async e=>{var t;if(De){const r=v.startUpload(qe||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),v.updateProgress(n,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await De(e),r.forEach(e=>{v.updateProgress(e,100),v.markAsSuccess(e)}),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())}},[De,v,qe]),kt=i.useCallback(async e=>{var t;await Pe(e),await ye(),await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())},[Pe,ye]),At=(({files:e,clearSelection:t,showRenameModal:r,showMoveModal:i,showCopyModal:o,handleDeleteFile:a,handleDeleteFolder:s,showDeleteConfirm:l,onEdit:c})=>{const u=n.useCallback(()=>{t()},[t]),d=n.useCallback(e=>{const t=Ya.getState().selectedFiles;if(t&&1===t.size||e){const n=e||Array.from(t)[0];r(n)}},[r]),h=n.useCallback(t=>{const r=Ya.getState().selectedFiles;if(r&&r.size>0||(null==t?void 0:t.id)){if(l)return void l();(t?[t.id]:r).forEach(t=>{const r=e.find(e=>e.id===t);r?r.isFolder?s(t):a(t):console.warn(`Объект с ID ${t} не найден в списке файлов`)})}},[e,a,s,l]);return{handleClearSelection:u,handleRename:d,handleDeleteSelected:h,handleCopy:n.useCallback(()=>{o()},[o]),handleMove:n.useCallback(()=>{i()},[i]),handleEdit:n.useCallback(()=>{c()},[c])}})({files:ke||[],clearSelection:pe,showRenameModal:Le,showMoveModal:ze,showCopyModal:f.actions.showCopyModal||(()=>{}),handleDeleteFile:Oe,handleDeleteFolder:kt,showDeleteConfirm:$e,onEdit:at.handleEdit}),It=ve||Ae||st;a(()=>{Sr()},[]),x(()=>{G!==rr?pe():ge(ke||[])},[G,ke,ge,pe]),a(()=>{if(!E||G!==rr)return;if(!ur.current)return void(ur.current=!0);const e=(Array.isArray(ke)?ke:[]).filter(e=>fe.has(e.id));E(e)},[G,ke,fe,E]),i.useEffect(()=>{if(!Xe||0===me.length)return;const e=!1!==(null==T?void 0:T.rememberLastFolder),t=`em_fm:lastFolder:${(null==T?void 0:T.projectId)||"default"}`;if(e&&"undefined"!=typeof window)try{const e=localStorage.getItem(t),r=e&&me.some(t=>t.id===e);if(r)return void Xe(e)}catch(e){}qe||Xe("folders")},[qe,Xe,me,null==T?void 0:T.rememberLastFolder,null==T?void 0:T.projectId]);const{handleRenameFolderCancel:Et,handleRenameFolderOk:Ft}=Se.actions;a(()=>{const e=async e=>{if(G!==rr)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 St(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 Ct(r);else if(r.includes("<meta")||r.includes("http")){const t=r.match(/https?:\/\/[^\s"']+/);t&&(e.preventDefault(),await Ct(t[0]))}})};return document.addEventListener("paste",e),()=>{document.removeEventListener("paste",e)}},[G,Ct,St]);const Tt=u(Ze);a(()=>{Tt.current=Ze},[Ze]);const Ot=c(e=>{it(e.current||Tt.current.current,e.pageSize||Tt.current.pageSize)},[it]),Pt=c(e=>{null==Ke||Ke(e)},[Ke]),Mt=i.useCallback(e=>{const{sortBy:t,sortOrder:r}=(e=>{const[t,r]=e.split("-");return{sortBy:t,sortOrder:r}})(e);nt(t,r)},[nt]),[Rt,Lt]=o(rN),[Nt,jt]=o([]),Dt=u(null),[zt,Bt]=o(vr),[Ut,Vt]=o([]),Ht=u(null),[$t,Wt]=o(""),Gt=u(null),[qt,Yt]=o(""),[Xt,Kt]=o([]),Zt=i.useRef(void 0),[Jt,Qt]=o(!1),[er,tr]=o(!1),cr=i.useRef(null),ur=i.useRef(!1),dr=i.useRef(G),hr=i.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})},[]),fr=i.useCallback(async e=>{var t;const r=v.startUpload(qe||void 0,[e])[0];let n=0;const i=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),v.updateProgress(r,n)},200);try{const n=await y.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),v.updateProgress(r,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==ke?void 0:ke.find(e=>e.id===n.id&&!e.isFolder))||n;v.markAsSuccess(r,e)}else v.markAsSuccess(r);await(null===(t=se.current)||void 0===t?void 0:t.refreshFileCounts())}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw v.markAsError(r,t),e}},[v,ke,y,qe]),pr=c(async e=>{if(Boolean(e&&e.startsWith("data:"))){const t=hr(e);if(!t)return;return void await fr(t)}e&&await Ct(e,void 0,void 0,"iconStock")},[hr,Ct,fr]),yr=c(async()=>{const e=null==K?void 0:K.fileForEdit;if(Zt.current===e)return;if(G===sr&&e&&!at.editingFile){Zt.current=e;try{if("string"==typeof e){if(e.startsWith("data:"))return void(null==at||at.handleEdit({thumbnail:e,saveWithoutFolder:!0}));const t=await y.resolveFileForEditByUrl(e);Zt.current===e&&(null==at||at.handleEdit(t))}}catch(t){Zt.current===e&&(Zt.current=null),console.error("Failed to open file in editor:",t),null==at||at.handlePixieEditorClose()}}},[null==K?void 0:K.fileForEdit,G,at,y]);a(()=>{yr()},[yr]),a(()=>{var e,t,r,n;const i=dr.current;dr.current=G,G===rr?(jt([]),Lt(rN),Vt([]),Bt(vr),Kt([]),Yt(""),tr(!1),Qt(!1),i===rr||i!==ir&&i!==nr&&i!==ar||rt("")):G===ar?null===(e=cr.current)||void 0===e||e.focus():G===nr?null===(t=Dt.current)||void 0===t||t.focus():G===ir?null===(r=Ht.current)||void 0===r||r.focus():G===or&&(null===(n=Gt.current)||void 0===n||n.focus())},[G,rt]);const br=i.useCallback(async()=>{var e;await Ft(),await(null===(e=se.current)||void 0===e?void 0:e.refreshFileCounts())},[Ft]),wr=fe.size,xr=i.useMemo(()=>{var e,t,r;if(1!==wr)return!1;const[n]=Array.from(fe),i=ke.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&&mr.includes(s)},[wr,fe,ke]),Cr=c(e=>{var t;return e?(null===(t=e.files)||void 0===t?void 0:t.length)?Array.from(e.files):e.items?Array.from(e.items).map(e=>e.getAsFile()).filter(e=>Boolean(e)):[]:[]},[]);return t(r,{children:[ne&&pt===rr&&Fe(e("div",{className:ys.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"))&&!ae.current&&re(!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"))&&re(!0)},onDragLeave:e=>{const t=e.relatedTarget;t&&document.documentElement.contains(t)||(re(!1),ie(!1),document.body.removeAttribute("data-fm-dragging"))},onDrop:e=>{e.preventDefault(),e.stopPropagation(),ie(!1),re(!1),document.body.removeAttribute("data-fm-dragging");const t=Cr(e.dataTransfer);t.length&&(lt(!0),De(t).catch(e=>{"StaleLoad"!==(null==e?void 0:e.name)&&console.error(e)}).finally(()=>lt(!1)))},"aria-hidden":"true"}),document.body),te&&Fe(e("div",{className:ys.dragOverlayGlobal,"data-drop-overlay":"true",onDragOver:e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},onDragEnter:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),e.stopPropagation(),re(!1),ie(!1),document.body.removeAttribute("data-fm-dragging");const t=Cr(e.dataTransfer);t.length&&(lt(!0),De(t).catch(e=>{"StaleLoad"!==(null==e?void 0:e.name)&&console.error(e)}).finally(()=>lt(!1)))},"aria-hidden":"true",children:t("div",{className:ys.dragOverlayInner,children:[e("div",{className:ys.uploadIcon,children:e(Z,{})}),e("div",{className:ys.textTitle,children:C("Drop files here to upload")}),e("div",{className:ys.textDescription,children:C("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),document.body),e(J,{className:"file-manager__layout",children:t("div",{className:ys.filesContainer,"data-files-container":"true",onDragOver:dt,onDragLeave:ut,onDragEnter:ct,onDrop:ht,children:[Q&&e("div",{className:ys.dragOverlay,children:t("div",{className:ys.dragOverlayInner,children:[e("div",{className:ys.uploadIcon,children:e(Z,{})}),e("div",{className:ys.textTitle,children:C("Drop files here to upload")}),e("div",{className:ys.textDescription,children:C("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),m.showResizeGuide&&e("div",{className:"resize-guide",style:{left:`${m.resizeGuidePosition}px`}}),t(J,{className:"file-manager__content",children:[t(eN,{width:320,theme:"light",className:"file-manager-sider",children:[e(al,{ref:se,selectedFolder:qe||"folders",generateMenuItems:_e,onFolderSelect:e=>null==Xe?void 0:Xe(e),folders:me||[],fetchFolders:ye,fetchChildFolders:be,handleAddFile:xt,setIsUrlModalVisible:e=>null==q?void 0:q(e),handleDeleteFolder:kt,handleCreateFolder:we,activeLibraryItem:G,setActiveLibraryItem:e=>null==Y?void 0:Y(e)}),e("div",{className:"sidebar-resizer "+(m.isResizing?"resizing":""),onMouseDown:m.handleResizeStart,onDoubleClick:m.handleDoubleClick,children:e("div",{className:"sidebar-resizer-indicator"})})]}),t(J,{className:"file-manager__main-content",children:[st&&e(Qs,{style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,zIndex:100,background:"var(--colorBgLayout)"}}),t(tN,{className:"main-content",children:[e(dL,{activeLibraryItem:G,selectedFolder:(null===(s=null==me?void 0:me.find(e=>(null==e?void 0:e.id)===qe))||void 0===s?void 0:s.name)||C("Folders"),isTrashFolder:"Trash"===qe,onClearTrash:mt,files:ke||[],loading:It,onRefresh:ot,refreshDisabled:Ae||ve,showRefresh:!(!(null===(l=null==I?void 0:I.apiEndpoints)||void 0===l?void 0:l.clearCache)&&!(null===(d=null==I?void 0:I.dataProviders)||void 0===d?void 0:d.clearCache))}),e(X,{className:"zero-divider"}),G===rr&&e(Vs,{searchTerm:Qe,handleAddFile:xt,files:ke||[],handleSearch:rt,sortBy:et,sortOrder:tt,handleSortOptionChange:Mt,pagination:Ze,setPagination:Ot,loading:It,handleItemClick:Pt,onClearSelection:At.handleClearSelection,onRename:At.handleRename,onCopy:At.handleCopy,onMove:At.handleMove,onDelete:At.handleDeleteSelected,showRenameModal:Le,showDeleteConfirm:$e,showCopyModal:f.actions.showCopyModal||(()=>{}),showMoveModal:ze,onEdit:at.handleEdit,getFileData:y.getFileData}),G===nr&&e(bL,{imageGifList:Nt,setImageGifList:jt,currentReqGif:Rt,setCurrentReqGif:Lt,inputRef:Dt,customRequest:(e,t)=>Ct(e,void 0,t,"gif")}),G===ir&&e(_L,{imageStockList:Ut,setImageStockList:Vt,currentReq:zt,setCurrentReq:Bt,inputRef:Ht,customRequest:(e,t)=>Ct(e,void 0,t,"imageStock")}),G===or&&e(JL,{apiKey:null==K?void 0:K.STREAMLINE_API_KEY,customRequest:pr,query:$t,setQuery:Wt,inputRef:Gt}),G===ar&&!!(null==K?void 0:K.sseQuery)&&e(ML,{imageAiList:Xt,setImageAiList:Kt,aiImageRequest:qt,setAiImageRequest:Yt,inputAiRef:cr,customRequest:_t,isLoadingAi:Jt,setIsLoadingAi:Qt,isImageUploaded:er,setIsImageUploaded:tr}),G===sr&&e(r,{}),e(r,{children:xr&&t(r,{children:[e(X,{className:"zero-divider"}),e("div",{style:{display:"flex",justifyContent:"right",padding:"17px 24px",alignItems:"center"},children:e(M,{size:"large",type:"primary",style:{height:40},onClick:()=>{if(_.onEditorOk){const e=Array.from(fe)[0],t=ke.find(t=>t.id===e);t&&_.onEditorOk(t)}},children:C("Choose")})})]})})]})]})]}),ce&&!v.isUploadVisible&&e("div",{style:{position:"fixed",inset:0,zIndex:1500,backgroundColor:"rgba(255, 255, 255, 0.5)",pointerEvents:"all",display:"flex",alignItems:"center",justifyContent:"center"},children:e(S,{size:"large"})}),e(il,{isModalVisible:z,handleModalOk:xe,handleModalCancel:Ce,form:P,selectedFolder:qe||null,folders:me||[],isUrlModalVisible:B,setIsUrlModalVisible:e=>null==q?void 0:q(e),handleAddFileByUrl:Ct,urlForm:R,isRenameModalVisible:Ie,handleRenameOk:()=>null==je?void 0:je(),handleRenameCancel:()=>null==Ne?void 0:Ne(),renameForm:L,fileToRename:Ee,files:ke||[],isMoveModalVisible:U,handleMoveOk:bt,handleMoveCancel:Be,moveForm:N,selectedFiles:fe||new Set,isRenameFolderModalVisible:V,handleRenameFolderOk:br,handleRenameFolderCancel:Et,renameFolderForm:j,folderToRename:W,isCopyModalVisible:H,handleCopyOk:wt,handleCopyCancel:He,copyForm:D,isDeleteConfirmVisible:$,handleDeleteConfirmOk:gt,handleDeleteConfirmCancel:()=>null==We?void 0:We(),isClearTrashConfirmVisible:de,handleClearTrashConfirm:vt,handleClearTrashCancel:yt,fetchChildFolders:be}),e(MR,{visible:at.isPixieEditorVisible,onClose:at.handlePixieEditorClose,file:at.editingFile,onSave:at.handlePixieEditorSave,onSaveCopy:at.handlePixieEditorSaveCopy}),e(lL,{files:v.uploadFiles,visible:v.isUploadVisible,minimized:v.isUploadMinimized,totalFiles:v.totalFiles,completedFiles:v.completedFiles,onClose:v.closeUpload,onMinimize:v.minimizeUpload,onInsert:e=>{var t;const r=v.getUploadedFile(e.id)||e;null===(t=_.onEditorOk)||void 0===t||t.call(_,r)}})]})})]})},iN=f(({config:n={},onPathChange:o,onChangeSelection:s,onEditorOk:l,searchQuery:c="",sortBySize:d="name",apiEndpoints:h={},customIcons:f,dragDropIcon:p,dataProviders:g,handleNotify:m,handleError:v,handleSuccess:y})=>{const b=i.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}),n.fileNameProcessing),folderNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),n.folderNameProcessing)},n),[n]);i.useEffect(()=>{b.theme&&(e=>{if("system"===e){const t=matchMedia(hr).matches?ur:cr;e=e===dr?t:e}document.documentElement.setAttribute("data-theme",e)})(b.theme),QL(b)},[b]),a(()=>{b.locale&&b.locale!==On.language&&On.changeLanguage(b.locale),b.customLocale&&b.locale&&On.addResourceBundle(b.locale,"translation",b.customLocale,!0,!0)},[b.locale,b.customLocale]);const w=u(null),x=i.useMemo(()=>({apiEndpoints:h,searchQuery:c,sortBySize:d,onPathChange:o,onChangeSelection:s,onEditorOk:l,config:b,customIcons:f,dragDropIcon:p,dataProviders:g,handleNotify:m,handleError:v,handleSuccess:y}),[h,c,d,o,s,l,b,f,p,g,m,v,y]);return e(I,{className:"em-filemanager",children:t(r,{children:[e(A,{getPopupContainer:()=>w.current||document.body,children:e(go,{options:x,children:e(nN,{})})}),e("div",{ref:w,className:"file-manager-modal-root"})]})})});iN.displayName="FileManagerApp";const oN=t=>{var r,n,i;return e(Xn,{i18n:On,children:e(wr,{externalTheme:null!==(n=null===(r=t.config)||void 0===r?void 0:r.theme)&&void 0!==n?n:"light",customThemeToken:null===(i=t.config)||void 0===i?void 0:i.customTheme,children:e(oe,{children:e(iN,Object.assign({},t))})})})},aN=new Map,sN=(t,r)=>{var n;let i;Sr();let o={};const a=e=>{const t=!e||"fileManager"!==e.mode&&"imageCenter"!==e.mode&&"plugin"!==e.mode?void 0:e.mode;return"imageCenter"===t?Cr("imageCenter",e):Cr(t)};if(t instanceof HTMLElement){i=t;o={config:a(r),apiEndpoints:null==r?void 0:r.apiEndpoints}}else{i=t.element;const e=a(t.config),r=Object.assign(Object.assign({},null===(n=t.config)||void 0===n?void 0:n.apiEndpoints),t.apiEndpoints);o={config:e,currentPath:t.currentPath,onPathChange:t.onPathChange,onChangeSelection:t.onChangeSelection,searchQuery:t.searchQuery,sortBySize:t.sortBySize,apiEndpoints:r,dataProviders:t.dataProviders,customIcons:t.customIcons,dragDropIcon:t.dragDropIcon,handleNotify:t.handleNotify,handleError:t.handleError,handleSuccess:t.handleSuccess}}const s=_(i);s.render(e(oN,Object.assign({},o))),aN.set(i.id||`container_${Date.now()}`,s)},lN=e=>{const t=e.id||Object.keys(aN).find(e=>e.startsWith("container_"));if(t&&aN.has(t)){const e=aN.get(t);null==e||e.unmount(),aN.delete(t)}else{console.warn("Couldn t find the root to unmount");try{_(e).unmount()}catch(e){console.error("Error unmounting the component:",e)}}},cN=new Map,uN=n=>{const{onClose:o,onSave:s,dataProviders:l,theme:c,locale:d,hasPagination:h,disablePagination:f,paginationAvailable:p,dedupeUploadNamesOnClient:g,saveCopyToCurrentFolder:m}=n,v=i.useMemo(()=>{var e,t;return{theme:null!=c?c:"light",locale:d,baseUrl:n.baseUrl,assetsUrl:n.assetsUrl,compressMaxSize:n.compressMaxSize,compressMaxWidthOrHeight:n.compressMaxWidthOrHeight,compessorUrl:null!==(e=n.compessorUrl)&&void 0!==e?e:n.compressorUrl,compressorUrl:null!==(t=n.compressorUrl)&&void 0!==t?t:n.compessorUrl,showNotifications:n.showNotifications,handleFileProxy:n.handleFileProxy,hasPagination:h,disablePagination:f,paginationAvailable:p,dedupeUploadNamesOnClient:g,saveCopyToCurrentFolder:m}},[c,d,n.baseUrl,n.assetsUrl,n.compressMaxSize,n.compressMaxWidthOrHeight,n.compessorUrl,n.compressorUrl,n.showNotifications,n.handleFileProxy,h,f,p,g,m]),y=i.useCallback(async(e,t,r,n)=>{if(!e&&!t||!(null==l?void 0:l.getFiles))return null;try{const i=await l.getFiles({folderId:n?void 0:null!=r?r:void 0,noFolder:n,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 console.warn("Standalone Pixie: failed to resolve uploaded file from provider",e),null}},[l]),b=i.useMemo(()=>{if(n.file)return n.file;const e=n.name||"edited-image",t=n.extension||(n.type?n.type.split("/")[1]:"png"),r=n.type||`image/${t}`;return{thumbnail:n.imageDataUrl||"",name:e,id:void 0,type:r,extension:t,saveWithoutFolder:!0}},[n.file,n.imageDataUrl,n.name,n.extension,n.type]),w=i.useCallback(async(e,t)=>{if((null==l?void 0:l.updateFile)&&e.thumbnail)try{const r=(null==t?void 0:t.mimeType)||Er(e.thumbnail,e.type),n=Fr(r),i=e.name.substring(0,e.name.lastIndexOf("."))+"."+n,o=(null==t?void 0:t.blob)||Mr(e.thumbnail,r);return await l.updateFile(e.id,{name:i,type:r,data:o})}catch(e){return console.error("Error updating the file through updateFile:",e),null}return console.warn("DataProvider for updating files is not configured"),null},[l]),x=i.useCallback(async(e,t)=>{var r,n,i,o,a,s;if(!e.thumbnail)return null;try{const c=!0!==v.saveCopyToCurrentFolder||(null!==(r=e.saveWithoutFolder)&&void 0!==r?r:!e.id),u=c?"":e.folderId||"",d=(null==t?void 0:t.mimeType)||Er(e.thumbnail,e.type),h=(null==t?void 0:t.blob)||Mr(e.thumbnail,d),f=Dr(e.name,v),p=await hi(l,f,u,c,Br(v)),g=new File([h],p,{type:d,lastModified:Date.now()});if(null==l?void 0:l.uploadFiles){const t=await l.uploadFiles({items:[{name:g.name,size:g.size,type:g.type,folderId:u,noFolder:c,data:g,extension:Fr(d)}],folderId:u}),r=null===(n=t.detailed)||void 0===n?void 0:n[0];if(t.success&&(null==r?void 0:r.success)&&r.data){const t=r.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||g.type,size:null!==(o=t.size)&&void 0!==o?o:g.size,extension:t.extension||Fr(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};const n=await y(r.data.id,r.data.name||g.name,null!==(a=r.data.folderId)&&void 0!==a?a:u,c);return n||{id:r.data.id||e.id||"",name:r.data.name||e.name,folderId:null!==(s=r.data.folderId)&&void 0!==s?s:u,type:g.type,size:g.size,extension:Fr(d),url:r.data.url,thumbnailUrl:r.data.thumbnailUrl,thumbnail:r.data.thumbnail,isFolder:!1,selected:!1}}}return(null==l?void 0:l.uploadFile)?await l.uploadFile({name:g.name,size:g.size,type:g.type,folderId:u,noFolder:c,data:g,extension:Fr(d)}):null}catch(e){return console.error("Error saving file copy:",e),null}},[l,y,v]),C=i.useCallback(async(e,t)=>{if((null==l?void 0:l.updateFile)&&e.id&&e.thumbnail)try{const r=await w(e,t);r&&(e=r)}catch(e){console.error("Standalone Pixie: saveFileToServer error",e)}return s&&await s(e,t),o&&o(),e},[l,s,o,w]),_=i.useCallback(async(e,t)=>{let r=e;if(e.thumbnail)try{const n=await x(e,t);n&&(r=n)}catch(e){console.error("Standalone Pixie: saveFileCopyToServer error",e)}return s&&await s(r,t),o&&o(),r},[o,s,x]),S=u(null);return a(()=>{d&&d!==On.language&&On.changeLanguage(d)},[d]),e(I,{className:"em-filemanager",children:t(r,{children:[e(A,{getPopupContainer:()=>S.current||document.body,children:e(Xn,{i18n:On,children:e(wr,{externalTheme:null!=c?c:"light",children:e(oe,{children:e(go,{options:{dataProviders:l,handleNotify:n.handleNotify,handleError:n.handleError,handleSuccess:n.handleSuccess,config:v},children:e(MR,{visible:!0,onClose:o,file:b,onSave:C,onSaveCopy:_})})})})})}),e("div",{ref:S,className:"file-manager-modal-root"})]})})},dN=t=>{Sr();const r=t.element,n=_(r);n.render(e(uN,Object.assign({},t))),cN.set(r.id||`pixie_container_${Date.now()}`,n)},hN=e=>{const t=Array.from(cN.keys()).find(e=>e.startsWith("pixie_container_")),r=e.id||t;if(r&&cN.has(r)){const e=cN.get(r);null==e||e.unmount(),cN.delete(r)}else{console.warn("Couldn t find the root to unmount Pixie");try{_(e).unmount()}catch(e){console.error("Error unmounting Pixie:",e)}}},fN=e=>{var t,r;const{mode:n,element:i,fileManager:o,pixieEditor:a,theme:s,dataProviders:l}=e;let c,u;const d={unmount:()=>{c&&lN(c),u&&hN(u)},unmountFileManager:void 0,unmountPixieEditor:void 0};switch(n){case"fileManager":c=i,sN(i,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),d.unmountFileManager=()=>lN(c);break;case"pixieEditor":u=i,dN(Object.assign({element:i,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),d.unmountPixieEditor=()=>hN(u);break;case"both":{const e=document.createElement("div");e.id="file-manager-container",e.style.cssText="height: 50%; border-bottom: 1px solid #d9d9d9;";const t=document.createElement("div");t.id="pixie-editor-container",t.style.cssText="height: 50%;",i.appendChild(e),i.appendChild(t),c=e,u=t,sN(c,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(r=null==o?void 0:o.config)||void 0===r?void 0:r.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),dN(Object.assign({element:u,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),d.unmountFileManager=()=>lN(c),d.unmountPixieEditor=()=>hN(u);break}}return d};function pN(e,t="BackendError"){switch(e){case 400:return"ValidationError";case 401:return"AuthenticationFailed";case 403:return"AuthorizationFailed";case 404:return"FileNotFound";case 413:return"PayloadTooLarge";case 415:return"UnsupportedMediaType";case 429:return"RateLimitExceeded";case 500:return"BackendError";case 503:return"ServiceUnavailable";case 504:return"Timeout";default:return t}}var gN={init:sN,unmount:lN,initPixieEditor:dN,unmountPixieEditor:hN,initFileManager:fN};export{Vs as FileContent,qo as FileManagerApiError,iN as FileManagerApp,oN as FileManagerAppWithContext,il as FileModals,al as FolderSidebar,uN as PixieOnlyApp,gN as default,sN as init,fN as initFileManager,dN as initPixieEditor,Sr as installResizeObserverErrorHandler,pN as mapHttpStatusToErrorCode,kr as uninstallResizeObserverErrorHandler,lN as unmount,hN as unmountPixieEditor};
62
62
  //# sourceMappingURL=file-manager.esm.js.map