From 7c79fedfee4c370f5b33b3197100be2b011ca15a Mon Sep 17 00:00:00 2001 From: Rein Van Oyen Date: Wed, 24 Apr 2024 23:01:03 +0200 Subject: [PATCH] feat: implements bulk delete action --- public/js/app.js | 2 +- public/mix-manifest.json | 2 +- resources/js/actions/all.js | 2 + resources/js/actions/bulk-delete.js | 62 +++++++++++++++++++++++++++++ src/Action/BulkDelete.php | 49 +++++++++++++++++++++++ 5 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 resources/js/actions/bulk-delete.js create mode 100644 src/Action/BulkDelete.php diff --git a/public/js/app.js b/public/js/app.js index f9b757f..2452f52 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,2 +1,2 @@ /*! For license information please see app.js.LICENSE.txt */ -(self.webpackChunk=self.webpackChunk||[]).push([[773],{828:(t,e,r)=>{"use strict";var n=r(294),o=r(745),i=r(688),a=r(798),c=r(935);let u=function(t){t()};const s=()=>u,l=(0,n.createContext)(null);function f(){return(0,n.useContext)(l)}let p=()=>{throw new Error("uSES not initialized!")};const d=(t,e)=>t===e;function y(t=l){const e=t===l?f:()=>(0,n.useContext)(t);return function(t,r=d){const{store:o,subscription:i,getServerState:a}=e(),c=p(i.addNestedSub,o.getState,a||o.getState,t,r);return(0,n.useDebugValue)(c),c}}const h=y();r(679),r(973);const m={notify(){},get:()=>[]};function b(t,e){let r,n=m;function o(){a.onStateChange&&a.onStateChange()}function i(){r||(r=e?e.addNestedSub(o):t.subscribe(o),n=function(){const t=s();let e=null,r=null;return{clear(){e=null,r=null},notify(){t((()=>{let t=e;for(;t;)t.callback(),t=t.next}))},get(){let t=[],r=e;for(;r;)t.push(r),r=r.next;return t},subscribe(t){let n=!0,o=r={callback:t,next:null,prev:r};return o.prev?o.prev.next=o:e=o,function(){n&&null!==e&&(n=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}const a={addNestedSub:function(t){return i(),n.subscribe(t)},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(r)},trySubscribe:i,tryUnsubscribe:function(){r&&(r(),r=void 0,n.clear(),n=m)},getListeners:()=>n};return a}const v=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?n.useLayoutEffect:n.useEffect;let g=null;const w=function({store:t,context:e,children:r,serverState:o}){const i=(0,n.useMemo)((()=>{const e=b(t);return{store:t,subscription:e,getServerState:o?()=>o:void 0}}),[t,o]),a=(0,n.useMemo)((()=>t.getState()),[t]);v((()=>{const{subscription:e}=i;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}}),[i,a]);const c=e||l;return n.createElement(c.Provider,{value:i},r)};function j(t=l){const e=t===l?f:()=>(0,n.useContext)(t);return function(){const{store:t}=e();return t}}const O=j();function _(t=l){const e=t===l?O:j(t);return function(){return e().dispatch}}const S=_();var x,P;x=a.useSyncExternalStoreWithSelector,p=x,(t=>{g=t})(i.useSyncExternalStore),P=c.unstable_batchedUpdates,u=P;var k=r(890);function E(t){return function(e){var r=e.dispatch,n=e.getState;return function(e){return function(o){return"function"==typeof o?o(r,n,t):e(o)}}}}var C=E();C.withExtraArgument=E;const R=C;function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:I,e=arguments.length>1?arguments[1]:void 0;return"cmf/update"===e.type?L(L({},t),{},{title:e.payload.title,version:e.payload.version}):t},auth:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"auth/loggedin":return B(B({},t),{},{isLoggedIn:!0,user:e.payload});case"auth/loggedout":return B(B({},t),{},{isLoggedIn:!1,user:null});default:return t}},location:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"location/refresh":return H(H({},t),{},{refresh:!0});case"location/stop-refresh":return H(H({},t),{},{refresh:!1});case"location/update":var r=H(H({},t.current),e.payload);return H(H({},t),{},{previous:H({},t.current),current:H({},r)});default:return t}},media:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ut,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"media/init":return at(at({},t),{},{isInitialised:!0,directory:e.payload.directory,path:e.payload.path,directories:e.payload.directories,files:e.payload.files});case"media/path/update":return at(at({},t),{},{path:e.payload});case"media/directory/update":return at(at({},t),{},{directory:e.payload});case"media/directories/move":return t.directory&&t.directory.id!==e.moveToId||!t.directory&&e.moveToId?at(at({},t),{},{directories:t.directories.filter((function(t){return!e.directoryIds.includes(t.id)}))}):at({},t);case"media/directories/update":return at(at({},t),{},{directories:e.payload});case"media/directories/rename":var r=nt(t.directories).map((function(t){return at(at({},t),{},{name:t.id===e.payload.id?e.payload.name:t.name})}));return at(at({},t),{},{directories:r});case"media/directories/delete":return at(at({},t),{},{directories:t.directories.filter((function(t){return!e.directoryIds.includes(t.id)}))});case"media/directories/add":return at(at({},t),{},{directories:[].concat(nt(t.directories),[e.payload]).sort((function(t,e){return t.name.toLowerCase()>e.name.toLowerCase()?1:-1}))});case"media/files/label":var n=nt(t.files).map((function(t){return at(at({},t),{},{label:t.id===e.fileId?e.label:t.label})}));return at(at({},t),{},{files:n});case"media/files/changeProperties":var o=nt(t.files).map((function(t){return t[e.property]=e.fileIds.includes(t.id)?e.value:t[e.property],t}));return at(at({},t),{},{files:o});case"media/files/changeProperty":var i=nt(t.files).map((function(t){return t[e.property]=t.id===e.fileId?e.value:t[e.property],t}));return at(at({},t),{},{files:i});case"media/files/delete":return at(at({},t),{},{files:t.files.filter((function(t){return!e.fileIds.includes(t.id)}))});case"media/files/add":return at(at({},t),{},{files:[].concat(nt(t.files),[e.payload])});case"media/files/move":return t.directory&&t.directory.id!==e.moveToId||!t.directory&&e.moveToId?at(at({},t),{},{files:t.files.filter((function(t){return!e.fileIds.includes(t.id)}))}):at({},t);case"media/files/rename":var a=nt(t.files).map((function(t){return at(at({},t),{},{name:t.id===e.payload.id?e.payload.name:t.name})}));return at(at({},t),{},{files:a});case"media/files/update":return at(at({},t),{},{files:e.payload});case"media/view/update":return at(at({},t),{},{viewMode:e.payload});default:return t}},modules:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W,e=arguments.length>1?arguments[1]:void 0;return"modules/update"===e.type?V(V({},t),{},{all:e.payload.all,primary:e.payload.primary,secondary:e.payload.secondary}):t},language:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:et,e=arguments.length>1?arguments[1]:void 0;return"language/update"===e.type?X(X({},t),{},{language:e.payload}):t}});const lt=st;const ft={get:function(t){var e=document.querySelector('meta[name="'+t+'"]');return e?e.getAttribute("content"):null}},pt={get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=window.localStorage.getItem(t);return r||null===e?r:e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},clear:function(){window.localStorage.clear()}};var dt=function(){for(var t=arguments.length,e=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=t.split("."),n=window.i18n,o=0;o1&&void 0!==arguments[1]?arguments[1]:null,r=document.createElement("button");return r.setAttribute("type","button"),r.classList.add("button"),r.textContent=t,e&&r.addEventListener("click",e),r},i18nNotify:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.notify(mt.get(t,e))},notify:function(t){var e=this;this.notificationStackEl||(this.notificationStackEl=document.createElement("div"),this.notificationStackEl.classList.add("notification-stack"),document.body.appendChild(this.notificationStackEl));var r=document.createElement("div");r.classList.add("notification"),r.textContent=bt.toUpperCaseFirst(t),this.notificationStackEl.appendChild(r),setTimeout((function(){r.classList.add("notification--hidden"),setTimeout((function(){return e.notificationStackEl.removeChild(r)}),250)}),3e3)},copyText:function(t,e){var r=document.createElement("textarea");r.value=t,r.style.top=0,r.style.left=0,r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")&&e()}catch(t){console.error("Fallback: Oops, unable to copy text to clipboard",t)}document.body.removeChild(r)}};var gt=r(379),wt=r.n(gt),jt=r(709),Ot={insert:"head",singleton:!1};wt()(jt.Z,Ot);jt.Z.locals;const _t={scrollTop:function(){document.body.scrollTop=0,document.documentElement.scrollTop=0},className:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return t;if("string"==typeof e&&(e=[e]),!e.length)return t;var r=" "+t+"--";return t+(e?r+e.join(r):"")},shallowEqual:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=0,i=r;ot.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function se(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}const le={path:ft.get("cmf:path"),currentPath:{},history:[],parseLocation:function(t){var e="/"+this.path+"/",r=t.search,n=new URLSearchParams(r),o=Object.fromEntries(n),i=t.pathname,a=(i.startsWith(e)?i.slice(e.length):"").split("/");return{module:a[0],action:a[1],params:o}},update:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};yt.dispatch({type:"location/update",payload:{module:t,action:e,params:r}})},goTo:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=ae.query(r),i="".concat(this.path,"/").concat(t,"/").concat(e)+(o?"?"+o:"");n?window.open(i):(window.history.pushState({},"",i),this.history.push({module:t,action:e,params:r}),this.update(t,e,r))},refresh:function(){yt.dispatch(function(){var t=function(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){se(i,n,o,a,c,"next",t)}function c(t){se(i,n,o,a,c,"throw",t)}a(void 0)}))}}(ue().mark((function t(e){return ue().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e({type:"location/refresh"});case 2:e({type:"location/stop-refresh"});case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},goBack:function(){var t=this.history[this.history.length-2],e=t.module,r=t.action,n=t.params;this.goTo(e,r,n)},handleRedirect:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.refresh?this.refresh():t.redirectBack?this.goBack():t.redirect&&this.goTo(t.path.module,t.redirect,e)}};function fe(t){var e=h((function(t){return t.modules.primary})),r=function(e){t.onModuleSwitch&&t.onModuleSwitch(),le.goTo(e.id,"index")},o=function(t,e){"open"===t?r(e):"open_new"===t&&window.open(e.url)},i=function(e){if(t.activeModule&&t.activeModule.id===e.id)return!0;for(var r=0;r{const e=xr.call(t);return Er[e]||(Er[e]=e.slice(8,-1).toLowerCase())});var Er;const Cr=t=>(t=t.toLowerCase(),e=>kr(e)===t),Rr=t=>e=>typeof e===t,{isArray:Tr}=Array,Nr=Rr("undefined");const Lr=Cr("ArrayBuffer");const Dr=Rr("string"),Ir=Rr("function"),Ar=Rr("number"),Fr=t=>null!==t&&"object"==typeof t,Br=t=>{if("object"!==kr(t))return!1;const e=Pr(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},Ur=Cr("Date"),Mr=Cr("File"),zr=Cr("Blob"),Gr=Cr("FileList"),Vr=Cr("URLSearchParams");function qr(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),Tr(t))for(n=0,o=t.length;n0;)if(n=r[o],e===n.toLowerCase())return n;return null}const Yr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,$r=t=>!Nr(t)&&t!==Yr;const Hr=(Kr="undefined"!=typeof Uint8Array&&Pr(Uint8Array),t=>Kr&&t instanceof Kr);var Kr;const Zr=Cr("HTMLFormElement"),Jr=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Qr=Cr("RegExp"),Xr=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};qr(r,((r,o)=>{!1!==e(r,o,t)&&(n[o]=r)})),Object.defineProperties(t,n)},tn="abcdefghijklmnopqrstuvwxyz",en="0123456789",rn={DIGIT:en,ALPHA:tn,ALPHA_DIGIT:tn+tn.toUpperCase()+en};const nn={isArray:Tr,isArrayBuffer:Lr,isBuffer:function(t){return null!==t&&!Nr(t)&&null!==t.constructor&&!Nr(t.constructor)&&Ir(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||xr.call(t)===e||Ir(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&Lr(t.buffer),e},isString:Dr,isNumber:Ar,isBoolean:t=>!0===t||!1===t,isObject:Fr,isPlainObject:Br,isUndefined:Nr,isDate:Ur,isFile:Mr,isBlob:zr,isRegExp:Qr,isFunction:Ir,isStream:t=>Fr(t)&&Ir(t.pipe),isURLSearchParams:Vr,isTypedArray:Hr,isFileList:Gr,forEach:qr,merge:function t(){const{caseless:e}=$r(this)&&this||{},r={},n=(n,o)=>{const i=e&&Wr(r,o)||o;Br(r[i])&&Br(n)?r[i]=t(r[i],n):Br(n)?r[i]=t({},n):Tr(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t(qr(e,((e,n)=>{r&&Ir(e)?t[n]=Sr(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,a;const c={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],n&&!n(a,t,e)||c[a]||(e[a]=t[a],c[a]=!0);t=!1!==r&&Pr(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:kr,kindOfTest:Cr,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(Tr(t))return t;let e=t.length;if(!Ar(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:Zr,hasOwnProperty:Jr,hasOwnProp:Jr,reduceDescriptors:Xr,freezeMethods:t=>{Xr(t,((e,r)=>{if(Ir(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];Ir(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return Tr(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:Wr,global:Yr,isContextDefined:$r,ALPHABET:rn,generateString:(t=16,e=rn.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&Ir(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(Fr(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=Tr(t)?[]:{};return qr(t,((t,e)=>{const i=r(t,n+1);!Nr(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)}};function on(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}nn.inherits(on,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:nn.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const an=on.prototype,cn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{cn[t]={value:t}})),Object.defineProperties(on,cn),Object.defineProperty(an,"isAxiosError",{value:!0}),on.from=(t,e,r,n,o,i)=>{const a=Object.create(an);return nn.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),on.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const un=on,sn=null;var ln=r(764).lW;function fn(t){return nn.isPlainObject(t)||nn.isArray(t)}function pn(t){return nn.endsWith(t,"[]")?t.slice(0,-2):t}function dn(t,e,r){return t?t.concat(e).map((function(t,e){return t=pn(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const yn=nn.toFlatObject(nn,{},null,(function(t){return/^is[A-Z]/.test(t)}));const hn=function(t,e,r){if(!nn.isObject(t))throw new TypeError("target must be an object");e=e||new(sn||FormData);const n=(r=nn.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!nn.isUndefined(e[t])}))).metaTokens,o=r.visitor||s,i=r.dots,a=r.indexes,c=(r.Blob||"undefined"!=typeof Blob&&Blob)&&nn.isSpecCompliantForm(e);if(!nn.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(nn.isDate(t))return t.toISOString();if(!c&&nn.isBlob(t))throw new un("Blob is not supported. Use a Buffer instead.");return nn.isArrayBuffer(t)||nn.isTypedArray(t)?c&&"function"==typeof Blob?new Blob([t]):ln.from(t):t}function s(t,r,o){let c=t;if(t&&!o&&"object"==typeof t)if(nn.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(nn.isArray(t)&&function(t){return nn.isArray(t)&&!t.some(fn)}(t)||(nn.isFileList(t)||nn.endsWith(r,"[]"))&&(c=nn.toArray(t)))return r=pn(r),c.forEach((function(t,n){!nn.isUndefined(t)&&null!==t&&e.append(!0===a?dn([r],n,i):null===a?r:r+"[]",u(t))})),!1;return!!fn(t)||(e.append(dn(o,r,i),u(t)),!1)}const l=[],f=Object.assign(yn,{defaultVisitor:s,convertValue:u,isVisitable:fn});if(!nn.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!nn.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),nn.forEach(r,(function(r,i){!0===(!(nn.isUndefined(r)||null===r)&&o.call(e,r,nn.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function mn(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function bn(t,e){this._pairs=[],t&&hn(t,this,e)}const vn=bn.prototype;vn.append=function(t,e){this._pairs.push([t,e])},vn.toString=function(t){const e=t?function(e){return t.call(this,e,mn)}:mn;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const gn=bn;function wn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function jn(t,e,r){if(!e)return t;const n=r&&r.encode||wn,o=r&&r.serialize;let i;if(i=o?o(e,r):nn.isURLSearchParams(e)?e.toString():new gn(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const On=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){nn.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},_n={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Sn="undefined"!=typeof URLSearchParams?URLSearchParams:gn,xn=FormData,Pn=(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),kn="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,En={isBrowser:!0,classes:{URLSearchParams:Sn,FormData:xn,Blob},isStandardBrowserEnv:Pn,isStandardBrowserWebWorkerEnv:kn,protocols:["http","https","file","blob","url","data"]};const Cn=function(t){function e(t,r,n,o){let i=t[o++];const a=Number.isFinite(+i),c=o>=t.length;if(i=!i&&nn.isArray(n)?n.length:i,c)return nn.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a;n[i]&&nn.isObject(n[i])||(n[i]=[]);return e(t,r,n[i],o)&&nn.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n{e(function(t){return nn.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},Rn={"Content-Type":void 0};const Tn={transitional:_n,adapter:["xhr","http"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=nn.isObject(t);o&&nn.isHTMLForm(t)&&(t=new FormData(t));if(nn.isFormData(t))return n&&n?JSON.stringify(Cn(t)):t;if(nn.isArrayBuffer(t)||nn.isBuffer(t)||nn.isStream(t)||nn.isFile(t)||nn.isBlob(t))return t;if(nn.isArrayBufferView(t))return t.buffer;if(nn.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return hn(t,new En.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return En.isNode&&nn.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=nn.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return hn(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(nn.isString(t))try{return(e||JSON.parse)(t),nn.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Tn.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(t&&nn.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw un.from(t,un.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:En.classes.FormData,Blob:En.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};nn.forEach(["delete","get","head"],(function(t){Tn.headers[t]={}})),nn.forEach(["post","put","patch"],(function(t){Tn.headers[t]=nn.merge(Rn)}));const Nn=Tn,Ln=nn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Dn=Symbol("internals");function In(t){return t&&String(t).trim().toLowerCase()}function An(t){return!1===t||null==t?t:nn.isArray(t)?t.map(An):String(t)}function Fn(t,e,r,n){return nn.isFunction(n)?n.call(this,e,r):nn.isString(e)?nn.isString(n)?-1!==e.indexOf(n):nn.isRegExp(n)?n.test(e):void 0:void 0}class Bn{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=In(e);if(!o)throw new Error("header name must be a non-empty string");const i=nn.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=An(t))}const i=(t,e)=>nn.forEach(t,((t,r)=>o(t,r,e)));return nn.isPlainObject(t)||t instanceof this.constructor?i(t,e):nn.isString(t)&&(t=t.trim())&&!function(t){return/^[-_a-zA-Z]+$/.test(t.trim())}(t)?i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&Ln[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e):null!=t&&o(e,t,r),this}get(t,e){if(t=In(t)){const r=nn.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(nn.isFunction(e))return e.call(this,t,r);if(nn.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=In(t)){const r=nn.findKey(this,t);return!(!r||void 0===this[r]||e&&!Fn(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=In(t)){const o=nn.findKey(r,t);!o||e&&!Fn(0,r[o],o,e)||(delete r[o],n=!0)}}return nn.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!Fn(0,this[o],o,t)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return nn.forEach(this,((n,o)=>{const i=nn.findKey(r,o);if(i)return e[i]=An(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete e[o],e[a]=An(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return nn.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&nn.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[Dn]=this[Dn]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=In(t);e[n]||(!function(t,e){const r=nn.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return nn.isArray(t)?t.forEach(n):n(t),this}}Bn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),nn.freezeMethods(Bn.prototype),nn.freezeMethods(Bn);const Un=Bn;function Mn(t,e){const r=this||Nn,n=e||r,o=Un.from(n.headers);let i=n.data;return nn.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function zn(t){return!(!t||!t.__CANCEL__)}function Gn(t,e,r){un.call(this,null==t?"canceled":t,un.ERR_CANCELED,e,r),this.name="CanceledError"}nn.inherits(Gn,un,{__CANCEL__:!0});const Vn=Gn;const qn=En.isStandardBrowserEnv?{write:function(t,e,r,n,o,i){const a=[];a.push(t+"="+encodeURIComponent(e)),nn.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),nn.isString(n)&&a.push("path="+n),nn.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Wn(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Yn=En.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=nn.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0};const $n=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(c){const u=Date.now(),s=n[a];o||(o=u),r[i]=c,n[i]=u;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),u-o{const i=o.loaded,a=o.lengthComputable?o.total:void 0,c=i-r,u=n(c);r=i;const s={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:o};s[e?"download":"upload"]=!0,t(s)}}const Kn="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){let n=t.data;const o=Un.from(t.headers).normalize(),i=t.responseType;let a;function c(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}nn.isFormData(n)&&(En.isStandardBrowserEnv||En.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let u=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",r=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+r))}const s=Wn(t.baseURL,t.url);function l(){if(!u)return;const n=Un.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new un("Request failed with status code "+r.status,[un.ERR_BAD_REQUEST,un.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}((function(t){e(t),c()}),(function(t){r(t),c()}),{data:i&&"text"!==i&&"json"!==i?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u}),u=null}if(u.open(t.method.toUpperCase(),jn(s,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(new un("Request aborted",un.ECONNABORTED,t,u)),u=null)},u.onerror=function(){r(new un("Network Error",un.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const n=t.transitional||_n;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(new un(e,n.clarifyTimeoutError?un.ETIMEDOUT:un.ECONNABORTED,t,u)),u=null},En.isStandardBrowserEnv){const e=(t.withCredentials||Yn(s))&&t.xsrfCookieName&&qn.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===n&&o.setContentType(null),"setRequestHeader"in u&&nn.forEach(o.toJSON(),(function(t,e){u.setRequestHeader(e,t)})),nn.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),i&&"json"!==i&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",Hn(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",Hn(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{u&&(r(!e||e.type?new Vn(null,t,u):e),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const f=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(s);f&&-1===En.protocols.indexOf(f)?r(new un("Unsupported protocol "+f+":",un.ERR_BAD_REQUEST,t)):u.send(n||null)}))},Zn={http:sn,xhr:Kn};nn.forEach(Zn,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Jn={getAdapter:t=>{t=nn.isArray(t)?t:[t];const{length:e}=t;let r,n;for(let o=0;ot instanceof Un?t.toJSON():t;function eo(t,e){e=e||{};const r={};function n(t,e,r){return nn.isPlainObject(t)&&nn.isPlainObject(e)?nn.merge.call({caseless:r},t,e):nn.isPlainObject(e)?nn.merge({},e):nn.isArray(e)?e.slice():e}function o(t,e,r){return nn.isUndefined(e)?nn.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!nn.isUndefined(e))return n(void 0,e)}function a(t,e){return nn.isUndefined(e)?nn.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function c(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(t,e)=>o(to(t),to(e),!0)};return nn.forEach(Object.keys(t).concat(Object.keys(e)),(function(n){const i=u[n]||o,a=i(t[n],e[n],n);nn.isUndefined(a)&&i!==c||(r[n]=a)})),r}const ro="1.3.2",no={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{no[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const oo={};no.transitional=function(t,e,r){function n(t,e){return"[Axios v"+ro+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new un(n(o," has been removed"+(e?" in "+e:"")),un.ERR_DEPRECATED);return e&&!oo[o]&&(oo[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}};const io={assertOptions:function(t,e,r){if("object"!=typeof t)throw new un("options must be an object",un.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],a=e[i];if(a){const e=t[i],r=void 0===e||a(e,i,t);if(!0!==r)throw new un("option "+i+" must be "+r,un.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new un("Unknown option "+i,un.ERR_BAD_OPTION)}},validators:no},ao=io.validators;class co{constructor(t){this.defaults=t,this.interceptors={request:new On,response:new On}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=eo(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;let i;void 0!==r&&io.assertOptions(r,{silentJSONParsing:ao.transitional(ao.boolean),forcedJSONParsing:ao.transitional(ao.boolean),clarifyTimeoutError:ao.transitional(ao.boolean)},!1),void 0!==n&&io.assertOptions(n,{encode:ao.function,serialize:ao.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),i=o&&nn.merge(o.common,o[e.method]),i&&nn.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Un.concat(i,o);const a=[];let c=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(c=c&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const u=[];let s;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let l,f=0;if(!c){const t=[Xn.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,u),l=t.length,s=Promise.resolve(e);f{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new Vn(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new so((function(e){t=e})),cancel:t}}}const lo=so;const fo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(fo).forEach((([t,e])=>{fo[e]=t}));const po=fo;const yo=function t(e){const r=new uo(e),n=Sr(uo.prototype.request,r);return nn.extend(n,uo.prototype,r,{allOwnKeys:!0}),nn.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(eo(e,r))},n}(Nn);yo.Axios=uo,yo.CanceledError=Vn,yo.CancelToken=lo,yo.isCancel=zn,yo.VERSION=ro,yo.toFormData=hn,yo.AxiosError=un,yo.Cancel=yo.CanceledError,yo.all=function(t){return Promise.all(t)},yo.spread=function(t){return function(e){return t.apply(null,e)}},yo.isAxiosError=function(t){return nn.isObject(t)&&!0===t.isAxiosError},yo.mergeConfig=eo,yo.AxiosHeaders=Un,yo.formToJSON=t=>Cn(nn.isHTMLForm(t)?new FormData(t):t),yo.HttpStatusCode=po,yo.default=yo;const ho=yo;function mo(t){return mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mo(t)}function bo(){bo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new x(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function d(){}function y(){}var h={};u(h,i,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(P([])));b&&b!==e&&r.call(b,i)&&(h=b);var v=y.prototype=p.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==mo(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function vo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function go(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n={file:t};return e&&(n.directory=e),_o.post("cmf/api/media/upload",ae.formData(n),{onUploadProgress:r})},So.media.uploadChunk=function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i={status:t,filename:e,chunk:n};return r&&(i.path=r),o&&(i.directory=o),_o.post("cmf/api/media/upload-chunk",ae.formData(i))},So.media.path=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e={};return t&&(e.directory=t),_o.get("cmf/api/media/path",{params:e})},So.media.loadDirectories=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e={};return t&&(e.directory=t),_o.get("cmf/api/media/load-directories",{params:e})},So.media.loadFiles=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e={};return t&&(e.directory=t),_o.get("cmf/api/media/load-files",{params:e})},So.media.createDirectory=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r={name:t};return e&&(r.directory=e),_o.post("cmf/api/media/create-directory",r)},So.media.renameDirectory=function(t,e){return _o.post("cmf/api/media/rename-directory",{name:t,directory:e})},So.media.deleteDirectory=function(t){return _o.post("cmf/api/media/delete-directory",{directory:t})},So.media.moveDirectory=function(t,e){return _o.post("cmf/api/media/move-directory",{directory:t,id:e})},So.media.renameFile=function(t,e){return _o.post("cmf/api/media/rename-file",{name:t,file:e})},So.media.deleteFile=function(t){return _o.post("cmf/api/media/delete-file",{file:t})},So.media.deleteFiles=function(t){return _o.post("cmf/api/media/delete-files",{files:JSON.stringify(t)})},So.media.labelFile=function(t,e){return _o.post("cmf/api/media/label-file",{label:t,file:e})},So.media.updateFileDescription=function(t,e){return _o.post("cmf/api/media/update-file-description",{description:t,file:e})},So.media.updateFileCopyright=function(t,e){return _o.post("cmf/api/media/update-file-copyright",{copyright:t,file:e})},So.media.updateFileVisibility=function(t,e){return _o.post("cmf/api/media/update-file-visibility",{visibility:t,file:e})},So.media.updateFilesDescription=function(t,e){return _o.post("cmf/api/media/update-files-description",{description:t,files:JSON.stringify(e)})},So.media.updateFilesCopyright=function(t,e){return _o.post("cmf/api/media/update-files-copyright",{copyright:t,files:JSON.stringify(e)})},So.media.moveFile=function(t,e){return _o.post("cmf/api/media/move-file",{directory:t,file:e})},So.media.moveFiles=function(t,e){return _o.post("cmf/api/media/move-files",{directory:t,files:JSON.stringify(e)})},So.modules.index=function(){return _o.get("cmf/api/modules")},So.modules.action=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _o.get("cmf/api/modules/".concat(t.module,"/").concat(t.action),{params:e})},So.modules.get=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return _o.get("cmf/api/modules/".concat(t.module,"/").concat(t.action,"/").concat(e),{params:r})},So.modules.post=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return _o.post("cmf/api/modules/".concat(t.module,"/").concat(t.action,"/").concat(e),ae.formData(r))},So.execute.get=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return _o.get("cmf/api/modules/".concat(t.module,"/").concat(t.action,"/").concat(e,"/").concat(r),{params:n})},So.execute.post=function(t,e,r,n){return _o.post("cmf/api/modules/".concat(t.module,"/").concat(t.action,"/").concat(e,"/").concat(r),ae.formData(n))};const xo=So;function Po(t){return Po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Po(t)}function ko(t,e){for(var r=0;r1&&void 0!==arguments[1])||arguments[1])&&(Ci.set(t),Ei.trigger("language.switch",{id:this.props.id,prevLanguage:this.state.language,language:t})),this.setState({language:t})}},{key:"renderLanguageSwitcher",value:function(){var t=this;return this.props.languages.map((function(e){return(0,St.jsx)("button",{type:"button",onClick:function(r){return t.switchLanguage(e)},className:"translatable__button"+(e===t.state.language?" translatable__button--active":""),children:e},e)}))}},{key:"render",value:function(){return(0,St.jsxs)("div",{className:"translatable",id:"language-"+this.props.id,children:[(0,St.jsx)("div",{className:"translatable__tabs",children:this.renderLanguageSwitcher()}),this.renderTranslatedComponents()]})}}],r&&Li(e.prototype,r),n&&Li(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(n.Component);Fi(Ui,"defaultProps",{id:null,components:[],path:{},data:{},languages:[],errors:{}});const Mi=Ui;function zi(t){return zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zi(t)}function Gi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Vi(t){for(var e=1;e5&&(t=(0,St.jsx)("div",{className:"select__search",children:(0,St.jsx)(ua,{debounce:100,onSearch:function(t){return e.search(t)}})})),(0,St.jsxs)("div",{className:"select__dropdown",children:[t,(0,St.jsx)("div",{className:"select__list",children:(0,St.jsx)(Ji,{nullable:this.props.nullable,multiple:this.props.multiple,defaultValues:this.props.multiple?this.state.value:[this.state.value],options:this.state.isSearching?this.state.searchResults:this.props.options,onChange:function(t){return e.handleSelectionChange(t)}})}),this.renderDropdownChildren()]})):null}},{key:"render",value:function(){var t,e=this;return t=this.props.multiple?this.state.value.length?this.state.value.map((function(t){return e.props.options[t]})).join(", "):this.props.nullText:this.props.options[this.state.value]?this.props.options[this.state.value]:this.props.nullText,(0,St.jsxs)("div",{className:"select",ref:this.selectRef,children:[(0,St.jsxs)("div",{className:"select__field",onClick:this.toggle.bind(this),children:[(0,St.jsx)("div",{className:"select__value",children:t}),(0,St.jsx)("div",{className:"select__icon",children:(0,St.jsx)(ee,{name:this.state.isOpen?this.props.closeIcon:this.props.openIcon})})]}),this.renderDropdown()]})}}],r&&fa(e.prototype,r),o&&fa(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=ma(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(ba,"defaultProps",{options:{},multiple:!1,value:"",search:!0,nullable:!1,nullText:"",onChange:function(t){},openIcon:"expand_more",closeIcon:"expand_less"});const va=ba;function ga(t){return ga="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ga(t)}function wa(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;xo.execute.get(this.props.path,this.props.id,"load",this.props.path.params).then((function(r){var n=r.data.data,o={};n.forEach((function(e){return o[e.id]=e[t.props.titleColumn]}));var i=n.length?n[0].id:"",a=t.state.value?t.state.value:t.props.nullable?"":i;t.setState({value:a,options:o},(function(){e&&e()}))}))}},{key:"handleChange",value:function(t){this.setState({value:t})}},{key:"open",value:function(){this.setState({isOpen:!0})}},{key:"close",value:function(){this.setState({isOpen:!1})}},{key:"create",value:function(t){var e=this;xo.execute.post(this.props.path,this.props.id,"create",t).then((function(t){e.createFormRef.current.ready(),e.load((function(){e.setState({isOpen:!1,value:t.data.data.id})})),vt.notify(mt.get("snippets.singular_created_selected",{singular:e.props.singular}))}),(function(t){var r=t.response;e.createFormRef.current.ready(),e.setState({createFormErrors:r.data.errors}),vt.notify(r.data.message)}))}},{key:"renderSidebarComponents",value:function(){return iv.renderComponents(this.props.sidebarComponents,{},this.props.path)}},{key:"renderCreateComponents",value:function(){return iv.renderComponents(this.props.createComponents,{},this.props.path)}},{key:"renderCreateWidget",value:function(){return this.state.isOpen?(0,St.jsx)(No,{children:(0,St.jsx)(Ho,{title:mt.get("snippets.new_singular",{singular:this.props.singular}),style:"modal",closeable:!0,onClose:this.close.bind(this),children:(0,St.jsx)(ii,{ref:this.createFormRef,errors:this.state.createFormErrors,realForm:!1,onSubmit:this.create.bind(this),submitButtonText:mt.get("snippets.create_singular",{singular:this.props.singular}),sidebar:this.renderSidebarComponents(),children:this.renderCreateComponents()})})}):null}},{key:"renderCreate",value:function(){return this.props.create?(0,St.jsx)("div",{className:"belongs-to-field__btn",children:(0,St.jsx)(ar,{icon:"add",style:["full","small","secondary"],text:mt.get("snippets.new_singular",{singular:this.props.singular}),onClick:this.open.bind(this)})}):null}},{key:"render",value:function(){var t=this;return(0,St.jsxs)(Ee,{name:this.props.name,label:this.props.label,tooltip:this.props.tooltip,children:[(0,St.jsx)("div",{className:"belongs-to-field",children:(0,St.jsx)("div",{className:"belongs-to-field__field",children:(0,St.jsx)(va,{nullable:this.props.nullable,nullText:"– "+mt.get("snippets.no_singular_selected",{singular:this.props.singular})+" –",options:this.state.options,value:this.state.value,onChange:function(e){return t.handleChange(e)},children:this.renderCreate()})})}),this.renderCreateWidget()]})}}],r&&Hu(e.prototype,r),o&&Hu(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=Qu(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Xu,"defaultProps",{data:{},label:"",name:"",titleColumn:"",nullable:!1,plural:"",singular:"",tooltip:"",create:!1,createComponents:[],sidebarComponents:[]});const ts=Xu;function es(t){return es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},es(t)}function rs(t,e){for(var r=0;rA2');var n=e.querySelector(".trix-button-group--block-tools");n&&n.remove();var o=e.querySelector(".trix-button-group--file-tools");o&&o.remove()}},{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){}},{key:"componentDidUpdate",value:function(t){this.props.data[this.props.name]!==t.data[this.props.name]&&this.setState({redrawKey:this.state.redrawKey+1,value:this.props.data[this.props.name]||""})}},{key:"handleChange",value:function(t,e){this.setState({value:t})}},{key:"handleSubmit",value:function(t){t[this.props.name]=this.state.value||""}},{key:"getData",value:function(t){return t[this.props.name]=this.state.value||"",t}},{key:"render",value:function(){return(0,St.jsx)(Ee,{name:this.props.name,label:this.props.label,tooltip:this.props.tooltip,children:(0,St.jsx)("div",{className:"richtext-field",children:(0,St.jsx)(fs.TrixEditor,{value:this.props.data[this.props.name]||"",onChange:this.handleChange.bind(this),onEditorReady:this.handleEditorReady.bind(this)},this.state.redrawKey)})})}}])&&ys(e.prototype,r),n&&ys(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(n.Component);function ws(t){return ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ws(t)}function js(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rr?"left":"right",t.clientY>e?"up":"down")}}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"right",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"down";this.setState({isOpen:!0,dropDirectionX:e,dropDirectionY:r},(function(){t.bindDocumentClick()}))}},{key:"close",value:function(){var t=this;this.setState({isOpen:!1},(function(){t.unbindDocumentClick()}))}},{key:"onContentClick",value:function(t){t.target.classList.contains("dropdown__content")||this.close()}},{key:"render",value:function(){var t=(0,St.jsx)(ar,{stopPropagation:this.props.stopPropagation,text:this.props.text,label:this.props.label,style:[].concat(cl(this.props.style),["small"]),onClick:this.toggle.bind(this),icon:this.state.isOpen?this.props.closeIcon:this.props.openIcon});return this.props.text||(t=(0,St.jsx)(Mo,{stopPropagation:this.props.stopPropagation,name:this.state.isOpen?this.props.closeIcon:this.props.openIcon,iconStyle:"small",onClick:this.toggle.bind(this)})),(0,St.jsxs)("div",{className:_t.className("dropdown",this.props.style)+(this.state.isOpen?" dropdown--open":"")+" dropdown--"+this.state.dropDirectionX+" dropdown--"+this.state.dropDirectionY,ref:this.dropdownRef,children:[(0,St.jsx)("div",{className:"dropdown__trigger",children:t}),(0,St.jsx)("div",{className:"dropdown__content",onClick:this.onContentClick.bind(this),children:this.props.children})]})}}],r&&sl(e.prototype,r),o&&sl(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=yl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(hl,"defaultProps",{label:"",text:"",style:[],autoClose:!1,openIcon:"expand_more",closeIcon:"expand_less",stopPropagation:!0});const ml=hl;function bl(t){return function(t){if(Array.isArray(t))return vl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return vl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vl(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ul(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Ml(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ul(i,n,o,a,c,"next",t)}function c(t){Ul(i,n,o,a,c,"throw",t)}a(void 0)}))}}function zl(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;this.props.onDirectoryClick(t)}},{key:"load",value:(i=Ml(Bl().mark((function t(){var e=this;return Bl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,xo.media.loadDirectories(this.props.directory).then((function(t){e.setState({directories:t.data.data})}));case 2:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"loadChildren",value:(o=Ml(Bl().mark((function t(e){var r=this;return Bl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,xo.media.loadDirectories(e).then((function(t){var n=r.state.directoriesMap;n[e]=t.data.data,r.setState({directoriesMap:n})}));case 2:case"end":return t.stop()}}),t)}))),function(t){return o.apply(this,arguments)})},{key:"toggleCollapse",value:function(t){if(this.state.directoriesMap[t]){var e=this.state.directoriesMap;delete e[t],this.setState({directoriesMap:e})}else this.loadChildren(t)}},{key:"renderChildren",value:function(t){var e=this;return this.state.directoriesMap[t]?this.state.directoriesMap[t].map((function(t){return e.renderDirectory(t)})):null}},{key:"renderDirectory",value:function(t){var e=this;return(0,St.jsxs)("div",{className:"directory-tree__item",children:[(0,St.jsx)(Al,{icon:"folder",text:t.name,style:this.props.selectedDirectory===t.id?"selected":"default",onToggle:function(){return e.toggleCollapse(t.id)},onClick:function(){return e.select(t.id)}}),(0,St.jsx)("div",{className:"directory-tree__children",children:this.renderChildren(t.id)})]},t.id)}},{key:"render",value:function(){var t=this;return this.state.directories.length?(0,St.jsxs)("div",{className:"directory-tree",children:[(0,St.jsx)(Al,{icon:"home",text:mt.get("snippets.files_root"),style:null===this.props.selectedDirectory?"selected":"default",collapsible:!1,onClick:function(){return t.select()}}),this.state.directories.map((function(e){return t.renderDirectory(e)}))]}):null}}],r&&zl(e.prototype,r),n&&zl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),c}(n.Component);!function(t,e,r){(e=Wl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Yl,"defaultProps",{directory:null,selectedDirectory:null,onDirectoryClick:function(t){}});const $l=Yl;function Hl(t){return Hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hl(t)}function Kl(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r186?"#000000":"#ffffff"};function Of(t){return Of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Of(t)}function _f(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(e=[[mt.get("snippets.move_files",{amount:this.props.selectedFileIds.length}),"multi-move"],[mt.get("snippets.delete_files",{amount:this.props.selectedFileIds.length}),"multi-delete"]]),(0,St.jsx)(Lf,{files:this.state.files,fileLabels:this.props.fileLabels,selection:this.props.selectedFileIds,selectionMode:this.props.selectionMode,contextMenuLinks:e,onClick:function(e,r){return t.handleFileClick(e,r)},onContextClick:function(e,r){return t.onFileContextClick(e,r)}})}},{key:"renderDirectories",value:function(){var t=this;return this.props.directories.length?(0,St.jsx)(St.Fragment,{children:(0,St.jsx)(Ff,{directories:this.props.directories,contextMenuLinks:[[mt.get("snippets.rename"),"rename"],[mt.get("snippets.move"),"move"],[mt.get("snippets.delete"),"delete"]],onContextClick:function(e,r){return t.onDirectoryContextClick(e,r)},onClick:function(e,r){return t.props.onDirectoryClick(r.id)}})}):null}},{key:"renderContent",value:function(){return this.state.uploads.length||this.props.directories.length||this.state.files.length?(0,St.jsxs)("div",{className:"file-browser__content",children:[this.renderUploads(),this.renderDirectories(),this.renderFiles()]}):(0,St.jsx)("div",{className:"file-browser__content",children:(0,St.jsx)("div",{className:"file-browser__placeholder",children:(0,St.jsx)(Nu,{children:mt.get("snippets.directory_is_empty")})})})}},{key:"render",value:function(){return(0,St.jsxs)("div",{className:"file-browser",children:[this.renderContent(),this.renderMoveWidget()]})}}],r&&zf(e.prototype,r),n&&zf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(n.Component);!function(t,e,r){(e=Yf(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}($f,"defaultProps",{files:[],directories:[],currentDirectory:null,fileLabels:{},selectionMode:!1,selectedFileIds:[],selectedFiles:[],onDirectoryClick:function(t){},onFileClick:function(t){},onDirectoryDelete:function(t){},onDirectoryRename:function(t,e){},onDirectoryMove:function(t,e){},onFileDelete:function(t){},onFileRename:function(t){},onFileMove:function(t,e){},onFileOpen:function(t){},onSelectionChange:function(t,e){},onSelectionDelete:function(t,e){},onSelectionMove:function(t,e){}});const Hf=$f;var Kf=r(195),Zf={insert:"head",singleton:!1};wt()(Kf.Z,Zf);Kf.Z.locals;function Jf(t){return Jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(t)}function Qf(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:function(){},n=[],o=0;o2&&void 0!==arguments[2]?arguments[2]:function(){};up++,cp.push([up,t,e,r]),Ei.trigger("media.upload.queued",{id:up,size:t.size,filename:t.name}),ap||this.process()},process:function(){var t=this;if(cp.length){ap=!0;var e=cp[0];this.processChunkUpload(e[1],e[2],(function(t){Ei.trigger("media.upload.start",{id:e[0],size:e[1].size,filename:t})}),(function(t){Ei.trigger("media.upload.progress",{id:e[0],progress:t})}),(function(r){ap=!1,cp.shift(),t.process(),Ei.trigger("media.upload.success",{id:e[0],file:r}),e[3](r)}),(function(){Ei.trigger("media.upload.fail",{id:e[0]}),ap=!1,cp.shift(),t.process()}))}},isDone:function(){return 0===cp.length},processChunkUpload:function(t,e,r,n,o,i){var a,c,u,s=524288,l=Math.ceil(t.size/s),f=0,p=t.name;!function d(){(c=f*s)>t.size&&(c=u+1),u=c+s>=t.size?t.size:c+s;var y=0===f?"start":f===l?"end":"progress";"start"===y&&r(p),xo.media.uploadChunk(y,p,a||null,t.slice(c,u),e).then((function(t){var e=t.data;("created"===e.status&&(a=e.path),++f<=l)?(n(f/l*100),d()):o(e.data)}),(function(t){i()}))}()}};function lp(t){var e=function(e){sp.queueMultiple(e,t.directory,(function(e){t.onFileUploaded(e),sp.isDone()&&t.onUploadDone()}))};return(0,St.jsxs)("div",{className:"file-uploader",children:[(0,St.jsx)("div",{className:"file-uploader__input",children:(0,St.jsx)("input",{type:"file",name:"file-uploader",multiple:!0,onChange:function(t){e(t.target.files)}.bind(this)})}),(0,St.jsx)("div",{className:"file-uploader__placeholder",children:(0,St.jsx)(Nu,{children:mt.get("snippets.select_files_from_computer")})})]})}lp.defaultProps={directory:null,onUploadDone:function(){},onFileUploaded:function(t){}};const fp=lp;function pp(t){return pp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pp(t)}function dp(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;t.isFile?t.file((function(t){".DS_Store"!==t.name&&e.upload(t,r)})):t.isDirectory&&xo.media.createDirectory(t.name,r).then((function(r){var n=r.data.data;e.props.onCreateDirectory(n),t.createReader().readEntries((function(t){for(var r=0;r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function qp(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Wp(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){qp(i,n,o,a,c,"next",t)}function c(t){qp(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Yp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $p(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==n[0]?n[0]:null,t.next=3,ho.all([xo.media.path(e),xo.media.loadDirectories(e),xo.media.loadFiles(e)]).then(ho.spread((function(t,e,n){var a=t.data.data,c=e.data.data,u=n.data.data,s=a[a.length-1];i({type:"media/init",payload:{directory:s,path:a,directories:c,files:u}}),o($p($p({},r),{},{isLoading:!1}))})));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),d=function(e,n){o($p($p({},r),{},{selectedFileIds:e,selectedFiles:n})),t.onSelectionChange(e,n)},y=function(){t.onSelectionConfirm(r.selectedFileIds,r.selectedFiles)},m=function(t){var e=r.selectedFileIds.filter((function(e){return e!==t})),n=r.selectedFiles.filter((function(e){return e.id!==t}));o($p($p({},r),{},{selectedFileIds:e,selectedFiles:n}))},b=function(){t.onCancel()},v=function(t){p(t)},g=function(){vt.i18nNotify("snippets.files_uploaded")},w=function(t){!function(t){o($p($p({},r),{},{selectedFileIds:[].concat(Gp(r.selectedFileIds),[t.id]),selectedFiles:[].concat(Gp(r.selectedFiles),[t])}))}(t),i({type:"media/files/add",payload:t})},j=function(){var t=Wp(Vp().mark((function t(e){var r,n;return Vp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=13;break}return t.prev=1,t.next=4,xo.media.createDirectory(e,s?s.id:null);case 4:r=t.sent,n=r.data.data,vt.i18nNotify("snippets.directory_created"),i({type:"media/directories/add",payload:n}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}(),O=function(){var t=Wp(Vp().mark((function t(e,r){var n,o;return Vp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=13;break}return t.prev=1,t.next=4,xo.media.renameFile(e,r);case 4:n=t.sent,o=n.data.data,i({type:"media/files/rename",payload:o}),vt.i18nNotify("snippets.file_renamed"),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,r){return t.apply(this,arguments)}}(),_=function(){var t=Wp(Vp().mark((function t(e,r){var n,o;return Vp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=13;break}return t.prev=1,t.next=4,xo.media.renameDirectory(e,r);case 4:n=t.sent,o=n.data.data,i({type:"media/directories/rename",payload:o}),vt.i18nNotify("snippets.directory_renamed"),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,r){return t.apply(this,arguments)}}(),x=function(t,e){xo.media.moveFiles(t,e).then((function(t){vt.i18nNotify("snippets.files_moved"),p(s?s.id:null)}),(function(t){vt.i18nNotify("snippets.file_not_moved")}))},P=function(t,e){xo.media.moveFile(t,e).then((function(t){vt.i18nNotify("snippets.file_moved"),p(s?s.id:null)}),(function(t){vt.i18nNotify("snippets.file_not_moved")}))},k=function(){vt.prompt({title:mt.get("snippets.new_directory"),confirmButtonText:mt.get("snippets.confirm"),cancelButtonText:mt.get("snippets.cancel"),confirm:function(t){return j(t)}})},E=function(){var t=[[mt.get("snippets.deselect"),"deselect"],[mt.get("snippets.jump_to_folder"),"jump_to"]];return r.selectedFiles.length?(0,St.jsxs)("div",{className:"file-picker-widget__selection",children:[(0,St.jsxs)("div",{className:"file-picker-widget__selection-header",children:[mt.get("snippets.your_selection")," (",r.selectedFiles.length,")"]}),r.selectedFiles.map((function(e,r){return(0,St.jsx)("div",{className:"file-picker-widget__file",children:(0,St.jsx)(qt,{links:t,onClick:function(t){return function(t,e){"jump_to"===t?p(e.directory?e.directory.id:null):"deselect"===t&&m(e.id)}(t,e)},children:(0,St.jsx)(Tf,{file:e,viewMode:"minimal",actions:[(0,St.jsx)(Mo,{name:"delete",style:"transparent",onClick:function(t){return m(e.id)}},"delete")]})})},r)}))]}):(0,St.jsx)(Nu,{icon:"checklist",children:mt.get("snippets.your_selection_is_empty")})};return(0,St.jsx)(Ho,{style:["modal","wide"],closeable:!0,onClose:b,title:[(0,St.jsx)(ml,{style:["primary","small"],openIcon:"folder",closeIcon:"folder",children:(0,St.jsx)($l,{selectedDirectory:s?s.id:null,onDirectoryClick:function(t){return v(t)}})},"path"),(0,St.jsx)(np,{items:u,onClick:function(t){t?v(t.id):v()}},"breadcrumbs")],actions:[(0,St.jsx)(Mp,{},"view-switcher"),(0,St.jsx)(ar,{text:mt.get("snippets.new_directory"),style:["secondary","small"],onClick:k},"new-dir"),(0,St.jsx)(ml,{text:mt.get("snippets.upload"),style:["primary","small"],children:(0,St.jsx)(fp,{directory:s?s.id:null,onFileUploaded:w,onUploadDone:g})},"upload")],footer:[(0,St.jsx)(ar,{text:mt.get("snippets.cancel"),style:["secondary"],onClick:b},"cancel"),(0,St.jsx)(ar,{text:t.selectionMode?mt.get("snippets.confirm_selection"):mt.get("snippets.select_file"),style:r.selectedFileIds.length?[]:["disabled"],onClick:r.selectedFileIds.length?y:null},"confirm")],children:r.isLoading?null:(0,St.jsx)(vp,{sidebar:E(),children:(0,St.jsx)(Cp,{directory:s?s.id:null,onCreateDirectory:j,onUploadDone:g,children:(0,St.jsx)(Hf,{fileLabels:t.fileLabels,currentDirectory:s,selectionMode:t.selectionMode,selectedFiles:r.selectedFiles,selectedFileIds:r.selectedFileIds,directories:l,files:f,onDirectoryRename:_,onFileRename:O,onFileMove:P,onDirectoryClick:function(t){return v(t)},onSelectionChange:d,onSelectionMove:x})})})})}Qp.defaultProps={multiple:!1,onSelectionChange:function(t,e){},onSelectionConfirm:function(t,e){},onCancel:function(){},defaultDirectoryId:null,defaultSelectedFileIds:[],defaultSelectedFiles:[],selectionMode:!1,fileLabels:{}};const Xp=Qp;function td(t){return td="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},td(t)}function ed(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=this.state.addedBlocks.length-1)){var e=this.syncBlocksData(),r=t+1,n=[e[r],e[t]];e[t]=n[0],e[r]=n[1],this.setState({addedBlocks:e}),vt.notify(mt.get("snippets.order_changed"))}}},{key:"removeBlock",value:function(t,e){var r=this;vt.confirm({title:mt.get("snippets.delete_singular_title",{singular:this.props.singular}),text:mt.get("snippets.delete_singular_text",{singular:this.props.singular}),confirm:function(){var n=r.state.blocksToRemoveById,o=r.state.blocksToRemoveByOrder,i=r.syncBlocksData();i.splice(t,1),e?n.push(e):o.push(t),r.setState({addedBlocks:i,blocksToRemoveById:n,blocksToRemoveByOrder:o}),vt.notify(mt.get("snippets.singular_deleted",{singular:r.props.singular}))}})}},{key:"addBlock",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getBlockDefinition(t),n=this.state.addedBlocks,o={id:null,name:r.name,type:r.type,components:r.components,data:{}};null!==e?(n.splice(e,0,o),vt.notify(mt.get("snippets.singular_inserted",{singular:this.props.singular}))):(n.push(o),vt.notify(mt.get("snippets.singular_added",{singular:this.props.singular}))),this.setState({addedBlocks:n})}},{key:"renderAddBlockDropdown",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Object.getOwnPropertyNames(this.props.blocks);return n.length?1===n.length?t?(0,St.jsx)(ar,{icon:"add",style:["small","secondary"],text:t,stopPropagation:!1,onClick:function(t){return e.addBlock(n[0],r)}}):(0,St.jsx)(Mo,{name:"post_add",iconStyle:"small",stopPropagation:!1,onClick:function(t){return e.addBlock(n[0],r)}}):(0,St.jsx)(ml,{style:["secondary"],autoClose:!0,text:t,openIcon:"post_add",closeIcon:"post_add",children:(0,St.jsx)(It,{stopPropagation:!1,links:this.getTypeLinks(),onClick:function(t){return e.addBlock(t,r)}})},r):null}},{key:"optionDropdownClick",value:function(t,e,r){"delete"===t&&this.removeBlock(e,r)}},{key:"getTypeLinks",value:function(){var t=this;return Object.getOwnPropertyNames(this.props.blocks).map((function(e){return[t.props.blocks[e].name,e]}))}},{key:"getTypeLinksInsertBelow",value:function(){var t=this;return Object.getOwnPropertyNames(this.props.blocks).map((function(e){return[mt.get("snippets.insert_singular_below",{singular:t.props.blocks[e].name}),e]}))}},{key:"renderContentBlocks",value:function(){var t=this;return this.componentLists=[],this.state.addedBlocks.length?this.state.addedBlocks.map((function(e,r){if(!e)return null;var n=iv.renderComponentsWith(e.components,e.data,t.props.path,(function(t,e){return(0,St.jsx)("div",{className:"content-blocks__component",children:t},e)}),!0);return t.componentLists.push([n,e.id,e.type]),(0,St.jsx)("div",{className:"content-blocks__item",children:(0,St.jsx)(Sd,{title:e.name,actions:[(0,St.jsx)(Mo,{style:["transparent",r>0?"enabled":"disabled"],iconStyle:"mini",name:"arrow_upward",onClick:function(e){return t.sortUp(r)}},0),(0,St.jsx)(Mo,{style:["transparent",rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Yd(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function $d(t,e){for(var r=0;re?1:e>t?-1:0})),e.setState({tags:r,isLoading:!1})}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"onCancel",value:function(){this.props.onCancel()}},{key:"onConfirm",value:function(){this.props.onConfirm(this.state.selectedTags)}},{key:"onTagClick",value:function(t){this.setState({selectedTags:[].concat(Vd(this.state.selectedTags),[t])})}},{key:"onSelectedTagClick",value:function(t){var e=this.state.selectedTags.filter((function(e){return e!==t}));this.setState({selectedTags:e})}},{key:"renderContent",value:function(){return this.state.isLoading?null:this.state.tags.length?(this.state.selectedTags.length&&(t=(0,St.jsxs)("div",{className:"tags-browser__selected",children:[(0,St.jsx)("div",{className:"tags-browser__title",children:mt.get("snippets.selected_tags")}),(0,St.jsx)(zd,{tags:this.state.selectedTags,onClick:this.onSelectedTagClick.bind(this)})]})),this.state.tags.length&&(e=(0,St.jsxs)("div",{className:"tags-browser__available",children:[(0,St.jsx)("div",{className:"tags-browser__title",children:mt.get("snippets.available_tags")}),(0,St.jsx)(zd,{tags:this.state.tags,onClick:this.onTagClick.bind(this)})]})),(0,St.jsxs)("div",{className:"tags-browser__tags",children:[t,e]})):(0,St.jsx)(Nu,{children:mt.get("snippets.no_tags_available")});var t,e}},{key:"render",value:function(){return(0,St.jsx)(Ho,{style:"modal",title:mt.get("snippets.tags"),closeable:!0,onClose:this.onCancel.bind(this),footer:[(0,St.jsx)(ar,{text:mt.get("snippets.cancel"),style:["secondary"],onClick:this.onCancel.bind(this)},0),(0,St.jsx)(ar,{text:mt.get("snippets.confirm"),onClick:this.onConfirm.bind(this)},1)],children:(0,St.jsx)("div",{className:"tags-browser",children:(0,St.jsx)("div",{className:"tags-browser__content",children:this.renderContent()})})})}}],r&&$d(e.prototype,r),n&&$d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=Jd(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Qd,"defaultProps",{id:0,path:{},selectedTags:[],onCancel:function(){},onConfirm:function(t){}});const Xd=Qd;function ty(t){return ty="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ty(t)}function ey(t){return function(t){if(Array.isArray(t))return ry(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ry(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ry(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ry(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:function(){};clearTimeout(this.searchTimeout),t&&this.setState({autosuggestIsOpen:!1,tags:[].concat(ey(this.state.tags),[t])},e)}},{key:"removeLastTag",value:function(){this.setState({tags:this.state.tags.slice(0,-1)})}},{key:"autosuggest",value:function(t){var e=this;t.length>1&&xo.execute.get(this.props.path,this.props.id,"autosuggest",{search:t}).then((function(t){e.setState({autosuggestIsOpen:!0,autosuggest:t.data})}))}},{key:"openBrowser",value:function(){this.setState({browserIsOpen:!0})}},{key:"closeBrowser",value:function(){this.setState({browserIsOpen:!1})}},{key:"confirmBrowser",value:function(t){this.setState({tags:t,browserIsOpen:!1})}},{key:"render",value:function(){var t,e,r=this;return this.state.autosuggestIsOpen&&this.state.autosuggest.length&&(e=(0,St.jsx)("div",{className:"tags-field__autosuggest",children:this.state.autosuggest.map((function(t,e){return(0,St.jsx)("div",{className:"tags-field__autosuggestion",onClick:function(e){return r.handleSuggestionClick(t)},children:t},e)}))})),this.state.browserIsOpen&&(t=(0,St.jsx)(No,{children:(0,St.jsx)(Xd,{id:this.props.id,path:this.props.path,selectedTags:this.state.tags,onCancel:this.closeBrowser.bind(this),onConfirm:function(t){return r.confirmBrowser(t)}})})),(0,St.jsx)(Ee,{name:this.props.name,required:this.props.showRequiredIndicator,label:this.props.label,errors:this.props.errors,tooltip:this.props.tooltip,children:(0,St.jsx)("div",{className:"tags-field",children:(0,St.jsxs)("div",{className:"tags-field__wrap",children:[(0,St.jsx)("div",{className:"tags-field__browse",children:(0,St.jsx)(Mo,{style:"transparent",name:"fact_check",onClick:this.openBrowser.bind(this)})}),(0,St.jsx)("div",{className:"tags-field__tags",children:(0,St.jsx)(zd,{tags:this.state.tags})}),(0,St.jsx)("div",{className:"tags-field__input",children:(0,St.jsx)("input",{className:"tags-field__input-field",ref:this.inputRef,onChange:this.handleChange.bind(this),onKeyUp:this.handleKeyUp.bind(this),onKeyDown:this.handleKeyDown.bind(this),onBlur:this.handleBlur.bind(this)})}),e,t]})})})}}],r&&ny(e.prototype,r),o&&ny(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);function sy(t){return sy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(t)}function ly(t,e){for(var r=0;r1,r=this.props.currentPaget.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:[];t.onChange(t.id,e.join(","))};return i=t.label?t.label:bt.toUpperCaseFirst(t.field),(0,St.jsx)("div",{className:"enum-filter",children:(0,St.jsx)(ml,{stopPropagation:!1,style:["secondary"],label:i,text:r.humanReadableValue,children:(0,St.jsx)(Ji,{options:t.options,defaultValues:r.values,onChange:a,onClear:a})})})}$y.defaultProps={id:0,type:"",options:{},field:"",label:"",data:{},onChange:function(){}};const Hy=$y;function Ky(t){return Ky="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ky(t)}function Zy(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Jy(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:[];t.onChange(t.id,e.join(","))};return i=t.label?t.label:bt.toUpperCaseFirst(t.field),(0,St.jsx)("div",{className:"enum-filter",children:(0,St.jsx)(ml,{stopPropagation:!1,style:["secondary"],label:i,text:r.humanReadableValue,children:(0,St.jsx)(Ji,{options:r.options,defaultValues:r.values,onChange:a,onClear:a})})})}eh.defaultProps={id:0,type:"",field:"",label:"",titleColumn:"",data:{},onChange:function(){}};const rh=eh;function nh(t){return nh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nh(t)}function oh(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[],r=e.map((function(e){return t.state.options[e]}));this.setState({humanReadableValue:r.length?r.join(", "):mt.get("snippets.tags_all")}),this.props.onChange(this.props.id,e.join(","))}},{key:"clear",value:function(){this.selectListRef.current.clear()}},{key:"onCtxMenuClick",value:function(t){"clear"===t&&this.clear()}},{key:"render",value:function(){var t=this.props.label?this.props.label:mt.get("snippets.tag");return(0,St.jsx)("div",{className:"enum-filter",children:(0,St.jsx)(qt,{onClick:this.onCtxMenuClick.bind(this),links:[["Clear this filter","clear"]],children:(0,St.jsx)(ml,{stopPropagation:!1,style:["secondary"],label:t,text:this.state.humanReadableValue,children:(0,St.jsx)(Ji,{options:this.state.options,onChange:this.handleChange.bind(this),onClear:this.handleChange.bind(this),ref:this.selectListRef})})})})}}],r&&oh(e.prototype,r),o&&oh(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=uh(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(sh,"defaultProps",{id:0,type:"",label:"",onChange:function(){}});const lh=sh;function fh(t){return fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fh(t)}function ph(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dh(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r5&&void 0!==arguments[5]&&arguments[5];return t.map((function(t,c){var u=a?n.createRef():null,s=vh[t.type];return{filter:o((0,St.jsx)(s,jh(jh({},t),{},{data:e,path:r,onChange:i})),c),ref:u}}))}};function Sh(t){return Sh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sh(t)}function xh(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Ph(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function kh(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};this.state.searchKeyword&&(e.search=this.state.searchKeyword);for(var r=!1,n=0;nt.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:null;xo.execute.get(this.props.path,this.props.id,"load",this.props.path.params).then((function(r){var n=r.data.data,o={};n.forEach((function(e){return o[e.id]=e[t.props.titleColumn]})),t.setState({items:n,options:o},(function(){e&&e()}))}))}},{key:"getData",value:function(t){return t[this.props.name]=this.state.selectedItems||[],t}},{key:"handleSubmit",value:function(t){t[this.props.name]=this.state.selectedItemsIds||[]}},{key:"handleChange",value:function(t){this.setState({selectedItemsIds:t,selectedItems:this.state.items.filter((function(e){return t.includes("".concat(e.id))}))})}},{key:"open",value:function(){this.setState({isOpen:!0})}},{key:"close",value:function(){this.setState({isOpen:!1})}},{key:"create",value:function(t){var e=this;xo.execute.post(this.props.path,this.props.id,"create",t).then((function(t){e.createFormRef.current.ready(),e.load((function(){e.setState({isOpen:!1,selectedItemsIds:[].concat(em(e.state.selectedItemsIds),[t.data.data.id])})})),vt.notify(mt.get("snippets.singular_created_selected",{singular:e.props.singular}))}),(function(t){var r=t.response;e.createFormRef.current.ready(),e.setState({createFormErrors:r.data.errors}),vt.notify(r.data.message)}))}},{key:"renderSidebarComponents",value:function(){return iv.renderComponents(this.props.sidebarComponents,{},this.props.path)}},{key:"renderCreateComponents",value:function(){return iv.renderComponents(this.props.createComponents,{},this.props.path)}},{key:"renderCreateWidget",value:function(){return this.state.isOpen?(0,St.jsx)(No,{children:(0,St.jsx)(Ho,{title:mt.get("snippets.new_singular",{singular:this.props.singular}),style:"modal",closeable:!0,onClose:this.close.bind(this),children:(0,St.jsx)(ii,{ref:this.createFormRef,errors:this.state.createFormErrors,realForm:!1,onSubmit:this.create.bind(this),submitButtonText:mt.get("snippets.create_singular",{singular:this.props.singular}),sidebar:this.renderSidebarComponents(),children:this.renderCreateComponents()})})}):null}},{key:"renderCreate",value:function(){return this.props.create?(0,St.jsx)("div",{className:"many-to-many-select-field__btn",children:(0,St.jsx)(ar,{icon:"add",style:["full","small","secondary"],text:mt.get("snippets.new_singular",{singular:this.props.singular}),onClick:this.open.bind(this)})}):null}},{key:"render",value:function(){var t=this;return(0,St.jsxs)(Ee,{name:this.props.name,label:this.props.label,tooltip:this.props.tooltip,errors:this.props.errors,children:[(0,St.jsx)("div",{className:"many-to-many-select-field",children:(0,St.jsx)("div",{className:"many-to-many-select-field__field",children:(0,St.jsx)(va,{multiple:!0,value:this.state.selectedItemsIds,options:this.state.options,nullText:"– "+mt.get("snippets.no_plural_selected",{plural:this.props.plural})+" –",onChange:function(e){return t.handleChange(e)},children:this.renderCreate()})})}),this.renderCreateWidget()]})}}],r&&nm(e.prototype,r),o&&nm(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=cm(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(um,"defaultProps",{path:{},data:{},label:"",name:"",style:"",singular:"",plural:"",titleColumn:"",tooltip:"",create:!1,createComponents:[],sidebarComponents:[]});const sm=um;function lm(t){return lm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lm(t)}function fm(t){return function(t){if(Array.isArray(t))return pm(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return pm(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pm(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pm(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=this.state.addedItems.length-1)){var e=this.state.addedItems,r=t+1,n=[e[r],e[t]];e[t]=n[0],e[r]=n[1],this.setState({addedItems:e})}}},{key:"removeItem",value:function(t){var e=this.state.addedItems;e.splice(t,1),this.setState({addedItems:e})}},{key:"renderItems",value:function(){var t=this;return this.componentLists=[],this.state.addedItems.length?this.state.addedItems.map((function(e,r){var n=iv.renderComponentsWith(t.props.components,e,t.props.path,(function(t,e){return(0,St.jsx)("div",{className:"json-field__component",children:t},e)}),!0,t.props.errors);return t.componentLists.push(n),(0,St.jsxs)("div",{className:"json-field__item",children:[(0,St.jsx)("div",{className:"json-field__item-content",children:n.map((function(t){return t.component}))}),(0,St.jsxs)("div",{className:"json-field__item-actions",children:[(0,St.jsx)(Mo,{style:["transparent",r>0?"enabled":"disabled"],iconStyle:"mini",name:"arrow_upward",onClick:function(e){return t.sortUp(r)}}),(0,St.jsx)(Mo,{style:["transparent",rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:null,e={},r={};this.componentList.forEach((function(t){t.ref.current.getData&&t.ref.current.getData(e),t.ref.current.handleSubmit&&t.ref.current.handleSubmit(r)})),this.setState({isStored:!0,data:e,submitData:r,isOpen:!1},(function(){t&&t()}))}},{key:"renderComponents",value:function(){return this.componentList=iv.renderComponentsWith(this.props.components,this.state.isStored?this.state.data:this.props.data,this.props.path,(function(t,e){return(0,St.jsx)("div",{className:"content-blocks__component",children:t},e)}),!0),this.componentList.map((function(t){return t.component}))}},{key:"renderWidget",value:function(){var t=this;return(0,St.jsx)(No,{children:(0,St.jsx)(Ho,{title:this.props.title,style:"modal",closeable:!0,onClose:this.close.bind(this),footer:[(0,St.jsx)(ar,{text:"Confirm",onClick:function(){t.store()}},"confirm")],children:this.renderComponents()})})}},{key:"render",value:function(){return(0,St.jsxs)(n.Fragment,{children:[(0,St.jsx)(Ee,{label:this.props.label,tooltip:this.props.tooltip,children:"link"===this.props.style?(0,St.jsx)(yr,{style:this.props.style,onClick:this.open.bind(this),text:this.props.title}):(0,St.jsx)(ar,{style:["small","secondary"],text:this.props.title,onClick:this.open.bind(this)})}),(0,St.jsx)("div",{style:{display:this.state.isOpen?"block":"none"},children:this.renderWidget()})]})}}],r&&Rb(e.prototype,r),o&&Rb(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=Db(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Ib,"defaultProps",{title:"",label:"",components:[],path:{},data:{},errors:{},style:null});const Ab=Ib;function Fb(t){return Fb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fb(t)}function Bb(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return t.map((function(t,c){var u=null;i&&(u=n.createRef());var s=tv[t.type];return{component:o((0,St.jsx)(s,nv(nv({},t),{},{data:e,errors:a,path:r,ref:u})),c),ref:u}}))}};var av=r(498),cv={insert:"head",singleton:!1};wt()(av.Z,cv);av.Z.locals;function uv(t){return(0,St.jsx)("div",{className:_t.className("checkbox",t.style)+(t.checked?" checkbox--checked":""),onClick:t.onClick})}uv.defaultProps={style:[],checked:!1,onClick:function(){}};const sv=uv;function lv(t){var e,r,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function hv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mv(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==f[0]?f[0]:{},i=!1,c=0;c0?(0,St.jsx)("div",{className:"wizard__footer-component",children:(0,St.jsx)(yr,{onClick:this.goToPrev.bind(this),text:"Previous"})},1):null,(0,St.jsx)("div",{className:"wizard__footer-component",children:(0,St.jsx)(ar,{style:"large",onClick:this.goToNext.bind(this),text:this.isLastStep()?mt.get("snippets.create"):mt.get("snippets.next")})},2)]}},{key:"renderWizardContent",value:function(){var t=this;return this.props.steps.map((function(e,r){return(0,St.jsx)("div",{className:"wizard__step-content",style:{display:r===t.state.currentStepIndex?"block":"none"},children:t.componentLists[r].map((function(t){return t.component}))},r)}))}},{key:"isLastStep",value:function(){return this.state.currentStepIndex===this.props.steps.length-1}},{key:"goTo",value:function(t){(t=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Qg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xg(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==n[0]?n[0]:null,t.next=3,ho.all([xo.media.path(e),xo.media.loadDirectories(e),xo.media.loadFiles(e)]).then(ho.spread((function(t,e,n){var i=t.data.data,a=e.data.data,c=n.data.data,u=i[i.length-1];p({type:"media/init",payload:{directory:u,path:i,directories:a,files:c}}),o(Xg(Xg({},r),{},{isLoading:!1,currentFile:null,selectedFiles:[],selectedFileIds:[]}))})));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),y=function(){i.current.params.directory?d(i.current.params.directory):d()},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t?le.goTo(i.current.module,i.current.action,{directory:t}):le.goTo(i.current.module,i.current.action)},b=function(){o(Xg(Xg({},r),{},{currentFile:null,selectedFiles:[],selectedFileIds:[]}))},v=function(t,e){e.length?1===e.length?o(Xg(Xg({},r),{},{currentFile:e[0],selectedFiles:e,selectedFileIds:t})):o(Xg(Xg({},r),{},{currentFile:null,selectedFiles:e,selectedFileIds:t})):b()},g=function(){var t=rw(Jg().mark((function t(e){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.deleteDirectory(e);case 3:p({type:"media/directories/delete",directoryIds:[e]}),vt.i18nNotify("snippets.directory_deleted"),b(),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),vt.i18nNotify("snippets.directory_not_deleted");case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),w=function(){var t=rw(Jg().mark((function t(e,r){var n;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=13;break}return t.prev=1,t.next=4,xo.media.renameDirectory(e,r);case 4:n=t.sent,p({type:"media/directories/rename",payload:n.data.data}),vt.i18nNotify("snippets.directory_renamed"),b(),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,r){return t.apply(this,arguments)}}(),j=function(){var t=rw(Jg().mark((function t(e,r){var n;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=12;break}return t.prev=1,t.next=4,xo.media.renameFile(e,r);case 4:n=t.sent,p({type:"media/files/rename",payload:n.data.data}),vt.i18nNotify("snippets.file_renamed"),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,r){return t.apply(this,arguments)}}(),O=function(){var t=rw(Jg().mark((function t(e){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.deleteFile(e);case 3:p({type:"media/files/delete",fileIds:[e]}),vt.i18nNotify("snippets.file_deleted"),b(),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),vt.notify(mt.get("snippets.file_not_deleted"));case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),_=function(){var t=rw(Jg().mark((function t(e){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.deleteFiles(e);case 3:p({type:"media/files/delete",fileIds:e}),vt.i18nNotify("snippets.amount_files_deleted",{amount:e.length}),b(),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),vt.i18nNotify("snippets.files_not_deleted");case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),x=function(){var t=rw(Jg().mark((function t(e,r){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.labelFile(e,r);case 3:p({type:"media/files/label",fileId:r,label:e}),vt.i18nNotify("snippets.changes_successful"),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),vt.i18nNotify("snippets.changes_unsuccessful");case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}(),P=function(){var t=rw(Jg().mark((function t(e,r,n){var o;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=e.toLowerCase(),!["visibility","description","copyright"].includes(e)){t.next=13;break}return o=xo.media["updateFile"+bt.toUpperCaseFirst(e)],t.prev=3,t.next=6,o(r,n);case 6:p({type:"media/files/changeProperty",fileId:n,property:e,value:r}),vt.notify(mt.get("snippets.changes_successful")),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),vt.notify(mt.get("snippets.changes_unsuccessful"));case 13:case"end":return t.stop()}}),t,null,[[3,10]])})));return function(e,r,n){return t.apply(this,arguments)}}(),k=function(){var t=rw(Jg().mark((function t(e,r,n){var o;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=e.toLowerCase(),!["visibility","description","copyright"].includes(e)){t.next=13;break}return o=xo.media["updateFiles"+bt.toUpperCaseFirst(e)],t.prev=3,t.next=6,o(r,n);case 6:p({type:"media/files/changeProperties",fileIds:n,property:e,value:r}),vt.notify(mt.get("snippets.changes_successful")),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),vt.notify(mt.get("snippets.changes_unsuccessful"));case 13:case"end":return t.stop()}}),t,null,[[3,10]])})));return function(e,r,n){return t.apply(this,arguments)}}(),E=function(){var t=rw(Jg().mark((function t(e,r){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.moveDirectory(e,r);case 3:p({type:"media/directories/move",moveToId:e,directoryIds:[r]}),vt.notify(mt.get("snippets.directory_moved")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),vt.notify(mt.get("snippets.changes_unsuccessful"));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}(),C=function(){var t=rw(Jg().mark((function t(e,r){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.moveFile(e,r);case 3:p({type:"media/files/move",moveToId:e,fileIds:[r]}),vt.notify(mt.get("snippets.file_moved")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),vt.notify(mt.get("snippets.changes_unsuccessful"));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}(),R=function(){var t=rw(Jg().mark((function t(e,r){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.moveFiles(e,r);case 3:p({type:"media/files/move",moveToId:e,fileIds:r}),vt.notify(mt.get("snippets.files_moved")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),vt.notify(mt.get("snippets.changes_unsuccessful"));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}(),T=function(t){window.open(t.url)},N=function(){y()},L=function(t){(!i.current.params.directory&&!t.directory||t.directory&&i.current.params.directory&&t.directory.id===i.current.params.directory)&&y()},D=function(){var t;vt.prompt({title:mt.get("snippets.new_directory_title"),confirmButtonText:mt.get("snippets.create"),cancelButtonText:mt.get("snippets.cancel"),confirm:(t=rw(Jg().mark((function t(e){var r;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,xo.media.createDirectory(e,i.current.params.directory);case 2:r=t.sent,p({type:"media/directories/add",payload:r.data.data}),vt.notify(mt.get("snippets.directory_created"));case 5:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})})},I=function(t,e){vt.confirm({title:mt.get("snippets.delete_files_title",{amount:t.length}),text:mt.get("snippets.delete_files_text"),confirmButtonText:mt.get("snippets.delete_files_confirm",{amount:t.length}),cancelButtonText:mt.get("snippets.delete_files_cancel"),confirm:function(){return _(t)}})};return(0,St.jsxs)("div",{className:"view-media-directory"+(r.isLoading?" view-media-directory--loading":"")+(r.isDragOver?" view-media-directory--drag-over":""),children:[(0,St.jsxs)("div",{className:"view-media-directory__header",children:[(0,St.jsxs)("div",{className:"view-media-directory__header-title",children:[(0,St.jsx)(ml,{style:["primary","small"],openIcon:"folder",closeIcon:"folder",children:(0,St.jsx)($l,{selectedDirectory:s?s.id:null,onDirectoryClick:function(t){return m(t)}})}),(0,St.jsx)(np,{items:u,onClick:function(t){t?m(t.id):m()}})]}),(0,St.jsxs)("div",{className:"view-media-directory__header-options",children:[(0,St.jsx)(Mp,{}),(0,St.jsx)(ar,{style:["secondary","small"],onClick:D,text:mt.get("snippets.new_directory")}),(0,St.jsx)(ml,{text:mt.get("snippets.upload"),style:["primary","small"],autoClose:!0,children:(0,St.jsx)(fp,{directory:s?s.id:null,onUploadDone:N})})]})]}),(0,St.jsx)("div",{className:"view-media-directory__content",children:r.isLoading?null:(0,St.jsxs)(St.Fragment,{children:[(0,St.jsx)("div",{className:"view-media-directory__main",children:(0,St.jsx)(Cp,{directory:s?s.id:null,onCreateDirectory:L,onUploadDone:N,children:(0,St.jsx)(Hf,{viewMode:c,currentDirectory:s,directories:l,files:f,fileLabels:t.fileLabels,selectedFiles:r.selectedFiles,selectedFileIds:r.selectedFileIds,onDirectoryClick:m,onDirectoryDelete:g,onDirectoryRename:w,onDirectoryMove:E,onFileDelete:O,onFileRename:j,onFileOpen:T,onFileMove:C,onSelectionMove:R,onSelectionChange:v,onSelectionDelete:I})})}),(0,St.jsx)("div",{className:"view-media-directory__side",children:r.currentFile?(0,St.jsx)(Ig,{file:r.currentFile,fileLabels:t.fileLabels,onLabelFile:function(t){return x(t,r.currentFile.id)},onChangeFileProperty:function(t,e){return P(t,e,r.currentFile.id)},onDeleteFile:function(){vt.confirm({title:mt.get("snippets.delete_file_title"),text:mt.get("snippets.delete_file_text"),confirmButtonText:mt.get("snippets.delete_file_confirm"),cancelButtonText:mt.get("snippets.delete_file_cancel"),confirm:function(){return O(r.currentFile.id)}})},onRenameFile:function(){vt.prompt({title:mt.get("snippets.rename_file_title"),defaultValue:r.currentFile.name,confirmButtonText:mt.get("snippets.rename_file_confirm"),cancelButtonText:mt.get("snippets.rename_file_cancel"),confirm:function(t){xo.media.renameFile(t,r.currentFile.id).then((function(t){o(Xg(Xg({},r),{},{currentFile:t.data.data}),(function(){vt.notify(mt.get("snippets.file_renamed")),y()}))}))}})},onMoveFile:C}):r.selectedFiles.length?(0,St.jsx)(Gg,{files:r.selectedFiles,onDeleteFiles:function(){return I(r.selectedFileIds,r.selectedFiles)},onChangeFilesProperty:function(t,e){return k(t,e,r.selectedFileIds)},onMoveFiles:R}):s?(0,St.jsx)(Yg,{directory:s}):(0,St.jsx)(Kg,{})})]})})]})}iw.defaultProps={type:"",path:{},id:0,data:{},fileLabels:{}};const aw=iw;function cw(t){return cw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cw(t)}function uw(t,e){for(var r=0;r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function bw(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vw(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>32-e}function r(t,e){var r,n,o,i,a;return o=2147483648&t,i=2147483648&e,a=(1073741823&t)+(1073741823&e),(r=1073741824&t)&(n=1073741824&e)?2147483648^a^o^i:r|n?1073741824&a?3221225472^a^o^i:1073741824^a^o^i:a^o^i}function n(t,n,o,i,a,c,u){return t=r(t,r(r(function(t,e,r){return t&e|~t&r}(n,o,i),a),u)),r(e(t,c),n)}function o(t,n,o,i,a,c,u){return t=r(t,r(r(function(t,e,r){return t&r|e&~r}(n,o,i),a),u)),r(e(t,c),n)}function i(t,n,o,i,a,c,u){return t=r(t,r(r(function(t,e,r){return t^e^r}(n,o,i),a),u)),r(e(t,c),n)}function a(t,n,o,i,a,c,u){return t=r(t,r(r(function(t,e,r){return e^(t|~r)}(n,o,i),a),u)),r(e(t,c),n)}function c(t){var e,r="",n="";for(e=0;e<=3;e++)r+=(n="0"+(t>>>8*e&255).toString(16)).substr(n.length-2,2);return r}var u,s,l,f,p,d,y,h,m,b=Array();for(b=function(t){for(var e,r=t.length,n=r+8,o=16*((n-n%64)/64+1),i=Array(o-1),a=0,c=0;c>>29,i}(t=function(t){t=t.replace(/rn/g,"n");for(var e="",r=0;r127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}(t)),d=1732584193,y=4023233417,h=2562383102,m=271733878,u=0;u=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Yw(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function $w(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Yw(i,n,o,a,c,"next",t)}function c(t){Yw(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Hw(t){var e=S(),r=h((function(t){return t.auth})).user,n=h((function(t){return t.modules.secondary})),o=function(){var t=$w(Ww().mark((function t(){return Ww().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:vt.confirm({title:mt.get("snippets.logout"),confirmButtonText:mt.get("snippets.logout_confirm"),confirm:function(){var t=$w(Ww().mark((function t(){return Ww().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,xo.auth.logout();case 2:e({type:"auth/loggedout"}),vt.notify("User logged out");case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,St.jsxs)("div",{className:"user-panel",children:[(0,St.jsx)("div",{className:"user-panel__avatar",children:(0,St.jsx)("img",{src:Vw.get(r.email),alt:r.name})}),(0,St.jsx)("div",{className:"user-panel__name",children:r.name}),(0,St.jsx)("div",{className:"user-panel__actions",children:(0,St.jsxs)(ml,{style:["secondary"],children:[(0,St.jsx)(It,{stopPropagation:!1,links:n.map((function(t){return[t.title,t.id]})),onClick:function(t){return e=t,void le.goTo(e,"index");var e}}),(0,St.jsx)("div",{className:"user-panel__logout",children:(0,St.jsx)(ar,{stopPropagation:!1,onClick:o,style:["full","small"],text:mt.get("snippets.logout")})})]})})]})}function Kw(){return(0,St.jsxs)("div",{className:"module",children:[(0,St.jsx)("div",{className:"module__header",children:(0,St.jsx)("div",{className:"module__title",children:(0,St.jsx)(bc,{children:"Not found"})})}),(0,St.jsx)("div",{className:"module__main",children:"Are you sure you're trying to access the correct URL? No module or action was found for this request."})]})}function Zw(t){return Zw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zw(t)}function Jw(){Jw=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new x(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function d(){}function y(){}var h={};u(h,i,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(P([])));b&&b!==e&&r.call(b,i)&&(h=b);var v=y.prototype=p.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Zw(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Qw(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xw(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=u(t),a=i[0],c=i[1],s=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,c)),l=0,f=c>0?a-4:a;for(r=0;r>16&255,s[l++]=e>>8&255,s[l++]=255&e;2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,s[l++]=255&e);1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e);return s},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],a=16383,c=0,u=n-o;cu?u:c+a));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=i.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,n){for(var o,i,a=[],c=e;c>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(t,e,r)=>{"use strict";var n=r(742),o=r(241),i=r(826);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n)return z(t).length;e=(""+e).toLowerCase(),n=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,c=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,c/=2,u/=2,r/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(i=r;ic&&(r=c-u),i=r;i>=0;i--){for(var f=!0,p=0;po&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:s>223?3:s>191?2:1;if(o+f<=r)switch(f){case 1:s<128&&(l=s);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&s)<<6|63&i)>127&&(l=u);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(u=(15&s)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[o+1],a=t[o+2],c=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&c)&&(u=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&c)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),c=Math.min(i,a),s=this.slice(n,o),l=t.slice(e,r),f=0;fo)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return j(this,t,e,r);case"latin1":case"binary":return O(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;on)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function I(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function A(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,i){return i||A(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return i||A(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):I(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):I(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);L(this,t,e,r,o-1,-o)}var i=0,a=1,c=0;for(this[e]=255&t;++i>0)-c&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);L(this,t,e,r,o-1,-o)}var i=r-1,a=1,c=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===c&&0!==this[e+i+1]&&(c=1),this[e+i]=(t/a>>0)-c&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):I(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):I(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}},399:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".footer-text{color:var(--fill-color-alt-3);display:block;font-family:Poppins,sans-serif;font-size:.85rem;font-weight:500;letter-spacing:-.02em;line-height:1;text-align:center;width:100%}.footer-text a{text-decoration:underline;transition:color .5s}.footer-text a:hover{color:var(--primary-color);text-decoration:none}",""]);const i=o},451:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.boolean-switcher{background-color:var(--fill-color-alt-1);border-radius:1.3333333333rem;cursor:pointer;display:inline-block;height:1.6666666667rem;padding:.3333333333rem;position:relative;transition:background-color .25s;width:3.3333333333rem}.boolean-switcher:after{background-color:#fff;border-radius:50%;box-shadow:0 5px 15px 0 rgba(70,70,70,.1);content:"";height:1.3333333333rem;left:.1666666667rem;position:absolute;top:.1666666667rem;transition:transform .25s;width:1.3333333333rem}.boolean-switcher--alt{background-color:#fff}.boolean-switcher--alt:after{background-color:var(--fill-color-alt-2)}.boolean-switcher--alt.boolean-switcher--checked:after{background-color:#fff}.boolean-switcher--checked{background-color:var(--primary-color-alt-1)}.boolean-switcher--checked:after{transform:translateX(1.6666666667rem)}.boolean-switcher--small{height:1rem;width:2.3333333333rem}.boolean-switcher--small:after{height:.6666666667rem;width:.6666666667rem}.boolean-switcher--small.boolean-switcher--checked:after{transform:translateX(1.3333333333rem)}',""]);const i=o},195:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'@charset "UTF-8";.breadcrumbs__list{display:flex}.breadcrumbs__list li{color:#7b7d85}.breadcrumbs__list li:after{content:"›";margin-left:.6666666667rem;margin-right:.6666666667rem}.breadcrumbs__list li:last-child{color:#464646}.breadcrumbs__list li:last-child span{cursor:default}.breadcrumbs__list li:last-child span:hover{border-bottom:0}.breadcrumbs__list li:last-child:after{display:none}.breadcrumbs__list li span{cursor:pointer}.breadcrumbs__list li span:hover{border-bottom:1px solid hsla(228,4%,50%,.5)}',""]);const i=o},314:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".button-group{border-radius:var(--border-radius);display:flex;flex-wrap:nowrap;overflow:hidden}",""]);const i=o},151:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.button{background-color:var(--primary-color);border-radius:var(--border-radius);color:#fff;cursor:pointer;font-family:Poppins,sans-serif;font-size:.95rem;font-weight:500;line-height:1;overflow:hidden;padding:1rem 2rem;position:relative;transition:background-color .25s;white-space:nowrap}.button:after{bottom:0;box-shadow:inset 0 -2px 0 var(--primary-color-alt-1);content:"";left:0;opacity:.5;position:absolute;right:0;top:0}.button:before{border:1px solid var(--fill-color);border-radius:var(--border-radius);bottom:2px;content:"";left:2px;opacity:0;position:absolute;right:2px;top:2px;transition:opacity 1s}.button:active:before,.button:focus:before{opacity:.25}.button:hover{background-color:var(--primary-color-alt-1)}.button__icon{margin-right:.5rem}.button__label{color:#7b7d85;margin-right:.6666666667rem}.button--grouped{border-radius:0}.button--has-icon{align-items:center;display:inline-flex}.button--disabled{box-shadow:none;cursor:not-allowed;overflow:hidden}.button--disabled:after{background-color:var(--fill-color);bottom:0;box-shadow:none;content:"";left:0;opacity:.75;position:absolute;right:0;top:0}.button--secondary{background-color:var(--fill-color-alt-1);color:#464646}.button--secondary:after{display:none}.button--active,.button--secondary:hover{background-color:var(--fill-color-alt-2)}.button--outline{background-color:#fff;border:1px solid var(--fill-color-alt-1);color:var(--primary-color-alt-1)}.button--outline:after{display:none}.button--outline:hover{background-color:#fff}.button--full{justify-content:center;text-align:center;width:100%}.button--small{height:2.3rem;padding:.6666666667rem 1.3333333333rem}.button--small:after{display:none}.button--large{border-radius:var(--border-radius);font-family:Poppins,sans-serif;font-size:1.15rem;font-weight:700;line-height:1.35;padding:1rem 2rem;text-transform:none}',""]);const i=o},498:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.checkbox{background-color:var(--fill-color-alt-1);cursor:pointer;display:inline-block;height:1.1666666667rem;padding:.3333333333rem;position:relative;transition:background-color .25s;width:1.1666666667rem}.checkbox,.checkbox:after{border-radius:var(--border-radius)}.checkbox:after{background-color:#fff;box-shadow:0 5px 15px 0 rgba(70,70,70,.1);content:"";height:.6666666667rem;left:.25rem;position:absolute;top:.25rem;transform:scale(0);transition:transform .25s;width:.6666666667rem}.checkbox--checked{background-color:var(--primary-color-alt-1)}.checkbox--checked:after{transform:scale(1)}',""]);const i=o},554:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".collapsible{background-color:#fff;border:1px solid var(--fill-color-alt-1);border-radius:var(--border-radius);margin-bottom:1rem}.collapsible__header{align-items:center;background-color:var(--fill-color);display:flex;justify-content:space-between;padding:.3333333333rem .6666666667rem}.collapsible__title{padding-left:1rem;text-align:left;width:100%}.collapsible__content{display:flex;flex-direction:column;gap:2rem;padding:.6666666667rem}.collapsible--closed .collapsible__content{display:none}.collapsible__actions{align-items:center;display:flex;gap:.6666666667rem}.collapsible__component{margin-bottom:2rem}.collapsible__component:last-child{margin-bottom:0}",""]);const i=o},709:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.ctx-overlay{position:fixed}.ctx-mount,.ctx-overlay{bottom:0;left:0;right:0;top:0;z-index:9999}.ctx-mount{position:absolute}@keyframes context-menu{0%{transform:scaleY(.85) scaleX(.85);transform-origin:0 0}to{transform:scaleY(1) scaleX(1);transform-origin:0 0}}.context-menu{width:100%}.context-menu__menu{animation:context-menu .25s;background-color:#fff;border:1px solid var(--fill-color-alt-2);border-radius:var(--border-radius);box-shadow:0 5px 15px 0 rgba(70,70,70,.1);left:0;margin-top:.6666666667rem;padding:.6666666667rem;position:absolute;top:0;width:20rem;z-index:1}.context-menu__wrap{position:relative;width:100%}.context-menu--open .context-menu__wrap:after{border:1px solid var(--fill-color-alt-2);border-radius:var(--border-radius);bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}',""]);const i=o},279:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".directory-view{padding:1rem}.directory-view__content,.directory-view__header{margin-bottom:2rem}",""]);const i=o},374:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.file-drop-zone{border:1px solid transparent;border-radius:var(--border-radius);display:block;width:100%}.file-drop-zone__overlay{align-items:center;bottom:0;display:flex;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;z-index:9998}.file-drop-zone--drag-over .file-drop-zone__overlay{opacity:1;transition:opacity .5s}.file-drop-zone--drag-over{border:1px dashed var(--primary-color);cursor:copy;position:relative}.file-drop-zone--drag-over:after{background-color:var(--fill-color);border-radius:var(--border-radius);bottom:0;content:"";display:block;left:0;opacity:.85;pointer-events:none;position:absolute;right:0;top:0}',""]);const i=o},926:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".file-uploader{position:relative}.file-uploader__input{bottom:0;left:0;position:absolute;right:0;top:0}.file-uploader__input:has(input:hover){border:1px dashed var(--fill-color-alt-2);border-radius:var(--border-radius)}.file-uploader__input input{cursor:pointer;height:100%;opacity:0;width:100%}",""]);const i=o},668:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".directory-view{padding:1rem}.directory-view__content,.directory-view__header{margin-bottom:2rem}",""]);const i=o},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,n){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(n)for(var i=0;i{"use strict";var n=r(864),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function u(t){return n.isMemo(t)?a:c[t.$$typeof]||o}c[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[n.Memo]=a;var s=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,y=Object.prototype;t.exports=function t(e,r,n){if("string"!=typeof r){if(y){var o=d(r);o&&o!==y&&t(e,o,n)}var a=l(r);f&&(a=a.concat(f(r)));for(var c=u(e),h=u(r),m=0;m{e.read=function(t,e,r,n,o){var i,a,c=8*o-n-1,u=(1<>1,l=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=c;l>0;i=256*i+t[e+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=p,l-=8);if(0===i)i=1-s;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=s}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,c,u,s=8*i-o-1,l=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,y=n?1:-1,h=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(c=0,a=l):a+f>=1?(c=(e*u-1)*Math.pow(2,o),a+=f):(c=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&c,d+=y,c/=256,o-=8);for(a=a<0;t[r+d]=255&a,d+=y,a/=256,s-=8);t[r+d-y]|=128*h}},826:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},425:()=>{},921:(t,e)=>{"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.suspense_list"):60120,h=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,g=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function j(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:switch(t=t.type){case l:case f:case i:case c:case a:case d:return t;default:switch(t=t&&t.$$typeof){case s:case p:case m:case h:case u:return t;default:return e}}case o:return e}}}function O(t){return j(t)===f}e.AsyncMode=l,e.ConcurrentMode=f,e.ContextConsumer=s,e.ContextProvider=u,e.Element=n,e.ForwardRef=p,e.Fragment=i,e.Lazy=m,e.Memo=h,e.Portal=o,e.Profiler=c,e.StrictMode=a,e.Suspense=d,e.isAsyncMode=function(t){return O(t)||j(t)===l},e.isConcurrentMode=O,e.isContextConsumer=function(t){return j(t)===s},e.isContextProvider=function(t){return j(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===n},e.isForwardRef=function(t){return j(t)===p},e.isFragment=function(t){return j(t)===i},e.isLazy=function(t){return j(t)===m},e.isMemo=function(t){return j(t)===h},e.isPortal=function(t){return j(t)===o},e.isProfiler=function(t){return j(t)===c},e.isStrictMode=function(t){return j(t)===a},e.isSuspense=function(t){return j(t)===d},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===f||t===c||t===a||t===d||t===y||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===h||t.$$typeof===u||t.$$typeof===s||t.$$typeof===p||t.$$typeof===v||t.$$typeof===g||t.$$typeof===w||t.$$typeof===b)},e.typeOf=j},864:(t,e,r)=>{"use strict";t.exports=r(921)},359:(t,e)=>{"use strict";var r,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function b(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:switch(t=t.type){case i:case c:case a:case p:case d:return t;default:switch(t=t&&t.$$typeof){case l:case s:case f:case h:case y:case u:return t;default:return e}}case o:return e}}}r=Symbol.for("react.module.reference")},973:(t,e,r)=>{"use strict";r(359)},53:(t,e)=>{"use strict";function r(t,e){var r=t.length;t.push(e);t:for(;0>>1,o=t[n];if(!(0>>1;ni(u,r))si(l,u)?(t[n]=l,t[s]=r,n=s):(t[n]=u,t[c]=r,n=c);else{if(!(si(l,r)))break t;t[n]=l,t[s]=r,n=s}}}return e}function i(t,e){var r=t.sortIndex-e.sortIndex;return 0!==r?r:t.id-e.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var s=[],l=[],f=1,p=null,d=3,y=!1,h=!1,m=!1,b="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,g="undefined"!=typeof setImmediate?setImmediate:null;function w(t){for(var e=n(l);null!==e;){if(null===e.callback)o(l);else{if(!(e.startTime<=t))break;o(l),e.sortIndex=e.expirationTime,r(s,e)}e=n(l)}}function j(t){if(m=!1,w(t),!h)if(null!==n(s))h=!0,L(O);else{var e=n(l);null!==e&&D(j,e.startTime-t)}}function O(t,r){h=!1,m&&(m=!1,v(P),P=-1),y=!0;var i=d;try{for(w(r),p=n(s);null!==p&&(!(p.expirationTime>r)||t&&!C());){var a=p.callback;if("function"==typeof a){p.callback=null,d=p.priorityLevel;var c=a(p.expirationTime<=r);r=e.unstable_now(),"function"==typeof c?p.callback=c:p===n(s)&&o(s),w(r)}else o(s);p=n(s)}if(null!==p)var u=!0;else{var f=n(l);null!==f&&D(j,f.startTime-r),u=!1}return u}finally{p=null,d=i,y=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var _,S=!1,x=null,P=-1,k=5,E=-1;function C(){return!(e.unstable_now()-Et||125a?(t.sortIndex=i,r(l,t),null===n(s)&&t===n(l)&&(m?(v(P),P=-1):m=!0,D(j,i-a))):(t.sortIndex=c,r(s,t),h||y||(h=!0,L(O))),t},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(t){var e=d;return function(){var r=d;d=e;try{return t.apply(this,arguments)}finally{d=r}}}},840:(t,e,r)=>{"use strict";t.exports=r(53)},379:(t,e,r)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),a=[];function c(t){for(var e=-1,r=0;r{"use strict";var n=r(294);var o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},i=n.useState,a=n.useEffect,c=n.useLayoutEffect,u=n.useDebugValue;function s(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!o(t,r)}catch(t){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var r=e(),n=i({inst:{value:r,getSnapshot:e}}),o=n[0].inst,l=n[1];return c((function(){o.value=r,o.getSnapshot=e,s(o)&&l({inst:o})}),[t,r,e]),a((function(){return s(o)&&l({inst:o}),t((function(){s(o)&&l({inst:o})}))}),[t]),u(r),r};e.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:l},139:(t,e,r)=>{"use strict";var n=r(294),o=r(688);var i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=o.useSyncExternalStore,c=n.useRef,u=n.useEffect,s=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,r,n,o){var f=c(null);if(null===f.current){var p={hasValue:!1,value:null};f.current=p}else p=f.current;f=s((function(){function t(t){if(!u){if(u=!0,a=t,t=n(t),void 0!==o&&p.hasValue){var e=p.value;if(o(e,t))return c=e}return c=t}if(e=c,i(a,t))return e;var r=n(t);return void 0!==o&&o(e,r)?e:(a=t,c=r)}var a,c,u=!1,s=void 0===r?null:r;return[function(){return t(e())},null===s?void 0:function(){return t(s())}]}),[e,r,n,o]);var d=a(t,f[0],f[1]);return u((function(){p.hasValue=!0,p.value=d}),[d]),l(d),d}},688:(t,e,r)=>{"use strict";t.exports=r(250)},798:(t,e,r)=>{"use strict";t.exports=r(139)},328:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===n(e)?e:String(e)}function i(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;ec})}},t=>{var e=e=>t(t.s=e);t.O(0,[555,170],(()=>(e(828),e(425))));t.O()}]); \ No newline at end of file +(self.webpackChunk=self.webpackChunk||[]).push([[773],{957:(t,e,r)=>{"use strict";var n=r(294),o=r(745),i=r(688),a=r(798),c=r(935);let u=function(t){t()};const s=()=>u,l=(0,n.createContext)(null);function f(){return(0,n.useContext)(l)}let p=()=>{throw new Error("uSES not initialized!")};const d=(t,e)=>t===e;function h(t=l){const e=t===l?f:()=>(0,n.useContext)(t);return function(t,r=d){const{store:o,subscription:i,getServerState:a}=e(),c=p(i.addNestedSub,o.getState,a||o.getState,t,r);return(0,n.useDebugValue)(c),c}}const y=h();r(679),r(973);const m={notify(){},get:()=>[]};function b(t,e){let r,n=m;function o(){a.onStateChange&&a.onStateChange()}function i(){r||(r=e?e.addNestedSub(o):t.subscribe(o),n=function(){const t=s();let e=null,r=null;return{clear(){e=null,r=null},notify(){t((()=>{let t=e;for(;t;)t.callback(),t=t.next}))},get(){let t=[],r=e;for(;r;)t.push(r),r=r.next;return t},subscribe(t){let n=!0,o=r={callback:t,next:null,prev:r};return o.prev?o.prev.next=o:e=o,function(){n&&null!==e&&(n=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}const a={addNestedSub:function(t){return i(),n.subscribe(t)},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(r)},trySubscribe:i,tryUnsubscribe:function(){r&&(r(),r=void 0,n.clear(),n=m)},getListeners:()=>n};return a}const v=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?n.useLayoutEffect:n.useEffect;let g=null;const w=function({store:t,context:e,children:r,serverState:o}){const i=(0,n.useMemo)((()=>{const e=b(t);return{store:t,subscription:e,getServerState:o?()=>o:void 0}}),[t,o]),a=(0,n.useMemo)((()=>t.getState()),[t]);v((()=>{const{subscription:e}=i;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}}),[i,a]);const c=e||l;return n.createElement(c.Provider,{value:i},r)};function j(t=l){const e=t===l?f:()=>(0,n.useContext)(t);return function(){const{store:t}=e();return t}}const O=j();function _(t=l){const e=t===l?O:j(t);return function(){return e().dispatch}}const S=_();var x,P;x=a.useSyncExternalStoreWithSelector,p=x,(t=>{g=t})(i.useSyncExternalStore),P=c.unstable_batchedUpdates,u=P;var k=r(890);function E(t){return function(e){var r=e.dispatch,n=e.getState;return function(e){return function(o){return"function"==typeof o?o(r,n,t):e(o)}}}}var C=E();C.withExtraArgument=E;const R=C;function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:I,e=arguments.length>1?arguments[1]:void 0;return"cmf/update"===e.type?L(L({},t),{},{title:e.payload.title,version:e.payload.version}):t},auth:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"auth/loggedin":return B(B({},t),{},{isLoggedIn:!0,user:e.payload});case"auth/loggedout":return B(B({},t),{},{isLoggedIn:!1,user:null});default:return t}},location:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"location/refresh":return H(H({},t),{},{refresh:!0});case"location/stop-refresh":return H(H({},t),{},{refresh:!1});case"location/update":var r=H(H({},t.current),e.payload);return H(H({},t),{},{previous:H({},t.current),current:H({},r)});default:return t}},media:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ut,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"media/init":return at(at({},t),{},{isInitialised:!0,directory:e.payload.directory,path:e.payload.path,directories:e.payload.directories,files:e.payload.files});case"media/path/update":return at(at({},t),{},{path:e.payload});case"media/directory/update":return at(at({},t),{},{directory:e.payload});case"media/directories/move":return t.directory&&t.directory.id!==e.moveToId||!t.directory&&e.moveToId?at(at({},t),{},{directories:t.directories.filter((function(t){return!e.directoryIds.includes(t.id)}))}):at({},t);case"media/directories/update":return at(at({},t),{},{directories:e.payload});case"media/directories/rename":var r=nt(t.directories).map((function(t){return at(at({},t),{},{name:t.id===e.payload.id?e.payload.name:t.name})}));return at(at({},t),{},{directories:r});case"media/directories/delete":return at(at({},t),{},{directories:t.directories.filter((function(t){return!e.directoryIds.includes(t.id)}))});case"media/directories/add":return at(at({},t),{},{directories:[].concat(nt(t.directories),[e.payload]).sort((function(t,e){return t.name.toLowerCase()>e.name.toLowerCase()?1:-1}))});case"media/files/label":var n=nt(t.files).map((function(t){return at(at({},t),{},{label:t.id===e.fileId?e.label:t.label})}));return at(at({},t),{},{files:n});case"media/files/changeProperties":var o=nt(t.files).map((function(t){return t[e.property]=e.fileIds.includes(t.id)?e.value:t[e.property],t}));return at(at({},t),{},{files:o});case"media/files/changeProperty":var i=nt(t.files).map((function(t){return t[e.property]=t.id===e.fileId?e.value:t[e.property],t}));return at(at({},t),{},{files:i});case"media/files/delete":return at(at({},t),{},{files:t.files.filter((function(t){return!e.fileIds.includes(t.id)}))});case"media/files/add":return at(at({},t),{},{files:[].concat(nt(t.files),[e.payload])});case"media/files/move":return t.directory&&t.directory.id!==e.moveToId||!t.directory&&e.moveToId?at(at({},t),{},{files:t.files.filter((function(t){return!e.fileIds.includes(t.id)}))}):at({},t);case"media/files/rename":var a=nt(t.files).map((function(t){return at(at({},t),{},{name:t.id===e.payload.id?e.payload.name:t.name})}));return at(at({},t),{},{files:a});case"media/files/update":return at(at({},t),{},{files:e.payload});case"media/view/update":return at(at({},t),{},{viewMode:e.payload});default:return t}},modules:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y,e=arguments.length>1?arguments[1]:void 0;return"modules/update"===e.type?V(V({},t),{},{all:e.payload.all,primary:e.payload.primary,secondary:e.payload.secondary}):t},language:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:et,e=arguments.length>1?arguments[1]:void 0;return"language/update"===e.type?X(X({},t),{},{language:e.payload}):t}});const lt=st;const ft={get:function(t){var e=document.querySelector('meta[name="'+t+'"]');return e?e.getAttribute("content"):null}},pt={get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=window.localStorage.getItem(t);return r||null===e?r:e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},clear:function(){window.localStorage.clear()}};var dt=function(){for(var t=arguments.length,e=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=t.split("."),n=window.i18n,o=0;o1&&void 0!==arguments[1]?arguments[1]:null,r=document.createElement("button");return r.setAttribute("type","button"),r.classList.add("button"),r.textContent=t,e&&r.addEventListener("click",e),r},i18nNotify:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.notify(mt.get(t,e))},notify:function(t){var e=this;this.notificationStackEl||(this.notificationStackEl=document.createElement("div"),this.notificationStackEl.classList.add("notification-stack"),document.body.appendChild(this.notificationStackEl));var r=document.createElement("div");r.classList.add("notification"),r.textContent=bt.toUpperCaseFirst(t),this.notificationStackEl.appendChild(r),setTimeout((function(){r.classList.add("notification--hidden"),setTimeout((function(){return e.notificationStackEl.removeChild(r)}),250)}),3e3)},copyText:function(t,e){var r=document.createElement("textarea");r.value=t,r.style.top=0,r.style.left=0,r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")&&e()}catch(t){console.error("Fallback: Oops, unable to copy text to clipboard",t)}document.body.removeChild(r)}};var gt=r(379),wt=r.n(gt),jt=r(709),Ot={insert:"head",singleton:!1};wt()(jt.Z,Ot);jt.Z.locals;const _t={scrollTop:function(){document.body.scrollTop=0,document.documentElement.scrollTop=0},className:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return t;if("string"==typeof e&&(e=[e]),!e.length)return t;var r=" "+t+"--";return t+(e?r+e.join(r):"")},shallowEqual:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=0,i=r;ot.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function se(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}const le={path:ft.get("cmf:path"),currentPath:{},history:[],parseLocation:function(t){var e="/"+this.path+"/",r=t.search,n=new URLSearchParams(r),o=Object.fromEntries(n),i=t.pathname,a=(i.startsWith(e)?i.slice(e.length):"").split("/");return{module:a[0],action:a[1],params:o}},update:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ht.dispatch({type:"location/update",payload:{module:t,action:e,params:r}})},goTo:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=ae.query(r),i="".concat(this.path,"/").concat(t,"/").concat(e)+(o?"?"+o:"");n?window.open(i):(window.history.pushState({},"",i),this.history.push({module:t,action:e,params:r}),this.update(t,e,r))},refresh:function(){ht.dispatch(function(){var t=function(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){se(i,n,o,a,c,"next",t)}function c(t){se(i,n,o,a,c,"throw",t)}a(void 0)}))}}(ue().mark((function t(e){return ue().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e({type:"location/refresh"});case 2:e({type:"location/stop-refresh"});case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},goBack:function(){var t=this.history[this.history.length-2],e=t.module,r=t.action,n=t.params;this.goTo(e,r,n)},handleRedirect:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.refresh?this.refresh():t.redirectBack?this.goBack():t.redirect&&this.goTo(t.path.module,t.redirect,e)}};function fe(t){var e=y((function(t){return t.modules.primary})),r=function(e){t.onModuleSwitch&&t.onModuleSwitch(),le.goTo(e.id,"index")},o=function(t,e){"open"===t?r(e):"open_new"===t&&window.open(e.url)},i=function(e){if(t.activeModule&&t.activeModule.id===e.id)return!0;for(var r=0;r{const e=xr.call(t);return Er[e]||(Er[e]=e.slice(8,-1).toLowerCase())});var Er;const Cr=t=>(t=t.toLowerCase(),e=>kr(e)===t),Rr=t=>e=>typeof e===t,{isArray:Tr}=Array,Nr=Rr("undefined");const Lr=Cr("ArrayBuffer");const Dr=Rr("string"),Ir=Rr("function"),Ar=Rr("number"),Fr=t=>null!==t&&"object"==typeof t,Br=t=>{if("object"!==kr(t))return!1;const e=Pr(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},Ur=Cr("Date"),Mr=Cr("File"),Gr=Cr("Blob"),zr=Cr("FileList"),Vr=Cr("URLSearchParams");function qr(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),Tr(t))for(n=0,o=t.length;n0;)if(n=r[o],e===n.toLowerCase())return n;return null}const Wr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,$r=t=>!Nr(t)&&t!==Wr;const Hr=(Kr="undefined"!=typeof Uint8Array&&Pr(Uint8Array),t=>Kr&&t instanceof Kr);var Kr;const Zr=Cr("HTMLFormElement"),Jr=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Qr=Cr("RegExp"),Xr=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};qr(r,((r,o)=>{!1!==e(r,o,t)&&(n[o]=r)})),Object.defineProperties(t,n)},tn="abcdefghijklmnopqrstuvwxyz",en="0123456789",rn={DIGIT:en,ALPHA:tn,ALPHA_DIGIT:tn+tn.toUpperCase()+en};const nn={isArray:Tr,isArrayBuffer:Lr,isBuffer:function(t){return null!==t&&!Nr(t)&&null!==t.constructor&&!Nr(t.constructor)&&Ir(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||xr.call(t)===e||Ir(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&Lr(t.buffer),e},isString:Dr,isNumber:Ar,isBoolean:t=>!0===t||!1===t,isObject:Fr,isPlainObject:Br,isUndefined:Nr,isDate:Ur,isFile:Mr,isBlob:Gr,isRegExp:Qr,isFunction:Ir,isStream:t=>Fr(t)&&Ir(t.pipe),isURLSearchParams:Vr,isTypedArray:Hr,isFileList:zr,forEach:qr,merge:function t(){const{caseless:e}=$r(this)&&this||{},r={},n=(n,o)=>{const i=e&&Yr(r,o)||o;Br(r[i])&&Br(n)?r[i]=t(r[i],n):Br(n)?r[i]=t({},n):Tr(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t(qr(e,((e,n)=>{r&&Ir(e)?t[n]=Sr(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,a;const c={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],n&&!n(a,t,e)||c[a]||(e[a]=t[a],c[a]=!0);t=!1!==r&&Pr(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:kr,kindOfTest:Cr,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(Tr(t))return t;let e=t.length;if(!Ar(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:Zr,hasOwnProperty:Jr,hasOwnProp:Jr,reduceDescriptors:Xr,freezeMethods:t=>{Xr(t,((e,r)=>{if(Ir(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];Ir(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return Tr(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:Yr,global:Wr,isContextDefined:$r,ALPHABET:rn,generateString:(t=16,e=rn.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&Ir(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(Fr(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=Tr(t)?[]:{};return qr(t,((t,e)=>{const i=r(t,n+1);!Nr(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)}};function on(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}nn.inherits(on,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:nn.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const an=on.prototype,cn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{cn[t]={value:t}})),Object.defineProperties(on,cn),Object.defineProperty(an,"isAxiosError",{value:!0}),on.from=(t,e,r,n,o,i)=>{const a=Object.create(an);return nn.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),on.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const un=on,sn=null;var ln=r(764).lW;function fn(t){return nn.isPlainObject(t)||nn.isArray(t)}function pn(t){return nn.endsWith(t,"[]")?t.slice(0,-2):t}function dn(t,e,r){return t?t.concat(e).map((function(t,e){return t=pn(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const hn=nn.toFlatObject(nn,{},null,(function(t){return/^is[A-Z]/.test(t)}));const yn=function(t,e,r){if(!nn.isObject(t))throw new TypeError("target must be an object");e=e||new(sn||FormData);const n=(r=nn.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!nn.isUndefined(e[t])}))).metaTokens,o=r.visitor||s,i=r.dots,a=r.indexes,c=(r.Blob||"undefined"!=typeof Blob&&Blob)&&nn.isSpecCompliantForm(e);if(!nn.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(nn.isDate(t))return t.toISOString();if(!c&&nn.isBlob(t))throw new un("Blob is not supported. Use a Buffer instead.");return nn.isArrayBuffer(t)||nn.isTypedArray(t)?c&&"function"==typeof Blob?new Blob([t]):ln.from(t):t}function s(t,r,o){let c=t;if(t&&!o&&"object"==typeof t)if(nn.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(nn.isArray(t)&&function(t){return nn.isArray(t)&&!t.some(fn)}(t)||(nn.isFileList(t)||nn.endsWith(r,"[]"))&&(c=nn.toArray(t)))return r=pn(r),c.forEach((function(t,n){!nn.isUndefined(t)&&null!==t&&e.append(!0===a?dn([r],n,i):null===a?r:r+"[]",u(t))})),!1;return!!fn(t)||(e.append(dn(o,r,i),u(t)),!1)}const l=[],f=Object.assign(hn,{defaultVisitor:s,convertValue:u,isVisitable:fn});if(!nn.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!nn.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),nn.forEach(r,(function(r,i){!0===(!(nn.isUndefined(r)||null===r)&&o.call(e,r,nn.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function mn(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function bn(t,e){this._pairs=[],t&&yn(t,this,e)}const vn=bn.prototype;vn.append=function(t,e){this._pairs.push([t,e])},vn.toString=function(t){const e=t?function(e){return t.call(this,e,mn)}:mn;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const gn=bn;function wn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function jn(t,e,r){if(!e)return t;const n=r&&r.encode||wn,o=r&&r.serialize;let i;if(i=o?o(e,r):nn.isURLSearchParams(e)?e.toString():new gn(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const On=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){nn.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},_n={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Sn="undefined"!=typeof URLSearchParams?URLSearchParams:gn,xn=FormData,Pn=(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),kn="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,En={isBrowser:!0,classes:{URLSearchParams:Sn,FormData:xn,Blob},isStandardBrowserEnv:Pn,isStandardBrowserWebWorkerEnv:kn,protocols:["http","https","file","blob","url","data"]};const Cn=function(t){function e(t,r,n,o){let i=t[o++];const a=Number.isFinite(+i),c=o>=t.length;if(i=!i&&nn.isArray(n)?n.length:i,c)return nn.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a;n[i]&&nn.isObject(n[i])||(n[i]=[]);return e(t,r,n[i],o)&&nn.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n{e(function(t){return nn.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},Rn={"Content-Type":void 0};const Tn={transitional:_n,adapter:["xhr","http"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=nn.isObject(t);o&&nn.isHTMLForm(t)&&(t=new FormData(t));if(nn.isFormData(t))return n&&n?JSON.stringify(Cn(t)):t;if(nn.isArrayBuffer(t)||nn.isBuffer(t)||nn.isStream(t)||nn.isFile(t)||nn.isBlob(t))return t;if(nn.isArrayBufferView(t))return t.buffer;if(nn.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return yn(t,new En.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return En.isNode&&nn.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=nn.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return yn(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(nn.isString(t))try{return(e||JSON.parse)(t),nn.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Tn.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(t&&nn.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw un.from(t,un.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:En.classes.FormData,Blob:En.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};nn.forEach(["delete","get","head"],(function(t){Tn.headers[t]={}})),nn.forEach(["post","put","patch"],(function(t){Tn.headers[t]=nn.merge(Rn)}));const Nn=Tn,Ln=nn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Dn=Symbol("internals");function In(t){return t&&String(t).trim().toLowerCase()}function An(t){return!1===t||null==t?t:nn.isArray(t)?t.map(An):String(t)}function Fn(t,e,r,n){return nn.isFunction(n)?n.call(this,e,r):nn.isString(e)?nn.isString(n)?-1!==e.indexOf(n):nn.isRegExp(n)?n.test(e):void 0:void 0}class Bn{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=In(e);if(!o)throw new Error("header name must be a non-empty string");const i=nn.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=An(t))}const i=(t,e)=>nn.forEach(t,((t,r)=>o(t,r,e)));return nn.isPlainObject(t)||t instanceof this.constructor?i(t,e):nn.isString(t)&&(t=t.trim())&&!function(t){return/^[-_a-zA-Z]+$/.test(t.trim())}(t)?i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&Ln[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e):null!=t&&o(e,t,r),this}get(t,e){if(t=In(t)){const r=nn.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(nn.isFunction(e))return e.call(this,t,r);if(nn.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=In(t)){const r=nn.findKey(this,t);return!(!r||void 0===this[r]||e&&!Fn(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=In(t)){const o=nn.findKey(r,t);!o||e&&!Fn(0,r[o],o,e)||(delete r[o],n=!0)}}return nn.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!Fn(0,this[o],o,t)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return nn.forEach(this,((n,o)=>{const i=nn.findKey(r,o);if(i)return e[i]=An(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete e[o],e[a]=An(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return nn.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&nn.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[Dn]=this[Dn]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=In(t);e[n]||(!function(t,e){const r=nn.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return nn.isArray(t)?t.forEach(n):n(t),this}}Bn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),nn.freezeMethods(Bn.prototype),nn.freezeMethods(Bn);const Un=Bn;function Mn(t,e){const r=this||Nn,n=e||r,o=Un.from(n.headers);let i=n.data;return nn.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Gn(t){return!(!t||!t.__CANCEL__)}function zn(t,e,r){un.call(this,null==t?"canceled":t,un.ERR_CANCELED,e,r),this.name="CanceledError"}nn.inherits(zn,un,{__CANCEL__:!0});const Vn=zn;const qn=En.isStandardBrowserEnv?{write:function(t,e,r,n,o,i){const a=[];a.push(t+"="+encodeURIComponent(e)),nn.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),nn.isString(n)&&a.push("path="+n),nn.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Yn(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Wn=En.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=nn.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0};const $n=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(c){const u=Date.now(),s=n[a];o||(o=u),r[i]=c,n[i]=u;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),u-o{const i=o.loaded,a=o.lengthComputable?o.total:void 0,c=i-r,u=n(c);r=i;const s={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:o};s[e?"download":"upload"]=!0,t(s)}}const Kn="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){let n=t.data;const o=Un.from(t.headers).normalize(),i=t.responseType;let a;function c(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}nn.isFormData(n)&&(En.isStandardBrowserEnv||En.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let u=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",r=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+r))}const s=Yn(t.baseURL,t.url);function l(){if(!u)return;const n=Un.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new un("Request failed with status code "+r.status,[un.ERR_BAD_REQUEST,un.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}((function(t){e(t),c()}),(function(t){r(t),c()}),{data:i&&"text"!==i&&"json"!==i?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u}),u=null}if(u.open(t.method.toUpperCase(),jn(s,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(new un("Request aborted",un.ECONNABORTED,t,u)),u=null)},u.onerror=function(){r(new un("Network Error",un.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const n=t.transitional||_n;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(new un(e,n.clarifyTimeoutError?un.ETIMEDOUT:un.ECONNABORTED,t,u)),u=null},En.isStandardBrowserEnv){const e=(t.withCredentials||Wn(s))&&t.xsrfCookieName&&qn.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===n&&o.setContentType(null),"setRequestHeader"in u&&nn.forEach(o.toJSON(),(function(t,e){u.setRequestHeader(e,t)})),nn.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),i&&"json"!==i&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",Hn(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",Hn(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{u&&(r(!e||e.type?new Vn(null,t,u):e),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const f=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(s);f&&-1===En.protocols.indexOf(f)?r(new un("Unsupported protocol "+f+":",un.ERR_BAD_REQUEST,t)):u.send(n||null)}))},Zn={http:sn,xhr:Kn};nn.forEach(Zn,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Jn={getAdapter:t=>{t=nn.isArray(t)?t:[t];const{length:e}=t;let r,n;for(let o=0;ot instanceof Un?t.toJSON():t;function eo(t,e){e=e||{};const r={};function n(t,e,r){return nn.isPlainObject(t)&&nn.isPlainObject(e)?nn.merge.call({caseless:r},t,e):nn.isPlainObject(e)?nn.merge({},e):nn.isArray(e)?e.slice():e}function o(t,e,r){return nn.isUndefined(e)?nn.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!nn.isUndefined(e))return n(void 0,e)}function a(t,e){return nn.isUndefined(e)?nn.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function c(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(t,e)=>o(to(t),to(e),!0)};return nn.forEach(Object.keys(t).concat(Object.keys(e)),(function(n){const i=u[n]||o,a=i(t[n],e[n],n);nn.isUndefined(a)&&i!==c||(r[n]=a)})),r}const ro="1.3.2",no={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{no[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const oo={};no.transitional=function(t,e,r){function n(t,e){return"[Axios v"+ro+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new un(n(o," has been removed"+(e?" in "+e:"")),un.ERR_DEPRECATED);return e&&!oo[o]&&(oo[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}};const io={assertOptions:function(t,e,r){if("object"!=typeof t)throw new un("options must be an object",un.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],a=e[i];if(a){const e=t[i],r=void 0===e||a(e,i,t);if(!0!==r)throw new un("option "+i+" must be "+r,un.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new un("Unknown option "+i,un.ERR_BAD_OPTION)}},validators:no},ao=io.validators;class co{constructor(t){this.defaults=t,this.interceptors={request:new On,response:new On}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=eo(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;let i;void 0!==r&&io.assertOptions(r,{silentJSONParsing:ao.transitional(ao.boolean),forcedJSONParsing:ao.transitional(ao.boolean),clarifyTimeoutError:ao.transitional(ao.boolean)},!1),void 0!==n&&io.assertOptions(n,{encode:ao.function,serialize:ao.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),i=o&&nn.merge(o.common,o[e.method]),i&&nn.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Un.concat(i,o);const a=[];let c=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(c=c&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const u=[];let s;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let l,f=0;if(!c){const t=[Xn.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,u),l=t.length,s=Promise.resolve(e);f{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new Vn(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new so((function(e){t=e})),cancel:t}}}const lo=so;const fo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(fo).forEach((([t,e])=>{fo[e]=t}));const po=fo;const ho=function t(e){const r=new uo(e),n=Sr(uo.prototype.request,r);return nn.extend(n,uo.prototype,r,{allOwnKeys:!0}),nn.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(eo(e,r))},n}(Nn);ho.Axios=uo,ho.CanceledError=Vn,ho.CancelToken=lo,ho.isCancel=Gn,ho.VERSION=ro,ho.toFormData=yn,ho.AxiosError=un,ho.Cancel=ho.CanceledError,ho.all=function(t){return Promise.all(t)},ho.spread=function(t){return function(e){return t.apply(null,e)}},ho.isAxiosError=function(t){return nn.isObject(t)&&!0===t.isAxiosError},ho.mergeConfig=eo,ho.AxiosHeaders=Un,ho.formToJSON=t=>Cn(nn.isHTMLForm(t)?new FormData(t):t),ho.HttpStatusCode=po,ho.default=ho;const yo=ho;function mo(t){return mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mo(t)}function bo(){bo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new x(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function d(){}function h(){}var y={};u(y,i,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(P([])));b&&b!==e&&r.call(b,i)&&(y=b);var v=h.prototype=p.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==mo(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function vo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function go(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n={file:t};return e&&(n.directory=e),_o.post("cmf/api/media/upload",ae.formData(n),{onUploadProgress:r})},So.media.uploadChunk=function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i={status:t,filename:e,chunk:n};return r&&(i.path=r),o&&(i.directory=o),_o.post("cmf/api/media/upload-chunk",ae.formData(i))},So.media.path=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e={};return t&&(e.directory=t),_o.get("cmf/api/media/path",{params:e})},So.media.loadDirectories=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e={};return t&&(e.directory=t),_o.get("cmf/api/media/load-directories",{params:e})},So.media.loadFiles=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e={};return t&&(e.directory=t),_o.get("cmf/api/media/load-files",{params:e})},So.media.createDirectory=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r={name:t};return e&&(r.directory=e),_o.post("cmf/api/media/create-directory",r)},So.media.renameDirectory=function(t,e){return _o.post("cmf/api/media/rename-directory",{name:t,directory:e})},So.media.deleteDirectory=function(t){return _o.post("cmf/api/media/delete-directory",{directory:t})},So.media.moveDirectory=function(t,e){return _o.post("cmf/api/media/move-directory",{directory:t,id:e})},So.media.renameFile=function(t,e){return _o.post("cmf/api/media/rename-file",{name:t,file:e})},So.media.deleteFile=function(t){return _o.post("cmf/api/media/delete-file",{file:t})},So.media.deleteFiles=function(t){return _o.post("cmf/api/media/delete-files",{files:JSON.stringify(t)})},So.media.labelFile=function(t,e){return _o.post("cmf/api/media/label-file",{label:t,file:e})},So.media.updateFileDescription=function(t,e){return _o.post("cmf/api/media/update-file-description",{description:t,file:e})},So.media.updateFileCopyright=function(t,e){return _o.post("cmf/api/media/update-file-copyright",{copyright:t,file:e})},So.media.updateFileVisibility=function(t,e){return _o.post("cmf/api/media/update-file-visibility",{visibility:t,file:e})},So.media.updateFilesDescription=function(t,e){return _o.post("cmf/api/media/update-files-description",{description:t,files:JSON.stringify(e)})},So.media.updateFilesCopyright=function(t,e){return _o.post("cmf/api/media/update-files-copyright",{copyright:t,files:JSON.stringify(e)})},So.media.moveFile=function(t,e){return _o.post("cmf/api/media/move-file",{directory:t,file:e})},So.media.moveFiles=function(t,e){return _o.post("cmf/api/media/move-files",{directory:t,files:JSON.stringify(e)})},So.modules.index=function(){return _o.get("cmf/api/modules")},So.modules.action=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _o.get("cmf/api/modules/".concat(t.module,"/").concat(t.action),{params:e})},So.modules.get=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return _o.get("cmf/api/modules/".concat(t.module,"/").concat(t.action,"/").concat(e),{params:r})},So.modules.post=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return _o.post("cmf/api/modules/".concat(t.module,"/").concat(t.action,"/").concat(e),ae.formData(r))},So.execute.get=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return _o.get("cmf/api/modules/".concat(t.module,"/").concat(t.action,"/").concat(e,"/").concat(r),{params:n})},So.execute.post=function(t,e,r,n){return _o.post("cmf/api/modules/".concat(t.module,"/").concat(t.action,"/").concat(e,"/").concat(r),ae.formData(n))};const xo=So;function Po(t){return Po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Po(t)}function ko(t,e){for(var r=0;r1&&void 0!==arguments[1])||arguments[1])&&(Ci.set(t),Ei.trigger("language.switch",{id:this.props.id,prevLanguage:this.state.language,language:t})),this.setState({language:t})}},{key:"renderLanguageSwitcher",value:function(){var t=this;return this.props.languages.map((function(e){return(0,St.jsx)("button",{type:"button",onClick:function(r){return t.switchLanguage(e)},className:"translatable__button"+(e===t.state.language?" translatable__button--active":""),children:e},e)}))}},{key:"render",value:function(){return(0,St.jsxs)("div",{className:"translatable",id:"language-"+this.props.id,children:[(0,St.jsx)("div",{className:"translatable__tabs",children:this.renderLanguageSwitcher()}),this.renderTranslatedComponents()]})}}],r&&Li(e.prototype,r),n&&Li(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(n.Component);Fi(Ui,"defaultProps",{id:null,components:[],path:{},data:{},languages:[],errors:{}});const Mi=Ui;function Gi(t){return Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(t)}function zi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Vi(t){for(var e=1;e5&&(t=(0,St.jsx)("div",{className:"select__search",children:(0,St.jsx)(ua,{debounce:100,onSearch:function(t){return e.search(t)}})})),(0,St.jsxs)("div",{className:"select__dropdown",children:[t,(0,St.jsx)("div",{className:"select__list",children:(0,St.jsx)(Ji,{nullable:this.props.nullable,multiple:this.props.multiple,defaultValues:this.props.multiple?this.state.value:[this.state.value],options:this.state.isSearching?this.state.searchResults:this.props.options,onChange:function(t){return e.handleSelectionChange(t)}})}),this.renderDropdownChildren()]})):null}},{key:"render",value:function(){var t,e=this;return t=this.props.multiple?this.state.value.length?this.state.value.map((function(t){return e.props.options[t]})).join(", "):this.props.nullText:this.props.options[this.state.value]?this.props.options[this.state.value]:this.props.nullText,(0,St.jsxs)("div",{className:"select",ref:this.selectRef,children:[(0,St.jsxs)("div",{className:"select__field",onClick:this.toggle.bind(this),children:[(0,St.jsx)("div",{className:"select__value",children:t}),(0,St.jsx)("div",{className:"select__icon",children:(0,St.jsx)(ee,{name:this.state.isOpen?this.props.closeIcon:this.props.openIcon})})]}),this.renderDropdown()]})}}],r&&fa(e.prototype,r),o&&fa(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=ma(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(ba,"defaultProps",{options:{},multiple:!1,value:"",search:!0,nullable:!1,nullText:"",onChange:function(t){},openIcon:"expand_more",closeIcon:"expand_less"});const va=ba;function ga(t){return ga="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ga(t)}function wa(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;xo.execute.get(this.props.path,this.props.id,"load",this.props.path.params).then((function(r){var n=r.data.data,o={};n.forEach((function(e){return o[e.id]=e[t.props.titleColumn]}));var i=n.length?n[0].id:"",a=t.state.value?t.state.value:t.props.nullable?"":i;t.setState({value:a,options:o},(function(){e&&e()}))}))}},{key:"handleChange",value:function(t){this.setState({value:t})}},{key:"open",value:function(){this.setState({isOpen:!0})}},{key:"close",value:function(){this.setState({isOpen:!1})}},{key:"create",value:function(t){var e=this;xo.execute.post(this.props.path,this.props.id,"create",t).then((function(t){e.createFormRef.current.ready(),e.load((function(){e.setState({isOpen:!1,value:t.data.data.id})})),vt.notify(mt.get("snippets.singular_created_selected",{singular:e.props.singular}))}),(function(t){var r=t.response;e.createFormRef.current.ready(),e.setState({createFormErrors:r.data.errors}),vt.notify(r.data.message)}))}},{key:"renderSidebarComponents",value:function(){return iv.renderComponents(this.props.sidebarComponents,{},this.props.path)}},{key:"renderCreateComponents",value:function(){return iv.renderComponents(this.props.createComponents,{},this.props.path)}},{key:"renderCreateWidget",value:function(){return this.state.isOpen?(0,St.jsx)(No,{children:(0,St.jsx)(Ho,{title:mt.get("snippets.new_singular",{singular:this.props.singular}),style:"modal",closeable:!0,onClose:this.close.bind(this),children:(0,St.jsx)(ii,{ref:this.createFormRef,errors:this.state.createFormErrors,realForm:!1,onSubmit:this.create.bind(this),submitButtonText:mt.get("snippets.create_singular",{singular:this.props.singular}),sidebar:this.renderSidebarComponents(),children:this.renderCreateComponents()})})}):null}},{key:"renderCreate",value:function(){return this.props.create?(0,St.jsx)("div",{className:"belongs-to-field__btn",children:(0,St.jsx)(ar,{icon:"add",style:["full","small","secondary"],text:mt.get("snippets.new_singular",{singular:this.props.singular}),onClick:this.open.bind(this)})}):null}},{key:"render",value:function(){var t=this;return(0,St.jsxs)(Ee,{name:this.props.name,label:this.props.label,tooltip:this.props.tooltip,children:[(0,St.jsx)("div",{className:"belongs-to-field",children:(0,St.jsx)("div",{className:"belongs-to-field__field",children:(0,St.jsx)(va,{nullable:this.props.nullable,nullText:"– "+mt.get("snippets.no_singular_selected",{singular:this.props.singular})+" –",options:this.state.options,value:this.state.value,onChange:function(e){return t.handleChange(e)},children:this.renderCreate()})})}),this.renderCreateWidget()]})}}],r&&Hu(e.prototype,r),o&&Hu(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=Qu(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Xu,"defaultProps",{data:{},label:"",name:"",titleColumn:"",nullable:!1,plural:"",singular:"",tooltip:"",create:!1,createComponents:[],sidebarComponents:[]});const ts=Xu;function es(t){return es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},es(t)}function rs(t,e){for(var r=0;rA2');var n=e.querySelector(".trix-button-group--block-tools");n&&n.remove();var o=e.querySelector(".trix-button-group--file-tools");o&&o.remove()}},{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){}},{key:"componentDidUpdate",value:function(t){this.props.data[this.props.name]!==t.data[this.props.name]&&this.setState({redrawKey:this.state.redrawKey+1,value:this.props.data[this.props.name]||""})}},{key:"handleChange",value:function(t,e){this.setState({value:t})}},{key:"handleSubmit",value:function(t){t[this.props.name]=this.state.value||""}},{key:"getData",value:function(t){return t[this.props.name]=this.state.value||"",t}},{key:"render",value:function(){return(0,St.jsx)(Ee,{name:this.props.name,label:this.props.label,tooltip:this.props.tooltip,children:(0,St.jsx)("div",{className:"richtext-field",children:(0,St.jsx)(fs.TrixEditor,{value:this.props.data[this.props.name]||"",onChange:this.handleChange.bind(this),onEditorReady:this.handleEditorReady.bind(this)},this.state.redrawKey)})})}}])&&hs(e.prototype,r),n&&hs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(n.Component);function ws(t){return ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ws(t)}function js(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rr?"left":"right",t.clientY>e?"up":"down")}}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"right",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"down";this.setState({isOpen:!0,dropDirectionX:e,dropDirectionY:r},(function(){t.bindDocumentClick()}))}},{key:"close",value:function(){var t=this;this.setState({isOpen:!1},(function(){t.unbindDocumentClick()}))}},{key:"onContentClick",value:function(t){t.target.classList.contains("dropdown__content")||this.close()}},{key:"render",value:function(){var t=(0,St.jsx)(ar,{stopPropagation:this.props.stopPropagation,text:this.props.text,label:this.props.label,style:[].concat(cl(this.props.style),["small"]),onClick:this.toggle.bind(this),icon:this.state.isOpen?this.props.closeIcon:this.props.openIcon});return this.props.text||(t=(0,St.jsx)(Mo,{stopPropagation:this.props.stopPropagation,name:this.state.isOpen?this.props.closeIcon:this.props.openIcon,iconStyle:"small",onClick:this.toggle.bind(this)})),(0,St.jsxs)("div",{className:_t.className("dropdown",this.props.style)+(this.state.isOpen?" dropdown--open":"")+" dropdown--"+this.state.dropDirectionX+" dropdown--"+this.state.dropDirectionY,ref:this.dropdownRef,children:[(0,St.jsx)("div",{className:"dropdown__trigger",children:t}),(0,St.jsx)("div",{className:"dropdown__content",onClick:this.onContentClick.bind(this),children:this.props.children})]})}}],r&&sl(e.prototype,r),o&&sl(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=hl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(yl,"defaultProps",{label:"",text:"",style:[],autoClose:!1,openIcon:"expand_more",closeIcon:"expand_less",stopPropagation:!0});const ml=yl;function bl(t){return function(t){if(Array.isArray(t))return vl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return vl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vl(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ul(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Ml(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ul(i,n,o,a,c,"next",t)}function c(t){Ul(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Gl(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;this.props.onDirectoryClick(t)}},{key:"load",value:(i=Ml(Bl().mark((function t(){var e=this;return Bl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,xo.media.loadDirectories(this.props.directory).then((function(t){e.setState({directories:t.data.data})}));case 2:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"loadChildren",value:(o=Ml(Bl().mark((function t(e){var r=this;return Bl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,xo.media.loadDirectories(e).then((function(t){var n=r.state.directoriesMap;n[e]=t.data.data,r.setState({directoriesMap:n})}));case 2:case"end":return t.stop()}}),t)}))),function(t){return o.apply(this,arguments)})},{key:"toggleCollapse",value:function(t){if(this.state.directoriesMap[t]){var e=this.state.directoriesMap;delete e[t],this.setState({directoriesMap:e})}else this.loadChildren(t)}},{key:"renderChildren",value:function(t){var e=this;return this.state.directoriesMap[t]?this.state.directoriesMap[t].map((function(t){return e.renderDirectory(t)})):null}},{key:"renderDirectory",value:function(t){var e=this;return(0,St.jsxs)("div",{className:"directory-tree__item",children:[(0,St.jsx)(Al,{icon:"folder",text:t.name,style:this.props.selectedDirectory===t.id?"selected":"default",onToggle:function(){return e.toggleCollapse(t.id)},onClick:function(){return e.select(t.id)}}),(0,St.jsx)("div",{className:"directory-tree__children",children:this.renderChildren(t.id)})]},t.id)}},{key:"render",value:function(){var t=this;return this.state.directories.length?(0,St.jsxs)("div",{className:"directory-tree",children:[(0,St.jsx)(Al,{icon:"home",text:mt.get("snippets.files_root"),style:null===this.props.selectedDirectory?"selected":"default",collapsible:!1,onClick:function(){return t.select()}}),this.state.directories.map((function(e){return t.renderDirectory(e)}))]}):null}}],r&&Gl(e.prototype,r),n&&Gl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),c}(n.Component);!function(t,e,r){(e=Yl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Wl,"defaultProps",{directory:null,selectedDirectory:null,onDirectoryClick:function(t){}});const $l=Wl;function Hl(t){return Hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hl(t)}function Kl(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r186?"#000000":"#ffffff"};function Of(t){return Of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Of(t)}function _f(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(e=[[mt.get("snippets.move_files",{amount:this.props.selectedFileIds.length}),"multi-move"],[mt.get("snippets.delete_files",{amount:this.props.selectedFileIds.length}),"multi-delete"]]),(0,St.jsx)(Lf,{files:this.state.files,fileLabels:this.props.fileLabels,selection:this.props.selectedFileIds,selectionMode:this.props.selectionMode,contextMenuLinks:e,onClick:function(e,r){return t.handleFileClick(e,r)},onContextClick:function(e,r){return t.onFileContextClick(e,r)}})}},{key:"renderDirectories",value:function(){var t=this;return this.props.directories.length?(0,St.jsx)(St.Fragment,{children:(0,St.jsx)(Ff,{directories:this.props.directories,contextMenuLinks:[[mt.get("snippets.rename"),"rename"],[mt.get("snippets.move"),"move"],[mt.get("snippets.delete"),"delete"]],onContextClick:function(e,r){return t.onDirectoryContextClick(e,r)},onClick:function(e,r){return t.props.onDirectoryClick(r.id)}})}):null}},{key:"renderContent",value:function(){return this.state.uploads.length||this.props.directories.length||this.state.files.length?(0,St.jsxs)("div",{className:"file-browser__content",children:[this.renderUploads(),this.renderDirectories(),this.renderFiles()]}):(0,St.jsx)("div",{className:"file-browser__content",children:(0,St.jsx)("div",{className:"file-browser__placeholder",children:(0,St.jsx)(Nu,{children:mt.get("snippets.directory_is_empty")})})})}},{key:"render",value:function(){return(0,St.jsxs)("div",{className:"file-browser",children:[this.renderContent(),this.renderMoveWidget()]})}}],r&&Gf(e.prototype,r),n&&Gf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(n.Component);!function(t,e,r){(e=Wf(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}($f,"defaultProps",{files:[],directories:[],currentDirectory:null,fileLabels:{},selectionMode:!1,selectedFileIds:[],selectedFiles:[],onDirectoryClick:function(t){},onFileClick:function(t){},onDirectoryDelete:function(t){},onDirectoryRename:function(t,e){},onDirectoryMove:function(t,e){},onFileDelete:function(t){},onFileRename:function(t){},onFileMove:function(t,e){},onFileOpen:function(t){},onSelectionChange:function(t,e){},onSelectionDelete:function(t,e){},onSelectionMove:function(t,e){}});const Hf=$f;var Kf=r(195),Zf={insert:"head",singleton:!1};wt()(Kf.Z,Zf);Kf.Z.locals;function Jf(t){return Jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(t)}function Qf(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:function(){},n=[],o=0;o2&&void 0!==arguments[2]?arguments[2]:function(){};up++,cp.push([up,t,e,r]),Ei.trigger("media.upload.queued",{id:up,size:t.size,filename:t.name}),ap||this.process()},process:function(){var t=this;if(cp.length){ap=!0;var e=cp[0];this.processChunkUpload(e[1],e[2],(function(t){Ei.trigger("media.upload.start",{id:e[0],size:e[1].size,filename:t})}),(function(t){Ei.trigger("media.upload.progress",{id:e[0],progress:t})}),(function(r){ap=!1,cp.shift(),t.process(),Ei.trigger("media.upload.success",{id:e[0],file:r}),e[3](r)}),(function(){Ei.trigger("media.upload.fail",{id:e[0]}),ap=!1,cp.shift(),t.process()}))}},isDone:function(){return 0===cp.length},processChunkUpload:function(t,e,r,n,o,i){var a,c,u,s=524288,l=Math.ceil(t.size/s),f=0,p=t.name;!function d(){(c=f*s)>t.size&&(c=u+1),u=c+s>=t.size?t.size:c+s;var h=0===f?"start":f===l?"end":"progress";"start"===h&&r(p),xo.media.uploadChunk(h,p,a||null,t.slice(c,u),e).then((function(t){var e=t.data;("created"===e.status&&(a=e.path),++f<=l)?(n(f/l*100),d()):o(e.data)}),(function(t){i()}))}()}};function lp(t){var e=function(e){sp.queueMultiple(e,t.directory,(function(e){t.onFileUploaded(e),sp.isDone()&&t.onUploadDone()}))};return(0,St.jsxs)("div",{className:"file-uploader",children:[(0,St.jsx)("div",{className:"file-uploader__input",children:(0,St.jsx)("input",{type:"file",name:"file-uploader",multiple:!0,onChange:function(t){e(t.target.files)}.bind(this)})}),(0,St.jsx)("div",{className:"file-uploader__placeholder",children:(0,St.jsx)(Nu,{children:mt.get("snippets.select_files_from_computer")})})]})}lp.defaultProps={directory:null,onUploadDone:function(){},onFileUploaded:function(t){}};const fp=lp;function pp(t){return pp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pp(t)}function dp(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;t.isFile?t.file((function(t){".DS_Store"!==t.name&&e.upload(t,r)})):t.isDirectory&&xo.media.createDirectory(t.name,r).then((function(r){var n=r.data.data;e.props.onCreateDirectory(n),t.createReader().readEntries((function(t){for(var r=0;r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function qp(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Yp(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){qp(i,n,o,a,c,"next",t)}function c(t){qp(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Wp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $p(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==n[0]?n[0]:null,t.next=3,yo.all([xo.media.path(e),xo.media.loadDirectories(e),xo.media.loadFiles(e)]).then(yo.spread((function(t,e,n){var a=t.data.data,c=e.data.data,u=n.data.data,s=a[a.length-1];i({type:"media/init",payload:{directory:s,path:a,directories:c,files:u}}),o($p($p({},r),{},{isLoading:!1}))})));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),d=function(e,n){o($p($p({},r),{},{selectedFileIds:e,selectedFiles:n})),t.onSelectionChange(e,n)},h=function(){t.onSelectionConfirm(r.selectedFileIds,r.selectedFiles)},m=function(t){var e=r.selectedFileIds.filter((function(e){return e!==t})),n=r.selectedFiles.filter((function(e){return e.id!==t}));o($p($p({},r),{},{selectedFileIds:e,selectedFiles:n}))},b=function(){t.onCancel()},v=function(t){p(t)},g=function(){vt.i18nNotify("snippets.files_uploaded")},w=function(t){!function(t){o($p($p({},r),{},{selectedFileIds:[].concat(zp(r.selectedFileIds),[t.id]),selectedFiles:[].concat(zp(r.selectedFiles),[t])}))}(t),i({type:"media/files/add",payload:t})},j=function(){var t=Yp(Vp().mark((function t(e){var r,n;return Vp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=13;break}return t.prev=1,t.next=4,xo.media.createDirectory(e,s?s.id:null);case 4:r=t.sent,n=r.data.data,vt.i18nNotify("snippets.directory_created"),i({type:"media/directories/add",payload:n}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}(),O=function(){var t=Yp(Vp().mark((function t(e,r){var n,o;return Vp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=13;break}return t.prev=1,t.next=4,xo.media.renameFile(e,r);case 4:n=t.sent,o=n.data.data,i({type:"media/files/rename",payload:o}),vt.i18nNotify("snippets.file_renamed"),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,r){return t.apply(this,arguments)}}(),_=function(){var t=Yp(Vp().mark((function t(e,r){var n,o;return Vp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=13;break}return t.prev=1,t.next=4,xo.media.renameDirectory(e,r);case 4:n=t.sent,o=n.data.data,i({type:"media/directories/rename",payload:o}),vt.i18nNotify("snippets.directory_renamed"),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,r){return t.apply(this,arguments)}}(),x=function(t,e){xo.media.moveFiles(t,e).then((function(t){vt.i18nNotify("snippets.files_moved"),p(s?s.id:null)}),(function(t){vt.i18nNotify("snippets.file_not_moved")}))},P=function(t,e){xo.media.moveFile(t,e).then((function(t){vt.i18nNotify("snippets.file_moved"),p(s?s.id:null)}),(function(t){vt.i18nNotify("snippets.file_not_moved")}))},k=function(){vt.prompt({title:mt.get("snippets.new_directory"),confirmButtonText:mt.get("snippets.confirm"),cancelButtonText:mt.get("snippets.cancel"),confirm:function(t){return j(t)}})},E=function(){var t=[[mt.get("snippets.deselect"),"deselect"],[mt.get("snippets.jump_to_folder"),"jump_to"]];return r.selectedFiles.length?(0,St.jsxs)("div",{className:"file-picker-widget__selection",children:[(0,St.jsxs)("div",{className:"file-picker-widget__selection-header",children:[mt.get("snippets.your_selection")," (",r.selectedFiles.length,")"]}),r.selectedFiles.map((function(e,r){return(0,St.jsx)("div",{className:"file-picker-widget__file",children:(0,St.jsx)(qt,{links:t,onClick:function(t){return function(t,e){"jump_to"===t?p(e.directory?e.directory.id:null):"deselect"===t&&m(e.id)}(t,e)},children:(0,St.jsx)(Tf,{file:e,viewMode:"minimal",actions:[(0,St.jsx)(Mo,{name:"delete",style:"transparent",onClick:function(t){return m(e.id)}},"delete")]})})},r)}))]}):(0,St.jsx)(Nu,{icon:"checklist",children:mt.get("snippets.your_selection_is_empty")})};return(0,St.jsx)(Ho,{style:["modal","wide"],closeable:!0,onClose:b,title:[(0,St.jsx)(ml,{style:["primary","small"],openIcon:"folder",closeIcon:"folder",children:(0,St.jsx)($l,{selectedDirectory:s?s.id:null,onDirectoryClick:function(t){return v(t)}})},"path"),(0,St.jsx)(np,{items:u,onClick:function(t){t?v(t.id):v()}},"breadcrumbs")],actions:[(0,St.jsx)(Mp,{},"view-switcher"),(0,St.jsx)(ar,{text:mt.get("snippets.new_directory"),style:["secondary","small"],onClick:k},"new-dir"),(0,St.jsx)(ml,{text:mt.get("snippets.upload"),style:["primary","small"],children:(0,St.jsx)(fp,{directory:s?s.id:null,onFileUploaded:w,onUploadDone:g})},"upload")],footer:[(0,St.jsx)(ar,{text:mt.get("snippets.cancel"),style:["secondary"],onClick:b},"cancel"),(0,St.jsx)(ar,{text:t.selectionMode?mt.get("snippets.confirm_selection"):mt.get("snippets.select_file"),style:r.selectedFileIds.length?[]:["disabled"],onClick:r.selectedFileIds.length?h:null},"confirm")],children:r.isLoading?null:(0,St.jsx)(vp,{sidebar:E(),children:(0,St.jsx)(Cp,{directory:s?s.id:null,onCreateDirectory:j,onUploadDone:g,children:(0,St.jsx)(Hf,{fileLabels:t.fileLabels,currentDirectory:s,selectionMode:t.selectionMode,selectedFiles:r.selectedFiles,selectedFileIds:r.selectedFileIds,directories:l,files:f,onDirectoryRename:_,onFileRename:O,onFileMove:P,onDirectoryClick:function(t){return v(t)},onSelectionChange:d,onSelectionMove:x})})})})}Qp.defaultProps={multiple:!1,onSelectionChange:function(t,e){},onSelectionConfirm:function(t,e){},onCancel:function(){},defaultDirectoryId:null,defaultSelectedFileIds:[],defaultSelectedFiles:[],selectionMode:!1,fileLabels:{}};const Xp=Qp;function td(t){return td="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},td(t)}function ed(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=this.state.addedBlocks.length-1)){var e=this.syncBlocksData(),r=t+1,n=[e[r],e[t]];e[t]=n[0],e[r]=n[1],this.setState({addedBlocks:e}),vt.notify(mt.get("snippets.order_changed"))}}},{key:"removeBlock",value:function(t,e){var r=this;vt.confirm({title:mt.get("snippets.delete_singular_title",{singular:this.props.singular}),text:mt.get("snippets.delete_singular_text",{singular:this.props.singular}),confirm:function(){var n=r.state.blocksToRemoveById,o=r.state.blocksToRemoveByOrder,i=r.syncBlocksData();i.splice(t,1),e?n.push(e):o.push(t),r.setState({addedBlocks:i,blocksToRemoveById:n,blocksToRemoveByOrder:o}),vt.notify(mt.get("snippets.singular_deleted",{singular:r.props.singular}))}})}},{key:"addBlock",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getBlockDefinition(t),n=this.state.addedBlocks,o={id:null,name:r.name,type:r.type,components:r.components,data:{}};null!==e?(n.splice(e,0,o),vt.notify(mt.get("snippets.singular_inserted",{singular:this.props.singular}))):(n.push(o),vt.notify(mt.get("snippets.singular_added",{singular:this.props.singular}))),this.setState({addedBlocks:n})}},{key:"renderAddBlockDropdown",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Object.getOwnPropertyNames(this.props.blocks);return n.length?1===n.length?t?(0,St.jsx)(ar,{icon:"add",style:["small","secondary"],text:t,stopPropagation:!1,onClick:function(t){return e.addBlock(n[0],r)}}):(0,St.jsx)(Mo,{name:"post_add",iconStyle:"small",stopPropagation:!1,onClick:function(t){return e.addBlock(n[0],r)}}):(0,St.jsx)(ml,{style:["secondary"],autoClose:!0,text:t,openIcon:"post_add",closeIcon:"post_add",children:(0,St.jsx)(It,{stopPropagation:!1,links:this.getTypeLinks(),onClick:function(t){return e.addBlock(t,r)}})},r):null}},{key:"optionDropdownClick",value:function(t,e,r){"delete"===t&&this.removeBlock(e,r)}},{key:"getTypeLinks",value:function(){var t=this;return Object.getOwnPropertyNames(this.props.blocks).map((function(e){return[t.props.blocks[e].name,e]}))}},{key:"getTypeLinksInsertBelow",value:function(){var t=this;return Object.getOwnPropertyNames(this.props.blocks).map((function(e){return[mt.get("snippets.insert_singular_below",{singular:t.props.blocks[e].name}),e]}))}},{key:"renderContentBlocks",value:function(){var t=this;return this.componentLists=[],this.state.addedBlocks.length?this.state.addedBlocks.map((function(e,r){if(!e)return null;var n=iv.renderComponentsWith(e.components,e.data,t.props.path,(function(t,e){return(0,St.jsx)("div",{className:"content-blocks__component",children:t},e)}),!0);return t.componentLists.push([n,e.id,e.type]),(0,St.jsx)("div",{className:"content-blocks__item",children:(0,St.jsx)(Sd,{title:e.name,actions:[(0,St.jsx)(Mo,{style:["transparent",r>0?"enabled":"disabled"],iconStyle:"mini",name:"arrow_upward",onClick:function(e){return t.sortUp(r)}},0),(0,St.jsx)(Mo,{style:["transparent",rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Wd(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function $d(t,e){for(var r=0;re?1:e>t?-1:0})),e.setState({tags:r,isLoading:!1})}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"onCancel",value:function(){this.props.onCancel()}},{key:"onConfirm",value:function(){this.props.onConfirm(this.state.selectedTags)}},{key:"onTagClick",value:function(t){this.setState({selectedTags:[].concat(Vd(this.state.selectedTags),[t])})}},{key:"onSelectedTagClick",value:function(t){var e=this.state.selectedTags.filter((function(e){return e!==t}));this.setState({selectedTags:e})}},{key:"renderContent",value:function(){return this.state.isLoading?null:this.state.tags.length?(this.state.selectedTags.length&&(t=(0,St.jsxs)("div",{className:"tags-browser__selected",children:[(0,St.jsx)("div",{className:"tags-browser__title",children:mt.get("snippets.selected_tags")}),(0,St.jsx)(Gd,{tags:this.state.selectedTags,onClick:this.onSelectedTagClick.bind(this)})]})),this.state.tags.length&&(e=(0,St.jsxs)("div",{className:"tags-browser__available",children:[(0,St.jsx)("div",{className:"tags-browser__title",children:mt.get("snippets.available_tags")}),(0,St.jsx)(Gd,{tags:this.state.tags,onClick:this.onTagClick.bind(this)})]})),(0,St.jsxs)("div",{className:"tags-browser__tags",children:[t,e]})):(0,St.jsx)(Nu,{children:mt.get("snippets.no_tags_available")});var t,e}},{key:"render",value:function(){return(0,St.jsx)(Ho,{style:"modal",title:mt.get("snippets.tags"),closeable:!0,onClose:this.onCancel.bind(this),footer:[(0,St.jsx)(ar,{text:mt.get("snippets.cancel"),style:["secondary"],onClick:this.onCancel.bind(this)},0),(0,St.jsx)(ar,{text:mt.get("snippets.confirm"),onClick:this.onConfirm.bind(this)},1)],children:(0,St.jsx)("div",{className:"tags-browser",children:(0,St.jsx)("div",{className:"tags-browser__content",children:this.renderContent()})})})}}],r&&$d(e.prototype,r),n&&$d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=Jd(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Qd,"defaultProps",{id:0,path:{},selectedTags:[],onCancel:function(){},onConfirm:function(t){}});const Xd=Qd;function th(t){return th="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},th(t)}function eh(t){return function(t){if(Array.isArray(t))return rh(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return rh(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rh(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rh(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:function(){};clearTimeout(this.searchTimeout),t&&this.setState({autosuggestIsOpen:!1,tags:[].concat(eh(this.state.tags),[t])},e)}},{key:"removeLastTag",value:function(){this.setState({tags:this.state.tags.slice(0,-1)})}},{key:"autosuggest",value:function(t){var e=this;t.length>1&&xo.execute.get(this.props.path,this.props.id,"autosuggest",{search:t}).then((function(t){e.setState({autosuggestIsOpen:!0,autosuggest:t.data})}))}},{key:"openBrowser",value:function(){this.setState({browserIsOpen:!0})}},{key:"closeBrowser",value:function(){this.setState({browserIsOpen:!1})}},{key:"confirmBrowser",value:function(t){this.setState({tags:t,browserIsOpen:!1})}},{key:"render",value:function(){var t,e,r=this;return this.state.autosuggestIsOpen&&this.state.autosuggest.length&&(e=(0,St.jsx)("div",{className:"tags-field__autosuggest",children:this.state.autosuggest.map((function(t,e){return(0,St.jsx)("div",{className:"tags-field__autosuggestion",onClick:function(e){return r.handleSuggestionClick(t)},children:t},e)}))})),this.state.browserIsOpen&&(t=(0,St.jsx)(No,{children:(0,St.jsx)(Xd,{id:this.props.id,path:this.props.path,selectedTags:this.state.tags,onCancel:this.closeBrowser.bind(this),onConfirm:function(t){return r.confirmBrowser(t)}})})),(0,St.jsx)(Ee,{name:this.props.name,required:this.props.showRequiredIndicator,label:this.props.label,errors:this.props.errors,tooltip:this.props.tooltip,children:(0,St.jsx)("div",{className:"tags-field",children:(0,St.jsxs)("div",{className:"tags-field__wrap",children:[(0,St.jsx)("div",{className:"tags-field__browse",children:(0,St.jsx)(Mo,{style:"transparent",name:"fact_check",onClick:this.openBrowser.bind(this)})}),(0,St.jsx)("div",{className:"tags-field__tags",children:(0,St.jsx)(Gd,{tags:this.state.tags})}),(0,St.jsx)("div",{className:"tags-field__input",children:(0,St.jsx)("input",{className:"tags-field__input-field",ref:this.inputRef,onChange:this.handleChange.bind(this),onKeyUp:this.handleKeyUp.bind(this),onKeyDown:this.handleKeyDown.bind(this),onBlur:this.handleBlur.bind(this)})}),e,t]})})})}}],r&&nh(e.prototype,r),o&&nh(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);function sh(t){return sh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sh(t)}function lh(t,e){for(var r=0;r1,r=this.props.currentPaget.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:[];t.onChange(t.id,e.join(","))};return i=t.label?t.label:bt.toUpperCaseFirst(t.field),(0,St.jsx)("div",{className:"enum-filter",children:(0,St.jsx)(ml,{stopPropagation:!1,style:["secondary"],label:i,text:r.humanReadableValue,children:(0,St.jsx)(Ji,{options:t.options,defaultValues:r.values,onChange:a,onClear:a})})})}$h.defaultProps={id:0,type:"",options:{},field:"",label:"",data:{},onChange:function(){}};const Hh=$h;function Kh(t){return Kh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kh(t)}function Zh(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Jh(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:[];t.onChange(t.id,e.join(","))};return i=t.label?t.label:bt.toUpperCaseFirst(t.field),(0,St.jsx)("div",{className:"enum-filter",children:(0,St.jsx)(ml,{stopPropagation:!1,style:["secondary"],label:i,text:r.humanReadableValue,children:(0,St.jsx)(Ji,{options:r.options,defaultValues:r.values,onChange:a,onClear:a})})})}ey.defaultProps={id:0,type:"",field:"",label:"",titleColumn:"",data:{},onChange:function(){}};const ry=ey;function ny(t){return ny="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ny(t)}function oy(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[],r=e.map((function(e){return t.state.options[e]}));this.setState({humanReadableValue:r.length?r.join(", "):mt.get("snippets.tags_all")}),this.props.onChange(this.props.id,e.join(","))}},{key:"clear",value:function(){this.selectListRef.current.clear()}},{key:"onCtxMenuClick",value:function(t){"clear"===t&&this.clear()}},{key:"render",value:function(){var t=this.props.label?this.props.label:mt.get("snippets.tag");return(0,St.jsx)("div",{className:"enum-filter",children:(0,St.jsx)(qt,{onClick:this.onCtxMenuClick.bind(this),links:[["Clear this filter","clear"]],children:(0,St.jsx)(ml,{stopPropagation:!1,style:["secondary"],label:t,text:this.state.humanReadableValue,children:(0,St.jsx)(Ji,{options:this.state.options,onChange:this.handleChange.bind(this),onClear:this.handleChange.bind(this),ref:this.selectListRef})})})})}}],r&&oy(e.prototype,r),o&&oy(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=uy(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(sy,"defaultProps",{id:0,type:"",label:"",onChange:function(){}});const ly=sy;function fy(t){return fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fy(t)}function py(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dy(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r5&&void 0!==arguments[5]&&arguments[5];return t.map((function(t,c){var u=a?n.createRef():null,s=vy[t.type];return{filter:o((0,St.jsx)(s,jy(jy({},t),{},{data:e,path:r,onChange:i})),c),ref:u}}))}};function Sy(t){return Sy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sy(t)}function xy(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Py(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ky(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};this.state.searchKeyword&&(e.search=this.state.searchKeyword);for(var r=!1,n=0;nt.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:null;xo.execute.get(this.props.path,this.props.id,"load",this.props.path.params).then((function(r){var n=r.data.data,o={};n.forEach((function(e){return o[e.id]=e[t.props.titleColumn]})),t.setState({items:n,options:o},(function(){e&&e()}))}))}},{key:"getData",value:function(t){return t[this.props.name]=this.state.selectedItems||[],t}},{key:"handleSubmit",value:function(t){t[this.props.name]=this.state.selectedItemsIds||[]}},{key:"handleChange",value:function(t){this.setState({selectedItemsIds:t,selectedItems:this.state.items.filter((function(e){return t.includes("".concat(e.id))}))})}},{key:"open",value:function(){this.setState({isOpen:!0})}},{key:"close",value:function(){this.setState({isOpen:!1})}},{key:"create",value:function(t){var e=this;xo.execute.post(this.props.path,this.props.id,"create",t).then((function(t){e.createFormRef.current.ready(),e.load((function(){e.setState({isOpen:!1,selectedItemsIds:[].concat(em(e.state.selectedItemsIds),[t.data.data.id])})})),vt.notify(mt.get("snippets.singular_created_selected",{singular:e.props.singular}))}),(function(t){var r=t.response;e.createFormRef.current.ready(),e.setState({createFormErrors:r.data.errors}),vt.notify(r.data.message)}))}},{key:"renderSidebarComponents",value:function(){return iv.renderComponents(this.props.sidebarComponents,{},this.props.path)}},{key:"renderCreateComponents",value:function(){return iv.renderComponents(this.props.createComponents,{},this.props.path)}},{key:"renderCreateWidget",value:function(){return this.state.isOpen?(0,St.jsx)(No,{children:(0,St.jsx)(Ho,{title:mt.get("snippets.new_singular",{singular:this.props.singular}),style:"modal",closeable:!0,onClose:this.close.bind(this),children:(0,St.jsx)(ii,{ref:this.createFormRef,errors:this.state.createFormErrors,realForm:!1,onSubmit:this.create.bind(this),submitButtonText:mt.get("snippets.create_singular",{singular:this.props.singular}),sidebar:this.renderSidebarComponents(),children:this.renderCreateComponents()})})}):null}},{key:"renderCreate",value:function(){return this.props.create?(0,St.jsx)("div",{className:"many-to-many-select-field__btn",children:(0,St.jsx)(ar,{icon:"add",style:["full","small","secondary"],text:mt.get("snippets.new_singular",{singular:this.props.singular}),onClick:this.open.bind(this)})}):null}},{key:"render",value:function(){var t=this;return(0,St.jsxs)(Ee,{name:this.props.name,label:this.props.label,tooltip:this.props.tooltip,errors:this.props.errors,children:[(0,St.jsx)("div",{className:"many-to-many-select-field",children:(0,St.jsx)("div",{className:"many-to-many-select-field__field",children:(0,St.jsx)(va,{multiple:!0,value:this.state.selectedItemsIds,options:this.state.options,nullText:"– "+mt.get("snippets.no_plural_selected",{plural:this.props.plural})+" –",onChange:function(e){return t.handleChange(e)},children:this.renderCreate()})})}),this.renderCreateWidget()]})}}],r&&nm(e.prototype,r),o&&nm(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=cm(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(um,"defaultProps",{path:{},data:{},label:"",name:"",style:"",singular:"",plural:"",titleColumn:"",tooltip:"",create:!1,createComponents:[],sidebarComponents:[]});const sm=um;function lm(t){return lm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lm(t)}function fm(t){return function(t){if(Array.isArray(t))return pm(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return pm(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pm(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pm(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=this.state.addedItems.length-1)){var e=this.state.addedItems,r=t+1,n=[e[r],e[t]];e[t]=n[0],e[r]=n[1],this.setState({addedItems:e})}}},{key:"removeItem",value:function(t){var e=this.state.addedItems;e.splice(t,1),this.setState({addedItems:e})}},{key:"renderItems",value:function(){var t=this;return this.componentLists=[],this.state.addedItems.length?this.state.addedItems.map((function(e,r){var n=iv.renderComponentsWith(t.props.components,e,t.props.path,(function(t,e){return(0,St.jsx)("div",{className:"json-field__component",children:t},e)}),!0,t.props.errors);return t.componentLists.push(n),(0,St.jsxs)("div",{className:"json-field__item",children:[(0,St.jsx)("div",{className:"json-field__item-content",children:n.map((function(t){return t.component}))}),(0,St.jsxs)("div",{className:"json-field__item-actions",children:[(0,St.jsx)(Mo,{style:["transparent",r>0?"enabled":"disabled"],iconStyle:"mini",name:"arrow_upward",onClick:function(e){return t.sortUp(r)}}),(0,St.jsx)(Mo,{style:["transparent",rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:null,e={},r={};this.componentList.forEach((function(t){t.ref.current.getData&&t.ref.current.getData(e),t.ref.current.handleSubmit&&t.ref.current.handleSubmit(r)})),this.setState({isStored:!0,data:e,submitData:r,isOpen:!1},(function(){t&&t()}))}},{key:"renderComponents",value:function(){return this.componentList=iv.renderComponentsWith(this.props.components,this.state.isStored?this.state.data:this.props.data,this.props.path,(function(t,e){return(0,St.jsx)("div",{className:"content-blocks__component",children:t},e)}),!0),this.componentList.map((function(t){return t.component}))}},{key:"renderWidget",value:function(){var t=this;return(0,St.jsx)(No,{children:(0,St.jsx)(Ho,{title:this.props.title,style:"modal",closeable:!0,onClose:this.close.bind(this),footer:[(0,St.jsx)(ar,{text:"Confirm",onClick:function(){t.store()}},"confirm")],children:this.renderComponents()})})}},{key:"render",value:function(){return(0,St.jsxs)(n.Fragment,{children:[(0,St.jsx)(Ee,{label:this.props.label,tooltip:this.props.tooltip,children:"link"===this.props.style?(0,St.jsx)(hr,{style:this.props.style,onClick:this.open.bind(this),text:this.props.title}):(0,St.jsx)(ar,{style:["small","secondary"],text:this.props.title,onClick:this.open.bind(this)})}),(0,St.jsx)("div",{style:{display:this.state.isOpen?"block":"none"},children:this.renderWidget()})]})}}],r&&Rb(e.prototype,r),o&&Rb(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(n.Component);!function(t,e,r){(e=Db(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Ib,"defaultProps",{title:"",label:"",components:[],path:{},data:{},errors:{},style:null});const Ab=Ib;function Fb(t){return Fb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fb(t)}function Bb(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return t.map((function(t,c){var u=null;i&&(u=n.createRef());var s=tv[t.type];return{component:o((0,St.jsx)(s,nv(nv({},t),{},{data:e,errors:a,path:r,ref:u})),c),ref:u}}))}};var av=r(498),cv={insert:"head",singleton:!1};wt()(av.Z,cv);av.Z.locals;function uv(t){return(0,St.jsx)("div",{className:_t.className("checkbox",t.style)+(t.checked?" checkbox--checked":""),onClick:t.onClick})}uv.defaultProps={style:[],checked:!1,onClick:function(){}};const sv=uv;function lv(t){var e,r,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function yv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mv(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==f[0]?f[0]:{},i=!1,c=0;c0?(0,St.jsx)("div",{className:"wizard__footer-component",children:(0,St.jsx)(hr,{onClick:this.goToPrev.bind(this),text:"Previous"})},1):null,(0,St.jsx)("div",{className:"wizard__footer-component",children:(0,St.jsx)(ar,{style:"large",onClick:this.goToNext.bind(this),text:this.isLastStep()?mt.get("snippets.create"):mt.get("snippets.next")})},2)]}},{key:"renderWizardContent",value:function(){var t=this;return this.props.steps.map((function(e,r){return(0,St.jsx)("div",{className:"wizard__step-content",style:{display:r===t.state.currentStepIndex?"block":"none"},children:t.componentLists[r].map((function(t){return t.component}))},r)}))}},{key:"isLastStep",value:function(){return this.state.currentStepIndex===this.props.steps.length-1}},{key:"goTo",value:function(t){(t=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Qg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xg(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==n[0]?n[0]:null,t.next=3,yo.all([xo.media.path(e),xo.media.loadDirectories(e),xo.media.loadFiles(e)]).then(yo.spread((function(t,e,n){var i=t.data.data,a=e.data.data,c=n.data.data,u=i[i.length-1];p({type:"media/init",payload:{directory:u,path:i,directories:a,files:c}}),o(Xg(Xg({},r),{},{isLoading:!1,currentFile:null,selectedFiles:[],selectedFileIds:[]}))})));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),h=function(){i.current.params.directory?d(i.current.params.directory):d()},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t?le.goTo(i.current.module,i.current.action,{directory:t}):le.goTo(i.current.module,i.current.action)},b=function(){o(Xg(Xg({},r),{},{currentFile:null,selectedFiles:[],selectedFileIds:[]}))},v=function(t,e){e.length?1===e.length?o(Xg(Xg({},r),{},{currentFile:e[0],selectedFiles:e,selectedFileIds:t})):o(Xg(Xg({},r),{},{currentFile:null,selectedFiles:e,selectedFileIds:t})):b()},g=function(){var t=rw(Jg().mark((function t(e){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.deleteDirectory(e);case 3:p({type:"media/directories/delete",directoryIds:[e]}),vt.i18nNotify("snippets.directory_deleted"),b(),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),vt.i18nNotify("snippets.directory_not_deleted");case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),w=function(){var t=rw(Jg().mark((function t(e,r){var n;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=13;break}return t.prev=1,t.next=4,xo.media.renameDirectory(e,r);case 4:n=t.sent,p({type:"media/directories/rename",payload:n.data.data}),vt.i18nNotify("snippets.directory_renamed"),b(),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,r){return t.apply(this,arguments)}}(),j=function(){var t=rw(Jg().mark((function t(e,r){var n;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=12;break}return t.prev=1,t.next=4,xo.media.renameFile(e,r);case 4:n=t.sent,p({type:"media/files/rename",payload:n.data.data}),vt.i18nNotify("snippets.file_renamed"),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),vt.i18nNotify("snippets.changes_unsuccessful");case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,r){return t.apply(this,arguments)}}(),O=function(){var t=rw(Jg().mark((function t(e){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.deleteFile(e);case 3:p({type:"media/files/delete",fileIds:[e]}),vt.i18nNotify("snippets.file_deleted"),b(),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),vt.notify(mt.get("snippets.file_not_deleted"));case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),_=function(){var t=rw(Jg().mark((function t(e){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.deleteFiles(e);case 3:p({type:"media/files/delete",fileIds:e}),vt.i18nNotify("snippets.amount_files_deleted",{amount:e.length}),b(),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),vt.i18nNotify("snippets.files_not_deleted");case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),x=function(){var t=rw(Jg().mark((function t(e,r){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.labelFile(e,r);case 3:p({type:"media/files/label",fileId:r,label:e}),vt.i18nNotify("snippets.changes_successful"),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),vt.i18nNotify("snippets.changes_unsuccessful");case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}(),P=function(){var t=rw(Jg().mark((function t(e,r,n){var o;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=e.toLowerCase(),!["visibility","description","copyright"].includes(e)){t.next=13;break}return o=xo.media["updateFile"+bt.toUpperCaseFirst(e)],t.prev=3,t.next=6,o(r,n);case 6:p({type:"media/files/changeProperty",fileId:n,property:e,value:r}),vt.notify(mt.get("snippets.changes_successful")),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),vt.notify(mt.get("snippets.changes_unsuccessful"));case 13:case"end":return t.stop()}}),t,null,[[3,10]])})));return function(e,r,n){return t.apply(this,arguments)}}(),k=function(){var t=rw(Jg().mark((function t(e,r,n){var o;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=e.toLowerCase(),!["visibility","description","copyright"].includes(e)){t.next=13;break}return o=xo.media["updateFiles"+bt.toUpperCaseFirst(e)],t.prev=3,t.next=6,o(r,n);case 6:p({type:"media/files/changeProperties",fileIds:n,property:e,value:r}),vt.notify(mt.get("snippets.changes_successful")),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),vt.notify(mt.get("snippets.changes_unsuccessful"));case 13:case"end":return t.stop()}}),t,null,[[3,10]])})));return function(e,r,n){return t.apply(this,arguments)}}(),E=function(){var t=rw(Jg().mark((function t(e,r){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.moveDirectory(e,r);case 3:p({type:"media/directories/move",moveToId:e,directoryIds:[r]}),vt.notify(mt.get("snippets.directory_moved")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),vt.notify(mt.get("snippets.changes_unsuccessful"));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}(),C=function(){var t=rw(Jg().mark((function t(e,r){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.moveFile(e,r);case 3:p({type:"media/files/move",moveToId:e,fileIds:[r]}),vt.notify(mt.get("snippets.file_moved")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),vt.notify(mt.get("snippets.changes_unsuccessful"));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}(),R=function(){var t=rw(Jg().mark((function t(e,r){return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,xo.media.moveFiles(e,r);case 3:p({type:"media/files/move",moveToId:e,fileIds:r}),vt.notify(mt.get("snippets.files_moved")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),vt.notify(mt.get("snippets.changes_unsuccessful"));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}(),T=function(t){window.open(t.url)},N=function(){h()},L=function(t){(!i.current.params.directory&&!t.directory||t.directory&&i.current.params.directory&&t.directory.id===i.current.params.directory)&&h()},D=function(){var t;vt.prompt({title:mt.get("snippets.new_directory_title"),confirmButtonText:mt.get("snippets.create"),cancelButtonText:mt.get("snippets.cancel"),confirm:(t=rw(Jg().mark((function t(e){var r;return Jg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,xo.media.createDirectory(e,i.current.params.directory);case 2:r=t.sent,p({type:"media/directories/add",payload:r.data.data}),vt.notify(mt.get("snippets.directory_created"));case 5:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})})},I=function(t,e){vt.confirm({title:mt.get("snippets.delete_files_title",{amount:t.length}),text:mt.get("snippets.delete_files_text"),confirmButtonText:mt.get("snippets.delete_files_confirm",{amount:t.length}),cancelButtonText:mt.get("snippets.delete_files_cancel"),confirm:function(){return _(t)}})};return(0,St.jsxs)("div",{className:"view-media-directory"+(r.isLoading?" view-media-directory--loading":"")+(r.isDragOver?" view-media-directory--drag-over":""),children:[(0,St.jsxs)("div",{className:"view-media-directory__header",children:[(0,St.jsxs)("div",{className:"view-media-directory__header-title",children:[(0,St.jsx)(ml,{style:["primary","small"],openIcon:"folder",closeIcon:"folder",children:(0,St.jsx)($l,{selectedDirectory:s?s.id:null,onDirectoryClick:function(t){return m(t)}})}),(0,St.jsx)(np,{items:u,onClick:function(t){t?m(t.id):m()}})]}),(0,St.jsxs)("div",{className:"view-media-directory__header-options",children:[(0,St.jsx)(Mp,{}),(0,St.jsx)(ar,{style:["secondary","small"],onClick:D,text:mt.get("snippets.new_directory")}),(0,St.jsx)(ml,{text:mt.get("snippets.upload"),style:["primary","small"],autoClose:!0,children:(0,St.jsx)(fp,{directory:s?s.id:null,onUploadDone:N})})]})]}),(0,St.jsx)("div",{className:"view-media-directory__content",children:r.isLoading?null:(0,St.jsxs)(St.Fragment,{children:[(0,St.jsx)("div",{className:"view-media-directory__main",children:(0,St.jsx)(Cp,{directory:s?s.id:null,onCreateDirectory:L,onUploadDone:N,children:(0,St.jsx)(Hf,{viewMode:c,currentDirectory:s,directories:l,files:f,fileLabels:t.fileLabels,selectedFiles:r.selectedFiles,selectedFileIds:r.selectedFileIds,onDirectoryClick:m,onDirectoryDelete:g,onDirectoryRename:w,onDirectoryMove:E,onFileDelete:O,onFileRename:j,onFileOpen:T,onFileMove:C,onSelectionMove:R,onSelectionChange:v,onSelectionDelete:I})})}),(0,St.jsx)("div",{className:"view-media-directory__side",children:r.currentFile?(0,St.jsx)(Ig,{file:r.currentFile,fileLabels:t.fileLabels,onLabelFile:function(t){return x(t,r.currentFile.id)},onChangeFileProperty:function(t,e){return P(t,e,r.currentFile.id)},onDeleteFile:function(){vt.confirm({title:mt.get("snippets.delete_file_title"),text:mt.get("snippets.delete_file_text"),confirmButtonText:mt.get("snippets.delete_file_confirm"),cancelButtonText:mt.get("snippets.delete_file_cancel"),confirm:function(){return O(r.currentFile.id)}})},onRenameFile:function(){vt.prompt({title:mt.get("snippets.rename_file_title"),defaultValue:r.currentFile.name,confirmButtonText:mt.get("snippets.rename_file_confirm"),cancelButtonText:mt.get("snippets.rename_file_cancel"),confirm:function(t){xo.media.renameFile(t,r.currentFile.id).then((function(t){o(Xg(Xg({},r),{},{currentFile:t.data.data}),(function(){vt.notify(mt.get("snippets.file_renamed")),h()}))}))}})},onMoveFile:C}):r.selectedFiles.length?(0,St.jsx)(zg,{files:r.selectedFiles,onDeleteFiles:function(){return I(r.selectedFileIds,r.selectedFiles)},onChangeFilesProperty:function(t,e){return k(t,e,r.selectedFileIds)},onMoveFiles:R}):s?(0,St.jsx)(Wg,{directory:s}):(0,St.jsx)(Kg,{})})]})})]})}iw.defaultProps={type:"",path:{},id:0,data:{},fileLabels:{}};const aw=iw;function cw(t){return cw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cw(t)}function uw(t,e){for(var r=0;r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function bw(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vw(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ew(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Cw(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Rw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rw(t,e)}(t,e)||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 Rw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>32-e}function r(t,e){var r,n,o,i,a;return o=2147483648&t,i=2147483648&e,a=(1073741823&t)+(1073741823&e),(r=1073741824&t)&(n=1073741824&e)?2147483648^a^o^i:r|n?1073741824&a?3221225472^a^o^i:1073741824^a^o^i:a^o^i}function n(t,n,o,i,a,c,u){return t=r(t,r(r(function(t,e,r){return t&e|~t&r}(n,o,i),a),u)),r(e(t,c),n)}function o(t,n,o,i,a,c,u){return t=r(t,r(r(function(t,e,r){return t&r|e&~r}(n,o,i),a),u)),r(e(t,c),n)}function i(t,n,o,i,a,c,u){return t=r(t,r(r(function(t,e,r){return t^e^r}(n,o,i),a),u)),r(e(t,c),n)}function a(t,n,o,i,a,c,u){return t=r(t,r(r(function(t,e,r){return e^(t|~r)}(n,o,i),a),u)),r(e(t,c),n)}function c(t){var e,r="",n="";for(e=0;e<=3;e++)r+=(n="0"+(t>>>8*e&255).toString(16)).substr(n.length-2,2);return r}var u,s,l,f,p,d,h,y,m,b=Array();for(b=function(t){for(var e,r=t.length,n=r+8,o=16*((n-n%64)/64+1),i=Array(o-1),a=0,c=0;c>>29,i}(t=function(t){t=t.replace(/rn/g,"n");for(var e="",r=0;r127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}(t)),d=1732584193,h=4023233417,y=2562383102,m=271733878,u=0;u=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Xw(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function tj(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Xw(i,n,o,a,c,"next",t)}function c(t){Xw(i,n,o,a,c,"throw",t)}a(void 0)}))}}function ej(t){var e=S(),r=y((function(t){return t.auth})).user,n=y((function(t){return t.modules.secondary})),o=function(){var t=tj(Qw().mark((function t(){return Qw().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:vt.confirm({title:mt.get("snippets.logout"),confirmButtonText:mt.get("snippets.logout_confirm"),confirm:function(){var t=tj(Qw().mark((function t(){return Qw().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,xo.auth.logout();case 2:e({type:"auth/loggedout"}),vt.notify("User logged out");case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,St.jsxs)("div",{className:"user-panel",children:[(0,St.jsx)("div",{className:"user-panel__avatar",children:(0,St.jsx)("img",{src:Zw.get(r.email),alt:r.name})}),(0,St.jsx)("div",{className:"user-panel__name",children:r.name}),(0,St.jsx)("div",{className:"user-panel__actions",children:(0,St.jsxs)(ml,{style:["secondary"],children:[(0,St.jsx)(It,{stopPropagation:!1,links:n.map((function(t){return[t.title,t.id]})),onClick:function(t){return e=t,void le.goTo(e,"index");var e}}),(0,St.jsx)("div",{className:"user-panel__logout",children:(0,St.jsx)(ar,{stopPropagation:!1,onClick:o,style:["full","small"],text:mt.get("snippets.logout")})})]})})]})}function rj(){return(0,St.jsxs)("div",{className:"module",children:[(0,St.jsx)("div",{className:"module__header",children:(0,St.jsx)("div",{className:"module__title",children:(0,St.jsx)(bc,{children:"Not found"})})}),(0,St.jsx)("div",{className:"module__main",children:"Are you sure you're trying to access the correct URL? No module or action was found for this request."})]})}function nj(t){return nj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nj(t)}function oj(){oj=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new x(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function d(){}function h(){}var y={};u(y,i,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(P([])));b&&b!==e&&r.call(b,i)&&(y=b);var v=h.prototype=p.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==nj(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ij(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function aj(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=u(t),a=i[0],c=i[1],s=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,c)),l=0,f=c>0?a-4:a;for(r=0;r>16&255,s[l++]=e>>8&255,s[l++]=255&e;2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,s[l++]=255&e);1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e);return s},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],a=16383,c=0,u=n-o;cu?u:c+a));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=i.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,n){for(var o,i,a=[],c=e;c>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(t,e,r)=>{"use strict";var n=r(742),o=r(241),i=r(826);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(n)return G(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,c=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,c/=2,u/=2,r/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(i=r;ic&&(r=c-u),i=r;i>=0;i--){for(var f=!0,p=0;po&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:s>223?3:s>191?2:1;if(o+f<=r)switch(f){case 1:s<128&&(l=s);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&s)<<6|63&i)>127&&(l=u);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(u=(15&s)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[o+1],a=t[o+2],c=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&c)&&(u=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&c)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),c=Math.min(i,a),s=this.slice(n,o),l=t.slice(e,r),f=0;fo)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return j(this,t,e,r);case"latin1":case"binary":return O(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;on)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function I(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function A(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,i){return i||A(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return i||A(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):I(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):I(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);L(this,t,e,r,o-1,-o)}var i=0,a=1,c=0;for(this[e]=255&t;++i>0)-c&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);L(this,t,e,r,o-1,-o)}var i=r-1,a=1,c=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===c&&0!==this[e+i+1]&&(c=1),this[e+i]=(t/a>>0)-c&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):I(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):I(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}},399:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".footer-text{color:var(--fill-color-alt-3);display:block;font-family:Poppins,sans-serif;font-size:.85rem;font-weight:500;letter-spacing:-.02em;line-height:1;text-align:center;width:100%}.footer-text a{text-decoration:underline;transition:color .5s}.footer-text a:hover{color:var(--primary-color);text-decoration:none}",""]);const i=o},451:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.boolean-switcher{background-color:var(--fill-color-alt-1);border-radius:1.3333333333rem;cursor:pointer;display:inline-block;height:1.6666666667rem;padding:.3333333333rem;position:relative;transition:background-color .25s;width:3.3333333333rem}.boolean-switcher:after{background-color:#fff;border-radius:50%;box-shadow:0 5px 15px 0 rgba(70,70,70,.1);content:"";height:1.3333333333rem;left:.1666666667rem;position:absolute;top:.1666666667rem;transition:transform .25s;width:1.3333333333rem}.boolean-switcher--alt{background-color:#fff}.boolean-switcher--alt:after{background-color:var(--fill-color-alt-2)}.boolean-switcher--alt.boolean-switcher--checked:after{background-color:#fff}.boolean-switcher--checked{background-color:var(--primary-color-alt-1)}.boolean-switcher--checked:after{transform:translateX(1.6666666667rem)}.boolean-switcher--small{height:1rem;width:2.3333333333rem}.boolean-switcher--small:after{height:.6666666667rem;width:.6666666667rem}.boolean-switcher--small.boolean-switcher--checked:after{transform:translateX(1.3333333333rem)}',""]);const i=o},195:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'@charset "UTF-8";.breadcrumbs__list{display:flex}.breadcrumbs__list li{color:#7b7d85}.breadcrumbs__list li:after{content:"›";margin-left:.6666666667rem;margin-right:.6666666667rem}.breadcrumbs__list li:last-child{color:#464646}.breadcrumbs__list li:last-child span{cursor:default}.breadcrumbs__list li:last-child span:hover{border-bottom:0}.breadcrumbs__list li:last-child:after{display:none}.breadcrumbs__list li span{cursor:pointer}.breadcrumbs__list li span:hover{border-bottom:1px solid hsla(228,4%,50%,.5)}',""]);const i=o},314:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".button-group{border-radius:var(--border-radius);display:flex;flex-wrap:nowrap;overflow:hidden}",""]);const i=o},151:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.button{background-color:var(--primary-color);border-radius:var(--border-radius);color:#fff;cursor:pointer;font-family:Poppins,sans-serif;font-size:.95rem;font-weight:500;line-height:1;overflow:hidden;padding:1rem 2rem;position:relative;transition:background-color .25s;white-space:nowrap}.button:after{bottom:0;box-shadow:inset 0 -2px 0 var(--primary-color-alt-1);content:"";left:0;opacity:.5;position:absolute;right:0;top:0}.button:before{border:1px solid var(--fill-color);border-radius:var(--border-radius);bottom:2px;content:"";left:2px;opacity:0;position:absolute;right:2px;top:2px;transition:opacity 1s}.button:active:before,.button:focus:before{opacity:.25}.button:hover{background-color:var(--primary-color-alt-1)}.button__icon{margin-right:.5rem}.button__label{color:#7b7d85;margin-right:.6666666667rem}.button--grouped{border-radius:0}.button--has-icon{align-items:center;display:inline-flex}.button--disabled{box-shadow:none;cursor:not-allowed;overflow:hidden}.button--disabled:after{background-color:var(--fill-color);bottom:0;box-shadow:none;content:"";left:0;opacity:.75;position:absolute;right:0;top:0}.button--secondary{background-color:var(--fill-color-alt-1);color:#464646}.button--secondary:after{display:none}.button--active,.button--secondary:hover{background-color:var(--fill-color-alt-2)}.button--outline{background-color:#fff;border:1px solid var(--fill-color-alt-1);color:var(--primary-color-alt-1)}.button--outline:after{display:none}.button--outline:hover{background-color:#fff}.button--full{justify-content:center;text-align:center;width:100%}.button--small{height:2.3rem;padding:.6666666667rem 1.3333333333rem}.button--small:after{display:none}.button--large{border-radius:var(--border-radius);font-family:Poppins,sans-serif;font-size:1.15rem;font-weight:700;line-height:1.35;padding:1rem 2rem;text-transform:none}',""]);const i=o},498:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.checkbox{background-color:var(--fill-color-alt-1);cursor:pointer;display:inline-block;height:1.1666666667rem;padding:.3333333333rem;position:relative;transition:background-color .25s;width:1.1666666667rem}.checkbox,.checkbox:after{border-radius:var(--border-radius)}.checkbox:after{background-color:#fff;box-shadow:0 5px 15px 0 rgba(70,70,70,.1);content:"";height:.6666666667rem;left:.25rem;position:absolute;top:.25rem;transform:scale(0);transition:transform .25s;width:.6666666667rem}.checkbox--checked{background-color:var(--primary-color-alt-1)}.checkbox--checked:after{transform:scale(1)}',""]);const i=o},554:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".collapsible{background-color:#fff;border:1px solid var(--fill-color-alt-1);border-radius:var(--border-radius);margin-bottom:1rem}.collapsible__header{align-items:center;background-color:var(--fill-color);display:flex;justify-content:space-between;padding:.3333333333rem .6666666667rem}.collapsible__title{padding-left:1rem;text-align:left;width:100%}.collapsible__content{display:flex;flex-direction:column;gap:2rem;padding:.6666666667rem}.collapsible--closed .collapsible__content{display:none}.collapsible__actions{align-items:center;display:flex;gap:.6666666667rem}.collapsible__component{margin-bottom:2rem}.collapsible__component:last-child{margin-bottom:0}",""]);const i=o},709:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.ctx-overlay{position:fixed}.ctx-mount,.ctx-overlay{bottom:0;left:0;right:0;top:0;z-index:9999}.ctx-mount{position:absolute}@keyframes context-menu{0%{transform:scaleY(.85) scaleX(.85);transform-origin:0 0}to{transform:scaleY(1) scaleX(1);transform-origin:0 0}}.context-menu{width:100%}.context-menu__menu{animation:context-menu .25s;background-color:#fff;border:1px solid var(--fill-color-alt-2);border-radius:var(--border-radius);box-shadow:0 5px 15px 0 rgba(70,70,70,.1);left:0;margin-top:.6666666667rem;padding:.6666666667rem;position:absolute;top:0;width:20rem;z-index:1}.context-menu__wrap{position:relative;width:100%}.context-menu--open .context-menu__wrap:after{border:1px solid var(--fill-color-alt-2);border-radius:var(--border-radius);bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}',""]);const i=o},279:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".directory-view{padding:1rem}.directory-view__content,.directory-view__header{margin-bottom:2rem}",""]);const i=o},374:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,'.file-drop-zone{border:1px solid transparent;border-radius:var(--border-radius);display:block;width:100%}.file-drop-zone__overlay{align-items:center;bottom:0;display:flex;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;z-index:9998}.file-drop-zone--drag-over .file-drop-zone__overlay{opacity:1;transition:opacity .5s}.file-drop-zone--drag-over{border:1px dashed var(--primary-color);cursor:copy;position:relative}.file-drop-zone--drag-over:after{background-color:var(--fill-color);border-radius:var(--border-radius);bottom:0;content:"";display:block;left:0;opacity:.85;pointer-events:none;position:absolute;right:0;top:0}',""]);const i=o},926:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".file-uploader{position:relative}.file-uploader__input{bottom:0;left:0;position:absolute;right:0;top:0}.file-uploader__input:has(input:hover){border:1px dashed var(--fill-color-alt-2);border-radius:var(--border-radius)}.file-uploader__input input{cursor:pointer;height:100%;opacity:0;width:100%}",""]);const i=o},668:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(645),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".directory-view{padding:1rem}.directory-view__content,.directory-view__header{margin-bottom:2rem}",""]);const i=o},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,n){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(n)for(var i=0;i{"use strict";var n=r(864),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function u(t){return n.isMemo(t)?a:c[t.$$typeof]||o}c[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[n.Memo]=a;var s=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;t.exports=function t(e,r,n){if("string"!=typeof r){if(h){var o=d(r);o&&o!==h&&t(e,o,n)}var a=l(r);f&&(a=a.concat(f(r)));for(var c=u(e),y=u(r),m=0;m{e.read=function(t,e,r,n,o){var i,a,c=8*o-n-1,u=(1<>1,l=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=c;l>0;i=256*i+t[e+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=p,l-=8);if(0===i)i=1-s;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=s}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,c,u,s=8*i-o-1,l=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(c=0,a=l):a+f>=1?(c=(e*u-1)*Math.pow(2,o),a+=f):(c=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&c,d+=h,c/=256,o-=8);for(a=a<0;t[r+d]=255&a,d+=h,a/=256,s-=8);t[r+d-h]|=128*y}},826:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},425:()=>{},921:(t,e)=>{"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,g=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function j(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:switch(t=t.type){case l:case f:case i:case c:case a:case d:return t;default:switch(t=t&&t.$$typeof){case s:case p:case m:case y:case u:return t;default:return e}}case o:return e}}}function O(t){return j(t)===f}e.AsyncMode=l,e.ConcurrentMode=f,e.ContextConsumer=s,e.ContextProvider=u,e.Element=n,e.ForwardRef=p,e.Fragment=i,e.Lazy=m,e.Memo=y,e.Portal=o,e.Profiler=c,e.StrictMode=a,e.Suspense=d,e.isAsyncMode=function(t){return O(t)||j(t)===l},e.isConcurrentMode=O,e.isContextConsumer=function(t){return j(t)===s},e.isContextProvider=function(t){return j(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===n},e.isForwardRef=function(t){return j(t)===p},e.isFragment=function(t){return j(t)===i},e.isLazy=function(t){return j(t)===m},e.isMemo=function(t){return j(t)===y},e.isPortal=function(t){return j(t)===o},e.isProfiler=function(t){return j(t)===c},e.isStrictMode=function(t){return j(t)===a},e.isSuspense=function(t){return j(t)===d},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===f||t===c||t===a||t===d||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===y||t.$$typeof===u||t.$$typeof===s||t.$$typeof===p||t.$$typeof===v||t.$$typeof===g||t.$$typeof===w||t.$$typeof===b)},e.typeOf=j},864:(t,e,r)=>{"use strict";t.exports=r(921)},359:(t,e)=>{"use strict";var r,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function b(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:switch(t=t.type){case i:case c:case a:case p:case d:return t;default:switch(t=t&&t.$$typeof){case l:case s:case f:case y:case h:case u:return t;default:return e}}case o:return e}}}r=Symbol.for("react.module.reference")},973:(t,e,r)=>{"use strict";r(359)},53:(t,e)=>{"use strict";function r(t,e){var r=t.length;t.push(e);t:for(;0>>1,o=t[n];if(!(0>>1;ni(u,r))si(l,u)?(t[n]=l,t[s]=r,n=s):(t[n]=u,t[c]=r,n=c);else{if(!(si(l,r)))break t;t[n]=l,t[s]=r,n=s}}}return e}function i(t,e){var r=t.sortIndex-e.sortIndex;return 0!==r?r:t.id-e.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var s=[],l=[],f=1,p=null,d=3,h=!1,y=!1,m=!1,b="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,g="undefined"!=typeof setImmediate?setImmediate:null;function w(t){for(var e=n(l);null!==e;){if(null===e.callback)o(l);else{if(!(e.startTime<=t))break;o(l),e.sortIndex=e.expirationTime,r(s,e)}e=n(l)}}function j(t){if(m=!1,w(t),!y)if(null!==n(s))y=!0,L(O);else{var e=n(l);null!==e&&D(j,e.startTime-t)}}function O(t,r){y=!1,m&&(m=!1,v(P),P=-1),h=!0;var i=d;try{for(w(r),p=n(s);null!==p&&(!(p.expirationTime>r)||t&&!C());){var a=p.callback;if("function"==typeof a){p.callback=null,d=p.priorityLevel;var c=a(p.expirationTime<=r);r=e.unstable_now(),"function"==typeof c?p.callback=c:p===n(s)&&o(s),w(r)}else o(s);p=n(s)}if(null!==p)var u=!0;else{var f=n(l);null!==f&&D(j,f.startTime-r),u=!1}return u}finally{p=null,d=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var _,S=!1,x=null,P=-1,k=5,E=-1;function C(){return!(e.unstable_now()-Et||125a?(t.sortIndex=i,r(l,t),null===n(s)&&t===n(l)&&(m?(v(P),P=-1):m=!0,D(j,i-a))):(t.sortIndex=c,r(s,t),y||h||(y=!0,L(O))),t},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(t){var e=d;return function(){var r=d;d=e;try{return t.apply(this,arguments)}finally{d=r}}}},840:(t,e,r)=>{"use strict";t.exports=r(53)},379:(t,e,r)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),a=[];function c(t){for(var e=-1,r=0;r{"use strict";var n=r(294);var o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},i=n.useState,a=n.useEffect,c=n.useLayoutEffect,u=n.useDebugValue;function s(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!o(t,r)}catch(t){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var r=e(),n=i({inst:{value:r,getSnapshot:e}}),o=n[0].inst,l=n[1];return c((function(){o.value=r,o.getSnapshot=e,s(o)&&l({inst:o})}),[t,r,e]),a((function(){return s(o)&&l({inst:o}),t((function(){s(o)&&l({inst:o})}))}),[t]),u(r),r};e.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:l},139:(t,e,r)=>{"use strict";var n=r(294),o=r(688);var i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=o.useSyncExternalStore,c=n.useRef,u=n.useEffect,s=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,r,n,o){var f=c(null);if(null===f.current){var p={hasValue:!1,value:null};f.current=p}else p=f.current;f=s((function(){function t(t){if(!u){if(u=!0,a=t,t=n(t),void 0!==o&&p.hasValue){var e=p.value;if(o(e,t))return c=e}return c=t}if(e=c,i(a,t))return e;var r=n(t);return void 0!==o&&o(e,r)?e:(a=t,c=r)}var a,c,u=!1,s=void 0===r?null:r;return[function(){return t(e())},null===s?void 0:function(){return t(s())}]}),[e,r,n,o]);var d=a(t,f[0],f[1]);return u((function(){p.hasValue=!0,p.value=d}),[d]),l(d),d}},688:(t,e,r)=>{"use strict";t.exports=r(250)},798:(t,e,r)=>{"use strict";t.exports=r(139)},328:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===n(e)?e:String(e)}function i(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;ec})}},t=>{var e=e=>t(t.s=e);t.O(0,[555,170],(()=>(e(957),e(425))));t.O()}]); \ No newline at end of file diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 1baf4d5..26e8ae3 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,5 +1,5 @@ { - "/js/app.js": "/js/app.js?id=ab09a08f7ca5e793049ca0c7871f09b6", + "/js/app.js": "/js/app.js?id=cca782392d5c21be6a3420881af9c366", "/js/manifest.js": "/js/manifest.js?id=22bb55ce20c9c883a45b5c11d8eca703", "/js/vendor.js": "/js/vendor.js?id=a21c2dcb4fdd557ce1ec6c040ad40be4", "/css/app.css": "/css/app.css?id=d75c395a1c5c29d8b4c39d09727b550c" diff --git a/resources/js/actions/all.js b/resources/js/actions/all.js index 86eee76..b52c870 100644 --- a/resources/js/actions/all.js +++ b/resources/js/actions/all.js @@ -9,8 +9,10 @@ import CreateWizard from "./create-wizard"; import ViewMediaDirectory from "./view-media-directory"; import Dashboard from "./dashboard"; import SelectOne from "./select-one"; +import BulkDelete from "./bulk-delete"; export default { + 'bulk-delete': BulkDelete, 'index': Index, 'edit': Edit, 'create': Create, diff --git a/resources/js/actions/bulk-delete.js b/resources/js/actions/bulk-delete.js new file mode 100644 index 0000000..6279c90 --- /dev/null +++ b/resources/js/actions/bulk-delete.js @@ -0,0 +1,62 @@ +import React, {useState} from 'react'; +import api from "../api/api"; +import path from "../state/path"; +import ui from "../core/ui/util"; +import Button from "../core/ui/button"; +import i18n from "../util/i18n"; + +function BulkDelete(props) { + + const [state, setState] = useState({ + options: [], + selectedOptionId: null, + }); + + const ids = `${props.path.params.id}`; + + const bulkDelete = async () => { + // Load the data from the backend (with id as param) + await api.execute.get(props.path, props.id,'delete', { + ids: ids.split(',').map(id => parseInt(id)), + }); + // Redirect + redirect(); + // Notify the user + ui.notify('Deleted all items'); + } + + const redirect = () => { + path.handleRedirect(props); + } + + return ( +
+
+ Are you sure you wish to delete these {props.plural}? +
+
+
+
+
+
+
+
+ ); +} + +BulkDelete.defaultProps = { + type: '', + components: [], + path: {}, + id: 0, + data: {}, + params: null, + redirect: 'index', + redirectBack: false, + singular: '', + plural: '' +}; + +export default BulkDelete; diff --git a/src/Action/BulkDelete.php b/src/Action/BulkDelete.php new file mode 100644 index 0000000..c5c02be --- /dev/null +++ b/src/Action/BulkDelete.php @@ -0,0 +1,49 @@ +meta($meta); + $this->singular($meta::getSingular()); + $this->plural($meta::getPlural()); + } + + /** + * @return string + */ + public function type(): string + { + return 'bulk-delete'; + } + + /** + * @param Request $request + * @return bool + */ + public function apiDelete(Request $request): bool + { + $modelClass = $this->getMeta()::getModel(); + $allModels = $modelClass::whereIn('id', $request->input('ids'))->get(); + + foreach ($allModels as $model) { + $model->delete(); + } + + return true; + } +}