1(()=>{var Vu=Object.create;var gi=Object.defineProperty;var Hu=Object.getOwnPropertyDescriptor;var ku=Object.getOwnPropertyNames;var zu=Object.getPrototypeOf,Yu=Object.prototype.hasOwnProperty;var ju=(f,d)=>()=>(d||f((d={exports:{}}).exports,d),d.exports);var Wu=(f,d,g,L)=>{if(d&&typeof d=="object"||typeof d=="function")for(let S of ku(d))!Yu.call(f,S)&&S!==g&&gi(f,S,{get:()=>d[S],enumerable:!(L=Hu(d,S))||L.enumerable});return f};var $u=(f,d,g)=>(g=f!=null?Vu(zu(f)):{},Wu(d||!f||!f.__esModule?gi(g,"default",{value:f,enumerable:!0}):g,f));var hi=ju((kt,Ei)=>{(function(f,d){typeof kt=="object"&&typeof Ei<"u"?d(kt):typeof define=="function"&&define.amd?define(["exports"],d):(f=f||self,d(f.FilePond={}))})(kt,function(f){"use strict";var d=function(e){return e instanceof HTMLElement},g=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=Object.assign({},e),o=[],a=[],s=function(){return Object.assign({},n)},u=function(){var E=[].concat(o);return o.length=0,E},l=function(){var E=[].concat(a);a.length=0,E.forEach(function(b){var P=b.type,N=b.data;c(P,N)})},c=function(E,b,P){if(P&&!document.hidden){a.push({type:E,data:b});return}T[E]&&T[E](b),o.push({type:E,data:b})},p=function(E){for(var b,P=arguments.length,N=new Array(P>1?P-1:0),R=1;R<P;R++)N[R-1]=arguments[R];return h[E]?(b=h)[E].apply(b,N):null},v={getState:s,processActionQueue:u,processDispatchQueue:l,dispatch:c,query:p},h={};t.forEach(function(_){h=Object.assign({},_(n),{},h)});var T={};return r.forEach(function(_){T=Object.assign({},_(c,p,n),{},T)}),v},L=function(e,t,r){if(typeof r=="function"){e[t]=r;return}Object.defineProperty(e,t,Object.assign({},r))},S=function(e,t){for(var r in e)e.hasOwnProperty(r)&&t(r,e[r])},D=function(e){var t={};return S(e,function(r){L(t,r,e[r])}),t},U=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(r===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,r)},F="http://www.w3.org/2000/svg",$=["svg","path"],k=function(e){return $.includes(e)},me=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};typeof t=="object"&&(r=t,t=null);var n=k(e)?document.createElementNS(F,e):document.createElement(e);return t&&(k(e)?U(n,"class",t):n.className=t),S(r,function(o,a){U(n,o,a)}),n},re=function(e){return function(t,r){typeof r<"u"&&e.children[r]?e.insertBefore(t,e.children[r]):e.appendChild(t)}},_e=function(e,t){return function(r,n){return typeof n<"u"?t.splice(n,0,r):t.push(r),r}},ue=function(e,t){return function(r){return t.splice(t.indexOf(r),1),r.element.parentNode&&e.removeChild(r.element),r}},Ie=function(){return typeof window<"u"&&typeof window.document<"u"}(),ne=function(){return Ie},X=ne()?me("svg"):{},Ce="children"in X?function(i){return i.children.length}:function(i){return i.childNodes.length},Ae=function(e,t,r,n){var o=r[0]||e.left,a=r[1]||e.top,s=o+e.width,u=a+e.height*(n[1]||1),l={element:Object.assign({},e),inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:o,top:a,right:s,bottom:u}};return t.filter(function(c){return!c.isRectIgnored()}).map(function(c){return c.rect}).forEach(function(c){ge(l.inner,Object.assign({},c.inner)),ge(l.outer,Object.assign({},c.outer))}),qe(l.inner),l.outer.bottom+=l.element.marginBottom,l.outer.right+=l.element.marginRight,qe(l.outer),l},ge=function(e,t){t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},qe=function(e){e.width=e.right-e.left,e.height=e.bottom-e.top},ie=function(e){return typeof e=="number"},Re=function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:.001;return Math.abs(e-t)<n&&Math.abs(r)<n},Z=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiffness,r=t===void 0?.5:t,n=e.damping,o=n===void 0?.75:n,a=e.mass,s=a===void 0?10:a,u=null,l=null,c=0,p=!1,v=function(E,b){if(!p){if(!(ie(u)&&ie(l))){p=!0,c=0;return}var P=-(l-u)*r;c+=P/s,l+=c,c*=o,Re(l,u,c)||b?(l=u,c=0,p=!0,T.onupdate(l),T.oncomplete(l)):T.onupdate(l)}},h=function(E){if(ie(E)&&!ie(l)&&(l=E),u===null&&(u=E,l=E),u=E,l===u||typeof u>"u"){p=!0,c=0,T.onupdate(l),T.oncomplete(l);return}p=!1},T=D({interpolate:v,target:{set:h,get:function(){return u}},resting:{get:function(){return p}},onupdate:function(E){},oncomplete:function(E){}});return T},pe=function(e){return e},ce=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},Oe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.duration,r=t===void 0?500:t,n=e.easing,o=n===void 0?ce:n,a=e.delay,s=a===void 0?0:a,u=null,l,c,p=!0,v=!1,h=null,T=function(b,P){p||h===null||(u===null&&(u=b),!(b-u<s)&&(l=b-u-s,l>=r||P?(l=1,c=v?0:1,_.onupdate(c*h),_.oncomplete(c*h),p=!0):(c=l/r,_.onupdate((l>
1=0?o(v?1-c:c):0)*h))))},_=D({interpolate:T,target:{get:function(){return v?0:h},set:function(b){if(h===null){h=b,_.onupdate(b),_.oncomplete(b);return}b<h?(h=1,v=!0):(v=!1,h=b),p=!1,u=null}},resting:{get:function(){return p}},onupdate:function(b){},oncomplete:function(b){}});return _},ae={spring:Z,tween:Oe},Le=function(e,t,r){var n=e[t]&&typeof e[t][r]=="object"?e[t][r]:e[t]||e,o=typeof n=="string"?n:n.type,a=typeof n=="object"?Object.assign({},n):{};return ae[o]?ae[o](a):null},Ue=function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;t=Array.isArray(t)?t:[t],t.forEach(function(o){e.forEach(function(a){var s=a,u=function(){return r[a]},l=function(p){return r[a]=p};typeof a=="object"&&(s=a.key,u=a.getter||u,l=a.setter||l),!(o[s]&&!n)&&(o[s]={get:u,set:l})})})},_t=function(e){var t=e.mixinConfig,r=e.viewProps,n=e.viewInternalAPI,o=e.viewExternalAPI,a=Object.assign({},r),s=[];return S(t,function(u,l){var c=Le(l);if(c){c.onupdate=function(v){r[u]=v},c.target=a[u];var p={key:u,setter:function(h){c.target!==h&&(c.target=h)},getter:function(){return r[u]}};Ue([p],[n,o],r,!0),s.push(c)}}),{write:function(l){var c=document.hidden,p=!0;return s.forEach(function(v){v.resting||(p=!1),v.interpolate(l,c)}),p},destroy:function(){}}},$t=function(e){return function(t,r){e.addEventListener(t,r)}},wi=function(e){return function(t,r){e.removeEventListener(t,r)}},Di=function(e){var t=e.mixinConfig,r=e.viewProps,n=e.viewInternalAPI,o=e.viewExternalAPI,a=e.viewState,s=e.view,u=[],l=$t(s.element),c=wi(s.element);return o.on=function(p,v){u.push({type:p,fn:v}),l(p,v)},o.off=function(p,v){u.splice(u.findIndex(function(h){return h.type===p&&h.fn===v}),1),c(p,v)},{write:function(){return!0},destroy:function(){u.forEach(function(v){c(v.type,v.fn)})}}},Ai=function(e){var t=e.mixinConfig,r=e.viewProps,n=e.viewExternalAPI;Ue(t,n,r)},ye=function(e){return e!=null},Li={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},Pi=function(e){var t=e.mixinConfig,r=e.viewProps,n=e.viewInternalAPI,o=e.viewExternalAPI,a=e.view,s=Object.assign({},r),u={};Ue(t,[n,o],r);var l=function(){return[r.translateX||0,r.translateY||0]},c=function(){return[r.scaleX||0,r.scaleY||0]},p=function(){return a.rect?Ae(a.rect,a.childViews,l(),c()):null};return n.rect={get:p},o.rect={get:p},t.forEach(function(v){r[v]=typeof s[v]>"u"?Li[v]:s[v]}),{write:function(){if(Ci(u,r))return Mi(a.element,r),Object.assign(u,Object.assign({},r)),!0},destroy:function(){}}},Ci=function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!0;for(var r in t)if(t[r]!==e[r])return!0;return!1},Mi=function(e,t){var r=t.opacity,n=t.perspective,o=t.translateX,a=t.translateY,s=t.scaleX,u=t.scaleY,l=t.rotateX,c=t.rotateY,p=t.rotateZ,v=t.originX,h=t.originY,T=t.width,_=t.height,E="",b="";(ye(v)||ye(h))&&(b+="transform-origin: "+(v||0)+"px "+(h||0)+"px;"),ye(n)&&(E+="perspective("+n+"px) "),(ye(o)||ye(a))&&(E+="translate3d("+(o||0)+"px, "+(a||0)+"px, 0) "),(ye(s)||ye(u))&&(E+="scale3d("+(ye(s)?s:1)+", "+(ye(u)?u:1)+", 1) "),ye(p)&&(E+="rotateZ("+p+"rad) "),ye(l)&&(E+="rotateX("+l+"rad) "),ye(c)&&(E+="rotateY("+c+"rad) "),E.length&&(b+="transform:"+E+";"),ye(r)&&(b+="opacity:"+r+";",r===0&&(b+="visibility:hidden;"),r<1&&(b+="pointer-events:none;")),ye(_)&&(b+="height:"+_+"px;"),ye(T)&&(b+="width:"+T+"px;");var P=e.elementCurrentStyle||"";(b.length!==P.length||b!==P)&&(e.style.cssText=b,e.elementCurrentStyle=b)},Ni={styles:Pi,listeners:Di,animations:_t,apis:Ai},Mr=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.layoutCalculated||(e.paddingTop=parseInt(r.paddingTop,10)||0,e.marginTop=parseInt(r.marginTop,10)||0,e.marginRight=parseInt(r.marginRight,10)||0,e.marginBottom=parseInt(r.marginBottom,10)||0,e.marginLeft=parseInt(r.marginLeft,10)||0,t.layoutCalculated=!0),e.left=t.offsetLeft||0,e.top=t.offsetTop||0,e.width=t.offsetWidth||0,e.height=t.offsetHeight||0,e.right=e.left+e.width,e.bottom=e.top+e.height,e.scrollTop=t.scrollTop,e.hidden=t.offsetParent===null,e},ve=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.tag,r=t===void 0?"div":t,n=e.name,o=n===void 0?null:n,a=e.attributes,s=a===void 0?{}:a,u=e.read,l=u===void 0?function(){}:u,c=e.write,p=c===void 0?function(){}:c,v=e.create,h=v===void 0?function(){}:v,T=e.destroy,_=T===void 0?function(){}:T,E=e.filterFrameActionsForChild,b=E===void 0?function(w,C){return C}:E,P=e.didCreateView,N=P===void 0?function(){}:P,R=e.didWriteView,z=R===void 0?function(){}:R,O=e.ignoreRect,J=O===void 0?!1:O,ee=e.ignoreRectUpdate,A=ee===void 0?!1:ee,B=e.mixins,G=B===void 0?[]:B;return function(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=me(r,"filepond--"+o,s),te=window.getComputedStyle(x,null),K=Mr(),q=null,y=!1,m=[],M=[],H={},Y={},j=[p],Q=[l],se=[_],le=function(){return x},ut=function(){return m.concat()},fi=function(){return H},Nu=function(W){return function(ke,ze){return ke(W,ze)}},di=function(){return q||(q=Ae(K,m,[0,0],[1,1]),q)},Bu=function(){return te},Fu=function(){q=null,m.forEach(function(ze){return ze._read()});var W=!(A&&K.width&&K.height);W&&Mr(K,x,te);var ke={root:je,props:C,rect:K};Q.forEach(function(ze){return ze(ke)})},Gu=function(W,ke,ze){var lt=ke.length===0;
1return j.forEach(function(De){var tt=De({props:C,root:je,actions:ke,timestamp:W,shouldOptimize:ze});tt===!1&&(lt=!1)}),M.forEach(function(De){var tt=De.write(W);tt===!1&&(lt=!1)}),m.filter(function(De){return!!De.element.parentNode}).forEach(function(De){var tt=De._write(W,b(De,ke),ze);tt||(lt=!1)}),m.forEach(function(De,tt){De.element.parentNode||(je.appendChild(De.element,tt),De._read(),De._write(W,b(De,ke),ze),lt=!1)}),y=lt,z({props:C,root:je,actions:ke,timestamp:W}),lt},xu=function(){M.forEach(function(W){return W.destroy()}),se.forEach(function(W){W({root:je,props:C})}),m.forEach(function(W){return W._destroy()})},pi={element:{get:le},style:{get:Bu},childViews:{get:ut}},vi=Object.assign({},pi,{rect:{get:di},ref:{get:fi},is:function(W){return o===W},appendChild:re(x),createChildView:Nu(w),linkView:function(W){return m.push(W),W},unlinkView:function(W){m.splice(m.indexOf(W),1)},appendChildView:_e(x,m),removeChildView:ue(x,m),registerWriter:function(W){return j.push(W)},registerReader:function(W){return Q.push(W)},registerDestroyer:function(W){return se.push(W)},invalidateLayout:function(){return x.layoutCalculated=!1},dispatch:w.dispatch,query:w.query}),mi={element:{get:le},childViews:{get:ut},rect:{get:di},resting:{get:function(){return y}},isRectIgnored:function(){return J},_read:Fu,_write:Gu,_destroy:xu},qu=Object.assign({},pi,{rect:{get:function(){return K}}});Object.keys(G).sort(function(oe,W){return oe==="styles"?1:W==="styles"?-1:0}).forEach(function(oe){var W=Ni[oe]({mixinConfig:G[oe],viewProps:C,viewState:Y,viewInternalAPI:vi,viewExternalAPI:mi,view:D(qu)});W&&M.push(W)});var je=D(vi);h({root:je,props:C});var Uu=Ce(x);return m.forEach(function(oe,W){je.appendChild(oe.element,Uu+W)}),N(je),D(mi)}},Bi=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:60,n="__framePainter";if(window[n]){window[n].readers.push(e),window[n].writers.push(t);return}window[n]={readers:[e],writers:[t]};var o=window[n],a=1e3/r,s=null,u=null,l=null,c=null,p=function(){document.hidden?(l=function(){return window.setTimeout(function(){return v(performance.now())},a)},c=function(){return window.clearTimeout(u)}):(l=function(){return window.requestAnimationFrame(v)},c=function(){return window.cancelAnimationFrame(u)})};document.addEventListener("visibilitychange",function(){c&&c(),p(),v(performance.now())});var v=function h(T){u=l(h),s||(s=T);var _=T-s;_<=a||(s=T-_%a,o.readers.forEach(function(E){return E()}),o.writers.forEach(function(E){return E(T)}))};return p(),v(performance.now()),{pause:function(){c(u)}}},be=function(e,t){return function(r){var n=r.root,o=r.props,a=r.actions,s=a===void 0?[]:a,u=r.timestamp,l=r.shouldOptimize;s.filter(function(c){return e[c.type]}).forEach(function(c){return e[c.type]({root:n,props:o,action:c.data,timestamp:u,shouldOptimize:l})}),t&&t({root:n,props:o,actions:s,timestamp:u,shouldOptimize:l})}},Nr=function(e,t){return t.parentNode.insertBefore(e,t)},Br=function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},yt=function(e){return Array.isArray(e)},Ve=function(e){return e==null},Fi=function(e){return e.trim()},bt=function(e){return""+e},Gi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return Ve(e)?[]:yt(e)?e:bt(e).split(t).map(Fi).filter(function(r){return r.length})},Fr=function(e){return typeof e=="boolean"},Gr=function(e){return Fr(e)?e:e==="true"},Se=function(e){return typeof e=="string"},xr=function(e){return ie(e)?e:Se(e)?bt(e).replace(/[a-z]+/gi,""):0},St=function(e){return parseInt(xr(e),10)},qr=function(e){return parseFloat(xr(e))},rt=function(e){return ie(e)&&isFinite(e)&&Math.floor(e)===e},Ur=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;if(rt(e))return e;var r=bt(e).trim();return/MB$/i.test(r)?(r=r.replace(/MB$i/,"").trim(),St(r)*t*t):/KB/i.test(r)?(r=r.replace(/KB$i/,"").trim(),St(r)*t):St(r)},We=function(e){return typeof e=="function"},xi=function(e){for(var t=self,r=e.split("."),n=null;n=r.shift();)if(t=t[n],!t)return null;return t},Vr={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},qi=function(e){var t={};return t.url=Se(e)?e:e.url||"",t.timeout=e.timeout?parseInt(e.timeout,10):0,t.headers=e.headers?e.headers:{},S(Vr,function(r){t[r]=Ui(r,e[r],Vr[r],t.timeout,t.headers)}),t.process=e.process||Se(e)||e.url?t.process:null,t.remove=e.remove||null,delete t.headers,t},Ui=function(e,t,r,n,o){if(t===null)return null;if(typeof t=="function")return t;var a={url:r==="GET"||r==="PATCH"?"?"+e+"=":"",method:r,headers:o,withCredentials:!1,timeout:n,onload:null,ondata:null,onerror:null};if(Se(t))return a.url=t,a;if(Object.assign(a,t),Se(a.headers)){var s=a.headers.split(/:(.+)/);a.headers={header:s[0],value:s[1]}}return a.withCredentials=Gr(a.withCredentials),a},Vi=function(e){return qi(e)},Hi=function(e){return e===null},he=function(e){return typeof e=="object"&&e!==null},ki=function(e){return he(e)&&Se(e.url)&&he(e.process)&&he(e.revert)&&he(e.restore)&&he(e.fetch)},Xt=function(e){return yt(e)?"array":Hi(e)?"null":rt(e)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(e)?"bytes":ki(e)?"api":typeof e},zi=function(e){return e.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",')},Yi={array:Gi,boolean:Gr,int:function(e){return Xt(e)==="bytes"?Ur(e):St(e)},number:qr,float:qr,bytes:Ur,string:function(e){return We(e)?e:bt(e)},function:function(e){return xi(e)},serverapi:Vi,object:function(e){try{return JSON.parse(zi(e))}catch{return null}}},ji=function(e,t){return Yi[t](e)},Hr=function(e,t,r){if(e===t)return e;var n=Xt(e);if(n!==r){var o=ji(e,r);if(n=Xt(o),o===null)throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+r
1+'"';e=o}return e},Wi=function(e,t){var r=e;return{enumerable:!0,get:function(){return r},set:function(o){r=Hr(o,e,t)}}},$i=function(e){var t={};return S(e,function(r){var n=e[r];t[r]=Wi(n[0],n[1])}),D(t)},Xi=function(e){return{items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:$i(e)}},Rt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"-";return e.split(/(?=[A-Z])/).map(function(r){return r.toLowerCase()}).join(t)},Qi=function(e,t){var r={};return S(t,function(n){r[n]={get:function(){return e.getState().options[n]},set:function(a){e.dispatch("SET_"+Rt(n,"_").toUpperCase(),{value:a})}}}),r},Ki=function(e){return function(t,r,n){var o={};return S(e,function(a){var s=Rt(a,"_").toUpperCase();o["SET_"+s]=function(u){try{n.options[a]=u.value}catch{}t("DID_SET_"+s,{value:n.options[a]})}}),o}},Zi=function(e){return function(t){var r={};return S(e,function(n){r["GET_"+Rt(n,"_").toUpperCase()]=function(o){return t.options[n]}}),r}},Me={API:1,DROP:2,BROWSE:3,PASTE:4,NONE:5},Qt=function(){return Math.random().toString(36).substring(2,11)};function Kt(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Kt=function(e){return typeof e}:Kt=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kt(i)}var Zt;function fl(i,e,t,r){Zt||(Zt=typeof Symbol=="function"&&Symbol.for&&Symbol.for("react.element")||60103);var n=i&&i.defaultProps,o=arguments.length-3;if(!e&&o!==0&&(e={children:void 0}),e&&n)for(var a in n)e[a]===void 0&&(e[a]=n[a]);else e||(e=n||{});if(o===1)e.children=r;else if(o>1){for(var s=new Array(o),u=0;u<o;u++)s[u]=arguments[u+3];e.children=s}return{$$typeof:Zt,type:i,key:t===void 0?null:""+t,ref:null,props:e,_owner:null}}function dl(i){var e;if(typeof Symbol<"u"&&(Symbol.asyncIterator&&(e=i[Symbol.asyncIterator],e!=null)||Symbol.iterator&&(e=i[Symbol.iterator],e!=null)))return e.call(i);throw new TypeError("Object is not async iterable")}function kr(i){this.wrapped=i}function ft(i){var e,t;function r(a,s){return new Promise(function(u,l){var c={key:a,arg:s,resolve:u,reject:l,next:null};t?t=t.next=c:(e=t=c,n(a,s))})}function n(a,s){try{var u=i[a](s),l=u.value,c=l instanceof kr;Promise.resolve(c?l.wrapped:l).then(function(p){if(c){n("next",p);return}o(u.done?"return":"normal",p)},function(p){n("throw",p)})}catch(p){o("throw",p)}}function o(a,s){switch(a){case"return":e.resolve({value:s,done:!0});break;case"throw":e.reject(s);break;default:e.resolve({value:s,done:!1});break}e=e.next,e?n(e.key,e.arg):t=null}this._invoke=r,typeof i.return!="function"&&(this.return=void 0)}typeof Symbol=="function"&&Symbol.asyncIterator&&(ft.prototype[Symbol.asyncIterator]=function(){return this}),ft.prototype.next=function(i){return this._invoke("next",i)},ft.prototype.throw=function(i){return this._invoke("throw",i)},ft.prototype.return=function(i){return this._invoke("return",i)};function pl(i){return function(){return new ft(i.apply(this,arguments))}}function vl(i){return new kr(i)}function ml(i,e){var t={},r=!1;function n(o,a){return r=!0,a=new Promise(function(s){s(i[o](a))}),{done:!1,value:e(a)}}return typeof Symbol=="function"&&Symbol.iterator&&(t[Symbol.iterator]=function(){return this}),t.next=function(o){return r?(r=!1,o):n("next",o)},typeof i.throw=="function"&&(t.throw=function(o){if(r)throw r=!1,o;return n("throw",o)}),typeof i.return=="function"&&(t.return=function(o){return n("return",o)}),t}function zr(i,e,t,r,n,o,a){try{var s=i[o](a),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,n)}function gl(i){return function(){var e=this,t=arguments;return new Promise(function(r,n){var o=i.apply(e,t);function a(u){zr(o,r,n,a,s,"next",u)}function s(u){zr(o,r,n,a,s,"throw",u)}a(void 0)})}}function El(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Yr(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function hl(i,e,t){return e&&Yr(i.prototype,e),t&&Yr(i,t),i}function Il(i,e){for(var t in e){var r=e[t];r.configurable=r.enumerable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,t,r)}if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(e),o=0;o<n.length;o++){var a=n[o],r=e[a];r.configurable=r.enumerable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,a,r)}return i}function Tl(i,e){for(var t=Object.getOwnPropertyNames(e),r=0;r<t.length;r++){var n=t[r],o=Object.getOwnPropertyDescriptor(e,n);o&&o.configurable&&i[n]===void 0&&Object.defineProperty(i,n,o)}return i}function Jt(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function jr(){return jr=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},jr.apply(this,arguments)}function _l(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},r=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),r.forEach(function(n){Jt(i,n,t[n])})}return i}function Wr(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function yl(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
1e%2?Wr(t,!0).forEach(function(r){Jt(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Wr(t).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function Ji(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&dt(i,e)}function bl(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}function Ot(i){return Ot=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ot(i)}function dt(i,e){return dt=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},dt(i,e)}function eo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(i,e,t){return eo()?wt=Reflect.construct:wt=function(n,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(n,s),l=new u;return a&&dt(l,a.prototype),l},wt.apply(null,arguments)}function to(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function er(i){var e=typeof Map=="function"?new Map:void 0;return er=function(r){if(r===null||!to(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,n)}function n(){return wt(r,arguments,Ot(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),dt(n,r)},er(i)}function Sl(i,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](i):i instanceof e}function Rl(i){return i&&i.__esModule?i:{default:i}}function Ol(i){if(i&&i.__esModule)return i;var e={};if(i!=null){for(var t in i)if(Object.prototype.hasOwnProperty.call(i,t)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(i,t):{};r.get||r.set?Object.defineProperty(e,t,r):e[t]=i[t]}}return e.default=i,e}function wl(i,e){if(i!==e)throw new TypeError("Cannot instantiate an arrow function")}function Dl(i){if(i==null)throw new TypeError("Cannot destructure undefined")}function ro(i,e){if(i==null)return{};var t={},r=Object.keys(i),n,o;for(o=0;o<r.length;o++)n=r[o],!(e.indexOf(n)>=0)&&(t[n]=i[n]);return t}function no(i,e){if(i==null)return{};var t=ro(i,e),r,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(n=0;n<o.length;n++)r=o[n],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(i,r)&&(t[r]=i[r])}return t}function io(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Al(i,e){return e&&(typeof e=="object"||typeof e=="function")?e:io(i)}function $r(i,e){for(;!Object.prototype.hasOwnProperty.call(i,e)&&(i=Ot(i),i!==null););return i}function tr(i,e,t){return typeof Reflect<"u"&&Reflect.get?tr=Reflect.get:tr=function(n,o,a){var s=$r(n,o);if(s){var u=Object.getOwnPropertyDescriptor(s,o);return u.get?u.get.call(a):u.value}},tr(i,e,t||i)}function Dt(i,e,t,r){return typeof Reflect<"u"&&Reflect.set?Dt=Reflect.set:Dt=function(o,a,s,u){var l=$r(o,a),c;if(l){if(c=Object.getOwnPropertyDescriptor(l,a),c.set)return c.set.call(u,s),!0;if(!c.writable)return!1}if(c=Object.getOwnPropertyDescriptor(u,a),c){if(!c.writable)return!1;c.value=s,Object.defineProperty(u,a,c)}else Jt(u,a,s);return!0},Dt(i,e,t,r)}function Ll(i,e,t,r,n){var o=Dt(i,e,t,r||i);if(!o&&n)throw new Error("failed to set property");return t}function Pl(i,e){return e||(e=i.slice(0)),Object.freeze(Object.defineProperties(i,{raw:{value:Object.freeze(e)}}))}function Cl(i,e){return e||(e=i.slice(0)),i.raw=e,i}function Ml(i,e){if(i===oo)throw new ReferenceError(e+" is not defined - temporal dead zone");return i}function Nl(i){throw new Error('"'+i+'" is read-only')}function Bl(i){throw new Error('Class "'+i+'" cannot be referenced in computed property keys.')}var oo={};function Fl(i,e){return rr(i)||uo(i,e)||nr()}function Gl(i,e){return rr(i)||lo(i,e)||nr()}function ao(i){return rr(i)||Xr(i)||nr()}function At(i){return so(i)||Xr(i)||co()}function so(i){if(Array.isArray(i)){for(var e=0,t=new Array(i.length);e<i.length;e++)t[e]=i[e];return t}}function rr(i){if(Array.isArray(i))return i}function Xr(i){if(Symbol.iterator in Object(i)||Object.prototype.toString.call(i)==="[object Arguments]")return Array.from(i)}function uo(i,e){var t=[],r=!0,n=!1,o=void 0;try{for(var a=i[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(t.push(s.value),!(e&&t.length===e));r=!0);}catch(u){n=!0,o=u}finally{try{!r&&a.return!=null&&a.return()}finally{if(n)throw o}}return t}function lo(i,e){for(var t=[],r=i[Symbol.iterator](),n;!(n=r.next()).done&&(t.push(n.value),!(e&&t.length===e)););return t}function co(){throw new TypeError("Invalid attempt to spread non-iterable instance")}
1function nr(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function xl(i){return function(){var e=i.apply(this,arguments);return e.next(),e}}function fo(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Qr(i){var e=fo(i,"string");return typeof e=="symbol"?e:String(e)}function ql(i,e){throw new Error("Decorating class property failed. Please ensure that proposal-class-properties is enabled and set to use loose mode. To use proposal-class-properties in spec mode with decorators, wait for the next major version of decorators in stage 2.")}function Ul(i,e,t,r){t&&Object.defineProperty(i,e,{enumerable:t.enumerable,configurable:t.configurable,writable:t.writable,value:t.initializer?t.initializer.call(r):void 0})}function Vl(i,e,t,r,n){var o={};return Object.keys(r).forEach(function(a){o[a]=r[a]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=t.slice().reverse().reduce(function(a,s){return s(i,e,a)||a},o),n&&o.initializer!==void 0&&(o.value=o.initializer?o.initializer.call(n):void 0,o.initializer=void 0),o.initializer===void 0&&(Object.defineProperty(i,e,o),o=null),o}var po=0;function Hl(i){return"__private_"+po+++"_"+i}function kl(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}function zl(i,e){var t=e.get(i);if(!t)throw new TypeError("attempted to get private field on non-instance");return t.get?t.get.call(i):t.value}function Yl(i,e,t){var r=e.get(i);if(!r)throw new TypeError("attempted to set private field on non-instance");if(r.set)r.set.call(i,t);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=t}return t}function jl(i,e){if(!e.has(i))throw new TypeError("attempted to set private field on non-instance");var t=e.get(i);if(t.set)return"__destrObj"in t||(t.__destrObj={set value(r){t.set.call(i,r)}}),t.__destrObj;if(!t.writable)throw new TypeError("attempted to set read only private field");return t}function Wl(i,e,t){if(i!==e)throw new TypeError("Private static access of wrong provenance");return t.value}function $l(i,e,t,r){if(i!==e)throw new TypeError("Private static access of wrong provenance");if(!t.writable)throw new TypeError("attempted to set read only private field");return t.value=r,r}function Xl(i,e,t){if(i!==e)throw new TypeError("Private static access of wrong provenance");return t}function Ql(){throw new TypeError("attempted to set read only static private field")}function Kl(i,e,t,r){var n=Kr();if(r)for(var o=0;o<r.length;o++)n=r[o](n);var a=e(function(l){n.initializeInstanceElements(l,s.elements)},t),s=n.decorateClass(go(a.d.map(vo)),i);return n.initializeClassElements(a.F,s.elements),n.runClassFinishers(a.F,s.finishers)}function Kr(){Kr=function(){return i};var i={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(r){t.forEach(function(n){n.kind===r&&n.placement==="own"&&this.defineClassElement(e,n)},this)},this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach(function(n){t.forEach(function(o){var a=o.placement;if(o.kind===n&&(a==="static"||a==="prototype")){var s=a==="static"?e:r;this.defineClassElement(s,o)}},this)},this)},defineClassElement:function(e,t){var r=t.descriptor;if(t.kind==="field"){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:n===void 0?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],o={static:[],prototype:[],own:[]};if(e.forEach(function(s){this.addElementPlacement(s,o)},this),e.forEach(function(s){if(!pt(s))return r.push(s);var u=this.decorateElement(s,o);r.push(u.element),r.push.apply(r,u.extras),n.push.apply(n,u.finishers)},this),!t)return{elements:r,finishers:n};var a=this.decorateConstructor(r,t);return n.push.apply(n,a.finishers),a.finishers=n,a},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&n.indexOf(e.key)!==-1)throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],o=e.decorators,a=o.length-1;a>=0;a--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var u=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,o[a])(u)||u);e=l.element,this.addElementPlacement(e,t),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var p=0;p<c.length;p++)this.addElementPlacement(c[p],t);r.push.apply(r,c)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=0;n--){var o=this.fromClassDescriptor(e),a=this.toClassDescriptor((0,t[n])(o)||o);if(a.finisher!==void 0&&r.push(a.finisher),a.elements!==void 0){e=a.elements;for(var s=0;s<e.length-1;s++)for(var u=s+1;u<e.length;u++)if(e[s].key===e[u].key&&e[s].placement===e[u].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor},r={value:"Descriptor",configurable:!0};return Object.defineProperty(t,Symbol.toStringTag,r),e.kind==="field"&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){if(e!==void 0)return ao(e).map(function(t){var r=this.toElementDescriptor(t);return this.disallowProperty(t,"finisher","An element descriptor"),this.disallowProperty(t,"extras","An element descriptor"),r},this)},toElementDescriptor:function(e){var t=String(e.kind);if(t!=="method"&&t!=="field")throw new TypeError(`An element descriptor's .kind property must be either "method" or "f
1ield", but a decorator created an element descriptor with .kind "`+t+'"');var r=Qr(e.key),n=String(e.placement);if(n!=="static"&&n!=="prototype"&&n!=="own")throw new TypeError(`An element descriptor's .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "`+n+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var a={kind:t,key:r,placement:n,descriptor:Object.assign({},o)};return t!=="field"?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),a.initializer=e.initializer),a},toElementFinisherExtras:function(e){var t=this.toElementDescriptor(e),r=Jr(e,"finisher"),n=this.toElementDescriptors(e.extras);return{element:t,finisher:r,extras:n}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)},r={value:"Descriptor",configurable:!0};return Object.defineProperty(t,Symbol.toStringTag,r),t},toClassDescriptor:function(e){var t=String(e.kind);if(t!=="class")throw new TypeError(`A class descriptor's .kind property must be "class", but a decorator created a class descriptor with .kind "`+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=Jr(e,"finisher"),n=this.toElementDescriptors(e.elements);return{elements:n,finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(n!==void 0){if(typeof n!="function")throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(e[t]!==void 0)throw new TypeError(r+" can't have a ."+t+" property.")}};return i}function vo(i){var e=Qr(i.key),t;i.kind==="method"?t={value:i.value,writable:!0,configurable:!0,enumerable:!1}:i.kind==="get"?t={get:i.value,configurable:!0,enumerable:!1}:i.kind==="set"?t={set:i.value,configurable:!0,enumerable:!1}:i.kind==="field"&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:i.kind==="field"?"field":"method",key:e,placement:i.static?"static":i.kind==="field"?"own":"prototype",descriptor:t};return i.decorators&&(r.decorators=i.decorators),i.kind==="field"&&(r.initializer=i.value),r}function mo(i,e){i.descriptor.get!==void 0?e.descriptor.get=i.descriptor.get:e.descriptor.set=i.descriptor.set}function go(i){for(var e=[],t=function(a){return a.kind==="method"&&a.key===n.key&&a.placement===n.placement},r=0;r<i.length;r++){var n=i[r],o;if(n.kind==="method"&&(o=e.find(t)))if(Zr(n.descriptor)||Zr(o.descriptor)){if(pt(n)||pt(o))throw new ReferenceError("Duplicated methods ("+n.key+") can't be decorated.");o.descriptor=n.descriptor}else{if(pt(n)){if(pt(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+n.key+").");o.decorators=n.decorators}mo(n,o)}else e.push(n)}return e}function pt(i){return i.decorators&&i.decorators.length}function Zr(i){return i!==void 0&&!(i.value===void 0&&i.writable===void 0)}function Jr(i,e){var t=i[e];if(t!==void 0&&typeof t!="function")throw new TypeError("Expected '"+e+"' to be a function");return t}function Zl(i,e,t){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return t}function Jl(){throw new TypeError("attempted to reassign private method")}function en(i,e){en=function(s,u){return new o(s,u)};var t=er(RegExp),r=RegExp.prototype,n=new WeakMap;function o(s,u){var l=t.call(this,s);return n.set(l,u),l}Ji(o,t),o.prototype.exec=function(s){var u=r.exec.call(this,s);return u&&(u.groups=a(u,this)),u},o.prototype[Symbol.replace]=function(s,u){if(typeof u=="string"){var l=n.get(this);return r[Symbol.replace].call(this,s,u.replace(/\$<([^>]+)>/g,function(p,v){return"$"+l[v]}))}else if(typeof u=="function"){var c=this;return r[Symbol.replace].call(this,s,function(){var p=[];
1return p.push.apply(p,arguments),typeof p[p.length-1]!="object"&&p.push(a(p,c)),u.apply(this,p)})}else return r[Symbol.replace].call(this,s,u)};function a(s,u){var l=n.get(u);return Object.keys(l).reduce(function(c,p){return c[p]=s[l[p]],c},Object.create(null))}return en.apply(this,arguments)}var ir=function(e,t){return e.splice(t,1)},Eo=function(e,t){t?e():document.hidden?Promise.resolve(1).then(e):setTimeout(e,0)},Lt=function(){var e=[],t=function(o,a){ir(e,e.findIndex(function(s){return s.event===o&&(s.cb===a||!a)}))},r=function(o,a,s){e.filter(function(u){return u.event===o}).map(function(u){return u.cb}).forEach(function(u){return Eo(function(){return u.apply(void 0,At(a))},s)})};return{fireSync:function(o){for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];r(o,s,!0)},fire:function(o){for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];r(o,s,!1)},on:function(o,a){e.push({event:o,cb:a})},onOnce:function(o,a){e.push({event:o,cb:function(){t(o,a),a.apply(void 0,arguments)}})},off:t}},tn=function(e,t,r){Object.getOwnPropertyNames(e).filter(function(n){return!r.includes(n)}).forEach(function(n){return Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})},ho=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],we=function(e){var t={};return tn(e,t,ho),t},Io=function(e){e.forEach(function(t,r){t.released&&ir(e,r)})},V={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},Ee={INPUT:1,LIMBO:2,LOCAL:3},rn=function(e){return/[^0-9]+/.exec(e)},nn=function(){return rn(1.1.toLocaleString())[0]},To=function(){var e=nn(),t=1e3.toLocaleString(),r="1000";return t!==r?rn(t)[0]:e==="."?",":"."},I={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},or=[],Fe=function(e,t,r){return new Promise(function(n,o){var a=or.filter(function(u){return u.key===e}).map(function(u){return u.cb});if(a.length===0){n(t);return}var s=a.shift();a.reduce(function(u,l){return u.then(function(c){return l(c,r)})},s(t,r)).then(function(u){return n(u)}).catch(function(u){return o(u)})})},$e=function(e,t,r){return or.filter(function(n){return n.key===e}).map(function(n){return n.cb(t,r)})},_o=function(e,t){return or.push({key:e,cb:t})},yo=function(e){return Object.assign(nt,e)},Pt=function(){return Object.assign({},nt)},bo=function(e){S(e,function(t,r){nt[t]&&(nt[t][0]=Hr(r,nt[t][0],nt[t][1]))})},nt={id:[null,I.STRING],name:["filepond",I.STRING],disabled:[!1,I.BOOLEAN],className:[null,I.STRING],required:[!1,I.BOOLEAN],captureMethod:[null,I.STRING],allowSyncAcceptAttribute:[!0,I.BOOLEAN],allowDrop:[!0,I.BOOLEAN],allowBrowse:[!0,I.BOOLEAN],allowPaste:[!0,I.BOOLEAN],allowMultiple:[!1,I.BOOLEAN],allowReplace:[!0,I.BOOLEAN],allowRevert:[!0,I.BOOLEAN],allowRemove:[!0,I.BOOLEAN],allowProcess:[!0,I.BOOLEAN],allowReorder:[!1,I.BOOLEAN],allowDirectoriesOnly:[!1,I.BOOLEAN],storeAsFile:[!1,I.BOOLEAN],forceRevert:[!1,I.BOOLEAN],maxFiles:[null,I.INT],checkValidity:[!1,I.BOOLEAN],itemInsertLocationFreedom:[!0,I.BOOLEAN],itemInsertLocation:["before",I.STRING],itemInsertInterval:[75,I.INT],dropOnPage:[!1,I.BOOLEAN],dropOnElement:[!0,I.BOOLEAN],dropValidation:[!1,I.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],I.ARRAY],instantUpload:[!0,I.BOOLEAN],maxParallelUploads:[2,I.INT],allowMinimumUploadDuration:[!0,I.BOOLEAN],chunkUploads:[!1,I.BOOLEAN],chunkForce:[!1,I.BOOLEAN],chunkSize:[5e6,I.INT],chunkRetryDelays:[[500,1e3,3e3],I.ARRAY],server:[null,I.SERVER_API],fileSizeBase:[1e3,I.INT],labelFileSizeBytes:["bytes",I.STRING],labelFileSizeKilobytes:["KB",I.STRING],labelFileSizeMegabytes:["MB",I.STRING],labelFileSizeGigabytes:["GB",I.STRING],labelDecimalSeparator:[nn(),I.STRING],labelThousandsSeparator:[To(),I.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>
1',I.STRING],labelInvalidField:["Field contains invalid files",I.STRING],labelFileWaitingForSize:["Waiting for size",I.STRING],labelFileSizeNotAvailable:["Size not available",I.STRING],labelFileCountSingular:["file in list",I.STRING],labelFileCountPlural:["files in list",I.STRING],labelFileLoading:["Loading",I.STRING],labelFileAdded:["Added",I.STRING],labelFileLoadError:["Error during load",I.STRING],labelFileRemoved:["Removed",I.STRING],labelFileRemoveError:["Error during remove",I.STRING],labelFileProcessing:["Uploading",I.STRING],labelFileProcessingComplete:["Upload complete",I.STRING],labelFileProcessingAborted:["Upload cancelled",I.STRING],labelFileProcessingError:["Error during upload",I.STRING],labelFileProcessingRevertError:["Error during revert",I.STRING],labelTapToCancel:["tap to cancel",I.STRING],labelTapToRetry:["tap to retry",I.STRING],labelTapToUndo:["tap to undo",I.STRING],labelButtonRemoveItem:["Remove",I.STRING],labelButtonAbortItemLoad:["Abort",I.STRING],labelButtonRetryItemLoad:["Retry",I.STRING],labelButtonAbortItemProcessing:["Cancel",I.STRING],labelButtonUndoItemProcessing:["
1Undo",I.STRING],labelButtonRetryItemProcessing:["Retry",I.STRING],labelButtonProcessItem:["Upload",I.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',I.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',I.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',I.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',I.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',I.STRING],oninit:[null,I.FUNCTION],onwarning:[null,I.FUNCTION],onerror:[null,I.FUNCTION],onactivatefile:[null,I.FUNCTION],oninitfile:[null,I.FUNCTION],onaddfilestart:[null,I.FUNCTION],onaddfileprogress:[null,I.FUNCTION],onaddfile:[null,I.FUNCTION],onprocessfilestart:[null,I.FUNCTION],onprocessfileprogress:[null,I.FUNCTION],onprocessfileabort:[null,I.FUNCTION],onprocessfilerevert:[null,I.FUNCTION],onprocessfile:[null,I.FUNCTION],onprocessfiles:[null,I.FUNCTION],onremovefile:[null,I.FUNCTION],onpreparefile:[null,I.FUNCTION],onupdatefiles:[null,I.FUNCTION],onreorderfiles:[null,I.FUNCTION],beforeDropFile:[null,I.FUNCTION],beforeAddFile:[null,I.FUNCTION],beforeRemoveFile:[null,I.FUNCTION],beforePrepareFile:[null,I.FUNCTION],stylePanelLayout:[null,I.STRING],stylePanelAspectRatio:[null,I.STRING],styleItemPanelAspectRatio:[null,I.STRING],styleButtonRemoveItemPosition:["left",I.STRING],styleButtonProcessItemPosition:["right",I.STRING],styleLoadIndicatorPosition:["right",I.STRING],styleProgressIndicatorPosition:["right",I.STRING],styleButtonRemoveItemAlign:[!1,I.BOOLEAN],files:[[],I.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],I.ARRAY]},Xe=function(e,t){return Ve(t)?e[0]||null:rt(t)?e[t]||null:(typeof t=="object"&&(t=t.id),e.find(function(r){return r.id===t})||null)},on=function(e){if(Ve(e))return e;if(/:/.test(e)){var t=e.split(":");return t[1]/t[0]}return parseFloat(e)},Ge=function(e){return e.filter(function(t){return!t.archived})},it={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4},Ct=null,So=function(){if(Ct===null)try{var e=new DataTransfer;e.items.add(new File(["hello world"],"This_Works.txt"));var t=document.createElement("input");t.setAttribute("type","file"),t.files=e.files,Ct=t.files.length===1}catch{Ct=!1}return Ct},Ro=[V.LOAD_ERROR,V.PROCESSING_ERROR,V.PROCESSING_REVERT_ERROR],Oo=[V.LOADING,V.PROCESSING,V.PROCESSING_QUEUED,V.INIT],wo=[V.PROCESSING_COMPLETE],Do=function(e){return Ro.includes(e.status)},Ao=function(e){return Oo.includes(e.status)},Lo=function(e){return wo.includes(e.status)},an=function(e){return he(e.options.server)&&(he(e.options.server.process)||We(e.options.server.process))},Po=function(e){return{GET_STATUS:function(){var r=Ge(e.items),n=it.EMPTY,o=it.ERROR,a=it.BUSY,s=it.IDLE,u=it.READY;
1return r.length===0?n:r.some(Do)?o:r.some(Ao)?a:r.some(Lo)?u:s},GET_ITEM:function(r){return Xe(e.items,r)},GET_ACTIVE_ITEM:function(r){return Xe(Ge(e.items),r)},GET_ACTIVE_ITEMS:function(){return Ge(e.items)},GET_ITEMS:function(){return e.items},GET_ITEM_NAME:function(r){var n=Xe(e.items,r);return n?n.filename:null},GET_ITEM_SIZE:function(r){var n=Xe(e.items,r);return n?n.fileSize:null},GET_STYLES:function(){return Object.keys(e.options).filter(function(r){return/^style/.test(r)}).map(function(r){return{name:r,value:e.options[r]}})},GET_PANEL_ASPECT_RATIO:function(){var r=/circle/.test(e.options.stylePanelLayout),n=r?1:on(e.options.stylePanelAspectRatio);return n},GET_ITEM_PANEL_ASPECT_RATIO:function(){return e.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function(r){return Ge(e.items).filter(function(n){return n.status===r})},GET_TOTAL_ITEMS:function(){return Ge(e.items).length},SHOULD_UPDATE_FILE_INPUT:function(){return e.options.storeAsFile&&So()&&!an(e)},IS_ASYNC:function(){return an(e)},GET_FILE_SIZE_LABELS:function(r){return{labelBytes:r("GET_LABEL_FILE_SIZE_BYTES")||void 0,labelKilobytes:r("GET_LABEL_FILE_SIZE_KILOBYTES")||void 0,labelMegabytes:r("GET_LABEL_FILE_SIZE_MEGABYTES")||void 0,labelGigabytes:r("GET_LABEL_FILE_SIZE_GIGABYTES")||void 0}}}},Co=function(e){var t=Ge(e.items).length;if(!e.options.allowMultiple)return t===0;var r=e.options.maxFiles;return r===null||t<r},sn=function(e,t,r){return Math.max(Math.min(r,e),t)},Mo=function(e,t,r){return e.splice(t,0,r)},No=function(e,t,r){return Ve(t)?null:typeof r>"u"?(e.push(t),t):(r=sn(r,0,e.length),Mo(e,r,t),t)},ar=function(e){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(e)},vt=function(e){return(""+e).split("/").pop().split("?").shift()},Mt=function(e){return e.split(".").pop()},Bo=function(e){if(typeof e!="string")return"";var t=e.split("/").pop();return/svg/.test(t)?"svg":/zip|compressed/.test(t)?"zip":/plain/.test(t)?"txt":/msword/.test(t)?"doc":/[a-z]+/.test(t)?t==="jpeg"?"jpg":t:""},mt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(t+e).slice(-t.length)},un=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return e.getFullYear()+"-"+mt(e.getMonth()+1,"00")+"-"+mt(e.getDate(),"00")+"_"+mt(e.getHours(),"00")+"-"+mt(e.getMinutes(),"00")+"-"+mt(e.getSeconds(),"00")},ot=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=typeof r=="string"?e.slice(0,e.size,r):e.slice(0,e.size,e.type);return o.lastModifiedDate=new Date,e._relativePath&&(o._relativePath=e._relativePath),Se(t)||(t=un()),t&&n===null&&Mt(t)?o.name=t:(n=n||Bo(o.type),o.name=t+(n?"."+n:"")),o},Fo=function(){return window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder},ln=function(e,t){var r=Fo();if(r){var n=new r;return n.append(e),n.getBlob(t)}return new Blob([e],{type:t})},Go=function(e,t){for(var r=new ArrayBuffer(e.length),n=new Uint8Array(r),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return ln(r,t)},cn=function(e){return(/^data:(.+);/.exec(e)||[])[1]||null},xo=function(e){var t=e.split(",")[1];return t.replace(/\s/g,"")},qo=function(e){return atob(xo(e))},Uo=function(e){var t=cn(e),r=qo(e);return Go(r,t)},Vo=function(e,t,r){return ot(Uo(e),t,null,r)},Ho=function(e){if(!/^content-disposition:/i.test(e))return null;var t=e.split(/filename=|filename\*=.+''/).splice(1).map(function(r){return r.trim().replace(/^["']|[;"']{0,2}$/g,"")}).filter(function(r){return r.length});return t.length?decodeURI(t[t.length-1]):null},ko=function(e){if(/content-length:/i.test(e)){var t=e.match(/[0-9]+/)[0];return t?parseInt(t,10):null}return null},zo=function(e){if(/x-content-transfer-id:/i.test(e)){var t=(e.split(":")[1]||"").trim();return t||null}return null},sr=function(e){var t={source:null,name:null,size:null},r=e.split(` 2`),n=!0,o=!1,a=void 0;try{for(var s=r[Symbol.iterator](),u;!(n=(u=s.next()).done);n=!0){var l=u.value,c=Ho(l);if(c){t.name=c;continue}var p=ko(l);if(p){t.size=p;continue}var v=zo(l);if(v){t.source=v;continue}}}catch(h){o=!0,a=h}finally{try{!n&&s.return!=null&&s.return()}finally{if(o)throw a}}return t},Yo=function(e){var t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},r=function(){return t.progress},n=function(){t.request&&t.request.abort&&t.request.abort()},o=function(){var l=t.source;s.fire("init",l),l instanceof File?s.fire("load",l):l instanceof Blob?s.fire("load",ot(l,l.name)):ar(l)?s.fire("load",Vo(l)):a(l)},a=function(l){if(!e){s.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=e(l,function(c){t.duration=Date.now()-t.timestamp,t.complete=!0,c instanceof Blob&&(c=ot(c,c.name||vt(l))),s.fire("load",c instanceof Blob?c:c?c.body:null)},function(c){s.fire("error",typeof c=="string"?{type:"error",code:0,body:c}:c)},function(c,p,v){if(v&&(t.size=v),t.duration=Date.now()-t.timestamp,!c){t.progress=null;return}t.progress=p/v,s.fire("progress",t.progress)},function(){s.fire("abort")},function(c){var p=sr(typeof c=="string"?c:c.headers);s.fire("meta",{size:t.size||p.size,filename:p.name,source:p.source})})},s=Object.assign({},Lt(),{setSource:function(l){return t.source=l},getProgress:r,abort:n,load:o});return s},fn=function(e){return/GET|HEAD/.test(e)},Qe=function(e,t,r){var n={onheaders:function(){},onprogress:function(){},onload:function(){},ontimeout:function(){},onerror:function(){},onabort:function(){},abort:function(){o=!0,s.abort()}},o=!1,a=!1;r=Object.assign({method:"POST",headers:{},withCredentials:!1},r),t=encodeURI(t),fn(r.method)&&e&&(t=""+t+encodeURIComponent(typeof e=="string"?e:JSON.stringify(e)));var s=new XMLHttpRequest,u=fn(r.method)?s:s.upload;return u.onprogress=function(l){o||n.onprogress(l.lengthComputable,l.loaded,l.total)},s.onreadystatechange=function(){s.readyState<2||s.readyState===4&&s.status===0||a||(a=!0,n.onheaders(s))},s.onload=function(){s.status>
2=200&&s.status<300?n.onload(s):n.onerror(s)},s.onerror=function(){return n.onerror(s)},s.onabort=function(){o=!0,n.onabort()},s.ontimeout=function(){return n.ontimeout(s)},s.open(r.method,t,!0),rt(r.timeout)&&(s.timeout=r.timeout),Object.keys(r.headers).forEach(function(l){var c=unescape(encodeURIComponent(r.headers[l]));s.setRequestHeader(l,c)}),r.responseType&&(s.responseType=r.responseType),r.withCredentials&&(s.withCredentials=!0),s.send(e),n},fe=function(e,t,r,n){return{type:e,code:t,body:r,headers:n}},Ke=function(e){return function(t){e(fe("error",0,"Timeout",t.getAllResponseHeaders()))}},dn=function(e){return/\?/.test(e)},gt=function(){for(var e="",t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach(function(o){e+=dn(e)&&dn(o)?o.replace(/\?/,"&"):o}),e},ur=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(typeof t=="function")return t;if(!t||!Se(t.url))return null;var r=t.onload||function(o){return o},n=t.onerror||function(o){return null};return function(o,a,s,u,l,c){var p=Qe(o,gt(e,t.url),Object.assign({},t,{responseType:"blob"}));return p.onload=function(v){var h=v.getAllResponseHeaders(),T=sr(h).name||vt(o);a(fe("load",v.status,t.method==="HEAD"?null:ot(r(v.response),T),h))},p.onerror=function(v){s(fe("error",v.status,n(v.response)||v.statusText,v.getAllResponseHeaders()))},p.onheaders=function(v){c(fe("headers",v.status,null,v.getAllResponseHeaders()))},p.ontimeout=Ke(s),p.onprogress=u,p.onabort=l,p}},Ne={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},jo=function(e,t,r,n,o,a,s,u,l,c,p){for(var v=[],h=p.chunkTransferId,T=p.chunkServer,_=p.chunkSize,E=p.chunkRetryDelays,b={serverId:h,aborted:!1},P=t.ondata||function(y){return y},N=t.onload||function(y,m){return m==="HEAD"?y.getResponseHeader("Upload-Offset"):y.response},R=t.onerror||function(y){return null},z=function(m){var M=new FormData;he(o)&&M.append(r,JSON.stringify(o));var H=typeof t.headers=="function"?t.headers(n,o):Object.assign({},t.headers,{"Upload-Length":n.size}),Y=Object.assign({},t,{headers:H}),j=Qe(P(M),gt(e,t.url),Y);j.onload=function(Q){return m(N(Q,Y.method))},j.onerror=function(Q){return s(fe("error",Q.status,R(Q.response)||Q.statusText,Q.getAllResponseHeaders()))},j.ontimeout=Ke(s)},O=function(m){var M=gt(e,T.url,b.serverId),H=typeof t.headers=="function"?t.headers(b.serverId):Object.assign({},t.headers),Y={headers:H,method:"HEAD"},j=Qe(null,M,Y);j.onload=function(Q){return m(N(Q,Y.method))},j.onerror=function(Q){return s(fe("error",Q.status,R(Q.response)||Q.statusText,Q.getAllResponseHeaders()))},j.ontimeout=Ke(s)},J=Math.floor(n.size/_),ee=0;ee<=J;ee++){var A=ee*_,B=n.slice(A,A+_,"application/offset+octet-stream");v[ee]={index:ee,size:B.size,offset:A,data:B,file:n,progress:0,retries:At(E),status:Ne.QUEUED,error:null,request:null,timeout:null}}var G=function(){return a(b.serverId)},w=function(m){return m.status===Ne.QUEUED||m.status===Ne.ERROR},C=function(m){if(!b.aborted){if(m=m||v.find(w),!m){v.every(function(le){return le.status===Ne.COMPLETE})&&G();return}m.status=Ne.PROCESSING,m.progress=null;var M=T.ondata||function(le){return le},H=T.onerror||function(le){return null},Y=T.onload||function(){},j=gt(e,T.url,b.serverId),Q=typeof T.headers=="function"?T.headers(m):Object.assign({},T.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":m.offset,"Upload-Length":n.size,"Upload-Name":n.name}),se=m.request=Qe(M(m.data),j,Object.assign({},T,{headers:Q}));se.onload=function(le){Y(le,m.index,v.length),m.status=Ne.COMPLETE,m.request=null,K()},se.onprogress=function(le,ut,fi){m.progress=le?ut:null,te()},se.onerror=function(le){m.status=Ne.ERROR,m.request=null,m.error=H(le.response)||le.statusText,x(m)||s(fe("error",le.status,H(le.response)||le.statusText,le.getAllResponseHeaders()))},se.ontimeout=function(le){m.status=Ne.ERROR,m.request=null,x(m)||Ke(s)(le)},se.onabort=function(){m.status=Ne.QUEUED,m.request=null,l()}}},x=function(m){return m.retries.length===0?!1:(m.status=Ne.WAITING,clearTimeout(m.timeout),m.timeout=setTimeout(function(){C(m)},m.retries.shift()),!0)},te=function(){var m=v.reduce(function(H,Y){return H===null||Y.progress===null?null:H+Y.progress},0);if(m===null)return u(!1,0,0);var M=v.reduce(function(H,Y){return H+Y.size},0);u(!0,m,M)},K=function(){var m=v.filter(function(M){return M.status===Ne.PROCESSING}).length;m>=1||C()},q=function(){v.forEach(function(m){clearTimeout(m.timeout),m.request&&m.request.abort()})};return b.serverId?O(function(y){b.aborted||(v.filter(function(m){return m.offset<y}
2).forEach(function(m){m.status=Ne.COMPLETE,m.progress=m.size}),K())}):z(function(y){b.aborted||(c(y),b.serverId=y,K())}),{abort:function(){b.aborted=!0,q()}}},Wo=function(e,t,r,n){return function(o,a,s,u,l,c,p){if(o){var v=n.chunkUploads,h=v&&o.size>n.chunkSize,T=v&&(h||n.chunkForce);if(o instanceof Blob&&T)return jo(e,t,r,o,a,s,u,l,c,p,n);var _=t.ondata||function(O){return O},E=t.onload||function(O){return O},b=t.onerror||function(O){return null},P=typeof t.headers=="function"?t.headers(o,a)||{}:Object.assign({},t.headers),N=Object.assign({},t,{headers:P}),R=new FormData;he(a)&&R.append(r,JSON.stringify(a)),(o instanceof Blob?[{name:null,file:o}]:o).forEach(function(O){R.append(r,O.file,O.name===null?O.file.name:""+O.name+O.file.name)});var z=Qe(_(R),gt(e,t.url),N);return z.onload=function(O){s(fe("load",O.status,E(O.response),O.getAllResponseHeaders()))},z.onerror=function(O){u(fe("error",O.status,b(O.response)||O.statusText,O.getAllResponseHeaders()))},z.ontimeout=Ke(u),z.onprogress=l,z.onabort=c,z}}},$o=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;return typeof t=="function"?function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return t.apply(void 0,[r].concat(a,[n]))}:!t||!Se(t.url)?null:Wo(e,t,r,n)},Et=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(typeof t=="function")return t;if(!t||!Se(t.url))return function(o,a){return a()};var r=t.onload||function(o){return o},n=t.onerror||function(o){return null};return function(o,a,s){var u=Qe(o,e+t.url,t);return u.onload=function(l){a(fe("load",l.status,r(l.response),l.getAllResponseHeaders()))},u.onerror=function(l){s(fe("error",l.status,n(l.response)||l.statusText,l.getAllResponseHeaders()))},u.ontimeout=Ke(s),u}},pn=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return e+Math.random()*(t-e)},Xo=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:25,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:250,a=null,s=Date.now(),u=function l(){var c=Date.now()-s,p=pn(n,o);c+p>t&&(p=c+p-t);var v=c/t;if(v>=1||document.hidden){e(1);return}e(v),a=setTimeout(l,p)};return t>0&&u(),{clear:function(){clearTimeout(a)}}},Qo=function(e,t){var r={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},n=t.allowMinimumUploadDuration,o=function(v,h){var T=function(){r.duration===0||r.progress===null||c.fire("progress",c.getProgress())},_=function(){r.complete=!0,c.fire("load-perceived",r.response.body)};c.fire("start"),r.timestamp=Date.now(),r.perceivedPerformanceUpdater=Xo(function(E){r.perceivedProgress=E,r.perceivedDuration=Date.now()-r.timestamp,T(),r.response&&r.perceivedProgress===1&&!r.complete&&_()},n?pn(750,1500):0),r.request=e(v,h,function(E){r.response=he(E)?E:{type:"load",code:200,body:""+E,headers:{}},r.duration=Date.now()-r.timestamp,r.progress=1,c.fire("load",r.response.body),(!n||n&&r.perceivedProgress===1)&&_()},function(E){r.perceivedPerformanceUpdater.clear(),c.fire("error",he(E)?E:{type:"error",code:0,body:""+E})},function(E,b,P){r.duration=Date.now()-r.timestamp,r.progress=E?b/P:null,T()},function(){r.perceivedPerformanceUpdater.clear(),c.fire("abort",r.response?r.response.body:null)},function(E){c.fire("transfer",E)})},a=function(){r.request&&(r.perceivedPerformanceUpdater.clear(),r.request.abort&&r.request.abort(),r.complete=!0)},s=function(){a(),r.complete=!1,r.perceivedProgress=0,r.progress=0,r.timestamp=null,r.perceivedDuration=0,r.duration=0,r.request=null,r.response=null},u=n?function(){return r.progress?Math.min(r.progress,r.perceivedProgress):null}:function(){return r.progress||null},l=n?function(){return Math.min(r.duration,r.perceivedDuration)}:function(){return r.duration},c=Object.assign({},Lt(),{process:o,abort:a,getProgress:u,getDuration:l,reset:s});return c},vn=function(e){return e.substring(0,e.lastIndexOf("."))||e},Ko=function(e){var t=[e.name,e.size,e.type];return e instanceof Blob||ar(e)?t[0]=e.name||un():ar(e)?(t[1]=e.length,t[2]=cn(e)):Se(e)&&(t[0]=vt(e),t[1]=0,t[2]="application/octet-stream"),{name:t[0],size:t[1],type:t[2]}},Ze=function(e){return!!(e instanceof File||e instanceof Blob&&e.name)},Zo=function i(e){if(!he(e))return e;var t=yt(e)?[]:{};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];t[r]=n&&he(n)?i(n):n}return t},Jo=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=Qt(),o={archived:!1,frozen:!1,released:!1,source:null,file:r,serverFileReference:t,transferId:null,processingAborted:!1,status:t?V.PROCESSING_COMPLETE:V.INIT,activeLoader:null,activeProcessor:null},a=null,s={},u=function(B){return o.status=B},l=function(B){if(!(o.released||o.frozen)){for(var G=arguments.length,w=new Array(G>1?G-1:0),C=1;C<G;C++)w[C-1]=arguments[C];J.fire.apply(J,[B].concat(w))}},c=function(){return Mt(o.file.name)},p=function(){return o.file.type},v=function(){return o.file.size},h=function(){return o.file},T=function(B,G,w){if(o.source=B,J.fireSync("init"),o.file){J.fireSync("load-skip");return}o.file=Ko(B),G.on("init",function(){l("load-init")}),G.on("meta",function(C){o.file.size=C.size,o.file.filename=C.filename,C.source&&(e=Ee.LIMBO,o.serverFileReference=C.source,o.status=V.PROCESSING_COMPLETE),l("load-meta")}),G.on("progress",function(C){u(V.LOADING),l("load-progress",C)}),G.on("error",function(C){u(V.LOAD_ERROR),l("load-request-error",C)}),G.on("abort",function(){u(V.INIT),l("load-abort")}),G.on("load",function(C){o.activeLoader=null;var x=function(q){o.file=Ze(q)?q:o.file,e===Ee.LIMBO&&o.serverFileReference?u(V.PROCESSING_COMPLETE):u(V.IDLE),l("load")},te=function(q){o.file=C,l("load-meta"),u(V.LOAD_ERROR),l("load-file-error",q)};if(o.serverFileReference){x(C);return}w(C,x,te)}),G.setSource(B),o.activeLoader=G,G.load()},_=function(){o.activeLoader&&o.activeLoader.load()},E=function(){if(o.activeLoader){o.activeLoader.abort();return}u(V.INIT),l("load-abort")},b=function A(B,G){if(o.processingAborted){o.processingAborted=!1;return}if(u(V.PROCESSING),a=null,!(o.file instanceof Blob)){J.on("load",function(){A(B,G)});return}B.on("load",function(x){o.transferId=null,o.serverFileReference=x}),B.on("transfer",function(x){o.transferId=x}),B.on("load-perceived",function(x){o.activeProcessor=null,o.transferId=null,o.serverFileReference=x,u(V.PROCESSING_COMPLETE),l("process-complete",x)}),B.on("start",function(){l("process-start")}),B.on("error",function(x){o.activeProcessor=null,u(V.PROCESSING_ERROR),l("process-error",x)}),B.on("abort",function(x){o.activeProcessor=null,o.serverFileReference=x,u(V.IDLE),l("process-abort"),a&&a()}),B.on("progress",function(x){l("process-progress",x)});var w=function(te){o.archived||B.process(te,Object.assign({},s))},C=console.error;G(o.file,w,C),o.activeProcessor=B},P=function(){o.processingAborted=!1,u(V.PROCESSING_QUEUED)},N=function(){return new Promise(function(B){if(!o.activeProcessor){o.processingAborted=!0,u(V.IDLE),l("process-abort"),B();return}a=function(){B()},o.activeProcessor.abort()})},R=function(B,G){return new Promise(function(w,C){var x=o.serverFileReference!==null?o.serverFileReference:o.transferId;if(x===null){w();return}B(x,function(){o.serverFileReference=null,o.transferId=null,w()},function(te){if(!G){w();return}u(V.PROCESSING_REVERT_ERROR),l("process-revert-error"),C(te)}),u(V.IDLE),l("process-revert")})},z=function(B,G,w){var C=B.split("."),x=C[0],te=C.pop(),K=s;
2C.forEach(function(q){return K=K[q]}),JSON.stringify(K[te])!==JSON.stringify(G)&&(K[te]=G,l("metadata-update",{key:x,value:s[x],silent:w}))},O=function(B){return Zo(B?s[B]:s)},J=Object.assign({id:{get:function(){return n}},origin:{get:function(){return e},set:function(B){return e=B}},serverId:{get:function(){return o.serverFileReference}},transferId:{get:function(){return o.transferId}},status:{get:function(){return o.status}},filename:{get:function(){return o.file.name}},filenameWithoutExtension:{get:function(){return vn(o.file.name)}},fileExtension:{get:c},fileType:{get:p},fileSize:{get:v},file:{get:h},relativePath:{get:function(){return o.file._relativePath}},source:{get:function(){return o.source}},getMetadata:O,setMetadata:function(B,G,w){if(he(B)){var C=B;return Object.keys(C).forEach(function(x){z(x,C[x],G)}),B}return z(B,G,w),G},extend:function(B,G){return ee[B]=G},abortLoad:E,retryLoad:_,requestProcessing:P,abortProcessing:N,load:T,process:b,revert:R},Lt(),{freeze:function(){return o.frozen=!0},release:function(){return o.released=!0},released:{get:function(){return o.released}},archive:function(){return o.archived=!0},archived:{get:function(){return o.archived}},setFile:function(B){return o.file=B}}),ee=D(J);return ee},ea=function(e,t){return Ve(t)?0:Se(t)?e.findIndex(function(r){return r.id===t}):-1},mn=function(e,t){var r=ea(e,t);if(!(r<0))return e[r]||null},gn=function(e,t,r,n,o,a){var s=Qe(null,e,{method:"GET",responseType:"blob"});return s.onload=function(u){var l=u.getAllResponseHeaders(),c=sr(l).name||vt(e);t(fe("load",u.status,ot(u.response,c),l))},s.onerror=function(u){r(fe("error",u.status,u.statusText,u.getAllResponseHeaders()))},s.onheaders=function(u){a(fe("headers",u.status,null,u.getAllResponseHeaders()))},s.ontimeout=Ke(r),s.onprogress=n,s.onabort=o,s},En=function(e){return e.indexOf("//")===0&&(e=location.protocol+e),e.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]},ta=function(e){return(e.indexOf(":")>-1||e.indexOf("//")>-1)&&En(location.href)!==En(e)},Nt=function(e){return function(){return We(e)?e.apply(void 0,arguments):e}},ra=function(e){return!Ze(e.file)},lr=function(e,t){clearTimeout(t.listUpdateTimeout),t.listUpdateTimeout=setTimeout(function(){e("DID_UPDATE_ITEMS",{items:Ge(t.items)})},0)},hn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new Promise(function(o){if(!e)return o(!0);var a=e.apply(void 0,r);if(a==null)return o(!0);if(typeof a=="boolean")return o(a);typeof a.then=="function"&&a.then(o)})},cr=function(e,t){e.items.sort(function(r,n){return t(we(r),we(n))})},Be=function(e,t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=r.query,o=r.success,a=o===void 0?function(){}:o,s=r.failure,u=s===void 0?function(){}:s,l=no(r,["query","success","failure"]),c=Xe(e.items,n);if(!c){u({error:fe("error",0,"Item not found"),file:null});return}t(c,a,u,l||{})}},na=function(e,t,r){return{ABORT_ALL:function(){Ge(r.items).forEach(function(o){o.freeze(),o.abortLoad(),o.abortProcessing()})},DID_SET_FILES:function(o){var a=o.value,s=a===void 0?[]:a,u=s.map(function(c){return{source:c.source?c.source:c,options:c.options}}),l=Ge(r.items);l.forEach(function(c){u.find(function(p){return p.source===c.source||p.source===c.file})||e("REMOVE_ITEM",{query:c,remove:!1})}),l=Ge(r.items),u.forEach(function(c,p){l.find(function(v){return v.source===c.source||v.file===c.source})||e("ADD_ITEM",Object.assign({},c,{interactionMethod:Me.NONE,index:p}))})},DID_UPDATE_ITEM_METADATA:function(o){var a=o.id,s=o.action,u=o.change;u.silent||(clearTimeout(r.itemUpdateTimeout),r.itemUpdateTimeout=setTimeout(function(){var l=mn(r.items,a);if(!t("IS_ASYNC")){Fe("SHOULD_PREPARE_OUTPUT",!1,{item:l,query:t,action:s,change:u}).then(function(h){var T=t("GET_BEFORE_PREPARE_FILE");T&&(h=T(l,h)),h&&e("REQUEST_PREPARE_OUTPUT",{query:a,item:l,success:function(E){e("DID_PREPARE_OUTPUT",{id:a,file:E})}},!0)});return}l.origin===Ee.LOCAL&&e("DID_LOAD_ITEM",{id:l.id,error:null,serverFileReference:l.source});var c=function(){setTimeout(function(){e("REQUEST_ITEM_PROCESSING",{query:a})},32)},p=function(T){l.revert(Et(r.options.server.url,r.options.server.revert),t("GET_FORCE_REVERT")).then(T?c:function(){}).catch(function(){})},v=function(T){l.abortProcessing().then(T?c:function(){})};if(l.status===V.PROCESSING_COMPLETE)return p(r.options.instantUpload);if(l.status===V.PROCESSING)return v(r.options.instantUpload);r.options.instantUpload&&c()},0))},MOVE_ITEM:function(o){var a=o.query,s=o.index,u=Xe(r.items,a);if(u){var l=r.items.indexOf(u);s=sn(s,0,r.items.length-1),l!==s&&r.items.splice(s,0,r.items.splice(l,1)[0])}},SORT:function(o){var a=o.compare;cr(r,a),e("DID_SORT_ITEMS",{items:t("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function(o){var a=o.items,s=o.index,u=o.interactionMethod,l=o.success,c=l===void 0?function(){}:l,p=o.failure,v=p===void 0?function(){}:p,h=s;if(s===-1||typeof s>"u"){var T=t("GET_ITEM_INSERT_LOCATION"),_=t("GET_TOTAL_ITEMS");h=T==="before"?0:_}var E=t("GET_IGNORED_FILES"),b=function(z){return Ze(z)?!E.includes(z.name.toLowerCase()):!Ve(z)},P=a.filter(b),N=P.map(function(R){return new Promise(function(z,O){e("ADD_ITEM",{interactionMethod:u,source:R.source||R,success:z,failure:O,index:h++,options:R.options||{}})})});Promise.all(N).then(c).catch(v)},ADD_ITEM:function(o){var a=o.source,s=o.index,u=s===void 0?-1:s,l=o.interactionMethod,c=o.success,p=c===void 0?function(){}:c,v=o.failure,h=v===void 0?function(){}:v,T=o.options,_=T===void 0?{}:T;if(Ve(a)){h({error:fe("error",0,"No source"),file:null});return}if(!(Ze(a)&&r.options.ignoredFiles.includes(a.name.toLowerCase()))){if(!Co(r)){if(r.options.allowMultiple||!r.options.allowMultiple&&!r.options.allowReplace){var E=fe("warning",0,"Max files");e("DID_THROW_MAX_FILES",{source:a,error:E}),h({error:E,file:null});return}var b=Ge(r.items)[0];if(b.status===V.PROCESSING_COMPLETE||b.status===V.PROCESSING_REVERT_ERROR){var P=t("GET_FORCE_REVERT");if(b.revert(Et(r.options.server.url,r.options.server.revert),P).then(function(){P&&e("ADD_ITEM",{source:a,index:u,interactionMethod:l,success:p,failure:h,options:_})}).catch(function(){}),P)return}e("REMOVE_ITEM",{query:b.id})}
2var N=_.type==="local"?Ee.LOCAL:_.type==="limbo"?Ee.LIMBO:Ee.INPUT,R=Jo(N,N===Ee.INPUT?null:a,_.file);Object.keys(_.metadata||{}).forEach(function(w){R.setMetadata(w,_.metadata[w])}),$e("DID_CREATE_ITEM",R,{query:t,dispatch:e});var z=t("GET_ITEM_INSERT_LOCATION");r.options.itemInsertLocationFreedom||(u=z==="before"?-1:r.items.length),No(r.items,R,u),We(z)&&a&&cr(r,z);var O=R.id;R.on("init",function(){e("DID_INIT_ITEM",{id:O})}),R.on("load-init",function(){e("DID_START_ITEM_LOAD",{id:O})}),R.on("load-meta",function(){e("DID_UPDATE_ITEM_META",{id:O})}),R.on("load-progress",function(w){e("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:O,progress:w})}),R.on("load-request-error",function(w){var C=Nt(r.options.labelFileLoadError)(w);if(w.code>=400&&w.code<500){e("DID_THROW_ITEM_INVALID",{id:O,error:w,status:{main:C,sub:w.code+" ("+w.body+")"}}),h({error:w,file:we(R)});return}e("DID_THROW_ITEM_LOAD_ERROR",{id:O,error:w,status:{main:C,sub:r.options.labelTapToRetry}})}),R.on("load-file-error",function(w){e("DID_THROW_ITEM_INVALID",{id:O,error:w.status,status:w.status}),h({error:w.status,file:we(R)})}),R.on("load-abort",function(){e("REMOVE_ITEM",{query:O})}),R.on("load-skip",function(){R.on("metadata-update",function(w){Ze(R.file)&&e("DID_UPDATE_ITEM_METADATA",{id:O,change:w})}),e("COMPLETE_LOAD_ITEM",{query:O,item:R,data:{source:a,success:p}})}),R.on("load",function(){var w=function(x){if(!x){e("REMOVE_ITEM",{query:O});return}R.on("metadata-update",function(te){e("DID_UPDATE_ITEM_METADATA",{id:O,change:te})}),Fe("SHOULD_PREPARE_OUTPUT",!1,{item:R,query:t}).then(function(te){var K=t("GET_BEFORE_PREPARE_FILE");K&&(te=K(R,te));var q=function(){e("COMPLETE_LOAD_ITEM",{query:O,item:R,data:{source:a,success:p}}),lr(e,r)};if(te){e("REQUEST_PREPARE_OUTPUT",{query:O,item:R,success:function(m){e("DID_PREPARE_OUTPUT",{id:O,file:m}),q()}},!0);return}q()})};Fe("DID_LOAD_ITEM",R,{query:t,dispatch:e}).then(function(){hn(t("GET_BEFORE_ADD_FILE"),we(R)).then(w)}).catch(function(C){if(!C||!C.error||!C.status)return w(!1);e("DID_THROW_ITEM_INVALID",{id:O,error:C.error,status:C.status})})}),R.on("process-start",function(){e("DID_START_ITEM_PROCESSING",{id:O})}),R.on("process-progress",function(w){e("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:O,progress:w})}),R.on("process-error",function(w){e("DID_THROW_ITEM_PROCESSING_ERROR",{id:O,error:w,status:{main:Nt(r.options.labelFileProcessingError)(w),sub:r.options.labelTapToRetry}})}),R.on("process-revert-error",function(w){e("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:O,error:w,status:{main:Nt(r.options.labelFileProcessingRevertError)(w),sub:r.options.labelTapToRetry}})}),R.on("process-complete",function(w){e("DID_COMPLETE_ITEM_PROCESSING",{id:O,error:null,serverFileReference:w}),e("DID_DEFINE_VALUE",{id:O,value:w})}),R.on("process-abort",function(){e("DID_ABORT_ITEM_PROCESSING",{id:O})}),R.on("process-revert",function(){e("DID_REVERT_ITEM_PROCESSING",{id:O}),e("DID_DEFINE_VALUE",{id:O,value:null})}),e("DID_ADD_ITEM",{id:O,index:u,interactionMethod:l}),lr(e,r);var J=r.options.server||{},ee=J.url,A=J.load,B=J.restore,G=J.fetch;R.load(a,Yo(N===Ee.INPUT?Se(a)&&ta(a)&&G?ur(ee,G):gn:N===Ee.LIMBO?ur(ee,B):ur(ee,A)),function(w,C,x){Fe("LOAD_FILE",w,{query:t}).then(C).catch(x)})}},REQUEST_PREPARE_OUTPUT:function(o){var a=o.item,s=o.success,u=o.failure,l=u===void 0?function(){}:u,c={error:fe("error",0,"Item not found"),file:null};if(a.archived)return l(c);Fe("PREPARE_OUTPUT",a.file,{query:t,item:a}).then(function(p){Fe("COMPLETE_PREPARE_OUTPUT",p,{query:t,item:a}).then(function(v){if(a.archived)return l(c);s(v)})})},COMPLETE_LOAD_ITEM:function(o){var a=o.item,s=o.data,u=s.success,l=s.source,c=t("GET_ITEM_INSERT_LOCATION");if(We(c)&&l&&cr(r,c),e("DID_LOAD_ITEM",{id:a.id,error:null,serverFileReference:a.origin===Ee.INPUT?null:l}),u(we(a)),a.origin===Ee.LOCAL){e("DID_LOAD_LOCAL_ITEM",{id:a.id});return}if(a.origin===Ee.LIMBO){e("DID_COMPLETE_ITEM_PROCESSING",{id:a.id,error:null,serverFileReference:l}),e("DID_DEFINE_VALUE",{id:a.id,value:a.serverId||l});return}t("IS_ASYNC")&&r.options.instantUpload&&e("REQUEST_ITEM_PROCESSING",{query:a.id})},RETRY_ITEM_LOAD:Be(r,function(n){n.retryLoad()}),REQUEST_ITEM_PREPARE:Be(r,function(n,o,a){e("REQUEST_PREPARE_OUTPUT",{query:n.id,item:n,success:function(u){e("DID_PREPARE_OUTPUT",{id:n.id,file:u}),o({file:n,output:u})},failure:a},!0)}),REQUEST_ITEM_PROCESSING:Be(r,function(n,o,a){var s=n.status===V.IDLE||n.status===V.PROCESSING_ERROR;if(!s){var u=function(){return e("REQUEST_ITEM_PROCESSING",{query:n,success:o,failure:a})},l=function(){return document.hidden?u():setTimeout(u,32)};n.status===V.PROCESSING_COMPLETE||n.status===V.PROCESSING_REVERT_ERROR?n.revert(Et(r.options.server.url,r.options.server.revert),t("GET_FORCE_REVERT")).then(l).catch(function(){}):n.status===V.PROCESSING&&n.abortProcessing().then(l);return}n.status!==V.PROCESSING_QUEUED&&(n.requestProcessing(),e("DID_REQUEST_ITEM_PROCESSING",{id:n.id}),e("PROCESS_ITEM",{query:n,success:o,failure:a},!0))}),PROCESS_ITEM:Be(r,function(n,o,a){var s=t("GET_MAX_PARALLEL_UPLOADS"),u=t("GET_ITEMS_BY_STATUS",V.PROCESSING).length;if(u===s){r.processingQueue.push({id:n.id,success:o,failure:a});return}if(n.status!==V.PROCESSING){var l=function p(){var v=r.processingQueue.shift();if(v){var h=v.id,T=v.success,_=v.failure,E=Xe(r.items,h);if(!E||E.archived){p();return}e("PROCESS_ITEM",{query:h,success:T,failure:_},!0)}};n.onOnce("process-complete",function(){o(we(n)),l();var p=r.options.server,v=r.options.instantUpload;if(v&&n.origin===Ee.LOCAL&&We(p.remove)){var h=function(){};n.origin=Ee.LIMBO,r.options.server.remove(n.source,h,h)}var T=t("GET_ITEMS_BY_STATUS",V.PROCESSING_COMPLETE).length===r.items.length;T&&e("DID_COMPLETE_ITEM_PROCESSING_ALL")}),n.onOnce("process-error",function(p){a({error:p,file:we(n)}),l()});var c=r.options;n.process(Qo($o(c.server.url,c.server.process,c.name,{chunkTransferId:n.transferId,chunkServer:c.server.patch,chunkUploads:c.chunkUploads,chunkForce:c.chunkForce,chunkSize:c.chunkSize,chunkRetryDelays:c.chunkRetryDelays}),{allowMinimumUploadDuration:t("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),function(p,v,h){Fe("PREPARE_OUTPUT",p,{query:t,item:n}).then(function(T){e("DID_PREPARE_OUTPUT",{id:n.id,file:T}),v(T)}).catch(h)})}}),RETRY_ITEM_PROCESSING:Be(r,function(n){e("REQUEST_ITEM_PROCESSING",{query:n})}),REQUEST_REMOVE_ITEM:Be(r,function(n){hn(t("GET_BEFORE_REMOVE_FILE"),we(n)).then(function(o){o&&e("REMOVE_ITEM",{query:n})})}),RELEASE_ITEM:Be(r,function(n){n.release()}),REMOVE_ITEM:Be(r,function(n,o,a,s){var u=function(){var p=n.id;mn(r.items,p).archive(),e("DID_REMOVE_ITEM",{error:null,id:p,item:n}),lr(e,r),o(we(n))},l=r.options.server;n.origin===Ee.LOCAL&&l&&We(l.remove)&&s.remove!==!1?(e("DID_START_ITEM_REMOVE",{id:n.id}),l.remove(n.source,function(){return u()}
2,function(c){e("DID_THROW_ITEM_REMOVE_ERROR",{id:n.id,error:fe("error",0,c,null),status:{main:Nt(r.options.labelFileRemoveError)(c),sub:r.options.labelTapToRetry}})})):((s.revert&&n.origin!==Ee.LOCAL&&n.serverId!==null||r.options.chunkUploads&&n.file.size>r.options.chunkSize||r.options.chunkUploads&&r.options.chunkForce)&&n.revert(Et(r.options.server.url,r.options.server.revert),t("GET_FORCE_REVERT")),u())}),ABORT_ITEM_LOAD:Be(r,function(n){n.abortLoad()}),ABORT_ITEM_PROCESSING:Be(r,function(n){if(n.serverId){e("REVERT_ITEM_PROCESSING",{id:n.id});return}n.abortProcessing().then(function(){var o=r.options.instantUpload;o&&e("REMOVE_ITEM",{query:n.id})})}),REQUEST_REVERT_ITEM_PROCESSING:Be(r,function(n){if(!r.options.instantUpload){e("REVERT_ITEM_PROCESSING",{query:n});return}var o=function(l){l&&e("REVERT_ITEM_PROCESSING",{query:n})},a=t("GET_BEFORE_REMOVE_FILE");if(!a)return o(!0);var s=a(we(n));if(s==null)return o(!0);if(typeof s=="boolean")return o(s);typeof s.then=="function"&&s.then(o)}),REVERT_ITEM_PROCESSING:Be(r,function(n){n.revert(Et(r.options.server.url,r.options.server.revert),t("GET_FORCE_REVERT")).then(function(){var o=r.options.instantUpload||ra(n);o&&e("REMOVE_ITEM",{query:n.id})}).catch(function(){})}),SET_OPTIONS:function(o){var a=o.options,s=Object.keys(a),u=ia.filter(function(c){return s.includes(c)}),l=[].concat(At(u),At(Object.keys(a).filter(function(c){return!u.includes(c)})));l.forEach(function(c){e("SET_"+Rt(c,"_").toUpperCase(),{value:a[c]})})}}},ia=["server"],fr=function(e){return e},He=function(e){return document.createElement(e)},de=function(e,t){var r=e.childNodes[0];r?t!==r.nodeValue&&(r.nodeValue=t):(r=document.createTextNode(t),e.appendChild(r))},In=function(e,t,r,n){var o=(n%360-90)*Math.PI/180;return{x:e+r*Math.cos(o),y:t+r*Math.sin(o)}},oa=function(e,t,r,n,o,a){var s=In(e,t,r,o),u=In(e,t,r,n);return["M",s.x,s.y,"A",r,r,0,a,0,u.x,u.y].join(" ")},aa=function(e,t,r,n,o){var a=1;return o>n&&o-n<=.5&&(a=0),n>o&&n-o>=.5&&(a=0),oa(e,t,r,Math.min(.9999,n)*360,Math.min(.9999,o)*360,a)},sa=function(e){var t=e.root,r=e.props;r.spin=!1,r.progress=0,r.opacity=0;var n=me("svg");t.ref.path=me("path",{"stroke-width":2,"stroke-linecap":"round"}),n.appendChild(t.ref.path),t.ref.svg=n,t.appendChild(n)},ua=function(e){var t=e.root,r=e.props;if(r.opacity!==0){r.align&&(t.element.dataset.align=r.align);var n=parseInt(U(t.ref.path,"stroke-width"),10),o=t.rect.element.width*.5,a=0,s=0;r.spin?(a=0,s=.5):(a=0,s=r.progress);var u=aa(o,o,o-n,a,s);U(t.ref.path,"d",u),U(t.ref.path,"stroke-opacity",r.spin||r.progress>0?1:0)}},Tn=ve({tag:"div",name:"progress-indicator",ignoreRectUpdate:!0,ignoreRect:!0,create:sa,write:ua,mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),la=function(e){var t=e.root,r=e.props;t.element.innerHTML=(r.icon||"")+("<span>"+r.label+"</span>"),r.isDisabled=!1},ca=function(e){var t=e.root,r=e.props,n=r.isDisabled,o=t.query("GET_DISABLED")||r.opacity===0;o&&!n?(r.isDisabled=!0,U(t.element,"disabled","disabled")):!o&&n&&(r.isDisabled=!1,t.element.removeAttribute("disabled"))},_n=ve({tag:"button",attributes:{type:"button"},ignoreRect:!0,ignoreRectUpdate:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:la,write:ca}),yn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e3,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=n.labelBytes,a=o===void 0?"bytes":o,s=n.labelKilobytes,u=s===void 0?"KB":s,l=n.labelMegabytes,c=l===void 0?"MB":l,p=n.labelGigabytes,v=p===void 0?"GB":p;e=Math.round(Math.abs(e));var h=r,T=r*r,_=r*r*r;return e<h?e+" "+a:e<T?Math.floor(e/h)+" "+u:e<_?bn(e/T,1,t)+" "+c:bn(e/_,2,t)+" "+v},bn=function(e,t,r){return e.toFixed(t).split(".").filter(function(n){return n!=="0"}).join(r)},fa=function(e){var t=e.root,r=e.props,n=He("span");n.className="filepond--file-info-main",U(n,"aria-hidden","true"),t.appendChild(n),t.ref.fileName=n;var o=He("span");o.className="filepond--file-info-sub",t.appendChild(o),t.ref.fileSize=o,de(o,t.query("GET_LABEL_FILE_WAITING_FOR_SIZE")),de(n,fr(t.query("GET_ITEM_NAME",r.id)))},dr=function(e){var t=e.root,r=e.props;de(t.ref.fileSize,yn(t.query("GET_ITEM_SIZE",r.id),".",t.query("GET_FILE_SIZE_BASE"),t.query("GET_FILE_SIZE_LABELS",t.query))),de(t.ref.fileName,fr(t.query("GET_ITEM_NAME",r.id)))},Sn=function(e){var t=e.root,r=e.props;if(rt(t.query("GET_ITEM_SIZE",r.id))){dr({root:t,props:r});return}de(t.ref.fileSize,t.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))},da=ve({name:"file-info",ignoreRect:!0,ignoreRectUpdate:!0,write:be({DID_LOAD_ITEM:dr,DID_UPDATE_ITEM_META:dr,DID_THROW_ITEM_LOAD_ERROR:Sn,DID_THROW_ITEM_INVALID:Sn}),didCreateView:function(e){$e("CREATE_VIEW",Object.assign({},e,{view:e}))},create:fa,mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}}),Rn=function(e){return Math.round(e*100)},pa=function(e){var t=e.root,r=He("span");r.className="filepond--file-status-main",t.appendChild(r),t.ref.main=r;var n=He("span");n.className="filepond--file-status-sub",t.appendChild(n),t.ref.sub=n,On({root:t,action:{progress:null}})},On=function(e){var t=e.root,r=e.action,n=r.progress===null?t.query("GET_LABEL_FILE_LOADING"):t.query("GET_LABEL_FILE_LOADING")+" "+Rn(r.progress)+"%";de(t.ref.main,n),de(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},va=function(e){var t=e.root,r=e.action,n=r.progress===null?t.query("GET_LABEL_FILE_PROCESSING"):t.query("GET_LABEL_FILE_PROCESSING")+" "+Rn(r.progress)+"%";de(t.ref.main,n),de(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},ma=function(e){var t=e.root;de(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING")),de(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},ga=function(e){var t=e.root;de(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING_ABORTED")),de(t.ref.sub,t.query("GET_LABEL_TAP_TO_RETRY"))},Ea=function(e){var t=e.root;de(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING_COMPLETE")),de(t.ref.sub,t.query("GET_LABEL_TAP_TO_UNDO"))},wn=function(e){var t=e.root;de(t.ref.main,""),de(t.ref.sub,"")},ht=function(e){var t=e.root,r=e.action;de(t.ref.main,r.status.main),de(t.ref.sub,r.status.sub)},ha=ve({name:"file-status",ignoreRect:!0,ignoreRectUpdate:!0,write:be({DID_LOAD_ITEM:wn,DID_REVERT_ITEM_PROCESSING:wn,DID_REQUEST_ITEM_PROCESSING:ma,DID_ABORT_ITEM_PROCESSING:ga,DID_COMPLETE_ITEM_PROCESSING:Ea,DID_UPDATE_ITEM_PROCESS_PROGRESS:va,DID_UPDATE_ITEM_LOAD_PROGRESS:On,DID_THROW_ITEM_LOAD_ERROR:ht,DID_THROW_ITEM_INVALID:ht,DID_THROW_ITEM_PROCESSING_ERROR:ht,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:ht,DID_THROW_ITEM_REMOVE_
vendor: 5,948 bytes, line 2
2ERROR:ht}),didCreateView:function(e){$e("CREATE_VIEW",Object.assign({},e,{view:e}))},create:pa,mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}}),pr={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}},vr=[];S(pr,function(i){vr.push(i)});var Pe=function(e){if(mr(e)==="right")return 0;var t=e.ref.buttonRemoveItem.rect.element;return t.hidden?null:t.width+t.left},Ia=function(e){var t=e.ref.buttonAbortItemLoad.rect.element;return t.width},Bt=function(e){return Math.floor(e.ref.buttonRemoveItem.rect.element.height/4)},Ta=function(e){return Math.floor(e.ref.buttonRemoveItem.rect.element.left/2)},_a=function(e){return e.query("GET_STYLE_LOAD_INDICATOR_POSITION")},ya=function(e){return e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")},mr=function(e){return e.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")},ba={buttonAbortItemLoad:{opacity:0},buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:_a},processProgressIndicator:{opacity:0,align:ya},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}},Dn={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Pe},status:{translateX:Pe}},gr={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}},at={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:Pe},status:{translateX:Pe,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:Pe},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:mr},info:{translateX:Pe},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:mr},buttonRemoveItem:{opacity:1},info:{translateX:Pe},status:{opacity:1,translateX:Pe}},DID_LOAD_ITEM:Dn,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:Pe},status:{translateX:Pe}},DID_START_ITEM_PROCESSING:gr,DID_REQUEST_ITEM_PROCESSING:gr,DID_UPDATE_ITEM_PROCESS_PROGRESS:gr,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:Pe}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Pe},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:Dn},Sa=ve({create:function(e){var t=e.root;t.element.innerHTML=t.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:!0,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}}),Ra=function(e){var t=e.root,r=e.props,n=Object.keys(pr).reduce(function(P,N){return P[N]=Object.assign({},pr[N]),P},{}),o=r.id,a=t.query("GET_ALLOW_REVERT"),s=t.query("GET_ALLOW_REMOVE"),u=t.query("GET_ALLOW_PROCESS"),l=t.query("GET_INSTANT_UPLOAD"),c=t.query("IS_ASYNC"),p=t.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN"),v;c?u&&!a?v=function(N){return!/RevertItemProcessing/.test(N)}:!u&&a?v=function(N){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(N)}:!u&&!a&&(v=function(N){return!/Process/.test(N)}):v=function(N){return!/Process/.test(N)};var h=v?vr.filter(v):vr.concat();if(l&&a&&(n.RevertItemProcessing.label="GET_LABEL_BUTTON_REMOVE_ITEM",n.RevertItemProcessing.icon="GET_ICON_REMOVE"),c&&!a){var T=at.DID_COMPLETE_ITEM_PROCESSING;T.info.translateX=Ta,T.info.translateY=Bt,T.status.translateY=Bt,T.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(c&&!u&&(["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach(function(P){at[P].status.translateY=Bt}),at.DID_THROW_ITEM_PROCESSING_ERROR.status.translateX=Ia),p&&a){n.RevertItemProcessing.align="BUTTON_REMOVE_ITEM_POSITION";var _=at.DID_COMPLETE_ITEM_PROCESSING;_.info.translateX=Pe,_.status.translateY=Bt,_.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}s||(n.RemoveItem.disabled=!0),S(n,function(P,N){var R=t.createChildView(_n,{label:t.query(N.label),icon:t.query(N.icon),opacity:0}
2);h.includes(P)&&t.appendChildView(R),N.disabled&&(R.element.setAttribute("disabled","disabled"),R.element.setAttribute("hidden","hidden")),R.element.dataset.align=t.query("GET_STYLE_"+N.align),R.element.classList.add(N.className),R.on("click",function(z){z.stopPropagation(),!N.disabled&&t.dispatch(N.action,{query:o})}),t.ref["button"+P]=R}),t.ref.processingCompleteIndicator=t.appendChildView(t.createChildView(Sa)),t.ref.processingCompleteIndicator.element.dataset.align=t.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION"),t.ref.info=t.appendChildView(t.createChildView(da,{id:o})),t.ref.status=t.appendChildView(t.createChildView(ha,{id:o}));var E=t.appendChildView(t.createChildView(Tn,{opacity:0,align:t.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));E.element.classList.add("filepond--load-indicator"),t.ref.loadProgressIndicator=E;var b=t.appendChildView(t.createChildView(Tn,{opacity:0,align:t.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));b.element.classList.add("filepond--process-indicator"),t.ref.processProgressIndicator=b,t.ref.activeStyles=[]},Oa=function(e){var t=e.root,r=e.actions,n=e.props;wa({root:t,actions:r,props:n});var o=r.concat().filter(function(s){return/^DID_/.test(s.type)}).reverse().find(function(s){return at[s.type]});if(o){t.ref.activeStyles=[];var a=at[o.type];S(ba,function(s,u){var l=t.ref[s];S(u,function(c,p){var v=a[s]&&typeof a[s][c]<"u"?a[s][c]:p;t.ref.activeStyles.push({control:l,key:c,value:v})})})}t.ref.activeStyles.forEach(function(s){var u=s.control,l=s.key,c=s.value;u[l]=typeof c=="function"?c(t):c})},wa=be({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function(e){var t=e.root,r=e.action;t.ref.buttonAbortItemProcessing.label=r.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function(e){var t=e.root,r=e.action;t.ref.buttonAbortItemLoad.label=r.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function(e){var t=e.root,r=e.action;t.ref.buttonAbortItemRemoval.label=r.value},DID_REQUEST_ITEM_PROCESSING:function(e){var t=e.root;t.ref.processProgressIndicator.spin=!0,t.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function(e){var t=e.root;t.ref.loadProgressIndicator.spin=!0,t.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function(e){var t=e.root;t.ref.processProgressIndicator.spin=!0,t.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function(e){var t=e.root,r=e.action;t.ref.loadProgressIndicator.spin=!1,t.ref.loadProgressIndicator.progress=r.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(e){var t=e.root,r=e.action;t.ref.processProgressIndicator.spin=!1,t.ref.processProgressIndicator.progress=r.progress}}),Da=ve({create:Ra,write:Oa,didCreateView:function(e){$e("CREATE_VIEW",Object.assign({},e,{view:e}))},name:"file"}),Aa=function(e){var t=e.root,r=e.props;t.ref.fileName=He("legend"),t.appendChild(t.ref.fileName),t.ref.file=t.appendChildView(t.createChildView(Da,{id:r.id})),t.ref.data=!1},La=function(e){var t=e.root,r=e.props;de(t.ref.fileName,fr(t.query("GET_ITEM_NAME",r.id)))},Pa=ve({create:Aa,ignoreRect:!0,write:be({DID_LOAD_ITEM:La}),didCreateView:function(e){$e("CREATE_VIEW",Object.assign({},e,{view:e}))},tag:"fieldset",name:"file-wrapper"}),An={type:"spring",damping:.6,mass:7},Ca=function(e){var t=e.root,r=e.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:An},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:An},styles:["translateY"]}}].forEach(function(n){Ma(t,n,r.name)}),t.element.classList.add("filepond--"+r.name),t.ref.scalable=null},Ma=function(e,t,r){var n=ve({name:"panel-"+t.name+" filepond--"+r,mixins:t.mixins,ignoreRectUpdate:!0}),o=e.createChildView(n,t.props);e.ref[t.name]=e.appendChildView(o)},Na=function(e){var t=e.root,r=e.props;if((t.ref.scalable===null||r.scalable!==t.ref.scalable)&&(t.ref.scalable=Fr(r.scalable)?r.scalable:!0,t.element.dataset.scalable=t.ref.scalable),!!r.height){var n=t.ref.top.rect.element,o=t.ref.bottom.rect.element,a=Math.max(n.height+o.height,r.height);t.ref.center.translateY=n.height,t.ref.center.scaleY=(a-n.height-o.height)/100,t.ref.bottom.translateY=a-o.height}}
2,Ln=ve({name:"panel",read:function(e){var t=e.root,r=e.props;return r.heightCurrent=t.ref.bottom.translateY},write:Na,create:Ca,ignoreRect:!0,mixins:{apis:["height","heightCurrent","scalable"]}}),Ba=function(e){var t=e.map(function(n){return n.id}),r=void 0;return{setIndex:function(o){r=o},getIndex:function(){return r},getItemIndex:function(o){return t.indexOf(o.id)}}},Pn={type:"spring",stiffness:.75,damping:.45,mass:10},Cn="spring",Mn={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy processing",DID_REQUEST_ITEM_PROCESSING:"busy processing",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"},Fa=function(e){var t=e.root,r=e.props;if(t.ref.handleClick=function(o){return t.dispatch("DID_ACTIVATE_ITEM",{id:r.id})},t.element.id="filepond--item-"+r.id,t.element.addEventListener("click",t.ref.handleClick),t.ref.container=t.appendChildView(t.createChildView(Pa,{id:r.id})),t.ref.panel=t.appendChildView(t.createChildView(Ln,{name:"item-panel"})),t.ref.panel.height=null,r.markedForRemoval=!1,!!t.query("GET_ALLOW_REORDER")){t.element.dataset.dragState="idle";var n=function(a){if(a.isPrimary){var s=!1,u={x:a.pageX,y:a.pageY};r.dragOrigin={x:t.translateX,y:t.translateY},r.dragCenter={x:a.offsetX,y:a.offsetY};var l=Ba(t.query("GET_ACTIVE_ITEMS"));t.dispatch("DID_GRAB_ITEM",{id:r.id,dragState:l});var c=function(_){if(_.isPrimary){_.stopPropagation(),_.preventDefault(),r.dragOffset={x:_.pageX-u.x,y:_.pageY-u.y};var E=r.dragOffset.x*r.dragOffset.x+r.dragOffset.y*r.dragOffset.y;E>16&&!s&&(s=!0,t.element.removeEventListener("click",t.ref.handleClick)),t.dispatch("DID_DRAG_ITEM",{id:r.id,dragState:l})}},p=function(_){_.isPrimary&&(r.dragOffset={x:_.pageX-u.x,y:_.pageY-u.y},h())},v=function(){h()},h=function(){document.removeEventListener("pointercancel",v),document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",p),t.dispatch("DID_DROP_ITEM",{id:r.id,dragState:l}),s&&setTimeout(function(){return t.element.addEventListener("click",t.ref.handleClick)},0)};document.addEventListener("pointercancel",v),document.addEventListener("pointermove",c),document.addEventListener("pointerup",p)}};t.element.addEventListener("pointerdown",n)}},Ga=be({DID_UPDATE_PANEL_HEIGHT:function(e){var t=e.root,r=e.action;t.height=r.height}}),xa=be({DID_GRAB_ITEM:function(e){var t=e.root,r=e.props;r.dragOrigin={x:t.translateX,y:t.translateY}},DID_DRAG_ITEM:function(e){var t=e.root;t.element.dataset.dragState="drag"},DID_DROP_ITEM:function(e){var t=e.root,r=e.props;r.dragOffset=null,r.dragOrigin=null,t.element.dataset.dragState="drop"}},function(i){var e=i.root,t=i.actions,r=i.props,n=i.shouldOptimize;e.element.dataset.dragState==="drop"&&e.scaleX<=1&&(e.element.dataset.dragState="idle");var o=t.concat().filter(function(s){return/^DID_/.test(s.type)}).reverse().find(function(s){return Mn[s.type]});o&&o.type!==r.currentState&&(r.currentState=o.type,e.element.dataset.filepondItemState=Mn[r.currentState]||"");var a=e.query("GET_ITEM_PANEL_ASPECT_RATIO")||e.query("GET_PANEL_ASPECT_RATIO");a?n||(e.height=e.rect.element.width*a):(Ga({root:e,actions:t,props:r}),!e.height&&e.ref.container.rect.element.height>0&&(e.height=e.ref.container.rect.element.height)),n&&(e.ref.panel.height=null),e.ref.panel.height=e.height}),qa=ve({create:Fa,write:xa,destroy:function(e){var t=e.root,r=e.props;t.element.removeEventListener("click",t.ref.handleClick),t.dispatch("RELEASE_ITEM",{query:r.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:Cn,scaleY:Cn,translateX:Pn,translateY:Pn,opacity:{type:"tween",duration:150}}}}),Er=function(i,e){return Math.max(1,Math.floor((i+1)/e))},hr=function(e,t,r){if(r){var n=e.rect.element.width,o=t.length,a=null;if(o===0||r.top<t[0].rect.element.top)return-1;var s=t[0],u=s.rect.element,l=u.marginLeft+u.marginRight,c=u.width+l,p=Er(n,c);if(p===1){for(var v=0;v<o;v++){var h=t[v],T=h.rect.outer.top+h.rect.element.height*.5;if(r.top<T)return v}return o}for(var _=u.marginTop+u.marginBottom,E=u.height+_,b=0;b<o;b++){var P=b%p,N=Math.floor(b/p),R=P*c,z=N*E,O=z-u.marginTop,J=R+c,ee=z+E+u.marginBottom;
2if(r.top<ee&&r.top>O){if(r.left<J)return b;b!==o-1?a=b:a=null}}return a!==null?a:o}},Ft={height:0,width:0,get getHeight(){return this.height},set setHeight(i){(this.height===0||i===0)&&(this.height=i)},get getWidth(){return this.width},set setWidth(i){(this.width===0||i===0)&&(this.width=i)},setDimensions:function(e,t){(this.height===0||e===0)&&(this.height=e),(this.width===0||t===0)&&(this.width=t)}},Ua=function(e){var t=e.root;U(t.element,"role","list"),t.ref.lastItemSpanwDate=Date.now()},Va=function(e){var t=e.root,r=e.action,n=r.id,o=r.index,a=r.interactionMethod;t.ref.addIndex=o;var s=Date.now(),u=s,l=1;if(a!==Me.NONE){l=0;var c=t.query("GET_ITEM_INSERT_INTERVAL"),p=s-t.ref.lastItemSpanwDate;u=p<c?s+(c-p):s}t.ref.lastItemSpanwDate=u,t.appendChildView(t.createChildView(qa,{spawnDate:u,id:n,opacity:l,interactionMethod:a}),o)},Nn=function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1;e.dragOffset?(e.translateX=null,e.translateY=null,e.translateX=e.dragOrigin.x+e.dragOffset.x,e.translateY=e.dragOrigin.y+e.dragOffset.y,e.scaleX=1.025,e.scaleY=1.025):(e.translateX=t,e.translateY=r,Date.now()>e.spawnDate&&(e.opacity===0&&Ha(e,t,r,n,o),e.scaleX=1,e.scaleY=1,e.opacity=1))},Ha=function(e,t,r,n,o){e.interactionMethod===Me.NONE?(e.translateX=null,e.translateX=t,e.translateY=null,e.translateY=r):e.interactionMethod===Me.DROP?(e.translateX=null,e.translateX=t-n*20,e.translateY=null,e.translateY=r-o*10,e.scaleX=.8,e.scaleY=.8):e.interactionMethod===Me.BROWSE?(e.translateY=null,e.translateY=r-30):e.interactionMethod===Me.API&&(e.translateX=null,e.translateX=t-30,e.translateY=null)},ka=function(e){var t=e.root,r=e.action,n=r.id,o=t.childViews.find(function(a){return a.id===n});o&&(o.scaleX=.9,o.scaleY=.9,o.opacity=0,o.markedForRemoval=!0)},Ir=function(e){return e.rect.element.height+e.rect.element.marginBottom*.5+e.rect.element.marginTop*.5},za=function(e){return e.rect.element.width+e.rect.element.marginLeft*.5+e.rect.element.marginRight*.5},Ya=function(e){var t=e.root,r=e.action,n=r.id,o=r.dragState,a=t.query("GET_ITEM",{id:n}),s=t.childViews.find(function(P){return P.id===n}),u=t.childViews.length,l=o.getItemIndex(a);if(s){var c={x:s.dragOrigin.x+s.dragOffset.x+s.dragCenter.x,y:s.dragOrigin.y+s.dragOffset.y+s.dragCenter.y},p=Ir(s),v=za(s),h=Math.floor(t.rect.outer.width/v);h>u&&(h=u);var T=Math.floor(u/h+1);Ft.setHeight=p*T,Ft.setWidth=v*h;var _={y:Math.floor(c.y/p),x:Math.floor(c.x/v),getGridIndex:function(){return c.y>Ft.getHeight||c.y<0||c.x>Ft.getWidth||c.x<0?l:this.y*h+this.x},getColIndex:function(){for(var N=t.query("GET_ACTIVE_ITEMS"),R=t.childViews.filter(function(x){return x.rect.element.height}),z=N.map(function(x){return R.find(function(te){return te.id===x.id})}),O=z.findIndex(function(x){return x===s}),J=Ir(s),ee=z.length,A=ee,B=0,G=0,w=0,C=0;C<ee;C++)if(B=Ir(z[C]),w=G,G=w+B,c.y<G){if(O>C){if(c.y<w+J){A=C;break}continue}A=C;break}return A}},E=h>1?_.getGridIndex():_.getColIndex();t.dispatch("MOVE_ITEM",{query:s,index:E});var b=o.getIndex();if(b===void 0||b!==E){if(o.setIndex(E),b===void 0)return;t.dispatch("DID_REORDER_ITEMS",{items:t.query("GET_ACTIVE_ITEMS"),origin:l,target:E})}}},ja=be({DID_ADD_ITEM:Va,DID_REMOVE_ITEM:ka,DID_DRAG_ITEM:Ya}),Wa=function(e){var t=e.root,r=e.props,n=e.actions,o=e.shouldOptimize;ja({root:t,props:r,actions:n});var a=r.dragCoordinates,s=t.rect.element.width,u=t.childViews.filter(function(A){return A.rect.element.height}),l=t.query("GET_ACTIVE_ITEMS").map(function(A){return u.find(function(B){return B.id===A.id})}).filter(function(A){return A}),c=a?hr(t,l,a):null,p=t.ref.addIndex||null;t.ref.addIndex=null;var v=0,h=0,T=0;if(l.length!==0){var _=l[0].rect.element,E=_.marginTop+_.marginBottom,b=_.marginLeft+_.marginRight,P=_.width+b,N=_.height+E,R=Er(s,P);if(R===1){var z=0,O=0;l.forEach(function(A,B){if(c){var G=B-c;G===-2?O=-E*.25:G===-1?O=-E*.75:G===0?O=E*.75:G===1?O=E*.25:O=0}o&&(A.translateX=null,A.translateY=null),A.markedForRemoval||Nn(A,0,z+O);var w=A.rect.element.height+E,C=w*(A.markedForRemoval?A.opacity:1);z+=C})}else{var J=0,ee=0;l.forEach(function(A,B){B===c&&(v=1),B===p&&(T+=1),A.markedForRemoval&&A.opacity<.5&&(h-=1);var G=B+T+v+h,w=G%R,C=Math.floor(G/R),x=w*P,te=C*N,K=Math.sign(x-J),q=Math.sign(te-ee);J=x,ee=te,!A.markedForRemoval&&(o&&(A.translateX=null,A.translateY=null),Nn(A,x,te,K,q))})}}},$a=function(e,t){return t.filter(function(r){return r.data&&r.data.id?e.id===r.data.id:!0})},Xa=ve({create:Ua,write:Wa,tag:"ul",name:"list",didWriteView:function(e){var t=e.root;t.childViews.filter(function(r){return r.markedForRemoval&&r.opacity===0&&r.resting}
2).forEach(function(r){r._destroy(),t.removeChildView(r)})},filterFrameActionsForChild:$a,mixins:{apis:["dragCoordinates"]}}),Qa=function(e){var t=e.root,r=e.props;t.ref.list=t.appendChildView(t.createChildView(Xa)),r.dragCoordinates=null,r.overflowing=!1},Ka=function(e){var t=e.root,r=e.props,n=e.action;t.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(r.dragCoordinates={left:n.position.scopeLeft-t.ref.list.rect.element.left,top:n.position.scopeTop-(t.rect.outer.top+t.rect.element.marginTop+t.rect.element.scrollTop)})},Za=function(e){var t=e.props;t.dragCoordinates=null},Ja=be({DID_DRAG:Ka,DID_END_DRAG:Za}),es=function(e){var t=e.root,r=e.props,n=e.actions;if(Ja({root:t,props:r,actions:n}),t.ref.list.dragCoordinates=r.dragCoordinates,r.overflowing&&!r.overflow&&(r.overflowing=!1,t.element.dataset.state="",t.height=null),r.overflow){var o=Math.round(r.overflow);o!==t.height&&(r.overflowing=!0,t.element.dataset.state="overflow",t.height=o)}},ts=ve({create:Qa,write:es,name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),xe=function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";r?U(e,t,n):e.removeAttribute(t)},rs=function(e){if(!(!e||e.value==="")){try{e.value=""}catch{}if(e.value){var t=He("form"),r=e.parentNode,n=e.nextSibling;t.appendChild(e),t.reset(),n?r.insertBefore(e,n):r.appendChild(e)}}},ns=function(e){var t=e.root,r=e.props;t.element.id="filepond--browser-"+r.id,U(t.element,"name",t.query("GET_NAME")),U(t.element,"aria-controls","filepond--assistant-"+r.id),U(t.element,"aria-labelledby","filepond--drop-label-"+r.id),Bn({root:t,action:{value:t.query("GET_ACCEPTED_FILE_TYPES")}}),Fn({root:t,action:{value:t.query("GET_ALLOW_MULTIPLE")}}),Gn({root:t,action:{value:t.query("GET_ALLOW_DIRECTORIES_ONLY")}}),Tr({root:t}),xn({root:t,action:{value:t.query("GET_REQUIRED")}
2}),qn({root:t,action:{value:t.query("GET_CAPTURE_METHOD")}}),t.ref.handleChange=function(n){if(t.element.value){var o=Array.from(t.element.files).map(function(a){return a._relativePath=a.webkitRelativePath,a});setTimeout(function(){r.onload(o),rs(t.element)},250)}},t.element.addEventListener("change",t.ref.handleChange)},Bn=function(e){var t=e.root,r=e.action;t.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&xe(t.element,"accept",!!r.value,r.value?r.value.join(","):"")},Fn=function(e){var t=e.root,r=e.action;xe(t.element,"multiple",r.value)},Gn=function(e){var t=e.root,r=e.action;xe(t.element,"webkitdirectory",r.value)},Tr=function(e){var t=e.root,r=t.query("GET_DISABLED"),n=t.query("GET_ALLOW_BROWSE"),o=r||!n;xe(t.element,"disabled",o)},xn=function(e){var t=e.root,r=e.action;r.value?t.query("GET_TOTAL_ITEMS")===0&&xe(t.element,"required",!0):xe(t.element,"required",!1)},qn=function(e){var t=e.root,r=e.action;xe(t.element,"capture",!!r.value,r.value===!0?"":r.value)},Un=function(e){var t=e.root,r=t.element;if(t.query("GET_TOTAL_ITEMS")>0){xe(r,"required",!1),xe(r,"name",!1);for(var n=t.query("GET_ACTIVE_ITEMS"),o=!1,a=0;a<n.length;a++)n[a].status===V.LOAD_ERROR&&(o=!0);t.element.setCustomValidity(o?t.query("GET_LABEL_INVALID_FIELD"):"")}else{xe(r,"name",!0,t.query("GET_NAME"));var s=t.query("GET_CHECK_VALIDITY");s&&r.setCustomValidity(""),t.query("GET_REQUIRED")&&xe(r,"required",!0)}},is=function(e){var t=e.root,r=t.query("GET_CHECK_VALIDITY");r&&t.element.setCustomValidity(t.query("GET_LABEL_INVALID_FIELD"))},os=ve({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:ns,destroy:function(e){var t=e.root;t.element.removeEventListener("change",t.ref.handleChange)},write:be({DID_LOAD_ITEM:Un,DID_REMOVE_ITEM:Un,DID_THROW_ITEM_INVALID:is,DID_SET_DISABLED:Tr,DID_SET_ALLOW_BROWSE:Tr,DID_SET_ALLOW_DIRECTORIES_ONLY:Gn,DID_SET_ALLOW_MULTIPLE:Fn,DID_SET_ACCEPTED_FILE_TYPES:Bn,DID_SET_CAPTURE_METHOD:qn,DID_SET_REQUIRED:xn})}),Vn={ENTER:13,SPACE:32},as=function(e){var t=e.root,r=e.props,n=He("label");U(n,"for","filepond--browser-"+r.id),U(n,"id","filepond--drop-label-"+r.id),t.ref.handleKeyDown=function(o){var a=o.keyCode===Vn.ENTER||o.keyCode===Vn.SPACE;a&&(o.preventDefault(),t.ref.label.click())},t.ref.handleClick=function(o){var a=o.target===n||n.contains(o.target);a||t.ref.label.click()},n.addEventListener("keydown",t.ref.handleKeyDown),t.element.addEventListener("click",t.ref.handleClick),Hn(n,r.caption),t.appendChild(n),t.ref.label=n},Hn=function(e,t){e.innerHTML=t;var r=e.querySelector(".filepond--label-action");return r&&U(r,"tabindex","0"),t},ss=ve({name:"drop-label",ignoreRect:!0,create:as,destroy:function(e){var t=e.root;t.ref.label.addEventListener("keydown",t.ref.handleKeyDown),t.element.removeEventListener("click",t.ref.handleClick)},write:be({DID_SET_LABEL_IDLE:function(e){var t=e.root,r=e.action;Hn(t.ref.label,r.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),us=ve({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),ls=function(e){var t=e.root,r=t.rect.element.width*.5,n=t.rect.element.height*.5;t.ref.blob=t.appendChildView(t.createChildView(us,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:r,translateY:n}))},cs=function(e){var t=e.root,r=e.action;if(!t.ref.blob){ls({root:t});return}t.ref.blob.translateX=r.position.scopeLeft,t.ref.blob.translateY=r.position.scopeTop,t.ref.blob.scaleX=1,t.ref.blob.scaleY=1,t.ref.blob.opacity=1},fs=function(e){var t=e.root;t.ref.blob&&(t.ref.blob.opacity=0)},ds=function(e){var t=e.root;t.ref.blob&&(t.ref.blob.scaleX=2.5,t.ref.blob.scaleY=2.5,t.ref.blob.opacity=0)},ps=function(e){var t=e.root,r=e.props,n=e.actions;vs({root:t,props:r,actions:n});var o=t.ref.blob;n.length===0&&o&&o.opacity===0&&(t.removeChildView(o),t.ref.blob=null)},vs=be({DID_DRAG:cs,DID_DROP:ds,DID_END_DRAG:fs}),ms=ve({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:ps}),kn=function(e,t){try{var r=new DataTransfer;t.forEach(function(n){n instanceof File?r.items.add(n):r.items.add(new File([n],n.name,{type:n.type}))}),e.files=r.files}catch{return!1}return!0},gs=function(e){var t=e.root;t.ref.fields={};var r=document.createElement("legend");r.textContent="Files",t.element.appendChild(r)},Gt=function(e,t){return e.ref.fields[t]},_r=function(e){e.query("GET_ACTIVE_ITEMS").forEach(function(t){e.ref.fields[t.id]&&e.element.appendChild(e.ref.fields[t.id])})},zn=function(e){var t=e.root;return _r(t)},Es=function(e){var t=e.root,r=e.action,n=t.query("GET_ITEM",r.id),o=n.origin===Ee.LOCAL,a=!o&&t.query("SHOULD_UPDATE_FILE_INPUT"),s=He("input");s.type=a?"file":"hidden",s.name=t.query("GET_NAME"),t.ref.fields[r.id]=s,_r(t)},hs=function(e){var t=e.root,r=e.action,n=Gt(t,r.id);if(n&&(r.serverFileReference!==null&&(n.value=r.serverFileReference),!!t.query("SHOULD_UPDATE_FILE_INPUT"))){var o=t.query("GET_ITEM",r.id);kn(n,[o.file])}},Is=function(e){var t=e.root,r=e.action;t.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout(function(){var n=Gt(t,r.id);n&&kn(n,[r.file])},0)},Ts=function(e){var t=e.root;t.element.disabled=t.query("GET_DISABLED")},_s=function(e){var t=e.root,r=e.action,n=Gt(t,r.id);n&&(n.parentNode&&n.parentNode.removeChild(n),delete t.ref.fields[r.id])},ys=function(e){var t=e.root,r=e.action,n=Gt(t,r.id);n&&(r.value===null?n.removeAttribute("value"):n.type!="file"&&(n.value=r.value),_r(t))},bs=be({DID_SET_DISABLED:Ts,DID_ADD_ITEM:Es,DID_LOAD_ITEM:hs,DID_REMOVE_ITEM:_s,DID_DEFINE_VALUE:ys,DID_PREPARE_OUTPUT:Is,DID_REORDER_ITEMS:zn,DID_SORT_ITEMS:zn}),Ss=ve({tag:"fieldset",name:"data",create:gs,write:bs,ignoreRect:!0}),Rs=function(e){return"getRootNode"in e?e.getRootNode():document},Os=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],ws=["css","csv","html","txt"],Ds={zip:"zip|compressed",epub:"application/epub+zip"},Yn=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e=e.toLowerCase(),Os.includes(e)?"image/"+(e==="jpg"?"jpeg":e==="svg"?"svg+xml":e):ws.includes(e)?"text/"+e:Ds[e]||""},yr=function(e){return new Promise(function(t,r){var n=Fs(e);if(n.length&&!As(e))return t(n);Ls(e).then(t)})},As=function(e){return e.files?e.files.length>0:!1},Ls=function(e){return new Promise(function(t,r){var n=(e.items?Array.from(e.items):[]).filter(function(o){return Ps(o)}).map(function(o){return Cs(o)});if(!n.length){t(e.files?Array.from(e.files):[]);return}Promise.all(n).then(function(o){var a=[];o.forEach(function(s){a.push.apply(a,s)}),t(a.filter(function(s){return s}).map(function(s){return s._relativePath||(s._relativePath=s.webkitRelativePath),s}))}).catch(console.error)})},Ps=function(e){if(jn(e)){var t=br(e);if(t)return t.isFile||t.isDirectory}return e.kind==="file"},Cs=function(e){return new Promise(function(t,r){if(Bs(e)){Ms(br(e)).then(t).cat
2ch(r);return}t([e.getAsFile()])})},Ms=function(e){return new Promise(function(t,r){var n=[],o=0,a=0,s=function(){a===0&&o===0&&t(n)},u=function l(c){o++;var p=c.createReader(),v=function h(){p.readEntries(function(T){if(T.length===0){o--,s();return}T.forEach(function(_){_.isDirectory?l(_):(a++,_.file(function(E){var b=Ns(E);_.fullPath&&(b._relativePath=_.fullPath),n.push(b),a--,s()}))}),h()},r)};v()};u(e)})},Ns=function(e){if(e.type.length)return e;var t=e.lastModifiedDate,r=e.name,n=Yn(Mt(e.name));return n.length&&(e=e.slice(0,e.size,n),e.name=r,e.lastModifiedDate=t),e},Bs=function(e){return jn(e)&&(br(e)||{}).isDirectory},jn=function(e){return"webkitGetAsEntry"in e},br=function(e){return e.webkitGetAsEntry()},Fs=function(e){var t=[];try{if(t=xs(e),t.length)return t;t=Gs(e)}catch{}return t},Gs=function(e){var t=e.getData("url");return typeof t=="string"&&t.length?[t]:[]},xs=function(e){var t=e.getData("text/html");if(typeof t=="string"&&t.length){var r=t.match(/src\s*=\s*"(.+?)"/);if(r)return[r[1]]}return[]},xt=[],Je=function(e){return{pageLeft:e.pageX,pageTop:e.pageY,scopeLeft:e.offsetX||e.layerX,scopeTop:e.offsetY||e.layerY}},qs=function(e,t,r){var n=Us(t),o={element:e,filterElement:r,state:null,ondrop:function(){},onenter:function(){},ondrag:function(){},onexit:function(){},onload:function(){},allowdrop:function(){}};return o.destroy=n.addListener(o),o},Us=function(e){var t=xt.find(function(n){return n.element===e});if(t)return t;var r=Vs(e);return xt.push(r),r},Vs=function(e){var t=[],r={dragenter:ks,dragover:zs,dragleave:js,drop:Ys},n={};S(r,function(a,s){n[a]=s(e,t),e.addEventListener(a,n[a],!1)});var o={element:e,addListener:function(s){return t.push(s),function(){t.splice(t.indexOf(s),1),t.length===0&&(xt.splice(xt.indexOf(o),1),S(r,function(u){e.removeEventListener(u,n[u],!1)}))}}};return o},Hs=function(e,t){return"elementFromPoint"in e||(e=document),e.elementFromPoint(t.x,t.y)},Sr=function(e,t){var r=Rs(t),n=Hs(r,{x:e.pageX-window.pageXOffset,y:e.pageY-window.pageYOffset});return n===t||t.contains(n)},Wn=null,qt=function(e,t){try{e.dropEffect=t}catch{}},ks=function(e,t){return function(r){r.preventDefault(),Wn=r.target,t.forEach(function(n){var o=n.element,a=n.onenter;Sr(r,o)&&(n.state="enter",a(Je(r)))})}},zs=function(e,t){return function(r){r.preventDefault();var n=r.dataTransfer;yr(n).then(function(o){var a=!1;t.some(function(s){var u=s.filterElement,l=s.element,c=s.onenter,p=s.onexit,v=s.ondrag,h=s.allowdrop;qt(n,"copy");var T=h(o);if(!T){qt(n,"none");return}if(Sr(r,l)){if(a=!0,s.state===null){s.state="enter",c(Je(r));return}if(s.state="over",u&&!T){qt(n,"none");return}v(Je(r))}else u&&!a&&qt(n,"none"),s.state&&(s.state=null,p(Je(r)))})})}},Ys=function(e,t){return function(r){r.preventDefault();var n=r.dataTransfer;yr(n).then(function(o){t.forEach(function(a){var s=a.filterElement,u=a.element,l=a.ondrop,c=a.onexit,p=a.allowdrop;if(a.state=null,!(s&&!Sr(r,u))){if(!p(o))return c(Je(r));l(Je(r),o)}})})}},js=function(e,t){return function(r){Wn===r.target&&t.forEach(function(n){var o=n.onexit;n.state=null,o(Je(r))})}},Ws=function(e,t,r){e.classList.add("filepond--hopper");var n=r.catchesDropsOnPage,o=r.requiresDropOnElement,a=r.filterItems,s=a===void 0?function(v){return v}:a,u=qs(e,n?document.documentElement:e,o),l="",c="";u.allowdrop=function(v){return t(s(v))},u.ondrop=function(v,h){var T=s(h);if(!t(T)){p.ondragend(v);return}c="drag-drop",p.onload(T,v)},u.ondrag=function(v){p.ondrag(v)},u.onenter=function(v){c="drag-over",p.ondragstart(v)},u.onexit=function(v){c="drag-exit",p.ondragend(v)};var p={updateHopperState:function(){l!==c&&(e.dataset.hopperState=c,l=c)},onload:function(){},ondragstart:function(){},ondrag:function(){},ondragend:function(){},destroy:function(){u.destroy()}};return p},Rr=!1,st=[],$n=function(e){var t=document.activeElement,r=t&&(/textarea|input/i.test(t.nodeName)||t.getAttribute("contenteditable")==="true");if(r){for(var n=!1,o=t;o!==document.body;){if(o.classList.contains("filepond--root")){n=!0;break}o=o.parentNode}if(!n)return}yr(e.clipboardData).then(function(a){a.length&&st.forEach(function(s){return s(a)})})},$s=function(e){st.includes(e)||(st.push(e),!Rr&&(Rr=!0,document.addEventListener("paste",$n)))}
vendor: 4,337 bytes, line 2
2,Xs=function(e){ir(st,st.indexOf(e)),st.length===0&&(document.removeEventListener("paste",$n),Rr=!1)},Qs=function(){var e=function(n){t.onload(n)},t={destroy:function(){Xs(e)},onload:function(){}};return $s(e),t},Ks=function(e){var t=e.root,r=e.props;t.element.id="filepond--assistant-"+r.id,U(t.element,"role","alert"),U(t.element,"aria-live","polite"),U(t.element,"aria-relevant","additions")},Xn=null,Qn=null,Or=[],Ut=function(e,t){e.element.textContent=t},Zs=function(e){e.element.textContent=""},Kn=function(e,t,r){var n=e.query("GET_TOTAL_ITEMS");Ut(e,r+" "+t+", "+n+" "+(n===1?e.query("GET_LABEL_FILE_COUNT_SINGULAR"):e.query("GET_LABEL_FILE_COUNT_PLURAL"))),clearTimeout(Qn),Qn=setTimeout(function(){Zs(e)},1500)},Zn=function(e){return e.element.parentNode.contains(document.activeElement)},Js=function(e){var t=e.root,r=e.action;if(Zn(t)){t.element.textContent="";var n=t.query("GET_ITEM",r.id);Or.push(n.filename),clearTimeout(Xn),Xn=setTimeout(function(){Kn(t,Or.join(", "),t.query("GET_LABEL_FILE_ADDED")),Or.length=0},750)}},eu=function(e){var t=e.root,r=e.action;if(Zn(t)){var n=r.item;Kn(t,n.filename,t.query("GET_LABEL_FILE_REMOVED"))}},tu=function(e){var t=e.root,r=e.action,n=t.query("GET_ITEM",r.id),o=n.filename,a=t.query("GET_LABEL_FILE_PROCESSING_COMPLETE");Ut(t,o+" "+a)},Jn=function(e){var t=e.root,r=e.action,n=t.query("GET_ITEM",r.id),o=n.filename,a=t.query("GET_LABEL_FILE_PROCESSING_ABORTED");Ut(t,o+" "+a)},Vt=function(e){var t=e.root,r=e.action,n=t.query("GET_ITEM",r.id),o=n.filename;Ut(t,r.status.main+" "+o+" "+r.status.sub)},ru=ve({create:Ks,ignoreRect:!0,ignoreRectUpdate:!0,write:be({DID_LOAD_ITEM:Js,DID_REMOVE_ITEM:eu,DID_COMPLETE_ITEM_PROCESSING:tu,DID_ABORT_ITEM_PROCESSING:Jn,DID_REVERT_ITEM_PROCESSING:Jn,DID_THROW_ITEM_REMOVE_ERROR:Vt,DID_THROW_ITEM_LOAD_ERROR:Vt,DID_THROW_ITEM_INVALID:Vt,DID_THROW_ITEM_PROCESSING_ERROR:Vt}),tag:"span",name:"assistant"}),ei=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"-";return e.replace(new RegExp(t+".","g"),function(r){return r.charAt(1).toUpperCase()})},ti=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=Date.now(),o=null;return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];clearTimeout(o);var l=Date.now()-n,c=function(){n=Date.now(),e.apply(void 0,s)};l<t?r||(o=setTimeout(c,t-l)):c()}},nu=1e6,Ht=function(e){return e.preventDefault()},iu=function(e){var t=e.root,r=e.props,n=t.query("GET_ID");n&&(t.element.id=n);var o=t.query("GET_CLASS_NAME");o&&o.split(" ").filter(function(p){return p.length}).forEach(function(p){t.element.classList.add(p)}),t.ref.label=t.appendChildView(t.createChildView(ss,Object.assign({},r,{translateY:null,caption:t.query("GET_LABEL_IDLE")}))),t.ref.list=t.appendChildView(t.createChildView(ts,{translateY:null})),t.ref.panel=t.appendChildView(t.createChildView(Ln,{name:"panel-root"})),t.ref.assistant=t.appendChildView(t.createChildView(ru,Object.assign({},r))),t.ref.data=t.appendChildView(t.createChildView(Ss,Object.assign({},r))),t.ref.measure=He("div"),t.ref.measure.style.height="100%",t.element.appendChild(t.ref.measure),t.ref.bounds=null,t.query("GET_STYLES").filter(function(p){return!Ve(p.value)}).map(function(p){var v=p.name,h=p.value;t.element.dataset[v]=h}),t.ref.widthPrevious=null,t.ref.widthUpdated=ti(function(){t.ref.updateHistory=[],t.dispatch("DID_RESIZE_ROOT")},250),t.ref.previousAspectRatio=null,t.ref.updateHistory=[];var a=window.matchMedia("(pointer: fine) and (hover: hover)").matches,s="PointerEvent"in window;t.query("GET_ALLOW_REORDER")&&s&&!a&&(t.element.addEventListener("touchmove",Ht,{passive:!1}),t.element.addEventListener("gesturestart",Ht));var u=t.query("GET_CREDITS"),l=u.length===2;if(l){var c=document.createElement("a");c.className="filepond--credits",c.href=u[0],c.tabIndex=-1,c.target="_blank",c.rel="noopener noreferrer nofollow",c.textContent=u[1],t.element.appendChild(c),t.ref.credits=c}},ou=function(e){var t=e.root,r=e.props,n=e.actions;if(cu({root:t,props:r,actions:n}),n.filter(function(Q){return/^DID_SET_STYLE_/.test(Q.type)}).filter(function(Q){return!Ve(Q.data.value)}).map(function(Q){var se=Q.type,le=Q.data,ut=ei(se.substring(8).toLowerCase(),"_");t.element.dataset[ut]=le.value,t.invalidateLayout()}
2),!t.rect.element.hidden){t.rect.element.width!==t.ref.widthPrevious&&(t.ref.widthPrevious=t.rect.element.width,t.ref.widthUpdated());var o=t.ref.bounds;o||(o=t.ref.bounds=uu(t),t.element.removeChild(t.ref.measure),t.ref.measure=null);var a=t.ref,s=a.hopper,u=a.label,l=a.list,c=a.panel;s&&s.updateHopperState();var p=t.query("GET_PANEL_ASPECT_RATIO"),v=t.query("GET_ALLOW_MULTIPLE"),h=t.query("GET_TOTAL_ITEMS"),T=v?t.query("GET_MAX_FILES")||nu:1,_=h===T,E=n.find(function(Q){return Q.type==="DID_ADD_ITEM"});if(_&&E){var b=E.data.interactionMethod;u.opacity=0,v?u.translateY=-40:b===Me.API?u.translateX=40:b===Me.BROWSE?u.translateY=40:u.translateY=30}else _||(u.opacity=1,u.translateX=0,u.translateY=0);var P=au(t),N=su(t),R=u.rect.element.height,z=!v||_?0:R,O=_?l.rect.element.marginTop:0,J=h===0?0:l.rect.element.marginBottom,ee=z+O+N.visual+J,A=z+O+N.bounds+J;if(l.translateY=Math.max(0,z-l.rect.element.marginTop)-P.top,p){var B=t.rect.element.width,G=B*p;p!==t.ref.previousAspectRatio&&(t.ref.previousAspectRatio=p,t.ref.updateHistory=[]);var w=t.ref.updateHistory;w.push(B);var C=2;if(w.length>C*2){for(var x=w.length,te=x-10,K=0,q=x;q>=te;q--)if(w[q]===w[q-2]&&K++,K>=C)return}c.scalable=!1,c.height=G;var y=G-z-(J-P.bottom)-(_?O:0);N.visual>y?l.overflow=y:l.overflow=null,t.height=G}else if(o.fixedHeight){c.scalable=!1;var m=o.fixedHeight-z-(J-P.bottom)-(_?O:0);N.visual>m?l.overflow=m:l.overflow=null}else if(o.cappedHeight){var M=ee>=o.cappedHeight,H=Math.min(o.cappedHeight,ee);c.scalable=!0,c.height=M?H:H-P.top-P.bottom;var Y=H-z-(J-P.bottom)-(_?O:0);ee>o.cappedHeight&&N.visual>Y?l.overflow=Y:l.overflow=null,t.height=Math.min(o.cappedHeight,A-P.top-P.bottom)}else{var j=h>0?P.top+P.bottom:0;c.scalable=!0,c.height=Math.max(R,ee-j),t.height=Math.max(R,A-j)}t.ref.credits&&c.heightCurrent&&(t.ref.credits.style.transform="translateY("+c.heightCurrent+"px)")}},au=function(e){var t=e.ref.list.childViews[0].childViews[0];return t?{top:t.rect.element.marginTop,bottom:t.rect.element.marginBottom}:{top:0,bottom:0}},su=function(e){var t=0,r=0,n=e.ref.list,o=n.childViews[0],a=o.childViews.filter(function(N){return N.rect.element.height}),s=e.query("GET_ACTIVE_ITEMS").map(function(N){return a.find(function(R){return R.id===N.id})}).filter(function(N){return N});if(s.length===0)return{visual:t,bounds:r};var u=o.rect.element.width,l=hr(o,s,n.dragCoordinates),c=s[0].rect.element,p=c.marginTop+c.marginBottom,v=c.marginLeft+c.marginRight,h=c.width+v,T=c.height+p,_=typeof l<"u"&&l>=0?1:0,E=s.find(function(N){return N.markedForRemoval&&N.opacity<.45})?-1:0,b=s.length+_+E,P=Er(u,h);return P===1?s.forEach(function(N){var R=N.rect.element.height+p;r+=R,t+=R*N.opacity}):(r=Math.ceil(b/P)*T,t=r),{visual:t,bounds:r}},uu=function(e){var t=e.ref.measureHeight||null,r=parseInt(e.style.maxHeight,10)||null,n=t===0?null:t;return{cappedHeight:r,fixedHeight:n}},wr=function(e,t){var r=e.query("GET_ALLOW_REPLACE"),n=e.query("GET_ALLOW_MULTIPLE"),o=e.query("GET_TOTAL_ITEMS"),a=e.query("GET_MAX_FILES"),s=t.length;if(!n&&s>1)return e.dispatch("DID_THROW_MAX_FILES",{source:t,error:fe("warning",0,"Max files")}),!0;if(a=n?a:1,!n&&r)return!1;var u=rt(a);return u&&o+s>a?(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:fe("warning",0,"Max files")}),!0):!1},lu=function(e,t,r){var n=e.childViews[0];return hr(n,t,{left:r.scopeLeft-n.rect.element.left,top:r.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},ri=function(e){var t=e.query("GET_ALLOW_DROP"),r=e.query("GET_DISABLED"),n=t&&!r;if(n&&!e.ref.hopper){var o=Ws(e.element,function(a){var s=e.query("GET_BEFORE_DROP_FILE")||function(){return!0},u=e.query("GET_DROP_VALIDATION");return u?a.every(function(l){return $e("ALLOW_HOPPER_ITEM",l,{query:e.query}).every(function(c){return c===!0})&&s(l)}):!0},{filterItems:function(s){var u=e.query("GET_IGNORED_FILES");return s.filter(function(l){return Ze(l)?!u.includes(l.name.toLowerCase()):!0})},catchesDropsOnPage:e.query("GET_DROP_ON_PAGE"),requiresDropOnElement:e.query("GET_DROP_ON_ELEMENT")});o.onload=function(a,s){var u=e.ref.list.childViews[0],l=u.childViews.filter(function(p){return p.rect.element.height}),c=e.query("GET_ACTIVE_ITEMS").map(function(p){return l.find(function(v){return v.id===p.id})}).filter(function(p){return p});Fe("ADD_ITEMS",a,{dispatch:e.dispatch}).then(function(p){if(wr(e,p))return!1;e.dispatch("ADD_ITEMS",{items:p,index:lu(e.ref.list,c,s),interactionMethod:Me.DROP})}),e.dispatch("DID_DROP",{position:s}),e.dispatch("DID_END_DRAG",{position:s})},o.ondragstart=function(a){e.dispatch("DID_START_DRAG",{position:a})},o.ondrag=ti(function(a){e.dispatch("DID_DRAG",{position:a})}),o.ondragend=function(a){e.dispatch("DID_END_DRAG",{position:a})},e.ref.hopper=o,e.ref.drip=e.appendChildView(e.createChildView(ms))}else!n&&e.ref.hopper&&(e.ref.hopper.destroy(),e.ref.hopper=null,e.removeChildView(e.ref.drip))},ni=function(e,t){var r=e.query("GET_ALLOW_BROWSE"),n=e.query("GET_DISABLED"),o=r&&!n;o&&!e.ref.browser?e.ref.browser=e.appendChildView(e.createChildView(os,Object.assign({},t,{onload:function(s){Fe("ADD_ITEMS",s,{dispatch:e.dispatch}).then(function(u){if(wr(e,u))return!1;e.dispatch("ADD_ITEMS",{items:u,index:-1,interactionMethod:Me.BROWSE})})}})),0):!o&&e.ref.browser&&(e.removeChildView(e.ref.browser),e.ref.browser=null)},ii=function(e){var t=e.query("GET_ALLOW_PASTE"),r=e.query("GET_DISABLED"),n=t&&!r;n&&!e.ref.paster?(e.ref.paster=Qs(),e.ref.paster.onload=function(o){Fe("ADD_ITEMS",o,{dispatch:e.dispatch}
vendor: 6,159 bytes, line 2
2).then(function(a){if(wr(e,a))return!1;e.dispatch("ADD_ITEMS",{items:a,index:-1,interactionMethod:Me.PASTE})})}):!n&&e.ref.paster&&(e.ref.paster.destroy(),e.ref.paster=null)},cu=be({DID_SET_ALLOW_BROWSE:function(e){var t=e.root,r=e.props;ni(t,r)},DID_SET_ALLOW_DROP:function(e){var t=e.root;ri(t)},DID_SET_ALLOW_PASTE:function(e){var t=e.root;ii(t)},DID_SET_DISABLED:function(e){var t=e.root,r=e.props;ri(t),ii(t),ni(t,r);var n=t.query("GET_DISABLED");n?t.element.dataset.disabled="disabled":t.element.removeAttribute("data-disabled")}}),fu=ve({name:"root",read:function(e){var t=e.root;t.ref.measure&&(t.ref.measureHeight=t.ref.measure.offsetHeight)},create:iu,write:ou,destroy:function(e){var t=e.root;t.ref.paster&&t.ref.paster.destroy(),t.ref.hopper&&t.ref.hopper.destroy(),t.element.removeEventListener("touchmove",Ht),t.element.removeEventListener("gesturestart",Ht)},mixins:{styles:["height"]}}),du=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=null,r=Pt(),n=g(Xi(r),[Po,Zi(r)],[na,Ki(r)]);n.dispatch("SET_OPTIONS",{options:e});var o=function(){document.hidden||n.dispatch("KICK")};document.addEventListener("visibilitychange",o);var a=null,s=!1,u=!1,l=null,c=null,p=function(){s||(s=!0),clearTimeout(a),a=setTimeout(function(){s=!1,l=null,c=null,u&&(u=!1,n.dispatch("DID_STOP_RESIZE"))},500)};window.addEventListener("resize",p);var v=fu(n,{id:Qt()}),h=!1,T=!1,_={_read:function(){s&&(c=window.innerWidth,l||(l=c),!u&&c!==l&&(n.dispatch("DID_START_RESIZE"),u=!0)),T&&h&&(h=v.element.offsetParent===null),!h&&(v._read(),T=v.rect.element.hidden)},_write:function(y){var m=n.processActionQueue().filter(function(M){return!/^SET_/.test(M.type)});h&&!m.length||(N(m),h=v._write(y,m,u),Io(n.query("GET_ITEMS")),h&&n.processDispatchQueue())}},E=function(y){return function(m){var M={type:y};if(!m)return M;if(m.hasOwnProperty("error")&&(M.error=m.error?Object.assign({},m.error):null),m.status&&(M.status=Object.assign({},m.status)),m.file&&(M.output=m.file),m.source)M.file=m.source;else if(m.item||m.id){var H=m.item?m.item:n.query("GET_ITEM",m.id);M.file=H?we(H):null}return m.items&&(M.items=m.items.map(we)),/progress/.test(y)&&(M.progress=m.progress),m.hasOwnProperty("origin")&&m.hasOwnProperty("target")&&(M.origin=m.origin,M.target=m.target),M}},b={DID_DESTROY:E("destroy"),DID_INIT:E("init"),DID_THROW_MAX_FILES:E("warning"),DID_INIT_ITEM:E("initfile"),DID_START_ITEM_LOAD:E("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:E("addfileprogress"),DID_LOAD_ITEM:E("addfile"),DID_THROW_ITEM_INVALID:[E("error"),E("addfile")],DID_THROW_ITEM_LOAD_ERROR:[E("error"),E("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[E("error"),E("removefile")],DID_PREPARE_OUTPUT:E("preparefile"),DID_START_ITEM_PROCESSING:E("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:E("processfileprogress"),DID_ABORT_ITEM_PROCESSING:E("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:E("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:E("processfiles"),DID_REVERT_ITEM_PROCESSING:E("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[E("error"),E("processfile")],DID_REMOVE_ITEM:E("removefile"),DID_UPDATE_ITEMS:E("updatefiles"),DID_ACTIVATE_ITEM:E("activatefile"),DID_REORDER_ITEMS:E("reorderfiles")},P=function(y){var m=Object.assign({pond:K},y);delete m.type,v.element.dispatchEvent(new CustomEvent("FilePond:"+y.type,{detail:m,bubbles:!0,cancelable:!0,composed:!0}));var M=[];y.hasOwnProperty("error")&&M.push(y.error),y.hasOwnProperty("file")&&M.push(y.file);var H=["type","error","file"];Object.keys(y).filter(function(j){return!H.includes(j)}).forEach(function(j){return M.push(y[j])}),K.fire.apply(K,[y.type].concat(M));var Y=n.query("GET_ON"+y.type.toUpperCase());Y&&Y.apply(void 0,M)},N=function(y){y.length&&y.filter(function(m){return b[m.type]}).forEach(function(m){var M=b[m.type];(Array.isArray(M)?M:[M]).forEach(function(H){m.type==="DID_INIT_ITEM"?P(H(m.data)):setTimeout(function(){P(H(m.data))},0)})})},R=function(y){return n.dispatch("SET_OPTIONS",{options:y})},z=function(y){return n.query("GET_ACTIVE_ITEM",y)},O=function(y){return new Promise(function(m,M){n.dispatch("REQUEST_ITEM_PREPARE",{query:y,success:function(Y){m(Y)},failure:function(Y){M(Y)}})})},J=function(y){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(M,H){B([{source:y,options:m}],{index:m.index}).then(function(Y){return M(Y&&Y[0])}).catch(H)})},ee=function(y){return y.file&&y.id},A=function(y,m){return typeof y=="object"&&!ee(y)&&!m&&(m=y,y=void 0),n.dispatch("REMOVE_ITEM",Object.assign({},m,{query:y})),n.query("GET_ACTIVE_ITEM",y)===null},B=function(){for(var y=arguments.length,m=new Array(y),M=0;M<y;M++)m[M]=arguments[M];return new Promise(function(H,Y){var j=[],Q={};if(yt(m[0]))j.push.apply(j,m[0]),Object.assign(Q,m[1]||{});else{var se=m[m.length-1];typeof se=="object"&&!(se instanceof Blob)&&Object.assign(Q,m.pop()),j.push.apply(j,m)}n.dispatch("ADD_ITEMS",{items:j,index:Q.index,interactionMethod:Me.API,success:H,failure:Y})})},G=function(){return n.query("GET_ACTIVE_ITEMS")},w=function(y){return new Promise(function(m,M){n.dispatch("REQUEST_ITEM_PROCESSING",{query:y,success:function(Y){m(Y)},failure:function(Y){M(Y)}})})},C=function(){for(var y=arguments.length,m=new Array(y),M=0;M<y;M++)m[M]=arguments[M];var H=Array.isArray(m[0])?m[0]:m,Y=H.length?H:G();return Promise.all(Y.map(O))},x=function(){for(var y=arguments.length,m=new Array(y),M=0;M<y;M++)m[M]=arguments[M];var H=Array.isArray(m[0])?m[0]:m;if(!H.length){var Y=G().filter(function(j){return!(j.status===V.IDLE&&j.origin===Ee.LOCAL)&&j.status!==V.PROCESSING&&j.status!==V.PROCESSING_COMPLETE&&j.status!==V.PROCESSING_REVERT_ERROR});return Promise.all(Y.map(w))}return Promise.all(H.map(w))},te=function(){for(var y=arguments.length,m=new Array(y),M=0;M<y;M++)m[M]=arguments[M];var H=Array.isArray(m[0])?m[0]:m,Y;typeof H[H.length-1]=="object"?Y=H.pop():Array.isArray(m[0])&&(Y=m[1]);var j=G();if(!H.length)return Promise.all(j.map(function(se){return A(se,Y)}));var Q=H.map(function(se){return ie(se)?j[se]?j[se].id:null:se}).filter(function(se){return se});return Q.map(function(se){return A(se,Y)})},K=Object.assign({},Lt(),{},_,{}
2,Qi(n,r),{setOptions:R,addFile:J,addFiles:B,getFile:z,processFile:w,prepareFile:O,removeFile:A,moveFile:function(y,m){return n.dispatch("MOVE_ITEM",{query:y,index:m})},getFiles:G,processFiles:x,removeFiles:te,prepareFiles:C,sort:function(y){return n.dispatch("SORT",{compare:y})},browse:function(){var y=v.element.querySelector("input[type=file]");y&&y.click()},destroy:function(){K.fire("destroy",v.element),n.dispatch("ABORT_ALL"),v._destroy(),window.removeEventListener("resize",p),document.removeEventListener("visibilitychange",o),n.dispatch("DID_DESTROY")},insertBefore:function(y){return Nr(v.element,y)},insertAfter:function(y){return Br(v.element,y)},appendTo:function(y){return y.appendChild(v.element)},replaceElement:function(y){Nr(v.element,y),y.parentNode.removeChild(y),t=y},restoreElement:function(){t&&(Br(t,v.element),v.element.parentNode.removeChild(v.element),t=null)},isAttachedTo:function(y){return v.element===y||t===y},element:{get:function(){return v.element}},status:{get:function(){return n.query("GET_STATUS")}}});return n.dispatch("DID_INIT"),D(K)},oi=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={};S(Pt(),function(n,o){t[n]=o[0]});var r=du(Object.assign({},t,{},e));return r},pu=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},vu=function(e){return ei(e.replace(/^data-/,""))},mu=function i(e,t){S(t,function(r,n){S(e,function(o,a){var s=new RegExp(r),u=s.test(o);if(u&&(delete e[o],n!==!1)){if(Se(n)){e[n]=a;return}var l=n.group;he(n)&&!e[l]&&(e[l]={}),e[l][pu(o.replace(s,""))]=a}}),n.mapping&&i(e[n.group],n.mapping)})},gu=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[];S(e.attributes,function(o){r.push(e.attributes[o])});var n=r.filter(function(o){return o.name}).reduce(function(o,a){var s=U(e,a.name);return o[vu(a.name)]=s===a.name?!0:s,o},{});return mu(n,t),n},Eu=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};$e("SET_ATTRIBUTE_TO_OPTION_MAP",r);var n=Object.assign({},t),o=gu(e.nodeName==="FIELDSET"?e.querySelector("input[type=file]"):e,r);Object.keys(o).forEach(function(s){he(o[s])?(he(n[s])||(n[s]={}),Object.assign(n[s],o[s])):n[s]=o[s]}),n.files=(t.files||[]).concat(Array.from(e.querySelectorAll("input:not([type=file])")).map(function(s){return{source:s.value,options:{type:s.dataset.type}}}));var a=oi(n);return e.files&&Array.from(e.files).forEach(function(s){a.addFile(s)}),a.replaceElement(e),a},hu=function(){return d(arguments.length<=0?void 0:arguments[0])?Eu.apply(void 0,arguments):oi.apply(void 0,arguments)},Iu=["fire","_read","_write"],ai=function(e){var t={};return tn(e,t,Iu),t},Tu=function(e,t){return e.replace(/(?:{([a-zA-Z]+)})/g,function(r,n){return t[n]})},_u=function(e){var t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r);return{transfer:function(a,s){},post:function(a,s,u){var l=Qt();n.onmessage=function(c){c.data.id===l&&s(c.data.message)},n.postMessage({id:l,message:a},u)},terminate:function(){n.terminate(),URL.revokeObjectURL(r)}}},yu=function(e){return new Promise(function(t,r){var n=new Image;n.onload=function(){t(n)},n.onerror=function(o){r(o)},n.src=e})},si=function(e,t){var r=e.slice(0,e.size,e.type);return r.lastModifiedDate=e.lastModifiedDate,r.name=t,r},bu=function(e){return si(e,e.name)},ui=[],Su=function(e){if(!ui.includes(e)){ui.push(e);var t=e({addFilter:_o,utils:{Type:I,forin:S,isString:Se,isFile:Ze,toNaturalFileSize:yn,replaceInString:Tu,getExtensionFromFilename:Mt,getFilenameWithoutExtension:vn,guesstimateMimeType:Yn,getFileFromBlob:ot,getFilenameFromURL:vt,createRoute:be,createWorker:_u,createView:ve,createItemAPI:we,loadImage:yu,copyFile:bu,renameFile:si,createBlob:ln,applyFilterChain:Fe,text:de,getNumericAspectRatioFromString:on},views:{fileActionButton:_n}});yo(t.options)}},Ru=function(){return Object.prototype.toString.call(window.operamini)==="[object OperaMini]"},Ou=function(){return"Promise"in window},wu=function(){return"slice"in Blob.prototype},Du=function(){return"URL"in window&&"createObjectURL"in window.URL},Au=function(){return"visibilityState"in document},Lu=function(){return"performance"in window},Pu=function(){return"supports"in(window.CSS||{})},Cu=function(){return/MSIE|Trident/.test(window.navigator.userAgent)},Dr=function(){var i=ne()&&!Ru()&&Au()&&Ou()&&wu()&&Du()&&Lu()&&(Pu()||Cu());return function(){return i}}(),Ye={apps:[]},Mu="filepond",et=function(){};if(f.Status={},f.FileStatus={},f.FileOrigin={},f.OptionTypes={},f.create=et,f.destroy=et,f.parse=et,f.find=et,f.registerPlugin=et,f.getOptions=et,f.setOptions=et,Dr()){Bi(function(){Ye.apps.forEach(function(i){return i._read()})},function(i){Ye.apps.forEach(function(e){return e._write(i)})});var li=function i(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:Dr,create:f.create,destroy:f.destroy,parse:f.parse,find:f.find,registerPlugin:f.registerPlugin,setOptions:f.setOptions}})),document.removeEventListener("DOMContentLoaded",i)};document.readyState!=="loading"?setTimeout(function(){return li()},0):document.addEventListener("DOMContentLoaded",li);var ci=function(){return S(Pt(),function(e,t){f.OptionTypes[e]=t[1]})};f.Status=Object.assign({},it),f.FileOrigin=Object.assign({},Ee),f.FileStatus=Object.assign({},V),f.OptionTypes={},ci(),f.create=function(){var e=hu.apply(void 0,arguments);return e.on("destroy",f.destroy),Ye.apps.push(e),ai(e)},f.destroy=function(e){var t=Ye.apps.findIndex(function(n){return n.isAttachedTo(e)});if(t>=0){var r=Ye.apps.splice(t,1)[0];return r.restoreElement(),!0}return!1},f.parse=function(e){var t=Array.from(e.querySelectorAll("."+Mu)),r=t.filter(function(n){return!Ye.apps.find(function(o){return o.isAttachedTo(n)})});return r.map(function(n){return f.create(n)})},f.find=function(e){var t=Ye.apps.find(function(r){return r.isAttachedTo(e)});return t?ai(t):null},f.registerPlugin=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach(Su),ci()},f.getOptions=function(){var e={};return S(Pt(),function(t,r){e[t]=r[0]}),e},f.setOptions=function(e){return he(e)&&(Ye.apps.forEach(function(t){t.setOptions(e)}),bo(e)),f.getOptions()}}
2f.supported=Dr,Object.defineProperty(f,"__esModule",{value:!0})})});var Lr=$u(hi(),1);(function(f){typeof define=="function"&&define.amd?define(f):f()})(function(){"use strict";let f={closeButton:"\u2716",duration:1e4,removeAfter:300};window.toast=d=>{let{text:g,duration:L,variant:S,classList:D,removeAfter:U,closeButton:F}={...f,...d},$=document.querySelector(".toasts-wrapper");$||($=document.createElement("div"),$.classList.add("toasts-wrapper"),document.body.appendChild($));let k=document.createElement("div");k.classList.add("toast"),S&&k.classList.add(`toast-variant-${S}`),D?.map(re=>{k.classList.add(re)}),k.innerHTML=g;function me(){k.classList.remove("is-visible"),setTimeout(()=>{var re;(re=k.querySelector(".toast-close"))==null||re.removeEventListener("click",me),k.remove()},U)}if(F){let re=document.createElement("button");re.setAttribute("type","button"),re.classList.add("toast-close"),F&&(re.innerHTML=F),re.addEventListener("click",me),k.append(re)}if(L&&L>0&&setTimeout(me,L),!g||typeof g!="string")throw new Error("No message provided for toast");$.append(k),setTimeout(()=>{k.classList.add("is-visible")},50)}});function Te(f,d,g){"toast"in window&&window.toast({text:f,duration:5e3,variant:d,closeButton:" ",classList:[g]})}var Xu=document.querySelector(".newBrand-tabs-box"),Pr=Xu?.querySelectorAll(".newBrand-tabs-btn"),Qu=document.querySelectorAll("[data-tables-content]");function bi(f){Pr.forEach(g=>{g.classList.toggle("active",g.dataset.tablesBtn===f)});let d=null;Qu.forEach(g=>{let L=g.dataset.tablesContent===f;g.classList.toggle("active",L),L&&(d=g)}),f==="discussions"&&setTimeout(Yt,100),f==="reviews"&&setTimeout(Wt,100),d&&window.innerWidth<768&&d.scrollIntoView({behavior:"smooth",block:"start"})}Pr?.forEach(f=>{f.addEventListener("click",function(){let d=this.dataset.tablesBtn;d&&(history.pushState(null,"",`#${d}`),bi(d,!0))})});function Ii(){let f=window.location.hash.substring(1);f&&(bi(f,!1),setTimeout(()=>{let d=document.querySelector(`[data-tables-content="${f}"]`);if(d&&window.innerWidth<768){let g=document.querySelector(".newBrand-tabs-btns"),L=d.getBoundingClientRect().top+window.scrollY,S=240-(g?.classList.contains("is-fixed")?70:0);window.scrollTo({top:L-S,behavior:"smooth"})}},100))}Pr&&(Ii(),window.addEventListener("popstate",Ii));var Ti=document.getElementById("review-media-label")?.innerHTML;Ti&&Lr.default.setOptions({labelIdle:Ti});document.addEventListener("input",f=>{let d=f.target;if(d.name==="text"&&d.closest(".brand-discus-form")){let g=d.closest(".brand-discus-form").querySelector(".brand-discus-form-inf");if(g){let L=parseInt(d.getAttribute("maxlength"),10)||5e3;g.textContent=`${d.value.length}/${L}`}}});var Ar=document.querySelector(".newBrand-tabs-btns"),_i=document.querySelector(".newBrand-tabs");window.addEventListener("scroll",()=>{if(Ar&&_i&&window.innerWidth<768){let f=_i.getBoundingClientRect().top;f<=72&&Ar.classList.add("is-fixed"),f>72&&Ar.classList.remove("is-fixed")}});var Ku=document.querySelectorAll("[data-hide-list]");Ku.forEach(f=>{let d=f.querySelectorAll(".more-list-a.alt"),g=f.closest(".more-list"),L=g.querySelector(".more-list-btn span");L&&(()=>{let D=0;d.forEach(U=>{let F=U.getBoundingClientRect().bottom,$=f.getBoundingClientRect().bottom;F>$?(U.classList.add("is-hidden"),D++):U.classList.remove("is-hidden")}),D<=0?g.querySelector(".more-list-btn")?.classList.add("is-hidden"):g.querySelector(".more-list-btn")?.classList.remove("is-hidden"),L.textContent=` (+${D})`})()});var Zu=document.querySelectorAll(".newBrand-more-btn");Zu.forEach(f=>{f.addEventListener("click",()=>
2{let d=f.closest(".newBrand-tabs-cnt"),g=f.getAttribute("data-txt");f.setAttribute("data-txt",f.innerHTML),f.innerHTML=g,d.classList.toggle("hide-blocks"),f.classList.toggle("is-open")})});var Ju=document.querySelectorAll(".newBrand-tabs-bonus-box.more-cnt");Ju.forEach(f=>{let d=f.querySelector(".newBrand-tabs-bonus-lbl");d&&d.addEventListener("click",()=>{let g=d.nextElementSibling;g&&g.classList.contains("newBrand-tabs-bonus-content")&&(g.classList.toggle("is-open"),d.classList.toggle("is-open"))})});var el=document.querySelectorAll("[data-form-no-open]");el.forEach(f=>{f.addEventListener("click",()=>{if(f.classList.contains("done")){let d=f.nextElementSibling;d&&d.classList.contains("newBrand-form-no")&&d.classList.add("is-open")}})});var tl=document.querySelectorAll("[data-form-no-close]");tl.forEach(f=>{f.addEventListener("click",d=>{d.preventDefault();let g=f.closest("[data-form-no]");g&&g.classList.toggle("is-open")})});document.addEventListener("click",f=>{document.querySelectorAll("[data-form-no]").forEach(d=>{let g=f.target.closest("[data-form-no-open]");d.classList.contains("is-open")&&!d.contains(f.target)&&(!g||g.getAttribute("data-form-no-open")!==d.getAttribute("data-form-no"))&&d.classList.remove("is-open")})});var rl=document.querySelectorAll("[data-resize-area]");rl.forEach(f=>{let[d,g]=f.getAttribute("data-resize-area").split(",").map(Number);f.style.minHeight=`${d}px`,f.style.maxHeight=`${g}px`,f.addEventListener("input",function(){this.style.height=`${d}px`,this.style.height=Math.min(this.scrollHeight,g)+"px"})});document.addEventListener("submit",async function(f){if(!f.target.matches(".brand-discus-form form"))return;f.preventDefault();let d=f.target,g=new FormData(d),L=d.getAttribute("action");try{d.querySelector("button[type=submit]").setAttribute("disabled",!0),d.closest(".brand-discus-form").querySelector(".brand-discus-form-error").innerHTML="";let D=await(await fetch(L,{method:"POST",body:g})).json();if(!D.status)throw new Error(`${D.error}`);let U=d.closest(".brand-discus-form").querySelector(".brand-discus-message");U&&(U.classList.add("is-visible"),U.innerHTML=document.querySelector(".brand-discus-add-sucs").innerHTML,setTimeout(()=>{U.classList.remove("is-visible"),U.innerHTML=""},5e3)),d.querySelector(".brand-discus-form-inf").textContent="0/5000",d.reset(),d.querySelector("button[type=submit]").removeAttribute("disabled"),d.closest(".brand-discus-comment")||(d.classList.add("hidden"),document.querySelector(".brand-discus-top").classList.add("hidden")),d.closest(".brand-discus-comment")&&(d.classList.add("hidden"),d.closest(".brand-discus-comment").querySelector(".brand-discus-comment-answer").remove(),d.closest(".brand-discus-form").querySelector(".quote-comment-rep").remove())}catch(S){Te(S.message||window.zuc_default_error_message||"Something went wrong, try later.","error","comment-result")}finally{d.querySelector("button[type=submit]").removeAttribute("disabled")}});document.addEventListener("click",function(f){let d=f.target.closest(".brand-discus-comment-answer");if(!d)return;let g=d.closest(".brand-discus-comment"),L=g.querySelector(".brand-discus-comment-au-name").textContent,S=g.id.replace("comment-","");if(d.classList.contains("auth"))return!1;let D=document.querySelector(".brand-discus-answer-container"),U=D.querySelector("form");if(!U)return;let F=g.querySelector(".brand-discus-form");if(F){F.remove();return}let $=U.cloneNode(!0);$.setAttribute("action",U.getAttribute("action")),typeof zuc_apply_ga_track=="function"&&zuc_apply_ga_track($.querySelector('button[type="submit"]'));let k=$.querySelector("textarea");k&&(k.placeholder=`${k.placeholder} ${L}`);let me=$.querySelector("input[name='commentId']");me||(me=document.createElement("input"),me.setAttribute("type","hidden"),me.setAttribute("name","commentId"),$.appendChild(me)),me.value=S;let re=document.createElement("div");re.classList.add("brand-discus-form"),re.innerHTML=` 3 <div class="brand-discus-message"></div> 4 <div class="quote-comment-rep">${D.querySelector(".quote-comment-rep").innerHTML} ${L}</div> 5 `,re.appendChild($);let _e=document.createElement("span");_e.classList.add("brand-discus-form-error"),re.appendChild(_e),g.appendChild(re)});function Yt(){document.querySelectorAll(".brand-discus-comment-txt p").forEach(d=>{let g=d.closest(".brand-discus-comment-txt"),L=63;d.style.maxHeight="none";let S=d.scrollHeight;if(S>L){d.style.maxHeight=`${L}px`,d.style.overflow="hidden";let D=g.querySelector(".brand-discus-comment-show-more"),U=d.closest("[data-txt-m], [data-txt-l]"),F=U?.getAttribute("data-txt-m")||"Show More",$=U?.getAttribute("data-txt-l")||"Show Less";D||(D=document.createElement("button"),D.classList.add("brand-discus-comment-show-more"),D.textContent=F,D.addEventListener("click",function(){let k=d.classList.toggle("more-hidden");d.style.maxHeight=k?`${L}px`:`${S}px`,D.textContent=k?F:$,g.classList.toggle("more-hidden")}),d.after(D)),g.classList.add("more-hidden"),d.classList.add("more-hidden")}})}Yt();document.querySelectorAll(".newBrand-tabs-btn").forEach(f=>{f.addEventListener("click",()=>{setTimeout(Yt,100)})});var Tt=document.querySelector(".brand-discus-delete-popup"),nl=document.querySelectorAll("[data-close-delete-popup]"),il=Tt?.querySelector(".brand-discus-delete-popup-btns"),zt=null;document.addEventListener("click",function(f){let d=f.target.closest(".brand-discus-comment-delete");if(!d)return;let g=d.closest(".brand-discus-comment");g&&(zt=g.id.replace("comment-",""),Tt.classList.add("open"))});Tt&&nl.forEach(f=>{f.addEventListener("click",function(){Tt.classList.remove("open")})});il?.addEventListener("submit",async function(f){if(f.preventDefault(),!zt)return;let d=f.target,g=new FormData(d);g.append("commentId",zt);try{d.querySelector("button[type=submit]").setAttribute("disabled",!0);let S=await(await fetch(d.getAttribute("action"),{method:"POST",body:g})).json();if(!S.status)throw new Error(S.error||window.zuc_default_error_message||"Something went wrong, try later.");document.querySelector(`#comment-${zt}`).remove(),Tt.classList.remove("open"),d.querySelector("button[type=submit]").removeAttribute("disabled"),Te(S.message,"success","comment-result")}catch(L){Te(L.message||window.zuc_default_error_message||"Something went wrong, try later.","error","comment-result")}finally{d.querySelector("button[type=submit]").removeAttribute("disabled")}});document.querySelectorAll("[data-go-to-com]").forEach(f=>{f.addEventListener("click",function(){let d=this.getAttribute("data-go-to-com"),g=document.querySelector(d);if(g){let S=g.getBoundingClientRect().top+window.scrollY-110;window.scrollTo({top:S,behavior:"smooth"})}})});document.querySelectorAll("[data-to-discus-form]").forEach(f=>{f.addEventListener("click",function(){let d=document.querySelector("#brand-discus-add-comment-form");if(d){let L=d.getBoundingClientRect().top+window.scrollY-110;window.scrollTo({top:L,behavior:"smooth"})}})});document.addEventListener("click",async function(f){let d=f.target.closest(".brand-discus-comment-like");if(!d)return;let g=d.closest(".brand-discus-comment"),L=g?g.id.replace("comment-",""):null;if(!L)return;if(d.classList.contains("auth")){let $=new Date;return $.setTime($.getTime()+3600*1e3),document.cookie=`zuc_add_like_comment_id=${L}; expires=${$.toUTCString()}; path=/`,!1}let S=d.classList.contains("done"),D=d.textContent.match(/\d+/),U=D?parseInt(D[0],10):0,F=new FormData;F.append("commentId",L),F.append("action","zuc_like_comment");try{d.setAttribute("disabled",!0);let k=await(await fetch(d.closest("[data-ajax-url]").getAttribute("data-ajax-url"),{method:"POST",body:F})).json();if(!k.status)throw new Error(k.error||window.zuc_default_error_message||"Something went wrong, try later.");d.classList.toggle("done"),d.textContent=`(${S?U-1:U+1})`,d.removeAttribute("disabled")}catch($){Te($.message||window.zuc_default_error_message||"Something went wrong, try later.","error","comment-result")}finally{d.removeAttribute("disabled")}});async function Si(f){let d=document.querySelector(".brand-discus-load-btn"),g=document.querySelector(".brand-discus .l-filter-sort-all .is-active"),L=g?g.value:"oldest";try{let S=1;f.target.classList.contains("brand-discus-load-btn")&&(d.setAttribute("disabled",!0),S=d.getAttribute("data-page"));let D=new URL(d.closest("[data-ajax-url]").getAttribute("data-ajax-url"));D.searchParams.append("action","zuc_paginate_comments"),D.searchParams.append("page",S),D.searchParams.append("post",d.getAttribute("data-post")),D.searchParams.append("order",L),D.searchParams.append("part","brand");let F=await(await fetch(D,{method:"GET"})).json();if(!F.status)throw new Error(F.error||window.zuc_default_error_message||"Something went wrong, try later.");f.target.classList.contains("brand-discus-load-btn")?(d.closest(".brand-discus").querySelector(".brand-discus-items").innerHTML+=F.items,d.setAttribute("data-page",Number(d.getAttribute("data-page"))+1)):(d.closest(".brand-discus").querySelector(".brand-discus-items").innerHTML=F.items,d.setAttribute("data-page",2)),Number(F.pagination.total)==Number(F.pagination.current)?(d.setAttribute("data-page",2),d.classList.add("is-hidden")):d.classList.remove("is-hidden"),Yt()}catch(S){console.error(S),Te(S.message||window.zuc_default_error_message||"Something went wrong, try later.","error","comment-result")}finally{d.removeAttribute("disabled")}}document.querySelectorAll(".brand-discus-load-btn").forEach(f=>{f.addEventListener("click",Si)});document.addEventListener("click",async function(f){f.target.closest(".l-filter-coms-btn")&&await Si(f)});var ol=document.querySelectorAll("[data-form-rev-tgl]");ol.forEach(f=>{if(f.classList.contains("auth"))return!1;f.addEventListener("click",()=>{document.querySelector("[data-form-rev]").classList.toggle("is-visible"),document.querySelector(".newBrand-rev-bottom").classList.toggle("is-visible")})});document.addEventListener("click",f=>
5{let d=f.target.closest(".newBrand-review-block-btn");if(!d)return;let g=d.getAttribute("data-txt");d.setAttribute("data-txt",d.innerHTML),d.innerHTML=g;let L=d.closest(".newBrand-review");L&&(L.querySelector(".newBrand-review-block")?.classList.toggle("is-hidden"),L.querySelector(".newBrand-review-txt p").offsetHeight>20&&L.querySelector(".newBrand-review-txt p")?.classList.toggle("is-hidden"))});document.addEventListener("click",f=>{if(f.target.matches(".newBrand-form-rev-pc-del")){f.preventDefault();let d=f.target.closest("div");d.querySelectorAll("label").length>1&&(f.target.closest("label").remove(),Cr(d))}});document.addEventListener("keydown",f=>{if(f.target.matches("[data-brand-pc]")){let d=f.target.closest("div"),g=d.querySelectorAll("label"),L=g[g.length-1].querySelector("input");f.target===L&&f.target.value.trim()!==""&&al(d),Cr(d)}});function al(f){let d=document.createElement("label"),g=f.classList.contains("newBrand-form-rev-proses")?"newBrand-form-rev-pros":"newBrand-form-rev-cons";d.classList.add("newBrand-form-rev-input",g);let L=document.createElement("input");L.type="text",L.name="pros",L.placeholder="Your text here",L.setAttribute("data-brand-pc",""),L.setAttribute("maxlength","200");let S=document.createElement("button");S.classList.add("newBrand-form-rev-pc-del"),S.addEventListener("click",D=>{D.preventDefault(),f.querySelectorAll("label").length>1&&(d.remove(),Cr(f))}),d.appendChild(L),d.appendChild(S),f.appendChild(d)}function Cr(f){let d=f.querySelectorAll("label");f.querySelectorAll(".newBrand-form-rev-pc-del").forEach(L=>{L.disabled=d.length===1,L.style.pointerEvents=d.length===1?"none":"auto"})}var sl=document.querySelectorAll("[data-form-rev] form"),yi=document.querySelector(".newBrand-form-rev-done");sl.forEach(f=>{Ri(f,!1)});function Ri(f,d,g){let L=f.querySelector(".fileUpload"),S=f.querySelector(".newBrand-form-upload-preview"),D=f.querySelector(".newBrand-form-upload-label"),U=f.querySelector("input[name='no_spam_approve']");d&&(U.checked=!0);let F=Lr.default.create(L,{allowMultiple:!1,allowImagePreview:!0,acceptedFileTypes:["image/*"]});F.on("addfile",(_e,ue)=>{if(!_e){D.classList.remove("has-error"),D.querySelector(".error-message").innerHTML="";let Ie=["image/png","image/jpeg","image/jpg"],ne=2*1024*1024;if(!Ie.includes(ue.file.type)){F.removeFile(ue.id),D.classList.add("has-error"),D.querySelector(".error-message").innerHTML=D.getAttribute("data-error-format");return}if(ue.file.size>ne){F.removeFile(ue.id),D.classList.add("has-error"),D.querySelector(".error-message").innerHTML=D.getAttribute("data-error-size");return}let X=new FileReader;X.onload=Ce=>{if(!S)return;let Ae=new Image;Ae.onload=function(){if(this.width<100||this.height<100){F.removeFile(ue.id),D.classList.add("has-error"),D.querySelector(".error-message").innerHTML=D.getAttribute("data-error-dimensions")||"Image must be at least 100x100px";return}S.innerHTML="";let ie=document.createElement("img");ie.src=Ce.target.result,ie.classList.add("upload-preview-image");let Re=document.createElement("div");Re.classList.add("upload-item");let Z=document.createElement("button");Z.classList.add("upload-remove"),Z.addEventListener("click",()=>{F.removeFile(ue.id),Re.remove(),D&&(D.style.display="block")}),Re.appendChild(ie),Re.appendChild(Z),S.appendChild(Re),S.style.display="block",D&&(D.style.display="none")},Ae.onerror=function(){F.removeFile(ue.id),D.classList.add("has-error"),D.querySelector(".error-message").innerHTML=D.getAttribute("data-error-broken")||"Invalid image file"},Ae.src=Ce.target.result},X.readAsDataURL(ue.file)}}),F.on("removefile",()=>{S&&(S.innerHTML=""),D&&(D.style.display="block")});let $=f.querySelector("textarea[name='text']");$.addEventListener("input",()=>{$.value.trim().length>=3&&$.value.trim().length<=3e3&&($.classList.remove("has-error"),$.nextElementSibling.textContent="")});let k=f.querySelector("input[name='experience_date']"),me=new Date().toISOString().split("T")[0];k.max=me,k.addEventListener("input",()=>{let _e=k.value;if(!_e){k.classList.add("has-error"),k.nextElementSibling.textContent=k.getAttribute("data-er-mes");return}let ue=new Date(k.min),Ie=new Date(k.max),ne=new Date(_e);ne<ue||ne>Ie?(k.classList.add("has-error"),k.nextElementSibling.textContent=k.getAttribute("data-er-val-mes")):(k.classList.remove("has-error"),k.nextElementSibling.textContent="")});let re=f.querySelector("input[name='video']");re.addEventListener("input",()=>{(!re.value.trim()||/^https?:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\//.test(re.value.trim()))&&(re.classList.remove("has-error"),re.nextElementSibling.textContent="")}),f.addEventListener("submit",async _e=>{_e.preventDefault(),f.querySelectorAll(".has-error").forEach(ae=>ae.classList.remove("has-error")),f.querySelectorAll(".error-message").forEach(ae=>ae.textContent="");let ue=!0,Ie="",ne=new FormData(f),X=ne.get("video")?.trim()||"",Ce=f.querySelector("textarea[name='text']"),Ae=ne.get("text").replace(/<br\s*\/?>/gi,` 6`).replace(/\n{2,}/g,` 7`).replace(/^\s*\n+|\n+\s*$/g,"").trim();(Ae.length<3||Ae.length>3e3)&&(Ce.classList.add("has-error"),Ce.nextElementSibling.textContent=Ce.getAttribute("data-er-mes"),ue=!1,Ce?.scrollIntoView({behavior:"smooth",block:"center"})),ne.set("text",Ae);let ge=f.querySelector("input[name='experience_date']"),qe=ne.get("experience_date");if(!qe)ge.classList.add("has-error"),ge.nextElementSibling.textContent=ge.getAttribute("data-er-mes"),ue=!1,ge?.scrollIntoView({behavior:"smooth",block:"center"});else{let ae=new Date(ge.min),Le=new Date(ge.max),Ue=new Date(qe);Ue<ae||Ue>Le?(ge.classList.add("has-error"),ge.nextElementSibling.textContent=ge.getAttribute("data-er-val-mes"),ue=!1,ge?.scrollIntoView({behavior:"smooth",block:"center"})):(ge.classList.remove("has-error"),ge.nextElementSibling.textContent="")}let ie=f.querySelector("input[name='no_spam_approve']");ie.addEventListener("change",()=>{ie.checked&&(ie.classList.remove("has-error"),ie.nextElementSibling.nextElementSibling.textContent="")}),ie.checked||(ie.classList.add("has-error"),ie.nextElementSibling.nextElementSibling.textContent=ie.getAttribute("data-er-mes"),ue=!1,(ie.closest(".
7newBrand-form-rev-pol")||ie.parentElement)?.scrollIntoView({behavior:"smooth",block:"center"}));let Re=f.querySelector("input[name='video']");if(X&&!/^https?:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\//.test(X)&&(Re.classList.add("has-error"),Re.nextElementSibling.textContent=Re.getAttribute("data-er-mes"),ue=!1),!ue)return;let Z=X?ll(X):"";Z&&ne.append("videoThumbnail",Z),ne.delete("pros"),ne.delete("cons"),ne.delete("file_screenshot");let pe=[];f.querySelectorAll(".newBrand-form-rev-proses label input").forEach(ae=>{ae.value.trim()&&pe.push(ae.value)});let ce=[];if(f.querySelectorAll(".newBrand-form-rev-conses label input").forEach(ae=>{ae.value.trim()&&ce.push(ae.value)}),pe.forEach(ae=>{ne.append("pros[]",ae)}),ce.forEach(ae=>{ne.append("cons[]",ae)}),F.getFiles().length>0){let ae=F.getFile();ne.append("file_screenshot",ae.file)}d&&F.getFiles().length<=0&&(Ie=f.querySelector(".newBrand-form-upload-preview img")?.getAttribute("src"),Ie&&ne.append("file_screenshot",Ie)),ne.delete("filepond"),g&&ne.append("reviewId",g);let Oe=f.getAttribute("action");try{f.querySelector(".btn.btn-blue").setAttribute("disabled",!0),f.querySelector(".btn.btn-blue").classList.add("load");let Le=await(await fetch(Oe,{method:"POST",body:ne})).json();if(Le.reload)Le.error?(Te(Le.error||window.zuc_default_error_message||"Something went wrong, try later.","error","review-result"),setTimeout(()=>{location.reload()},2e3)):location.reload();else if(Le.status){if(yi.classList.add("is-visible"),setTimeout(()=>{yi.classList.remove("is-visible")},5e3),f.reset(),f.querySelector(".btn.btn-blue").removeAttribute("disabled"),f.closest("[data-form-rev]").classList.remove("is-visible"),document.querySelector(".empty-rev-block")?.remove(),ul(f),F.removeFiles(),document.querySelector(".newBrand-reviews").style.display="flex",Le.item)if(g){let Ue=document.querySelector(`#review-${g}`),_t=document.createElement("div");_t.innerHTML=Le.item;let $t=_t.firstElementChild;Ue.replaceWith($t),Ue.classList.remove("is-hidden")}else document.querySelector(".newBrand-reviews").insertAdjacentHTML("afterbegin",Le.item)}else Te(Le.error||window.zuc_default_error_message||"Something went wrong, try later.","error","review-result"),console.error(Le.error)}catch(ae){console.error(ae),Te(window.zuc_default_error_message||"Something went wrong, try later.","error","review-result")}finally{f.querySelector(".btn.btn-blue").removeAttribute("disabled"),f.querySelector(".btn.btn-blue")?.classList.remove("load"),Wt()}})}function ul(f){f.querySelectorAll(".newBrand-form-rev-proses label").forEach((d,g)=>{g!=0&&d.remove()}),f.querySelectorAll(".newBrand-form-rev-conses label").forEach((d,g)=>{g!=0&&d.remove()})}function ll(f){let d=f.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/),g=f.match(/vimeo\.com\/(\d+)/);return d?`https://img.youtube.com/vi/${d[1]}/hqdefault.jpg`:g?`https://vumbnail.com/${g[1]}.jpg`:""}document.querySelector(".newBrand-form-rev-done-close")&&document.querySelector(".newBrand-form-rev-done-close").addEventListener("click",()=>{document.querySelector(".newBrand-form-rev-done").classList.remove("is-visible")});document.addEventListener("click",function(f){let d=f.target.closest(".newBrand-rev-mode-tgl");if(d){let g=d.closest(".newBrand-rev-mode")?.querySelector(".newBrand-rev-mode-btns");g&&g.classList.toggle("is-visible");return}document.querySelectorAll(".newBrand-rev-mode-btns.is-visible").forEach(g=>{g.contains(f.target)||g.classList.remove("is-visible")})});document.addEventListener("click",f=>{let d=f.target.closest("[data-show-media-popup]");if(!d)return;let g=d.closest(".newBrand-review-media")?.querySelector(".newBrand-review-media-popup");g&&g.classList.toggle("is-visible")});document.addEventListener("click",async function(f){let d=f.target.closest(".newBrand-act-review.newBrand-act-yes");if(!d)return;let g=d.closest(".newBrand-review"),L=g?g.id.replace("review-",""):null;if(!L)return;if(d.classList.contains("auth")){let F=new Date;return F.setTime(F.getTime()+3600*1e3),document.cookie=`zuc_add_like_review_id=${L}; expires=${F.toUTCString()}; path=/`,!1}let S=d.classList.contains("done"),D=parseInt(d.textContent.match(/\d+/)[0],10),U=new FormData;U.append("reviewId",L),U.append("action","zuc_like_review");try{d.setAttribute("disabled",!0);let F=d.closest("[data-ajax-url]").getAttribute("data-ajax-url"),k=await(await fetch(F,{method:"POST",body:U})).json();if(k.reload)k.error?(Te(k.error||window.zuc_default_error_message||"Something went wrong, try later.","error","review-result"),setTimeout(()=>{location.reload()},2e3)):location.reload();else{if(!k.status)throw new Error(k.error||window.zuc_default_error_message||"Something went wrong, try later.");d.classList.toggle("done"),d.textContent=`(${S?D-1:D+1})`,d.removeAttribute("disabled")}}catch(F){Te(F.message,"error","review-result")}finally{d.removeAttribute("disabled")}});var jt=document.querySelector(".newBrand-reviews-delete-popup"),cl=document.querySelectorAll("[data-close-delete-review-popup]"),ct=jt?.querySelector(".newBrand-reviews-delete-popup-btns"),It=null;document.addEventListener("click",async function(f){let d=f.target.closest(".
7newBrand-rev-mode-del");if(!d)return;It=d.closest(".newBrand-review").id.replace("review-",""),jt.classList.add("open")});cl.forEach(f=>{f.addEventListener("click",function(){jt.classList.remove("open")})});ct?.addEventListener("submit",async function(f){if(f.preventDefault(),!It)return;let d=ct.getAttribute("action"),g=new FormData(ct);g.append("reviewId",It),g.append("action","zuc_delete_review");try{ct.querySelector("button[type=submit]").setAttribute("disabled",!0);let S=await(await fetch(d,{method:"POST",body:g})).json();if(S.reload)S.error?(Te(S.error||window.zuc_default_error_message||"Something went wrong, try later.","error","review-result"),setTimeout(()=>{location.reload()},2e3)):location.reload();else{if(!S.status)throw new Error(S.error||window.zuc_default_error_message||"Something went wrong, try later.");document.querySelector(`#review-${It}`).remove(),jt.classList.remove("open"),ct.querySelector("button[type=submit]").removeAttribute("disabled"),Te(S.message,"success","review-result"),console.error(`Review by id ${It} was deleted successful.`)}}catch(L){Te(L.message,"error","review-result")}finally{ct.querySelector("button[type=submit]").removeAttribute("disabled")}});document.addEventListener("click",f=>{let d=f.target.closest(".newBrand-rev-mode-edt");if(!d)return;let g=d.closest(".newBrand-review"),L=g.id.replace("review-",""),S=g.querySelector(".newBrand-rev-val span").innerHTML.trim(),D=g.querySelector(".newBrand-review-au-name").innerHTML.trim(),U=g.querySelector(".newBrand-review-au-photo").getAttribute("src"),F=g.querySelector(".newBrand-review-media-screen img")?.getAttribute("src")||"",$=g.querySelector(".newBrand-review-media-video")?.getAttribute("href")||"",k=g.querySelector(".newBrand-review-media-video img")?.getAttribute("src")||"",me=g.querySelector(".newBrand-review-txt p")?.innerHTML.trim().replace(/<br\s*\/?>/gi,` 8`)||"",re=g.querySelector(".newBrand-rev-mode-exp")?.getAttribute("datetime")?.split(" ")[0],_e=[],ue=[];g.querySelectorAll(".newBrand-review-c").forEach(Z=>{ue.push(Z.textContent.trim())}),g.querySelectorAll(".newBrand-review-p").forEach(Z=>{_e.push(Z.innerHTML.trim())}),ue.push(""),_e.push("");let Ie=document.createElement("div");Ie.classList.add("newBrand-form-rev"),Ie.setAttribute("data-form-rev",!0);let ne=document.querySelector(".newBrand-form-rev form"),X=ne.cloneNode(!0);X.classList.add("is-edit"),Ie.append(X),g.insertAdjacentElement("afterend",Ie),X.querySelector('button[type="submit"]').setAttribute("data-event-name","click_edit_review"),typeof zuc_apply_ga_track=="function"&&zuc_apply_ga_track(X.querySelector('button[type="submit"]')),X.querySelector(".newBrand-review-au img").setAttribute("src",U),X.querySelector(".newBrand-review-au-name").innerHTML=D,X.querySelector(".newBrand-form-rev-ttl").innerHTML="Edit a review",X.querySelector(".btn.btn-blue").innerHTML="Update a review",X.querySelector(".btn.btn-blue").append(ne.querySelector(".btn.btn-blue").querySelector("span").cloneNode(!0));let Ce=X.querySelector('textarea[name="text"]');Ce&&(Ce.value=me.replace(/\n{2,}/g,` 9`).trim());let Ae=X.querySelector('input[name="experience_date"]');Ae&&re&&(Ae.value=re);let ge=X.querySelector('input[name="video"]');ge&&(ge.value=$);let qe=X.querySelector(`input[name="rate"][value="${S}"]`);qe&&(qe.checked=!0);let ie=X.querySelector(".newBrand-form-rev-proses");ie.innerHTML="",_e.forEach(Z=>{let pe=document.createElement("label");pe.className="newBrand-form-rev-input newBrand-form-rev-pros";let ce=document.createElement("input");ce.setAttribute("data-brand-pc",!0),ce.setAttribute("maxlength","200"),ce.type="text",ce.name="pros",ce.value=Z;let Oe=document.createElement("button");Oe.type="button",Oe.className="newBrand-form-rev-pc-del",pe.appendChild(ce),pe.appendChild(Oe),ie.appendChild(pe)});let Re=X.querySelector(".newBrand-form-rev-conses");if(Re.innerHTML="",ue.forEach(Z=>{let pe=document.createElement("label");pe.className="newBrand-form-rev-input newBrand-form-rev-cons";let ce=document.createElement("input");ce.setAttribute("data-brand-pc",!0),ce.setAttribute("maxlength","200"),ce.type="text",ce.name="cons",ce.value=Z;let Oe=document.createElement("button");Oe.type="button",Oe.className="newBrand-form-rev-pc-del",pe.appendChild(ce),pe.appendChild(Oe),Re.appendChild(pe)}),F){X.querySelector(".newBrand-form-upload-label").style.display="none";let Z=X.querySelector(".newBrand-form-upload-preview");if(Z.style.display="block",!X.querySelector(".upload-preview-image")){let pe=document.createElement("div");pe.classList.add("upload-item");let ce=document.createElement("img");ce.classList.add("upload-preview-image"),pe.append(ce);let Oe=document.createElement("button");Oe.classList.add("upload-remove"),pe.append(Oe),Z.append(pe)}X.querySelector(".upload-preview-image").setAttribute("src",F),X.querySelector(".upload-remove").addEventListener("click",pe=>{pe.preventDefault(),Z&&(Z.innerHTML=""),X.querySelector(".newBrand-form-upload-label").style.display="block"})}X.querySelectorAll("input, label").forEach(Z=>{Z.id&&(Z.id=`${Z.id}-${L}`),Z.htmlFor&&(Z.htmlFor=`${Z.htmlFor}-${L}`)}),Ri(X,!0,L),X.querySelector("[data-form-rev-tgl]").addEventListener("click",Z=>{Z.preventDefault(),Ie.classList.remove("is-visible"),g.classList.remove("is-hidden")}),Ie.classList.add("is-visible"),g.classList.add("is-hidden")});async function Oi(f){let d=document.querySelector(".newBrand-review-load-btn"),g=document.querySelector(".newBrand-reviews-cnt .newBrand-sort-btn.is-active"),L=g?g.value:"oldest";try{let S=1;f.target.classList.contains("newBrand-review-load-btn")&&(d.setAttribute("disabled",!0),d.classList.add("is-loading"),S=d.getAttribute("data-page"));let D=new URL(d.closest("[data-ajax-url]").getAttribute("data-ajax-url"));D.searchParams.append("action","zuc_paginate_reviews"),D.searchParams.append("page",S),D.searchParams.append("post",d.getAttribute("data-post")),D.searchParams.append("order",L),D.searchParams.append("part","brand");let F=await(await fetch(D,{method:"GET"})).json();if(F.reload)F.error?(Te(F.error||window.zuc_default_error_message||"Something went wrong, try later.","error","review-result"),setTimeout(()=>{location.reload()},2e3)):location.reload();else{if(!F.status)throw new Error(F.error||window.zuc_default_error_message||"Something went wrong, try later.");f.target.classList.contains("newBrand-review-load-btn")?(d.closest("[data-ajax-url]").querySelector(".newBrand-reviews").innerHTML+=F.items,d.setAttribute("data-page",Number(d.getAttribute("data-page"))+1)):d.closest("[data-ajax-url]").querySelector(".newBrand-reviews").innerHTML=F.items,F.pagination.total==F.pagination.current?(d?.setAttribute("data-page",2),d?.classList.add("is-hidden")):d?.classList.remove("is-hidden")}}catch(S){console.error(S),Te(S.message||window.zuc_default_error_message||"Something went wrong, try later.","error","review-result")}finally{d?.removeAttribute("disabled"),d?.classList.remove("is-loading"),Wt()}}document.querySelectorAll(".newBrand-review-load-btn").forEach(f=>{f.addEventListener("click",Oi)});document.addEventListener("click",async function(f){f.target.closest(".
9newBrand-sort-btn")&&await Oi(f)});document.addEventListener("keydown",f=>{let{target:d,key:g}=f;d?.closest(".newBrand-form-rev")&&d.tagName==="INPUT"&&g==="Enter"&&(f.preventDefault(),d.value.trim().length>0&&d.parentElement.nextElementSibling?.querySelector("input")?.focus())});function Wt(){document.querySelectorAll(".newBrand-review-txt p").forEach(f=>{f.offsetHeight<20?f.classList.remove("is-hidden"):f.classList.add("is-hidden")})}Wt()})(); 10/*! Bundled license information: 11 12filepond/dist/filepond.js: 13 (*! 14 * FilePond 4.32.7 15 * Licensed under MIT, https://opensource.org/licenses/MIT/ 16 * Please visit https://pqina.nl/filepond/ for details. 17 *) 18*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.