@salla.sa/twilight-components 2.13.66 → 2.13.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-d23f6f98.js → app-globals-b7d4e7fe.js} +2 -2
- package/dist/cjs/app-globals-b7d4e7fe.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-add-product-button_48.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_48.cjs.entry.js.map +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/collection/components/salla-comments/salla-comment-item.js +1 -1
- package/dist/collection/components/salla-comments/salla-comment-item.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-comment-item2.js +1 -1
- package/dist/components/salla-comment-item2.js.map +1 -1
- package/dist/components/salla-quick-buy2.js.map +1 -1
- package/dist/esm/{app-globals-1a4320ce.js → app-globals-d8ab32b4.js} +2 -2
- package/dist/esm/app-globals-d8ab32b4.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-add-product-button_48.entry.js +1 -1
- package/dist/esm/salla-add-product-button_48.entry.js.map +1 -1
- package/dist/esm/twilight.js +1 -1
- package/dist/esm-es5/{app-globals-1a4320ce.js → app-globals-d8ab32b4.js} +2 -2
- package/dist/{twilight/p-e04fe73f.system.js.map → esm-es5/app-globals-d8ab32b4.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-add-product-button_48.entry.js +3 -3
- package/dist/esm-es5/salla-add-product-button_48.entry.js.map +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-0b087481.entry.js → p-093185c9.entry.js} +2 -2
- package/dist/twilight/p-093185c9.entry.js.map +1 -0
- package/dist/twilight/{p-414bc6f1.js → p-8e070ed6.js} +2 -2
- package/dist/twilight/{p-414bc6f1.js.map → p-8e070ed6.js.map} +1 -1
- package/dist/twilight/{p-a7f0fadc.system.js → p-963a9e0e.system.js} +2 -2
- package/dist/twilight/{p-55ccc76f.system.entry.js → p-bd139d03.system.entry.js} +2 -2
- package/dist/twilight/p-bd139d03.system.entry.js.map +1 -0
- package/dist/twilight/{p-e04fe73f.system.js → p-dad29c6b.system.js} +2 -2
- package/dist/{esm-es5/app-globals-1a4320ce.js.map → twilight/p-dad29c6b.system.js.map} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/app-globals-d23f6f98.js.map +0 -1
- package/dist/esm/app-globals-1a4320ce.js.map +0 -1
- package/dist/twilight/p-0b087481.entry.js.map +0 -1
- package/dist/twilight/p-55ccc76f.system.entry.js.map +0 -1
- /package/dist/twilight/{p-a7f0fadc.system.js.map → p-963a9e0e.system.js.map} +0 -0
|
@@ -8,13 +8,13 @@ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function a(e){return e ins
|
|
|
8
8
|
*
|
|
9
9
|
* Copyright 2017-2021 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
|
10
10
|
* Released under the ISC license.
|
|
11
|
-
*/var classCallCheck=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}};var createClass=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}return function(t,i,n){if(i)e(t.prototype,i);if(n)e(t,n);return t}}();var slicedToArray=function(){function e(e,t){var i=[];var n=true;var a=false;var r=undefined;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done);n=true){i.push(s.value);if(t&&i.length===t)break}}catch(e){a=true;r=e}finally{try{if(!n&&o["return"])o["return"]()}finally{if(a)throw r}}return i}return function(t,i){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,i)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();String.prototype.startsWith=String.prototype.startsWith||function(e){return this.indexOf(e)===0};String.prototype.padStart=String.prototype.padStart||function(e,t){var i=this;while(i.length<e){i=t+i}return i};var colorNames={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function printNum(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var i=t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString();return i||"0"}var Color=function(){function e(t,i,n,a){classCallCheck(this,e);var r=this;function o(t){if(t.startsWith("hsl")){var i=t.match(/([\-\d\.e]+)/g).map(Number),n=slicedToArray(i,4),a=n[0],o=n[1],s=n[2],l=n[3];if(l===undefined){l=1}a/=360;o/=100;s/=100;r.hsla=[a,o,s,l]}else if(t.startsWith("rgb")){var c=t.match(/([\-\d\.e]+)/g).map(Number),u=slicedToArray(c,4),d=u[0],p=u[1],h=u[2],f=u[3];if(f===undefined){f=1}r.rgba=[d,p,h,f]}else{if(t.startsWith("#")){r.rgba=e.hexToRgb(t)}else{r.rgba=e.nameToRgb(t)||e.hexToRgb(t)}}}if(t===undefined);else if(Array.isArray(t)){this.rgba=t}else if(n===undefined){var s=t&&""+t;if(s){o(s.toLowerCase())}}else{this.rgba=[t,i,n,a===undefined?1:a]}}createClass(e,[{key:"printRGB",value:function e(t){var i=t?this.rgba:this.rgba.slice(0,3),n=i.map((function(e,t){return printNum(e,t===3?3:0)}));return t?"rgba("+n+")":"rgb("+n+")"}},{key:"printHSL",value:function e(t){var i=[360,100,100,1],n=["","%","%",""];var a=t?this.hsla:this.hsla.slice(0,3),r=a.map((function(e,t){return printNum(e*i[t],t===3?3:1)+n[t]}));return t?"hsla("+r+")":"hsl("+r+")"}},{key:"printHex",value:function e(t){var i=this.hex;return t?i:i.substring(0,7)}},{key:"rgba",get:function t(){if(this._rgba){return this._rgba}if(!this._hsla){throw new Error("No color is set")}return this._rgba=e.hslToRgb(this._hsla)},set:function e(t){if(t.length===3){t[3]=1}this._rgba=t;this._hsla=null}},{key:"rgbString",get:function e(){return this.printRGB()}},{key:"rgbaString",get:function e(){return this.printRGB(true)}},{key:"hsla",get:function t(){if(this._hsla){return this._hsla}if(!this._rgba){throw new Error("No color is set")}return this._hsla=e.rgbToHsl(this._rgba)},set:function e(t){if(t.length===3){t[3]=1}this._hsla=t;this._rgba=null}},{key:"hslString",get:function e(){return this.printHSL()}},{key:"hslaString",get:function e(){return this.printHSL(true)}},{key:"hex",get:function e(){var t=this.rgba,i=t.map((function(e,t){return t<3?e.toString(16):Math.round(e*255).toString(16)}));return"#"+i.map((function(e){return e.padStart(2,"0")})).join("")},set:function t(i){this.rgba=e.hexToRgb(i)}}],[{key:"hexToRgb",value:function e(t){var i=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!i.match(/^([0-9a-fA-F]{8})$/)){throw new Error("Unknown hex color; "+t)}var n=i.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));n[3]=n[3]/255;return n}},{key:"nameToRgb",value:function t(i){var n=i.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),a=colorNames[n];return a===undefined?a:e.hexToRgb(a.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function e(t){var i=slicedToArray(t,4),n=i[0],a=i[1],r=i[2],o=i[3];n/=255;a/=255;r/=255;var s=Math.max(n,a,r),l=Math.min(n,a,r);var c=void 0,u=void 0,d=(s+l)/2;if(s===l){c=u=0}else{var p=s-l;u=d>.5?p/(2-s-l):p/(s+l);switch(s){case n:c=(a-r)/p+(a<r?6:0);break;case a:c=(r-n)/p+2;break;case r:c=(n-a)/p+4;break}c/=6}return[c,u,d,o]}},{key:"hslToRgb",value:function e(t){var i=slicedToArray(t,4),n=i[0],a=i[1],r=i[2],o=i[3];var s=void 0,l=void 0,c=void 0;if(a===0){s=l=c=r}else{var u=function e(t,i,n){if(n<0)n+=1;if(n>1)n-=1;if(n<1/6)return t+(i-t)*6*n;if(n<1/2)return i;if(n<2/3)return t+(i-t)*(2/3-n)*6;return t};var d=r<.5?r*(1+a):r+a-r*a,p=2*r-d;s=u(p,d,n+1/3);l=u(p,d,n);c=u(p,d,n-1/3)}var h=[s*255,l*255,c*255].map(Math.round);h[3]=o;return h}}]);return e}();var EventBucket=function(){function e(){classCallCheck(this,e);this._events=[]}createClass(e,[{key:"add",value:function e(t,i,n){t.addEventListener(i,n,false);this._events.push({target:t,type:i,handler:n})}},{key:"remove",value:function t(i,n,a){this._events=this._events.filter((function(t){var r=true;if(i&&i!==t.target){r=false}if(n&&n!==t.type){r=false}if(a&&a!==t.handler){r=false}if(r){e._doRemove(t.target,t.type,t.handler)}return!r}))}},{key:"destroy",value:function t(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)}));this._events=[]}}],[{key:"_doRemove",value:function e(t,i,n){t.removeEventListener(i,n,false)}}]);return e}();function parseHTML(e){var t=document.createElement("div");t.innerHTML=e;return t.firstElementChild}function dragTrack(e,t,i){var n=false;function a(e,t,i){return Math.max(t,Math.min(e,i))}function r(e,r,o){if(o){n=true}if(!n){return}e.preventDefault();var s=t.getBoundingClientRect(),l=s.width,c=s.height,u=r.clientX,d=r.clientY;var p=a(u-s.left,0,l),h=a(d-s.top,0,c);i(p/l,h/c)}function o(e,t){var i=e.buttons===undefined?e.which:e.buttons;if(i===1){r(e,e,t)}else{n=false}}function s(e,t){if(e.touches.length===1){r(e,e.touches[0],t)}else{n=false}}e.add(t,"mousedown",(function(e){o(e,true)}));e.add(t,"touchstart",(function(e){s(e,true)}));e.add(window,"mousemove",o);e.add(t,"touchmove",s);e.add(window,"mouseup",(function(e){n=false}));e.add(t,"touchend",(function(e){n=false}));e.add(t,"touchcancel",(function(e){n=false}))}var BG_TRANSP="linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em";var HUES=360;var EVENT_KEY="keydown",EVENT_CLICK_OUTSIDE="mousedown",EVENT_TAB_MOVE="focusin";function $$1(e,t){return(t||document).querySelector(e)}function stopEvent(e){e.preventDefault();e.stopPropagation()}function onKey(e,t,i,n,a){e.add(t,EVENT_KEY,(function(e){if(i.indexOf(e.key)>=0){if(a){stopEvent(e)}n(e)}}))}var Picker=function(){function e(t){classCallCheck(this,e);this.settings={popup:"right",layout:"default",alpha:true,editor:true,editorFormat:"hex",cancelButton:false,defaultColor:"#0cf"};this._events=new EventBucket;this.onChange=null;this.onDone=null;this.onOpen=null;this.onClose=null;this.setOptions(t)}createClass(e,[{key:"setOptions",value:function e(t){var i=this;if(!t){return}var n=this.settings;function a(e,t,i){for(var n in e){if(i&&i.indexOf(n)>=0){continue}t[n]=e[n]}}if(t instanceof HTMLElement){n.parent=t}else{if(n.parent&&t.parent&&n.parent!==t.parent){this._events.remove(n.parent);this._popupInited=false}a(t,n);if(t.onChange){this.onChange=t.onChange}if(t.onDone){this.onDone=t.onDone}if(t.onOpen){this.onOpen=t.onOpen}if(t.onClose){this.onClose=t.onClose}var r=t.color||t.colour;if(r){this._setColor(r)}}var o=n.parent;if(o&&n.popup&&!this._popupInited){var s=function e(t){return i.openHandler(t)};this._events.add(o,"click",s);onKey(this._events,o,[" ","Spacebar","Enter"],s);this._popupInited=true}else if(t.parent&&!n.popup){this.show()}}},{key:"openHandler",value:function e(t){if(this.show()){t&&t.preventDefault();this.settings.parent.style.pointerEvents="none";var i=t&&t.type===EVENT_KEY?this._domEdit:this.domElement;setTimeout((function(){return i.focus()}),100);if(this.onOpen){this.onOpen(this.colour)}}}},{key:"closeHandler",value:function e(t){var i=t&&t.type;var n=false;if(!t){n=true}else if(i===EVENT_CLICK_OUTSIDE||i===EVENT_TAB_MOVE){var a=(this.__containedEvent||0)+100;if(t.timeStamp>a){n=true}}else{stopEvent(t);n=true}if(n&&this.hide()){this.settings.parent.style.pointerEvents="";if(i!==EVENT_CLICK_OUTSIDE){this.settings.parent.focus()}if(this.onClose){this.onClose(this.colour)}}}},{key:"movePopup",value:function e(t,i){this.closeHandler();this.setOptions(t);if(i){this.openHandler()}}},{key:"setColor",value:function e(t,i){this._setColor(t,{silent:i})}},{key:"_setColor",value:function e(t,i){if(typeof t==="string"){t=t.trim()}if(!t){return}i=i||{};var n=void 0;try{n=new Color(t)}catch(e){if(i.failSilently){return}throw e}if(!this.settings.alpha){var a=n.hsla;a[3]=1;n.hsla=a}this.colour=this.color=n;this._setHSLA(null,null,null,null,i)}},{key:"setColour",value:function e(t,i){this.setColor(t,i)}},{key:"show",value:function e(){var t=this.settings.parent;if(!t){return false}if(this.domElement){var i=this._toggleDOM(true);this._setPosition();return i}var n=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>';var a=parseHTML(n);this.domElement=a;this._domH=$$1(".picker_hue",a);this._domSL=$$1(".picker_sl",a);this._domA=$$1(".picker_alpha",a);this._domEdit=$$1(".picker_editor input",a);this._domSample=$$1(".picker_sample",a);this._domOkay=$$1(".picker_done button",a);this._domCancel=$$1(".picker_cancel button",a);a.classList.add("layout_"+this.settings.layout);if(!this.settings.alpha){a.classList.add("no_alpha")}if(!this.settings.editor){a.classList.add("no_editor")}if(!this.settings.cancelButton){a.classList.add("no_cancel")}this._ifPopup((function(){return a.classList.add("popup")}));this._setPosition();if(this.colour){this._updateUI()}else{this._setColor(this.settings.defaultColor)}this._bindEvents();return true}},{key:"hide",value:function e(){return this._toggleDOM(false)}},{key:"destroy",value:function e(){this._events.destroy();if(this.domElement){this.settings.parent.removeChild(this.domElement)}}},{key:"_bindEvents",value:function e(){var t=this;var i=this,n=this.domElement,a=this._events;function r(e,t,i){a.add(e,t,i)}r(n,"click",(function(e){return e.preventDefault()}));dragTrack(a,this._domH,(function(e,t){return i._setHSLA(e)}));dragTrack(a,this._domSL,(function(e,t){return i._setHSLA(null,e,1-t)}));if(this.settings.alpha){dragTrack(a,this._domA,(function(e,t){return i._setHSLA(null,null,null,1-t)}))}var o=this._domEdit;{r(o,"input",(function(e){i._setColor(this.value,{fromEditor:true,failSilently:true})}));r(o,"focus",(function(e){var t=this;if(t.selectionStart===t.selectionEnd){t.select()}}))}this._ifPopup((function(){var e=function e(i){return t.closeHandler(i)};r(window,EVENT_CLICK_OUTSIDE,e);r(window,EVENT_TAB_MOVE,e);onKey(a,n,["Esc","Escape"],e);var i=function e(i){t.__containedEvent=i.timeStamp};r(n,EVENT_CLICK_OUTSIDE,i);r(n,EVENT_TAB_MOVE,i);r(t._domCancel,"click",e)}));var s=function e(i){t._ifPopup((function(){return t.closeHandler(i)}));if(t.onDone){t.onDone(t.colour)}};r(this._domOkay,"click",s);onKey(a,n,["Enter"],s)}},{key:"_setPosition",value:function e(){var t=this.settings.parent,i=this.domElement;if(t!==i.parentNode){t.appendChild(i)}this._ifPopup((function(e){if(getComputedStyle(t).position==="static"){t.style.position="relative"}var n=e===true?"popup_right":"popup_"+e;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){if(e===n){i.classList.add(e)}else{i.classList.remove(e)}}));i.classList.add(n)}))}},{key:"_setHSLA",value:function e(t,i,n,a,r){r=r||{};var o=this.colour,s=o.hsla;[t,i,n,a].forEach((function(e,t){if(e||e===0){s[t]=e}}));o.hsla=s;this._updateUI(r);if(this.onChange&&!r.silent){this.onChange(o)}}},{key:"_updateUI",value:function e(t){if(!this.domElement){return}t=t||{};var i=this.colour,n=i.hsla,a="hsl("+n[0]*HUES+", 100%, 50%)",r=i.hslString,o=i.hslaString;var s=this._domH,l=this._domSL,c=this._domA,u=$$1(".picker_selector",s),d=$$1(".picker_selector",l),p=$$1(".picker_selector",c);function h(e,t,i){t.style.left=i*100+"%"}function f(e,t,i){t.style.top=i*100+"%"}h(s,u,n[0]);this._domSL.style.backgroundColor=this._domH.style.color=a;h(l,d,n[1]);f(l,d,1-n[2]);l.style.color=r;f(c,p,1-n[3]);var g=r,m=g.replace("hsl","hsla").replace(")",", 0)"),v="linear-gradient("+[g,m]+")";this._domA.style.background=v+", "+BG_TRANSP;if(!t.fromEditor){var _=this.settings.editorFormat,b=this.settings.alpha;var y=void 0;switch(_){case"rgb":y=i.printRGB(b);break;case"hsl":y=i.printHSL(b);break;default:y=i.printHex(b)}this._domEdit.value=y}this._domSample.style.color=o}},{key:"_ifPopup",value:function e(t,i){if(this.settings.parent&&this.settings.popup){t&&t(this.settings.popup)}else{i&&i()}}},{key:"_toggleDOM",value:function e(t){var i=this.domElement;if(!i){return false}var n=t?"":"none",a=i.style.display!==n;if(a){i.style.display=n}return a}}]);return e}();{var style=document.createElement("style");style.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}';document.documentElement.firstElementChild.appendChild(style);Picker.StyleElement=style}var ArrowDown='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_down</title>\n<path d="M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z"></path>\n</svg>\n';var sallaColorPickerCss="";var SallaColorPicker=function(){function e(e){registerInstance(this,e);this.colorChanged=createEvent(this,"colorChanged",7);this.invalidInput=createEvent(this,"invalidInput",7);this.submitted=createEvent(this,"submitted",7);this.popupOpened=createEvent(this,"popupOpened",7);this.popupClosed=createEvent(this,"popupClosed",7);this.widgetColor=undefined;this.name="color";this.required=false;this.color=undefined;this.format="hex";this.showCancelButton=false;this.showTextField=true;this.enableAlpha=false}e.prototype.colorChangeHandler=function(e){this.colorInput.value=e.hex;this.colorChanged.emit(e)};e.prototype.submittedHandler=function(e){this.setColorValue(e.rgbaString,true);this.canvas.style.backgroundColor=e.rgbString;this.colorInput.value=e.hex;this.colorInput.dispatchEvent(new window.Event("change",{bubbles:true}));this.submitted.emit(e)};e.prototype.popupOpenedHandler=function(e){this.setPopInPosition();this.popupOpened.emit(e)};e.prototype.popupClosedHandler=function(e){this.popupClosed.emit(e)};e.prototype.setPickerOption=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.picker.setOptions(e);return[2]}))}))};e.prototype.movePopUp=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.picker.movePopup(e,t);return[2]}))}))};e.prototype.setColorValue=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.picker.setColor(e,t);return[2]}))}))};e.prototype.openPicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.show();return[2]}))}))};e.prototype.closePicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.hide();return[2]}))}))};e.prototype.destroyPicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.destroy();return[2]}))}))};e.prototype.componentWillLoad=function(){var e=this;salla.onReady((function(){e.color=e.color?e.color:salla.config.get("theme.color.primary","#5dd5c4")}))};e.prototype.setPopInPosition=function(){var e=this.host.querySelector(".picker_wrapper");var t=this.host.querySelector(".s-color-picker-widget").getBoundingClientRect();var i=window.innerWidth/2-t.width/2;var n=i>t.x;var a=i<t.x;var r=i===t.x;var o=window.innerWidth<768;if(o&&n){e.style.left="0"}if(o&&a){e.style.left="auto"}if(!o||o&&(!a&&!n||r)){e.style.left="-95px"}};e.prototype.initColorPicker=function(){var e=this;this.picker=new Picker({parent:this.host,color:this.color,popup:"bottom",alpha:this.enableAlpha,editor:this.showTextField,editorFormat:this.format,cancelButton:this.showCancelButton,onChange:function(t){return e.colorChangeHandler(t)},onDone:function(t){return e.submittedHandler(t)},onOpen:function(t){return e.popupOpenedHandler(t)},onClose:function(t){return e.popupClosedHandler(t)}})};e.prototype.render=function(){var e=this;return h(Host,{class:"s-color-picker-main"},h("slot",{name:"widget"},h("div",{class:"s-color-picker-widget"},h("div",{class:"s-color-picker-widget-canvas",ref:function(t){return e.canvas=t}}),h("span",{innerHTML:ArrowDown}))),h("input",{class:"s-hidden",name:this.name,required:this.required,value:this.color,ref:function(t){return e.colorInput=t}}))};e.prototype.componentDidLoad=function(){var e=this;this.canvas.style.backgroundColor=this.color;this.initColorPicker();this.colorInput.addEventListener("invalid",(function(t){e.invalidInput.emit(t)}));this.colorInput.addEventListener("input",(function(){e.colorInput.setCustomValidity("");e.colorInput.reportValidity()}))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaColorPicker.style=sallaColorPickerCss;var sallaCommentFormCss=":host{display:block}";var SallaCommentForm=function(){function e(e){var t=this;registerInstance(this,e);this.type=undefined;this.showAvatar=undefined;this.itemId=undefined;this.placeholder=salla.lang.get("blocks.comments.placeholder");this.submitText=salla.lang.get("blocks.comments.submit");this.canComment=undefined;salla.lang.onLoaded((function(){t.placeholder=salla.lang.get("blocks.comments.placeholder");t.submitText=salla.lang.get("blocks.comments.submit")}));salla.onReady((function(){t.canComment=salla.config.get("user.can_comment");t.itemId=salla.config.get("page.id");t.type=salla.url.is_page("page-single")?"page":"product"}))}e.prototype.submit=function(){var e=this;if(!this.commentForm.reportValidity()){salla.log("CommentForm:: validation error!");return}this.submitBtn.load().then((function(){return salla.comment.add({id:e.itemId,comment:e.commentField.value,type:e.type})})).finally((function(){return e.submitBtn.stop}))};e.prototype.render=function(){var e=this;return h(Host,null,!!this.canComment?h("form",{ref:function(t){return e.commentForm=t}},h("div",{class:"s-comment-form-wrapper"},this.showAvatar?h("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",h("div",{class:"s-comment-form-content"},h("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:function(t){return e.commentField=t},placeholder:this.placeholder,class:"s-comment-form-input",required:true}),h("br",null),h("div",{class:"s-comment-form-action"},h("salla-button",{ref:function(t){return e.submitBtn=t},"loader-position":"center",onClick:function(){return e.submit()}},this.submitText))))):"")};return e}();SallaCommentForm.style=sallaCommentFormCss;var Reply='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>reply</title>\n<path d="M20 14.667h-12.609l9.401-6.927c0.592-0.436 0.72-1.271 0.283-1.863-0.439-0.595-1.273-0.72-1.864-0.283l-12.667 9.333c-0.343 0.251-0.544 0.649-0.544 1.072s0.201 0.821 0.543 1.073l12.667 9.333c0.237 0.176 0.515 0.26 0.789 0.26 0.409 0 0.813-0.188 1.075-0.543 0.437-0.592 0.309-1.427-0.283-1.863l-9.4-6.928h12.609c4.412 0 8 3.588 8 8 0 0.737 0.597 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-5.881-4.785-10.667-10.667-10.667z"></path>\n</svg>\n';var sallaCommentsCss$1=":host{display:block}";var SallaCommentItem=function(){function e(e){var t=this;registerInstance(this,e);this.comment=undefined;this.has_bought_trans=salla.lang.get("blocks.comments.has_bought");this.rated_trans=salla.lang.get("pages.rating.rated");this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval");this.has_order_trans=salla.lang.get("blocks.comments.has_order");salla.lang.onLoaded((function(){t.has_bought_trans=salla.lang.get("blocks.comments.has_bought");t.rated_trans=salla.lang.get("pages.rating.rated");t.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval");t.has_order_trans=salla.lang.get("blocks.comments.has_order")}))}e.prototype.getReplies=function(){return Array.isArray(this.comment.replies)?this.comment.replies:[this.comment.replies]};e.prototype.getDate=function(e){var t=e.split(" ")[0];var i=t.split("-"),n=i[0],a=i[1],r=i[2];var o="".concat(parseInt(a,10),"/").concat(parseInt(r,10),"/").concat(parseInt(n,10));return o};e.prototype.getTime=function(e){var t=e.split(" "),i=t[1];var n=i.split(":"),a=n[0],r=n[1];var o="".concat(parseInt(a,10),":").concat(parseInt(r,10));return o};e.prototype.render=function(){var e,t,i,n,a,r;var o=this.comment.type=="admin";return h(Host,{class:o?"s-comments-item-admin":"s-comments-item"},h("div",{class:{"s-comments-item-wrapper":!o,"s-comments-item-admin-wrapper":o},id:"s-comments-item-".concat(this.comment.id)},h("div",{class:"s-comments-item-inner s-comments-flex-1"},o&&h("span",{class:"s-comments-item-reply-icon",innerHTML:Reply}),h("div",{class:"s-comments-item-avatar"},h("img",{"data-src":(e=this.comment)===null||e===void 0?void 0:e.avatar,alt:(t=this.comment)===null||t===void 0?void 0:t.name,src:(i=this.comment)===null||i===void 0?void 0:i.avatar,class:"s-comments-item-avatar-img lazy"})),h("div",{class:"s-comments-flex-1"},h("div",{class:"s-comments-item-user-wrapper"},h("div",{class:"s-comments-item-user-info"},h("h3",{class:"s-comments-item-user-info-name"},(n=this.comment)===null||n===void 0?void 0:n.name),(this.comment.has_order||!!this.comment.rating)&&!this.comment.is_pending?h("div",{class:"s-comments-flex"},this.comment.has_order?[h("span",{class:"s-comments-item-has-order-check-icon",innerHTML:CheckCircleIcon}),h("span",{class:"s-comments-item-has-order-check-text"},this.has_bought_trans," ",this.comment.rating?", ":"")]:null,!!this.comment.rating?h("span",{class:"s-comments-item-rated-widget"},this.rated_trans):null):null),h("p",{class:"s-comments-item-timestamp s-ltr"}," ",this.getDate((a=this.comment.created_at)===null||a===void 0?void 0:a.date)," ",h("span",{class:"s-comments-item-time"}," - ",this.getTime((r=this.comment.created_at)===null||r===void 0?void 0:r.date)," ")),!!this.comment.rating?h("salla-rating-stars",{size:"mini",class:"s-comments-item-stars",value:this.comment.rating}):null),h("div",{class:"s-comments-item-content"},h("p",null,this.comment.content),this.comment.is_pending?h("span",{class:"s-comments-item-pending-text"},this.waiting_approval_trans):null))),!!this.getReplies().length&&!o?this.getReplies().map((function(e){return h("div",null,h("salla-comment-item",{comment:e}))})):null))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaCommentItem.style=sallaCommentsCss$1;var CommentType;(function(e){e["PAGE"]="page";e["PRODUCT"]="product"})(CommentType||(CommentType={}));var sallaCommentsCss=":host{display:block}";var SallaComments=function(){function e(e){var t=this;registerInstance(this,e);this.itemId=undefined;this.loadMoreText=undefined;this.hideForm=undefined;this.blockTitle=undefined;this.hideTitle=undefined;this.type=CommentType.PAGE;this.showFormAvatar=false;this.comments=undefined;this.pagination=undefined;this.total=undefined;this.showPlaceholder=undefined;this.nextPage=undefined;this.noComments=salla.lang.get("blocks.comments.no_comments");this.comment_title=salla.lang.get("blocks.comments.title");this.comment_name=salla.lang.get("blocks.comments.comment");this.placeholder_text=undefined;salla.lang.onLoaded((function(){t.comment_title=salla.lang.get("blocks.comments.title");t.comment_name=salla.lang.get("blocks.comments.comment");t.noComments=salla.lang.get("pages.rating.no_ratings")}))}e.prototype.pluralize=function(e,t){var i=e.split("|");var n=[{condition:t===0,index:0},{condition:t===1,index:1},{condition:t===2,index:2},{condition:t>2&&t<=10,index:3},{condition:t>=11,index:4}];var a=(n.find((function(e){var t=e.condition;return t}))||{index:i.length-1}).index;var r=i[a];return r.replace(":count",salla.helpers.number(t.toString())).replace(/\{[0-9]+\}/g,"").replace(/\[\d+,\d+\]|\[11,\*\]/g,"")};e.prototype.initiateInfiniteScroll=function(){var e=this;var t,i,n;if(!this.wrapper){console.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){return e.nextPage},history:true,nextPage:this.nextPage,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(function(t){e.loading()}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("load",(function(t){e.pagination=t.pagination;e.nextPage=typeof t.pagination.links=="object"&&!!t.pagination.links.next?t.pagination.links.next:null;e.handleResponse(t).forEach((function(t){return e.wrapper.append(t)}));var i=e.host.querySelectorAll("salla-comment-item:not(.animated):not(.s-comments-item-admin)");e.animateItems(i);e.loading(false)}));(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("error",(function(e){salla.console.error("Error loading more comments:",e)}))};e.prototype.loading=function(e){if(e===void 0){e=true}var t;var i=(t=this.status)===null||t===void 0?void 0:t.querySelector(".s-button-text");if(i){Helper.toggleElementClassIf(i,"s-button-hide","s-button-show",(function(){return e}));this.btnLoader.style.display=e?"inherit":"none"}};e.prototype.animateItems=function(e){anime({targets:e,opacity:[0,1],duration:1200,translateY:[20,0],delay:function(e,t){return t*100},easing:"easeOutExpo",complete:function(t){e.forEach((function(e){e.classList.add("animated")}))}})};e.prototype.getCommentHTML=function(e){var t=document.createElement("salla-comment-item");t.comment=e;return t};e.prototype.handleResponse=function(e){var t=this;var i;return((i=e.data)===null||i===void 0?void 0:i.map((function(e){return t.getCommentHTML(e)})))||[]};e.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;var i=this;return __generator(this,(function(n){switch(n.label){case 0:this.loading();n.label=1;case 1:n.trys.push([1,3,,4]);return[4,this.type==CommentType.PAGE?salla.api.comment.getPageComments(this.itemId):salla.api.comment.getProductComments(this.itemId)];case 2:e=n.sent();if(!e.data||!e.data.length){this.showPlaceholder=false;this.loading(false);return[2]}this.comments=e.data;this.pagination=e.pagination;this.total=e.pagination.total;this.nextPage=typeof e.pagination.links=="object"&&!!e.pagination.links.next?e.pagination.links.next:null;setTimeout((function(){i.handleResponse(e).forEach((function(e){return i.wrapper.append(e)}));i.initiateInfiniteScroll();var t=i.wrapper.querySelectorAll("salla-comment-item:not(.animated)");i.animateItems(t)}),100);return[3,4];case 3:t=n.sent();console.error("Error loading initial data:",t);this.showPlaceholder=true;this.loading(false);return[3,4];case 4:return[2]}}))}))};e.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){(e=this.infiniteScroll)===null||e===void 0?void 0:e.loadNextPage();return[2]}))}))};e.prototype.render=function(){var e=this;if(this.showPlaceholder){return h("div",null,!!this.total&&!this.hideTitle?h("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&h("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),h("div",{class:"no-content-placeholder--comments"},h("i",{class:"sicon-chat-bubbles text-5xl block mb-5 text-gray-400"}),h("p",{class:"text-sm"},this.noComments)))}return h("div",{class:"s-comments s-comments-".concat(this.type)},h("div",{class:"".concat(this.type==CommentType.PAGE?"s-comments-page-container":"s-comments-container")},!!this.total&&!this.hideTitle?h("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&h("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),!!this.total&&h("h2",{class:"s-comments-count-label",innerHTML:this.pluralize(this.comment_name,this.total)}),h("div",{ref:function(t){return e.wrapper=t}}),this.nextPage&&h("div",{class:"s-infinite-scroll-wrapper",ref:function(t){return e.status=t}},h("button",{onClick:function(){return e.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary"},h("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),h("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(t){return e.btnLoader=t},style:{display:"none"}})))))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.loadInitialData()];case 1:e.sent();return[2]}}))}))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaComments.style=sallaCommentsCss;var sallaCountDownCss="";var SallaCountDown=function(){function e(e){var t=this;registerInstance(this,e);this.date=undefined;this.boxed=undefined;this.size="md";this.color="dark";this.labeled=undefined;this.endText=undefined;this.digits="auto";this.endOfDay=undefined;this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم");this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة");this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة");this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية");this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض");this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح");this.offerEnded=false;this.countInterval=undefined;this.days=undefined;this.hours=undefined;this.minutes=undefined;this.seconds=undefined;this.days=this.number(0);this.hours=this.number(0);this.minutes=this.number(0);this.seconds=this.number(0);salla.lang.onLoaded((function(){t.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم");t.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة");t.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة");t.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح");t.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية");t.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")}));if(this.date&&this.isValidDate(this.date)){this.startCountDown()}}e.prototype.endCountDown=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){clearInterval(this.countInterval);this.offerEnded=true;this.days=this.number(0);this.hours=this.number(0);this.minutes=this.number(0);this.seconds=this.number(0);return[2]}))}))};e.prototype.isValidDate=function(e){var t=e.includes("-"),i=e.split(" "),n;if(t){n=i[0].replace(/-/g,"/")}else{n=i[0]}return!isNaN(Date.parse(n))};e.prototype.number=function(e){return salla.helpers.number(e,this.digits==="en")};e.prototype.startCountDown=function(){var e=this;var t=new Date(this.date.replace(/-/g,"/"));if(this.endOfDay||this.date.split(" ").length===1){t.setHours(23,59,59,999)}var i=t.getTime();this.countInterval=setInterval((function(){var t=(new Date).getTime();var n=i-t;e.days=e.number(Math.floor(n/(1e3*60*60*24)));e.hours=e.number(Math.floor(n%(1e3*60*60*24)/(1e3*60*60)));e.minutes=e.number(Math.floor(n%(1e3*60*60)/(1e3*60)));e.seconds=e.number(Math.floor(n%(1e3*60)/1e3));if(n<0){e.endCountDown()}}),1e3)};e.prototype.render=function(){if(!this.date){return""}else if(this.date&&!this.isValidDate(this.date)){return h("div",{class:"s-count-down-text-center"},this.invalidDate)}return h(Host,{class:"s-count-down-wrapper"},h("ul",{class:"s-count-down-list ".concat(this.boxed?"s-count-down-boxed":""," ").concat(this.offerEnded?"s-count-down-ended":""," s-count-down-").concat(this.size," s-count-down-").concat(this.color)},h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&h("div",{class:"s-count-down-item-label"},this.secondsLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&h("div",{class:"s-count-down-item-label"},this.minutesLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&h("div",{class:"s-count-down-item-label"},this.hoursLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.days),this.labeled&&h("div",{class:"s-count-down-item-label"},this.daysLabel))),this.offerEnded&&h("div",{class:"s-count-down-end-text"},!!this.endText?this.endText:this.endLabel))};return e}();SallaCountDown.style=sallaCountDownCss;var HOOKS=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"];var defaults$1={_disable:[],allowInput:false,allowInvalidPreload:false,altFormat:"F j, Y",altInput:false,altInputClass:"form-control input",animate:typeof window==="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:true,clickOpens:true,closeOnSelect:true,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:false,enableSeconds:false,enableTime:false,errorHandler:function(e){return typeof console!=="undefined"&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0);t.setDate(t.getDate()+3-(t.getDay()+6)%7);var i=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:false,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:false,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:undefined,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:false,showMonths:1,static:false,time_24hr:false,weekNumbers:false,wrap:false};var english={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:false};var pad=function(e,t){if(t===void 0){t=2}return("000"+e).slice(t*-1)};var int=function(e){return e===true?1:0};function debounce(e,t){var i;return function(){var n=this;var a=arguments;clearTimeout(i);i=setTimeout((function(){return e.apply(n,a)}),t)}}var arrayify=function(e){return e instanceof Array?e:[e]};function toggleClass(e,t,i){if(i===true)return e.classList.add(t);e.classList.remove(t)}function createElement(e,t,i){var n=window.document.createElement(e);t=t||"";i=i||"";n.className=t;if(i!==undefined)n.textContent=i;return n}function clearNode(e){while(e.firstChild)e.removeChild(e.firstChild)}function findParent(e,t){if(t(e))return e;else if(e.parentNode)return findParent(e.parentNode,t);return undefined}function createNumberInput(e,t){var i=createElement("div","numInputWrapper"),n=createElement("input","numInput "+e),a=createElement("span","arrowUp"),r=createElement("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1){n.type="number"}else{n.type="text";n.pattern="\\d*"}if(t!==undefined)for(var o in t)n.setAttribute(o,t[o]);i.appendChild(n);i.appendChild(a);i.appendChild(r);return i}function getEventTarget(e){try{if(typeof e.composedPath==="function"){var t=e.composedPath();return t[0]}return e.target}catch(t){return e.target}}var doNothing=function(){return undefined};var monthToStr=function(e,t,i){return i.months[t?"shorthand":"longhand"][e]};var revFormat={D:doNothing,F:function(e,t,i){e.setMonth(i.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,i){e.setHours(e.getHours()%12+12*int(new RegExp(i.amPM[1],"i").test(t)))},M:function(e,t,i){e.setMonth(i.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(parseFloat(t)*1e3)},W:function(e,t,i){var n=parseInt(t);var a=new Date(e.getFullYear(),0,2+(n-1)*7,0,0,0,0);a.setDate(a.getDate()-a.getDay()+i.firstDayOfWeek);return a},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:doNothing,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:doNothing,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}};var tokenRegex={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"};var formats={Z:function(e){return e.toISOString()},D:function(e,t,i){return t.weekdays.shorthand[formats.w(e,t,i)]},F:function(e,t,i){return monthToStr(formats.n(e,t,i)-1,false,t)},G:function(e,t,i){return pad(formats.h(e,t,i))},H:function(e){return pad(e.getHours())},J:function(e,t){return t.ordinal!==undefined?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[int(e.getHours()>11)]},M:function(e,t){return monthToStr(e.getMonth(),true,t)},S:function(e){return pad(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,i){return i.getWeek(e)},Y:function(e){return pad(e.getFullYear(),4)},d:function(e){return pad(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return pad(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return pad(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}};var createDateFormatter=function(e){var t=e.config,i=t===void 0?defaults$1:t,n=e.l10n,a=n===void 0?english:n,r=e.isMobile,o=r===void 0?false:r;return function(e,t,n){var r=n||a;if(i.formatDate!==undefined&&!o){return i.formatDate(e,t,r)}return t.split("").map((function(t,n,a){return formats[t]&&a[n-1]!=="\\"?formats[t](e,r,i):t!=="\\"?t:""})).join("")}};var createDateParser=function(e){var t=e.config,i=t===void 0?defaults$1:t,n=e.l10n,a=n===void 0?english:n;return function(e,t,n,r){if(e!==0&&!e)return undefined;var o=r||a;var s;var l=e;if(e instanceof Date)s=new Date(e.getTime());else if(typeof e!=="string"&&e.toFixed!==undefined)s=new Date(e);else if(typeof e==="string"){var c=t||(i||defaults$1).dateFormat;var u=String(e).trim();if(u==="today"){s=new Date;n=true}else if(i&&i.parseDate){s=i.parseDate(e,c)}else if(/Z$/.test(u)||/GMT$/.test(u)){s=new Date(e)}else{var d=void 0,p=[];for(var h=0,f=0,g="";h<c.length;h++){var m=c[h];var v=m==="\\";var _=c[h-1]==="\\"||v;if(tokenRegex[m]&&!_){g+=tokenRegex[m];var b=new RegExp(g).exec(e);if(b&&(d=true)){p[m!=="Y"?"push":"unshift"]({fn:revFormat[m],val:b[++f]})}}else if(!v)g+="."}s=!i||!i.noCalendar?new Date((new Date).getFullYear(),0,1,0,0,0,0):new Date((new Date).setHours(0,0,0,0));p.forEach((function(e){var t=e.fn,i=e.val;return s=t(s,i,o)||s}));s=d?s:undefined}}if(!(s instanceof Date&&!isNaN(s.getTime()))){i.errorHandler(new Error("Invalid date provided: "+l));return undefined}if(n===true)s.setHours(0,0,0,0);return s}};function compareDates(e,t,i){if(i===void 0){i=true}if(i!==false){return new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0)}return e.getTime()-t.getTime()}var isBetween=function(e,t,i){return e>Math.min(t,i)&&e<Math.max(t,i)};var calculateSecondsSinceMidnight=function(e,t,i){return e*3600+t*60+i};var parseSeconds=function(e){var t=Math.floor(e/3600),i=(e-t*3600)/60;return[t,i,e-t*3600-i*60]};var duration={DAY:864e5};function getDefaultHours(e){var t=e.defaultHour;var i=e.defaultMinute;var n=e.defaultSeconds;if(e.minDate!==undefined){var a=e.minDate.getHours();var r=e.minDate.getMinutes();var o=e.minDate.getSeconds();if(t<a){t=a}if(t===a&&i<r){i=r}if(t===a&&i===r&&n<o)n=e.minDate.getSeconds()}if(e.maxDate!==undefined){var s=e.maxDate.getHours();var l=e.maxDate.getMinutes();t=Math.min(t,s);if(t===s)i=Math.min(l,i);if(t===s&&i===l)n=e.maxDate.getSeconds()}return{hours:t,minutes:i,seconds:n}}if(typeof Object.assign!=="function"){Object.assign=function(e){var t=[];for(var i=1;i<arguments.length;i++){t[i-1]=arguments[i]}if(!e){throw TypeError("Cannot convert undefined or null to object")}var n=function(t){if(t){Object.keys(t).forEach((function(i){return e[i]=t[i]}))}};for(var a=0,r=t;a<r.length;a++){var o=r[a];n(o)}return e}}var __assign=undefined&&undefined.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};var __spreadArrays=undefined&&undefined.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<i;t++)for(var r=arguments[t],o=0,s=r.length;o<s;o++,a++)n[a]=r[o];return n};var DEBOUNCED_CHANGE_MS=300;function FlatpickrInstance(e,t){var i={config:__assign(__assign({},defaults$1),flatpickr.defaultConfig),l10n:english};i.parseDate=createDateParser({config:i.config,l10n:i.l10n});i._handlers=[];i.pluginElements=[];i.loadedPlugins=[];i._bind=g;i._setHoursFromDate=p;i._positionCalendar=te;i.changeMonth=F;i.changeYear=H;i.clear=G;i.close=z;i.onMouseOver=X;i._createElement=createElement;i.createDay=x;i.destroy=B;i.isEnabled=V;i.jumpToDate=_;i.updateValue=Ee;i.open=Z;i.redraw=ae;i.set=le;i.setDate=ue;i.toggle=me;function n(){i.utils={getDaysInMonth:function(e,t){if(e===void 0){e=i.currentMonth}if(t===void 0){t=i.currentYear}if(e===1&&(t%4===0&&t%100!==0||t%400===0))return 29;return i.l10n.daysInMonth[e]}}}function a(){i.element=i.input=e;i.isOpen=false;$();ee();he();pe();n();if(!i.isMobile)w();v();if(i.selectedDates.length||i.config.noCalendar){if(i.config.enableTime){p(i.config.noCalendar?i.latestSelectedDateObj:undefined)}Ee(false)}s();var t=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);if(!i.isMobile&&t){te()}ve("onReady")}function r(){var e;return((e=i.calendarContainer)===null||e===void 0?void 0:e.getRootNode()).activeElement||document.activeElement}function o(e){return e.bind(i)}function s(){var e=i.config;if(e.weekNumbers===false&&e.showMonths===1){return}else if(e.noCalendar!==true){window.requestAnimationFrame((function(){if(i.calendarContainer!==undefined){i.calendarContainer.style.visibility="hidden";i.calendarContainer.style.display="block"}if(i.daysContainer!==undefined){var t=(i.days.offsetWidth+1)*e.showMonths;i.daysContainer.style.width=t+"px";i.calendarContainer.style.width=t+(i.weekWrapper!==undefined?i.weekWrapper.offsetWidth:0)+"px";i.calendarContainer.style.removeProperty("visibility");i.calendarContainer.style.removeProperty("display")}}))}}function l(e){if(i.selectedDates.length===0){var t=i.config.minDate===undefined||compareDates(new Date,i.config.minDate)>=0?new Date:new Date(i.config.minDate.getTime());var n=getDefaultHours(i.config);t.setHours(n.hours,n.minutes,n.seconds,t.getMilliseconds());i.selectedDates=[t];i.latestSelectedDateObj=t}if(e!==undefined&&e.type!=="blur"){Ie(e)}var a=i._input.value;d();Ee();if(i._input.value!==a){i._debouncedChange()}}function c(e,t){return e%12+12*int(t===i.l10n.amPM[1])}function u(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}function d(){if(i.hourElement===undefined||i.minuteElement===undefined)return;var e=(parseInt(i.hourElement.value.slice(-2),10)||0)%24,t=(parseInt(i.minuteElement.value,10)||0)%60,n=i.secondElement!==undefined?(parseInt(i.secondElement.value,10)||0)%60:0;if(i.amPM!==undefined){e=c(e,i.amPM.textContent)}var a=i.config.minTime!==undefined||i.config.minDate&&i.minDateHasTime&&i.latestSelectedDateObj&&compareDates(i.latestSelectedDateObj,i.config.minDate,true)===0;var r=i.config.maxTime!==undefined||i.config.maxDate&&i.maxDateHasTime&&i.latestSelectedDateObj&&compareDates(i.latestSelectedDateObj,i.config.maxDate,true)===0;if(i.config.maxTime!==undefined&&i.config.minTime!==undefined&&i.config.minTime>i.config.maxTime){var o=calculateSecondsSinceMidnight(i.config.minTime.getHours(),i.config.minTime.getMinutes(),i.config.minTime.getSeconds());var s=calculateSecondsSinceMidnight(i.config.maxTime.getHours(),i.config.maxTime.getMinutes(),i.config.maxTime.getSeconds());var l=calculateSecondsSinceMidnight(e,t,n);if(l>s&&l<o){var u=parseSeconds(o);e=u[0];t=u[1];n=u[2]}}else{if(r){var d=i.config.maxTime!==undefined?i.config.maxTime:i.config.maxDate;e=Math.min(e,d.getHours());if(e===d.getHours())t=Math.min(t,d.getMinutes());if(t===d.getMinutes())n=Math.min(n,d.getSeconds())}if(a){var p=i.config.minTime!==undefined?i.config.minTime:i.config.minDate;e=Math.max(e,p.getHours());if(e===p.getHours()&&t<p.getMinutes())t=p.getMinutes();if(t===p.getMinutes())n=Math.max(n,p.getSeconds())}}h(e,t,n)}function p(e){var t=e||i.latestSelectedDateObj;if(t&&t instanceof Date){h(t.getHours(),t.getMinutes(),t.getSeconds())}}function h(e,t,n){if(i.latestSelectedDateObj!==undefined){i.latestSelectedDateObj.setHours(e%24,t,n||0,0)}if(!i.hourElement||!i.minuteElement||i.isMobile)return;i.hourElement.value=pad(!i.config.time_24hr?(12+e)%12+12*int(e%12===0):e);i.minuteElement.value=pad(t);if(i.amPM!==undefined)i.amPM.textContent=i.l10n.amPM[int(e>=12)];if(i.secondElement!==undefined)i.secondElement.value=pad(n)}function f(e){var t=getEventTarget(e);var i=parseInt(t.value)+(e.delta||0);if(i/1e3>1||e.key==="Enter"&&!/[^\d]/.test(i.toString())){H(i)}}function g(e,t,n,a){if(t instanceof Array)return t.forEach((function(t){return g(e,t,n,a)}));if(e instanceof Array)return e.forEach((function(e){return g(e,t,n,a)}));e.addEventListener(t,n,a);i._handlers.push({remove:function(){return e.removeEventListener(t,n,a)}})}function m(){ve("onChange")}function v(){if(i.config.wrap){["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(i.element.querySelectorAll("[data-"+e+"]"),(function(t){return g(t,"click",i[e])}))}))}if(i.isMobile){ge();return}var e=debounce(K,50);i._debouncedChange=debounce(m,DEBOUNCED_CHANGE_MS);if(i.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent))g(i.daysContainer,"mouseover",(function(e){if(i.config.mode==="range")X(getEventTarget(e))}));g(i._input,"keydown",W);if(i.calendarContainer!==undefined){g(i.calendarContainer,"keydown",W)}if(!i.config.inline&&!i.config.static)g(window,"resize",e);if(window.ontouchstart!==undefined)g(window.document,"touchstart",U);else g(window.document,"mousedown",U);g(window.document,"focus",U,{capture:true});if(i.config.clickOpens===true){g(i._input,"focus",i.open);g(i._input,"click",i.open)}if(i.daysContainer!==undefined){g(i.monthNav,"click",ke);g(i.monthNav,["keyup","increment"],f);g(i.daysContainer,"click",oe)}if(i.timeContainer!==undefined&&i.minuteElement!==undefined&&i.hourElement!==undefined){var t=function(e){return getEventTarget(e).select()};g(i.timeContainer,["increment"],l);g(i.timeContainer,"blur",l,{capture:true});g(i.timeContainer,"click",b);g([i.hourElement,i.minuteElement],["focus","click"],t);if(i.secondElement!==undefined)g(i.secondElement,"focus",(function(){return i.secondElement&&i.secondElement.select()}));if(i.amPM!==undefined){g(i.amPM,"click",(function(e){l(e)}))}}if(i.config.allowInput){g(i._input,"blur",Y)}}function _(e,t){var n=e!==undefined?i.parseDate(e):i.latestSelectedDateObj||(i.config.minDate&&i.config.minDate>i.now?i.config.minDate:i.config.maxDate&&i.config.maxDate<i.now?i.config.maxDate:i.now);var a=i.currentYear;var r=i.currentMonth;try{if(n!==undefined){i.currentYear=n.getFullYear();i.currentMonth=n.getMonth()}}catch(e){e.message="Invalid date supplied: "+n;i.config.errorHandler(e)}if(t&&i.currentYear!==a){ve("onYearChange");C()}if(t&&(i.currentYear!==a||i.currentMonth!==r)){ve("onMonthChange")}i.redraw()}function b(e){var t=getEventTarget(e);if(~t.className.indexOf("arrow"))y(e,t.classList.contains("arrowUp")?1:-1)}function y(e,t,i){var n=e&&getEventTarget(e);var a=i||n&&n.parentNode&&n.parentNode.firstChild;var r=_e("increment");r.delta=t;a&&a.dispatchEvent(r)}function w(){var e=window.document.createDocumentFragment();i.calendarContainer=createElement("div","flatpickr-calendar");i.calendarContainer.tabIndex=-1;if(!i.config.noCalendar){e.appendChild(L());i.innerContainer=createElement("div","flatpickr-innerContainer");if(i.config.weekNumbers){var t=N(),n=t.weekWrapper,a=t.weekNumbers;i.innerContainer.appendChild(n);i.weekNumbers=a;i.weekWrapper=n}i.rContainer=createElement("div","flatpickr-rContainer");i.rContainer.appendChild(P());if(!i.daysContainer){i.daysContainer=createElement("div","flatpickr-days");i.daysContainer.tabIndex=-1}A();i.rContainer.appendChild(i.daysContainer);i.innerContainer.appendChild(i.rContainer);e.appendChild(i.innerContainer)}if(i.config.enableTime){e.appendChild(O())}toggleClass(i.calendarContainer,"rangeMode",i.config.mode==="range");toggleClass(i.calendarContainer,"animate",i.config.animate===true);toggleClass(i.calendarContainer,"multiMonth",i.config.showMonths>1);i.calendarContainer.appendChild(e);var r=i.config.appendTo!==undefined&&i.config.appendTo.nodeType!==undefined;if(i.config.inline||i.config.static){i.calendarContainer.classList.add(i.config.inline?"inline":"static");if(i.config.inline){if(!r&&i.element.parentNode)i.element.parentNode.insertBefore(i.calendarContainer,i._input.nextSibling);else if(i.config.appendTo!==undefined)i.config.appendTo.appendChild(i.calendarContainer)}if(i.config.static){var o=createElement("div","flatpickr-wrapper");if(i.element.parentNode)i.element.parentNode.insertBefore(o,i.element);o.appendChild(i.element);if(i.altInput)o.appendChild(i.altInput);o.appendChild(i.calendarContainer)}}if(!i.config.static&&!i.config.inline)(i.config.appendTo!==undefined?i.config.appendTo:window.document.body).appendChild(i.calendarContainer)}function x(e,t,n,a){var r=V(t,true),o=createElement("span",e,t.getDate().toString());o.dateObj=t;o.$i=a;o.setAttribute("aria-label",i.formatDate(t,i.config.ariaDateFormat));if(e.indexOf("hidden")===-1&&compareDates(t,i.now)===0){i.todayDateElem=o;o.classList.add("today");o.setAttribute("aria-current","date")}if(r){o.tabIndex=-1;if(be(t)){o.classList.add("selected");i.selectedDateElem=o;if(i.config.mode==="range"){toggleClass(o,"startRange",i.selectedDates[0]&&compareDates(t,i.selectedDates[0],true)===0);toggleClass(o,"endRange",i.selectedDates[1]&&compareDates(t,i.selectedDates[1],true)===0);if(e==="nextMonthDay")o.classList.add("inRange")}}}else{o.classList.add("flatpickr-disabled")}if(i.config.mode==="range"){if(ye(t)&&!be(t))o.classList.add("inRange")}if(i.weekNumbers&&i.config.showMonths===1&&e!=="prevMonthDay"&&a%7===6){i.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+i.config.getWeek(t)+"</span>")}ve("onDayCreate",o);return o}function E(e){e.focus();if(i.config.mode==="range")X(e)}function k(e){var t=e>0?0:i.config.showMonths-1;var n=e>0?i.config.showMonths:-1;for(var a=t;a!=n;a+=e){var r=i.daysContainer.children[a];var o=e>0?0:r.children.length-1;var s=e>0?r.children.length:-1;for(var l=o;l!=s;l+=e){var c=r.children[l];if(c.className.indexOf("hidden")===-1&&V(c.dateObj))return c}}return undefined}function I(e,t){var n=e.className.indexOf("Month")===-1?e.dateObj.getMonth():i.currentMonth;var a=t>0?i.config.showMonths:-1;var r=t>0?1:-1;for(var o=n-i.currentMonth;o!=a;o+=r){var s=i.daysContainer.children[o];var l=n-i.currentMonth===o?e.$i+t:t<0?s.children.length-1:0;var c=s.children.length;for(var u=l;u>=0&&u<c&&u!=(t>0?c:-1);u+=r){var d=s.children[u];if(d.className.indexOf("hidden")===-1&&V(d.dateObj)&&Math.abs(e.$i-u)>=Math.abs(t))return E(d)}}i.changeMonth(r);T(k(r),0);return undefined}function T(e,t){var n=r();var a=j(n||document.body);var o=e!==undefined?e:a?n:i.selectedDateElem!==undefined&&j(i.selectedDateElem)?i.selectedDateElem:i.todayDateElem!==undefined&&j(i.todayDateElem)?i.todayDateElem:k(t>0?1:-1);if(o===undefined){i._input.focus()}else if(!a){E(o)}else{I(o,t)}}function S(e,t){var n=(new Date(e,t,1).getDay()-i.l10n.firstDayOfWeek+7)%7;var a=i.utils.getDaysInMonth((t-1+12)%12,e);var r=i.utils.getDaysInMonth(t,e),o=window.document.createDocumentFragment(),s=i.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",c=s?"nextMonthDay hidden":"nextMonthDay";var u=a+1-n,d=0;for(;u<=a;u++,d++){o.appendChild(x("flatpickr-day "+l,new Date(e,t-1,u),u,d))}for(u=1;u<=r;u++,d++){o.appendChild(x("flatpickr-day",new Date(e,t,u),u,d))}for(var p=r+1;p<=42-n&&(i.config.showMonths===1||d%7!==0);p++,d++){o.appendChild(x("flatpickr-day "+c,new Date(e,t+1,p%r),p,d))}var h=createElement("div","dayContainer");h.appendChild(o);return h}function A(){if(i.daysContainer===undefined){return}clearNode(i.daysContainer);if(i.weekNumbers)clearNode(i.weekNumbers);var e=document.createDocumentFragment();for(var t=0;t<i.config.showMonths;t++){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+t);e.appendChild(S(n.getFullYear(),n.getMonth()))}i.daysContainer.appendChild(e);i.days=i.daysContainer.firstChild;if(i.config.mode==="range"&&i.selectedDates.length===1){X()}}function C(){if(i.config.showMonths>1||i.config.monthSelectorType!=="dropdown")return;var e=function(e){if(i.config.minDate!==undefined&&i.currentYear===i.config.minDate.getFullYear()&&e<i.config.minDate.getMonth()){return false}return!(i.config.maxDate!==undefined&&i.currentYear===i.config.maxDate.getFullYear()&&e>i.config.maxDate.getMonth())};i.monthsDropdownContainer.tabIndex=-1;i.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++){if(!e(t))continue;var n=createElement("option","flatpickr-monthDropdown-month");n.value=new Date(i.currentYear,t).getMonth().toString();n.textContent=monthToStr(t,i.config.shorthandCurrentMonth,i.l10n);n.tabIndex=-1;if(i.currentMonth===t){n.selected=true}i.monthsDropdownContainer.appendChild(n)}}function M(){var e=createElement("div","flatpickr-month");var t=window.document.createDocumentFragment();var n;if(i.config.showMonths>1||i.config.monthSelectorType==="static"){n=createElement("span","cur-month")}else{i.monthsDropdownContainer=createElement("select","flatpickr-monthDropdown-months");i.monthsDropdownContainer.setAttribute("aria-label",i.l10n.monthAriaLabel);g(i.monthsDropdownContainer,"change",(function(e){var t=getEventTarget(e);var n=parseInt(t.value,10);i.changeMonth(n-i.currentMonth);ve("onMonthChange")}));C();n=i.monthsDropdownContainer}var a=createNumberInput("cur-year",{tabindex:"-1"});var r=a.getElementsByTagName("input")[0];r.setAttribute("aria-label",i.l10n.yearAriaLabel);if(i.config.minDate){r.setAttribute("min",i.config.minDate.getFullYear().toString())}if(i.config.maxDate){r.setAttribute("max",i.config.maxDate.getFullYear().toString());r.disabled=!!i.config.minDate&&i.config.minDate.getFullYear()===i.config.maxDate.getFullYear()}var o=createElement("div","flatpickr-current-month");o.appendChild(n);o.appendChild(a);t.appendChild(o);e.appendChild(t);return{container:e,yearElement:r,monthElement:n}}function D(){clearNode(i.monthNav);i.monthNav.appendChild(i.prevMonthNav);if(i.config.showMonths){i.yearElements=[];i.monthElements=[]}for(var e=i.config.showMonths;e--;){var t=M();i.yearElements.push(t.yearElement);i.monthElements.push(t.monthElement);i.monthNav.appendChild(t.container)}i.monthNav.appendChild(i.nextMonthNav)}function L(){i.monthNav=createElement("div","flatpickr-months");i.yearElements=[];i.monthElements=[];i.prevMonthNav=createElement("span","flatpickr-prev-month");i.prevMonthNav.innerHTML=i.config.prevArrow;i.nextMonthNav=createElement("span","flatpickr-next-month");i.nextMonthNav.innerHTML=i.config.nextArrow;D();Object.defineProperty(i,"_hidePrevMonthArrow",{get:function(){return i.__hidePrevMonthArrow},set:function(e){if(i.__hidePrevMonthArrow!==e){toggleClass(i.prevMonthNav,"flatpickr-disabled",e);i.__hidePrevMonthArrow=e}}});Object.defineProperty(i,"_hideNextMonthArrow",{get:function(){return i.__hideNextMonthArrow},set:function(e){if(i.__hideNextMonthArrow!==e){toggleClass(i.nextMonthNav,"flatpickr-disabled",e);i.__hideNextMonthArrow=e}}});i.currentYearElement=i.yearElements[0];we();return i.monthNav}function O(){i.calendarContainer.classList.add("hasTime");if(i.config.noCalendar)i.calendarContainer.classList.add("noCalendar");var e=getDefaultHours(i.config);i.timeContainer=createElement("div","flatpickr-time");i.timeContainer.tabIndex=-1;var t=createElement("span","flatpickr-time-separator",":");var n=createNumberInput("flatpickr-hour",{"aria-label":i.l10n.hourAriaLabel});i.hourElement=n.getElementsByTagName("input")[0];var a=createNumberInput("flatpickr-minute",{"aria-label":i.l10n.minuteAriaLabel});i.minuteElement=a.getElementsByTagName("input")[0];i.hourElement.tabIndex=i.minuteElement.tabIndex=-1;i.hourElement.value=pad(i.latestSelectedDateObj?i.latestSelectedDateObj.getHours():i.config.time_24hr?e.hours:u(e.hours));i.minuteElement.value=pad(i.latestSelectedDateObj?i.latestSelectedDateObj.getMinutes():e.minutes);i.hourElement.setAttribute("step",i.config.hourIncrement.toString());i.minuteElement.setAttribute("step",i.config.minuteIncrement.toString());i.hourElement.setAttribute("min",i.config.time_24hr?"0":"1");i.hourElement.setAttribute("max",i.config.time_24hr?"23":"12");i.hourElement.setAttribute("maxlength","2");i.minuteElement.setAttribute("min","0");i.minuteElement.setAttribute("max","59");i.minuteElement.setAttribute("maxlength","2");i.timeContainer.appendChild(n);i.timeContainer.appendChild(t);i.timeContainer.appendChild(a);if(i.config.time_24hr)i.timeContainer.classList.add("time24hr");if(i.config.enableSeconds){i.timeContainer.classList.add("hasSeconds");var r=createNumberInput("flatpickr-second");i.secondElement=r.getElementsByTagName("input")[0];i.secondElement.value=pad(i.latestSelectedDateObj?i.latestSelectedDateObj.getSeconds():e.seconds);i.secondElement.setAttribute("step",i.minuteElement.getAttribute("step"));i.secondElement.setAttribute("min","0");i.secondElement.setAttribute("max","59");i.secondElement.setAttribute("maxlength","2");i.timeContainer.appendChild(createElement("span","flatpickr-time-separator",":"));i.timeContainer.appendChild(r)}if(!i.config.time_24hr){i.amPM=createElement("span","flatpickr-am-pm",i.l10n.amPM[int((i.latestSelectedDateObj?i.hourElement.value:i.config.defaultHour)>11)]);i.amPM.title=i.l10n.toggleTitle;i.amPM.tabIndex=-1;i.timeContainer.appendChild(i.amPM)}return i.timeContainer}function P(){if(!i.weekdayContainer)i.weekdayContainer=createElement("div","flatpickr-weekdays");else clearNode(i.weekdayContainer);for(var e=i.config.showMonths;e--;){var t=createElement("div","flatpickr-weekdaycontainer");i.weekdayContainer.appendChild(t)}R();return i.weekdayContainer}function R(){if(!i.weekdayContainer){return}var e=i.l10n.firstDayOfWeek;var t=__spreadArrays(i.l10n.weekdays.shorthand);if(e>0&&e<t.length){t=__spreadArrays(t.splice(e,t.length),t.splice(0,e))}for(var n=i.config.showMonths;n--;){i.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function N(){i.calendarContainer.classList.add("hasWeeks");var e=createElement("div","flatpickr-weekwrapper");e.appendChild(createElement("span","flatpickr-weekday",i.l10n.weekAbbreviation));var t=createElement("div","flatpickr-weeks");e.appendChild(t);return{weekWrapper:e,weekNumbers:t}}function F(e,t){if(t===void 0){t=true}var n=t?e:e-i.currentMonth;if(n<0&&i._hidePrevMonthArrow===true||n>0&&i._hideNextMonthArrow===true)return;i.currentMonth+=n;if(i.currentMonth<0||i.currentMonth>11){i.currentYear+=i.currentMonth>11?1:-1;i.currentMonth=(i.currentMonth+12)%12;ve("onYearChange");C()}A();ve("onMonthChange");we()}function G(e,t){if(e===void 0){e=true}if(t===void 0){t=true}i.input.value="";if(i.altInput!==undefined)i.altInput.value="";if(i.mobileInput!==undefined)i.mobileInput.value="";i.selectedDates=[];i.latestSelectedDateObj=undefined;if(t===true){i.currentYear=i._initialDate.getFullYear();i.currentMonth=i._initialDate.getMonth()}if(i.config.enableTime===true){var n=getDefaultHours(i.config),a=n.hours,r=n.minutes,o=n.seconds;h(a,r,o)}i.redraw();if(e)ve("onChange")}function z(){i.isOpen=false;if(!i.isMobile){if(i.calendarContainer!==undefined){i.calendarContainer.classList.remove("open")}if(i._input!==undefined){i._input.classList.remove("active")}}ve("onClose")}function B(){if(i.config!==undefined)ve("onDestroy");for(var e=i._handlers.length;e--;){i._handlers[e].remove()}i._handlers=[];if(i.mobileInput){if(i.mobileInput.parentNode)i.mobileInput.parentNode.removeChild(i.mobileInput);i.mobileInput=undefined}else if(i.calendarContainer&&i.calendarContainer.parentNode){if(i.config.static&&i.calendarContainer.parentNode){var t=i.calendarContainer.parentNode;t.lastChild&&t.removeChild(t.lastChild);if(t.parentNode){while(t.firstChild)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else i.calendarContainer.parentNode.removeChild(i.calendarContainer)}if(i.altInput){i.input.type="text";if(i.altInput.parentNode)i.altInput.parentNode.removeChild(i.altInput);delete i.altInput}if(i.input){i.input.type=i.input._type;i.input.classList.remove("flatpickr-input");i.input.removeAttribute("readonly")}["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete i[e]}catch(e){}}))}function q(e){return i.calendarContainer.contains(e)}function U(e){if(i.isOpen&&!i.config.inline){var t=getEventTarget(e);var n=q(t);var a=t===i.input||t===i.altInput||i.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(i.input)||~e.path.indexOf(i.altInput));var r=!a&&!n&&!q(e.relatedTarget);var o=!i.config.ignoredFocusElements.some((function(e){return e.contains(t)}));if(r&&o){if(i.config.allowInput){i.setDate(i._input.value,false,i.config.altInput?i.config.altFormat:i.config.dateFormat)}if(i.timeContainer!==undefined&&i.minuteElement!==undefined&&i.hourElement!==undefined&&i.input.value!==""&&i.input.value!==undefined){l()}i.close();if(i.config&&i.config.mode==="range"&&i.selectedDates.length===1)i.clear(false)}}}function H(e){if(!e||i.config.minDate&&e<i.config.minDate.getFullYear()||i.config.maxDate&&e>i.config.maxDate.getFullYear())return;var t=e,n=i.currentYear!==t;i.currentYear=t||i.currentYear;if(i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()){i.currentMonth=Math.min(i.config.maxDate.getMonth(),i.currentMonth)}else if(i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()){i.currentMonth=Math.max(i.config.minDate.getMonth(),i.currentMonth)}if(n){i.redraw();ve("onYearChange");C()}}function V(e,t){var n;if(t===void 0){t=true}var a=i.parseDate(e,undefined,t);if(i.config.minDate&&a&&compareDates(a,i.config.minDate,t!==undefined?t:!i.minDateHasTime)<0||i.config.maxDate&&a&&compareDates(a,i.config.maxDate,t!==undefined?t:!i.maxDateHasTime)>0)return false;if(!i.config.enable&&i.config.disable.length===0)return true;if(a===undefined)return false;var r=!!i.config.enable,o=(n=i.config.enable)!==null&&n!==void 0?n:i.config.disable;for(var s=0,l=void 0;s<o.length;s++){l=o[s];if(typeof l==="function"&&l(a))return r;else if(l instanceof Date&&a!==undefined&&l.getTime()===a.getTime())return r;else if(typeof l==="string"){var c=i.parseDate(l,undefined,true);return c&&c.getTime()===a.getTime()?r:!r}else if(typeof l==="object"&&a!==undefined&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return r}return!r}function j(e){if(i.daysContainer!==undefined)return e.className.indexOf("hidden")===-1&&e.className.indexOf("flatpickr-disabled")===-1&&i.daysContainer.contains(e);return false}function Y(e){var t=e.target===i._input;var n=i._input.value.trimEnd()!==xe();if(t&&n&&!(e.relatedTarget&&q(e.relatedTarget))){i.setDate(i._input.value,true,e.target===i.altInput?i.config.altFormat:i.config.dateFormat)}}function W(t){var n=getEventTarget(t);var a=i.config.wrap?e.contains(n):n===i._input;var o=i.config.allowInput;var s=i.isOpen&&(!o||!a);var c=i.config.inline&&a&&!o;if(t.keyCode===13&&a){if(o){i.setDate(i._input.value,true,n===i.altInput?i.config.altFormat:i.config.dateFormat);i.close();return n.blur()}else{i.open()}}else if(q(n)||s||c){var u=!!i.timeContainer&&i.timeContainer.contains(n);switch(t.keyCode){case 13:if(u){t.preventDefault();l();re()}else oe(t);break;case 27:t.preventDefault();re();break;case 8:case 46:if(a&&!i.config.allowInput){t.preventDefault();i.clear()}break;case 37:case 39:if(!u&&!a){t.preventDefault();var p=r();if(i.daysContainer!==undefined&&(o===false||p&&j(p))){var h=t.keyCode===39?1:-1;if(!t.ctrlKey)T(undefined,h);else{t.stopPropagation();F(h);T(k(1),0)}}}else if(i.hourElement)i.hourElement.focus();break;case 38:case 40:t.preventDefault();var f=t.keyCode===40?1:-1;if(i.daysContainer&&n.$i!==undefined||n===i.input||n===i.altInput){if(t.ctrlKey){t.stopPropagation();H(i.currentYear-f);T(k(1),0)}else if(!u)T(undefined,f*7)}else if(n===i.currentYearElement){H(i.currentYear-f)}else if(i.config.enableTime){if(!u&&i.hourElement)i.hourElement.focus();l(t);i._debouncedChange()}break;case 9:if(u){var g=[i.hourElement,i.minuteElement,i.secondElement,i.amPM].concat(i.pluginElements).filter((function(e){return e}));var m=g.indexOf(n);if(m!==-1){var v=g[m+(t.shiftKey?-1:1)];t.preventDefault();(v||i._input).focus()}}else if(!i.config.noCalendar&&i.daysContainer&&i.daysContainer.contains(n)&&t.shiftKey){t.preventDefault();i._input.focus()}break}}if(i.amPM!==undefined&&n===i.amPM){switch(t.key){case i.l10n.amPM[0].charAt(0):case i.l10n.amPM[0].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[0];d();Ee();break;case i.l10n.amPM[1].charAt(0):case i.l10n.amPM[1].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[1];d();Ee();break}}if(a||q(n)){ve("onKeyDown",t)}}function X(e,t){if(t===void 0){t="flatpickr-day"}if(i.selectedDates.length!==1||e&&(!e.classList.contains(t)||e.classList.contains("flatpickr-disabled")))return;var n=e?e.dateObj.getTime():i.days.firstElementChild.dateObj.getTime(),a=i.parseDate(i.selectedDates[0],undefined,true).getTime(),r=Math.min(n,i.selectedDates[0].getTime()),o=Math.max(n,i.selectedDates[0].getTime());var s=false;var l=0,c=0;for(var u=r;u<o;u+=duration.DAY){if(!V(new Date(u),true)){s=s||u>r&&u<o;if(u<a&&(!l||u>l))l=u;else if(u>a&&(!c||u<c))c=u}}var d=Array.from(i.rContainer.querySelectorAll("*:nth-child(-n+"+i.config.showMonths+") > ."+t));d.forEach((function(t){var r=t.dateObj;var o=r.getTime();var u=l>0&&o<l||c>0&&o>c;if(u){t.classList.add("notAllowed");["inRange","startRange","endRange"].forEach((function(e){t.classList.remove(e)}));return}else if(s&&!u)return;["startRange","inRange","endRange","notAllowed"].forEach((function(e){t.classList.remove(e)}));if(e!==undefined){e.classList.add(n<=i.selectedDates[0].getTime()?"startRange":"endRange");if(a<n&&o===a)t.classList.add("startRange");else if(a>n&&o===a)t.classList.add("endRange");if(o>=l&&(c===0||o<=c)&&isBetween(o,a,n))t.classList.add("inRange")}}))}function K(){if(i.isOpen&&!i.config.static&&!i.config.inline)te()}function Z(e,t){if(t===void 0){t=i._positionElement}if(i.isMobile===true){if(e){e.preventDefault();var n=getEventTarget(e);if(n){n.blur()}}if(i.mobileInput!==undefined){i.mobileInput.focus();i.mobileInput.click()}ve("onOpen");return}else if(i._input.disabled||i.config.inline){return}var a=i.isOpen;i.isOpen=true;if(!a){i.calendarContainer.classList.add("open");i._input.classList.add("active");ve("onOpen");te(t)}if(i.config.enableTime===true&&i.config.noCalendar===true){if(i.config.allowInput===false&&(e===undefined||!i.timeContainer.contains(e.relatedTarget))){setTimeout((function(){return i.hourElement.select()}),50)}}}function Q(e){return function(t){var n=i.config["_"+e+"Date"]=i.parseDate(t,i.config.dateFormat);var a=i.config["_"+(e==="min"?"max":"min")+"Date"];if(n!==undefined){i[e==="min"?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0}if(i.selectedDates){i.selectedDates=i.selectedDates.filter((function(e){return V(e)}));if(!i.selectedDates.length&&e==="min")p(n);Ee()}if(i.daysContainer){ae();if(n!==undefined)i.currentYearElement[e]=n.getFullYear().toString();else i.currentYearElement.removeAttribute(e);i.currentYearElement.disabled=!!a&&n!==undefined&&a.getFullYear()===n.getFullYear()}}}function $(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"];var a=__assign(__assign({},JSON.parse(JSON.stringify(e.dataset||{}))),t);var r={};i.config.parseDate=a.parseDate;i.config.formatDate=a.formatDate;Object.defineProperty(i.config,"enable",{get:function(){return i.config._enable},set:function(e){i.config._enable=de(e)}});Object.defineProperty(i.config,"disable",{get:function(){return i.config._disable},set:function(e){i.config._disable=de(e)}});var s=a.mode==="time";if(!a.dateFormat&&(a.enableTime||s)){var l=flatpickr.defaultConfig.dateFormat||defaults$1.dateFormat;r.dateFormat=a.noCalendar||s?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||s)&&!a.altFormat){var c=flatpickr.defaultConfig.altFormat||defaults$1.altFormat;r.altFormat=a.noCalendar||s?"h:i"+(a.enableSeconds?":S K":" K"):c+(" h:i"+(a.enableSeconds?":S":"")+" K")}Object.defineProperty(i.config,"minDate",{get:function(){return i.config._minDate},set:Q("min")});Object.defineProperty(i.config,"maxDate",{get:function(){return i.config._maxDate},set:Q("max")});var u=function(e){return function(t){i.config[e==="min"?"_minTime":"_maxTime"]=i.parseDate(t,"H:i:S")}};Object.defineProperty(i.config,"minTime",{get:function(){return i.config._minTime},set:u("min")});Object.defineProperty(i.config,"maxTime",{get:function(){return i.config._maxTime},set:u("max")});if(a.mode==="time"){i.config.noCalendar=true;i.config.enableTime=true}Object.assign(i.config,r,a);for(var d=0;d<n.length;d++)i.config[n[d]]=i.config[n[d]]===true||i.config[n[d]]==="true";HOOKS.filter((function(e){return i.config[e]!==undefined})).forEach((function(e){i.config[e]=arrayify(i.config[e]||[]).map(o)}));i.isMobile=!i.config.disableMobile&&!i.config.inline&&i.config.mode==="single"&&!i.config.disable.length&&!i.config.enable&&!i.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var d=0;d<i.config.plugins.length;d++){var p=i.config.plugins[d](i)||{};for(var h in p){if(HOOKS.indexOf(h)>-1){i.config[h]=arrayify(p[h]).map(o).concat(i.config[h])}else if(typeof a[h]==="undefined")i.config[h]=p[h]}}if(!a.altInputClass){i.config.altInputClass=J().className+" "+i.config.altInputClass}ve("onParseConfig")}function J(){return i.config.wrap?e.querySelector("[data-input]"):e}function ee(){if(typeof i.config.locale!=="object"&&typeof flatpickr.l10ns[i.config.locale]==="undefined")i.config.errorHandler(new Error("flatpickr: invalid locale "+i.config.locale));i.l10n=__assign(__assign({},flatpickr.l10ns.default),typeof i.config.locale==="object"?i.config.locale:i.config.locale!=="default"?flatpickr.l10ns[i.config.locale]:undefined);tokenRegex.D="("+i.l10n.weekdays.shorthand.join("|")+")";tokenRegex.l="("+i.l10n.weekdays.longhand.join("|")+")";tokenRegex.M="("+i.l10n.months.shorthand.join("|")+")";tokenRegex.F="("+i.l10n.months.longhand.join("|")+")";tokenRegex.K="("+i.l10n.amPM[0]+"|"+i.l10n.amPM[1]+"|"+i.l10n.amPM[0].toLowerCase()+"|"+i.l10n.amPM[1].toLowerCase()+")";var n=__assign(__assign({},t),JSON.parse(JSON.stringify(e.dataset||{})));if(n.time_24hr===undefined&&flatpickr.defaultConfig.time_24hr===undefined){i.config.time_24hr=i.l10n.time_24hr}i.formatDate=createDateFormatter(i);i.parseDate=createDateParser({config:i.config,l10n:i.l10n})}function te(e){if(typeof i.config.position==="function"){return void i.config.position(i,e)}if(i.calendarContainer===undefined)return;ve("onPreCalendarPosition");var t=e||i._positionElement;var n=Array.prototype.reduce.call(i.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),a=i.calendarContainer.offsetWidth,r=i.config.position.split(" "),o=r[0],s=r.length>1?r[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,u=o==="above"||o!=="below"&&c<n&&l.top>n;var d=window.pageYOffset+l.top+(!u?t.offsetHeight+2:-n-2);toggleClass(i.calendarContainer,"arrowTop",!u);toggleClass(i.calendarContainer,"arrowBottom",u);if(i.config.inline)return;var p=window.pageXOffset+l.left;var h=false;var f=false;if(s==="center"){p-=(a-l.width)/2;h=true}else if(s==="right"){p-=a-l.width;f=true}toggleClass(i.calendarContainer,"arrowLeft",!h&&!f);toggleClass(i.calendarContainer,"arrowCenter",h);toggleClass(i.calendarContainer,"arrowRight",f);var g=window.document.body.offsetWidth-(window.pageXOffset+l.right);var m=p+a>window.document.body.offsetWidth;var v=g+a>window.document.body.offsetWidth;toggleClass(i.calendarContainer,"rightMost",m);if(i.config.static)return;i.calendarContainer.style.top=d+"px";if(!m){i.calendarContainer.style.left=p+"px";i.calendarContainer.style.right="auto"}else if(!v){i.calendarContainer.style.left="auto";i.calendarContainer.style.right=g+"px"}else{var _=ie();if(_===undefined)return;var b=window.document.body.offsetWidth;var y=Math.max(0,b/2-a/2);var w=".flatpickr-calendar.centerMost:before";var x=".flatpickr-calendar.centerMost:after";var E=_.cssRules.length;var k="{left:"+l.left+"px;right:auto;}";toggleClass(i.calendarContainer,"rightMost",false);toggleClass(i.calendarContainer,"centerMost",true);_.insertRule(w+","+x+k,E);i.calendarContainer.style.left=y+"px";i.calendarContainer.style.right="auto"}}function ie(){var e=null;for(var t=0;t<document.styleSheets.length;t++){var i=document.styleSheets[t];if(!i.cssRules)continue;e=i;break}return e!=null?e:ne()}function ne(){var e=document.createElement("style");document.head.appendChild(e);return e.sheet}function ae(){if(i.config.noCalendar||i.isMobile)return;C();we();A()}function re(){i._input.focus();if(window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==undefined){setTimeout(i.close,0)}else{i.close()}}function oe(e){e.preventDefault();e.stopPropagation();var t=function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")};var n=findParent(getEventTarget(e),t);if(n===undefined)return;var a=n;var r=i.latestSelectedDateObj=new Date(a.dateObj.getTime());var o=(r.getMonth()<i.currentMonth||r.getMonth()>i.currentMonth+i.config.showMonths-1)&&i.config.mode!=="range";i.selectedDateElem=a;if(i.config.mode==="single")i.selectedDates=[r];else if(i.config.mode==="multiple"){var s=be(r);if(s)i.selectedDates.splice(parseInt(s),1);else i.selectedDates.push(r)}else if(i.config.mode==="range"){if(i.selectedDates.length===2){i.clear(false,false)}i.latestSelectedDateObj=r;i.selectedDates.push(r);if(compareDates(r,i.selectedDates[0],true)!==0)i.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}d();if(o){var l=i.currentYear!==r.getFullYear();i.currentYear=r.getFullYear();i.currentMonth=r.getMonth();if(l){ve("onYearChange");C()}ve("onMonthChange")}we();A();Ee();if(!o&&i.config.mode!=="range"&&i.config.showMonths===1)E(a);else if(i.selectedDateElem!==undefined&&i.hourElement===undefined){i.selectedDateElem&&i.selectedDateElem.focus()}if(i.hourElement!==undefined)i.hourElement!==undefined&&i.hourElement.focus();if(i.config.closeOnSelect){var c=i.config.mode==="single"&&!i.config.enableTime;var u=i.config.mode==="range"&&i.selectedDates.length===2&&!i.config.enableTime;if(c||u){re()}}m()}var se={locale:[ee,R],showMonths:[D,s,P],minDate:[_],maxDate:[_],positionElement:[fe],clickOpens:[function(){if(i.config.clickOpens===true){g(i._input,"focus",i.open);g(i._input,"click",i.open)}else{i._input.removeEventListener("focus",i.open);i._input.removeEventListener("click",i.open)}}]};function le(e,t){if(e!==null&&typeof e==="object"){Object.assign(i.config,e);for(var n in e){if(se[n]!==undefined)se[n].forEach((function(e){return e()}))}}else{i.config[e]=t;if(se[e]!==undefined)se[e].forEach((function(e){return e()}));else if(HOOKS.indexOf(e)>-1)i.config[e]=arrayify(t)}i.redraw();Ee(true)}function ce(e,t){var n=[];if(e instanceof Array)n=e.map((function(e){return i.parseDate(e,t)}));else if(e instanceof Date||typeof e==="number")n=[i.parseDate(e,t)];else if(typeof e==="string"){switch(i.config.mode){case"single":case"time":n=[i.parseDate(e,t)];break;case"multiple":n=e.split(i.config.conjunction).map((function(e){return i.parseDate(e,t)}));break;case"range":n=e.split(i.l10n.rangeSeparator).map((function(e){return i.parseDate(e,t)}));break}}else i.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));i.selectedDates=i.config.allowInvalidPreload?n:n.filter((function(e){return e instanceof Date&&V(e,false)}));if(i.config.mode==="range")i.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function ue(e,t,n){if(t===void 0){t=false}if(n===void 0){n=i.config.dateFormat}if(e!==0&&!e||e instanceof Array&&e.length===0)return i.clear(t);ce(e,n);i.latestSelectedDateObj=i.selectedDates[i.selectedDates.length-1];i.redraw();_(undefined,t);p();if(i.selectedDates.length===0){i.clear(false)}Ee(t);if(t)ve("onChange")}function de(e){return e.slice().map((function(e){if(typeof e==="string"||typeof e==="number"||e instanceof Date){return i.parseDate(e,undefined,true)}else if(e&&typeof e==="object"&&e.from&&e.to)return{from:i.parseDate(e.from,undefined),to:i.parseDate(e.to,undefined)};return e})).filter((function(e){return e}))}function pe(){i.selectedDates=[];i.now=i.parseDate(i.config.now)||new Date;var e=i.config.defaultDate||((i.input.nodeName==="INPUT"||i.input.nodeName==="TEXTAREA")&&i.input.placeholder&&i.input.value===i.input.placeholder?null:i.input.value);if(e)ce(e,i.config.dateFormat);i._initialDate=i.selectedDates.length>0?i.selectedDates[0]:i.config.minDate&&i.config.minDate.getTime()>i.now.getTime()?i.config.minDate:i.config.maxDate&&i.config.maxDate.getTime()<i.now.getTime()?i.config.maxDate:i.now;i.currentYear=i._initialDate.getFullYear();i.currentMonth=i._initialDate.getMonth();if(i.selectedDates.length>0)i.latestSelectedDateObj=i.selectedDates[0];if(i.config.minTime!==undefined)i.config.minTime=i.parseDate(i.config.minTime,"H:i");if(i.config.maxTime!==undefined)i.config.maxTime=i.parseDate(i.config.maxTime,"H:i");i.minDateHasTime=!!i.config.minDate&&(i.config.minDate.getHours()>0||i.config.minDate.getMinutes()>0||i.config.minDate.getSeconds()>0);i.maxDateHasTime=!!i.config.maxDate&&(i.config.maxDate.getHours()>0||i.config.maxDate.getMinutes()>0||i.config.maxDate.getSeconds()>0)}function he(){i.input=J();if(!i.input){i.config.errorHandler(new Error("Invalid input element specified"));return}i.input._type=i.input.type;i.input.type="text";i.input.classList.add("flatpickr-input");i._input=i.input;if(i.config.altInput){i.altInput=createElement(i.input.nodeName,i.config.altInputClass);i._input=i.altInput;i.altInput.placeholder=i.input.placeholder;i.altInput.disabled=i.input.disabled;i.altInput.required=i.input.required;i.altInput.tabIndex=i.input.tabIndex;i.altInput.type="text";i.input.setAttribute("type","hidden");if(!i.config.static&&i.input.parentNode)i.input.parentNode.insertBefore(i.altInput,i.input.nextSibling)}if(!i.config.allowInput)i._input.setAttribute("readonly","readonly");fe()}function fe(){i._positionElement=i.config.positionElement||i._input}function ge(){var e=i.config.enableTime?i.config.noCalendar?"time":"datetime-local":"date";i.mobileInput=createElement("input",i.input.className+" flatpickr-mobile");i.mobileInput.tabIndex=1;i.mobileInput.type=e;i.mobileInput.disabled=i.input.disabled;i.mobileInput.required=i.input.required;i.mobileInput.placeholder=i.input.placeholder;i.mobileFormatStr=e==="datetime-local"?"Y-m-d\\TH:i:S":e==="date"?"Y-m-d":"H:i:S";if(i.selectedDates.length>0){i.mobileInput.defaultValue=i.mobileInput.value=i.formatDate(i.selectedDates[0],i.mobileFormatStr)}if(i.config.minDate)i.mobileInput.min=i.formatDate(i.config.minDate,"Y-m-d");if(i.config.maxDate)i.mobileInput.max=i.formatDate(i.config.maxDate,"Y-m-d");if(i.input.getAttribute("step"))i.mobileInput.step=String(i.input.getAttribute("step"));i.input.type="hidden";if(i.altInput!==undefined)i.altInput.type="hidden";try{if(i.input.parentNode)i.input.parentNode.insertBefore(i.mobileInput,i.input.nextSibling)}catch(e){}g(i.mobileInput,"change",(function(e){i.setDate(getEventTarget(e).value,false,i.mobileFormatStr);ve("onChange");ve("onClose")}))}function me(e){if(i.isOpen===true)return i.close();i.open(e)}function ve(e,t){if(i.config===undefined)return;var n=i.config[e];if(n!==undefined&&n.length>0){for(var a=0;n[a]&&a<n.length;a++)n[a](i.selectedDates,i.input.value,i,t)}if(e==="onChange"){i.input.dispatchEvent(_e("change"));i.input.dispatchEvent(_e("input"))}}function _e(e){var t=document.createEvent("Event");t.initEvent(e,true,true);return t}function be(e){for(var t=0;t<i.selectedDates.length;t++){var n=i.selectedDates[t];if(n instanceof Date&&compareDates(n,e)===0)return""+t}return false}function ye(e){if(i.config.mode!=="range"||i.selectedDates.length<2)return false;return compareDates(e,i.selectedDates[0])>=0&&compareDates(e,i.selectedDates[1])<=0}function we(){if(i.config.noCalendar||i.isMobile||!i.monthNav)return;i.yearElements.forEach((function(e,t){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+t);if(i.config.showMonths>1||i.config.monthSelectorType==="static"){i.monthElements[t].textContent=monthToStr(n.getMonth(),i.config.shorthandCurrentMonth,i.l10n)+" "}else{i.monthsDropdownContainer.value=n.getMonth().toString()}e.value=n.getFullYear().toString()}));i._hidePrevMonthArrow=i.config.minDate!==undefined&&(i.currentYear===i.config.minDate.getFullYear()?i.currentMonth<=i.config.minDate.getMonth():i.currentYear<i.config.minDate.getFullYear());i._hideNextMonthArrow=i.config.maxDate!==undefined&&(i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth+1>i.config.maxDate.getMonth():i.currentYear>i.config.maxDate.getFullYear())}function xe(e){var t=e||(i.config.altInput?i.config.altFormat:i.config.dateFormat);return i.selectedDates.map((function(e){return i.formatDate(e,t)})).filter((function(e,t,n){return i.config.mode!=="range"||i.config.enableTime||n.indexOf(e)===t})).join(i.config.mode!=="range"?i.config.conjunction:i.l10n.rangeSeparator)}function Ee(e){if(e===void 0){e=true}if(i.mobileInput!==undefined&&i.mobileFormatStr){i.mobileInput.value=i.latestSelectedDateObj!==undefined?i.formatDate(i.latestSelectedDateObj,i.mobileFormatStr):""}i.input.value=xe(i.config.dateFormat);if(i.altInput!==undefined){i.altInput.value=xe(i.config.altFormat)}if(e!==false)ve("onValueUpdate")}function ke(e){var t=getEventTarget(e);var n=i.prevMonthNav.contains(t);var a=i.nextMonthNav.contains(t);if(n||a){F(n?-1:1)}else if(i.yearElements.indexOf(t)>=0){t.select()}else if(t.classList.contains("arrowUp")){i.changeYear(i.currentYear+1)}else if(t.classList.contains("arrowDown")){i.changeYear(i.currentYear-1)}}function Ie(e){e.preventDefault();var t=e.type==="keydown",n=getEventTarget(e),a=n;if(i.amPM!==undefined&&n===i.amPM){i.amPM.textContent=i.l10n.amPM[int(i.amPM.textContent===i.l10n.amPM[0])]}var r=parseFloat(a.getAttribute("min")),o=parseFloat(a.getAttribute("max")),s=parseFloat(a.getAttribute("step")),l=parseInt(a.value,10),c=e.delta||(t?e.which===38?1:-1:0);var u=l+s*c;if(typeof a.value!=="undefined"&&a.value.length===2){var d=a===i.hourElement,p=a===i.minuteElement;if(u<r){u=o+u+int(!d)+(int(d)&&int(!i.amPM));if(p)y(undefined,-1,i.hourElement)}else if(u>o){u=a===i.hourElement?u-o-int(!i.amPM):r;if(p)y(undefined,1,i.hourElement)}if(i.amPM&&d&&(s===1?u+l===23:Math.abs(u-l)>s)){i.amPM.textContent=i.l10n.amPM[int(i.amPM.textContent===i.l10n.amPM[0])]}a.value=pad(u)}}a();return i}function _flatpickr(e,t){var i=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement}));var n=[];for(var a=0;a<i.length;a++){var r=i[a];try{if(r.getAttribute("data-fp-omit")!==null)continue;if(r._flatpickr!==undefined){r._flatpickr.destroy();r._flatpickr=undefined}r._flatpickr=FlatpickrInstance(r,t||{});n.push(r._flatpickr)}catch(e){console.error(e)}}return n.length===1?n[0]:n}if(typeof HTMLElement!=="undefined"&&typeof HTMLCollection!=="undefined"&&typeof NodeList!=="undefined"){HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return _flatpickr(this,e)};HTMLElement.prototype.flatpickr=function(e){return _flatpickr([this],e)}}var flatpickr=function(e,t){if(typeof e==="string"){return _flatpickr(window.document.querySelectorAll(e),t)}else if(e instanceof Node){return _flatpickr([e],t)}else{return _flatpickr(e,t)}};flatpickr.defaultConfig={};flatpickr.l10ns={en:__assign({},english),default:__assign({},english)};flatpickr.localize=function(e){flatpickr.l10ns.default=__assign(__assign({},flatpickr.l10ns.default),e)};flatpickr.setDefaults=function(e){flatpickr.defaultConfig=__assign(__assign({},flatpickr.defaultConfig),e)};flatpickr.parseDate=createDateParser({});flatpickr.formatDate=createDateFormatter({});flatpickr.compareDates=compareDates;if(typeof jQuery!=="undefined"&&typeof jQuery.fn!=="undefined"){jQuery.fn.flatpickr=function(e){return _flatpickr(this,e)}}Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof e==="string"?parseInt(e,10):e))};if(typeof window!=="undefined"){window.flatpickr=flatpickr}var sallaDatetimePickerCss='.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:\'\';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}';var SallaDatetimePicker=function(){function e(e){registerInstance(this,e);this.picked=createEvent(this,"picked",7);this.invalidInput=createEvent(this,"invalidInput",7);this.value=null;this.required=undefined;this.name=undefined;this.placeholder=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time");this.allowInput=true;this.allowInvalidPreload=false;this.altFormat="F j, Y";this.altInput=false;this.altInputClass=undefined;this.appendTo=undefined;this.ariaDateFormat="F j, Y";this.autoFillDefaultTime=true;this.clickOpens=true;this.closeOnSelect=true;this.conjunction=undefined;this.dateFormat="Y-m-d";this.defaultDate=undefined;this.defaultHour=12;this.defaultMinute=0;this.defaultSeconds=0;this.disable=[];this.disableMobile=false;this.enable=[function(e){return true}];this.enableSeconds=false;this.enableTime=false;this.formatDate=undefined;this.hourIncrement=1;this.inline=false;this.locale="en";this.maxDate=null;this.maxTime=null;this.minDate=null;this.minTime=null;this.minuteIncrement=5;this.mode="single";this.monthSelectorType="dropdown";this.nextArrow='<span class="sicon-keyboard_arrow_right"></span>';this.noCalendar=false;this.dateParser=undefined;this.position="auto";this.positionElement=undefined;this.prevArrow='<span class="sicon-keyboard_arrow_left"></span>';this.shorthandCurrentMonth=false;this.static=false;this.showMonths=1;this.time_24hr=false;this.weekNumbers=false;this.wrap=false}e.prototype.render=function(){var e=this;return h("div",{class:"s-datetime-picker"},h("input",{type:"datetime",name:this.name,value:this.value,required:this.required,placeholder:this.placeholder,class:"s-datetime-picker-input",ref:function(t){return e.dateInput=t}}))};e.prototype.componentDidLoad=function(){var e=this;var t={allowInput:this.allowInput,allowInvalidPreload:this.allowInvalidPreload,altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,appendTo:this.appendTo,ariaDateFormat:this.ariaDateFormat,autoFillDefaultTime:this.autoFillDefaultTime,clickOpens:this.clickOpens,closeOnSelect:this.closeOnSelect,conjunction:this.conjunction,dateFormat:this.dateFormat,defaultDate:!!this.value?Date.parse(this.value):this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,defaultSeconds:this.defaultSeconds,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableSeconds:this.enableSeconds,enableTime:this.enableTime,formatDate:this.formatDate,hourIncrement:this.hourIncrement,inline:this.inline,locale:this.locale,maxDate:this.maxDate,maxTime:this.maxTime,minDate:this.minDate,minTime:this.minTime,minuteIncrement:this.minuteIncrement,mode:this.mode,monthSelectorType:this.monthSelectorType,nextArrow:this.nextArrow,noCalendar:this.noCalendar,parseDate:this.dateParser,position:this.position,positionElement:this.positionElement,prevArrow:this.prevArrow,shorthandCurrentMonth:this.shorthandCurrentMonth,static:this.static,showMonths:this.showMonths,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,onChange:function(t,i){return e.picked.emit(e.value=i)}};flatpickr(this.dateInput,t);this.dateInput.addEventListener("invalid",(function(t){e.invalidInput.emit(t)}));this.dateInput.addEventListener("input",(function(){e.dateInput.setCustomValidity("");e.dateInput.reportValidity()}))};return e}();SallaDatetimePicker.style=sallaDatetimePickerCss;var filepond=createCommonjsModule((function(e,t){
|
|
11
|
+
*/var classCallCheck=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}};var createClass=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}return function(t,i,n){if(i)e(t.prototype,i);if(n)e(t,n);return t}}();var slicedToArray=function(){function e(e,t){var i=[];var n=true;var a=false;var r=undefined;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done);n=true){i.push(s.value);if(t&&i.length===t)break}}catch(e){a=true;r=e}finally{try{if(!n&&o["return"])o["return"]()}finally{if(a)throw r}}return i}return function(t,i){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,i)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();String.prototype.startsWith=String.prototype.startsWith||function(e){return this.indexOf(e)===0};String.prototype.padStart=String.prototype.padStart||function(e,t){var i=this;while(i.length<e){i=t+i}return i};var colorNames={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function printNum(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var i=t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString();return i||"0"}var Color=function(){function e(t,i,n,a){classCallCheck(this,e);var r=this;function o(t){if(t.startsWith("hsl")){var i=t.match(/([\-\d\.e]+)/g).map(Number),n=slicedToArray(i,4),a=n[0],o=n[1],s=n[2],l=n[3];if(l===undefined){l=1}a/=360;o/=100;s/=100;r.hsla=[a,o,s,l]}else if(t.startsWith("rgb")){var c=t.match(/([\-\d\.e]+)/g).map(Number),u=slicedToArray(c,4),d=u[0],p=u[1],h=u[2],f=u[3];if(f===undefined){f=1}r.rgba=[d,p,h,f]}else{if(t.startsWith("#")){r.rgba=e.hexToRgb(t)}else{r.rgba=e.nameToRgb(t)||e.hexToRgb(t)}}}if(t===undefined);else if(Array.isArray(t)){this.rgba=t}else if(n===undefined){var s=t&&""+t;if(s){o(s.toLowerCase())}}else{this.rgba=[t,i,n,a===undefined?1:a]}}createClass(e,[{key:"printRGB",value:function e(t){var i=t?this.rgba:this.rgba.slice(0,3),n=i.map((function(e,t){return printNum(e,t===3?3:0)}));return t?"rgba("+n+")":"rgb("+n+")"}},{key:"printHSL",value:function e(t){var i=[360,100,100,1],n=["","%","%",""];var a=t?this.hsla:this.hsla.slice(0,3),r=a.map((function(e,t){return printNum(e*i[t],t===3?3:1)+n[t]}));return t?"hsla("+r+")":"hsl("+r+")"}},{key:"printHex",value:function e(t){var i=this.hex;return t?i:i.substring(0,7)}},{key:"rgba",get:function t(){if(this._rgba){return this._rgba}if(!this._hsla){throw new Error("No color is set")}return this._rgba=e.hslToRgb(this._hsla)},set:function e(t){if(t.length===3){t[3]=1}this._rgba=t;this._hsla=null}},{key:"rgbString",get:function e(){return this.printRGB()}},{key:"rgbaString",get:function e(){return this.printRGB(true)}},{key:"hsla",get:function t(){if(this._hsla){return this._hsla}if(!this._rgba){throw new Error("No color is set")}return this._hsla=e.rgbToHsl(this._rgba)},set:function e(t){if(t.length===3){t[3]=1}this._hsla=t;this._rgba=null}},{key:"hslString",get:function e(){return this.printHSL()}},{key:"hslaString",get:function e(){return this.printHSL(true)}},{key:"hex",get:function e(){var t=this.rgba,i=t.map((function(e,t){return t<3?e.toString(16):Math.round(e*255).toString(16)}));return"#"+i.map((function(e){return e.padStart(2,"0")})).join("")},set:function t(i){this.rgba=e.hexToRgb(i)}}],[{key:"hexToRgb",value:function e(t){var i=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!i.match(/^([0-9a-fA-F]{8})$/)){throw new Error("Unknown hex color; "+t)}var n=i.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));n[3]=n[3]/255;return n}},{key:"nameToRgb",value:function t(i){var n=i.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),a=colorNames[n];return a===undefined?a:e.hexToRgb(a.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function e(t){var i=slicedToArray(t,4),n=i[0],a=i[1],r=i[2],o=i[3];n/=255;a/=255;r/=255;var s=Math.max(n,a,r),l=Math.min(n,a,r);var c=void 0,u=void 0,d=(s+l)/2;if(s===l){c=u=0}else{var p=s-l;u=d>.5?p/(2-s-l):p/(s+l);switch(s){case n:c=(a-r)/p+(a<r?6:0);break;case a:c=(r-n)/p+2;break;case r:c=(n-a)/p+4;break}c/=6}return[c,u,d,o]}},{key:"hslToRgb",value:function e(t){var i=slicedToArray(t,4),n=i[0],a=i[1],r=i[2],o=i[3];var s=void 0,l=void 0,c=void 0;if(a===0){s=l=c=r}else{var u=function e(t,i,n){if(n<0)n+=1;if(n>1)n-=1;if(n<1/6)return t+(i-t)*6*n;if(n<1/2)return i;if(n<2/3)return t+(i-t)*(2/3-n)*6;return t};var d=r<.5?r*(1+a):r+a-r*a,p=2*r-d;s=u(p,d,n+1/3);l=u(p,d,n);c=u(p,d,n-1/3)}var h=[s*255,l*255,c*255].map(Math.round);h[3]=o;return h}}]);return e}();var EventBucket=function(){function e(){classCallCheck(this,e);this._events=[]}createClass(e,[{key:"add",value:function e(t,i,n){t.addEventListener(i,n,false);this._events.push({target:t,type:i,handler:n})}},{key:"remove",value:function t(i,n,a){this._events=this._events.filter((function(t){var r=true;if(i&&i!==t.target){r=false}if(n&&n!==t.type){r=false}if(a&&a!==t.handler){r=false}if(r){e._doRemove(t.target,t.type,t.handler)}return!r}))}},{key:"destroy",value:function t(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)}));this._events=[]}}],[{key:"_doRemove",value:function e(t,i,n){t.removeEventListener(i,n,false)}}]);return e}();function parseHTML(e){var t=document.createElement("div");t.innerHTML=e;return t.firstElementChild}function dragTrack(e,t,i){var n=false;function a(e,t,i){return Math.max(t,Math.min(e,i))}function r(e,r,o){if(o){n=true}if(!n){return}e.preventDefault();var s=t.getBoundingClientRect(),l=s.width,c=s.height,u=r.clientX,d=r.clientY;var p=a(u-s.left,0,l),h=a(d-s.top,0,c);i(p/l,h/c)}function o(e,t){var i=e.buttons===undefined?e.which:e.buttons;if(i===1){r(e,e,t)}else{n=false}}function s(e,t){if(e.touches.length===1){r(e,e.touches[0],t)}else{n=false}}e.add(t,"mousedown",(function(e){o(e,true)}));e.add(t,"touchstart",(function(e){s(e,true)}));e.add(window,"mousemove",o);e.add(t,"touchmove",s);e.add(window,"mouseup",(function(e){n=false}));e.add(t,"touchend",(function(e){n=false}));e.add(t,"touchcancel",(function(e){n=false}))}var BG_TRANSP="linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em";var HUES=360;var EVENT_KEY="keydown",EVENT_CLICK_OUTSIDE="mousedown",EVENT_TAB_MOVE="focusin";function $$1(e,t){return(t||document).querySelector(e)}function stopEvent(e){e.preventDefault();e.stopPropagation()}function onKey(e,t,i,n,a){e.add(t,EVENT_KEY,(function(e){if(i.indexOf(e.key)>=0){if(a){stopEvent(e)}n(e)}}))}var Picker=function(){function e(t){classCallCheck(this,e);this.settings={popup:"right",layout:"default",alpha:true,editor:true,editorFormat:"hex",cancelButton:false,defaultColor:"#0cf"};this._events=new EventBucket;this.onChange=null;this.onDone=null;this.onOpen=null;this.onClose=null;this.setOptions(t)}createClass(e,[{key:"setOptions",value:function e(t){var i=this;if(!t){return}var n=this.settings;function a(e,t,i){for(var n in e){if(i&&i.indexOf(n)>=0){continue}t[n]=e[n]}}if(t instanceof HTMLElement){n.parent=t}else{if(n.parent&&t.parent&&n.parent!==t.parent){this._events.remove(n.parent);this._popupInited=false}a(t,n);if(t.onChange){this.onChange=t.onChange}if(t.onDone){this.onDone=t.onDone}if(t.onOpen){this.onOpen=t.onOpen}if(t.onClose){this.onClose=t.onClose}var r=t.color||t.colour;if(r){this._setColor(r)}}var o=n.parent;if(o&&n.popup&&!this._popupInited){var s=function e(t){return i.openHandler(t)};this._events.add(o,"click",s);onKey(this._events,o,[" ","Spacebar","Enter"],s);this._popupInited=true}else if(t.parent&&!n.popup){this.show()}}},{key:"openHandler",value:function e(t){if(this.show()){t&&t.preventDefault();this.settings.parent.style.pointerEvents="none";var i=t&&t.type===EVENT_KEY?this._domEdit:this.domElement;setTimeout((function(){return i.focus()}),100);if(this.onOpen){this.onOpen(this.colour)}}}},{key:"closeHandler",value:function e(t){var i=t&&t.type;var n=false;if(!t){n=true}else if(i===EVENT_CLICK_OUTSIDE||i===EVENT_TAB_MOVE){var a=(this.__containedEvent||0)+100;if(t.timeStamp>a){n=true}}else{stopEvent(t);n=true}if(n&&this.hide()){this.settings.parent.style.pointerEvents="";if(i!==EVENT_CLICK_OUTSIDE){this.settings.parent.focus()}if(this.onClose){this.onClose(this.colour)}}}},{key:"movePopup",value:function e(t,i){this.closeHandler();this.setOptions(t);if(i){this.openHandler()}}},{key:"setColor",value:function e(t,i){this._setColor(t,{silent:i})}},{key:"_setColor",value:function e(t,i){if(typeof t==="string"){t=t.trim()}if(!t){return}i=i||{};var n=void 0;try{n=new Color(t)}catch(e){if(i.failSilently){return}throw e}if(!this.settings.alpha){var a=n.hsla;a[3]=1;n.hsla=a}this.colour=this.color=n;this._setHSLA(null,null,null,null,i)}},{key:"setColour",value:function e(t,i){this.setColor(t,i)}},{key:"show",value:function e(){var t=this.settings.parent;if(!t){return false}if(this.domElement){var i=this._toggleDOM(true);this._setPosition();return i}var n=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>';var a=parseHTML(n);this.domElement=a;this._domH=$$1(".picker_hue",a);this._domSL=$$1(".picker_sl",a);this._domA=$$1(".picker_alpha",a);this._domEdit=$$1(".picker_editor input",a);this._domSample=$$1(".picker_sample",a);this._domOkay=$$1(".picker_done button",a);this._domCancel=$$1(".picker_cancel button",a);a.classList.add("layout_"+this.settings.layout);if(!this.settings.alpha){a.classList.add("no_alpha")}if(!this.settings.editor){a.classList.add("no_editor")}if(!this.settings.cancelButton){a.classList.add("no_cancel")}this._ifPopup((function(){return a.classList.add("popup")}));this._setPosition();if(this.colour){this._updateUI()}else{this._setColor(this.settings.defaultColor)}this._bindEvents();return true}},{key:"hide",value:function e(){return this._toggleDOM(false)}},{key:"destroy",value:function e(){this._events.destroy();if(this.domElement){this.settings.parent.removeChild(this.domElement)}}},{key:"_bindEvents",value:function e(){var t=this;var i=this,n=this.domElement,a=this._events;function r(e,t,i){a.add(e,t,i)}r(n,"click",(function(e){return e.preventDefault()}));dragTrack(a,this._domH,(function(e,t){return i._setHSLA(e)}));dragTrack(a,this._domSL,(function(e,t){return i._setHSLA(null,e,1-t)}));if(this.settings.alpha){dragTrack(a,this._domA,(function(e,t){return i._setHSLA(null,null,null,1-t)}))}var o=this._domEdit;{r(o,"input",(function(e){i._setColor(this.value,{fromEditor:true,failSilently:true})}));r(o,"focus",(function(e){var t=this;if(t.selectionStart===t.selectionEnd){t.select()}}))}this._ifPopup((function(){var e=function e(i){return t.closeHandler(i)};r(window,EVENT_CLICK_OUTSIDE,e);r(window,EVENT_TAB_MOVE,e);onKey(a,n,["Esc","Escape"],e);var i=function e(i){t.__containedEvent=i.timeStamp};r(n,EVENT_CLICK_OUTSIDE,i);r(n,EVENT_TAB_MOVE,i);r(t._domCancel,"click",e)}));var s=function e(i){t._ifPopup((function(){return t.closeHandler(i)}));if(t.onDone){t.onDone(t.colour)}};r(this._domOkay,"click",s);onKey(a,n,["Enter"],s)}},{key:"_setPosition",value:function e(){var t=this.settings.parent,i=this.domElement;if(t!==i.parentNode){t.appendChild(i)}this._ifPopup((function(e){if(getComputedStyle(t).position==="static"){t.style.position="relative"}var n=e===true?"popup_right":"popup_"+e;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){if(e===n){i.classList.add(e)}else{i.classList.remove(e)}}));i.classList.add(n)}))}},{key:"_setHSLA",value:function e(t,i,n,a,r){r=r||{};var o=this.colour,s=o.hsla;[t,i,n,a].forEach((function(e,t){if(e||e===0){s[t]=e}}));o.hsla=s;this._updateUI(r);if(this.onChange&&!r.silent){this.onChange(o)}}},{key:"_updateUI",value:function e(t){if(!this.domElement){return}t=t||{};var i=this.colour,n=i.hsla,a="hsl("+n[0]*HUES+", 100%, 50%)",r=i.hslString,o=i.hslaString;var s=this._domH,l=this._domSL,c=this._domA,u=$$1(".picker_selector",s),d=$$1(".picker_selector",l),p=$$1(".picker_selector",c);function h(e,t,i){t.style.left=i*100+"%"}function f(e,t,i){t.style.top=i*100+"%"}h(s,u,n[0]);this._domSL.style.backgroundColor=this._domH.style.color=a;h(l,d,n[1]);f(l,d,1-n[2]);l.style.color=r;f(c,p,1-n[3]);var g=r,m=g.replace("hsl","hsla").replace(")",", 0)"),v="linear-gradient("+[g,m]+")";this._domA.style.background=v+", "+BG_TRANSP;if(!t.fromEditor){var _=this.settings.editorFormat,b=this.settings.alpha;var y=void 0;switch(_){case"rgb":y=i.printRGB(b);break;case"hsl":y=i.printHSL(b);break;default:y=i.printHex(b)}this._domEdit.value=y}this._domSample.style.color=o}},{key:"_ifPopup",value:function e(t,i){if(this.settings.parent&&this.settings.popup){t&&t(this.settings.popup)}else{i&&i()}}},{key:"_toggleDOM",value:function e(t){var i=this.domElement;if(!i){return false}var n=t?"":"none",a=i.style.display!==n;if(a){i.style.display=n}return a}}]);return e}();{var style=document.createElement("style");style.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}';document.documentElement.firstElementChild.appendChild(style);Picker.StyleElement=style}var ArrowDown='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_down</title>\n<path d="M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z"></path>\n</svg>\n';var sallaColorPickerCss="";var SallaColorPicker=function(){function e(e){registerInstance(this,e);this.colorChanged=createEvent(this,"colorChanged",7);this.invalidInput=createEvent(this,"invalidInput",7);this.submitted=createEvent(this,"submitted",7);this.popupOpened=createEvent(this,"popupOpened",7);this.popupClosed=createEvent(this,"popupClosed",7);this.widgetColor=undefined;this.name="color";this.required=false;this.color=undefined;this.format="hex";this.showCancelButton=false;this.showTextField=true;this.enableAlpha=false}e.prototype.colorChangeHandler=function(e){this.colorInput.value=e.hex;this.colorChanged.emit(e)};e.prototype.submittedHandler=function(e){this.setColorValue(e.rgbaString,true);this.canvas.style.backgroundColor=e.rgbString;this.colorInput.value=e.hex;this.colorInput.dispatchEvent(new window.Event("change",{bubbles:true}));this.submitted.emit(e)};e.prototype.popupOpenedHandler=function(e){this.setPopInPosition();this.popupOpened.emit(e)};e.prototype.popupClosedHandler=function(e){this.popupClosed.emit(e)};e.prototype.setPickerOption=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.picker.setOptions(e);return[2]}))}))};e.prototype.movePopUp=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.picker.movePopup(e,t);return[2]}))}))};e.prototype.setColorValue=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.picker.setColor(e,t);return[2]}))}))};e.prototype.openPicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.show();return[2]}))}))};e.prototype.closePicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.hide();return[2]}))}))};e.prototype.destroyPicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.destroy();return[2]}))}))};e.prototype.componentWillLoad=function(){var e=this;salla.onReady((function(){e.color=e.color?e.color:salla.config.get("theme.color.primary","#5dd5c4")}))};e.prototype.setPopInPosition=function(){var e=this.host.querySelector(".picker_wrapper");var t=this.host.querySelector(".s-color-picker-widget").getBoundingClientRect();var i=window.innerWidth/2-t.width/2;var n=i>t.x;var a=i<t.x;var r=i===t.x;var o=window.innerWidth<768;if(o&&n){e.style.left="0"}if(o&&a){e.style.left="auto"}if(!o||o&&(!a&&!n||r)){e.style.left="-95px"}};e.prototype.initColorPicker=function(){var e=this;this.picker=new Picker({parent:this.host,color:this.color,popup:"bottom",alpha:this.enableAlpha,editor:this.showTextField,editorFormat:this.format,cancelButton:this.showCancelButton,onChange:function(t){return e.colorChangeHandler(t)},onDone:function(t){return e.submittedHandler(t)},onOpen:function(t){return e.popupOpenedHandler(t)},onClose:function(t){return e.popupClosedHandler(t)}})};e.prototype.render=function(){var e=this;return h(Host,{class:"s-color-picker-main"},h("slot",{name:"widget"},h("div",{class:"s-color-picker-widget"},h("div",{class:"s-color-picker-widget-canvas",ref:function(t){return e.canvas=t}}),h("span",{innerHTML:ArrowDown}))),h("input",{class:"s-hidden",name:this.name,required:this.required,value:this.color,ref:function(t){return e.colorInput=t}}))};e.prototype.componentDidLoad=function(){var e=this;this.canvas.style.backgroundColor=this.color;this.initColorPicker();this.colorInput.addEventListener("invalid",(function(t){e.invalidInput.emit(t)}));this.colorInput.addEventListener("input",(function(){e.colorInput.setCustomValidity("");e.colorInput.reportValidity()}))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaColorPicker.style=sallaColorPickerCss;var sallaCommentFormCss=":host{display:block}";var SallaCommentForm=function(){function e(e){var t=this;registerInstance(this,e);this.type=undefined;this.showAvatar=undefined;this.itemId=undefined;this.placeholder=salla.lang.get("blocks.comments.placeholder");this.submitText=salla.lang.get("blocks.comments.submit");this.canComment=undefined;salla.lang.onLoaded((function(){t.placeholder=salla.lang.get("blocks.comments.placeholder");t.submitText=salla.lang.get("blocks.comments.submit")}));salla.onReady((function(){t.canComment=salla.config.get("user.can_comment");t.itemId=salla.config.get("page.id");t.type=salla.url.is_page("page-single")?"page":"product"}))}e.prototype.submit=function(){var e=this;if(!this.commentForm.reportValidity()){salla.log("CommentForm:: validation error!");return}this.submitBtn.load().then((function(){return salla.comment.add({id:e.itemId,comment:e.commentField.value,type:e.type})})).finally((function(){return e.submitBtn.stop}))};e.prototype.render=function(){var e=this;return h(Host,null,!!this.canComment?h("form",{ref:function(t){return e.commentForm=t}},h("div",{class:"s-comment-form-wrapper"},this.showAvatar?h("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",h("div",{class:"s-comment-form-content"},h("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:function(t){return e.commentField=t},placeholder:this.placeholder,class:"s-comment-form-input",required:true}),h("br",null),h("div",{class:"s-comment-form-action"},h("salla-button",{ref:function(t){return e.submitBtn=t},"loader-position":"center",onClick:function(){return e.submit()}},this.submitText))))):"")};return e}();SallaCommentForm.style=sallaCommentFormCss;var Reply='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>reply</title>\n<path d="M20 14.667h-12.609l9.401-6.927c0.592-0.436 0.72-1.271 0.283-1.863-0.439-0.595-1.273-0.72-1.864-0.283l-12.667 9.333c-0.343 0.251-0.544 0.649-0.544 1.072s0.201 0.821 0.543 1.073l12.667 9.333c0.237 0.176 0.515 0.26 0.789 0.26 0.409 0 0.813-0.188 1.075-0.543 0.437-0.592 0.309-1.427-0.283-1.863l-9.4-6.928h12.609c4.412 0 8 3.588 8 8 0 0.737 0.597 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-5.881-4.785-10.667-10.667-10.667z"></path>\n</svg>\n';var sallaCommentsCss$1=":host{display:block}";var SallaCommentItem=function(){function e(e){var t=this;registerInstance(this,e);this.comment=undefined;this.has_bought_trans=salla.lang.get("blocks.comments.has_bought");this.rated_trans=salla.lang.get("pages.rating.rated");this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval");this.has_order_trans=salla.lang.get("blocks.comments.has_order");salla.lang.onLoaded((function(){t.has_bought_trans=salla.lang.get("blocks.comments.has_bought");t.rated_trans=salla.lang.get("pages.rating.rated");t.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval");t.has_order_trans=salla.lang.get("blocks.comments.has_order")}))}e.prototype.getReplies=function(){return Array.isArray(this.comment.replies)?this.comment.replies:[this.comment.replies]};e.prototype.getDate=function(e){var t=e.split(" ")[0];var i=t.split("-"),n=i[0],a=i[1],r=i[2];var o="".concat(parseInt(a,10),"/").concat(parseInt(r,10),"/").concat(parseInt(n,10));return o};e.prototype.getTime=function(e){var t=e.split(" "),i=t[1];var n=i.split(":"),a=n[0],r=n[1];var o="".concat(parseInt(a,10),":").concat(parseInt(r,10));return o};e.prototype.render=function(){var e,t,i,n,a,r;var o=this.comment.type=="admin";return h(Host,{class:o?"s-comments-item-admin":"s-comments-item"},h("div",{class:{"s-comments-item-wrapper":!o,"s-comments-item-admin-wrapper":o},id:"s-comments-item-".concat(this.comment.id)},h("div",{class:"s-comments-item-inner s-comments-flex-1"},o&&h("span",{class:"s-comments-item-reply-icon",innerHTML:Reply}),h("div",{class:"s-comments-item-avatar"},h("img",{"data-src":(e=this.comment)===null||e===void 0?void 0:e.avatar,alt:(t=this.comment)===null||t===void 0?void 0:t.name,src:(i=this.comment)===null||i===void 0?void 0:i.avatar,class:"s-comments-item-avatar-img lazy"})),h("div",{class:"s-comments-flex-1"},h("div",{class:"s-comments-item-user-wrapper"},h("div",{class:"s-comments-item-user-info"},h("h3",{class:"s-comments-item-user-info-name"},(n=this.comment)===null||n===void 0?void 0:n.name),(this.comment.has_order||!!this.comment.rating)&&!this.comment.is_pending?h("div",{class:"s-comments-flex"},this.comment.has_order?[h("span",{class:"s-comments-item-has-order-check-icon",innerHTML:CheckCircleIcon}),h("span",{class:"s-comments-item-has-order-check-text"},this.has_bought_trans," ",this.comment.rating?", ":"")]:null,!!this.comment.rating?h("span",{class:"s-comments-item-rated-widget"},this.rated_trans):null):null),h("p",{class:"s-comments-item-timestamp s-ltr"}," ",this.getDate((a=this.comment.created_at)===null||a===void 0?void 0:a.date)," ",h("span",{class:"s-comments-item-time"}," - ",this.getTime((r=this.comment.created_at)===null||r===void 0?void 0:r.date)," ")),!!this.comment.rating?h("salla-rating-stars",{size:"mini",class:"s-comments-item-stars",value:this.comment.rating}):null),h("div",{class:"s-comments-item-content"},h("p",{innerHTML:this.comment.content}),this.comment.is_pending?h("span",{class:"s-comments-item-pending-text"},this.waiting_approval_trans):null))),!!this.getReplies().length&&!o?this.getReplies().map((function(e){return h("div",null,h("salla-comment-item",{comment:e}))})):null))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaCommentItem.style=sallaCommentsCss$1;var CommentType;(function(e){e["PAGE"]="page";e["PRODUCT"]="product"})(CommentType||(CommentType={}));var sallaCommentsCss=":host{display:block}";var SallaComments=function(){function e(e){var t=this;registerInstance(this,e);this.itemId=undefined;this.loadMoreText=undefined;this.hideForm=undefined;this.blockTitle=undefined;this.hideTitle=undefined;this.type=CommentType.PAGE;this.showFormAvatar=false;this.comments=undefined;this.pagination=undefined;this.total=undefined;this.showPlaceholder=undefined;this.nextPage=undefined;this.noComments=salla.lang.get("blocks.comments.no_comments");this.comment_title=salla.lang.get("blocks.comments.title");this.comment_name=salla.lang.get("blocks.comments.comment");this.placeholder_text=undefined;salla.lang.onLoaded((function(){t.comment_title=salla.lang.get("blocks.comments.title");t.comment_name=salla.lang.get("blocks.comments.comment");t.noComments=salla.lang.get("pages.rating.no_ratings")}))}e.prototype.pluralize=function(e,t){var i=e.split("|");var n=[{condition:t===0,index:0},{condition:t===1,index:1},{condition:t===2,index:2},{condition:t>2&&t<=10,index:3},{condition:t>=11,index:4}];var a=(n.find((function(e){var t=e.condition;return t}))||{index:i.length-1}).index;var r=i[a];return r.replace(":count",salla.helpers.number(t.toString())).replace(/\{[0-9]+\}/g,"").replace(/\[\d+,\d+\]|\[11,\*\]/g,"")};e.prototype.initiateInfiniteScroll=function(){var e=this;var t,i,n;if(!this.wrapper){console.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){return e.nextPage},history:true,nextPage:this.nextPage,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(function(t){e.loading()}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("load",(function(t){e.pagination=t.pagination;e.nextPage=typeof t.pagination.links=="object"&&!!t.pagination.links.next?t.pagination.links.next:null;e.handleResponse(t).forEach((function(t){return e.wrapper.append(t)}));var i=e.host.querySelectorAll("salla-comment-item:not(.animated):not(.s-comments-item-admin)");e.animateItems(i);e.loading(false)}));(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("error",(function(e){salla.console.error("Error loading more comments:",e)}))};e.prototype.loading=function(e){if(e===void 0){e=true}var t;var i=(t=this.status)===null||t===void 0?void 0:t.querySelector(".s-button-text");if(i){Helper.toggleElementClassIf(i,"s-button-hide","s-button-show",(function(){return e}));this.btnLoader.style.display=e?"inherit":"none"}};e.prototype.animateItems=function(e){anime({targets:e,opacity:[0,1],duration:1200,translateY:[20,0],delay:function(e,t){return t*100},easing:"easeOutExpo",complete:function(t){e.forEach((function(e){e.classList.add("animated")}))}})};e.prototype.getCommentHTML=function(e){var t=document.createElement("salla-comment-item");t.comment=e;return t};e.prototype.handleResponse=function(e){var t=this;var i;return((i=e.data)===null||i===void 0?void 0:i.map((function(e){return t.getCommentHTML(e)})))||[]};e.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;var i=this;return __generator(this,(function(n){switch(n.label){case 0:this.loading();n.label=1;case 1:n.trys.push([1,3,,4]);return[4,this.type==CommentType.PAGE?salla.api.comment.getPageComments(this.itemId):salla.api.comment.getProductComments(this.itemId)];case 2:e=n.sent();if(!e.data||!e.data.length){this.showPlaceholder=false;this.loading(false);return[2]}this.comments=e.data;this.pagination=e.pagination;this.total=e.pagination.total;this.nextPage=typeof e.pagination.links=="object"&&!!e.pagination.links.next?e.pagination.links.next:null;setTimeout((function(){i.handleResponse(e).forEach((function(e){return i.wrapper.append(e)}));i.initiateInfiniteScroll();var t=i.wrapper.querySelectorAll("salla-comment-item:not(.animated)");i.animateItems(t)}),100);return[3,4];case 3:t=n.sent();console.error("Error loading initial data:",t);this.showPlaceholder=true;this.loading(false);return[3,4];case 4:return[2]}}))}))};e.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){(e=this.infiniteScroll)===null||e===void 0?void 0:e.loadNextPage();return[2]}))}))};e.prototype.render=function(){var e=this;if(this.showPlaceholder){return h("div",null,!!this.total&&!this.hideTitle?h("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&h("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),h("div",{class:"no-content-placeholder--comments"},h("i",{class:"sicon-chat-bubbles text-5xl block mb-5 text-gray-400"}),h("p",{class:"text-sm"},this.noComments)))}return h("div",{class:"s-comments s-comments-".concat(this.type)},h("div",{class:"".concat(this.type==CommentType.PAGE?"s-comments-page-container":"s-comments-container")},!!this.total&&!this.hideTitle?h("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&h("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),!!this.total&&h("h2",{class:"s-comments-count-label",innerHTML:this.pluralize(this.comment_name,this.total)}),h("div",{ref:function(t){return e.wrapper=t}}),this.nextPage&&h("div",{class:"s-infinite-scroll-wrapper",ref:function(t){return e.status=t}},h("button",{onClick:function(){return e.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary"},h("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),h("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(t){return e.btnLoader=t},style:{display:"none"}})))))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.loadInitialData()];case 1:e.sent();return[2]}}))}))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaComments.style=sallaCommentsCss;var sallaCountDownCss="";var SallaCountDown=function(){function e(e){var t=this;registerInstance(this,e);this.date=undefined;this.boxed=undefined;this.size="md";this.color="dark";this.labeled=undefined;this.endText=undefined;this.digits="auto";this.endOfDay=undefined;this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم");this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة");this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة");this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية");this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض");this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح");this.offerEnded=false;this.countInterval=undefined;this.days=undefined;this.hours=undefined;this.minutes=undefined;this.seconds=undefined;this.days=this.number(0);this.hours=this.number(0);this.minutes=this.number(0);this.seconds=this.number(0);salla.lang.onLoaded((function(){t.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم");t.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة");t.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة");t.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح");t.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية");t.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")}));if(this.date&&this.isValidDate(this.date)){this.startCountDown()}}e.prototype.endCountDown=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){clearInterval(this.countInterval);this.offerEnded=true;this.days=this.number(0);this.hours=this.number(0);this.minutes=this.number(0);this.seconds=this.number(0);return[2]}))}))};e.prototype.isValidDate=function(e){var t=e.includes("-"),i=e.split(" "),n;if(t){n=i[0].replace(/-/g,"/")}else{n=i[0]}return!isNaN(Date.parse(n))};e.prototype.number=function(e){return salla.helpers.number(e,this.digits==="en")};e.prototype.startCountDown=function(){var e=this;var t=new Date(this.date.replace(/-/g,"/"));if(this.endOfDay||this.date.split(" ").length===1){t.setHours(23,59,59,999)}var i=t.getTime();this.countInterval=setInterval((function(){var t=(new Date).getTime();var n=i-t;e.days=e.number(Math.floor(n/(1e3*60*60*24)));e.hours=e.number(Math.floor(n%(1e3*60*60*24)/(1e3*60*60)));e.minutes=e.number(Math.floor(n%(1e3*60*60)/(1e3*60)));e.seconds=e.number(Math.floor(n%(1e3*60)/1e3));if(n<0){e.endCountDown()}}),1e3)};e.prototype.render=function(){if(!this.date){return""}else if(this.date&&!this.isValidDate(this.date)){return h("div",{class:"s-count-down-text-center"},this.invalidDate)}return h(Host,{class:"s-count-down-wrapper"},h("ul",{class:"s-count-down-list ".concat(this.boxed?"s-count-down-boxed":""," ").concat(this.offerEnded?"s-count-down-ended":""," s-count-down-").concat(this.size," s-count-down-").concat(this.color)},h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&h("div",{class:"s-count-down-item-label"},this.secondsLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&h("div",{class:"s-count-down-item-label"},this.minutesLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&h("div",{class:"s-count-down-item-label"},this.hoursLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.days),this.labeled&&h("div",{class:"s-count-down-item-label"},this.daysLabel))),this.offerEnded&&h("div",{class:"s-count-down-end-text"},!!this.endText?this.endText:this.endLabel))};return e}();SallaCountDown.style=sallaCountDownCss;var HOOKS=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"];var defaults$1={_disable:[],allowInput:false,allowInvalidPreload:false,altFormat:"F j, Y",altInput:false,altInputClass:"form-control input",animate:typeof window==="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:true,clickOpens:true,closeOnSelect:true,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:false,enableSeconds:false,enableTime:false,errorHandler:function(e){return typeof console!=="undefined"&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0);t.setDate(t.getDate()+3-(t.getDay()+6)%7);var i=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:false,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:false,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:undefined,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:false,showMonths:1,static:false,time_24hr:false,weekNumbers:false,wrap:false};var english={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:false};var pad=function(e,t){if(t===void 0){t=2}return("000"+e).slice(t*-1)};var int=function(e){return e===true?1:0};function debounce(e,t){var i;return function(){var n=this;var a=arguments;clearTimeout(i);i=setTimeout((function(){return e.apply(n,a)}),t)}}var arrayify=function(e){return e instanceof Array?e:[e]};function toggleClass(e,t,i){if(i===true)return e.classList.add(t);e.classList.remove(t)}function createElement(e,t,i){var n=window.document.createElement(e);t=t||"";i=i||"";n.className=t;if(i!==undefined)n.textContent=i;return n}function clearNode(e){while(e.firstChild)e.removeChild(e.firstChild)}function findParent(e,t){if(t(e))return e;else if(e.parentNode)return findParent(e.parentNode,t);return undefined}function createNumberInput(e,t){var i=createElement("div","numInputWrapper"),n=createElement("input","numInput "+e),a=createElement("span","arrowUp"),r=createElement("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1){n.type="number"}else{n.type="text";n.pattern="\\d*"}if(t!==undefined)for(var o in t)n.setAttribute(o,t[o]);i.appendChild(n);i.appendChild(a);i.appendChild(r);return i}function getEventTarget(e){try{if(typeof e.composedPath==="function"){var t=e.composedPath();return t[0]}return e.target}catch(t){return e.target}}var doNothing=function(){return undefined};var monthToStr=function(e,t,i){return i.months[t?"shorthand":"longhand"][e]};var revFormat={D:doNothing,F:function(e,t,i){e.setMonth(i.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,i){e.setHours(e.getHours()%12+12*int(new RegExp(i.amPM[1],"i").test(t)))},M:function(e,t,i){e.setMonth(i.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(parseFloat(t)*1e3)},W:function(e,t,i){var n=parseInt(t);var a=new Date(e.getFullYear(),0,2+(n-1)*7,0,0,0,0);a.setDate(a.getDate()-a.getDay()+i.firstDayOfWeek);return a},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:doNothing,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:doNothing,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}};var tokenRegex={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"};var formats={Z:function(e){return e.toISOString()},D:function(e,t,i){return t.weekdays.shorthand[formats.w(e,t,i)]},F:function(e,t,i){return monthToStr(formats.n(e,t,i)-1,false,t)},G:function(e,t,i){return pad(formats.h(e,t,i))},H:function(e){return pad(e.getHours())},J:function(e,t){return t.ordinal!==undefined?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[int(e.getHours()>11)]},M:function(e,t){return monthToStr(e.getMonth(),true,t)},S:function(e){return pad(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,i){return i.getWeek(e)},Y:function(e){return pad(e.getFullYear(),4)},d:function(e){return pad(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return pad(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return pad(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}};var createDateFormatter=function(e){var t=e.config,i=t===void 0?defaults$1:t,n=e.l10n,a=n===void 0?english:n,r=e.isMobile,o=r===void 0?false:r;return function(e,t,n){var r=n||a;if(i.formatDate!==undefined&&!o){return i.formatDate(e,t,r)}return t.split("").map((function(t,n,a){return formats[t]&&a[n-1]!=="\\"?formats[t](e,r,i):t!=="\\"?t:""})).join("")}};var createDateParser=function(e){var t=e.config,i=t===void 0?defaults$1:t,n=e.l10n,a=n===void 0?english:n;return function(e,t,n,r){if(e!==0&&!e)return undefined;var o=r||a;var s;var l=e;if(e instanceof Date)s=new Date(e.getTime());else if(typeof e!=="string"&&e.toFixed!==undefined)s=new Date(e);else if(typeof e==="string"){var c=t||(i||defaults$1).dateFormat;var u=String(e).trim();if(u==="today"){s=new Date;n=true}else if(i&&i.parseDate){s=i.parseDate(e,c)}else if(/Z$/.test(u)||/GMT$/.test(u)){s=new Date(e)}else{var d=void 0,p=[];for(var h=0,f=0,g="";h<c.length;h++){var m=c[h];var v=m==="\\";var _=c[h-1]==="\\"||v;if(tokenRegex[m]&&!_){g+=tokenRegex[m];var b=new RegExp(g).exec(e);if(b&&(d=true)){p[m!=="Y"?"push":"unshift"]({fn:revFormat[m],val:b[++f]})}}else if(!v)g+="."}s=!i||!i.noCalendar?new Date((new Date).getFullYear(),0,1,0,0,0,0):new Date((new Date).setHours(0,0,0,0));p.forEach((function(e){var t=e.fn,i=e.val;return s=t(s,i,o)||s}));s=d?s:undefined}}if(!(s instanceof Date&&!isNaN(s.getTime()))){i.errorHandler(new Error("Invalid date provided: "+l));return undefined}if(n===true)s.setHours(0,0,0,0);return s}};function compareDates(e,t,i){if(i===void 0){i=true}if(i!==false){return new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0)}return e.getTime()-t.getTime()}var isBetween=function(e,t,i){return e>Math.min(t,i)&&e<Math.max(t,i)};var calculateSecondsSinceMidnight=function(e,t,i){return e*3600+t*60+i};var parseSeconds=function(e){var t=Math.floor(e/3600),i=(e-t*3600)/60;return[t,i,e-t*3600-i*60]};var duration={DAY:864e5};function getDefaultHours(e){var t=e.defaultHour;var i=e.defaultMinute;var n=e.defaultSeconds;if(e.minDate!==undefined){var a=e.minDate.getHours();var r=e.minDate.getMinutes();var o=e.minDate.getSeconds();if(t<a){t=a}if(t===a&&i<r){i=r}if(t===a&&i===r&&n<o)n=e.minDate.getSeconds()}if(e.maxDate!==undefined){var s=e.maxDate.getHours();var l=e.maxDate.getMinutes();t=Math.min(t,s);if(t===s)i=Math.min(l,i);if(t===s&&i===l)n=e.maxDate.getSeconds()}return{hours:t,minutes:i,seconds:n}}if(typeof Object.assign!=="function"){Object.assign=function(e){var t=[];for(var i=1;i<arguments.length;i++){t[i-1]=arguments[i]}if(!e){throw TypeError("Cannot convert undefined or null to object")}var n=function(t){if(t){Object.keys(t).forEach((function(i){return e[i]=t[i]}))}};for(var a=0,r=t;a<r.length;a++){var o=r[a];n(o)}return e}}var __assign=undefined&&undefined.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};var __spreadArrays=undefined&&undefined.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<i;t++)for(var r=arguments[t],o=0,s=r.length;o<s;o++,a++)n[a]=r[o];return n};var DEBOUNCED_CHANGE_MS=300;function FlatpickrInstance(e,t){var i={config:__assign(__assign({},defaults$1),flatpickr.defaultConfig),l10n:english};i.parseDate=createDateParser({config:i.config,l10n:i.l10n});i._handlers=[];i.pluginElements=[];i.loadedPlugins=[];i._bind=g;i._setHoursFromDate=p;i._positionCalendar=te;i.changeMonth=F;i.changeYear=U;i.clear=G;i.close=z;i.onMouseOver=X;i._createElement=createElement;i.createDay=x;i.destroy=B;i.isEnabled=V;i.jumpToDate=_;i.updateValue=Ee;i.open=Z;i.redraw=ae;i.set=le;i.setDate=ue;i.toggle=me;function n(){i.utils={getDaysInMonth:function(e,t){if(e===void 0){e=i.currentMonth}if(t===void 0){t=i.currentYear}if(e===1&&(t%4===0&&t%100!==0||t%400===0))return 29;return i.l10n.daysInMonth[e]}}}function a(){i.element=i.input=e;i.isOpen=false;$();ee();he();pe();n();if(!i.isMobile)w();v();if(i.selectedDates.length||i.config.noCalendar){if(i.config.enableTime){p(i.config.noCalendar?i.latestSelectedDateObj:undefined)}Ee(false)}s();var t=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);if(!i.isMobile&&t){te()}ve("onReady")}function r(){var e;return((e=i.calendarContainer)===null||e===void 0?void 0:e.getRootNode()).activeElement||document.activeElement}function o(e){return e.bind(i)}function s(){var e=i.config;if(e.weekNumbers===false&&e.showMonths===1){return}else if(e.noCalendar!==true){window.requestAnimationFrame((function(){if(i.calendarContainer!==undefined){i.calendarContainer.style.visibility="hidden";i.calendarContainer.style.display="block"}if(i.daysContainer!==undefined){var t=(i.days.offsetWidth+1)*e.showMonths;i.daysContainer.style.width=t+"px";i.calendarContainer.style.width=t+(i.weekWrapper!==undefined?i.weekWrapper.offsetWidth:0)+"px";i.calendarContainer.style.removeProperty("visibility");i.calendarContainer.style.removeProperty("display")}}))}}function l(e){if(i.selectedDates.length===0){var t=i.config.minDate===undefined||compareDates(new Date,i.config.minDate)>=0?new Date:new Date(i.config.minDate.getTime());var n=getDefaultHours(i.config);t.setHours(n.hours,n.minutes,n.seconds,t.getMilliseconds());i.selectedDates=[t];i.latestSelectedDateObj=t}if(e!==undefined&&e.type!=="blur"){Ie(e)}var a=i._input.value;d();Ee();if(i._input.value!==a){i._debouncedChange()}}function c(e,t){return e%12+12*int(t===i.l10n.amPM[1])}function u(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}function d(){if(i.hourElement===undefined||i.minuteElement===undefined)return;var e=(parseInt(i.hourElement.value.slice(-2),10)||0)%24,t=(parseInt(i.minuteElement.value,10)||0)%60,n=i.secondElement!==undefined?(parseInt(i.secondElement.value,10)||0)%60:0;if(i.amPM!==undefined){e=c(e,i.amPM.textContent)}var a=i.config.minTime!==undefined||i.config.minDate&&i.minDateHasTime&&i.latestSelectedDateObj&&compareDates(i.latestSelectedDateObj,i.config.minDate,true)===0;var r=i.config.maxTime!==undefined||i.config.maxDate&&i.maxDateHasTime&&i.latestSelectedDateObj&&compareDates(i.latestSelectedDateObj,i.config.maxDate,true)===0;if(i.config.maxTime!==undefined&&i.config.minTime!==undefined&&i.config.minTime>i.config.maxTime){var o=calculateSecondsSinceMidnight(i.config.minTime.getHours(),i.config.minTime.getMinutes(),i.config.minTime.getSeconds());var s=calculateSecondsSinceMidnight(i.config.maxTime.getHours(),i.config.maxTime.getMinutes(),i.config.maxTime.getSeconds());var l=calculateSecondsSinceMidnight(e,t,n);if(l>s&&l<o){var u=parseSeconds(o);e=u[0];t=u[1];n=u[2]}}else{if(r){var d=i.config.maxTime!==undefined?i.config.maxTime:i.config.maxDate;e=Math.min(e,d.getHours());if(e===d.getHours())t=Math.min(t,d.getMinutes());if(t===d.getMinutes())n=Math.min(n,d.getSeconds())}if(a){var p=i.config.minTime!==undefined?i.config.minTime:i.config.minDate;e=Math.max(e,p.getHours());if(e===p.getHours()&&t<p.getMinutes())t=p.getMinutes();if(t===p.getMinutes())n=Math.max(n,p.getSeconds())}}h(e,t,n)}function p(e){var t=e||i.latestSelectedDateObj;if(t&&t instanceof Date){h(t.getHours(),t.getMinutes(),t.getSeconds())}}function h(e,t,n){if(i.latestSelectedDateObj!==undefined){i.latestSelectedDateObj.setHours(e%24,t,n||0,0)}if(!i.hourElement||!i.minuteElement||i.isMobile)return;i.hourElement.value=pad(!i.config.time_24hr?(12+e)%12+12*int(e%12===0):e);i.minuteElement.value=pad(t);if(i.amPM!==undefined)i.amPM.textContent=i.l10n.amPM[int(e>=12)];if(i.secondElement!==undefined)i.secondElement.value=pad(n)}function f(e){var t=getEventTarget(e);var i=parseInt(t.value)+(e.delta||0);if(i/1e3>1||e.key==="Enter"&&!/[^\d]/.test(i.toString())){U(i)}}function g(e,t,n,a){if(t instanceof Array)return t.forEach((function(t){return g(e,t,n,a)}));if(e instanceof Array)return e.forEach((function(e){return g(e,t,n,a)}));e.addEventListener(t,n,a);i._handlers.push({remove:function(){return e.removeEventListener(t,n,a)}})}function m(){ve("onChange")}function v(){if(i.config.wrap){["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(i.element.querySelectorAll("[data-"+e+"]"),(function(t){return g(t,"click",i[e])}))}))}if(i.isMobile){ge();return}var e=debounce(K,50);i._debouncedChange=debounce(m,DEBOUNCED_CHANGE_MS);if(i.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent))g(i.daysContainer,"mouseover",(function(e){if(i.config.mode==="range")X(getEventTarget(e))}));g(i._input,"keydown",W);if(i.calendarContainer!==undefined){g(i.calendarContainer,"keydown",W)}if(!i.config.inline&&!i.config.static)g(window,"resize",e);if(window.ontouchstart!==undefined)g(window.document,"touchstart",H);else g(window.document,"mousedown",H);g(window.document,"focus",H,{capture:true});if(i.config.clickOpens===true){g(i._input,"focus",i.open);g(i._input,"click",i.open)}if(i.daysContainer!==undefined){g(i.monthNav,"click",ke);g(i.monthNav,["keyup","increment"],f);g(i.daysContainer,"click",oe)}if(i.timeContainer!==undefined&&i.minuteElement!==undefined&&i.hourElement!==undefined){var t=function(e){return getEventTarget(e).select()};g(i.timeContainer,["increment"],l);g(i.timeContainer,"blur",l,{capture:true});g(i.timeContainer,"click",b);g([i.hourElement,i.minuteElement],["focus","click"],t);if(i.secondElement!==undefined)g(i.secondElement,"focus",(function(){return i.secondElement&&i.secondElement.select()}));if(i.amPM!==undefined){g(i.amPM,"click",(function(e){l(e)}))}}if(i.config.allowInput){g(i._input,"blur",Y)}}function _(e,t){var n=e!==undefined?i.parseDate(e):i.latestSelectedDateObj||(i.config.minDate&&i.config.minDate>i.now?i.config.minDate:i.config.maxDate&&i.config.maxDate<i.now?i.config.maxDate:i.now);var a=i.currentYear;var r=i.currentMonth;try{if(n!==undefined){i.currentYear=n.getFullYear();i.currentMonth=n.getMonth()}}catch(e){e.message="Invalid date supplied: "+n;i.config.errorHandler(e)}if(t&&i.currentYear!==a){ve("onYearChange");C()}if(t&&(i.currentYear!==a||i.currentMonth!==r)){ve("onMonthChange")}i.redraw()}function b(e){var t=getEventTarget(e);if(~t.className.indexOf("arrow"))y(e,t.classList.contains("arrowUp")?1:-1)}function y(e,t,i){var n=e&&getEventTarget(e);var a=i||n&&n.parentNode&&n.parentNode.firstChild;var r=_e("increment");r.delta=t;a&&a.dispatchEvent(r)}function w(){var e=window.document.createDocumentFragment();i.calendarContainer=createElement("div","flatpickr-calendar");i.calendarContainer.tabIndex=-1;if(!i.config.noCalendar){e.appendChild(L());i.innerContainer=createElement("div","flatpickr-innerContainer");if(i.config.weekNumbers){var t=N(),n=t.weekWrapper,a=t.weekNumbers;i.innerContainer.appendChild(n);i.weekNumbers=a;i.weekWrapper=n}i.rContainer=createElement("div","flatpickr-rContainer");i.rContainer.appendChild(P());if(!i.daysContainer){i.daysContainer=createElement("div","flatpickr-days");i.daysContainer.tabIndex=-1}A();i.rContainer.appendChild(i.daysContainer);i.innerContainer.appendChild(i.rContainer);e.appendChild(i.innerContainer)}if(i.config.enableTime){e.appendChild(O())}toggleClass(i.calendarContainer,"rangeMode",i.config.mode==="range");toggleClass(i.calendarContainer,"animate",i.config.animate===true);toggleClass(i.calendarContainer,"multiMonth",i.config.showMonths>1);i.calendarContainer.appendChild(e);var r=i.config.appendTo!==undefined&&i.config.appendTo.nodeType!==undefined;if(i.config.inline||i.config.static){i.calendarContainer.classList.add(i.config.inline?"inline":"static");if(i.config.inline){if(!r&&i.element.parentNode)i.element.parentNode.insertBefore(i.calendarContainer,i._input.nextSibling);else if(i.config.appendTo!==undefined)i.config.appendTo.appendChild(i.calendarContainer)}if(i.config.static){var o=createElement("div","flatpickr-wrapper");if(i.element.parentNode)i.element.parentNode.insertBefore(o,i.element);o.appendChild(i.element);if(i.altInput)o.appendChild(i.altInput);o.appendChild(i.calendarContainer)}}if(!i.config.static&&!i.config.inline)(i.config.appendTo!==undefined?i.config.appendTo:window.document.body).appendChild(i.calendarContainer)}function x(e,t,n,a){var r=V(t,true),o=createElement("span",e,t.getDate().toString());o.dateObj=t;o.$i=a;o.setAttribute("aria-label",i.formatDate(t,i.config.ariaDateFormat));if(e.indexOf("hidden")===-1&&compareDates(t,i.now)===0){i.todayDateElem=o;o.classList.add("today");o.setAttribute("aria-current","date")}if(r){o.tabIndex=-1;if(be(t)){o.classList.add("selected");i.selectedDateElem=o;if(i.config.mode==="range"){toggleClass(o,"startRange",i.selectedDates[0]&&compareDates(t,i.selectedDates[0],true)===0);toggleClass(o,"endRange",i.selectedDates[1]&&compareDates(t,i.selectedDates[1],true)===0);if(e==="nextMonthDay")o.classList.add("inRange")}}}else{o.classList.add("flatpickr-disabled")}if(i.config.mode==="range"){if(ye(t)&&!be(t))o.classList.add("inRange")}if(i.weekNumbers&&i.config.showMonths===1&&e!=="prevMonthDay"&&a%7===6){i.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+i.config.getWeek(t)+"</span>")}ve("onDayCreate",o);return o}function E(e){e.focus();if(i.config.mode==="range")X(e)}function k(e){var t=e>0?0:i.config.showMonths-1;var n=e>0?i.config.showMonths:-1;for(var a=t;a!=n;a+=e){var r=i.daysContainer.children[a];var o=e>0?0:r.children.length-1;var s=e>0?r.children.length:-1;for(var l=o;l!=s;l+=e){var c=r.children[l];if(c.className.indexOf("hidden")===-1&&V(c.dateObj))return c}}return undefined}function I(e,t){var n=e.className.indexOf("Month")===-1?e.dateObj.getMonth():i.currentMonth;var a=t>0?i.config.showMonths:-1;var r=t>0?1:-1;for(var o=n-i.currentMonth;o!=a;o+=r){var s=i.daysContainer.children[o];var l=n-i.currentMonth===o?e.$i+t:t<0?s.children.length-1:0;var c=s.children.length;for(var u=l;u>=0&&u<c&&u!=(t>0?c:-1);u+=r){var d=s.children[u];if(d.className.indexOf("hidden")===-1&&V(d.dateObj)&&Math.abs(e.$i-u)>=Math.abs(t))return E(d)}}i.changeMonth(r);T(k(r),0);return undefined}function T(e,t){var n=r();var a=j(n||document.body);var o=e!==undefined?e:a?n:i.selectedDateElem!==undefined&&j(i.selectedDateElem)?i.selectedDateElem:i.todayDateElem!==undefined&&j(i.todayDateElem)?i.todayDateElem:k(t>0?1:-1);if(o===undefined){i._input.focus()}else if(!a){E(o)}else{I(o,t)}}function S(e,t){var n=(new Date(e,t,1).getDay()-i.l10n.firstDayOfWeek+7)%7;var a=i.utils.getDaysInMonth((t-1+12)%12,e);var r=i.utils.getDaysInMonth(t,e),o=window.document.createDocumentFragment(),s=i.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",c=s?"nextMonthDay hidden":"nextMonthDay";var u=a+1-n,d=0;for(;u<=a;u++,d++){o.appendChild(x("flatpickr-day "+l,new Date(e,t-1,u),u,d))}for(u=1;u<=r;u++,d++){o.appendChild(x("flatpickr-day",new Date(e,t,u),u,d))}for(var p=r+1;p<=42-n&&(i.config.showMonths===1||d%7!==0);p++,d++){o.appendChild(x("flatpickr-day "+c,new Date(e,t+1,p%r),p,d))}var h=createElement("div","dayContainer");h.appendChild(o);return h}function A(){if(i.daysContainer===undefined){return}clearNode(i.daysContainer);if(i.weekNumbers)clearNode(i.weekNumbers);var e=document.createDocumentFragment();for(var t=0;t<i.config.showMonths;t++){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+t);e.appendChild(S(n.getFullYear(),n.getMonth()))}i.daysContainer.appendChild(e);i.days=i.daysContainer.firstChild;if(i.config.mode==="range"&&i.selectedDates.length===1){X()}}function C(){if(i.config.showMonths>1||i.config.monthSelectorType!=="dropdown")return;var e=function(e){if(i.config.minDate!==undefined&&i.currentYear===i.config.minDate.getFullYear()&&e<i.config.minDate.getMonth()){return false}return!(i.config.maxDate!==undefined&&i.currentYear===i.config.maxDate.getFullYear()&&e>i.config.maxDate.getMonth())};i.monthsDropdownContainer.tabIndex=-1;i.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++){if(!e(t))continue;var n=createElement("option","flatpickr-monthDropdown-month");n.value=new Date(i.currentYear,t).getMonth().toString();n.textContent=monthToStr(t,i.config.shorthandCurrentMonth,i.l10n);n.tabIndex=-1;if(i.currentMonth===t){n.selected=true}i.monthsDropdownContainer.appendChild(n)}}function M(){var e=createElement("div","flatpickr-month");var t=window.document.createDocumentFragment();var n;if(i.config.showMonths>1||i.config.monthSelectorType==="static"){n=createElement("span","cur-month")}else{i.monthsDropdownContainer=createElement("select","flatpickr-monthDropdown-months");i.monthsDropdownContainer.setAttribute("aria-label",i.l10n.monthAriaLabel);g(i.monthsDropdownContainer,"change",(function(e){var t=getEventTarget(e);var n=parseInt(t.value,10);i.changeMonth(n-i.currentMonth);ve("onMonthChange")}));C();n=i.monthsDropdownContainer}var a=createNumberInput("cur-year",{tabindex:"-1"});var r=a.getElementsByTagName("input")[0];r.setAttribute("aria-label",i.l10n.yearAriaLabel);if(i.config.minDate){r.setAttribute("min",i.config.minDate.getFullYear().toString())}if(i.config.maxDate){r.setAttribute("max",i.config.maxDate.getFullYear().toString());r.disabled=!!i.config.minDate&&i.config.minDate.getFullYear()===i.config.maxDate.getFullYear()}var o=createElement("div","flatpickr-current-month");o.appendChild(n);o.appendChild(a);t.appendChild(o);e.appendChild(t);return{container:e,yearElement:r,monthElement:n}}function D(){clearNode(i.monthNav);i.monthNav.appendChild(i.prevMonthNav);if(i.config.showMonths){i.yearElements=[];i.monthElements=[]}for(var e=i.config.showMonths;e--;){var t=M();i.yearElements.push(t.yearElement);i.monthElements.push(t.monthElement);i.monthNav.appendChild(t.container)}i.monthNav.appendChild(i.nextMonthNav)}function L(){i.monthNav=createElement("div","flatpickr-months");i.yearElements=[];i.monthElements=[];i.prevMonthNav=createElement("span","flatpickr-prev-month");i.prevMonthNav.innerHTML=i.config.prevArrow;i.nextMonthNav=createElement("span","flatpickr-next-month");i.nextMonthNav.innerHTML=i.config.nextArrow;D();Object.defineProperty(i,"_hidePrevMonthArrow",{get:function(){return i.__hidePrevMonthArrow},set:function(e){if(i.__hidePrevMonthArrow!==e){toggleClass(i.prevMonthNav,"flatpickr-disabled",e);i.__hidePrevMonthArrow=e}}});Object.defineProperty(i,"_hideNextMonthArrow",{get:function(){return i.__hideNextMonthArrow},set:function(e){if(i.__hideNextMonthArrow!==e){toggleClass(i.nextMonthNav,"flatpickr-disabled",e);i.__hideNextMonthArrow=e}}});i.currentYearElement=i.yearElements[0];we();return i.monthNav}function O(){i.calendarContainer.classList.add("hasTime");if(i.config.noCalendar)i.calendarContainer.classList.add("noCalendar");var e=getDefaultHours(i.config);i.timeContainer=createElement("div","flatpickr-time");i.timeContainer.tabIndex=-1;var t=createElement("span","flatpickr-time-separator",":");var n=createNumberInput("flatpickr-hour",{"aria-label":i.l10n.hourAriaLabel});i.hourElement=n.getElementsByTagName("input")[0];var a=createNumberInput("flatpickr-minute",{"aria-label":i.l10n.minuteAriaLabel});i.minuteElement=a.getElementsByTagName("input")[0];i.hourElement.tabIndex=i.minuteElement.tabIndex=-1;i.hourElement.value=pad(i.latestSelectedDateObj?i.latestSelectedDateObj.getHours():i.config.time_24hr?e.hours:u(e.hours));i.minuteElement.value=pad(i.latestSelectedDateObj?i.latestSelectedDateObj.getMinutes():e.minutes);i.hourElement.setAttribute("step",i.config.hourIncrement.toString());i.minuteElement.setAttribute("step",i.config.minuteIncrement.toString());i.hourElement.setAttribute("min",i.config.time_24hr?"0":"1");i.hourElement.setAttribute("max",i.config.time_24hr?"23":"12");i.hourElement.setAttribute("maxlength","2");i.minuteElement.setAttribute("min","0");i.minuteElement.setAttribute("max","59");i.minuteElement.setAttribute("maxlength","2");i.timeContainer.appendChild(n);i.timeContainer.appendChild(t);i.timeContainer.appendChild(a);if(i.config.time_24hr)i.timeContainer.classList.add("time24hr");if(i.config.enableSeconds){i.timeContainer.classList.add("hasSeconds");var r=createNumberInput("flatpickr-second");i.secondElement=r.getElementsByTagName("input")[0];i.secondElement.value=pad(i.latestSelectedDateObj?i.latestSelectedDateObj.getSeconds():e.seconds);i.secondElement.setAttribute("step",i.minuteElement.getAttribute("step"));i.secondElement.setAttribute("min","0");i.secondElement.setAttribute("max","59");i.secondElement.setAttribute("maxlength","2");i.timeContainer.appendChild(createElement("span","flatpickr-time-separator",":"));i.timeContainer.appendChild(r)}if(!i.config.time_24hr){i.amPM=createElement("span","flatpickr-am-pm",i.l10n.amPM[int((i.latestSelectedDateObj?i.hourElement.value:i.config.defaultHour)>11)]);i.amPM.title=i.l10n.toggleTitle;i.amPM.tabIndex=-1;i.timeContainer.appendChild(i.amPM)}return i.timeContainer}function P(){if(!i.weekdayContainer)i.weekdayContainer=createElement("div","flatpickr-weekdays");else clearNode(i.weekdayContainer);for(var e=i.config.showMonths;e--;){var t=createElement("div","flatpickr-weekdaycontainer");i.weekdayContainer.appendChild(t)}R();return i.weekdayContainer}function R(){if(!i.weekdayContainer){return}var e=i.l10n.firstDayOfWeek;var t=__spreadArrays(i.l10n.weekdays.shorthand);if(e>0&&e<t.length){t=__spreadArrays(t.splice(e,t.length),t.splice(0,e))}for(var n=i.config.showMonths;n--;){i.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function N(){i.calendarContainer.classList.add("hasWeeks");var e=createElement("div","flatpickr-weekwrapper");e.appendChild(createElement("span","flatpickr-weekday",i.l10n.weekAbbreviation));var t=createElement("div","flatpickr-weeks");e.appendChild(t);return{weekWrapper:e,weekNumbers:t}}function F(e,t){if(t===void 0){t=true}var n=t?e:e-i.currentMonth;if(n<0&&i._hidePrevMonthArrow===true||n>0&&i._hideNextMonthArrow===true)return;i.currentMonth+=n;if(i.currentMonth<0||i.currentMonth>11){i.currentYear+=i.currentMonth>11?1:-1;i.currentMonth=(i.currentMonth+12)%12;ve("onYearChange");C()}A();ve("onMonthChange");we()}function G(e,t){if(e===void 0){e=true}if(t===void 0){t=true}i.input.value="";if(i.altInput!==undefined)i.altInput.value="";if(i.mobileInput!==undefined)i.mobileInput.value="";i.selectedDates=[];i.latestSelectedDateObj=undefined;if(t===true){i.currentYear=i._initialDate.getFullYear();i.currentMonth=i._initialDate.getMonth()}if(i.config.enableTime===true){var n=getDefaultHours(i.config),a=n.hours,r=n.minutes,o=n.seconds;h(a,r,o)}i.redraw();if(e)ve("onChange")}function z(){i.isOpen=false;if(!i.isMobile){if(i.calendarContainer!==undefined){i.calendarContainer.classList.remove("open")}if(i._input!==undefined){i._input.classList.remove("active")}}ve("onClose")}function B(){if(i.config!==undefined)ve("onDestroy");for(var e=i._handlers.length;e--;){i._handlers[e].remove()}i._handlers=[];if(i.mobileInput){if(i.mobileInput.parentNode)i.mobileInput.parentNode.removeChild(i.mobileInput);i.mobileInput=undefined}else if(i.calendarContainer&&i.calendarContainer.parentNode){if(i.config.static&&i.calendarContainer.parentNode){var t=i.calendarContainer.parentNode;t.lastChild&&t.removeChild(t.lastChild);if(t.parentNode){while(t.firstChild)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else i.calendarContainer.parentNode.removeChild(i.calendarContainer)}if(i.altInput){i.input.type="text";if(i.altInput.parentNode)i.altInput.parentNode.removeChild(i.altInput);delete i.altInput}if(i.input){i.input.type=i.input._type;i.input.classList.remove("flatpickr-input");i.input.removeAttribute("readonly")}["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete i[e]}catch(e){}}))}function q(e){return i.calendarContainer.contains(e)}function H(e){if(i.isOpen&&!i.config.inline){var t=getEventTarget(e);var n=q(t);var a=t===i.input||t===i.altInput||i.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(i.input)||~e.path.indexOf(i.altInput));var r=!a&&!n&&!q(e.relatedTarget);var o=!i.config.ignoredFocusElements.some((function(e){return e.contains(t)}));if(r&&o){if(i.config.allowInput){i.setDate(i._input.value,false,i.config.altInput?i.config.altFormat:i.config.dateFormat)}if(i.timeContainer!==undefined&&i.minuteElement!==undefined&&i.hourElement!==undefined&&i.input.value!==""&&i.input.value!==undefined){l()}i.close();if(i.config&&i.config.mode==="range"&&i.selectedDates.length===1)i.clear(false)}}}function U(e){if(!e||i.config.minDate&&e<i.config.minDate.getFullYear()||i.config.maxDate&&e>i.config.maxDate.getFullYear())return;var t=e,n=i.currentYear!==t;i.currentYear=t||i.currentYear;if(i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()){i.currentMonth=Math.min(i.config.maxDate.getMonth(),i.currentMonth)}else if(i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()){i.currentMonth=Math.max(i.config.minDate.getMonth(),i.currentMonth)}if(n){i.redraw();ve("onYearChange");C()}}function V(e,t){var n;if(t===void 0){t=true}var a=i.parseDate(e,undefined,t);if(i.config.minDate&&a&&compareDates(a,i.config.minDate,t!==undefined?t:!i.minDateHasTime)<0||i.config.maxDate&&a&&compareDates(a,i.config.maxDate,t!==undefined?t:!i.maxDateHasTime)>0)return false;if(!i.config.enable&&i.config.disable.length===0)return true;if(a===undefined)return false;var r=!!i.config.enable,o=(n=i.config.enable)!==null&&n!==void 0?n:i.config.disable;for(var s=0,l=void 0;s<o.length;s++){l=o[s];if(typeof l==="function"&&l(a))return r;else if(l instanceof Date&&a!==undefined&&l.getTime()===a.getTime())return r;else if(typeof l==="string"){var c=i.parseDate(l,undefined,true);return c&&c.getTime()===a.getTime()?r:!r}else if(typeof l==="object"&&a!==undefined&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return r}return!r}function j(e){if(i.daysContainer!==undefined)return e.className.indexOf("hidden")===-1&&e.className.indexOf("flatpickr-disabled")===-1&&i.daysContainer.contains(e);return false}function Y(e){var t=e.target===i._input;var n=i._input.value.trimEnd()!==xe();if(t&&n&&!(e.relatedTarget&&q(e.relatedTarget))){i.setDate(i._input.value,true,e.target===i.altInput?i.config.altFormat:i.config.dateFormat)}}function W(t){var n=getEventTarget(t);var a=i.config.wrap?e.contains(n):n===i._input;var o=i.config.allowInput;var s=i.isOpen&&(!o||!a);var c=i.config.inline&&a&&!o;if(t.keyCode===13&&a){if(o){i.setDate(i._input.value,true,n===i.altInput?i.config.altFormat:i.config.dateFormat);i.close();return n.blur()}else{i.open()}}else if(q(n)||s||c){var u=!!i.timeContainer&&i.timeContainer.contains(n);switch(t.keyCode){case 13:if(u){t.preventDefault();l();re()}else oe(t);break;case 27:t.preventDefault();re();break;case 8:case 46:if(a&&!i.config.allowInput){t.preventDefault();i.clear()}break;case 37:case 39:if(!u&&!a){t.preventDefault();var p=r();if(i.daysContainer!==undefined&&(o===false||p&&j(p))){var h=t.keyCode===39?1:-1;if(!t.ctrlKey)T(undefined,h);else{t.stopPropagation();F(h);T(k(1),0)}}}else if(i.hourElement)i.hourElement.focus();break;case 38:case 40:t.preventDefault();var f=t.keyCode===40?1:-1;if(i.daysContainer&&n.$i!==undefined||n===i.input||n===i.altInput){if(t.ctrlKey){t.stopPropagation();U(i.currentYear-f);T(k(1),0)}else if(!u)T(undefined,f*7)}else if(n===i.currentYearElement){U(i.currentYear-f)}else if(i.config.enableTime){if(!u&&i.hourElement)i.hourElement.focus();l(t);i._debouncedChange()}break;case 9:if(u){var g=[i.hourElement,i.minuteElement,i.secondElement,i.amPM].concat(i.pluginElements).filter((function(e){return e}));var m=g.indexOf(n);if(m!==-1){var v=g[m+(t.shiftKey?-1:1)];t.preventDefault();(v||i._input).focus()}}else if(!i.config.noCalendar&&i.daysContainer&&i.daysContainer.contains(n)&&t.shiftKey){t.preventDefault();i._input.focus()}break}}if(i.amPM!==undefined&&n===i.amPM){switch(t.key){case i.l10n.amPM[0].charAt(0):case i.l10n.amPM[0].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[0];d();Ee();break;case i.l10n.amPM[1].charAt(0):case i.l10n.amPM[1].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[1];d();Ee();break}}if(a||q(n)){ve("onKeyDown",t)}}function X(e,t){if(t===void 0){t="flatpickr-day"}if(i.selectedDates.length!==1||e&&(!e.classList.contains(t)||e.classList.contains("flatpickr-disabled")))return;var n=e?e.dateObj.getTime():i.days.firstElementChild.dateObj.getTime(),a=i.parseDate(i.selectedDates[0],undefined,true).getTime(),r=Math.min(n,i.selectedDates[0].getTime()),o=Math.max(n,i.selectedDates[0].getTime());var s=false;var l=0,c=0;for(var u=r;u<o;u+=duration.DAY){if(!V(new Date(u),true)){s=s||u>r&&u<o;if(u<a&&(!l||u>l))l=u;else if(u>a&&(!c||u<c))c=u}}var d=Array.from(i.rContainer.querySelectorAll("*:nth-child(-n+"+i.config.showMonths+") > ."+t));d.forEach((function(t){var r=t.dateObj;var o=r.getTime();var u=l>0&&o<l||c>0&&o>c;if(u){t.classList.add("notAllowed");["inRange","startRange","endRange"].forEach((function(e){t.classList.remove(e)}));return}else if(s&&!u)return;["startRange","inRange","endRange","notAllowed"].forEach((function(e){t.classList.remove(e)}));if(e!==undefined){e.classList.add(n<=i.selectedDates[0].getTime()?"startRange":"endRange");if(a<n&&o===a)t.classList.add("startRange");else if(a>n&&o===a)t.classList.add("endRange");if(o>=l&&(c===0||o<=c)&&isBetween(o,a,n))t.classList.add("inRange")}}))}function K(){if(i.isOpen&&!i.config.static&&!i.config.inline)te()}function Z(e,t){if(t===void 0){t=i._positionElement}if(i.isMobile===true){if(e){e.preventDefault();var n=getEventTarget(e);if(n){n.blur()}}if(i.mobileInput!==undefined){i.mobileInput.focus();i.mobileInput.click()}ve("onOpen");return}else if(i._input.disabled||i.config.inline){return}var a=i.isOpen;i.isOpen=true;if(!a){i.calendarContainer.classList.add("open");i._input.classList.add("active");ve("onOpen");te(t)}if(i.config.enableTime===true&&i.config.noCalendar===true){if(i.config.allowInput===false&&(e===undefined||!i.timeContainer.contains(e.relatedTarget))){setTimeout((function(){return i.hourElement.select()}),50)}}}function Q(e){return function(t){var n=i.config["_"+e+"Date"]=i.parseDate(t,i.config.dateFormat);var a=i.config["_"+(e==="min"?"max":"min")+"Date"];if(n!==undefined){i[e==="min"?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0}if(i.selectedDates){i.selectedDates=i.selectedDates.filter((function(e){return V(e)}));if(!i.selectedDates.length&&e==="min")p(n);Ee()}if(i.daysContainer){ae();if(n!==undefined)i.currentYearElement[e]=n.getFullYear().toString();else i.currentYearElement.removeAttribute(e);i.currentYearElement.disabled=!!a&&n!==undefined&&a.getFullYear()===n.getFullYear()}}}function $(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"];var a=__assign(__assign({},JSON.parse(JSON.stringify(e.dataset||{}))),t);var r={};i.config.parseDate=a.parseDate;i.config.formatDate=a.formatDate;Object.defineProperty(i.config,"enable",{get:function(){return i.config._enable},set:function(e){i.config._enable=de(e)}});Object.defineProperty(i.config,"disable",{get:function(){return i.config._disable},set:function(e){i.config._disable=de(e)}});var s=a.mode==="time";if(!a.dateFormat&&(a.enableTime||s)){var l=flatpickr.defaultConfig.dateFormat||defaults$1.dateFormat;r.dateFormat=a.noCalendar||s?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||s)&&!a.altFormat){var c=flatpickr.defaultConfig.altFormat||defaults$1.altFormat;r.altFormat=a.noCalendar||s?"h:i"+(a.enableSeconds?":S K":" K"):c+(" h:i"+(a.enableSeconds?":S":"")+" K")}Object.defineProperty(i.config,"minDate",{get:function(){return i.config._minDate},set:Q("min")});Object.defineProperty(i.config,"maxDate",{get:function(){return i.config._maxDate},set:Q("max")});var u=function(e){return function(t){i.config[e==="min"?"_minTime":"_maxTime"]=i.parseDate(t,"H:i:S")}};Object.defineProperty(i.config,"minTime",{get:function(){return i.config._minTime},set:u("min")});Object.defineProperty(i.config,"maxTime",{get:function(){return i.config._maxTime},set:u("max")});if(a.mode==="time"){i.config.noCalendar=true;i.config.enableTime=true}Object.assign(i.config,r,a);for(var d=0;d<n.length;d++)i.config[n[d]]=i.config[n[d]]===true||i.config[n[d]]==="true";HOOKS.filter((function(e){return i.config[e]!==undefined})).forEach((function(e){i.config[e]=arrayify(i.config[e]||[]).map(o)}));i.isMobile=!i.config.disableMobile&&!i.config.inline&&i.config.mode==="single"&&!i.config.disable.length&&!i.config.enable&&!i.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var d=0;d<i.config.plugins.length;d++){var p=i.config.plugins[d](i)||{};for(var h in p){if(HOOKS.indexOf(h)>-1){i.config[h]=arrayify(p[h]).map(o).concat(i.config[h])}else if(typeof a[h]==="undefined")i.config[h]=p[h]}}if(!a.altInputClass){i.config.altInputClass=J().className+" "+i.config.altInputClass}ve("onParseConfig")}function J(){return i.config.wrap?e.querySelector("[data-input]"):e}function ee(){if(typeof i.config.locale!=="object"&&typeof flatpickr.l10ns[i.config.locale]==="undefined")i.config.errorHandler(new Error("flatpickr: invalid locale "+i.config.locale));i.l10n=__assign(__assign({},flatpickr.l10ns.default),typeof i.config.locale==="object"?i.config.locale:i.config.locale!=="default"?flatpickr.l10ns[i.config.locale]:undefined);tokenRegex.D="("+i.l10n.weekdays.shorthand.join("|")+")";tokenRegex.l="("+i.l10n.weekdays.longhand.join("|")+")";tokenRegex.M="("+i.l10n.months.shorthand.join("|")+")";tokenRegex.F="("+i.l10n.months.longhand.join("|")+")";tokenRegex.K="("+i.l10n.amPM[0]+"|"+i.l10n.amPM[1]+"|"+i.l10n.amPM[0].toLowerCase()+"|"+i.l10n.amPM[1].toLowerCase()+")";var n=__assign(__assign({},t),JSON.parse(JSON.stringify(e.dataset||{})));if(n.time_24hr===undefined&&flatpickr.defaultConfig.time_24hr===undefined){i.config.time_24hr=i.l10n.time_24hr}i.formatDate=createDateFormatter(i);i.parseDate=createDateParser({config:i.config,l10n:i.l10n})}function te(e){if(typeof i.config.position==="function"){return void i.config.position(i,e)}if(i.calendarContainer===undefined)return;ve("onPreCalendarPosition");var t=e||i._positionElement;var n=Array.prototype.reduce.call(i.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),a=i.calendarContainer.offsetWidth,r=i.config.position.split(" "),o=r[0],s=r.length>1?r[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,u=o==="above"||o!=="below"&&c<n&&l.top>n;var d=window.pageYOffset+l.top+(!u?t.offsetHeight+2:-n-2);toggleClass(i.calendarContainer,"arrowTop",!u);toggleClass(i.calendarContainer,"arrowBottom",u);if(i.config.inline)return;var p=window.pageXOffset+l.left;var h=false;var f=false;if(s==="center"){p-=(a-l.width)/2;h=true}else if(s==="right"){p-=a-l.width;f=true}toggleClass(i.calendarContainer,"arrowLeft",!h&&!f);toggleClass(i.calendarContainer,"arrowCenter",h);toggleClass(i.calendarContainer,"arrowRight",f);var g=window.document.body.offsetWidth-(window.pageXOffset+l.right);var m=p+a>window.document.body.offsetWidth;var v=g+a>window.document.body.offsetWidth;toggleClass(i.calendarContainer,"rightMost",m);if(i.config.static)return;i.calendarContainer.style.top=d+"px";if(!m){i.calendarContainer.style.left=p+"px";i.calendarContainer.style.right="auto"}else if(!v){i.calendarContainer.style.left="auto";i.calendarContainer.style.right=g+"px"}else{var _=ie();if(_===undefined)return;var b=window.document.body.offsetWidth;var y=Math.max(0,b/2-a/2);var w=".flatpickr-calendar.centerMost:before";var x=".flatpickr-calendar.centerMost:after";var E=_.cssRules.length;var k="{left:"+l.left+"px;right:auto;}";toggleClass(i.calendarContainer,"rightMost",false);toggleClass(i.calendarContainer,"centerMost",true);_.insertRule(w+","+x+k,E);i.calendarContainer.style.left=y+"px";i.calendarContainer.style.right="auto"}}function ie(){var e=null;for(var t=0;t<document.styleSheets.length;t++){var i=document.styleSheets[t];if(!i.cssRules)continue;e=i;break}return e!=null?e:ne()}function ne(){var e=document.createElement("style");document.head.appendChild(e);return e.sheet}function ae(){if(i.config.noCalendar||i.isMobile)return;C();we();A()}function re(){i._input.focus();if(window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==undefined){setTimeout(i.close,0)}else{i.close()}}function oe(e){e.preventDefault();e.stopPropagation();var t=function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")};var n=findParent(getEventTarget(e),t);if(n===undefined)return;var a=n;var r=i.latestSelectedDateObj=new Date(a.dateObj.getTime());var o=(r.getMonth()<i.currentMonth||r.getMonth()>i.currentMonth+i.config.showMonths-1)&&i.config.mode!=="range";i.selectedDateElem=a;if(i.config.mode==="single")i.selectedDates=[r];else if(i.config.mode==="multiple"){var s=be(r);if(s)i.selectedDates.splice(parseInt(s),1);else i.selectedDates.push(r)}else if(i.config.mode==="range"){if(i.selectedDates.length===2){i.clear(false,false)}i.latestSelectedDateObj=r;i.selectedDates.push(r);if(compareDates(r,i.selectedDates[0],true)!==0)i.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}d();if(o){var l=i.currentYear!==r.getFullYear();i.currentYear=r.getFullYear();i.currentMonth=r.getMonth();if(l){ve("onYearChange");C()}ve("onMonthChange")}we();A();Ee();if(!o&&i.config.mode!=="range"&&i.config.showMonths===1)E(a);else if(i.selectedDateElem!==undefined&&i.hourElement===undefined){i.selectedDateElem&&i.selectedDateElem.focus()}if(i.hourElement!==undefined)i.hourElement!==undefined&&i.hourElement.focus();if(i.config.closeOnSelect){var c=i.config.mode==="single"&&!i.config.enableTime;var u=i.config.mode==="range"&&i.selectedDates.length===2&&!i.config.enableTime;if(c||u){re()}}m()}var se={locale:[ee,R],showMonths:[D,s,P],minDate:[_],maxDate:[_],positionElement:[fe],clickOpens:[function(){if(i.config.clickOpens===true){g(i._input,"focus",i.open);g(i._input,"click",i.open)}else{i._input.removeEventListener("focus",i.open);i._input.removeEventListener("click",i.open)}}]};function le(e,t){if(e!==null&&typeof e==="object"){Object.assign(i.config,e);for(var n in e){if(se[n]!==undefined)se[n].forEach((function(e){return e()}))}}else{i.config[e]=t;if(se[e]!==undefined)se[e].forEach((function(e){return e()}));else if(HOOKS.indexOf(e)>-1)i.config[e]=arrayify(t)}i.redraw();Ee(true)}function ce(e,t){var n=[];if(e instanceof Array)n=e.map((function(e){return i.parseDate(e,t)}));else if(e instanceof Date||typeof e==="number")n=[i.parseDate(e,t)];else if(typeof e==="string"){switch(i.config.mode){case"single":case"time":n=[i.parseDate(e,t)];break;case"multiple":n=e.split(i.config.conjunction).map((function(e){return i.parseDate(e,t)}));break;case"range":n=e.split(i.l10n.rangeSeparator).map((function(e){return i.parseDate(e,t)}));break}}else i.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));i.selectedDates=i.config.allowInvalidPreload?n:n.filter((function(e){return e instanceof Date&&V(e,false)}));if(i.config.mode==="range")i.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function ue(e,t,n){if(t===void 0){t=false}if(n===void 0){n=i.config.dateFormat}if(e!==0&&!e||e instanceof Array&&e.length===0)return i.clear(t);ce(e,n);i.latestSelectedDateObj=i.selectedDates[i.selectedDates.length-1];i.redraw();_(undefined,t);p();if(i.selectedDates.length===0){i.clear(false)}Ee(t);if(t)ve("onChange")}function de(e){return e.slice().map((function(e){if(typeof e==="string"||typeof e==="number"||e instanceof Date){return i.parseDate(e,undefined,true)}else if(e&&typeof e==="object"&&e.from&&e.to)return{from:i.parseDate(e.from,undefined),to:i.parseDate(e.to,undefined)};return e})).filter((function(e){return e}))}function pe(){i.selectedDates=[];i.now=i.parseDate(i.config.now)||new Date;var e=i.config.defaultDate||((i.input.nodeName==="INPUT"||i.input.nodeName==="TEXTAREA")&&i.input.placeholder&&i.input.value===i.input.placeholder?null:i.input.value);if(e)ce(e,i.config.dateFormat);i._initialDate=i.selectedDates.length>0?i.selectedDates[0]:i.config.minDate&&i.config.minDate.getTime()>i.now.getTime()?i.config.minDate:i.config.maxDate&&i.config.maxDate.getTime()<i.now.getTime()?i.config.maxDate:i.now;i.currentYear=i._initialDate.getFullYear();i.currentMonth=i._initialDate.getMonth();if(i.selectedDates.length>0)i.latestSelectedDateObj=i.selectedDates[0];if(i.config.minTime!==undefined)i.config.minTime=i.parseDate(i.config.minTime,"H:i");if(i.config.maxTime!==undefined)i.config.maxTime=i.parseDate(i.config.maxTime,"H:i");i.minDateHasTime=!!i.config.minDate&&(i.config.minDate.getHours()>0||i.config.minDate.getMinutes()>0||i.config.minDate.getSeconds()>0);i.maxDateHasTime=!!i.config.maxDate&&(i.config.maxDate.getHours()>0||i.config.maxDate.getMinutes()>0||i.config.maxDate.getSeconds()>0)}function he(){i.input=J();if(!i.input){i.config.errorHandler(new Error("Invalid input element specified"));return}i.input._type=i.input.type;i.input.type="text";i.input.classList.add("flatpickr-input");i._input=i.input;if(i.config.altInput){i.altInput=createElement(i.input.nodeName,i.config.altInputClass);i._input=i.altInput;i.altInput.placeholder=i.input.placeholder;i.altInput.disabled=i.input.disabled;i.altInput.required=i.input.required;i.altInput.tabIndex=i.input.tabIndex;i.altInput.type="text";i.input.setAttribute("type","hidden");if(!i.config.static&&i.input.parentNode)i.input.parentNode.insertBefore(i.altInput,i.input.nextSibling)}if(!i.config.allowInput)i._input.setAttribute("readonly","readonly");fe()}function fe(){i._positionElement=i.config.positionElement||i._input}function ge(){var e=i.config.enableTime?i.config.noCalendar?"time":"datetime-local":"date";i.mobileInput=createElement("input",i.input.className+" flatpickr-mobile");i.mobileInput.tabIndex=1;i.mobileInput.type=e;i.mobileInput.disabled=i.input.disabled;i.mobileInput.required=i.input.required;i.mobileInput.placeholder=i.input.placeholder;i.mobileFormatStr=e==="datetime-local"?"Y-m-d\\TH:i:S":e==="date"?"Y-m-d":"H:i:S";if(i.selectedDates.length>0){i.mobileInput.defaultValue=i.mobileInput.value=i.formatDate(i.selectedDates[0],i.mobileFormatStr)}if(i.config.minDate)i.mobileInput.min=i.formatDate(i.config.minDate,"Y-m-d");if(i.config.maxDate)i.mobileInput.max=i.formatDate(i.config.maxDate,"Y-m-d");if(i.input.getAttribute("step"))i.mobileInput.step=String(i.input.getAttribute("step"));i.input.type="hidden";if(i.altInput!==undefined)i.altInput.type="hidden";try{if(i.input.parentNode)i.input.parentNode.insertBefore(i.mobileInput,i.input.nextSibling)}catch(e){}g(i.mobileInput,"change",(function(e){i.setDate(getEventTarget(e).value,false,i.mobileFormatStr);ve("onChange");ve("onClose")}))}function me(e){if(i.isOpen===true)return i.close();i.open(e)}function ve(e,t){if(i.config===undefined)return;var n=i.config[e];if(n!==undefined&&n.length>0){for(var a=0;n[a]&&a<n.length;a++)n[a](i.selectedDates,i.input.value,i,t)}if(e==="onChange"){i.input.dispatchEvent(_e("change"));i.input.dispatchEvent(_e("input"))}}function _e(e){var t=document.createEvent("Event");t.initEvent(e,true,true);return t}function be(e){for(var t=0;t<i.selectedDates.length;t++){var n=i.selectedDates[t];if(n instanceof Date&&compareDates(n,e)===0)return""+t}return false}function ye(e){if(i.config.mode!=="range"||i.selectedDates.length<2)return false;return compareDates(e,i.selectedDates[0])>=0&&compareDates(e,i.selectedDates[1])<=0}function we(){if(i.config.noCalendar||i.isMobile||!i.monthNav)return;i.yearElements.forEach((function(e,t){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+t);if(i.config.showMonths>1||i.config.monthSelectorType==="static"){i.monthElements[t].textContent=monthToStr(n.getMonth(),i.config.shorthandCurrentMonth,i.l10n)+" "}else{i.monthsDropdownContainer.value=n.getMonth().toString()}e.value=n.getFullYear().toString()}));i._hidePrevMonthArrow=i.config.minDate!==undefined&&(i.currentYear===i.config.minDate.getFullYear()?i.currentMonth<=i.config.minDate.getMonth():i.currentYear<i.config.minDate.getFullYear());i._hideNextMonthArrow=i.config.maxDate!==undefined&&(i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth+1>i.config.maxDate.getMonth():i.currentYear>i.config.maxDate.getFullYear())}function xe(e){var t=e||(i.config.altInput?i.config.altFormat:i.config.dateFormat);return i.selectedDates.map((function(e){return i.formatDate(e,t)})).filter((function(e,t,n){return i.config.mode!=="range"||i.config.enableTime||n.indexOf(e)===t})).join(i.config.mode!=="range"?i.config.conjunction:i.l10n.rangeSeparator)}function Ee(e){if(e===void 0){e=true}if(i.mobileInput!==undefined&&i.mobileFormatStr){i.mobileInput.value=i.latestSelectedDateObj!==undefined?i.formatDate(i.latestSelectedDateObj,i.mobileFormatStr):""}i.input.value=xe(i.config.dateFormat);if(i.altInput!==undefined){i.altInput.value=xe(i.config.altFormat)}if(e!==false)ve("onValueUpdate")}function ke(e){var t=getEventTarget(e);var n=i.prevMonthNav.contains(t);var a=i.nextMonthNav.contains(t);if(n||a){F(n?-1:1)}else if(i.yearElements.indexOf(t)>=0){t.select()}else if(t.classList.contains("arrowUp")){i.changeYear(i.currentYear+1)}else if(t.classList.contains("arrowDown")){i.changeYear(i.currentYear-1)}}function Ie(e){e.preventDefault();var t=e.type==="keydown",n=getEventTarget(e),a=n;if(i.amPM!==undefined&&n===i.amPM){i.amPM.textContent=i.l10n.amPM[int(i.amPM.textContent===i.l10n.amPM[0])]}var r=parseFloat(a.getAttribute("min")),o=parseFloat(a.getAttribute("max")),s=parseFloat(a.getAttribute("step")),l=parseInt(a.value,10),c=e.delta||(t?e.which===38?1:-1:0);var u=l+s*c;if(typeof a.value!=="undefined"&&a.value.length===2){var d=a===i.hourElement,p=a===i.minuteElement;if(u<r){u=o+u+int(!d)+(int(d)&&int(!i.amPM));if(p)y(undefined,-1,i.hourElement)}else if(u>o){u=a===i.hourElement?u-o-int(!i.amPM):r;if(p)y(undefined,1,i.hourElement)}if(i.amPM&&d&&(s===1?u+l===23:Math.abs(u-l)>s)){i.amPM.textContent=i.l10n.amPM[int(i.amPM.textContent===i.l10n.amPM[0])]}a.value=pad(u)}}a();return i}function _flatpickr(e,t){var i=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement}));var n=[];for(var a=0;a<i.length;a++){var r=i[a];try{if(r.getAttribute("data-fp-omit")!==null)continue;if(r._flatpickr!==undefined){r._flatpickr.destroy();r._flatpickr=undefined}r._flatpickr=FlatpickrInstance(r,t||{});n.push(r._flatpickr)}catch(e){console.error(e)}}return n.length===1?n[0]:n}if(typeof HTMLElement!=="undefined"&&typeof HTMLCollection!=="undefined"&&typeof NodeList!=="undefined"){HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return _flatpickr(this,e)};HTMLElement.prototype.flatpickr=function(e){return _flatpickr([this],e)}}var flatpickr=function(e,t){if(typeof e==="string"){return _flatpickr(window.document.querySelectorAll(e),t)}else if(e instanceof Node){return _flatpickr([e],t)}else{return _flatpickr(e,t)}};flatpickr.defaultConfig={};flatpickr.l10ns={en:__assign({},english),default:__assign({},english)};flatpickr.localize=function(e){flatpickr.l10ns.default=__assign(__assign({},flatpickr.l10ns.default),e)};flatpickr.setDefaults=function(e){flatpickr.defaultConfig=__assign(__assign({},flatpickr.defaultConfig),e)};flatpickr.parseDate=createDateParser({});flatpickr.formatDate=createDateFormatter({});flatpickr.compareDates=compareDates;if(typeof jQuery!=="undefined"&&typeof jQuery.fn!=="undefined"){jQuery.fn.flatpickr=function(e){return _flatpickr(this,e)}}Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof e==="string"?parseInt(e,10):e))};if(typeof window!=="undefined"){window.flatpickr=flatpickr}var sallaDatetimePickerCss='.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:\'\';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}';var SallaDatetimePicker=function(){function e(e){registerInstance(this,e);this.picked=createEvent(this,"picked",7);this.invalidInput=createEvent(this,"invalidInput",7);this.value=null;this.required=undefined;this.name=undefined;this.placeholder=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time");this.allowInput=true;this.allowInvalidPreload=false;this.altFormat="F j, Y";this.altInput=false;this.altInputClass=undefined;this.appendTo=undefined;this.ariaDateFormat="F j, Y";this.autoFillDefaultTime=true;this.clickOpens=true;this.closeOnSelect=true;this.conjunction=undefined;this.dateFormat="Y-m-d";this.defaultDate=undefined;this.defaultHour=12;this.defaultMinute=0;this.defaultSeconds=0;this.disable=[];this.disableMobile=false;this.enable=[function(e){return true}];this.enableSeconds=false;this.enableTime=false;this.formatDate=undefined;this.hourIncrement=1;this.inline=false;this.locale="en";this.maxDate=null;this.maxTime=null;this.minDate=null;this.minTime=null;this.minuteIncrement=5;this.mode="single";this.monthSelectorType="dropdown";this.nextArrow='<span class="sicon-keyboard_arrow_right"></span>';this.noCalendar=false;this.dateParser=undefined;this.position="auto";this.positionElement=undefined;this.prevArrow='<span class="sicon-keyboard_arrow_left"></span>';this.shorthandCurrentMonth=false;this.static=false;this.showMonths=1;this.time_24hr=false;this.weekNumbers=false;this.wrap=false}e.prototype.render=function(){var e=this;return h("div",{class:"s-datetime-picker"},h("input",{type:"datetime",name:this.name,value:this.value,required:this.required,placeholder:this.placeholder,class:"s-datetime-picker-input",ref:function(t){return e.dateInput=t}}))};e.prototype.componentDidLoad=function(){var e=this;var t={allowInput:this.allowInput,allowInvalidPreload:this.allowInvalidPreload,altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,appendTo:this.appendTo,ariaDateFormat:this.ariaDateFormat,autoFillDefaultTime:this.autoFillDefaultTime,clickOpens:this.clickOpens,closeOnSelect:this.closeOnSelect,conjunction:this.conjunction,dateFormat:this.dateFormat,defaultDate:!!this.value?Date.parse(this.value):this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,defaultSeconds:this.defaultSeconds,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableSeconds:this.enableSeconds,enableTime:this.enableTime,formatDate:this.formatDate,hourIncrement:this.hourIncrement,inline:this.inline,locale:this.locale,maxDate:this.maxDate,maxTime:this.maxTime,minDate:this.minDate,minTime:this.minTime,minuteIncrement:this.minuteIncrement,mode:this.mode,monthSelectorType:this.monthSelectorType,nextArrow:this.nextArrow,noCalendar:this.noCalendar,parseDate:this.dateParser,position:this.position,positionElement:this.positionElement,prevArrow:this.prevArrow,shorthandCurrentMonth:this.shorthandCurrentMonth,static:this.static,showMonths:this.showMonths,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,onChange:function(t,i){return e.picked.emit(e.value=i)}};flatpickr(this.dateInput,t);this.dateInput.addEventListener("invalid",(function(t){e.invalidInput.emit(t)}));this.dateInput.addEventListener("input",(function(){e.dateInput.setCustomValidity("");e.dateInput.reportValidity()}))};return e}();SallaDatetimePicker.style=sallaDatetimePickerCss;var filepond=createCommonjsModule((function(e,t){
|
|
12
12
|
/*!
|
|
13
13
|
* FilePond 4.30.4
|
|
14
14
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
15
15
|
* Please visit https://pqina.nl/filepond/ for details.
|
|
16
16
|
*/
|
|
17
|
-
(function(e,i){i(t)})(commonjsGlobal,(function(e){var t=function e(t){return t instanceof HTMLElement};var i=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var a=Object.assign({},t);var r=[];var o=[];var s=function e(){return Object.assign({},a)};var l=function e(){var t=[].concat(r);r.length=0;return t};var c=function e(){var t=[].concat(o);o.length=0;t.forEach((function(e){var t=e.type,i=e.data;u(t,i)}))};var u=function e(t,i,n){if(n&&!document.hidden){o.push({type:t,data:i});return}if(f[t]){f[t](i)}r.push({type:t,data:i})};var d=function e(t){var i;for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++){a[r-1]=arguments[r]}return h[t]?(i=h)[t].apply(i,a):null};var p={getState:s,processActionQueue:l,processDispatchQueue:c,dispatch:u,query:d};var h={};i.forEach((function(e){h=Object.assign({},e(a),{},h)}));var f={};n.forEach((function(e){f=Object.assign({},e(u,d,a),{},f)}));return p};var n=function e(t,i,n){if(typeof n==="function"){t[i]=n;return}Object.defineProperty(t,i,Object.assign({},n))};var a=function e(t,i){for(var n in t){if(!t.hasOwnProperty(n)){continue}i(n,t[n])}};var r=function e(t){var i={};a(t,(function(e){n(i,e,t[e])}));return i};var o=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(n===null){return t.getAttribute(i)||t.hasAttribute(i)}t.setAttribute(i,n)};var s="http://www.w3.org/2000/svg";var l=["svg","path"];var c=function e(t){return l.includes(t)};var u=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(typeof i==="object"){n=i;i=null}var r=c(t)?document.createElementNS(s,t):document.createElement(t);if(i){if(c(t)){o(r,"class",i)}else{r.className=i}}a(n,(function(e,t){o(r,e,t)}));return r};var d=function e(t){return function(e,i){if(typeof i!=="undefined"&&t.children[i]){t.insertBefore(e,t.children[i])}else{t.appendChild(e)}}};var p=function e(t,i){return function(e,t){if(typeof t!=="undefined"){i.splice(t,0,e)}else{i.push(e)}return e}};var h=function e(t,i){return function(e){i.splice(i.indexOf(e),1);if(e.element.parentNode){t.removeChild(e.element)}return e}};var f=function(){return typeof window!=="undefined"&&typeof window.document!=="undefined"}();var g=function e(){return f};var m=g()?u("svg"):{};var v="children"in m?function(e){return e.children.length}:function(e){return e.childNodes.length};var _=function e(t,i,n,a){var r=n[0]||t.left;var o=n[1]||t.top;var s=r+t.width;var l=o+t.height*(a[1]||1);var c={element:Object.assign({},t),inner:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},outer:{left:r,top:o,right:s,bottom:l}};i.filter((function(e){return!e.isRectIgnored()})).map((function(e){return e.rect})).forEach((function(e){b(c.inner,Object.assign({},e.inner));b(c.outer,Object.assign({},e.outer))}));y(c.inner);c.outer.bottom+=c.element.marginBottom;c.outer.right+=c.element.marginRight;y(c.outer);return c};var b=function e(t,i){i.top+=t.top;i.right+=t.left;i.bottom+=t.top;i.left+=t.left;if(i.bottom>t.bottom){t.bottom=i.bottom}if(i.right>t.right){t.right=i.right}};var y=function e(t){t.width=t.right-t.left;t.height=t.bottom-t.top};var w=function e(t){return typeof t==="number"};var x=function e(t,i,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:.001;return Math.abs(t-i)<a&&Math.abs(n)<a};var E=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=t.stiffness,n=i===void 0?.5:i,a=t.damping,o=a===void 0?.75:a,s=t.mass,l=s===void 0?10:s;var c=null;var u=null;var d=0;var p=false;var h=function e(t,i){if(p)return;if(!(w(c)&&w(u))){p=true;d=0;return}var a=-(u-c)*n;d+=a/l;u+=d;d*=o;if(x(u,c,d)||i){u=c;d=0;p=true;g.onupdate(u);g.oncomplete(u)}else{g.onupdate(u)}};var f=function e(t){if(w(t)&&!w(u)){u=t}if(c===null){c=t;u=t}c=t;if(u===c||typeof c==="undefined"){p=true;d=0;g.onupdate(u);g.oncomplete(u);return}p=false};var g=r({interpolate:h,target:{set:f,get:function e(){return c}},resting:{get:function e(){return p}},onupdate:function e(t){},oncomplete:function e(t){}});return g};var k=function e(t){return t<.5?2*t*t:-1+(4-2*t)*t};var I=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=t.duration,n=i===void 0?500:i,a=t.easing,o=a===void 0?k:a,s=t.delay,l=s===void 0?0:s;var c=null;var u;var d;var p=true;var h=false;var f=null;var g=function e(t,i){if(p||f===null)return;if(c===null){c=t}if(t-c<l)return;u=t-c-l;if(u>=n||i){u=1;d=h?0:1;m.onupdate(d*f);m.oncomplete(d*f);p=true}else{d=u/n;m.onupdate((u>=0?o(h?1-d:d):0)*f)}};var m=r({interpolate:g,target:{get:function e(){return h?0:f},set:function e(t){if(f===null){f=t;m.onupdate(t);m.oncomplete(t);return}if(t<f){f=1;h=true}else{h=false;f=t}p=false;c=null}},resting:{get:function e(){return p}},onupdate:function e(t){},oncomplete:function e(t){}});return m};var T={spring:E,tween:I};var S=function e(t,i,n){var a=t[i]&&typeof t[i][n]==="object"?t[i][n]:t[i]||t;var r=typeof a==="string"?a:a.type;var o=typeof a==="object"?Object.assign({},a):{};return T[r]?T[r](o):null};var A=function e(t,i,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;i=Array.isArray(i)?i:[i];i.forEach((function(e){t.forEach((function(t){var i=t;var r=function e(){return n[t]};var o=function e(i){return n[t]=i};if(typeof t==="object"){i=t.key;r=t.getter||r;o=t.setter||o}if(e[i]&&!a){return}e[i]={get:r,set:o}}))}))};var C=function e(t){var i=t.mixinConfig,n=t.viewProps,r=t.viewInternalAPI,o=t.viewExternalAPI;var s=Object.assign({},n);var e=[];a(i,(function(t,i){var a=S(i);if(!a){return}a.onupdate=function(e){n[t]=e};a.target=s[t];var l={key:t,setter:function e(t){if(a.target===t){return}a.target=t},getter:function e(){return n[t]}};A([l],[r,o],n,true);e.push(a)}));return{write:function t(i){var n=document.hidden;var a=true;e.forEach((function(e){if(!e.resting)a=false;e.interpolate(i,n)}));return a},destroy:function e(){}}};var M=function e(t){return function(e,i){t.addEventListener(e,i)}};var D=function e(t){return function(e,i){t.removeEventListener(e,i)}};var L=function e(t){var i=t.viewExternalAPI,n=t.view;var a=[];var r=M(n.element);var o=D(n.element);i.on=function(e,t){a.push({type:e,fn:t});r(e,t)};i.off=function(e,t){a.splice(a.findIndex((function(i){return i.type===e&&i.fn===t})),1);o(e,t)};return{write:function e(){return true},destroy:function e(){a.forEach((function(e){o(e.type,e.fn)}))}}};var O=function e(t){var i=t.mixinConfig,n=t.viewProps,a=t.viewExternalAPI;A(i,a,n)};var P=function e(t){return t!=null};var R={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0};var N=function e(t){var i=t.mixinConfig,n=t.viewProps,a=t.viewInternalAPI,r=t.viewExternalAPI,o=t.view;var s=Object.assign({},n);var l={};A(i,[a,r],n);var c=function e(){return[n["translateX"]||0,n["translateY"]||0]};var u=function e(){return[n["scaleX"]||0,n["scaleY"]||0]};var d=function e(){return o.rect?_(o.rect,o.childViews,c(),u()):null};a.rect={get:d};r.rect={get:d};i.forEach((function(e){n[e]=typeof s[e]==="undefined"?R[e]:s[e]}));return{write:function e(){if(!F(l,n)){return}G(o.element,n);Object.assign(l,Object.assign({},n));return true},destroy:function e(){}}};var F=function e(t,i){if(Object.keys(t).length!==Object.keys(i).length){return true}for(var n in i){if(i[n]!==t[n]){return true}}return false};var G=function e(t,i){var n=i.opacity,a=i.perspective,r=i.translateX,o=i.translateY,s=i.scaleX,l=i.scaleY,c=i.rotateX,u=i.rotateY,d=i.rotateZ,p=i.originX,h=i.originY,f=i.width,g=i.height;var m="";var v="";if(P(p)||P(h)){v+="transform-origin: "+(p||0)+"px "+(h||0)+"px;"}if(P(a)){m+="perspective("+a+"px) "}if(P(r)||P(o)){m+="translate3d("+(r||0)+"px, "+(o||0)+"px, 0) "}if(P(s)||P(l)){m+="scale3d("+(P(s)?s:1)+", "+(P(l)?l:1)+", 1) "}if(P(d)){m+="rotateZ("+d+"rad) "}if(P(c)){m+="rotateX("+c+"rad) "}if(P(u)){m+="rotateY("+u+"rad) "}if(m.length){v+="transform:"+m+";"}if(P(n)){v+="opacity:"+n+";";if(n===0){v+="visibility:hidden;"}if(n<1){v+="pointer-events:none;"}}if(P(g)){v+="height:"+g+"px;"}if(P(f)){v+="width:"+f+"px;"}var _=t.elementCurrentStyle||"";if(v.length!==_.length||v!==_){t.style.cssText=v;t.elementCurrentStyle=v}};var z={styles:N,listeners:L,animations:C,apis:O};var B=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!i.layoutCalculated){t.paddingTop=parseInt(n.paddingTop,10)||0;t.marginTop=parseInt(n.marginTop,10)||0;t.marginRight=parseInt(n.marginRight,10)||0;t.marginBottom=parseInt(n.marginBottom,10)||0;t.marginLeft=parseInt(n.marginLeft,10)||0;i.layoutCalculated=true}t.left=i.offsetLeft||0;t.top=i.offsetTop||0;t.width=i.offsetWidth||0;t.height=i.offsetHeight||0;t.right=t.left+t.width;t.bottom=t.top+t.height;t.scrollTop=i.scrollTop;t.hidden=i.offsetParent===null;return t};var q=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=t.tag,n=i===void 0?"div":i,a=t.name,o=a===void 0?null:a,s=t.attributes,l=s===void 0?{}:s,c=t.read,f=c===void 0?function(){}:c,g=t.write,m=g===void 0?function(){}:g,b=t.create,y=b===void 0?function(){}:b,w=t.destroy,x=w===void 0?function(){}:w,E=t.filterFrameActionsForChild,k=E===void 0?function(e,t){return t}:E,I=t.didCreateView,T=I===void 0?function(){}:I,S=t.didWriteView,A=S===void 0?function(){}:S,C=t.ignoreRect,M=C===void 0?false:C,D=t.ignoreRectUpdate,L=D===void 0?false:D,O=t.mixins,P=O===void 0?[]:O;return function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=u(n,"filepond--"+o,l);var a=window.getComputedStyle(i,null);var s=B();var c=null;var g=false;var b=[];var w=[];var E={};var I={};var S=[m];var C=[f];var D=[x];var O=function e(){return i};var R=function e(){return b.concat()};var N=function e(){return E};var F=function e(t){return function(e,i){return e(t,i)}};var G=function e(){if(c){return c}c=_(s,b,[0,0],[1,1]);return c};var q=function e(){return a};var U=function e(){c=null;b.forEach((function(e){return e._read()}));var n=!(L&&s.width&&s.height);if(n){B(s,i,a)}var r={root:K,props:t,rect:s};C.forEach((function(e){return e(r)}))};var H=function e(i,n,a){var r=n.length===0;S.forEach((function(e){var o=e({props:t,root:K,actions:n,timestamp:i,shouldOptimize:a});if(o===false){r=false}}));w.forEach((function(e){var t=e.write(i);if(t===false){r=false}}));b.filter((function(e){return!!e.element.parentNode})).forEach((function(e){var t=e._write(i,k(e,n),a);if(!t){r=false}}));b.forEach((function(e,t){if(e.element.parentNode){return}K.appendChild(e.element,t);e._read();e._write(i,k(e,n),a);r=false}));g=r;A({props:t,root:K,actions:n,timestamp:i});return r};var V=function e(){w.forEach((function(e){return e.destroy()}));D.forEach((function(e){e({root:K,props:t})}));b.forEach((function(e){return e._destroy()}))};var j={element:{get:O},style:{get:q},childViews:{get:R}};var Y=Object.assign({},j,{rect:{get:G},ref:{get:N},is:function e(t){return o===t},appendChild:d(i),createChildView:F(e),linkView:function e(t){b.push(t);return t},unlinkView:function e(t){b.splice(b.indexOf(t),1)},appendChildView:p(i,b),removeChildView:h(i,b),registerWriter:function e(t){return S.push(t)},registerReader:function e(t){return C.push(t)},registerDestroyer:function e(t){return D.push(t)},invalidateLayout:function e(){return i.layoutCalculated=false},dispatch:e.dispatch,query:e.query});var W={element:{get:O},childViews:{get:R},rect:{get:G},resting:{get:function e(){return g}},isRectIgnored:function e(){return M},_read:U,_write:H,_destroy:V};var X=Object.assign({},j,{rect:{get:function e(){return s}}});Object.keys(P).sort((function(e,t){if(e==="styles"){return 1}else if(t==="styles"){return-1}return 0})).forEach((function(e){var i=z[e]({mixinConfig:P[e],viewProps:t,viewState:I,viewInternalAPI:Y,viewExternalAPI:W,view:r(X)});if(i){w.push(i)}}));var K=r(Y);y({root:K,props:t});var Z=v(i);b.forEach((function(e,t){K.appendChild(e.element,Z+t)}));T(K);return r(W)}};var U=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:60;var a="__framePainter";if(window[a]){window[a].readers.push(t);window[a].writers.push(i);return}window[a]={readers:[t],writers:[i]};var r=window[a];var o=1e3/n;var s=null;var l=null;var c=null;var u=null;var d=function e(){if(document.hidden){c=function e(){return window.setTimeout((function(){return p(performance.now())}),o)};u=function e(){return window.clearTimeout(l)}}else{c=function e(){return window.requestAnimationFrame(p)};u=function e(){return window.cancelAnimationFrame(l)}}};document.addEventListener("visibilitychange",(function(){if(u)u();d();p(performance.now())}));var p=function e(t){l=c(e);if(!s){s=t}var i=t-s;if(i<=o){return}s=t-i%o;r.readers.forEach((function(e){return e()}));r.writers.forEach((function(e){return e(t)}))};d();p(performance.now());return{pause:function e(){u(l)}}};var H=function e(t,i){return function(e){var n=e.root,a=e.props,r=e.actions,o=r===void 0?[]:r,s=e.timestamp,l=e.shouldOptimize;o.filter((function(e){return t[e.type]})).forEach((function(e){return t[e.type]({root:n,props:a,action:e.data,timestamp:s,shouldOptimize:l})}));if(i){i({root:n,props:a,actions:o,timestamp:s,shouldOptimize:l})}}};var V=function e(t,i){return i.parentNode.insertBefore(t,i)};var j=function e(t,i){return i.parentNode.insertBefore(t,i.nextSibling)};var Y=function e(t){return Array.isArray(t)};var W=function e(t){return t==null};var X=function e(t){return t.trim()};var K=function e(t){return""+t};var Z=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:",";if(W(t)){return[]}if(Y(t)){return t}return K(t).split(i).map(X).filter((function(e){return e.length}))};var Q=function e(t){return typeof t==="boolean"};var $=function e(t){return Q(t)?t:t==="true"};var J=function e(t){return typeof t==="string"};var ee=function e(t){return w(t)?t:J(t)?K(t).replace(/[a-z]+/gi,""):0};var te=function e(t){return parseInt(ee(t),10)};var ie=function e(t){return parseFloat(ee(t))};var ne=function e(t){return w(t)&&isFinite(t)&&Math.floor(t)===t};var ae=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1e3;if(ne(t)){return t}var n=K(t).trim();if(/MB$/i.test(n)){n=n.replace(/MB$i/,"").trim();return te(n)*i*i}if(/KB/i.test(n)){n=n.replace(/KB$i/,"").trim();return te(n)*i}return te(n)};var re=function e(t){return typeof t==="function"};var oe=function e(t){var i=self;var n=t.split(".");var a=null;while(a=n.shift()){i=i[a];if(!i){return null}}return i};var se={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"};var le=function e(t){var i={};i.url=J(t)?t:t.url||"";i.timeout=t.timeout?parseInt(t.timeout,10):0;i.headers=t.headers?t.headers:{};a(se,(function(e){i[e]=ce(e,t[e],se[e],i.timeout,i.headers)}));i.process=t.process||J(t)||t.url?i.process:null;i.remove=t.remove||null;delete i.headers;return i};var ce=function e(t,i,n,a,r){if(i===null){return null}if(typeof i==="function"){return i}var o={url:n==="GET"||n==="PATCH"?"?"+t+"=":"",method:n,headers:r,withCredentials:false,timeout:a,onload:null,ondata:null,onerror:null};if(J(i)){o.url=i;return o}Object.assign(o,i);if(J(o.headers)){var s=o.headers.split(/:(.+)/);o.headers={header:s[0],value:s[1]}}o.withCredentials=$(o.withCredentials);return o};var ue=function e(t){return le(t)};var de=function e(t){return t===null};var pe=function e(t){return typeof t==="object"&&t!==null};var he=function e(t){return pe(t)&&J(t.url)&&pe(t.process)&&pe(t.revert)&&pe(t.restore)&&pe(t.fetch)};var fe=function e(t){if(Y(t)){return"array"}if(de(t)){return"null"}if(ne(t)){return"int"}if(/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(t)){return"bytes"}if(he(t)){return"api"}return typeof t};var ge=function e(t){return t.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",')};var me={array:Z,boolean:$,int:function e(t){return fe(t)==="bytes"?ae(t):te(t)},number:ie,float:ie,bytes:ae,string:function e(t){return re(t)?t:K(t)},function:function e(t){return oe(t)},serverapi:ue,object:function e(t){try{return JSON.parse(ge(t))}catch(e){return null}}};var ve=function e(t,i){return me[i](t)};var _e=function e(t,i,n){if(t===i){return t}var a=fe(t);if(a!==n){var r=ve(t,n);a=fe(r);if(r===null){throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+n+'"'}else{t=r}}return t};var be=function e(t,i){var n=t;return{enumerable:true,get:function e(){return n},set:function e(a){n=_e(a,t,i)}}};var ye=function e(t){var i={};a(t,(function(e){var n=t[e];i[e]=be(n[0],n[1])}));return r(i)};var we=function e(t){return{items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:ye(t)}};var xe=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"-";return t.split(/(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join(i)};var Ee=function e(t,i){var n={};a(i,(function(e){n[e]={get:function i(){return t.getState().options[e]},set:function i(n){t.dispatch("SET_"+xe(e,"_").toUpperCase(),{value:n})}}}));return n};var ke=function e(t){return function(e,i,n){var r={};a(t,(function(t){var i=xe(t,"_").toUpperCase();r["SET_"+i]=function(a){try{n.options[t]=a.value}catch(e){}e("DID_SET_"+i,{value:n.options[t]})}}));return r}};var Ie=function e(t){return function(e){var i={};a(t,(function(t){i["GET_"+xe(t,"_").toUpperCase()]=function(i){return e.options[t]}}));return i}};var Te={API:1,DROP:2,BROWSE:3,PASTE:4,NONE:5};var Se=function e(){return Math.random().toString(36).substring(2,11)};function Ae(e,t){if(e==null)return{};var i={};var n=Object.keys(e);var a,r;for(r=0;r<n.length;r++){a=n[r];if(t.indexOf(a)>=0)continue;i[a]=e[a]}return i}function Ce(e,t){if(e==null)return{};var i=Ae(e,t);var n,a;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++){n=r[a];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;i[n]=e[n]}}return i}function Me(e){return De(e)||Le(e)||Oe()}function De(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}function Le(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Oe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var Pe=function e(t,i){return t.splice(i,1)};var Re=function e(t,i){if(i){t()}else if(document.hidden){Promise.resolve(1).then(t)}else{setTimeout(t,0)}};var Ne=function e(){var t=[];var i=function e(i,n){Pe(t,t.findIndex((function(e){return e.event===i&&(e.cb===n||!n)})))};var n=function e(i,n,a){t.filter((function(e){return e.event===i})).map((function(e){return e.cb})).forEach((function(e){return Re((function(){return e.apply(void 0,Me(n))}),a)}))};return{fireSync:function e(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),r=1;r<i;r++){a[r-1]=arguments[r]}n(t,a,true)},fire:function e(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),r=1;r<i;r++){a[r-1]=arguments[r]}n(t,a,false)},on:function e(i,n){t.push({event:i,cb:n})},onOnce:function e(n,a){t.push({event:n,cb:function e(){i(n,a);a.apply(void 0,arguments)}})},off:i}};var Fe=function e(t,i,n){Object.getOwnPropertyNames(t).filter((function(e){return!n.includes(e)})).forEach((function(e){return Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))}))};var Ge=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"];var ze=function e(t){var i={};Fe(t,i,Ge);return i};var Be=function e(t){t.forEach((function(e,i){if(e.released){Pe(t,i)}}))};var qe={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8};var Ue={INPUT:1,LIMBO:2,LOCAL:3};var He=function e(t){return/[^0-9]+/.exec(t)};var Ve=function e(){return He(1.1.toLocaleString())[0]};var je=function e(){var t=Ve();var i=1e3.toLocaleString();var n=1e3.toString();if(i!==n){return He(i)[0]}return t==="."?",":"."};var Ye={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"};var We=[];var Xe=function e(t,i,n){return new Promise((function(e,a){var r=We.filter((function(e){return e.key===t})).map((function(e){return e.cb}));if(r.length===0){e(i);return}var o=r.shift();r.reduce((function(e,t){return e.then((function(e){return t(e,n)}))}),o(i,n)).then((function(t){return e(t)})).catch((function(e){return a(e)}))}))};var Ke=function e(t,i,n){return We.filter((function(e){return e.key===t})).map((function(e){return e.cb(i,n)}))};var Ze=function e(t,i){return We.push({key:t,cb:i})};var Qe=function e(t){return Object.assign(et,t)};var $e=function e(){return Object.assign({},et)};var Je=function e(t){a(t,(function(e,t){if(!et[e]){return}et[e][0]=_e(t,et[e][0],et[e][1])}))};var et={id:[null,Ye.STRING],name:["filepond",Ye.STRING],disabled:[false,Ye.BOOLEAN],className:[null,Ye.STRING],required:[false,Ye.BOOLEAN],captureMethod:[null,Ye.STRING],allowSyncAcceptAttribute:[true,Ye.BOOLEAN],allowDrop:[true,Ye.BOOLEAN],allowBrowse:[true,Ye.BOOLEAN],allowPaste:[true,Ye.BOOLEAN],allowMultiple:[false,Ye.BOOLEAN],allowReplace:[true,Ye.BOOLEAN],allowRevert:[true,Ye.BOOLEAN],allowRemove:[true,Ye.BOOLEAN],allowProcess:[true,Ye.BOOLEAN],allowReorder:[false,Ye.BOOLEAN],allowDirectoriesOnly:[false,Ye.BOOLEAN],storeAsFile:[false,Ye.BOOLEAN],forceRevert:[false,Ye.BOOLEAN],maxFiles:[null,Ye.INT],checkValidity:[false,Ye.BOOLEAN],itemInsertLocationFreedom:[true,Ye.BOOLEAN],itemInsertLocation:["before",Ye.STRING],itemInsertInterval:[75,Ye.INT],dropOnPage:[false,Ye.BOOLEAN],dropOnElement:[true,Ye.BOOLEAN],dropValidation:[false,Ye.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],Ye.ARRAY],instantUpload:[true,Ye.BOOLEAN],maxParallelUploads:[2,Ye.INT],allowMinimumUploadDuration:[true,Ye.BOOLEAN],chunkUploads:[false,Ye.BOOLEAN],chunkForce:[false,Ye.BOOLEAN],chunkSize:[5e6,Ye.INT],chunkRetryDelays:[[500,1e3,3e3],Ye.ARRAY],server:[null,Ye.SERVER_API],fileSizeBase:[1e3,Ye.INT],labelFileSizeBytes:["bytes",Ye.STRING],labelFileSizeKilobytes:["KB",Ye.STRING],labelFileSizeMegabytes:["MB",Ye.STRING],labelFileSizeGigabytes:["GB",Ye.STRING],labelDecimalSeparator:[Ve(),Ye.STRING],labelThousandsSeparator:[je(),Ye.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',Ye.STRING],labelInvalidField:["Field contains invalid files",Ye.STRING],labelFileWaitingForSize:["Waiting for size",Ye.STRING],labelFileSizeNotAvailable:["Size not available",Ye.STRING],labelFileCountSingular:["file in list",Ye.STRING],labelFileCountPlural:["files in list",Ye.STRING],labelFileLoading:["Loading",Ye.STRING],labelFileAdded:["Added",Ye.STRING],labelFileLoadError:["Error during load",Ye.STRING],labelFileRemoved:["Removed",Ye.STRING],labelFileRemoveError:["Error during remove",Ye.STRING],labelFileProcessing:["Uploading",Ye.STRING],labelFileProcessingComplete:["Upload complete",Ye.STRING],labelFileProcessingAborted:["Upload cancelled",Ye.STRING],labelFileProcessingError:["Error during upload",Ye.STRING],labelFileProcessingRevertError:["Error during revert",Ye.STRING],labelTapToCancel:["tap to cancel",Ye.STRING],labelTapToRetry:["tap to retry",Ye.STRING],labelTapToUndo:["tap to undo",Ye.STRING],labelButtonRemoveItem:["Remove",Ye.STRING],labelButtonAbortItemLoad:["Abort",Ye.STRING],labelButtonRetryItemLoad:["Retry",Ye.STRING],labelButtonAbortItemProcessing:["Cancel",Ye.STRING],labelButtonUndoItemProcessing:["Undo",Ye.STRING],labelButtonRetryItemProcessing:["Retry",Ye.STRING],labelButtonProcessItem:["Upload",Ye.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>',Ye.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>',Ye.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>',Ye.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>',Ye.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>',Ye.STRING],oninit:[null,Ye.FUNCTION],onwarning:[null,Ye.FUNCTION],onerror:[null,Ye.FUNCTION],onactivatefile:[null,Ye.FUNCTION],oninitfile:[null,Ye.FUNCTION],onaddfilestart:[null,Ye.FUNCTION],onaddfileprogress:[null,Ye.FUNCTION],onaddfile:[null,Ye.FUNCTION],onprocessfilestart:[null,Ye.FUNCTION],onprocessfileprogress:[null,Ye.FUNCTION],onprocessfileabort:[null,Ye.FUNCTION],onprocessfilerevert:[null,Ye.FUNCTION],onprocessfile:[null,Ye.FUNCTION],onprocessfiles:[null,Ye.FUNCTION],onremovefile:[null,Ye.FUNCTION],onpreparefile:[null,Ye.FUNCTION],onupdatefiles:[null,Ye.FUNCTION],onreorderfiles:[null,Ye.FUNCTION],beforeDropFile:[null,Ye.FUNCTION],beforeAddFile:[null,Ye.FUNCTION],beforeRemoveFile:[null,Ye.FUNCTION],beforePrepareFile:[null,Ye.FUNCTION],stylePanelLayout:[null,Ye.STRING],stylePanelAspectRatio:[null,Ye.STRING],styleItemPanelAspectRatio:[null,Ye.STRING],styleButtonRemoveItemPosition:["left",Ye.STRING],styleButtonProcessItemPosition:["right",Ye.STRING],styleLoadIndicatorPosition:["right",Ye.STRING],styleProgressIndicatorPosition:["right",Ye.STRING],styleButtonRemoveItemAlign:[false,Ye.BOOLEAN],files:[[],Ye.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],Ye.ARRAY]};var tt=function e(t,i){if(W(i)){return t[0]||null}if(ne(i)){return t[i]||null}if(typeof i==="object"){i=i.id}return t.find((function(e){return e.id===i}))||null};var it=function e(t){if(W(t)){return t}if(/:/.test(t)){var i=t.split(":");return i[1]/i[0]}return parseFloat(t)};var nt=function e(t){return t.filter((function(e){return!e.archived}))};var at={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4};var rt=null;var ot=function e(){if(rt===null){try{var t=new DataTransfer;t.items.add(new File(["hello world"],"This_Works.txt"));var i=document.createElement("input");i.setAttribute("type","file");i.files=t.files;rt=i.files.length===1}catch(e){rt=false}}return rt};var st=[qe.LOAD_ERROR,qe.PROCESSING_ERROR,qe.PROCESSING_REVERT_ERROR];var lt=[qe.LOADING,qe.PROCESSING,qe.PROCESSING_QUEUED,qe.INIT];var ct=[qe.PROCESSING_COMPLETE];var ut=function e(t){return st.includes(t.status)};var dt=function e(t){return lt.includes(t.status)};var pt=function e(t){return ct.includes(t.status)};var ht=function e(t){return pe(t.options.server)&&(pe(t.options.server.process)||re(t.options.server.process))};var ft=function e(t){return{GET_STATUS:function e(){var i=nt(t.items);var n=at.EMPTY,a=at.ERROR,r=at.BUSY,o=at.IDLE,s=at.READY;if(i.length===0)return n;if(i.some(ut))return a;if(i.some(dt))return r;if(i.some(pt))return s;return o},GET_ITEM:function e(i){return tt(t.items,i)},GET_ACTIVE_ITEM:function e(i){return tt(nt(t.items),i)},GET_ACTIVE_ITEMS:function e(){return nt(t.items)},GET_ITEMS:function e(){return t.items},GET_ITEM_NAME:function e(i){var n=tt(t.items,i);return n?n.filename:null},GET_ITEM_SIZE:function e(i){var n=tt(t.items,i);return n?n.fileSize:null},GET_STYLES:function e(){return Object.keys(t.options).filter((function(e){return/^style/.test(e)})).map((function(e){return{name:e,value:t.options[e]}}))},GET_PANEL_ASPECT_RATIO:function e(){var i=/circle/.test(t.options.stylePanelLayout);var n=i?1:it(t.options.stylePanelAspectRatio);return n},GET_ITEM_PANEL_ASPECT_RATIO:function e(){return t.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function e(i){return nt(t.items).filter((function(e){return e.status===i}))},GET_TOTAL_ITEMS:function e(){return nt(t.items).length},SHOULD_UPDATE_FILE_INPUT:function e(){return t.options.storeAsFile&&ot()&&!ht(t)},IS_ASYNC:function e(){return ht(t)},GET_FILE_SIZE_LABELS:function e(t){return{labelBytes:t("GET_LABEL_FILE_SIZE_BYTES")||undefined,labelKilobytes:t("GET_LABEL_FILE_SIZE_KILOBYTES")||undefined,labelMegabytes:t("GET_LABEL_FILE_SIZE_MEGABYTES")||undefined,labelGigabytes:t("GET_LABEL_FILE_SIZE_GIGABYTES")||undefined}}}};var gt=function e(t){var i=nt(t.items).length;if(!t.options.allowMultiple){return i===0}var n=t.options.maxFiles;if(n===null){return true}if(i<n){return true}return false};var mt=function e(t,i,n){return Math.max(Math.min(n,t),i)};var vt=function e(t,i,n){return t.splice(i,0,n)};var _t=function e(t,i,n){if(W(i)){return null}if(typeof n==="undefined"){t.push(i);return i}n=mt(n,0,t.length);vt(t,n,i);return i};var bt=function e(t){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(t)};var yt=function e(t){return t.split("/").pop().split("?").shift()};var wt=function e(t){return t.split(".").pop()};var xt=function e(t){if(typeof t!=="string"){return""}var i=t.split("/").pop();if(/svg/.test(i)){return"svg"}if(/zip|compressed/.test(i)){return"zip"}if(/plain/.test(i)){return"txt"}if(/msword/.test(i)){return"doc"}if(/[a-z]+/.test(i)){if(i==="jpeg"){return"jpg"}return i}return""};var Et=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return(i+t).slice(-i.length)};var kt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:new Date;return t.getFullYear()+"-"+Et(t.getMonth()+1,"00")+"-"+Et(t.getDate(),"00")+"_"+Et(t.getHours(),"00")+"-"+Et(t.getMinutes(),"00")+"-"+Et(t.getSeconds(),"00")};var It=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var r=typeof n==="string"?t.slice(0,t.size,n):t.slice(0,t.size,t.type);r.lastModifiedDate=new Date;if(t._relativePath)r._relativePath=t._relativePath;if(!J(i)){i=kt()}if(i&&a===null&&wt(i)){r.name=i}else{a=a||xt(r.type);r.name=i+(a?"."+a:"")}return r};var Tt=function e(){return window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder};var St=function e(t,i){var n=Tt();if(n){var a=new n;a.append(t);return a.getBlob(i)}return new Blob([t],{type:i})};var At=function e(t,i){var n=new ArrayBuffer(t.length);var a=new Uint8Array(n);for(var r=0;r<t.length;r++){a[r]=t.charCodeAt(r)}return St(n,i)};var Ct=function e(t){return(/^data:(.+);/.exec(t)||[])[1]||null};var Mt=function e(t){var i=t.split(",")[1];return i.replace(/\s/g,"")};var Dt=function e(t){return atob(Mt(t))};var Lt=function e(t){var i=Ct(t);var n=Dt(t);return At(n,i)};var Ot=function e(t,i,n){return It(Lt(t),i,null,n)};var Pt=function e(t){if(!/^content-disposition:/i.test(t))return null;var i=t.split(/filename=|filename\*=.+''/).splice(1).map((function(e){return e.trim().replace(/^["']|[;"']{0,2}$/g,"")})).filter((function(e){return e.length}));return i.length?decodeURI(i[i.length-1]):null};var Rt=function e(t){if(/content-length:/i.test(t)){var i=t.match(/[0-9]+/)[0];return i?parseInt(i,10):null}return null};var Nt=function e(t){if(/x-content-transfer-id:/i.test(t)){var i=(t.split(":")[1]||"").trim();return i||null}return null};var Ft=function e(t){var i={source:null,name:null,size:null};var n=t.split("\n");var a=true;var r=false;var o=undefined;try{for(var s=n[Symbol.iterator](),l;!(a=(l=s.next()).done);a=true){var c=l.value;var u=Pt(c);if(u){i.name=u;continue}var d=Rt(c);if(d){i.size=d;continue}var p=Nt(c);if(p){i.source=p;continue}}}catch(e){r=true;o=e}finally{try{if(!a&&s.return!=null){s.return()}}finally{if(r){throw o}}}return i};var Gt=function e(t){var i={source:null,complete:false,progress:0,size:null,timestamp:null,duration:0,request:null};var n=function e(){return i.progress};var a=function e(){if(i.request&&i.request.abort){i.request.abort()}};var r=function e(){var t=i.source;s.fire("init",t);if(t instanceof File){s.fire("load",t)}else if(t instanceof Blob){s.fire("load",It(t,t.name))}else if(bt(t)){s.fire("load",Ot(t))}else{o(t)}};var o=function e(n){if(!t){s.fire("error",{type:"error",body:"Can't load URL",code:400});return}i.timestamp=Date.now();i.request=t(n,(function(e){i.duration=Date.now()-i.timestamp;i.complete=true;if(e instanceof Blob){e=It(e,e.name||yt(n))}s.fire("load",e instanceof Blob?e:e?e.body:null)}),(function(e){s.fire("error",typeof e==="string"?{type:"error",code:0,body:e}:e)}),(function(e,t,n){if(n){i.size=n}i.duration=Date.now()-i.timestamp;if(!e){i.progress=null;return}i.progress=t/n;s.fire("progress",i.progress)}),(function(){s.fire("abort")}),(function(e){var t=Ft(typeof e==="string"?e:e.headers);s.fire("meta",{size:i.size||t.size,filename:t.name,source:t.source})}))};var s=Object.assign({},Ne(),{setSource:function e(t){return i.source=t},getProgress:n,abort:a,load:r});return s};var zt=function e(t){return/GET|HEAD/.test(t)};var Bt=function e(t,i,n){var a={onheaders:function e(){},onprogress:function e(){},onload:function e(){},ontimeout:function e(){},onerror:function e(){},onabort:function e(){},abort:function e(){r=true;s.abort()}};var r=false;var o=false;n=Object.assign({method:"POST",headers:{},withCredentials:false},n);i=encodeURI(i);if(zt(n.method)&&t){i=""+i+encodeURIComponent(typeof t==="string"?t:JSON.stringify(t))}var s=new XMLHttpRequest;var l=zt(n.method)?s:s.upload;l.onprogress=function(e){if(r){return}a.onprogress(e.lengthComputable,e.loaded,e.total)};s.onreadystatechange=function(){if(s.readyState<2){return}if(s.readyState===4&&s.status===0){return}if(o){return}o=true;a.onheaders(s)};s.onload=function(){if(s.status>=200&&s.status<300){a.onload(s)}else{a.onerror(s)}};s.onerror=function(){return a.onerror(s)};s.onabort=function(){r=true;a.onabort()};s.ontimeout=function(){return a.ontimeout(s)};s.open(n.method,i,true);if(ne(n.timeout)){s.timeout=n.timeout}Object.keys(n.headers).forEach((function(e){var t=unescape(encodeURIComponent(n.headers[e]));s.setRequestHeader(e,t)}));if(n.responseType){s.responseType=n.responseType}if(n.withCredentials){s.withCredentials=true}s.send(t);return a};var qt=function e(t,i,n,a){return{type:t,code:i,body:n,headers:a}};var Ut=function e(t){return function(e){t(qt("error",0,"Timeout",e.getAllResponseHeaders()))}};var Ht=function e(t){return/\?/.test(t)};var Vt=function e(){var t="";for(var i=arguments.length,n=new Array(i),a=0;a<i;a++){n[a]=arguments[a]}n.forEach((function(e){t+=Ht(t)&&Ht(e)?e.replace(/\?/,"&"):e}));return t};var jt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var i=arguments.length>1?arguments[1]:undefined;if(typeof i==="function"){return i}if(!i||!J(i.url)){return null}var n=i.onload||function(e){return e};var a=i.onerror||function(e){return null};return function(e,r,o,s,l,c){var u=Bt(e,Vt(t,i.url),Object.assign({},i,{responseType:"blob"}));u.onload=function(t){var a=t.getAllResponseHeaders();var o=Ft(a).name||yt(e);r(qt("load",t.status,i.method==="HEAD"?null:It(n(t.response),o),a))};u.onerror=function(e){o(qt("error",e.status,a(e.response)||e.statusText,e.getAllResponseHeaders()))};u.onheaders=function(e){c(qt("headers",e.status,null,e.getAllResponseHeaders()))};u.ontimeout=Ut(o);u.onprogress=s;u.onabort=l;return u}};var Yt={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4};var Wt=function e(t,i,n,a,r,o,s,l,c,u,d){var p=[];var h=d.chunkTransferId,f=d.chunkServer,g=d.chunkSize,m=d.chunkRetryDelays;var v={serverId:h,aborted:false};var _=i.ondata||function(e){return e};var b=i.onload||function(e,t){return t==="HEAD"?e.getResponseHeader("Upload-Offset"):e.response};var y=i.onerror||function(e){return null};var w=function e(o){var l=new FormData;if(pe(r))l.append(n,JSON.stringify(r));var c=typeof i.headers==="function"?i.headers(a,r):Object.assign({},i.headers,{"Upload-Length":a.size});var u=Object.assign({},i,{headers:c});var d=Bt(_(l),Vt(t,i.url),u);d.onload=function(e){return o(b(e,u.method))};d.onerror=function(e){return s(qt("error",e.status,y(e.response)||e.statusText,e.getAllResponseHeaders()))};d.ontimeout=Ut(s)};var x=function e(n){var a=Vt(t,f.url,v.serverId);var r=typeof i.headers==="function"?i.headers(v.serverId):Object.assign({},i.headers);var o={headers:r,method:"HEAD"};var l=Bt(null,a,o);l.onload=function(e){return n(b(e,o.method))};l.onerror=function(e){return s(qt("error",e.status,y(e.response)||e.statusText,e.getAllResponseHeaders()))};l.ontimeout=Ut(s)};var E=Math.floor(a.size/g);for(var k=0;k<=E;k++){var I=k*g;var T=a.slice(I,I+g,"application/offset+octet-stream");p[k]={index:k,size:T.size,offset:I,data:T,file:a,progress:0,retries:Me(m),status:Yt.QUEUED,error:null,request:null,timeout:null}}var S=function e(){return o(v.serverId)};var A=function e(t){return t.status===Yt.QUEUED||t.status===Yt.ERROR};var C=function e(i){if(v.aborted)return;i=i||p.find(A);if(!i){if(p.every((function(e){return e.status===Yt.COMPLETE}))){S()}return}i.status=Yt.PROCESSING;i.progress=null;var n=f.ondata||function(e){return e};var r=f.onerror||function(e){return null};var o=Vt(t,f.url,v.serverId);var l=typeof f.headers==="function"?f.headers(i):Object.assign({},f.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":i.offset,"Upload-Length":a.size,"Upload-Name":a.name});var u=i.request=Bt(n(i.data),o,Object.assign({},f,{headers:l}));u.onload=function(){i.status=Yt.COMPLETE;i.request=null;L()};u.onprogress=function(e,t,n){i.progress=e?t:null;D()};u.onerror=function(e){i.status=Yt.ERROR;i.request=null;i.error=r(e.response)||e.statusText;if(!M(i)){s(qt("error",e.status,r(e.response)||e.statusText,e.getAllResponseHeaders()))}};u.ontimeout=function(e){i.status=Yt.ERROR;i.request=null;if(!M(i)){Ut(s)(e)}};u.onabort=function(){i.status=Yt.QUEUED;i.request=null;c()}};var M=function e(t){if(t.retries.length===0)return false;t.status=Yt.WAITING;clearTimeout(t.timeout);t.timeout=setTimeout((function(){C(t)}),t.retries.shift());return true};var D=function e(){var t=p.reduce((function(e,t){if(e===null||t.progress===null)return null;return e+t.progress}),0);if(t===null)return l(false,0,0);var i=p.reduce((function(e,t){return e+t.size}),0);l(true,t,i)};var L=function e(){var t=p.filter((function(e){return e.status===Yt.PROCESSING})).length;if(t>=1)return;C()};var O=function e(){p.forEach((function(e){clearTimeout(e.timeout);if(e.request){e.request.abort()}}))};if(!v.serverId){w((function(e){if(v.aborted)return;u(e);v.serverId=e;L()}))}else{x((function(e){if(v.aborted)return;p.filter((function(t){return t.offset<e})).forEach((function(e){e.status=Yt.COMPLETE;e.progress=e.size}));L()}))}return{abort:function e(){v.aborted=true;O()}}};var Xt=function e(t,i,n,a){return function(e,r,o,s,l,c,u){if(!e)return;var d=a.chunkUploads;var p=d&&e.size>a.chunkSize;var h=d&&(p||a.chunkForce);if(e instanceof Blob&&h)return Wt(t,i,n,e,r,o,s,l,c,u,a);var f=i.ondata||function(e){return e};var g=i.onload||function(e){return e};var m=i.onerror||function(e){return null};var v=typeof i.headers==="function"?i.headers(e,r)||{}:Object.assign({},i.headers);var _=Object.assign({},i,{headers:v});var b=new FormData;if(pe(r)){b.append(n,JSON.stringify(r))}(e instanceof Blob?[{name:null,file:e}]:e).forEach((function(e){b.append(n,e.file,e.name===null?e.file.name:""+e.name+e.file.name)}));var y=Bt(f(b),Vt(t,i.url),_);y.onload=function(e){o(qt("load",e.status,g(e.response),e.getAllResponseHeaders()))};y.onerror=function(e){s(qt("error",e.status,m(e.response)||e.statusText,e.getAllResponseHeaders()))};y.ontimeout=Ut(s);y.onprogress=l;y.onabort=c;return y}};var Kt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var i=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;var a=arguments.length>3?arguments[3]:undefined;if(typeof i==="function")return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return i.apply(void 0,[n].concat(t,[a]))};if(!i||!J(i.url))return null;return Xt(t,i,n,a)};var Zt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var i=arguments.length>1?arguments[1]:undefined;if(typeof i==="function"){return i}if(!i||!J(i.url)){return function(e,t){return t()}}var n=i.onload||function(e){return e};var a=i.onerror||function(e){return null};return function(e,r,o){var s=Bt(e,t+i.url,i);s.onload=function(e){r(qt("load",e.status,n(e.response),e.getAllResponseHeaders()))};s.onerror=function(e){o(qt("error",e.status,a(e.response)||e.statusText,e.getAllResponseHeaders()))};s.ontimeout=Ut(o);return s}};var Qt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return t+Math.random()*(i-t)};var $t=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1e3;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:25;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:250;var r=null;var o=Date.now();var s=function e(){var s=Date.now()-o;var l=Qt(n,a);if(s+l>i){l=s+l-i}var c=s/i;if(c>=1||document.hidden){t(1);return}t(c);r=setTimeout(e,l)};if(i>0)s();return{clear:function e(){clearTimeout(r)}}};var Jt=function e(t,i){var n={complete:false,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null};var a=i.allowMinimumUploadDuration;var r=function e(i,r){var o=function e(){if(n.duration===0||n.progress===null)return;u.fire("progress",u.getProgress())};var s=function e(){n.complete=true;u.fire("load-perceived",n.response.body)};u.fire("start");n.timestamp=Date.now();n.perceivedPerformanceUpdater=$t((function(e){n.perceivedProgress=e;n.perceivedDuration=Date.now()-n.timestamp;o();if(n.response&&n.perceivedProgress===1&&!n.complete){s()}}),a?Qt(750,1500):0);n.request=t(i,r,(function(e){n.response=pe(e)?e:{type:"load",code:200,body:""+e,headers:{}};n.duration=Date.now()-n.timestamp;n.progress=1;u.fire("load",n.response.body);if(!a||a&&n.perceivedProgress===1){s()}}),(function(e){n.perceivedPerformanceUpdater.clear();u.fire("error",pe(e)?e:{type:"error",code:0,body:""+e})}),(function(e,t,i){n.duration=Date.now()-n.timestamp;n.progress=e?t/i:null;o()}),(function(){n.perceivedPerformanceUpdater.clear();u.fire("abort",n.response?n.response.body:null)}),(function(e){u.fire("transfer",e)}))};var o=function e(){if(!n.request)return;n.perceivedPerformanceUpdater.clear();if(n.request.abort)n.request.abort();n.complete=true};var s=function e(){o();n.complete=false;n.perceivedProgress=0;n.progress=0;n.timestamp=null;n.perceivedDuration=0;n.duration=0;n.request=null;n.response=null};var l=a?function(){return n.progress?Math.min(n.progress,n.perceivedProgress):null}:function(){return n.progress||null};var c=a?function(){return Math.min(n.duration,n.perceivedDuration)}:function(){return n.duration};var u=Object.assign({},Ne(),{process:r,abort:o,getProgress:l,getDuration:c,reset:s});return u};var ei=function e(t){return t.substring(0,t.lastIndexOf("."))||t};var ti=function e(t){var i=[t.name,t.size,t.type];if(t instanceof Blob||bt(t)){i[0]=t.name||kt()}else if(bt(t)){i[1]=t.length;i[2]=Ct(t)}else if(J(t)){i[0]=yt(t);i[1]=0;i[2]="application/octet-stream"}return{name:i[0],size:i[1],type:i[2]}};var ii=function e(t){return!!(t instanceof File||t instanceof Blob&&t.name)};var ni=function e(t){if(!pe(t))return t;var i=Y(t)?[]:{};for(var n in t){if(!t.hasOwnProperty(n))continue;var a=t[n];i[n]=a&&pe(a)?e(a):a}return i};var ai=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var a=Se();var o={archived:false,frozen:false,released:false,source:null,file:n,serverFileReference:i,transferId:null,processingAborted:false,status:i?qe.PROCESSING_COMPLETE:qe.INIT,activeLoader:null,activeProcessor:null};var s=null;var l={};var c=function e(t){return o.status=t};var u=function e(t){if(o.released||o.frozen)return;for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++){n[a-1]=arguments[a]}k.fire.apply(k,[t].concat(n))};var d=function e(){return wt(o.file.name)};var p=function e(){return o.file.type};var h=function e(){return o.file.size};var f=function e(){return o.file};var g=function e(i,n,a){o.source=i;k.fireSync("init");if(o.file){k.fireSync("load-skip");return}o.file=ti(i);n.on("init",(function(){u("load-init")}));n.on("meta",(function(e){o.file.size=e.size;o.file.filename=e.filename;if(e.source){t=Ue.LIMBO;o.serverFileReference=e.source;o.status=qe.PROCESSING_COMPLETE}u("load-meta")}));n.on("progress",(function(e){c(qe.LOADING);u("load-progress",e)}));n.on("error",(function(e){c(qe.LOAD_ERROR);u("load-request-error",e)}));n.on("abort",(function(){c(qe.INIT);u("load-abort")}));n.on("load",(function(e){o.activeLoader=null;var i=function e(i){o.file=ii(i)?i:o.file;if(t===Ue.LIMBO&&o.serverFileReference){c(qe.PROCESSING_COMPLETE)}else{c(qe.IDLE)}u("load")};var n=function t(i){o.file=e;u("load-meta");c(qe.LOAD_ERROR);u("load-file-error",i)};if(o.serverFileReference){i(e);return}a(e,i,n)}));n.setSource(i);o.activeLoader=n;n.load()};var m=function e(){if(!o.activeLoader){return}o.activeLoader.load()};var v=function e(){if(o.activeLoader){o.activeLoader.abort();return}c(qe.INIT);u("load-abort")};var _=function e(t,i){if(o.processingAborted){o.processingAborted=false;return}c(qe.PROCESSING);s=null;if(!(o.file instanceof Blob)){k.on("load",(function(){e(t,i)}));return}t.on("load",(function(e){o.transferId=null;o.serverFileReference=e}));t.on("transfer",(function(e){o.transferId=e}));t.on("load-perceived",(function(e){o.activeProcessor=null;o.transferId=null;o.serverFileReference=e;c(qe.PROCESSING_COMPLETE);u("process-complete",e)}));t.on("start",(function(){u("process-start")}));t.on("error",(function(e){o.activeProcessor=null;c(qe.PROCESSING_ERROR);u("process-error",e)}));t.on("abort",(function(e){o.activeProcessor=null;o.serverFileReference=e;c(qe.IDLE);u("process-abort");if(s){s()}}));t.on("progress",(function(e){u("process-progress",e)}));var n=function e(i){if(o.archived)return;t.process(i,Object.assign({},l))};var a=console.error;i(o.file,n,a);o.activeProcessor=t};var b=function e(){o.processingAborted=false;c(qe.PROCESSING_QUEUED)};var y=function e(){return new Promise((function(e){if(!o.activeProcessor){o.processingAborted=true;c(qe.IDLE);u("process-abort");e();return}s=function t(){e()};o.activeProcessor.abort()}))};var w=function e(t,i){return new Promise((function(e,n){var a=o.serverFileReference!==null?o.serverFileReference:o.transferId;if(a===null){e();return}t(a,(function(){o.serverFileReference=null;o.transferId=null;e()}),(function(t){if(!i){e();return}c(qe.PROCESSING_REVERT_ERROR);u("process-revert-error");n(t)}));c(qe.IDLE);u("process-revert")}))};var x=function e(t,i,n){var a=t.split(".");var r=a[0];var o=a.pop();var s=l;a.forEach((function(e){return s=s[e]}));if(JSON.stringify(s[o])===JSON.stringify(i))return;s[o]=i;u("metadata-update",{key:r,value:l[r],silent:n})};var E=function e(t){return ni(t?l[t]:l)};var k=Object.assign({id:{get:function e(){return a}},origin:{get:function e(){return t},set:function e(i){return t=i}},serverId:{get:function e(){return o.serverFileReference}},transferId:{get:function e(){return o.transferId}},status:{get:function e(){return o.status}},filename:{get:function e(){return o.file.name}},filenameWithoutExtension:{get:function e(){return ei(o.file.name)}},fileExtension:{get:d},fileType:{get:p},fileSize:{get:h},file:{get:f},relativePath:{get:function e(){return o.file._relativePath}},source:{get:function e(){return o.source}},getMetadata:E,setMetadata:function e(t,i,n){if(pe(t)){var a=t;Object.keys(a).forEach((function(e){x(e,a[e],i)}));return t}x(t,i,n);return i},extend:function e(t,i){return I[t]=i},abortLoad:v,retryLoad:m,requestProcessing:b,abortProcessing:y,load:g,process:_,revert:w},Ne(),{freeze:function e(){return o.frozen=true},release:function e(){return o.released=true},released:{get:function e(){return o.released}},archive:function e(){return o.archived=true},archived:{get:function e(){return o.archived}}});var I=r(k);return I};var ri=function e(t,i){if(W(i)){return 0}if(!J(i)){return-1}return t.findIndex((function(e){return e.id===i}))};var oi=function e(t,i){var n=ri(t,i);if(n<0){return}return t[n]||null};var si=function e(t,i,n,a,r,o){var s=Bt(null,t,{method:"GET",responseType:"blob"});s.onload=function(e){var n=e.getAllResponseHeaders();var a=Ft(n).name||yt(t);i(qt("load",e.status,It(e.response,a),n))};s.onerror=function(e){n(qt("error",e.status,e.statusText,e.getAllResponseHeaders()))};s.onheaders=function(e){o(qt("headers",e.status,null,e.getAllResponseHeaders()))};s.ontimeout=Ut(n);s.onprogress=a;s.onabort=r;return s};var li=function e(t){if(t.indexOf("//")===0){t=location.protocol+t}return t.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]};var ci=function e(t){return(t.indexOf(":")>-1||t.indexOf("//")>-1)&&li(location.href)!==li(t)};var ui=function e(t){return function(){return re(t)?t.apply(void 0,arguments):t}};var di=function e(t){return!ii(t.file)};var pi=function e(t,i){clearTimeout(i.listUpdateTimeout);i.listUpdateTimeout=setTimeout((function(){t("DID_UPDATE_ITEMS",{items:nt(i.items)})}),0)};var hi=function e(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++){n[a-1]=arguments[a]}return new Promise((function(e){if(!t){return e(true)}var i=t.apply(void 0,n);if(i==null){return e(true)}if(typeof i==="boolean"){return e(i)}if(typeof i.then==="function"){i.then(e)}}))};var fi=function e(t,i){t.items.sort((function(e,t){return i(ze(e),ze(t))}))};var gi=function e(t,i){return function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=e.query,a=e.success,r=a===void 0?function(){}:a,o=e.failure,s=o===void 0?function(){}:o,l=Ce(e,["query","success","failure"]);var c=tt(t.items,n);if(!c){s({error:qt("error",0,"Item not found"),file:null});return}i(c,r,s,l||{})}};var mi=function e(t,i,n){return{ABORT_ALL:function e(){nt(n.items).forEach((function(e){e.freeze();e.abortLoad();e.abortProcessing()}))},DID_SET_FILES:function e(i){var a=i.value,r=a===void 0?[]:a;var o=r.map((function(e){return{source:e.source?e.source:e,options:e.options}}));var s=nt(n.items);s.forEach((function(e){if(!o.find((function(t){return t.source===e.source||t.source===e.file}))){t("REMOVE_ITEM",{query:e,remove:false})}}));s=nt(n.items);o.forEach((function(e,i){if(s.find((function(t){return t.source===e.source||t.file===e.source})))return;t("ADD_ITEM",Object.assign({},e,{interactionMethod:Te.NONE,index:i}))}))},DID_UPDATE_ITEM_METADATA:function e(a){var r=a.id,o=a.action,s=a.change;if(s.silent)return;clearTimeout(n.itemUpdateTimeout);n.itemUpdateTimeout=setTimeout((function(){var e=oi(n.items,r);if(!i("IS_ASYNC")){Xe("SHOULD_PREPARE_OUTPUT",false,{item:e,query:i,action:o,change:s}).then((function(n){var a=i("GET_BEFORE_PREPARE_FILE");if(a)n=a(e,n);if(!n)return;t("REQUEST_PREPARE_OUTPUT",{query:r,item:e,success:function e(i){t("DID_PREPARE_OUTPUT",{id:r,file:i})}},true)}));return}if(e.origin===Ue.LOCAL){t("DID_LOAD_ITEM",{id:e.id,error:null,serverFileReference:e.source})}var a=function e(){setTimeout((function(){t("REQUEST_ITEM_PROCESSING",{query:r})}),32)};var l=function t(r){e.revert(Zt(n.options.server.url,n.options.server.revert),i("GET_FORCE_REVERT")).then(r?a:function(){}).catch((function(){}))};var c=function t(i){e.abortProcessing().then(i?a:function(){})};if(e.status===qe.PROCESSING_COMPLETE){return l(n.options.instantUpload)}if(e.status===qe.PROCESSING){return c(n.options.instantUpload)}if(n.options.instantUpload){a()}}),0)},MOVE_ITEM:function e(t){var i=t.query,a=t.index;var r=tt(n.items,i);if(!r)return;var o=n.items.indexOf(r);a=mt(a,0,n.items.length-1);if(o===a)return;n.items.splice(a,0,n.items.splice(o,1)[0])},SORT:function e(a){var r=a.compare;fi(n,r);t("DID_SORT_ITEMS",{items:i("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function e(n){var a=n.items,r=n.index,o=n.interactionMethod,s=n.success,l=s===void 0?function(){}:s,c=n.failure,u=c===void 0?function(){}:c;var d=r;if(r===-1||typeof r==="undefined"){var p=i("GET_ITEM_INSERT_LOCATION");var h=i("GET_TOTAL_ITEMS");d=p==="before"?0:h}var f=i("GET_IGNORED_FILES");var g=function e(t){return ii(t)?!f.includes(t.name.toLowerCase()):!W(t)};var m=a.filter(g);var v=m.map((function(e){return new Promise((function(i,n){t("ADD_ITEM",{interactionMethod:o,source:e.source||e,success:i,failure:n,index:d++,options:e.options||{}})}))}));Promise.all(v).then(l).catch(u)},ADD_ITEM:function e(a){var r=a.source,o=a.index,s=o===void 0?-1:o,l=a.interactionMethod,c=a.success,u=c===void 0?function(){}:c,d=a.failure,p=d===void 0?function(){}:d,h=a.options,f=h===void 0?{}:h;if(W(r)){p({error:qt("error",0,"No source"),file:null});return}if(ii(r)&&n.options.ignoredFiles.includes(r.name.toLowerCase())){return}if(!gt(n)){if(n.options.allowMultiple||!n.options.allowMultiple&&!n.options.allowReplace){var g=qt("warning",0,"Max files");t("DID_THROW_MAX_FILES",{source:r,error:g});p({error:g,file:null});return}var m=nt(n.items)[0];if(m.status===qe.PROCESSING_COMPLETE||m.status===qe.PROCESSING_REVERT_ERROR){var v=i("GET_FORCE_REVERT");m.revert(Zt(n.options.server.url,n.options.server.revert),v).then((function(){if(!v)return;t("ADD_ITEM",{source:r,index:s,interactionMethod:l,success:u,failure:p,options:f})})).catch((function(){}));if(v)return}t("REMOVE_ITEM",{query:m.id})}var _=f.type==="local"?Ue.LOCAL:f.type==="limbo"?Ue.LIMBO:Ue.INPUT;var b=ai(_,_===Ue.INPUT?null:r,f.file);Object.keys(f.metadata||{}).forEach((function(e){b.setMetadata(e,f.metadata[e])}));Ke("DID_CREATE_ITEM",b,{query:i,dispatch:t});var y=i("GET_ITEM_INSERT_LOCATION");if(!n.options.itemInsertLocationFreedom){s=y==="before"?-1:n.items.length}_t(n.items,b,s);if(re(y)&&r){fi(n,y)}var w=b.id;b.on("init",(function(){t("DID_INIT_ITEM",{id:w})}));b.on("load-init",(function(){t("DID_START_ITEM_LOAD",{id:w})}));b.on("load-meta",(function(){t("DID_UPDATE_ITEM_META",{id:w})}));b.on("load-progress",(function(e){t("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:w,progress:e})}));b.on("load-request-error",(function(e){var i=ui(n.options.labelFileLoadError)(e);if(e.code>=400&&e.code<500){t("DID_THROW_ITEM_INVALID",{id:w,error:e,status:{main:i,sub:e.code+" ("+e.body+")"}});p({error:e,file:ze(b)});return}t("DID_THROW_ITEM_LOAD_ERROR",{id:w,error:e,status:{main:i,sub:n.options.labelTapToRetry}})}));b.on("load-file-error",(function(e){t("DID_THROW_ITEM_INVALID",{id:w,error:e.status,status:e.status});p({error:e.status,file:ze(b)})}));b.on("load-abort",(function(){t("REMOVE_ITEM",{query:w})}));b.on("load-skip",(function(){t("COMPLETE_LOAD_ITEM",{query:w,item:b,data:{source:r,success:u}})}));b.on("load",(function(){var e=function e(a){if(!a){t("REMOVE_ITEM",{query:w});return}b.on("metadata-update",(function(e){t("DID_UPDATE_ITEM_METADATA",{id:w,change:e})}));Xe("SHOULD_PREPARE_OUTPUT",false,{item:b,query:i}).then((function(e){var a=i("GET_BEFORE_PREPARE_FILE");if(a)e=a(b,e);var o=function e(){t("COMPLETE_LOAD_ITEM",{query:w,item:b,data:{source:r,success:u}});pi(t,n)};if(e){t("REQUEST_PREPARE_OUTPUT",{query:w,item:b,success:function e(i){t("DID_PREPARE_OUTPUT",{id:w,file:i});o()}},true);return}o()}))};Xe("DID_LOAD_ITEM",b,{query:i,dispatch:t}).then((function(){hi(i("GET_BEFORE_ADD_FILE"),ze(b)).then(e)})).catch((function(i){if(!i||!i.error||!i.status)return e(false);t("DID_THROW_ITEM_INVALID",{id:w,error:i.error,status:i.status})}))}));b.on("process-start",(function(){t("DID_START_ITEM_PROCESSING",{id:w})}));b.on("process-progress",(function(e){t("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:w,progress:e})}));b.on("process-error",(function(e){t("DID_THROW_ITEM_PROCESSING_ERROR",{id:w,error:e,status:{main:ui(n.options.labelFileProcessingError)(e),sub:n.options.labelTapToRetry}})}));b.on("process-revert-error",(function(e){t("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:w,error:e,status:{main:ui(n.options.labelFileProcessingRevertError)(e),sub:n.options.labelTapToRetry}})}));b.on("process-complete",(function(e){t("DID_COMPLETE_ITEM_PROCESSING",{id:w,error:null,serverFileReference:e});t("DID_DEFINE_VALUE",{id:w,value:e})}));b.on("process-abort",(function(){t("DID_ABORT_ITEM_PROCESSING",{id:w})}));b.on("process-revert",(function(){t("DID_REVERT_ITEM_PROCESSING",{id:w});t("DID_DEFINE_VALUE",{id:w,value:null})}));t("DID_ADD_ITEM",{id:w,index:s,interactionMethod:l});pi(t,n);var x=n.options.server||{},E=x.url,k=x.load,I=x.restore,T=x.fetch;b.load(r,Gt(_===Ue.INPUT?J(r)&&ci(r)?T?jt(E,T):si:si:_===Ue.LIMBO?jt(E,I):jt(E,k)),(function(e,t,n){Xe("LOAD_FILE",e,{query:i}).then(t).catch(n)}))},REQUEST_PREPARE_OUTPUT:function e(t){var n=t.item,a=t.success,r=t.failure,o=r===void 0?function(){}:r;var s={error:qt("error",0,"Item not found"),file:null};if(n.archived)return o(s);Xe("PREPARE_OUTPUT",n.file,{query:i,item:n}).then((function(e){Xe("COMPLETE_PREPARE_OUTPUT",e,{query:i,item:n}).then((function(e){if(n.archived)return o(s);a(e)}))}))},COMPLETE_LOAD_ITEM:function e(a){var r=a.item,o=a.data;var s=o.success,l=o.source;var c=i("GET_ITEM_INSERT_LOCATION");if(re(c)&&l){fi(n,c)}t("DID_LOAD_ITEM",{id:r.id,error:null,serverFileReference:r.origin===Ue.INPUT?null:l});s(ze(r));if(r.origin===Ue.LOCAL){t("DID_LOAD_LOCAL_ITEM",{id:r.id});return}if(r.origin===Ue.LIMBO){t("DID_COMPLETE_ITEM_PROCESSING",{id:r.id,error:null,serverFileReference:l});t("DID_DEFINE_VALUE",{id:r.id,value:r.serverId||l});return}if(i("IS_ASYNC")&&n.options.instantUpload){t("REQUEST_ITEM_PROCESSING",{query:r.id})}},RETRY_ITEM_LOAD:gi(n,(function(e){e.retryLoad()})),REQUEST_ITEM_PREPARE:gi(n,(function(e,i,n){t("REQUEST_PREPARE_OUTPUT",{query:e.id,item:e,success:function n(a){t("DID_PREPARE_OUTPUT",{id:e.id,file:a});i({file:e,output:a})},failure:n},true)})),REQUEST_ITEM_PROCESSING:gi(n,(function(e,a,r){var o=e.status===qe.IDLE||e.status===qe.PROCESSING_ERROR;if(!o){var s=function i(){return t("REQUEST_ITEM_PROCESSING",{query:e,success:a,failure:r})};var l=function e(){return document.hidden?s():setTimeout(s,32)};if(e.status===qe.PROCESSING_COMPLETE||e.status===qe.PROCESSING_REVERT_ERROR){e.revert(Zt(n.options.server.url,n.options.server.revert),i("GET_FORCE_REVERT")).then(l).catch((function(){}))}else if(e.status===qe.PROCESSING){e.abortProcessing().then(l)}return}if(e.status===qe.PROCESSING_QUEUED)return;e.requestProcessing();t("DID_REQUEST_ITEM_PROCESSING",{id:e.id});t("PROCESS_ITEM",{query:e,success:a,failure:r},true)})),PROCESS_ITEM:gi(n,(function(e,a,r){var o=i("GET_MAX_PARALLEL_UPLOADS");var s=i("GET_ITEMS_BY_STATUS",qe.PROCESSING).length;if(s===o){n.processingQueue.push({id:e.id,success:a,failure:r});return}if(e.status===qe.PROCESSING)return;var l=function e(){var i=n.processingQueue.shift();if(!i)return;var a=i.id,r=i.success,o=i.failure;var s=tt(n.items,a);if(!s||s.archived){e();return}t("PROCESS_ITEM",{query:a,success:r,failure:o},true)};e.onOnce("process-complete",(function(){a(ze(e));l();var r=n.options.server;var o=n.options.instantUpload;if(o&&e.origin===Ue.LOCAL&&re(r.remove)){var s=function e(){};e.origin=Ue.LIMBO;n.options.server.remove(e.source,s,s)}var c=i("GET_ITEMS_BY_STATUS",qe.PROCESSING_COMPLETE).length===n.items.length;if(c){t("DID_COMPLETE_ITEM_PROCESSING_ALL")}}));e.onOnce("process-error",(function(t){r({error:t,file:ze(e)});l()}));var c=n.options;e.process(Jt(Kt(c.server.url,c.server.process,c.name,{chunkTransferId:e.transferId,chunkServer:c.server.patch,chunkUploads:c.chunkUploads,chunkForce:c.chunkForce,chunkSize:c.chunkSize,chunkRetryDelays:c.chunkRetryDelays}),{allowMinimumUploadDuration:i("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(function(n,a,r){Xe("PREPARE_OUTPUT",n,{query:i,item:e}).then((function(i){t("DID_PREPARE_OUTPUT",{id:e.id,file:i});a(i)})).catch(r)}))})),RETRY_ITEM_PROCESSING:gi(n,(function(e){t("REQUEST_ITEM_PROCESSING",{query:e})})),REQUEST_REMOVE_ITEM:gi(n,(function(e){hi(i("GET_BEFORE_REMOVE_FILE"),ze(e)).then((function(i){if(!i){return}t("REMOVE_ITEM",{query:e})}))})),RELEASE_ITEM:gi(n,(function(e){e.release()})),REMOVE_ITEM:gi(n,(function(e,a,r,o){var s=function i(){var r=e.id;oi(n.items,r).archive();t("DID_REMOVE_ITEM",{error:null,id:r,item:e});pi(t,n);a(ze(e))};var l=n.options.server;if(e.origin===Ue.LOCAL&&l&&re(l.remove)&&o.remove!==false){t("DID_START_ITEM_REMOVE",{id:e.id});l.remove(e.source,(function(){return s()}),(function(i){t("DID_THROW_ITEM_REMOVE_ERROR",{id:e.id,error:qt("error",0,i,null),status:{main:ui(n.options.labelFileRemoveError)(i),sub:n.options.labelTapToRetry}})}))}else{if(o.revert&&e.origin!==Ue.LOCAL&&e.serverId!==null||n.options.chunkUploads&&e.file.size>n.options.chunkSize||n.options.chunkUploads&&n.options.chunkForce){e.revert(Zt(n.options.server.url,n.options.server.revert),i("GET_FORCE_REVERT"))}s()}})),ABORT_ITEM_LOAD:gi(n,(function(e){e.abortLoad()})),ABORT_ITEM_PROCESSING:gi(n,(function(e){if(e.serverId){t("REVERT_ITEM_PROCESSING",{id:e.id});return}e.abortProcessing().then((function(){var i=n.options.instantUpload;if(i){t("REMOVE_ITEM",{query:e.id})}}))})),REQUEST_REVERT_ITEM_PROCESSING:gi(n,(function(e){if(!n.options.instantUpload){t("REVERT_ITEM_PROCESSING",{query:e});return}var a=function i(n){if(!n)return;t("REVERT_ITEM_PROCESSING",{query:e})};var r=i("GET_BEFORE_REMOVE_FILE");if(!r){return a(true)}var o=r(ze(e));if(o==null){return a(true)}if(typeof o==="boolean"){return a(o)}if(typeof o.then==="function"){o.then(a)}})),REVERT_ITEM_PROCESSING:gi(n,(function(e){e.revert(Zt(n.options.server.url,n.options.server.revert),i("GET_FORCE_REVERT")).then((function(){var i=n.options.instantUpload||di(e);if(i){t("REMOVE_ITEM",{query:e.id})}})).catch((function(){}))})),SET_OPTIONS:function e(i){var n=i.options;var a=Object.keys(n);var r=vi.filter((function(e){return a.includes(e)}));var o=[].concat(Me(r),Me(Object.keys(n).filter((function(e){return!r.includes(e)}))));o.forEach((function(e){t("SET_"+xe(e,"_").toUpperCase(),{value:n[e]})}))}}};var vi=["server"];var _i=function e(t){return t};var bi=function e(t){return document.createElement(t)};var yi=function e(t,i){var n=t.childNodes[0];if(!n){n=document.createTextNode(i);t.appendChild(n)}else if(i!==n.nodeValue){n.nodeValue=i}};var wi=function e(t,i,n,a){var r=(a%360-90)*Math.PI/180;return{x:t+n*Math.cos(r),y:i+n*Math.sin(r)}};var xi=function e(t,i,n,a,r,o){var s=wi(t,i,n,r);var l=wi(t,i,n,a);return["M",s.x,s.y,"A",n,n,0,o,0,l.x,l.y].join(" ")};var Ei=function e(t,i,n,a,r){var o=1;if(r>a&&r-a<=.5){o=0}if(a>r&&a-r>=.5){o=0}return xi(t,i,n,Math.min(.9999,a)*360,Math.min(.9999,r)*360,o)};var ki=function e(t){var i=t.root,n=t.props;n.spin=false;n.progress=0;n.opacity=0;var a=u("svg");i.ref.path=u("path",{"stroke-width":2,"stroke-linecap":"round"});a.appendChild(i.ref.path);i.ref.svg=a;i.appendChild(a)};var Ii=function e(t){var i=t.root,n=t.props;if(n.opacity===0){return}if(n.align){i.element.dataset.align=n.align}var a=parseInt(o(i.ref.path,"stroke-width"),10);var r=i.rect.element.width*.5;var s=0;var l=0;if(n.spin){s=0;l=.5}else{s=0;l=n.progress}var c=Ei(r,r,r-a,s,l);o(i.ref.path,"d",c);o(i.ref.path,"stroke-opacity",n.spin||n.progress>0?1:0)};var Ti=q({tag:"div",name:"progress-indicator",ignoreRectUpdate:true,ignoreRect:true,create:ki,write:Ii,mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}});var Si=function e(t){var i=t.root,n=t.props;i.element.innerHTML=(n.icon||"")+("<span>"+n.label+"</span>");n.isDisabled=false};var Ai=function e(t){var i=t.root,n=t.props;var a=n.isDisabled;var r=i.query("GET_DISABLED")||n.opacity===0;if(r&&!a){n.isDisabled=true;o(i.element,"disabled","disabled")}else if(!r&&a){n.isDisabled=false;i.element.removeAttribute("disabled")}};var Ci=q({tag:"button",attributes:{type:"button"},ignoreRect:true,ignoreRectUpdate:true,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:true},create:Si,write:Ai});var Mi=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:".";var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e3;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var r=a.labelBytes,o=r===void 0?"bytes":r,s=a.labelKilobytes,l=s===void 0?"KB":s,c=a.labelMegabytes,u=c===void 0?"MB":c,d=a.labelGigabytes,p=d===void 0?"GB":d;t=Math.round(Math.abs(t));var h=n;var f=n*n;var g=n*n*n;if(t<h){return t+" "+o}if(t<f){return Math.floor(t/h)+" "+l}if(t<g){return Di(t/f,1,i)+" "+u}return Di(t/g,2,i)+" "+p};var Di=function e(t,i,n){return t.toFixed(i).split(".").filter((function(e){return e!=="0"})).join(n)};var Li=function e(t){var i=t.root,n=t.props;var a=bi("span");a.className="filepond--file-info-main";o(a,"aria-hidden","true");i.appendChild(a);i.ref.fileName=a;var r=bi("span");r.className="filepond--file-info-sub";i.appendChild(r);i.ref.fileSize=r;yi(r,i.query("GET_LABEL_FILE_WAITING_FOR_SIZE"));yi(a,_i(i.query("GET_ITEM_NAME",n.id)))};var Oi=function e(t){var i=t.root,n=t.props;yi(i.ref.fileSize,Mi(i.query("GET_ITEM_SIZE",n.id),".",i.query("GET_FILE_SIZE_BASE"),i.query("GET_FILE_SIZE_LABELS",i.query)));yi(i.ref.fileName,_i(i.query("GET_ITEM_NAME",n.id)))};var Pi=function e(t){var i=t.root,n=t.props;if(ne(i.query("GET_ITEM_SIZE",n.id))){Oi({root:i,props:n});return}yi(i.ref.fileSize,i.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))};var Ri=q({name:"file-info",ignoreRect:true,ignoreRectUpdate:true,write:H({DID_LOAD_ITEM:Oi,DID_UPDATE_ITEM_META:Oi,DID_THROW_ITEM_LOAD_ERROR:Pi,DID_THROW_ITEM_INVALID:Pi}),didCreateView:function e(t){Ke("CREATE_VIEW",Object.assign({},t,{view:t}))},create:Li,mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}});var Ni=function e(t){return Math.round(t*100)};var Fi=function e(t){var i=t.root;var n=bi("span");n.className="filepond--file-status-main";i.appendChild(n);i.ref.main=n;var a=bi("span");a.className="filepond--file-status-sub";i.appendChild(a);i.ref.sub=a;Gi({root:i,action:{progress:null}})};var Gi=function e(t){var i=t.root,n=t.action;var a=n.progress===null?i.query("GET_LABEL_FILE_LOADING"):i.query("GET_LABEL_FILE_LOADING")+" "+Ni(n.progress)+"%";yi(i.ref.main,a);yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_CANCEL"))};var zi=function e(t){var i=t.root,n=t.action;var a=n.progress===null?i.query("GET_LABEL_FILE_PROCESSING"):i.query("GET_LABEL_FILE_PROCESSING")+" "+Ni(n.progress)+"%";yi(i.ref.main,a);yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_CANCEL"))};var Bi=function e(t){var i=t.root;yi(i.ref.main,i.query("GET_LABEL_FILE_PROCESSING"));yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_CANCEL"))};var qi=function e(t){var i=t.root;yi(i.ref.main,i.query("GET_LABEL_FILE_PROCESSING_ABORTED"));yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_RETRY"))};var Ui=function e(t){var i=t.root;yi(i.ref.main,i.query("GET_LABEL_FILE_PROCESSING_COMPLETE"));yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_UNDO"))};var Hi=function e(t){var i=t.root;yi(i.ref.main,"");yi(i.ref.sub,"")};var Vi=function e(t){var i=t.root,n=t.action;yi(i.ref.main,n.status.main);yi(i.ref.sub,n.status.sub)};var ji=q({name:"file-status",ignoreRect:true,ignoreRectUpdate:true,write:H({DID_LOAD_ITEM:Hi,DID_REVERT_ITEM_PROCESSING:Hi,DID_REQUEST_ITEM_PROCESSING:Bi,DID_ABORT_ITEM_PROCESSING:qi,DID_COMPLETE_ITEM_PROCESSING:Ui,DID_UPDATE_ITEM_PROCESS_PROGRESS:zi,DID_UPDATE_ITEM_LOAD_PROGRESS:Gi,DID_THROW_ITEM_LOAD_ERROR:Vi,DID_THROW_ITEM_INVALID:Vi,DID_THROW_ITEM_PROCESSING_ERROR:Vi,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Vi,DID_THROW_ITEM_REMOVE_ERROR:Vi}),didCreateView:function e(t){Ke("CREATE_VIEW",Object.assign({},t,{view:t}))},create:Fi,mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}});var Yi={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"}};var Wi=[];a(Yi,(function(e){Wi.push(e)}));var Xi=function e(t){if(en(t)==="right")return 0;var i=t.ref.buttonRemoveItem.rect.element;return i.hidden?null:i.width+i.left};var Ki=function e(t){var i=t.ref.buttonAbortItemLoad.rect.element;return i.width};var Zi=function e(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.height/4)};var Qi=function e(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.left/2)};var $i=function e(t){return t.query("GET_STYLE_LOAD_INDICATOR_POSITION")};var Ji=function e(t){return t.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")};var en=function e(t){return t.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")};var tn={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:$i},processProgressIndicator:{opacity:0,align:Ji},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}};var nn={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Xi},status:{translateX:Xi}};var an={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}};var rn={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:Xi},status:{translateX:Xi,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:Xi},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:en},info:{translateX:Xi},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:en},buttonRemoveItem:{opacity:1},info:{translateX:Xi},status:{opacity:1,translateX:Xi}},DID_LOAD_ITEM:nn,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:Xi},status:{translateX:Xi}},DID_START_ITEM_PROCESSING:an,DID_REQUEST_ITEM_PROCESSING:an,DID_UPDATE_ITEM_PROCESS_PROGRESS:an,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:Xi}},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:Xi},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:nn};var on=q({create:function e(t){var i=t.root;i.element.innerHTML=i.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:true,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}});var sn=function e(t){var i=t.root,n=t.props;var r=Object.keys(Yi).reduce((function(e,t){e[t]=Object.assign({},Yi[t]);return e}),{});var o=n.id;var s=i.query("GET_ALLOW_REVERT");var l=i.query("GET_ALLOW_REMOVE");var c=i.query("GET_ALLOW_PROCESS");var u=i.query("GET_INSTANT_UPLOAD");var d=i.query("IS_ASYNC");var p=i.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");var h;if(d){if(c&&!s){h=function e(t){return!/RevertItemProcessing/.test(t)}}else if(!c&&s){h=function e(t){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(t)}}else if(!c&&!s){h=function e(t){return!/Process/.test(t)}}}else{h=function e(t){return!/Process/.test(t)}}var f=h?Wi.filter(h):Wi.concat();if(u&&s){r["RevertItemProcessing"].label="GET_LABEL_BUTTON_REMOVE_ITEM";r["RevertItemProcessing"].icon="GET_ICON_REMOVE"}if(d&&!s){var g=rn["DID_COMPLETE_ITEM_PROCESSING"];g.info.translateX=Qi;g.info.translateY=Zi;g.status.translateY=Zi;g.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(d&&!c){["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach((function(e){rn[e].status.translateY=Zi}));rn["DID_THROW_ITEM_PROCESSING_ERROR"].status.translateX=Ki}if(p&&s){r["RevertItemProcessing"].align="BUTTON_REMOVE_ITEM_POSITION";var m=rn["DID_COMPLETE_ITEM_PROCESSING"];m.info.translateX=Xi;m.status.translateY=Zi;m.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(!l){r["RemoveItem"].disabled=true}a(r,(function(e,t){var n=i.createChildView(Ci,{label:i.query(t.label),icon:i.query(t.icon),opacity:0});if(f.includes(e)){i.appendChildView(n)}if(t.disabled){n.element.setAttribute("disabled","disabled");n.element.setAttribute("hidden","hidden")}n.element.dataset.align=i.query("GET_STYLE_"+t.align);n.element.classList.add(t.className);n.on("click",(function(e){e.stopPropagation();if(t.disabled)return;i.dispatch(t.action,{query:o})}));i.ref["button"+e]=n}));i.ref.processingCompleteIndicator=i.appendChildView(i.createChildView(on));i.ref.processingCompleteIndicator.element.dataset.align=i.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION");i.ref.info=i.appendChildView(i.createChildView(Ri,{id:o}));i.ref.status=i.appendChildView(i.createChildView(ji,{id:o}));var v=i.appendChildView(i.createChildView(Ti,{opacity:0,align:i.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));v.element.classList.add("filepond--load-indicator");i.ref.loadProgressIndicator=v;var _=i.appendChildView(i.createChildView(Ti,{opacity:0,align:i.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));_.element.classList.add("filepond--process-indicator");i.ref.processProgressIndicator=_;i.ref.activeStyles=[]};var ln=function e(t){var i=t.root,n=t.actions,r=t.props;cn({root:i,actions:n,props:r});var o=n.concat().filter((function(e){return/^DID_/.test(e.type)})).reverse().find((function(e){return rn[e.type]}));if(o){i.ref.activeStyles=[];var s=rn[o.type];a(tn,(function(e,t){var n=i.ref[e];a(t,(function(t,a){var r=s[e]&&typeof s[e][t]!=="undefined"?s[e][t]:a;i.ref.activeStyles.push({control:n,key:t,value:r})}))}))}i.ref.activeStyles.forEach((function(e){var t=e.control,n=e.key,a=e.value;t[n]=typeof a==="function"?a(i):a}))};var cn=H({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function e(t){var i=t.root,n=t.action;i.ref.buttonAbortItemProcessing.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function e(t){var i=t.root,n=t.action;i.ref.buttonAbortItemLoad.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function e(t){var i=t.root,n=t.action;i.ref.buttonAbortItemRemoval.label=n.value},DID_REQUEST_ITEM_PROCESSING:function e(t){var i=t.root;i.ref.processProgressIndicator.spin=true;i.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function e(t){var i=t.root;i.ref.loadProgressIndicator.spin=true;i.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function e(t){var i=t.root;i.ref.processProgressIndicator.spin=true;i.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function e(t){var i=t.root,n=t.action;i.ref.loadProgressIndicator.spin=false;i.ref.loadProgressIndicator.progress=n.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function e(t){var i=t.root,n=t.action;i.ref.processProgressIndicator.spin=false;i.ref.processProgressIndicator.progress=n.progress}});var un=q({create:sn,write:ln,didCreateView:function e(t){Ke("CREATE_VIEW",Object.assign({},t,{view:t}))},name:"file"});var dn=function e(t){var i=t.root,n=t.props;i.ref.fileName=bi("legend");i.appendChild(i.ref.fileName);i.ref.file=i.appendChildView(i.createChildView(un,{id:n.id}));i.ref.data=false};var pn=function e(t){var i=t.root,n=t.props;yi(i.ref.fileName,_i(i.query("GET_ITEM_NAME",n.id)))};var hn=q({create:dn,ignoreRect:true,write:H({DID_LOAD_ITEM:pn}),didCreateView:function e(t){Ke("CREATE_VIEW",Object.assign({},t,{view:t}))},tag:"fieldset",name:"file-wrapper"});var fn={type:"spring",damping:.6,mass:7};var gn=function e(t){var i=t.root,n=t.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:fn},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:fn},styles:["translateY"]}}].forEach((function(e){mn(i,e,n.name)}));i.element.classList.add("filepond--"+n.name);i.ref.scalable=null};var mn=function e(t,i,n){var a=q({name:"panel-"+i.name+" filepond--"+n,mixins:i.mixins,ignoreRectUpdate:true});var r=t.createChildView(a,i.props);t.ref[i.name]=t.appendChildView(r)};var vn=function e(t){var i=t.root,n=t.props;if(i.ref.scalable===null||n.scalable!==i.ref.scalable){i.ref.scalable=Q(n.scalable)?n.scalable:true;i.element.dataset.scalable=i.ref.scalable}if(!n.height)return;var a=i.ref.top.rect.element;var r=i.ref.bottom.rect.element;var o=Math.max(a.height+r.height,n.height);i.ref.center.translateY=a.height;i.ref.center.scaleY=(o-a.height-r.height)/100;i.ref.bottom.translateY=o-r.height};var _n=q({name:"panel",read:function e(t){var i=t.root,n=t.props;return n.heightCurrent=i.ref.bottom.translateY},write:vn,create:gn,ignoreRect:true,mixins:{apis:["height","heightCurrent","scalable"]}});var bn=function e(t){var i=t.map((function(e){return e.id}));var n=undefined;return{setIndex:function e(t){n=t},getIndex:function e(){return n},getItemIndex:function e(t){return i.indexOf(t.id)}}};var yn={type:"spring",stiffness:.75,damping:.45,mass:10};var wn="spring";var xn={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"};var En=function e(t){var i=t.root,n=t.props;i.ref.handleClick=function(e){return i.dispatch("DID_ACTIVATE_ITEM",{id:n.id})};i.element.id="filepond--item-"+n.id;i.element.addEventListener("click",i.ref.handleClick);i.ref.container=i.appendChildView(i.createChildView(hn,{id:n.id}));i.ref.panel=i.appendChildView(i.createChildView(_n,{name:"item-panel"}));i.ref.panel.height=null;n.markedForRemoval=false;if(!i.query("GET_ALLOW_REORDER"))return;i.element.dataset.dragState="idle";var a=function e(t){if(!t.isPrimary)return;var a=false;var r={x:t.pageX,y:t.pageY};n.dragOrigin={x:i.translateX,y:i.translateY};n.dragCenter={x:t.offsetX,y:t.offsetY};var o=bn(i.query("GET_ACTIVE_ITEMS"));i.dispatch("DID_GRAB_ITEM",{id:n.id,dragState:o});var s=function e(t){if(!t.isPrimary)return;t.stopPropagation();t.preventDefault();n.dragOffset={x:t.pageX-r.x,y:t.pageY-r.y};var s=n.dragOffset.x*n.dragOffset.x+n.dragOffset.y*n.dragOffset.y;if(s>16&&!a){a=true;i.element.removeEventListener("click",i.ref.handleClick)}i.dispatch("DID_DRAG_ITEM",{id:n.id,dragState:o})};var l=function e(t){if(!t.isPrimary)return;document.removeEventListener("pointermove",s);document.removeEventListener("pointerup",e);n.dragOffset={x:t.pageX-r.x,y:t.pageY-r.y};i.dispatch("DID_DROP_ITEM",{id:n.id,dragState:o});if(a){setTimeout((function(){return i.element.addEventListener("click",i.ref.handleClick)}),0)}};document.addEventListener("pointermove",s);document.addEventListener("pointerup",l)};i.element.addEventListener("pointerdown",a)};var kn=H({DID_UPDATE_PANEL_HEIGHT:function e(t){var i=t.root,n=t.action;i.height=n.height}});var In=H({DID_GRAB_ITEM:function e(t){var i=t.root,n=t.props;n.dragOrigin={x:i.translateX,y:i.translateY}},DID_DRAG_ITEM:function e(t){var i=t.root;i.element.dataset.dragState="drag"},DID_DROP_ITEM:function e(t){var i=t.root,n=t.props;n.dragOffset=null;n.dragOrigin=null;i.element.dataset.dragState="drop"}},(function(e){var t=e.root,i=e.actions,n=e.props,a=e.shouldOptimize;if(t.element.dataset.dragState==="drop"){if(t.scaleX<=1){t.element.dataset.dragState="idle"}}var r=i.concat().filter((function(e){return/^DID_/.test(e.type)})).reverse().find((function(e){return xn[e.type]}));if(r&&r.type!==n.currentState){n.currentState=r.type;t.element.dataset.filepondItemState=xn[n.currentState]||""}var o=t.query("GET_ITEM_PANEL_ASPECT_RATIO")||t.query("GET_PANEL_ASPECT_RATIO");if(!o){kn({root:t,actions:i,props:n});if(!t.height&&t.ref.container.rect.element.height>0){t.height=t.ref.container.rect.element.height}}else if(!a){t.height=t.rect.element.width*o}if(a){t.ref.panel.height=null}t.ref.panel.height=t.height}));var Tn=q({create:En,write:In,destroy:function e(t){var i=t.root,n=t.props;i.element.removeEventListener("click",i.ref.handleClick);i.dispatch("RELEASE_ITEM",{query:n.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:wn,scaleY:wn,translateX:yn,translateY:yn,opacity:{type:"tween",duration:150}}}});var Sn=function(e,t){return Math.max(1,Math.floor((e+1)/t))};var An=function e(t,i,n){if(!n)return;var a=t.rect.element.width;var r=i.length;var o=null;if(r===0||n.top<i[0].rect.element.top)return-1;var s=i[0];var l=s.rect.element;var c=l.marginLeft+l.marginRight;var u=l.width+c;var d=Sn(a,u);if(d===1){for(var p=0;p<r;p++){var h=i[p];var f=h.rect.outer.top+h.rect.element.height*.5;if(n.top<f){return p}}return r}var g=l.marginTop+l.marginBottom;var m=l.height+g;for(var v=0;v<r;v++){var _=v%d;var b=Math.floor(v/d);var y=_*u;var w=b*m;var x=w-l.marginTop;var E=y+u;var k=w+m+l.marginBottom;if(n.top<k&&n.top>x){if(n.left<E){return v}else if(v!==r-1){o=v}else{o=null}}}if(o!==null){return o}return r};var Cn={height:0,width:0,get getHeight(){return this.height},set setHeight(e){if(this.height===0||e===0)this.height=e},get getWidth(){return this.width},set setWidth(e){if(this.width===0||e===0)this.width=e},setDimensions:function e(t,i){if(this.height===0||t===0)this.height=t;if(this.width===0||i===0)this.width=i}};var Mn=function e(t){var i=t.root;o(i.element,"role","list");i.ref.lastItemSpanwDate=Date.now()};var Dn=function e(t){var i=t.root,n=t.action;var a=n.id,r=n.index,o=n.interactionMethod;i.ref.addIndex=r;var s=Date.now();var l=s;var c=1;if(o!==Te.NONE){c=0;var u=i.query("GET_ITEM_INSERT_INTERVAL");var d=s-i.ref.lastItemSpanwDate;l=d<u?s+(u-d):s}i.ref.lastItemSpanwDate=l;i.appendChildView(i.createChildView(Tn,{spawnDate:l,id:a,opacity:c,interactionMethod:o}),r)};var Ln=function e(t,i,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;if(t.dragOffset){t.translateX=null;t.translateY=null;t.translateX=t.dragOrigin.x+t.dragOffset.x;t.translateY=t.dragOrigin.y+t.dragOffset.y;t.scaleX=1.025;t.scaleY=1.025}else{t.translateX=i;t.translateY=n;if(Date.now()>t.spawnDate){if(t.opacity===0){On(t,i,n,a,r)}t.scaleX=1;t.scaleY=1;t.opacity=1}}};var On=function e(t,i,n,a,r){if(t.interactionMethod===Te.NONE){t.translateX=null;t.translateX=i;t.translateY=null;t.translateY=n}else if(t.interactionMethod===Te.DROP){t.translateX=null;t.translateX=i-a*20;t.translateY=null;t.translateY=n-r*10;t.scaleX=.8;t.scaleY=.8}else if(t.interactionMethod===Te.BROWSE){t.translateY=null;t.translateY=n-30}else if(t.interactionMethod===Te.API){t.translateX=null;t.translateX=i-30;t.translateY=null}};var Pn=function e(t){var i=t.root,n=t.action;var a=n.id;var r=i.childViews.find((function(e){return e.id===a}));if(!r){return}r.scaleX=.9;r.scaleY=.9;r.opacity=0;r.markedForRemoval=true};var Rn=function e(t){return t.rect.element.height+t.rect.element.marginBottom*.5+t.rect.element.marginTop*.5};var Nn=function e(t){return t.rect.element.width+t.rect.element.marginLeft*.5+t.rect.element.marginRight*.5};var Fn=function e(t){var i=t.root,n=t.action;var a=n.id,r=n.dragState;var o=i.query("GET_ITEM",{id:a});var s=i.childViews.find((function(e){return e.id===a}));var l=i.childViews.length;var c=r.getItemIndex(o);if(!s)return;var u={x:s.dragOrigin.x+s.dragOffset.x+s.dragCenter.x,y:s.dragOrigin.y+s.dragOffset.y+s.dragCenter.y};var d=Rn(s);var p=Nn(s);var h=Math.floor(i.rect.outer.width/p);if(h>l)h=l;var f=Math.floor(l/h+1);Cn.setHeight=d*f;Cn.setWidth=p*h;var g={y:Math.floor(u.y/d),x:Math.floor(u.x/p),getGridIndex:function e(){if(u.y>Cn.getHeight||u.y<0||u.x>Cn.getWidth||u.x<0)return c;return this.y*h+this.x},getColIndex:function e(){var t=i.query("GET_ACTIVE_ITEMS");var n=i.childViews.filter((function(e){return e.rect.element.height}));var a=t.map((function(e){return n.find((function(t){return t.id===e.id}))}));var r=a.findIndex((function(e){return e===s}));var o=Rn(s);var l=a.length;var c=l;var d=0;var p=0;var h=0;for(var f=0;f<l;f++){d=Rn(a[f]);h=p;p=h+d;if(u.y<p){if(r>f){if(u.y<h+o){c=f;break}continue}c=f;break}}return c}};var m=h>1?g.getGridIndex():g.getColIndex();i.dispatch("MOVE_ITEM",{query:s,index:m});var v=r.getIndex();if(v===undefined||v!==m){r.setIndex(m);if(v===undefined)return;i.dispatch("DID_REORDER_ITEMS",{items:i.query("GET_ACTIVE_ITEMS"),origin:c,target:m})}};var Gn=H({DID_ADD_ITEM:Dn,DID_REMOVE_ITEM:Pn,DID_DRAG_ITEM:Fn});var zn=function e(t){var i=t.root,n=t.props,a=t.actions,r=t.shouldOptimize;Gn({root:i,props:n,actions:a});var o=n.dragCoordinates;var s=i.rect.element.width;var l=i.childViews.filter((function(e){return e.rect.element.height}));var c=i.query("GET_ACTIVE_ITEMS").map((function(e){return l.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));var u=o?An(i,c,o):null;var d=i.ref.addIndex||null;i.ref.addIndex=null;var p=0;var h=0;var f=0;if(c.length===0)return;var g=c[0].rect.element;var m=g.marginTop+g.marginBottom;var v=g.marginLeft+g.marginRight;var _=g.width+v;var b=g.height+m;var y=Sn(s,_);if(y===1){var w=0;var x=0;c.forEach((function(e,t){if(u){var i=t-u;if(i===-2){x=-m*.25}else if(i===-1){x=-m*.75}else if(i===0){x=m*.75}else if(i===1){x=m*.25}else{x=0}}if(r){e.translateX=null;e.translateY=null}if(!e.markedForRemoval){Ln(e,0,w+x)}var n=e.rect.element.height+m;var a=n*(e.markedForRemoval?e.opacity:1);w+=a}))}else{var E=0;var k=0;c.forEach((function(e,t){if(t===u){p=1}if(t===d){f+=1}if(e.markedForRemoval&&e.opacity<.5){h-=1}var i=t+f+p+h;var n=i%y;var a=Math.floor(i/y);var o=n*_;var s=a*b;var l=Math.sign(o-E);var c=Math.sign(s-k);E=o;k=s;if(e.markedForRemoval)return;if(r){e.translateX=null;e.translateY=null}Ln(e,o,s,l,c)}))}};var Bn=function e(t,i){return i.filter((function(e){if(e.data&&e.data.id){return t.id===e.data.id}return true}))};var qn=q({create:Mn,write:zn,tag:"ul",name:"list",didWriteView:function e(t){var i=t.root;i.childViews.filter((function(e){return e.markedForRemoval&&e.opacity===0&&e.resting})).forEach((function(e){e._destroy();i.removeChildView(e)}))},filterFrameActionsForChild:Bn,mixins:{apis:["dragCoordinates"]}});var Un=function e(t){var i=t.root,n=t.props;i.ref.list=i.appendChildView(i.createChildView(qn));n.dragCoordinates=null;n.overflowing=false};var Hn=function e(t){var i=t.root,n=t.props,a=t.action;if(!i.query("GET_ITEM_INSERT_LOCATION_FREEDOM"))return;n.dragCoordinates={left:a.position.scopeLeft-i.ref.list.rect.element.left,top:a.position.scopeTop-(i.rect.outer.top+i.rect.element.marginTop+i.rect.element.scrollTop)}};var Vn=function e(t){var i=t.props;i.dragCoordinates=null};var jn=H({DID_DRAG:Hn,DID_END_DRAG:Vn});var Yn=function e(t){var i=t.root,n=t.props,a=t.actions;jn({root:i,props:n,actions:a});i.ref.list.dragCoordinates=n.dragCoordinates;if(n.overflowing&&!n.overflow){n.overflowing=false;i.element.dataset.state="";i.height=null}if(n.overflow){var r=Math.round(n.overflow);if(r!==i.height){n.overflowing=true;i.element.dataset.state="overflow";i.height=r}}};var Wn=q({create:Un,write:Yn,name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}});var Xn=function e(t,i,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"";if(n){o(t,i,a)}else{t.removeAttribute(i)}};var Kn=function e(t){if(!t||t.value===""){return}try{t.value=""}catch(e){}if(t.value){var i=bi("form");var n=t.parentNode;var a=t.nextSibling;i.appendChild(t);i.reset();if(a){n.insertBefore(t,a)}else{n.appendChild(t)}}};var Zn=function e(t){var i=t.root,n=t.props;i.element.id="filepond--browser-"+n.id;o(i.element,"name",i.query("GET_NAME"));o(i.element,"aria-controls","filepond--assistant-"+n.id);o(i.element,"aria-labelledby","filepond--drop-label-"+n.id);Qn({root:i,action:{value:i.query("GET_ACCEPTED_FILE_TYPES")}});$n({root:i,action:{value:i.query("GET_ALLOW_MULTIPLE")}});Jn({root:i,action:{value:i.query("GET_ALLOW_DIRECTORIES_ONLY")}});ea({root:i});ta({root:i,action:{value:i.query("GET_REQUIRED")}});ia({root:i,action:{value:i.query("GET_CAPTURE_METHOD")}});i.ref.handleChange=function(e){if(!i.element.value){return}var t=Array.from(i.element.files).map((function(e){e._relativePath=e.webkitRelativePath;return e}));setTimeout((function(){n.onload(t);Kn(i.element)}),250)};i.element.addEventListener("change",i.ref.handleChange)};var Qn=function e(t){var i=t.root,n=t.action;if(!i.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE"))return;Xn(i.element,"accept",!!n.value,n.value?n.value.join(","):"")};var $n=function e(t){var i=t.root,n=t.action;Xn(i.element,"multiple",n.value)};var Jn=function e(t){var i=t.root,n=t.action;Xn(i.element,"webkitdirectory",n.value)};var ea=function e(t){var i=t.root;var n=i.query("GET_DISABLED");var a=i.query("GET_ALLOW_BROWSE");var r=n||!a;Xn(i.element,"disabled",r)};var ta=function e(t){var i=t.root,n=t.action;if(!n.value){Xn(i.element,"required",false)}else if(i.query("GET_TOTAL_ITEMS")===0){Xn(i.element,"required",true)}};var ia=function e(t){var i=t.root,n=t.action;Xn(i.element,"capture",!!n.value,n.value===true?"":n.value)};var na=function e(t){var i=t.root;var n=i.element;if(i.query("GET_TOTAL_ITEMS")>0){Xn(n,"required",false);Xn(n,"name",false)}else{Xn(n,"name",true,i.query("GET_NAME"));var a=i.query("GET_CHECK_VALIDITY");if(a){n.setCustomValidity("")}if(i.query("GET_REQUIRED")){Xn(n,"required",true)}}};var aa=function e(t){var i=t.root;var n=i.query("GET_CHECK_VALIDITY");if(!n)return;i.element.setCustomValidity(i.query("GET_LABEL_INVALID_FIELD"))};var ra=q({tag:"input",name:"browser",ignoreRect:true,ignoreRectUpdate:true,attributes:{type:"file"},create:Zn,destroy:function e(t){var i=t.root;i.element.removeEventListener("change",i.ref.handleChange)},write:H({DID_LOAD_ITEM:na,DID_REMOVE_ITEM:na,DID_THROW_ITEM_INVALID:aa,DID_SET_DISABLED:ea,DID_SET_ALLOW_BROWSE:ea,DID_SET_ALLOW_DIRECTORIES_ONLY:Jn,DID_SET_ALLOW_MULTIPLE:$n,DID_SET_ACCEPTED_FILE_TYPES:Qn,DID_SET_CAPTURE_METHOD:ia,DID_SET_REQUIRED:ta})});var oa={ENTER:13,SPACE:32};var sa=function e(t){var i=t.root,n=t.props;var a=bi("label");o(a,"for","filepond--browser-"+n.id);o(a,"id","filepond--drop-label-"+n.id);o(a,"aria-hidden","true");i.ref.handleKeyDown=function(e){var t=e.keyCode===oa.ENTER||e.keyCode===oa.SPACE;if(!t)return;e.preventDefault();i.ref.label.click()};i.ref.handleClick=function(e){var t=e.target===a||a.contains(e.target);if(t)return;i.ref.label.click()};a.addEventListener("keydown",i.ref.handleKeyDown);i.element.addEventListener("click",i.ref.handleClick);la(a,n.caption);i.appendChild(a);i.ref.label=a};var la=function e(t,i){t.innerHTML=i;var n=t.querySelector(".filepond--label-action");if(n){o(n,"tabindex","0")}return i};var ca=q({name:"drop-label",ignoreRect:true,create:sa,destroy:function e(t){var i=t.root;i.ref.label.addEventListener("keydown",i.ref.handleKeyDown);i.element.removeEventListener("click",i.ref.handleClick)},write:H({DID_SET_LABEL_IDLE:function e(t){var i=t.root,n=t.action;la(i.ref.label,n.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}});var ua=q({name:"drip-blob",ignoreRect:true,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}});var da=function e(t){var i=t.root;var n=i.rect.element.width*.5;var a=i.rect.element.height*.5;i.ref.blob=i.appendChildView(i.createChildView(ua,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:n,translateY:a}))};var pa=function e(t){var i=t.root,n=t.action;if(!i.ref.blob){da({root:i});return}i.ref.blob.translateX=n.position.scopeLeft;i.ref.blob.translateY=n.position.scopeTop;i.ref.blob.scaleX=1;i.ref.blob.scaleY=1;i.ref.blob.opacity=1};var ha=function e(t){var i=t.root;if(!i.ref.blob){return}i.ref.blob.opacity=0};var fa=function e(t){var i=t.root;if(!i.ref.blob){return}i.ref.blob.scaleX=2.5;i.ref.blob.scaleY=2.5;i.ref.blob.opacity=0};var ga=function e(t){var i=t.root,n=t.props,a=t.actions;ma({root:i,props:n,actions:a});var r=i.ref.blob;if(a.length===0&&r&&r.opacity===0){i.removeChildView(r);i.ref.blob=null}};var ma=H({DID_DRAG:pa,DID_DROP:fa,DID_END_DRAG:ha});var va=q({ignoreRect:true,ignoreRectUpdate:true,name:"drip",write:ga});var _a=function e(t,i){try{var n=new DataTransfer;i.forEach((function(e){if(e instanceof File){n.items.add(e)}else{n.items.add(new File([e],e.name,{type:e.type}))}}));t.files=n.files}catch(e){return false}return true};var ba=function e(t){var i=t.root;return i.ref.fields={}};var ya=function e(t,i){return t.ref.fields[i]};var wa=function e(t){t.query("GET_ACTIVE_ITEMS").forEach((function(e){if(!t.ref.fields[e.id])return;t.element.appendChild(t.ref.fields[e.id])}))};var xa=function e(t){var i=t.root;return wa(i)};var Ea=function e(t){var i=t.root,n=t.action;var a=i.query("GET_ITEM",n.id);var r=a.origin===Ue.LOCAL;var o=!r&&i.query("SHOULD_UPDATE_FILE_INPUT");var s=bi("input");s.type=o?"file":"hidden";s.name=i.query("GET_NAME");s.disabled=i.query("GET_DISABLED");i.ref.fields[n.id]=s;wa(i)};var ka=function e(t){var i=t.root,n=t.action;var a=ya(i,n.id);if(!a)return;if(n.serverFileReference!==null)a.value=n.serverFileReference;if(!i.query("SHOULD_UPDATE_FILE_INPUT"))return;var r=i.query("GET_ITEM",n.id);_a(a,[r.file])};var Ia=function e(t){var i=t.root,n=t.action;if(!i.query("SHOULD_UPDATE_FILE_INPUT"))return;setTimeout((function(){var e=ya(i,n.id);if(!e)return;_a(e,[n.file])}),0)};var Ta=function e(t){var i=t.root;i.element.disabled=i.query("GET_DISABLED")};var Sa=function e(t){var i=t.root,n=t.action;var a=ya(i,n.id);if(!a)return;if(a.parentNode)a.parentNode.removeChild(a);delete i.ref.fields[n.id]};var Aa=function e(t){var i=t.root,n=t.action;var a=ya(i,n.id);if(!a)return;if(n.value===null){a.removeAttribute("value")}else{a.value=n.value}wa(i)};var Ca=H({DID_SET_DISABLED:Ta,DID_ADD_ITEM:Ea,DID_LOAD_ITEM:ka,DID_REMOVE_ITEM:Sa,DID_DEFINE_VALUE:Aa,DID_PREPARE_OUTPUT:Ia,DID_REORDER_ITEMS:xa,DID_SORT_ITEMS:xa});var Ma=q({tag:"fieldset",name:"data",create:ba,write:Ca,ignoreRect:true});var Da=function e(t){return"getRootNode"in t?t.getRootNode():document};var La=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"];var Oa=["css","csv","html","txt"];var Pa={zip:"zip|compressed",epub:"application/epub+zip"};var Ra=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";t=t.toLowerCase();if(La.includes(t)){return"image/"+(t==="jpg"?"jpeg":t==="svg"?"svg+xml":t)}if(Oa.includes(t)){return"text/"+t}return Pa[t]||""};var Na=function e(t){return new Promise((function(e,i){var n=Ya(t);if(n.length&&!Fa(t)){return e(n)}Ga(t).then(e)}))};var Fa=function e(t){if(t.files)return t.files.length>0;return false};var Ga=function e(t){return new Promise((function(e,i){var n=(t.items?Array.from(t.items):[]).filter((function(e){return za(e)})).map((function(e){return Ba(e)}));if(!n.length){e(t.files?Array.from(t.files):[]);return}Promise.all(n).then((function(t){var i=[];t.forEach((function(e){i.push.apply(i,e)}));e(i.filter((function(e){return e})).map((function(e){if(!e._relativePath)e._relativePath=e.webkitRelativePath;return e})))})).catch(console.error)}))};var za=function e(t){if(Va(t)){var i=ja(t);if(i){return i.isFile||i.isDirectory}}return t.kind==="file"};var Ba=function e(t){return new Promise((function(e,i){if(Ha(t)){qa(ja(t)).then(e).catch(i);return}e([t.getAsFile()])}))};var qa=function e(t){return new Promise((function(e,i){var n=[];var a=0;var r=0;var o=function t(){if(r===0&&a===0){e(n)}};var s=function e(t){a++;var s=t.createReader();var l=function t(){s.readEntries((function(i){if(i.length===0){a--;o();return}i.forEach((function(t){if(t.isDirectory){e(t)}else{r++;t.file((function(e){var i=Ua(e);if(t.fullPath)i._relativePath=t.fullPath;n.push(i);r--;o()}))}}));t()}),i)};l()};s(t)}))};var Ua=function e(t){if(t.type.length)return t;var i=t.lastModifiedDate;var n=t.name;var a=Ra(wt(t.name));if(!a.length)return t;t=t.slice(0,t.size,a);t.name=n;t.lastModifiedDate=i;return t};var Ha=function e(t){return Va(t)&&(ja(t)||{}).isDirectory};var Va=function e(t){return"webkitGetAsEntry"in t};var ja=function e(t){return t.webkitGetAsEntry()};var Ya=function e(t){var i=[];try{i=Xa(t);if(i.length){return i}i=Wa(t)}catch(e){}return i};var Wa=function e(t){var i=t.getData("url");if(typeof i==="string"&&i.length){return[i]}return[]};var Xa=function e(t){var i=t.getData("text/html");if(typeof i==="string"&&i.length){var n=i.match(/src\s*=\s*"(.+?)"/);if(n){return[n[1]]}}return[]};var Ka=[];var Za=function e(t){return{pageLeft:t.pageX,pageTop:t.pageY,scopeLeft:t.offsetX||t.layerX,scopeTop:t.offsetY||t.layerY}};var Qa=function e(t,i,n){var a=$a(i);var r={element:t,filterElement:n,state:null,ondrop:function e(){},onenter:function e(){},ondrag:function e(){},onexit:function e(){},onload:function e(){},allowdrop:function e(){}};r.destroy=a.addListener(r);return r};var $a=function e(t){var i=Ka.find((function(e){return e.element===t}));if(i){return i}var n=Ja(t);Ka.push(n);return n};var Ja=function e(t){var i=[];var n={dragenter:ar,dragover:rr,dragleave:sr,drop:or};var r={};a(n,(function(e,n){r[e]=n(t,i);t.addEventListener(e,r[e],false)}));var o={element:t,addListener:function e(s){i.push(s);return function(){i.splice(i.indexOf(s),1);if(i.length===0){Ka.splice(Ka.indexOf(o),1);a(n,(function(e){t.removeEventListener(e,r[e],false)}))}}}};return o};var er=function e(t,i){if(!("elementFromPoint"in t)){t=document}return t.elementFromPoint(i.x,i.y)};var tr=function e(t,i){var n=Da(i);var a=er(n,{x:t.pageX-window.pageXOffset,y:t.pageY-window.pageYOffset});return a===i||i.contains(a)};var ir=null;var nr=function e(t,i){try{t.dropEffect=i}catch(e){}};var ar=function e(t,i){return function(e){e.preventDefault();ir=e.target;i.forEach((function(t){var i=t.element,n=t.onenter;if(tr(e,i)){t.state="enter";n(Za(e))}}))}};var rr=function e(t,i){return function(e){e.preventDefault();var t=e.dataTransfer;Na(t).then((function(n){var a=false;i.some((function(i){var r=i.filterElement,o=i.element,s=i.onenter,l=i.onexit,c=i.ondrag,u=i.allowdrop;nr(t,"copy");var d=u(n);if(!d){nr(t,"none");return}if(tr(e,o)){a=true;if(i.state===null){i.state="enter";s(Za(e));return}i.state="over";if(r&&!d){nr(t,"none");return}c(Za(e))}else{if(r&&!a){nr(t,"none")}if(i.state){i.state=null;l(Za(e))}}}))}))}};var or=function e(t,i){return function(e){e.preventDefault();var t=e.dataTransfer;Na(t).then((function(t){i.forEach((function(i){var n=i.filterElement,a=i.element,r=i.ondrop,o=i.onexit,s=i.allowdrop;i.state=null;if(n&&!tr(e,a))return;if(!s(t))return o(Za(e));r(Za(e),t)}))}))}};var sr=function e(t,i){return function(e){if(ir!==e.target){return}i.forEach((function(t){var i=t.onexit;t.state=null;i(Za(e))}))}};var lr=function e(t,i,n){t.classList.add("filepond--hopper");var a=n.catchesDropsOnPage,r=n.requiresDropOnElement,o=n.filterItems,s=o===void 0?function(e){return e}:o;var l=Qa(t,a?document.documentElement:t,r);var c="";var u="";l.allowdrop=function(e){return i(s(e))};l.ondrop=function(e,t){var n=s(t);if(!i(n)){d.ondragend(e);return}u="drag-drop";d.onload(n,e)};l.ondrag=function(e){d.ondrag(e)};l.onenter=function(e){u="drag-over";d.ondragstart(e)};l.onexit=function(e){u="drag-exit";d.ondragend(e)};var d={updateHopperState:function e(){if(c!==u){t.dataset.hopperState=u;c=u}},onload:function e(){},ondragstart:function e(){},ondrag:function e(){},ondragend:function e(){},destroy:function e(){l.destroy()}};return d};var cr=false;var ur=[];var dr=function e(t){var i=document.activeElement;if(i&&/textarea|input/i.test(i.nodeName)){var n=false;var a=i;while(a!==document.body){if(a.classList.contains("filepond--root")){n=true;break}a=a.parentNode}if(!n)return}Na(t.clipboardData).then((function(e){if(!e.length){return}ur.forEach((function(t){return t(e)}))}))};var pr=function e(t){if(ur.includes(t)){return}ur.push(t);if(cr){return}cr=true;document.addEventListener("paste",dr)};var hr=function e(t){Pe(ur,ur.indexOf(t));if(ur.length===0){document.removeEventListener("paste",dr);cr=false}};var fr=function e(){var t=function e(t){i.onload(t)};var i={destroy:function e(){hr(t)},onload:function e(){}};pr(t);return i};var gr=function e(t){var i=t.root,n=t.props;i.element.id="filepond--assistant-"+n.id;o(i.element,"role","status");o(i.element,"aria-live","polite");o(i.element,"aria-relevant","additions")};var mr=null;var vr=null;var _r=[];var br=function e(t,i){t.element.textContent=i};var yr=function e(t){t.element.textContent=""};var wr=function e(t,i,n){var a=t.query("GET_TOTAL_ITEMS");br(t,n+" "+i+", "+a+" "+(a===1?t.query("GET_LABEL_FILE_COUNT_SINGULAR"):t.query("GET_LABEL_FILE_COUNT_PLURAL")));clearTimeout(vr);vr=setTimeout((function(){yr(t)}),1500)};var xr=function e(t){return t.element.parentNode.contains(document.activeElement)};var Er=function e(t){var i=t.root,n=t.action;if(!xr(i)){return}i.element.textContent="";var a=i.query("GET_ITEM",n.id);_r.push(a.filename);clearTimeout(mr);mr=setTimeout((function(){wr(i,_r.join(", "),i.query("GET_LABEL_FILE_ADDED"));_r.length=0}),750)};var kr=function e(t){var i=t.root,n=t.action;if(!xr(i)){return}var a=n.item;wr(i,a.filename,i.query("GET_LABEL_FILE_REMOVED"))};var Ir=function e(t){var i=t.root,n=t.action;var a=i.query("GET_ITEM",n.id);var r=a.filename;var o=i.query("GET_LABEL_FILE_PROCESSING_COMPLETE");br(i,r+" "+o)};var Tr=function e(t){var i=t.root,n=t.action;var a=i.query("GET_ITEM",n.id);var r=a.filename;var o=i.query("GET_LABEL_FILE_PROCESSING_ABORTED");br(i,r+" "+o)};var Sr=function e(t){var i=t.root,n=t.action;var a=i.query("GET_ITEM",n.id);var r=a.filename;br(i,n.status.main+" "+r+" "+n.status.sub)};var Ar=q({create:gr,ignoreRect:true,ignoreRectUpdate:true,write:H({DID_LOAD_ITEM:Er,DID_REMOVE_ITEM:kr,DID_COMPLETE_ITEM_PROCESSING:Ir,DID_ABORT_ITEM_PROCESSING:Tr,DID_REVERT_ITEM_PROCESSING:Tr,DID_THROW_ITEM_REMOVE_ERROR:Sr,DID_THROW_ITEM_LOAD_ERROR:Sr,DID_THROW_ITEM_INVALID:Sr,DID_THROW_ITEM_PROCESSING_ERROR:Sr}),tag:"span",name:"assistant"});var Cr=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"-";return t.replace(new RegExp(i+".","g"),(function(e){return e.charAt(1).toUpperCase()}))};var Mr=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:16;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var a=Date.now();var r=null;return function(){for(var e=arguments.length,o=new Array(e),s=0;s<e;s++){o[s]=arguments[s]}clearTimeout(r);var l=Date.now()-a;var c=function e(){a=Date.now();t.apply(void 0,o)};if(l<i){if(!n){r=setTimeout(c,i-l)}}else{c()}}};var Dr=1e6;var Lr=function e(t){return t.preventDefault()};var Or=function e(t){var i=t.root,n=t.props;var a=i.query("GET_ID");if(a){i.element.id=a}var r=i.query("GET_CLASS_NAME");if(r){r.split(" ").filter((function(e){return e.length})).forEach((function(e){i.element.classList.add(e)}))}i.ref.label=i.appendChildView(i.createChildView(ca,Object.assign({},n,{translateY:null,caption:i.query("GET_LABEL_IDLE")})));i.ref.list=i.appendChildView(i.createChildView(Wn,{translateY:null}));i.ref.panel=i.appendChildView(i.createChildView(_n,{name:"panel-root"}));i.ref.assistant=i.appendChildView(i.createChildView(Ar,Object.assign({},n)));i.ref.data=i.appendChildView(i.createChildView(Ma,Object.assign({},n)));i.ref.measure=bi("div");i.ref.measure.style.height="100%";i.element.appendChild(i.ref.measure);i.ref.bounds=null;i.query("GET_STYLES").filter((function(e){return!W(e.value)})).map((function(e){var t=e.name,n=e.value;i.element.dataset[t]=n}));i.ref.widthPrevious=null;i.ref.widthUpdated=Mr((function(){i.ref.updateHistory=[];i.dispatch("DID_RESIZE_ROOT")}),250);i.ref.previousAspectRatio=null;i.ref.updateHistory=[];var o=window.matchMedia("(pointer: fine) and (hover: hover)").matches;var s="PointerEvent"in window;if(i.query("GET_ALLOW_REORDER")&&s&&!o){i.element.addEventListener("touchmove",Lr,{passive:false});i.element.addEventListener("gesturestart",Lr)}var l=i.query("GET_CREDITS");var c=l.length===2;if(c){var u=document.createElement("a");u.className="filepond--credits";u.setAttribute("aria-hidden","true");u.href=l[0];u.tabindex=-1;u.target="_blank";u.rel="noopener noreferrer";u.textContent=l[1];i.element.appendChild(u);i.ref.credits=u}};var Pr=function e(t){var i=t.root,n=t.props,a=t.actions;Hr({root:i,props:n,actions:a});a.filter((function(e){return/^DID_SET_STYLE_/.test(e.type)})).filter((function(e){return!W(e.data.value)})).map((function(e){var t=e.type,n=e.data;var a=Cr(t.substring(8).toLowerCase(),"_");i.element.dataset[a]=n.value;i.invalidateLayout()}));if(i.rect.element.hidden)return;if(i.rect.element.width!==i.ref.widthPrevious){i.ref.widthPrevious=i.rect.element.width;i.ref.widthUpdated()}var r=i.ref.bounds;if(!r){r=i.ref.bounds=Fr(i);i.element.removeChild(i.ref.measure);i.ref.measure=null}var o=i.ref,s=o.hopper,l=o.label,c=o.list,u=o.panel;if(s){s.updateHopperState()}var d=i.query("GET_PANEL_ASPECT_RATIO");var p=i.query("GET_ALLOW_MULTIPLE");var h=i.query("GET_TOTAL_ITEMS");var f=p?i.query("GET_MAX_FILES")||Dr:1;var g=h===f;var m=a.find((function(e){return e.type==="DID_ADD_ITEM"}));if(g&&m){var v=m.data.interactionMethod;l.opacity=0;if(p){l.translateY=-40}else{if(v===Te.API){l.translateX=40}else if(v===Te.BROWSE){l.translateY=40}else{l.translateY=30}}}else if(!g){l.opacity=1;l.translateX=0;l.translateY=0}var _=Rr(i);var b=Nr(i);var y=l.rect.element.height;var w=!p||g?0:y;var x=g?c.rect.element.marginTop:0;var E=h===0?0:c.rect.element.marginBottom;var k=w+x+b.visual+E;var I=w+x+b.bounds+E;c.translateY=Math.max(0,w-c.rect.element.marginTop)-_.top;if(d){var T=i.rect.element.width;var S=T*d;if(d!==i.ref.previousAspectRatio){i.ref.previousAspectRatio=d;i.ref.updateHistory=[]}var A=i.ref.updateHistory;A.push(T);var C=2;if(A.length>C*2){var M=A.length;var D=M-10;var L=0;for(var O=M;O>=D;O--){if(A[O]===A[O-2]){L++}if(L>=C){return}}}u.scalable=false;u.height=S;var P=S-w-(E-_.bottom)-(g?x:0);if(b.visual>P){c.overflow=P}else{c.overflow=null}i.height=S}else if(r.fixedHeight){u.scalable=false;var R=r.fixedHeight-w-(E-_.bottom)-(g?x:0);if(b.visual>R){c.overflow=R}else{c.overflow=null}}else if(r.cappedHeight){var N=k>=r.cappedHeight;var F=Math.min(r.cappedHeight,k);u.scalable=true;u.height=N?F:F-_.top-_.bottom;var G=F-w-(E-_.bottom)-(g?x:0);if(k>r.cappedHeight&&b.visual>G){c.overflow=G}else{c.overflow=null}i.height=Math.min(r.cappedHeight,I-_.top-_.bottom)}else{var z=h>0?_.top+_.bottom:0;u.scalable=true;u.height=Math.max(y,k-z);i.height=Math.max(y,I-z)}if(i.ref.credits&&u.heightCurrent)i.ref.credits.style.transform="translateY("+u.heightCurrent+"px)"};var Rr=function e(t){var i=t.ref.list.childViews[0].childViews[0];return i?{top:i.rect.element.marginTop,bottom:i.rect.element.marginBottom}:{top:0,bottom:0}};var Nr=function e(t){var i=0;var n=0;var a=t.ref.list;var r=a.childViews[0];var o=r.childViews.filter((function(e){return e.rect.element.height}));var s=t.query("GET_ACTIVE_ITEMS").map((function(e){return o.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));if(s.length===0)return{visual:i,bounds:n};var l=r.rect.element.width;var c=An(r,s,a.dragCoordinates);var u=s[0].rect.element;var d=u.marginTop+u.marginBottom;var p=u.marginLeft+u.marginRight;var h=u.width+p;var f=u.height+d;var g=typeof c!=="undefined"&&c>=0?1:0;var m=s.find((function(e){return e.markedForRemoval&&e.opacity<.45}))?-1:0;var v=s.length+g+m;var _=Sn(l,h);if(_===1){s.forEach((function(e){var t=e.rect.element.height+d;n+=t;i+=t*e.opacity}))}else{n=Math.ceil(v/_)*f;i=n}return{visual:i,bounds:n}};var Fr=function e(t){var i=t.ref.measureHeight||null;var n=parseInt(t.style.maxHeight,10)||null;var a=i===0?null:i;return{cappedHeight:n,fixedHeight:a}};var Gr=function e(t,i){var n=t.query("GET_ALLOW_REPLACE");var a=t.query("GET_ALLOW_MULTIPLE");var r=t.query("GET_TOTAL_ITEMS");var o=t.query("GET_MAX_FILES");var s=i.length;if(!a&&s>1){t.dispatch("DID_THROW_MAX_FILES",{source:i,error:qt("warning",0,"Max files")});return true}o=a?o:1;if(!a&&n){return false}var l=ne(o);if(l&&r+s>o){t.dispatch("DID_THROW_MAX_FILES",{source:i,error:qt("warning",0,"Max files")});return true}return false};var zr=function e(t,i,n){var a=t.childViews[0];return An(a,i,{left:n.scopeLeft-a.rect.element.left,top:n.scopeTop-(t.rect.outer.top+t.rect.element.marginTop+t.rect.element.scrollTop)})};var Br=function e(t){var i=t.query("GET_ALLOW_DROP");var n=t.query("GET_DISABLED");var a=i&&!n;if(a&&!t.ref.hopper){var r=lr(t.element,(function(e){var i=t.query("GET_BEFORE_DROP_FILE")||function(){return true};var n=t.query("GET_DROP_VALIDATION");return n?e.every((function(e){return Ke("ALLOW_HOPPER_ITEM",e,{query:t.query}).every((function(e){return e===true}))&&i(e)})):true}),{filterItems:function e(i){var n=t.query("GET_IGNORED_FILES");return i.filter((function(e){if(ii(e)){return!n.includes(e.name.toLowerCase())}return true}))},catchesDropsOnPage:t.query("GET_DROP_ON_PAGE"),requiresDropOnElement:t.query("GET_DROP_ON_ELEMENT")});r.onload=function(e,i){var n=t.ref.list.childViews[0];var a=n.childViews.filter((function(e){return e.rect.element.height}));var r=t.query("GET_ACTIVE_ITEMS").map((function(e){return a.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));Xe("ADD_ITEMS",e,{dispatch:t.dispatch}).then((function(e){if(Gr(t,e))return false;t.dispatch("ADD_ITEMS",{items:e,index:zr(t.ref.list,r,i),interactionMethod:Te.DROP})}));t.dispatch("DID_DROP",{position:i});t.dispatch("DID_END_DRAG",{position:i})};r.ondragstart=function(e){t.dispatch("DID_START_DRAG",{position:e})};r.ondrag=Mr((function(e){t.dispatch("DID_DRAG",{position:e})}));r.ondragend=function(e){t.dispatch("DID_END_DRAG",{position:e})};t.ref.hopper=r;t.ref.drip=t.appendChildView(t.createChildView(va))}else if(!a&&t.ref.hopper){t.ref.hopper.destroy();t.ref.hopper=null;t.removeChildView(t.ref.drip)}};var qr=function e(t,i){var n=t.query("GET_ALLOW_BROWSE");var a=t.query("GET_DISABLED");var r=n&&!a;if(r&&!t.ref.browser){t.ref.browser=t.appendChildView(t.createChildView(ra,Object.assign({},i,{onload:function e(i){Xe("ADD_ITEMS",i,{dispatch:t.dispatch}).then((function(e){if(Gr(t,e))return false;t.dispatch("ADD_ITEMS",{items:e,index:-1,interactionMethod:Te.BROWSE})}))}})),0)}else if(!r&&t.ref.browser){t.removeChildView(t.ref.browser);t.ref.browser=null}};var Ur=function e(t){var i=t.query("GET_ALLOW_PASTE");var n=t.query("GET_DISABLED");var a=i&&!n;if(a&&!t.ref.paster){t.ref.paster=fr();t.ref.paster.onload=function(e){Xe("ADD_ITEMS",e,{dispatch:t.dispatch}).then((function(e){if(Gr(t,e))return false;t.dispatch("ADD_ITEMS",{items:e,index:-1,interactionMethod:Te.PASTE})}))}}else if(!a&&t.ref.paster){t.ref.paster.destroy();t.ref.paster=null}};var Hr=H({DID_SET_ALLOW_BROWSE:function e(t){var i=t.root,n=t.props;qr(i,n)},DID_SET_ALLOW_DROP:function e(t){var i=t.root;Br(i)},DID_SET_ALLOW_PASTE:function e(t){var i=t.root;Ur(i)},DID_SET_DISABLED:function e(t){var i=t.root,n=t.props;Br(i);Ur(i);qr(i,n);var a=i.query("GET_DISABLED");if(a){i.element.dataset.disabled="disabled"}else{i.element.removeAttribute("data-disabled")}}});var Vr=q({name:"root",read:function e(t){var i=t.root;if(i.ref.measure){i.ref.measureHeight=i.ref.measure.offsetHeight}},create:Or,write:Pr,destroy:function e(t){var i=t.root;if(i.ref.paster){i.ref.paster.destroy()}if(i.ref.hopper){i.ref.hopper.destroy()}i.element.removeEventListener("touchmove",Lr);i.element.removeEventListener("gesturestart",Lr)},mixins:{styles:["height"]}});var jr=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=null;var a=$e();var o=i(we(a),[ft,Ie(a)],[mi,ke(a)]);o.dispatch("SET_OPTIONS",{options:t});var s=function e(){if(document.hidden)return;o.dispatch("KICK")};document.addEventListener("visibilitychange",s);var l=null;var c=false;var u=false;var d=null;var p=null;var h=function e(){if(!c){c=true}clearTimeout(l);l=setTimeout((function(){c=false;d=null;p=null;if(u){u=false;o.dispatch("DID_STOP_RESIZE")}}),500)};window.addEventListener("resize",h);var f=Vr(o,{id:Se()});var g=false;var m=false;var v={_read:function e(){if(c){p=window.innerWidth;if(!d){d=p}if(!u&&p!==d){o.dispatch("DID_START_RESIZE");u=true}}if(m&&g){g=f.element.offsetParent===null}if(g)return;f._read();m=f.rect.element.hidden},_write:function e(t){var i=o.processActionQueue().filter((function(e){return!/^SET_/.test(e.type)}));if(g&&!i.length)return;x(i);g=f._write(t,i,u);Be(o.query("GET_ITEMS"));if(g){o.processDispatchQueue()}}};var _=function e(t){return function(e){var i={type:t};if(!e){return i}if(e.hasOwnProperty("error")){i.error=e.error?Object.assign({},e.error):null}if(e.status){i.status=Object.assign({},e.status)}if(e.file){i.output=e.file}if(e.source){i.file=e.source}else if(e.item||e.id){var n=e.item?e.item:o.query("GET_ITEM",e.id);i.file=n?ze(n):null}if(e.items){i.items=e.items.map(ze)}if(/progress/.test(t)){i.progress=e.progress}if(e.hasOwnProperty("origin")&&e.hasOwnProperty("target")){i.origin=e.origin;i.target=e.target}return i}};var b={DID_DESTROY:_("destroy"),DID_INIT:_("init"),DID_THROW_MAX_FILES:_("warning"),DID_INIT_ITEM:_("initfile"),DID_START_ITEM_LOAD:_("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:_("addfileprogress"),DID_LOAD_ITEM:_("addfile"),DID_THROW_ITEM_INVALID:[_("error"),_("addfile")],DID_THROW_ITEM_LOAD_ERROR:[_("error"),_("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[_("error"),_("removefile")],DID_PREPARE_OUTPUT:_("preparefile"),DID_START_ITEM_PROCESSING:_("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:_("processfileprogress"),DID_ABORT_ITEM_PROCESSING:_("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:_("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:_("processfiles"),DID_REVERT_ITEM_PROCESSING:_("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[_("error"),_("processfile")],DID_REMOVE_ITEM:_("removefile"),DID_UPDATE_ITEMS:_("updatefiles"),DID_ACTIVATE_ITEM:_("activatefile"),DID_REORDER_ITEMS:_("reorderfiles")};var y=function e(t){var i=Object.assign({pond:R},t);delete i.type;f.element.dispatchEvent(new CustomEvent("FilePond:"+t.type,{detail:i,bubbles:true,cancelable:true,composed:true}));var n=[];if(t.hasOwnProperty("error")){n.push(t.error)}if(t.hasOwnProperty("file")){n.push(t.file)}var a=["type","error","file"];Object.keys(t).filter((function(e){return!a.includes(e)})).forEach((function(e){return n.push(t[e])}));R.fire.apply(R,[t.type].concat(n));var r=o.query("GET_ON"+t.type.toUpperCase());if(r){r.apply(void 0,n)}};var x=function e(t){if(!t.length)return;t.filter((function(e){return b[e.type]})).forEach((function(e){var t=b[e.type];(Array.isArray(t)?t:[t]).forEach((function(t){if(e.type==="DID_INIT_ITEM"){y(t(e.data))}else{setTimeout((function(){y(t(e.data))}),0)}}))}))};var E=function e(t){return o.dispatch("SET_OPTIONS",{options:t})};var k=function e(t){return o.query("GET_ACTIVE_ITEM",t)};var I=function e(t){return new Promise((function(e,i){o.dispatch("REQUEST_ITEM_PREPARE",{query:t,success:function t(i){e(i)},failure:function e(t){i(t)}})}))};var T=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise((function(e,n){C([{source:t,options:i}],{index:i.index}).then((function(t){return e(t&&t[0])})).catch(n)}))};var S=function e(t){return t.file&&t.id};var A=function e(t,i){if(typeof t==="object"&&!S(t)&&!i){i=t;t=undefined}o.dispatch("REMOVE_ITEM",Object.assign({},i,{query:t}));return o.query("GET_ACTIVE_ITEM",t)===null};var C=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}return new Promise((function(e,t){var n=[];var a={};if(Y(i[0])){n.push.apply(n,i[0]);Object.assign(a,i[1]||{})}else{var r=i[i.length-1];if(typeof r==="object"&&!(r instanceof Blob)){Object.assign(a,i.pop())}n.push.apply(n,i)}o.dispatch("ADD_ITEMS",{items:n,index:a.index,interactionMethod:Te.API,success:e,failure:t})}))};var M=function e(){return o.query("GET_ACTIVE_ITEMS")};var D=function e(t){return new Promise((function(e,i){o.dispatch("REQUEST_ITEM_PROCESSING",{query:t,success:function t(i){e(i)},failure:function e(t){i(t)}})}))};var L=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}var a=Array.isArray(i[0])?i[0]:i;var r=a.length?a:M();return Promise.all(r.map(I))};var O=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}var a=Array.isArray(i[0])?i[0]:i;if(!a.length){var r=M().filter((function(e){return!(e.status===qe.IDLE&&e.origin===Ue.LOCAL)&&e.status!==qe.PROCESSING&&e.status!==qe.PROCESSING_COMPLETE&&e.status!==qe.PROCESSING_REVERT_ERROR}));return Promise.all(r.map(D))}return Promise.all(a.map(D))};var P=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}var a=Array.isArray(i[0])?i[0]:i;var r;if(typeof a[a.length-1]==="object"){r=a.pop()}else if(Array.isArray(i[0])){r=i[1]}var o=M();if(!a.length)return Promise.all(o.map((function(e){return A(e,r)})));var s=a.map((function(e){return w(e)?o[e]?o[e].id:null:e})).filter((function(e){return e}));return s.map((function(e){return A(e,r)}))};var R=Object.assign({},Ne(),{},v,{},Ee(o,a),{setOptions:E,addFile:T,addFiles:C,getFile:k,processFile:D,prepareFile:I,removeFile:A,moveFile:function e(t,i){return o.dispatch("MOVE_ITEM",{query:t,index:i})},getFiles:M,processFiles:O,removeFiles:P,prepareFiles:L,sort:function e(t){return o.dispatch("SORT",{compare:t})},browse:function e(){var t=f.element.querySelector("input[type=file]");if(t){t.click()}},destroy:function e(){R.fire("destroy",f.element);o.dispatch("ABORT_ALL");f._destroy();window.removeEventListener("resize",h);document.removeEventListener("visibilitychange",s);o.dispatch("DID_DESTROY")},insertBefore:function e(t){return V(f.element,t)},insertAfter:function e(t){return j(f.element,t)},appendTo:function e(t){return t.appendChild(f.element)},replaceElement:function e(t){V(f.element,t);t.parentNode.removeChild(t);n=t},restoreElement:function e(){if(!n){return}j(n,f.element);f.element.parentNode.removeChild(f.element);n=null},isAttachedTo:function e(t){return f.element===t||n===t},element:{get:function e(){return f.element}},status:{get:function e(){return o.query("GET_STATUS")}}});o.dispatch("DID_INIT");return r(R)};var Yr=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var i={};a($e(),(function(e,t){i[e]=t[0]}));var n=jr(Object.assign({},i,{},t));return n};var Wr=function e(t){return t.charAt(0).toLowerCase()+t.slice(1)};var Xr=function e(t){return Cr(t.replace(/^data-/,""))};var Kr=function e(t,i){a(i,(function(i,n){a(t,(function(e,a){var r=new RegExp(i);var o=r.test(e);if(!o){return}delete t[e];if(n===false){return}if(J(n)){t[n]=a;return}var s=n.group;if(pe(n)&&!t[s]){t[s]={}}t[s][Wr(e.replace(r,""))]=a}));if(n.mapping){e(t[n.group],n.mapping)}}))};var Zr=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=[];a(t.attributes,(function(e){n.push(t.attributes[e])}));var r=n.filter((function(e){return e.name})).reduce((function(e,i){var n=o(t,i.name);e[Xr(i.name)]=n===i.name?true:n;return e}),{});Kr(r,i);return r};var Qr=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n={"^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$":false,"^files$":false};Ke("SET_ATTRIBUTE_TO_OPTION_MAP",n);var a=Object.assign({},i);var r=Zr(t.nodeName==="FIELDSET"?t.querySelector("input[type=file]"):t,n);Object.keys(r).forEach((function(e){if(pe(r[e])){if(!pe(a[e])){a[e]={}}Object.assign(a[e],r[e])}else{a[e]=r[e]}}));a.files=(i.files||[]).concat(Array.from(t.querySelectorAll("input:not([type=file])")).map((function(e){return{source:e.value,options:{type:e.dataset.type}}})));var o=Yr(a);if(t.files){Array.from(t.files).forEach((function(e){o.addFile(e)}))}o.replaceElement(t);return o};var $r=function e(){return t(arguments.length<=0?undefined:arguments[0])?Qr.apply(void 0,arguments):Yr.apply(void 0,arguments)};var Jr=["fire","_read","_write"];var eo=function e(t){var i={};Fe(t,i,Jr);return i};var to=function e(t,i){return t.replace(/(?:{([a-zA-Z]+)})/g,(function(e,t){return i[t]}))};var io=function e(t){var i=new Blob(["(",t.toString(),")()"],{type:"application/javascript"});var n=URL.createObjectURL(i);var a=new Worker(n);return{transfer:function e(t,i){},post:function e(t,i,n){var r=Se();a.onmessage=function(e){if(e.data.id===r){i(e.data.message)}};a.postMessage({id:r,message:t},n)},terminate:function e(){a.terminate();URL.revokeObjectURL(n)}}};var no=function e(t){return new Promise((function(e,i){var n=new Image;n.onload=function(){e(n)};n.onerror=function(e){i(e)};n.src=t}))};var ao=function e(t,i){var n=t.slice(0,t.size,t.type);n.lastModifiedDate=t.lastModifiedDate;n.name=i;return n};var ro=function e(t){return ao(t,t.name)};var oo=[];var so=function e(t){if(oo.includes(t)){return}oo.push(t);var i=t({addFilter:Ze,utils:{Type:Ye,forin:a,isString:J,isFile:ii,toNaturalFileSize:Mi,replaceInString:to,getExtensionFromFilename:wt,getFilenameWithoutExtension:ei,guesstimateMimeType:Ra,getFileFromBlob:It,getFilenameFromURL:yt,createRoute:H,createWorker:io,createView:q,createItemAPI:ze,loadImage:no,copyFile:ro,renameFile:ao,createBlob:St,applyFilterChain:Xe,text:yi,getNumericAspectRatioFromString:it},views:{fileActionButton:Ci}});Qe(i.options)};var lo=function e(){return Object.prototype.toString.call(window.operamini)==="[object OperaMini]"};var co=function e(){return"Promise"in window};var uo=function e(){return"slice"in Blob.prototype};var po=function e(){return"URL"in window&&"createObjectURL"in window.URL};var ho=function e(){return"visibilityState"in document};var fo=function e(){return"performance"in window};var go=function e(){return"supports"in(window.CSS||{})};var mo=function e(){return/MSIE|Trident/.test(window.navigator.userAgent)};var vo=function(){var e=g()&&!lo()&&ho()&&co()&&uo()&&po()&&fo()&&(go()||mo());return function(){return e}}();var _o={apps:[]};var bo="filepond";var yo=function e(){};e.Status={};e.FileStatus={};e.FileOrigin={};e.OptionTypes={};e.create=yo;e.destroy=yo;e.parse=yo;e.find=yo;e.registerPlugin=yo;e.getOptions=yo;e.setOptions=yo;if(vo()){U((function(){_o.apps.forEach((function(e){return e._read()}))}),(function(e){_o.apps.forEach((function(t){return t._write(e)}))}));var wo=function t(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:vo,create:e.create,destroy:e.destroy,parse:e.parse,find:e.find,registerPlugin:e.registerPlugin,setOptions:e.setOptions}}));document.removeEventListener("DOMContentLoaded",t)};if(document.readyState!=="loading"){setTimeout((function(){return wo()}),0)}else{document.addEventListener("DOMContentLoaded",wo)}var xo=function t(){return a($e(),(function(t,i){e.OptionTypes[t]=i[1]}))};e.Status=Object.assign({},at);e.FileOrigin=Object.assign({},Ue);e.FileStatus=Object.assign({},qe);e.OptionTypes={};xo();e.create=function t(){var i=$r.apply(void 0,arguments);i.on("destroy",e.destroy);_o.apps.push(i);return eo(i)};e.destroy=function e(t){var i=_o.apps.findIndex((function(e){return e.isAttachedTo(t)}));if(i>=0){var n=_o.apps.splice(i,1)[0];n.restoreElement();return true}return false};e.parse=function t(i){var n=Array.from(i.querySelectorAll("."+bo));var a=n.filter((function(e){return!_o.apps.find((function(t){return t.isAttachedTo(e)}))}));return a.map((function(t){return e.create(t)}))};e.find=function e(t){var i=_o.apps.find((function(e){return e.isAttachedTo(t)}));if(!i){return null}return eo(i)};e.registerPlugin=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}i.forEach(so);xo()};e.getOptions=function e(){var t={};a($e(),(function(e,i){t[e]=i[0]}));return t};e.setOptions=function t(i){if(pe(i)){_o.apps.forEach((function(e){e.setOptions(i)}));Je(i)}return e.getOptions()}}e.supported=vo;Object.defineProperty(e,"__esModule",{value:true})}))}));var filepondPluginFileValidateSize=createCommonjsModule((function(e,t){
|
|
17
|
+
(function(e,i){i(t)})(commonjsGlobal,(function(e){var t=function e(t){return t instanceof HTMLElement};var i=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var a=Object.assign({},t);var r=[];var o=[];var s=function e(){return Object.assign({},a)};var l=function e(){var t=[].concat(r);r.length=0;return t};var c=function e(){var t=[].concat(o);o.length=0;t.forEach((function(e){var t=e.type,i=e.data;u(t,i)}))};var u=function e(t,i,n){if(n&&!document.hidden){o.push({type:t,data:i});return}if(f[t]){f[t](i)}r.push({type:t,data:i})};var d=function e(t){var i;for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++){a[r-1]=arguments[r]}return h[t]?(i=h)[t].apply(i,a):null};var p={getState:s,processActionQueue:l,processDispatchQueue:c,dispatch:u,query:d};var h={};i.forEach((function(e){h=Object.assign({},e(a),{},h)}));var f={};n.forEach((function(e){f=Object.assign({},e(u,d,a),{},f)}));return p};var n=function e(t,i,n){if(typeof n==="function"){t[i]=n;return}Object.defineProperty(t,i,Object.assign({},n))};var a=function e(t,i){for(var n in t){if(!t.hasOwnProperty(n)){continue}i(n,t[n])}};var r=function e(t){var i={};a(t,(function(e){n(i,e,t[e])}));return i};var o=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(n===null){return t.getAttribute(i)||t.hasAttribute(i)}t.setAttribute(i,n)};var s="http://www.w3.org/2000/svg";var l=["svg","path"];var c=function e(t){return l.includes(t)};var u=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(typeof i==="object"){n=i;i=null}var r=c(t)?document.createElementNS(s,t):document.createElement(t);if(i){if(c(t)){o(r,"class",i)}else{r.className=i}}a(n,(function(e,t){o(r,e,t)}));return r};var d=function e(t){return function(e,i){if(typeof i!=="undefined"&&t.children[i]){t.insertBefore(e,t.children[i])}else{t.appendChild(e)}}};var p=function e(t,i){return function(e,t){if(typeof t!=="undefined"){i.splice(t,0,e)}else{i.push(e)}return e}};var h=function e(t,i){return function(e){i.splice(i.indexOf(e),1);if(e.element.parentNode){t.removeChild(e.element)}return e}};var f=function(){return typeof window!=="undefined"&&typeof window.document!=="undefined"}();var g=function e(){return f};var m=g()?u("svg"):{};var v="children"in m?function(e){return e.children.length}:function(e){return e.childNodes.length};var _=function e(t,i,n,a){var r=n[0]||t.left;var o=n[1]||t.top;var s=r+t.width;var l=o+t.height*(a[1]||1);var c={element:Object.assign({},t),inner:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},outer:{left:r,top:o,right:s,bottom:l}};i.filter((function(e){return!e.isRectIgnored()})).map((function(e){return e.rect})).forEach((function(e){b(c.inner,Object.assign({},e.inner));b(c.outer,Object.assign({},e.outer))}));y(c.inner);c.outer.bottom+=c.element.marginBottom;c.outer.right+=c.element.marginRight;y(c.outer);return c};var b=function e(t,i){i.top+=t.top;i.right+=t.left;i.bottom+=t.top;i.left+=t.left;if(i.bottom>t.bottom){t.bottom=i.bottom}if(i.right>t.right){t.right=i.right}};var y=function e(t){t.width=t.right-t.left;t.height=t.bottom-t.top};var w=function e(t){return typeof t==="number"};var x=function e(t,i,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:.001;return Math.abs(t-i)<a&&Math.abs(n)<a};var E=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=t.stiffness,n=i===void 0?.5:i,a=t.damping,o=a===void 0?.75:a,s=t.mass,l=s===void 0?10:s;var c=null;var u=null;var d=0;var p=false;var h=function e(t,i){if(p)return;if(!(w(c)&&w(u))){p=true;d=0;return}var a=-(u-c)*n;d+=a/l;u+=d;d*=o;if(x(u,c,d)||i){u=c;d=0;p=true;g.onupdate(u);g.oncomplete(u)}else{g.onupdate(u)}};var f=function e(t){if(w(t)&&!w(u)){u=t}if(c===null){c=t;u=t}c=t;if(u===c||typeof c==="undefined"){p=true;d=0;g.onupdate(u);g.oncomplete(u);return}p=false};var g=r({interpolate:h,target:{set:f,get:function e(){return c}},resting:{get:function e(){return p}},onupdate:function e(t){},oncomplete:function e(t){}});return g};var k=function e(t){return t<.5?2*t*t:-1+(4-2*t)*t};var I=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=t.duration,n=i===void 0?500:i,a=t.easing,o=a===void 0?k:a,s=t.delay,l=s===void 0?0:s;var c=null;var u;var d;var p=true;var h=false;var f=null;var g=function e(t,i){if(p||f===null)return;if(c===null){c=t}if(t-c<l)return;u=t-c-l;if(u>=n||i){u=1;d=h?0:1;m.onupdate(d*f);m.oncomplete(d*f);p=true}else{d=u/n;m.onupdate((u>=0?o(h?1-d:d):0)*f)}};var m=r({interpolate:g,target:{get:function e(){return h?0:f},set:function e(t){if(f===null){f=t;m.onupdate(t);m.oncomplete(t);return}if(t<f){f=1;h=true}else{h=false;f=t}p=false;c=null}},resting:{get:function e(){return p}},onupdate:function e(t){},oncomplete:function e(t){}});return m};var T={spring:E,tween:I};var S=function e(t,i,n){var a=t[i]&&typeof t[i][n]==="object"?t[i][n]:t[i]||t;var r=typeof a==="string"?a:a.type;var o=typeof a==="object"?Object.assign({},a):{};return T[r]?T[r](o):null};var A=function e(t,i,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;i=Array.isArray(i)?i:[i];i.forEach((function(e){t.forEach((function(t){var i=t;var r=function e(){return n[t]};var o=function e(i){return n[t]=i};if(typeof t==="object"){i=t.key;r=t.getter||r;o=t.setter||o}if(e[i]&&!a){return}e[i]={get:r,set:o}}))}))};var C=function e(t){var i=t.mixinConfig,n=t.viewProps,r=t.viewInternalAPI,o=t.viewExternalAPI;var s=Object.assign({},n);var e=[];a(i,(function(t,i){var a=S(i);if(!a){return}a.onupdate=function(e){n[t]=e};a.target=s[t];var l={key:t,setter:function e(t){if(a.target===t){return}a.target=t},getter:function e(){return n[t]}};A([l],[r,o],n,true);e.push(a)}));return{write:function t(i){var n=document.hidden;var a=true;e.forEach((function(e){if(!e.resting)a=false;e.interpolate(i,n)}));return a},destroy:function e(){}}};var M=function e(t){return function(e,i){t.addEventListener(e,i)}};var D=function e(t){return function(e,i){t.removeEventListener(e,i)}};var L=function e(t){var i=t.viewExternalAPI,n=t.view;var a=[];var r=M(n.element);var o=D(n.element);i.on=function(e,t){a.push({type:e,fn:t});r(e,t)};i.off=function(e,t){a.splice(a.findIndex((function(i){return i.type===e&&i.fn===t})),1);o(e,t)};return{write:function e(){return true},destroy:function e(){a.forEach((function(e){o(e.type,e.fn)}))}}};var O=function e(t){var i=t.mixinConfig,n=t.viewProps,a=t.viewExternalAPI;A(i,a,n)};var P=function e(t){return t!=null};var R={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0};var N=function e(t){var i=t.mixinConfig,n=t.viewProps,a=t.viewInternalAPI,r=t.viewExternalAPI,o=t.view;var s=Object.assign({},n);var l={};A(i,[a,r],n);var c=function e(){return[n["translateX"]||0,n["translateY"]||0]};var u=function e(){return[n["scaleX"]||0,n["scaleY"]||0]};var d=function e(){return o.rect?_(o.rect,o.childViews,c(),u()):null};a.rect={get:d};r.rect={get:d};i.forEach((function(e){n[e]=typeof s[e]==="undefined"?R[e]:s[e]}));return{write:function e(){if(!F(l,n)){return}G(o.element,n);Object.assign(l,Object.assign({},n));return true},destroy:function e(){}}};var F=function e(t,i){if(Object.keys(t).length!==Object.keys(i).length){return true}for(var n in i){if(i[n]!==t[n]){return true}}return false};var G=function e(t,i){var n=i.opacity,a=i.perspective,r=i.translateX,o=i.translateY,s=i.scaleX,l=i.scaleY,c=i.rotateX,u=i.rotateY,d=i.rotateZ,p=i.originX,h=i.originY,f=i.width,g=i.height;var m="";var v="";if(P(p)||P(h)){v+="transform-origin: "+(p||0)+"px "+(h||0)+"px;"}if(P(a)){m+="perspective("+a+"px) "}if(P(r)||P(o)){m+="translate3d("+(r||0)+"px, "+(o||0)+"px, 0) "}if(P(s)||P(l)){m+="scale3d("+(P(s)?s:1)+", "+(P(l)?l:1)+", 1) "}if(P(d)){m+="rotateZ("+d+"rad) "}if(P(c)){m+="rotateX("+c+"rad) "}if(P(u)){m+="rotateY("+u+"rad) "}if(m.length){v+="transform:"+m+";"}if(P(n)){v+="opacity:"+n+";";if(n===0){v+="visibility:hidden;"}if(n<1){v+="pointer-events:none;"}}if(P(g)){v+="height:"+g+"px;"}if(P(f)){v+="width:"+f+"px;"}var _=t.elementCurrentStyle||"";if(v.length!==_.length||v!==_){t.style.cssText=v;t.elementCurrentStyle=v}};var z={styles:N,listeners:L,animations:C,apis:O};var B=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!i.layoutCalculated){t.paddingTop=parseInt(n.paddingTop,10)||0;t.marginTop=parseInt(n.marginTop,10)||0;t.marginRight=parseInt(n.marginRight,10)||0;t.marginBottom=parseInt(n.marginBottom,10)||0;t.marginLeft=parseInt(n.marginLeft,10)||0;i.layoutCalculated=true}t.left=i.offsetLeft||0;t.top=i.offsetTop||0;t.width=i.offsetWidth||0;t.height=i.offsetHeight||0;t.right=t.left+t.width;t.bottom=t.top+t.height;t.scrollTop=i.scrollTop;t.hidden=i.offsetParent===null;return t};var q=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=t.tag,n=i===void 0?"div":i,a=t.name,o=a===void 0?null:a,s=t.attributes,l=s===void 0?{}:s,c=t.read,f=c===void 0?function(){}:c,g=t.write,m=g===void 0?function(){}:g,b=t.create,y=b===void 0?function(){}:b,w=t.destroy,x=w===void 0?function(){}:w,E=t.filterFrameActionsForChild,k=E===void 0?function(e,t){return t}:E,I=t.didCreateView,T=I===void 0?function(){}:I,S=t.didWriteView,A=S===void 0?function(){}:S,C=t.ignoreRect,M=C===void 0?false:C,D=t.ignoreRectUpdate,L=D===void 0?false:D,O=t.mixins,P=O===void 0?[]:O;return function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=u(n,"filepond--"+o,l);var a=window.getComputedStyle(i,null);var s=B();var c=null;var g=false;var b=[];var w=[];var E={};var I={};var S=[m];var C=[f];var D=[x];var O=function e(){return i};var R=function e(){return b.concat()};var N=function e(){return E};var F=function e(t){return function(e,i){return e(t,i)}};var G=function e(){if(c){return c}c=_(s,b,[0,0],[1,1]);return c};var q=function e(){return a};var H=function e(){c=null;b.forEach((function(e){return e._read()}));var n=!(L&&s.width&&s.height);if(n){B(s,i,a)}var r={root:K,props:t,rect:s};C.forEach((function(e){return e(r)}))};var U=function e(i,n,a){var r=n.length===0;S.forEach((function(e){var o=e({props:t,root:K,actions:n,timestamp:i,shouldOptimize:a});if(o===false){r=false}}));w.forEach((function(e){var t=e.write(i);if(t===false){r=false}}));b.filter((function(e){return!!e.element.parentNode})).forEach((function(e){var t=e._write(i,k(e,n),a);if(!t){r=false}}));b.forEach((function(e,t){if(e.element.parentNode){return}K.appendChild(e.element,t);e._read();e._write(i,k(e,n),a);r=false}));g=r;A({props:t,root:K,actions:n,timestamp:i});return r};var V=function e(){w.forEach((function(e){return e.destroy()}));D.forEach((function(e){e({root:K,props:t})}));b.forEach((function(e){return e._destroy()}))};var j={element:{get:O},style:{get:q},childViews:{get:R}};var Y=Object.assign({},j,{rect:{get:G},ref:{get:N},is:function e(t){return o===t},appendChild:d(i),createChildView:F(e),linkView:function e(t){b.push(t);return t},unlinkView:function e(t){b.splice(b.indexOf(t),1)},appendChildView:p(i,b),removeChildView:h(i,b),registerWriter:function e(t){return S.push(t)},registerReader:function e(t){return C.push(t)},registerDestroyer:function e(t){return D.push(t)},invalidateLayout:function e(){return i.layoutCalculated=false},dispatch:e.dispatch,query:e.query});var W={element:{get:O},childViews:{get:R},rect:{get:G},resting:{get:function e(){return g}},isRectIgnored:function e(){return M},_read:H,_write:U,_destroy:V};var X=Object.assign({},j,{rect:{get:function e(){return s}}});Object.keys(P).sort((function(e,t){if(e==="styles"){return 1}else if(t==="styles"){return-1}return 0})).forEach((function(e){var i=z[e]({mixinConfig:P[e],viewProps:t,viewState:I,viewInternalAPI:Y,viewExternalAPI:W,view:r(X)});if(i){w.push(i)}}));var K=r(Y);y({root:K,props:t});var Z=v(i);b.forEach((function(e,t){K.appendChild(e.element,Z+t)}));T(K);return r(W)}};var H=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:60;var a="__framePainter";if(window[a]){window[a].readers.push(t);window[a].writers.push(i);return}window[a]={readers:[t],writers:[i]};var r=window[a];var o=1e3/n;var s=null;var l=null;var c=null;var u=null;var d=function e(){if(document.hidden){c=function e(){return window.setTimeout((function(){return p(performance.now())}),o)};u=function e(){return window.clearTimeout(l)}}else{c=function e(){return window.requestAnimationFrame(p)};u=function e(){return window.cancelAnimationFrame(l)}}};document.addEventListener("visibilitychange",(function(){if(u)u();d();p(performance.now())}));var p=function e(t){l=c(e);if(!s){s=t}var i=t-s;if(i<=o){return}s=t-i%o;r.readers.forEach((function(e){return e()}));r.writers.forEach((function(e){return e(t)}))};d();p(performance.now());return{pause:function e(){u(l)}}};var U=function e(t,i){return function(e){var n=e.root,a=e.props,r=e.actions,o=r===void 0?[]:r,s=e.timestamp,l=e.shouldOptimize;o.filter((function(e){return t[e.type]})).forEach((function(e){return t[e.type]({root:n,props:a,action:e.data,timestamp:s,shouldOptimize:l})}));if(i){i({root:n,props:a,actions:o,timestamp:s,shouldOptimize:l})}}};var V=function e(t,i){return i.parentNode.insertBefore(t,i)};var j=function e(t,i){return i.parentNode.insertBefore(t,i.nextSibling)};var Y=function e(t){return Array.isArray(t)};var W=function e(t){return t==null};var X=function e(t){return t.trim()};var K=function e(t){return""+t};var Z=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:",";if(W(t)){return[]}if(Y(t)){return t}return K(t).split(i).map(X).filter((function(e){return e.length}))};var Q=function e(t){return typeof t==="boolean"};var $=function e(t){return Q(t)?t:t==="true"};var J=function e(t){return typeof t==="string"};var ee=function e(t){return w(t)?t:J(t)?K(t).replace(/[a-z]+/gi,""):0};var te=function e(t){return parseInt(ee(t),10)};var ie=function e(t){return parseFloat(ee(t))};var ne=function e(t){return w(t)&&isFinite(t)&&Math.floor(t)===t};var ae=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1e3;if(ne(t)){return t}var n=K(t).trim();if(/MB$/i.test(n)){n=n.replace(/MB$i/,"").trim();return te(n)*i*i}if(/KB/i.test(n)){n=n.replace(/KB$i/,"").trim();return te(n)*i}return te(n)};var re=function e(t){return typeof t==="function"};var oe=function e(t){var i=self;var n=t.split(".");var a=null;while(a=n.shift()){i=i[a];if(!i){return null}}return i};var se={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"};var le=function e(t){var i={};i.url=J(t)?t:t.url||"";i.timeout=t.timeout?parseInt(t.timeout,10):0;i.headers=t.headers?t.headers:{};a(se,(function(e){i[e]=ce(e,t[e],se[e],i.timeout,i.headers)}));i.process=t.process||J(t)||t.url?i.process:null;i.remove=t.remove||null;delete i.headers;return i};var ce=function e(t,i,n,a,r){if(i===null){return null}if(typeof i==="function"){return i}var o={url:n==="GET"||n==="PATCH"?"?"+t+"=":"",method:n,headers:r,withCredentials:false,timeout:a,onload:null,ondata:null,onerror:null};if(J(i)){o.url=i;return o}Object.assign(o,i);if(J(o.headers)){var s=o.headers.split(/:(.+)/);o.headers={header:s[0],value:s[1]}}o.withCredentials=$(o.withCredentials);return o};var ue=function e(t){return le(t)};var de=function e(t){return t===null};var pe=function e(t){return typeof t==="object"&&t!==null};var he=function e(t){return pe(t)&&J(t.url)&&pe(t.process)&&pe(t.revert)&&pe(t.restore)&&pe(t.fetch)};var fe=function e(t){if(Y(t)){return"array"}if(de(t)){return"null"}if(ne(t)){return"int"}if(/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(t)){return"bytes"}if(he(t)){return"api"}return typeof t};var ge=function e(t){return t.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",')};var me={array:Z,boolean:$,int:function e(t){return fe(t)==="bytes"?ae(t):te(t)},number:ie,float:ie,bytes:ae,string:function e(t){return re(t)?t:K(t)},function:function e(t){return oe(t)},serverapi:ue,object:function e(t){try{return JSON.parse(ge(t))}catch(e){return null}}};var ve=function e(t,i){return me[i](t)};var _e=function e(t,i,n){if(t===i){return t}var a=fe(t);if(a!==n){var r=ve(t,n);a=fe(r);if(r===null){throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+n+'"'}else{t=r}}return t};var be=function e(t,i){var n=t;return{enumerable:true,get:function e(){return n},set:function e(a){n=_e(a,t,i)}}};var ye=function e(t){var i={};a(t,(function(e){var n=t[e];i[e]=be(n[0],n[1])}));return r(i)};var we=function e(t){return{items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:ye(t)}};var xe=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"-";return t.split(/(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join(i)};var Ee=function e(t,i){var n={};a(i,(function(e){n[e]={get:function i(){return t.getState().options[e]},set:function i(n){t.dispatch("SET_"+xe(e,"_").toUpperCase(),{value:n})}}}));return n};var ke=function e(t){return function(e,i,n){var r={};a(t,(function(t){var i=xe(t,"_").toUpperCase();r["SET_"+i]=function(a){try{n.options[t]=a.value}catch(e){}e("DID_SET_"+i,{value:n.options[t]})}}));return r}};var Ie=function e(t){return function(e){var i={};a(t,(function(t){i["GET_"+xe(t,"_").toUpperCase()]=function(i){return e.options[t]}}));return i}};var Te={API:1,DROP:2,BROWSE:3,PASTE:4,NONE:5};var Se=function e(){return Math.random().toString(36).substring(2,11)};function Ae(e,t){if(e==null)return{};var i={};var n=Object.keys(e);var a,r;for(r=0;r<n.length;r++){a=n[r];if(t.indexOf(a)>=0)continue;i[a]=e[a]}return i}function Ce(e,t){if(e==null)return{};var i=Ae(e,t);var n,a;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++){n=r[a];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;i[n]=e[n]}}return i}function Me(e){return De(e)||Le(e)||Oe()}function De(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}function Le(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Oe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var Pe=function e(t,i){return t.splice(i,1)};var Re=function e(t,i){if(i){t()}else if(document.hidden){Promise.resolve(1).then(t)}else{setTimeout(t,0)}};var Ne=function e(){var t=[];var i=function e(i,n){Pe(t,t.findIndex((function(e){return e.event===i&&(e.cb===n||!n)})))};var n=function e(i,n,a){t.filter((function(e){return e.event===i})).map((function(e){return e.cb})).forEach((function(e){return Re((function(){return e.apply(void 0,Me(n))}),a)}))};return{fireSync:function e(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),r=1;r<i;r++){a[r-1]=arguments[r]}n(t,a,true)},fire:function e(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),r=1;r<i;r++){a[r-1]=arguments[r]}n(t,a,false)},on:function e(i,n){t.push({event:i,cb:n})},onOnce:function e(n,a){t.push({event:n,cb:function e(){i(n,a);a.apply(void 0,arguments)}})},off:i}};var Fe=function e(t,i,n){Object.getOwnPropertyNames(t).filter((function(e){return!n.includes(e)})).forEach((function(e){return Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))}))};var Ge=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"];var ze=function e(t){var i={};Fe(t,i,Ge);return i};var Be=function e(t){t.forEach((function(e,i){if(e.released){Pe(t,i)}}))};var qe={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8};var He={INPUT:1,LIMBO:2,LOCAL:3};var Ue=function e(t){return/[^0-9]+/.exec(t)};var Ve=function e(){return Ue(1.1.toLocaleString())[0]};var je=function e(){var t=Ve();var i=1e3.toLocaleString();var n=1e3.toString();if(i!==n){return Ue(i)[0]}return t==="."?",":"."};var Ye={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"};var We=[];var Xe=function e(t,i,n){return new Promise((function(e,a){var r=We.filter((function(e){return e.key===t})).map((function(e){return e.cb}));if(r.length===0){e(i);return}var o=r.shift();r.reduce((function(e,t){return e.then((function(e){return t(e,n)}))}),o(i,n)).then((function(t){return e(t)})).catch((function(e){return a(e)}))}))};var Ke=function e(t,i,n){return We.filter((function(e){return e.key===t})).map((function(e){return e.cb(i,n)}))};var Ze=function e(t,i){return We.push({key:t,cb:i})};var Qe=function e(t){return Object.assign(et,t)};var $e=function e(){return Object.assign({},et)};var Je=function e(t){a(t,(function(e,t){if(!et[e]){return}et[e][0]=_e(t,et[e][0],et[e][1])}))};var et={id:[null,Ye.STRING],name:["filepond",Ye.STRING],disabled:[false,Ye.BOOLEAN],className:[null,Ye.STRING],required:[false,Ye.BOOLEAN],captureMethod:[null,Ye.STRING],allowSyncAcceptAttribute:[true,Ye.BOOLEAN],allowDrop:[true,Ye.BOOLEAN],allowBrowse:[true,Ye.BOOLEAN],allowPaste:[true,Ye.BOOLEAN],allowMultiple:[false,Ye.BOOLEAN],allowReplace:[true,Ye.BOOLEAN],allowRevert:[true,Ye.BOOLEAN],allowRemove:[true,Ye.BOOLEAN],allowProcess:[true,Ye.BOOLEAN],allowReorder:[false,Ye.BOOLEAN],allowDirectoriesOnly:[false,Ye.BOOLEAN],storeAsFile:[false,Ye.BOOLEAN],forceRevert:[false,Ye.BOOLEAN],maxFiles:[null,Ye.INT],checkValidity:[false,Ye.BOOLEAN],itemInsertLocationFreedom:[true,Ye.BOOLEAN],itemInsertLocation:["before",Ye.STRING],itemInsertInterval:[75,Ye.INT],dropOnPage:[false,Ye.BOOLEAN],dropOnElement:[true,Ye.BOOLEAN],dropValidation:[false,Ye.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],Ye.ARRAY],instantUpload:[true,Ye.BOOLEAN],maxParallelUploads:[2,Ye.INT],allowMinimumUploadDuration:[true,Ye.BOOLEAN],chunkUploads:[false,Ye.BOOLEAN],chunkForce:[false,Ye.BOOLEAN],chunkSize:[5e6,Ye.INT],chunkRetryDelays:[[500,1e3,3e3],Ye.ARRAY],server:[null,Ye.SERVER_API],fileSizeBase:[1e3,Ye.INT],labelFileSizeBytes:["bytes",Ye.STRING],labelFileSizeKilobytes:["KB",Ye.STRING],labelFileSizeMegabytes:["MB",Ye.STRING],labelFileSizeGigabytes:["GB",Ye.STRING],labelDecimalSeparator:[Ve(),Ye.STRING],labelThousandsSeparator:[je(),Ye.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',Ye.STRING],labelInvalidField:["Field contains invalid files",Ye.STRING],labelFileWaitingForSize:["Waiting for size",Ye.STRING],labelFileSizeNotAvailable:["Size not available",Ye.STRING],labelFileCountSingular:["file in list",Ye.STRING],labelFileCountPlural:["files in list",Ye.STRING],labelFileLoading:["Loading",Ye.STRING],labelFileAdded:["Added",Ye.STRING],labelFileLoadError:["Error during load",Ye.STRING],labelFileRemoved:["Removed",Ye.STRING],labelFileRemoveError:["Error during remove",Ye.STRING],labelFileProcessing:["Uploading",Ye.STRING],labelFileProcessingComplete:["Upload complete",Ye.STRING],labelFileProcessingAborted:["Upload cancelled",Ye.STRING],labelFileProcessingError:["Error during upload",Ye.STRING],labelFileProcessingRevertError:["Error during revert",Ye.STRING],labelTapToCancel:["tap to cancel",Ye.STRING],labelTapToRetry:["tap to retry",Ye.STRING],labelTapToUndo:["tap to undo",Ye.STRING],labelButtonRemoveItem:["Remove",Ye.STRING],labelButtonAbortItemLoad:["Abort",Ye.STRING],labelButtonRetryItemLoad:["Retry",Ye.STRING],labelButtonAbortItemProcessing:["Cancel",Ye.STRING],labelButtonUndoItemProcessing:["Undo",Ye.STRING],labelButtonRetryItemProcessing:["Retry",Ye.STRING],labelButtonProcessItem:["Upload",Ye.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>',Ye.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>',Ye.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>',Ye.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>',Ye.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>',Ye.STRING],oninit:[null,Ye.FUNCTION],onwarning:[null,Ye.FUNCTION],onerror:[null,Ye.FUNCTION],onactivatefile:[null,Ye.FUNCTION],oninitfile:[null,Ye.FUNCTION],onaddfilestart:[null,Ye.FUNCTION],onaddfileprogress:[null,Ye.FUNCTION],onaddfile:[null,Ye.FUNCTION],onprocessfilestart:[null,Ye.FUNCTION],onprocessfileprogress:[null,Ye.FUNCTION],onprocessfileabort:[null,Ye.FUNCTION],onprocessfilerevert:[null,Ye.FUNCTION],onprocessfile:[null,Ye.FUNCTION],onprocessfiles:[null,Ye.FUNCTION],onremovefile:[null,Ye.FUNCTION],onpreparefile:[null,Ye.FUNCTION],onupdatefiles:[null,Ye.FUNCTION],onreorderfiles:[null,Ye.FUNCTION],beforeDropFile:[null,Ye.FUNCTION],beforeAddFile:[null,Ye.FUNCTION],beforeRemoveFile:[null,Ye.FUNCTION],beforePrepareFile:[null,Ye.FUNCTION],stylePanelLayout:[null,Ye.STRING],stylePanelAspectRatio:[null,Ye.STRING],styleItemPanelAspectRatio:[null,Ye.STRING],styleButtonRemoveItemPosition:["left",Ye.STRING],styleButtonProcessItemPosition:["right",Ye.STRING],styleLoadIndicatorPosition:["right",Ye.STRING],styleProgressIndicatorPosition:["right",Ye.STRING],styleButtonRemoveItemAlign:[false,Ye.BOOLEAN],files:[[],Ye.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],Ye.ARRAY]};var tt=function e(t,i){if(W(i)){return t[0]||null}if(ne(i)){return t[i]||null}if(typeof i==="object"){i=i.id}return t.find((function(e){return e.id===i}))||null};var it=function e(t){if(W(t)){return t}if(/:/.test(t)){var i=t.split(":");return i[1]/i[0]}return parseFloat(t)};var nt=function e(t){return t.filter((function(e){return!e.archived}))};var at={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4};var rt=null;var ot=function e(){if(rt===null){try{var t=new DataTransfer;t.items.add(new File(["hello world"],"This_Works.txt"));var i=document.createElement("input");i.setAttribute("type","file");i.files=t.files;rt=i.files.length===1}catch(e){rt=false}}return rt};var st=[qe.LOAD_ERROR,qe.PROCESSING_ERROR,qe.PROCESSING_REVERT_ERROR];var lt=[qe.LOADING,qe.PROCESSING,qe.PROCESSING_QUEUED,qe.INIT];var ct=[qe.PROCESSING_COMPLETE];var ut=function e(t){return st.includes(t.status)};var dt=function e(t){return lt.includes(t.status)};var pt=function e(t){return ct.includes(t.status)};var ht=function e(t){return pe(t.options.server)&&(pe(t.options.server.process)||re(t.options.server.process))};var ft=function e(t){return{GET_STATUS:function e(){var i=nt(t.items);var n=at.EMPTY,a=at.ERROR,r=at.BUSY,o=at.IDLE,s=at.READY;if(i.length===0)return n;if(i.some(ut))return a;if(i.some(dt))return r;if(i.some(pt))return s;return o},GET_ITEM:function e(i){return tt(t.items,i)},GET_ACTIVE_ITEM:function e(i){return tt(nt(t.items),i)},GET_ACTIVE_ITEMS:function e(){return nt(t.items)},GET_ITEMS:function e(){return t.items},GET_ITEM_NAME:function e(i){var n=tt(t.items,i);return n?n.filename:null},GET_ITEM_SIZE:function e(i){var n=tt(t.items,i);return n?n.fileSize:null},GET_STYLES:function e(){return Object.keys(t.options).filter((function(e){return/^style/.test(e)})).map((function(e){return{name:e,value:t.options[e]}}))},GET_PANEL_ASPECT_RATIO:function e(){var i=/circle/.test(t.options.stylePanelLayout);var n=i?1:it(t.options.stylePanelAspectRatio);return n},GET_ITEM_PANEL_ASPECT_RATIO:function e(){return t.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function e(i){return nt(t.items).filter((function(e){return e.status===i}))},GET_TOTAL_ITEMS:function e(){return nt(t.items).length},SHOULD_UPDATE_FILE_INPUT:function e(){return t.options.storeAsFile&&ot()&&!ht(t)},IS_ASYNC:function e(){return ht(t)},GET_FILE_SIZE_LABELS:function e(t){return{labelBytes:t("GET_LABEL_FILE_SIZE_BYTES")||undefined,labelKilobytes:t("GET_LABEL_FILE_SIZE_KILOBYTES")||undefined,labelMegabytes:t("GET_LABEL_FILE_SIZE_MEGABYTES")||undefined,labelGigabytes:t("GET_LABEL_FILE_SIZE_GIGABYTES")||undefined}}}};var gt=function e(t){var i=nt(t.items).length;if(!t.options.allowMultiple){return i===0}var n=t.options.maxFiles;if(n===null){return true}if(i<n){return true}return false};var mt=function e(t,i,n){return Math.max(Math.min(n,t),i)};var vt=function e(t,i,n){return t.splice(i,0,n)};var _t=function e(t,i,n){if(W(i)){return null}if(typeof n==="undefined"){t.push(i);return i}n=mt(n,0,t.length);vt(t,n,i);return i};var bt=function e(t){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(t)};var yt=function e(t){return t.split("/").pop().split("?").shift()};var wt=function e(t){return t.split(".").pop()};var xt=function e(t){if(typeof t!=="string"){return""}var i=t.split("/").pop();if(/svg/.test(i)){return"svg"}if(/zip|compressed/.test(i)){return"zip"}if(/plain/.test(i)){return"txt"}if(/msword/.test(i)){return"doc"}if(/[a-z]+/.test(i)){if(i==="jpeg"){return"jpg"}return i}return""};var Et=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return(i+t).slice(-i.length)};var kt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:new Date;return t.getFullYear()+"-"+Et(t.getMonth()+1,"00")+"-"+Et(t.getDate(),"00")+"_"+Et(t.getHours(),"00")+"-"+Et(t.getMinutes(),"00")+"-"+Et(t.getSeconds(),"00")};var It=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var r=typeof n==="string"?t.slice(0,t.size,n):t.slice(0,t.size,t.type);r.lastModifiedDate=new Date;if(t._relativePath)r._relativePath=t._relativePath;if(!J(i)){i=kt()}if(i&&a===null&&wt(i)){r.name=i}else{a=a||xt(r.type);r.name=i+(a?"."+a:"")}return r};var Tt=function e(){return window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder};var St=function e(t,i){var n=Tt();if(n){var a=new n;a.append(t);return a.getBlob(i)}return new Blob([t],{type:i})};var At=function e(t,i){var n=new ArrayBuffer(t.length);var a=new Uint8Array(n);for(var r=0;r<t.length;r++){a[r]=t.charCodeAt(r)}return St(n,i)};var Ct=function e(t){return(/^data:(.+);/.exec(t)||[])[1]||null};var Mt=function e(t){var i=t.split(",")[1];return i.replace(/\s/g,"")};var Dt=function e(t){return atob(Mt(t))};var Lt=function e(t){var i=Ct(t);var n=Dt(t);return At(n,i)};var Ot=function e(t,i,n){return It(Lt(t),i,null,n)};var Pt=function e(t){if(!/^content-disposition:/i.test(t))return null;var i=t.split(/filename=|filename\*=.+''/).splice(1).map((function(e){return e.trim().replace(/^["']|[;"']{0,2}$/g,"")})).filter((function(e){return e.length}));return i.length?decodeURI(i[i.length-1]):null};var Rt=function e(t){if(/content-length:/i.test(t)){var i=t.match(/[0-9]+/)[0];return i?parseInt(i,10):null}return null};var Nt=function e(t){if(/x-content-transfer-id:/i.test(t)){var i=(t.split(":")[1]||"").trim();return i||null}return null};var Ft=function e(t){var i={source:null,name:null,size:null};var n=t.split("\n");var a=true;var r=false;var o=undefined;try{for(var s=n[Symbol.iterator](),l;!(a=(l=s.next()).done);a=true){var c=l.value;var u=Pt(c);if(u){i.name=u;continue}var d=Rt(c);if(d){i.size=d;continue}var p=Nt(c);if(p){i.source=p;continue}}}catch(e){r=true;o=e}finally{try{if(!a&&s.return!=null){s.return()}}finally{if(r){throw o}}}return i};var Gt=function e(t){var i={source:null,complete:false,progress:0,size:null,timestamp:null,duration:0,request:null};var n=function e(){return i.progress};var a=function e(){if(i.request&&i.request.abort){i.request.abort()}};var r=function e(){var t=i.source;s.fire("init",t);if(t instanceof File){s.fire("load",t)}else if(t instanceof Blob){s.fire("load",It(t,t.name))}else if(bt(t)){s.fire("load",Ot(t))}else{o(t)}};var o=function e(n){if(!t){s.fire("error",{type:"error",body:"Can't load URL",code:400});return}i.timestamp=Date.now();i.request=t(n,(function(e){i.duration=Date.now()-i.timestamp;i.complete=true;if(e instanceof Blob){e=It(e,e.name||yt(n))}s.fire("load",e instanceof Blob?e:e?e.body:null)}),(function(e){s.fire("error",typeof e==="string"?{type:"error",code:0,body:e}:e)}),(function(e,t,n){if(n){i.size=n}i.duration=Date.now()-i.timestamp;if(!e){i.progress=null;return}i.progress=t/n;s.fire("progress",i.progress)}),(function(){s.fire("abort")}),(function(e){var t=Ft(typeof e==="string"?e:e.headers);s.fire("meta",{size:i.size||t.size,filename:t.name,source:t.source})}))};var s=Object.assign({},Ne(),{setSource:function e(t){return i.source=t},getProgress:n,abort:a,load:r});return s};var zt=function e(t){return/GET|HEAD/.test(t)};var Bt=function e(t,i,n){var a={onheaders:function e(){},onprogress:function e(){},onload:function e(){},ontimeout:function e(){},onerror:function e(){},onabort:function e(){},abort:function e(){r=true;s.abort()}};var r=false;var o=false;n=Object.assign({method:"POST",headers:{},withCredentials:false},n);i=encodeURI(i);if(zt(n.method)&&t){i=""+i+encodeURIComponent(typeof t==="string"?t:JSON.stringify(t))}var s=new XMLHttpRequest;var l=zt(n.method)?s:s.upload;l.onprogress=function(e){if(r){return}a.onprogress(e.lengthComputable,e.loaded,e.total)};s.onreadystatechange=function(){if(s.readyState<2){return}if(s.readyState===4&&s.status===0){return}if(o){return}o=true;a.onheaders(s)};s.onload=function(){if(s.status>=200&&s.status<300){a.onload(s)}else{a.onerror(s)}};s.onerror=function(){return a.onerror(s)};s.onabort=function(){r=true;a.onabort()};s.ontimeout=function(){return a.ontimeout(s)};s.open(n.method,i,true);if(ne(n.timeout)){s.timeout=n.timeout}Object.keys(n.headers).forEach((function(e){var t=unescape(encodeURIComponent(n.headers[e]));s.setRequestHeader(e,t)}));if(n.responseType){s.responseType=n.responseType}if(n.withCredentials){s.withCredentials=true}s.send(t);return a};var qt=function e(t,i,n,a){return{type:t,code:i,body:n,headers:a}};var Ht=function e(t){return function(e){t(qt("error",0,"Timeout",e.getAllResponseHeaders()))}};var Ut=function e(t){return/\?/.test(t)};var Vt=function e(){var t="";for(var i=arguments.length,n=new Array(i),a=0;a<i;a++){n[a]=arguments[a]}n.forEach((function(e){t+=Ut(t)&&Ut(e)?e.replace(/\?/,"&"):e}));return t};var jt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var i=arguments.length>1?arguments[1]:undefined;if(typeof i==="function"){return i}if(!i||!J(i.url)){return null}var n=i.onload||function(e){return e};var a=i.onerror||function(e){return null};return function(e,r,o,s,l,c){var u=Bt(e,Vt(t,i.url),Object.assign({},i,{responseType:"blob"}));u.onload=function(t){var a=t.getAllResponseHeaders();var o=Ft(a).name||yt(e);r(qt("load",t.status,i.method==="HEAD"?null:It(n(t.response),o),a))};u.onerror=function(e){o(qt("error",e.status,a(e.response)||e.statusText,e.getAllResponseHeaders()))};u.onheaders=function(e){c(qt("headers",e.status,null,e.getAllResponseHeaders()))};u.ontimeout=Ht(o);u.onprogress=s;u.onabort=l;return u}};var Yt={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4};var Wt=function e(t,i,n,a,r,o,s,l,c,u,d){var p=[];var h=d.chunkTransferId,f=d.chunkServer,g=d.chunkSize,m=d.chunkRetryDelays;var v={serverId:h,aborted:false};var _=i.ondata||function(e){return e};var b=i.onload||function(e,t){return t==="HEAD"?e.getResponseHeader("Upload-Offset"):e.response};var y=i.onerror||function(e){return null};var w=function e(o){var l=new FormData;if(pe(r))l.append(n,JSON.stringify(r));var c=typeof i.headers==="function"?i.headers(a,r):Object.assign({},i.headers,{"Upload-Length":a.size});var u=Object.assign({},i,{headers:c});var d=Bt(_(l),Vt(t,i.url),u);d.onload=function(e){return o(b(e,u.method))};d.onerror=function(e){return s(qt("error",e.status,y(e.response)||e.statusText,e.getAllResponseHeaders()))};d.ontimeout=Ht(s)};var x=function e(n){var a=Vt(t,f.url,v.serverId);var r=typeof i.headers==="function"?i.headers(v.serverId):Object.assign({},i.headers);var o={headers:r,method:"HEAD"};var l=Bt(null,a,o);l.onload=function(e){return n(b(e,o.method))};l.onerror=function(e){return s(qt("error",e.status,y(e.response)||e.statusText,e.getAllResponseHeaders()))};l.ontimeout=Ht(s)};var E=Math.floor(a.size/g);for(var k=0;k<=E;k++){var I=k*g;var T=a.slice(I,I+g,"application/offset+octet-stream");p[k]={index:k,size:T.size,offset:I,data:T,file:a,progress:0,retries:Me(m),status:Yt.QUEUED,error:null,request:null,timeout:null}}var S=function e(){return o(v.serverId)};var A=function e(t){return t.status===Yt.QUEUED||t.status===Yt.ERROR};var C=function e(i){if(v.aborted)return;i=i||p.find(A);if(!i){if(p.every((function(e){return e.status===Yt.COMPLETE}))){S()}return}i.status=Yt.PROCESSING;i.progress=null;var n=f.ondata||function(e){return e};var r=f.onerror||function(e){return null};var o=Vt(t,f.url,v.serverId);var l=typeof f.headers==="function"?f.headers(i):Object.assign({},f.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":i.offset,"Upload-Length":a.size,"Upload-Name":a.name});var u=i.request=Bt(n(i.data),o,Object.assign({},f,{headers:l}));u.onload=function(){i.status=Yt.COMPLETE;i.request=null;L()};u.onprogress=function(e,t,n){i.progress=e?t:null;D()};u.onerror=function(e){i.status=Yt.ERROR;i.request=null;i.error=r(e.response)||e.statusText;if(!M(i)){s(qt("error",e.status,r(e.response)||e.statusText,e.getAllResponseHeaders()))}};u.ontimeout=function(e){i.status=Yt.ERROR;i.request=null;if(!M(i)){Ht(s)(e)}};u.onabort=function(){i.status=Yt.QUEUED;i.request=null;c()}};var M=function e(t){if(t.retries.length===0)return false;t.status=Yt.WAITING;clearTimeout(t.timeout);t.timeout=setTimeout((function(){C(t)}),t.retries.shift());return true};var D=function e(){var t=p.reduce((function(e,t){if(e===null||t.progress===null)return null;return e+t.progress}),0);if(t===null)return l(false,0,0);var i=p.reduce((function(e,t){return e+t.size}),0);l(true,t,i)};var L=function e(){var t=p.filter((function(e){return e.status===Yt.PROCESSING})).length;if(t>=1)return;C()};var O=function e(){p.forEach((function(e){clearTimeout(e.timeout);if(e.request){e.request.abort()}}))};if(!v.serverId){w((function(e){if(v.aborted)return;u(e);v.serverId=e;L()}))}else{x((function(e){if(v.aborted)return;p.filter((function(t){return t.offset<e})).forEach((function(e){e.status=Yt.COMPLETE;e.progress=e.size}));L()}))}return{abort:function e(){v.aborted=true;O()}}};var Xt=function e(t,i,n,a){return function(e,r,o,s,l,c,u){if(!e)return;var d=a.chunkUploads;var p=d&&e.size>a.chunkSize;var h=d&&(p||a.chunkForce);if(e instanceof Blob&&h)return Wt(t,i,n,e,r,o,s,l,c,u,a);var f=i.ondata||function(e){return e};var g=i.onload||function(e){return e};var m=i.onerror||function(e){return null};var v=typeof i.headers==="function"?i.headers(e,r)||{}:Object.assign({},i.headers);var _=Object.assign({},i,{headers:v});var b=new FormData;if(pe(r)){b.append(n,JSON.stringify(r))}(e instanceof Blob?[{name:null,file:e}]:e).forEach((function(e){b.append(n,e.file,e.name===null?e.file.name:""+e.name+e.file.name)}));var y=Bt(f(b),Vt(t,i.url),_);y.onload=function(e){o(qt("load",e.status,g(e.response),e.getAllResponseHeaders()))};y.onerror=function(e){s(qt("error",e.status,m(e.response)||e.statusText,e.getAllResponseHeaders()))};y.ontimeout=Ht(s);y.onprogress=l;y.onabort=c;return y}};var Kt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var i=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;var a=arguments.length>3?arguments[3]:undefined;if(typeof i==="function")return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return i.apply(void 0,[n].concat(t,[a]))};if(!i||!J(i.url))return null;return Xt(t,i,n,a)};var Zt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var i=arguments.length>1?arguments[1]:undefined;if(typeof i==="function"){return i}if(!i||!J(i.url)){return function(e,t){return t()}}var n=i.onload||function(e){return e};var a=i.onerror||function(e){return null};return function(e,r,o){var s=Bt(e,t+i.url,i);s.onload=function(e){r(qt("load",e.status,n(e.response),e.getAllResponseHeaders()))};s.onerror=function(e){o(qt("error",e.status,a(e.response)||e.statusText,e.getAllResponseHeaders()))};s.ontimeout=Ht(o);return s}};var Qt=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return t+Math.random()*(i-t)};var $t=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1e3;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:25;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:250;var r=null;var o=Date.now();var s=function e(){var s=Date.now()-o;var l=Qt(n,a);if(s+l>i){l=s+l-i}var c=s/i;if(c>=1||document.hidden){t(1);return}t(c);r=setTimeout(e,l)};if(i>0)s();return{clear:function e(){clearTimeout(r)}}};var Jt=function e(t,i){var n={complete:false,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null};var a=i.allowMinimumUploadDuration;var r=function e(i,r){var o=function e(){if(n.duration===0||n.progress===null)return;u.fire("progress",u.getProgress())};var s=function e(){n.complete=true;u.fire("load-perceived",n.response.body)};u.fire("start");n.timestamp=Date.now();n.perceivedPerformanceUpdater=$t((function(e){n.perceivedProgress=e;n.perceivedDuration=Date.now()-n.timestamp;o();if(n.response&&n.perceivedProgress===1&&!n.complete){s()}}),a?Qt(750,1500):0);n.request=t(i,r,(function(e){n.response=pe(e)?e:{type:"load",code:200,body:""+e,headers:{}};n.duration=Date.now()-n.timestamp;n.progress=1;u.fire("load",n.response.body);if(!a||a&&n.perceivedProgress===1){s()}}),(function(e){n.perceivedPerformanceUpdater.clear();u.fire("error",pe(e)?e:{type:"error",code:0,body:""+e})}),(function(e,t,i){n.duration=Date.now()-n.timestamp;n.progress=e?t/i:null;o()}),(function(){n.perceivedPerformanceUpdater.clear();u.fire("abort",n.response?n.response.body:null)}),(function(e){u.fire("transfer",e)}))};var o=function e(){if(!n.request)return;n.perceivedPerformanceUpdater.clear();if(n.request.abort)n.request.abort();n.complete=true};var s=function e(){o();n.complete=false;n.perceivedProgress=0;n.progress=0;n.timestamp=null;n.perceivedDuration=0;n.duration=0;n.request=null;n.response=null};var l=a?function(){return n.progress?Math.min(n.progress,n.perceivedProgress):null}:function(){return n.progress||null};var c=a?function(){return Math.min(n.duration,n.perceivedDuration)}:function(){return n.duration};var u=Object.assign({},Ne(),{process:r,abort:o,getProgress:l,getDuration:c,reset:s});return u};var ei=function e(t){return t.substring(0,t.lastIndexOf("."))||t};var ti=function e(t){var i=[t.name,t.size,t.type];if(t instanceof Blob||bt(t)){i[0]=t.name||kt()}else if(bt(t)){i[1]=t.length;i[2]=Ct(t)}else if(J(t)){i[0]=yt(t);i[1]=0;i[2]="application/octet-stream"}return{name:i[0],size:i[1],type:i[2]}};var ii=function e(t){return!!(t instanceof File||t instanceof Blob&&t.name)};var ni=function e(t){if(!pe(t))return t;var i=Y(t)?[]:{};for(var n in t){if(!t.hasOwnProperty(n))continue;var a=t[n];i[n]=a&&pe(a)?e(a):a}return i};var ai=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var a=Se();var o={archived:false,frozen:false,released:false,source:null,file:n,serverFileReference:i,transferId:null,processingAborted:false,status:i?qe.PROCESSING_COMPLETE:qe.INIT,activeLoader:null,activeProcessor:null};var s=null;var l={};var c=function e(t){return o.status=t};var u=function e(t){if(o.released||o.frozen)return;for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++){n[a-1]=arguments[a]}k.fire.apply(k,[t].concat(n))};var d=function e(){return wt(o.file.name)};var p=function e(){return o.file.type};var h=function e(){return o.file.size};var f=function e(){return o.file};var g=function e(i,n,a){o.source=i;k.fireSync("init");if(o.file){k.fireSync("load-skip");return}o.file=ti(i);n.on("init",(function(){u("load-init")}));n.on("meta",(function(e){o.file.size=e.size;o.file.filename=e.filename;if(e.source){t=He.LIMBO;o.serverFileReference=e.source;o.status=qe.PROCESSING_COMPLETE}u("load-meta")}));n.on("progress",(function(e){c(qe.LOADING);u("load-progress",e)}));n.on("error",(function(e){c(qe.LOAD_ERROR);u("load-request-error",e)}));n.on("abort",(function(){c(qe.INIT);u("load-abort")}));n.on("load",(function(e){o.activeLoader=null;var i=function e(i){o.file=ii(i)?i:o.file;if(t===He.LIMBO&&o.serverFileReference){c(qe.PROCESSING_COMPLETE)}else{c(qe.IDLE)}u("load")};var n=function t(i){o.file=e;u("load-meta");c(qe.LOAD_ERROR);u("load-file-error",i)};if(o.serverFileReference){i(e);return}a(e,i,n)}));n.setSource(i);o.activeLoader=n;n.load()};var m=function e(){if(!o.activeLoader){return}o.activeLoader.load()};var v=function e(){if(o.activeLoader){o.activeLoader.abort();return}c(qe.INIT);u("load-abort")};var _=function e(t,i){if(o.processingAborted){o.processingAborted=false;return}c(qe.PROCESSING);s=null;if(!(o.file instanceof Blob)){k.on("load",(function(){e(t,i)}));return}t.on("load",(function(e){o.transferId=null;o.serverFileReference=e}));t.on("transfer",(function(e){o.transferId=e}));t.on("load-perceived",(function(e){o.activeProcessor=null;o.transferId=null;o.serverFileReference=e;c(qe.PROCESSING_COMPLETE);u("process-complete",e)}));t.on("start",(function(){u("process-start")}));t.on("error",(function(e){o.activeProcessor=null;c(qe.PROCESSING_ERROR);u("process-error",e)}));t.on("abort",(function(e){o.activeProcessor=null;o.serverFileReference=e;c(qe.IDLE);u("process-abort");if(s){s()}}));t.on("progress",(function(e){u("process-progress",e)}));var n=function e(i){if(o.archived)return;t.process(i,Object.assign({},l))};var a=console.error;i(o.file,n,a);o.activeProcessor=t};var b=function e(){o.processingAborted=false;c(qe.PROCESSING_QUEUED)};var y=function e(){return new Promise((function(e){if(!o.activeProcessor){o.processingAborted=true;c(qe.IDLE);u("process-abort");e();return}s=function t(){e()};o.activeProcessor.abort()}))};var w=function e(t,i){return new Promise((function(e,n){var a=o.serverFileReference!==null?o.serverFileReference:o.transferId;if(a===null){e();return}t(a,(function(){o.serverFileReference=null;o.transferId=null;e()}),(function(t){if(!i){e();return}c(qe.PROCESSING_REVERT_ERROR);u("process-revert-error");n(t)}));c(qe.IDLE);u("process-revert")}))};var x=function e(t,i,n){var a=t.split(".");var r=a[0];var o=a.pop();var s=l;a.forEach((function(e){return s=s[e]}));if(JSON.stringify(s[o])===JSON.stringify(i))return;s[o]=i;u("metadata-update",{key:r,value:l[r],silent:n})};var E=function e(t){return ni(t?l[t]:l)};var k=Object.assign({id:{get:function e(){return a}},origin:{get:function e(){return t},set:function e(i){return t=i}},serverId:{get:function e(){return o.serverFileReference}},transferId:{get:function e(){return o.transferId}},status:{get:function e(){return o.status}},filename:{get:function e(){return o.file.name}},filenameWithoutExtension:{get:function e(){return ei(o.file.name)}},fileExtension:{get:d},fileType:{get:p},fileSize:{get:h},file:{get:f},relativePath:{get:function e(){return o.file._relativePath}},source:{get:function e(){return o.source}},getMetadata:E,setMetadata:function e(t,i,n){if(pe(t)){var a=t;Object.keys(a).forEach((function(e){x(e,a[e],i)}));return t}x(t,i,n);return i},extend:function e(t,i){return I[t]=i},abortLoad:v,retryLoad:m,requestProcessing:b,abortProcessing:y,load:g,process:_,revert:w},Ne(),{freeze:function e(){return o.frozen=true},release:function e(){return o.released=true},released:{get:function e(){return o.released}},archive:function e(){return o.archived=true},archived:{get:function e(){return o.archived}}});var I=r(k);return I};var ri=function e(t,i){if(W(i)){return 0}if(!J(i)){return-1}return t.findIndex((function(e){return e.id===i}))};var oi=function e(t,i){var n=ri(t,i);if(n<0){return}return t[n]||null};var si=function e(t,i,n,a,r,o){var s=Bt(null,t,{method:"GET",responseType:"blob"});s.onload=function(e){var n=e.getAllResponseHeaders();var a=Ft(n).name||yt(t);i(qt("load",e.status,It(e.response,a),n))};s.onerror=function(e){n(qt("error",e.status,e.statusText,e.getAllResponseHeaders()))};s.onheaders=function(e){o(qt("headers",e.status,null,e.getAllResponseHeaders()))};s.ontimeout=Ht(n);s.onprogress=a;s.onabort=r;return s};var li=function e(t){if(t.indexOf("//")===0){t=location.protocol+t}return t.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]};var ci=function e(t){return(t.indexOf(":")>-1||t.indexOf("//")>-1)&&li(location.href)!==li(t)};var ui=function e(t){return function(){return re(t)?t.apply(void 0,arguments):t}};var di=function e(t){return!ii(t.file)};var pi=function e(t,i){clearTimeout(i.listUpdateTimeout);i.listUpdateTimeout=setTimeout((function(){t("DID_UPDATE_ITEMS",{items:nt(i.items)})}),0)};var hi=function e(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++){n[a-1]=arguments[a]}return new Promise((function(e){if(!t){return e(true)}var i=t.apply(void 0,n);if(i==null){return e(true)}if(typeof i==="boolean"){return e(i)}if(typeof i.then==="function"){i.then(e)}}))};var fi=function e(t,i){t.items.sort((function(e,t){return i(ze(e),ze(t))}))};var gi=function e(t,i){return function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=e.query,a=e.success,r=a===void 0?function(){}:a,o=e.failure,s=o===void 0?function(){}:o,l=Ce(e,["query","success","failure"]);var c=tt(t.items,n);if(!c){s({error:qt("error",0,"Item not found"),file:null});return}i(c,r,s,l||{})}};var mi=function e(t,i,n){return{ABORT_ALL:function e(){nt(n.items).forEach((function(e){e.freeze();e.abortLoad();e.abortProcessing()}))},DID_SET_FILES:function e(i){var a=i.value,r=a===void 0?[]:a;var o=r.map((function(e){return{source:e.source?e.source:e,options:e.options}}));var s=nt(n.items);s.forEach((function(e){if(!o.find((function(t){return t.source===e.source||t.source===e.file}))){t("REMOVE_ITEM",{query:e,remove:false})}}));s=nt(n.items);o.forEach((function(e,i){if(s.find((function(t){return t.source===e.source||t.file===e.source})))return;t("ADD_ITEM",Object.assign({},e,{interactionMethod:Te.NONE,index:i}))}))},DID_UPDATE_ITEM_METADATA:function e(a){var r=a.id,o=a.action,s=a.change;if(s.silent)return;clearTimeout(n.itemUpdateTimeout);n.itemUpdateTimeout=setTimeout((function(){var e=oi(n.items,r);if(!i("IS_ASYNC")){Xe("SHOULD_PREPARE_OUTPUT",false,{item:e,query:i,action:o,change:s}).then((function(n){var a=i("GET_BEFORE_PREPARE_FILE");if(a)n=a(e,n);if(!n)return;t("REQUEST_PREPARE_OUTPUT",{query:r,item:e,success:function e(i){t("DID_PREPARE_OUTPUT",{id:r,file:i})}},true)}));return}if(e.origin===He.LOCAL){t("DID_LOAD_ITEM",{id:e.id,error:null,serverFileReference:e.source})}var a=function e(){setTimeout((function(){t("REQUEST_ITEM_PROCESSING",{query:r})}),32)};var l=function t(r){e.revert(Zt(n.options.server.url,n.options.server.revert),i("GET_FORCE_REVERT")).then(r?a:function(){}).catch((function(){}))};var c=function t(i){e.abortProcessing().then(i?a:function(){})};if(e.status===qe.PROCESSING_COMPLETE){return l(n.options.instantUpload)}if(e.status===qe.PROCESSING){return c(n.options.instantUpload)}if(n.options.instantUpload){a()}}),0)},MOVE_ITEM:function e(t){var i=t.query,a=t.index;var r=tt(n.items,i);if(!r)return;var o=n.items.indexOf(r);a=mt(a,0,n.items.length-1);if(o===a)return;n.items.splice(a,0,n.items.splice(o,1)[0])},SORT:function e(a){var r=a.compare;fi(n,r);t("DID_SORT_ITEMS",{items:i("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function e(n){var a=n.items,r=n.index,o=n.interactionMethod,s=n.success,l=s===void 0?function(){}:s,c=n.failure,u=c===void 0?function(){}:c;var d=r;if(r===-1||typeof r==="undefined"){var p=i("GET_ITEM_INSERT_LOCATION");var h=i("GET_TOTAL_ITEMS");d=p==="before"?0:h}var f=i("GET_IGNORED_FILES");var g=function e(t){return ii(t)?!f.includes(t.name.toLowerCase()):!W(t)};var m=a.filter(g);var v=m.map((function(e){return new Promise((function(i,n){t("ADD_ITEM",{interactionMethod:o,source:e.source||e,success:i,failure:n,index:d++,options:e.options||{}})}))}));Promise.all(v).then(l).catch(u)},ADD_ITEM:function e(a){var r=a.source,o=a.index,s=o===void 0?-1:o,l=a.interactionMethod,c=a.success,u=c===void 0?function(){}:c,d=a.failure,p=d===void 0?function(){}:d,h=a.options,f=h===void 0?{}:h;if(W(r)){p({error:qt("error",0,"No source"),file:null});return}if(ii(r)&&n.options.ignoredFiles.includes(r.name.toLowerCase())){return}if(!gt(n)){if(n.options.allowMultiple||!n.options.allowMultiple&&!n.options.allowReplace){var g=qt("warning",0,"Max files");t("DID_THROW_MAX_FILES",{source:r,error:g});p({error:g,file:null});return}var m=nt(n.items)[0];if(m.status===qe.PROCESSING_COMPLETE||m.status===qe.PROCESSING_REVERT_ERROR){var v=i("GET_FORCE_REVERT");m.revert(Zt(n.options.server.url,n.options.server.revert),v).then((function(){if(!v)return;t("ADD_ITEM",{source:r,index:s,interactionMethod:l,success:u,failure:p,options:f})})).catch((function(){}));if(v)return}t("REMOVE_ITEM",{query:m.id})}var _=f.type==="local"?He.LOCAL:f.type==="limbo"?He.LIMBO:He.INPUT;var b=ai(_,_===He.INPUT?null:r,f.file);Object.keys(f.metadata||{}).forEach((function(e){b.setMetadata(e,f.metadata[e])}));Ke("DID_CREATE_ITEM",b,{query:i,dispatch:t});var y=i("GET_ITEM_INSERT_LOCATION");if(!n.options.itemInsertLocationFreedom){s=y==="before"?-1:n.items.length}_t(n.items,b,s);if(re(y)&&r){fi(n,y)}var w=b.id;b.on("init",(function(){t("DID_INIT_ITEM",{id:w})}));b.on("load-init",(function(){t("DID_START_ITEM_LOAD",{id:w})}));b.on("load-meta",(function(){t("DID_UPDATE_ITEM_META",{id:w})}));b.on("load-progress",(function(e){t("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:w,progress:e})}));b.on("load-request-error",(function(e){var i=ui(n.options.labelFileLoadError)(e);if(e.code>=400&&e.code<500){t("DID_THROW_ITEM_INVALID",{id:w,error:e,status:{main:i,sub:e.code+" ("+e.body+")"}});p({error:e,file:ze(b)});return}t("DID_THROW_ITEM_LOAD_ERROR",{id:w,error:e,status:{main:i,sub:n.options.labelTapToRetry}})}));b.on("load-file-error",(function(e){t("DID_THROW_ITEM_INVALID",{id:w,error:e.status,status:e.status});p({error:e.status,file:ze(b)})}));b.on("load-abort",(function(){t("REMOVE_ITEM",{query:w})}));b.on("load-skip",(function(){t("COMPLETE_LOAD_ITEM",{query:w,item:b,data:{source:r,success:u}})}));b.on("load",(function(){var e=function e(a){if(!a){t("REMOVE_ITEM",{query:w});return}b.on("metadata-update",(function(e){t("DID_UPDATE_ITEM_METADATA",{id:w,change:e})}));Xe("SHOULD_PREPARE_OUTPUT",false,{item:b,query:i}).then((function(e){var a=i("GET_BEFORE_PREPARE_FILE");if(a)e=a(b,e);var o=function e(){t("COMPLETE_LOAD_ITEM",{query:w,item:b,data:{source:r,success:u}});pi(t,n)};if(e){t("REQUEST_PREPARE_OUTPUT",{query:w,item:b,success:function e(i){t("DID_PREPARE_OUTPUT",{id:w,file:i});o()}},true);return}o()}))};Xe("DID_LOAD_ITEM",b,{query:i,dispatch:t}).then((function(){hi(i("GET_BEFORE_ADD_FILE"),ze(b)).then(e)})).catch((function(i){if(!i||!i.error||!i.status)return e(false);t("DID_THROW_ITEM_INVALID",{id:w,error:i.error,status:i.status})}))}));b.on("process-start",(function(){t("DID_START_ITEM_PROCESSING",{id:w})}));b.on("process-progress",(function(e){t("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:w,progress:e})}));b.on("process-error",(function(e){t("DID_THROW_ITEM_PROCESSING_ERROR",{id:w,error:e,status:{main:ui(n.options.labelFileProcessingError)(e),sub:n.options.labelTapToRetry}})}));b.on("process-revert-error",(function(e){t("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:w,error:e,status:{main:ui(n.options.labelFileProcessingRevertError)(e),sub:n.options.labelTapToRetry}})}));b.on("process-complete",(function(e){t("DID_COMPLETE_ITEM_PROCESSING",{id:w,error:null,serverFileReference:e});t("DID_DEFINE_VALUE",{id:w,value:e})}));b.on("process-abort",(function(){t("DID_ABORT_ITEM_PROCESSING",{id:w})}));b.on("process-revert",(function(){t("DID_REVERT_ITEM_PROCESSING",{id:w});t("DID_DEFINE_VALUE",{id:w,value:null})}));t("DID_ADD_ITEM",{id:w,index:s,interactionMethod:l});pi(t,n);var x=n.options.server||{},E=x.url,k=x.load,I=x.restore,T=x.fetch;b.load(r,Gt(_===He.INPUT?J(r)&&ci(r)?T?jt(E,T):si:si:_===He.LIMBO?jt(E,I):jt(E,k)),(function(e,t,n){Xe("LOAD_FILE",e,{query:i}).then(t).catch(n)}))},REQUEST_PREPARE_OUTPUT:function e(t){var n=t.item,a=t.success,r=t.failure,o=r===void 0?function(){}:r;var s={error:qt("error",0,"Item not found"),file:null};if(n.archived)return o(s);Xe("PREPARE_OUTPUT",n.file,{query:i,item:n}).then((function(e){Xe("COMPLETE_PREPARE_OUTPUT",e,{query:i,item:n}).then((function(e){if(n.archived)return o(s);a(e)}))}))},COMPLETE_LOAD_ITEM:function e(a){var r=a.item,o=a.data;var s=o.success,l=o.source;var c=i("GET_ITEM_INSERT_LOCATION");if(re(c)&&l){fi(n,c)}t("DID_LOAD_ITEM",{id:r.id,error:null,serverFileReference:r.origin===He.INPUT?null:l});s(ze(r));if(r.origin===He.LOCAL){t("DID_LOAD_LOCAL_ITEM",{id:r.id});return}if(r.origin===He.LIMBO){t("DID_COMPLETE_ITEM_PROCESSING",{id:r.id,error:null,serverFileReference:l});t("DID_DEFINE_VALUE",{id:r.id,value:r.serverId||l});return}if(i("IS_ASYNC")&&n.options.instantUpload){t("REQUEST_ITEM_PROCESSING",{query:r.id})}},RETRY_ITEM_LOAD:gi(n,(function(e){e.retryLoad()})),REQUEST_ITEM_PREPARE:gi(n,(function(e,i,n){t("REQUEST_PREPARE_OUTPUT",{query:e.id,item:e,success:function n(a){t("DID_PREPARE_OUTPUT",{id:e.id,file:a});i({file:e,output:a})},failure:n},true)})),REQUEST_ITEM_PROCESSING:gi(n,(function(e,a,r){var o=e.status===qe.IDLE||e.status===qe.PROCESSING_ERROR;if(!o){var s=function i(){return t("REQUEST_ITEM_PROCESSING",{query:e,success:a,failure:r})};var l=function e(){return document.hidden?s():setTimeout(s,32)};if(e.status===qe.PROCESSING_COMPLETE||e.status===qe.PROCESSING_REVERT_ERROR){e.revert(Zt(n.options.server.url,n.options.server.revert),i("GET_FORCE_REVERT")).then(l).catch((function(){}))}else if(e.status===qe.PROCESSING){e.abortProcessing().then(l)}return}if(e.status===qe.PROCESSING_QUEUED)return;e.requestProcessing();t("DID_REQUEST_ITEM_PROCESSING",{id:e.id});t("PROCESS_ITEM",{query:e,success:a,failure:r},true)})),PROCESS_ITEM:gi(n,(function(e,a,r){var o=i("GET_MAX_PARALLEL_UPLOADS");var s=i("GET_ITEMS_BY_STATUS",qe.PROCESSING).length;if(s===o){n.processingQueue.push({id:e.id,success:a,failure:r});return}if(e.status===qe.PROCESSING)return;var l=function e(){var i=n.processingQueue.shift();if(!i)return;var a=i.id,r=i.success,o=i.failure;var s=tt(n.items,a);if(!s||s.archived){e();return}t("PROCESS_ITEM",{query:a,success:r,failure:o},true)};e.onOnce("process-complete",(function(){a(ze(e));l();var r=n.options.server;var o=n.options.instantUpload;if(o&&e.origin===He.LOCAL&&re(r.remove)){var s=function e(){};e.origin=He.LIMBO;n.options.server.remove(e.source,s,s)}var c=i("GET_ITEMS_BY_STATUS",qe.PROCESSING_COMPLETE).length===n.items.length;if(c){t("DID_COMPLETE_ITEM_PROCESSING_ALL")}}));e.onOnce("process-error",(function(t){r({error:t,file:ze(e)});l()}));var c=n.options;e.process(Jt(Kt(c.server.url,c.server.process,c.name,{chunkTransferId:e.transferId,chunkServer:c.server.patch,chunkUploads:c.chunkUploads,chunkForce:c.chunkForce,chunkSize:c.chunkSize,chunkRetryDelays:c.chunkRetryDelays}),{allowMinimumUploadDuration:i("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(function(n,a,r){Xe("PREPARE_OUTPUT",n,{query:i,item:e}).then((function(i){t("DID_PREPARE_OUTPUT",{id:e.id,file:i});a(i)})).catch(r)}))})),RETRY_ITEM_PROCESSING:gi(n,(function(e){t("REQUEST_ITEM_PROCESSING",{query:e})})),REQUEST_REMOVE_ITEM:gi(n,(function(e){hi(i("GET_BEFORE_REMOVE_FILE"),ze(e)).then((function(i){if(!i){return}t("REMOVE_ITEM",{query:e})}))})),RELEASE_ITEM:gi(n,(function(e){e.release()})),REMOVE_ITEM:gi(n,(function(e,a,r,o){var s=function i(){var r=e.id;oi(n.items,r).archive();t("DID_REMOVE_ITEM",{error:null,id:r,item:e});pi(t,n);a(ze(e))};var l=n.options.server;if(e.origin===He.LOCAL&&l&&re(l.remove)&&o.remove!==false){t("DID_START_ITEM_REMOVE",{id:e.id});l.remove(e.source,(function(){return s()}),(function(i){t("DID_THROW_ITEM_REMOVE_ERROR",{id:e.id,error:qt("error",0,i,null),status:{main:ui(n.options.labelFileRemoveError)(i),sub:n.options.labelTapToRetry}})}))}else{if(o.revert&&e.origin!==He.LOCAL&&e.serverId!==null||n.options.chunkUploads&&e.file.size>n.options.chunkSize||n.options.chunkUploads&&n.options.chunkForce){e.revert(Zt(n.options.server.url,n.options.server.revert),i("GET_FORCE_REVERT"))}s()}})),ABORT_ITEM_LOAD:gi(n,(function(e){e.abortLoad()})),ABORT_ITEM_PROCESSING:gi(n,(function(e){if(e.serverId){t("REVERT_ITEM_PROCESSING",{id:e.id});return}e.abortProcessing().then((function(){var i=n.options.instantUpload;if(i){t("REMOVE_ITEM",{query:e.id})}}))})),REQUEST_REVERT_ITEM_PROCESSING:gi(n,(function(e){if(!n.options.instantUpload){t("REVERT_ITEM_PROCESSING",{query:e});return}var a=function i(n){if(!n)return;t("REVERT_ITEM_PROCESSING",{query:e})};var r=i("GET_BEFORE_REMOVE_FILE");if(!r){return a(true)}var o=r(ze(e));if(o==null){return a(true)}if(typeof o==="boolean"){return a(o)}if(typeof o.then==="function"){o.then(a)}})),REVERT_ITEM_PROCESSING:gi(n,(function(e){e.revert(Zt(n.options.server.url,n.options.server.revert),i("GET_FORCE_REVERT")).then((function(){var i=n.options.instantUpload||di(e);if(i){t("REMOVE_ITEM",{query:e.id})}})).catch((function(){}))})),SET_OPTIONS:function e(i){var n=i.options;var a=Object.keys(n);var r=vi.filter((function(e){return a.includes(e)}));var o=[].concat(Me(r),Me(Object.keys(n).filter((function(e){return!r.includes(e)}))));o.forEach((function(e){t("SET_"+xe(e,"_").toUpperCase(),{value:n[e]})}))}}};var vi=["server"];var _i=function e(t){return t};var bi=function e(t){return document.createElement(t)};var yi=function e(t,i){var n=t.childNodes[0];if(!n){n=document.createTextNode(i);t.appendChild(n)}else if(i!==n.nodeValue){n.nodeValue=i}};var wi=function e(t,i,n,a){var r=(a%360-90)*Math.PI/180;return{x:t+n*Math.cos(r),y:i+n*Math.sin(r)}};var xi=function e(t,i,n,a,r,o){var s=wi(t,i,n,r);var l=wi(t,i,n,a);return["M",s.x,s.y,"A",n,n,0,o,0,l.x,l.y].join(" ")};var Ei=function e(t,i,n,a,r){var o=1;if(r>a&&r-a<=.5){o=0}if(a>r&&a-r>=.5){o=0}return xi(t,i,n,Math.min(.9999,a)*360,Math.min(.9999,r)*360,o)};var ki=function e(t){var i=t.root,n=t.props;n.spin=false;n.progress=0;n.opacity=0;var a=u("svg");i.ref.path=u("path",{"stroke-width":2,"stroke-linecap":"round"});a.appendChild(i.ref.path);i.ref.svg=a;i.appendChild(a)};var Ii=function e(t){var i=t.root,n=t.props;if(n.opacity===0){return}if(n.align){i.element.dataset.align=n.align}var a=parseInt(o(i.ref.path,"stroke-width"),10);var r=i.rect.element.width*.5;var s=0;var l=0;if(n.spin){s=0;l=.5}else{s=0;l=n.progress}var c=Ei(r,r,r-a,s,l);o(i.ref.path,"d",c);o(i.ref.path,"stroke-opacity",n.spin||n.progress>0?1:0)};var Ti=q({tag:"div",name:"progress-indicator",ignoreRectUpdate:true,ignoreRect:true,create:ki,write:Ii,mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}});var Si=function e(t){var i=t.root,n=t.props;i.element.innerHTML=(n.icon||"")+("<span>"+n.label+"</span>");n.isDisabled=false};var Ai=function e(t){var i=t.root,n=t.props;var a=n.isDisabled;var r=i.query("GET_DISABLED")||n.opacity===0;if(r&&!a){n.isDisabled=true;o(i.element,"disabled","disabled")}else if(!r&&a){n.isDisabled=false;i.element.removeAttribute("disabled")}};var Ci=q({tag:"button",attributes:{type:"button"},ignoreRect:true,ignoreRectUpdate:true,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:true},create:Si,write:Ai});var Mi=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:".";var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e3;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var r=a.labelBytes,o=r===void 0?"bytes":r,s=a.labelKilobytes,l=s===void 0?"KB":s,c=a.labelMegabytes,u=c===void 0?"MB":c,d=a.labelGigabytes,p=d===void 0?"GB":d;t=Math.round(Math.abs(t));var h=n;var f=n*n;var g=n*n*n;if(t<h){return t+" "+o}if(t<f){return Math.floor(t/h)+" "+l}if(t<g){return Di(t/f,1,i)+" "+u}return Di(t/g,2,i)+" "+p};var Di=function e(t,i,n){return t.toFixed(i).split(".").filter((function(e){return e!=="0"})).join(n)};var Li=function e(t){var i=t.root,n=t.props;var a=bi("span");a.className="filepond--file-info-main";o(a,"aria-hidden","true");i.appendChild(a);i.ref.fileName=a;var r=bi("span");r.className="filepond--file-info-sub";i.appendChild(r);i.ref.fileSize=r;yi(r,i.query("GET_LABEL_FILE_WAITING_FOR_SIZE"));yi(a,_i(i.query("GET_ITEM_NAME",n.id)))};var Oi=function e(t){var i=t.root,n=t.props;yi(i.ref.fileSize,Mi(i.query("GET_ITEM_SIZE",n.id),".",i.query("GET_FILE_SIZE_BASE"),i.query("GET_FILE_SIZE_LABELS",i.query)));yi(i.ref.fileName,_i(i.query("GET_ITEM_NAME",n.id)))};var Pi=function e(t){var i=t.root,n=t.props;if(ne(i.query("GET_ITEM_SIZE",n.id))){Oi({root:i,props:n});return}yi(i.ref.fileSize,i.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))};var Ri=q({name:"file-info",ignoreRect:true,ignoreRectUpdate:true,write:U({DID_LOAD_ITEM:Oi,DID_UPDATE_ITEM_META:Oi,DID_THROW_ITEM_LOAD_ERROR:Pi,DID_THROW_ITEM_INVALID:Pi}),didCreateView:function e(t){Ke("CREATE_VIEW",Object.assign({},t,{view:t}))},create:Li,mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}});var Ni=function e(t){return Math.round(t*100)};var Fi=function e(t){var i=t.root;var n=bi("span");n.className="filepond--file-status-main";i.appendChild(n);i.ref.main=n;var a=bi("span");a.className="filepond--file-status-sub";i.appendChild(a);i.ref.sub=a;Gi({root:i,action:{progress:null}})};var Gi=function e(t){var i=t.root,n=t.action;var a=n.progress===null?i.query("GET_LABEL_FILE_LOADING"):i.query("GET_LABEL_FILE_LOADING")+" "+Ni(n.progress)+"%";yi(i.ref.main,a);yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_CANCEL"))};var zi=function e(t){var i=t.root,n=t.action;var a=n.progress===null?i.query("GET_LABEL_FILE_PROCESSING"):i.query("GET_LABEL_FILE_PROCESSING")+" "+Ni(n.progress)+"%";yi(i.ref.main,a);yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_CANCEL"))};var Bi=function e(t){var i=t.root;yi(i.ref.main,i.query("GET_LABEL_FILE_PROCESSING"));yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_CANCEL"))};var qi=function e(t){var i=t.root;yi(i.ref.main,i.query("GET_LABEL_FILE_PROCESSING_ABORTED"));yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_RETRY"))};var Hi=function e(t){var i=t.root;yi(i.ref.main,i.query("GET_LABEL_FILE_PROCESSING_COMPLETE"));yi(i.ref.sub,i.query("GET_LABEL_TAP_TO_UNDO"))};var Ui=function e(t){var i=t.root;yi(i.ref.main,"");yi(i.ref.sub,"")};var Vi=function e(t){var i=t.root,n=t.action;yi(i.ref.main,n.status.main);yi(i.ref.sub,n.status.sub)};var ji=q({name:"file-status",ignoreRect:true,ignoreRectUpdate:true,write:U({DID_LOAD_ITEM:Ui,DID_REVERT_ITEM_PROCESSING:Ui,DID_REQUEST_ITEM_PROCESSING:Bi,DID_ABORT_ITEM_PROCESSING:qi,DID_COMPLETE_ITEM_PROCESSING:Hi,DID_UPDATE_ITEM_PROCESS_PROGRESS:zi,DID_UPDATE_ITEM_LOAD_PROGRESS:Gi,DID_THROW_ITEM_LOAD_ERROR:Vi,DID_THROW_ITEM_INVALID:Vi,DID_THROW_ITEM_PROCESSING_ERROR:Vi,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Vi,DID_THROW_ITEM_REMOVE_ERROR:Vi}),didCreateView:function e(t){Ke("CREATE_VIEW",Object.assign({},t,{view:t}))},create:Fi,mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}});var Yi={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"}};var Wi=[];a(Yi,(function(e){Wi.push(e)}));var Xi=function e(t){if(en(t)==="right")return 0;var i=t.ref.buttonRemoveItem.rect.element;return i.hidden?null:i.width+i.left};var Ki=function e(t){var i=t.ref.buttonAbortItemLoad.rect.element;return i.width};var Zi=function e(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.height/4)};var Qi=function e(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.left/2)};var $i=function e(t){return t.query("GET_STYLE_LOAD_INDICATOR_POSITION")};var Ji=function e(t){return t.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")};var en=function e(t){return t.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")};var tn={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:$i},processProgressIndicator:{opacity:0,align:Ji},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}};var nn={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Xi},status:{translateX:Xi}};var an={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}};var rn={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:Xi},status:{translateX:Xi,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:Xi},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:en},info:{translateX:Xi},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:en},buttonRemoveItem:{opacity:1},info:{translateX:Xi},status:{opacity:1,translateX:Xi}},DID_LOAD_ITEM:nn,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:Xi},status:{translateX:Xi}},DID_START_ITEM_PROCESSING:an,DID_REQUEST_ITEM_PROCESSING:an,DID_UPDATE_ITEM_PROCESS_PROGRESS:an,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:Xi}},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:Xi},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:nn};var on=q({create:function e(t){var i=t.root;i.element.innerHTML=i.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:true,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}});var sn=function e(t){var i=t.root,n=t.props;var r=Object.keys(Yi).reduce((function(e,t){e[t]=Object.assign({},Yi[t]);return e}),{});var o=n.id;var s=i.query("GET_ALLOW_REVERT");var l=i.query("GET_ALLOW_REMOVE");var c=i.query("GET_ALLOW_PROCESS");var u=i.query("GET_INSTANT_UPLOAD");var d=i.query("IS_ASYNC");var p=i.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");var h;if(d){if(c&&!s){h=function e(t){return!/RevertItemProcessing/.test(t)}}else if(!c&&s){h=function e(t){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(t)}}else if(!c&&!s){h=function e(t){return!/Process/.test(t)}}}else{h=function e(t){return!/Process/.test(t)}}var f=h?Wi.filter(h):Wi.concat();if(u&&s){r["RevertItemProcessing"].label="GET_LABEL_BUTTON_REMOVE_ITEM";r["RevertItemProcessing"].icon="GET_ICON_REMOVE"}if(d&&!s){var g=rn["DID_COMPLETE_ITEM_PROCESSING"];g.info.translateX=Qi;g.info.translateY=Zi;g.status.translateY=Zi;g.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(d&&!c){["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach((function(e){rn[e].status.translateY=Zi}));rn["DID_THROW_ITEM_PROCESSING_ERROR"].status.translateX=Ki}if(p&&s){r["RevertItemProcessing"].align="BUTTON_REMOVE_ITEM_POSITION";var m=rn["DID_COMPLETE_ITEM_PROCESSING"];m.info.translateX=Xi;m.status.translateY=Zi;m.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(!l){r["RemoveItem"].disabled=true}a(r,(function(e,t){var n=i.createChildView(Ci,{label:i.query(t.label),icon:i.query(t.icon),opacity:0});if(f.includes(e)){i.appendChildView(n)}if(t.disabled){n.element.setAttribute("disabled","disabled");n.element.setAttribute("hidden","hidden")}n.element.dataset.align=i.query("GET_STYLE_"+t.align);n.element.classList.add(t.className);n.on("click",(function(e){e.stopPropagation();if(t.disabled)return;i.dispatch(t.action,{query:o})}));i.ref["button"+e]=n}));i.ref.processingCompleteIndicator=i.appendChildView(i.createChildView(on));i.ref.processingCompleteIndicator.element.dataset.align=i.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION");i.ref.info=i.appendChildView(i.createChildView(Ri,{id:o}));i.ref.status=i.appendChildView(i.createChildView(ji,{id:o}));var v=i.appendChildView(i.createChildView(Ti,{opacity:0,align:i.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));v.element.classList.add("filepond--load-indicator");i.ref.loadProgressIndicator=v;var _=i.appendChildView(i.createChildView(Ti,{opacity:0,align:i.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));_.element.classList.add("filepond--process-indicator");i.ref.processProgressIndicator=_;i.ref.activeStyles=[]};var ln=function e(t){var i=t.root,n=t.actions,r=t.props;cn({root:i,actions:n,props:r});var o=n.concat().filter((function(e){return/^DID_/.test(e.type)})).reverse().find((function(e){return rn[e.type]}));if(o){i.ref.activeStyles=[];var s=rn[o.type];a(tn,(function(e,t){var n=i.ref[e];a(t,(function(t,a){var r=s[e]&&typeof s[e][t]!=="undefined"?s[e][t]:a;i.ref.activeStyles.push({control:n,key:t,value:r})}))}))}i.ref.activeStyles.forEach((function(e){var t=e.control,n=e.key,a=e.value;t[n]=typeof a==="function"?a(i):a}))};var cn=U({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function e(t){var i=t.root,n=t.action;i.ref.buttonAbortItemProcessing.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function e(t){var i=t.root,n=t.action;i.ref.buttonAbortItemLoad.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function e(t){var i=t.root,n=t.action;i.ref.buttonAbortItemRemoval.label=n.value},DID_REQUEST_ITEM_PROCESSING:function e(t){var i=t.root;i.ref.processProgressIndicator.spin=true;i.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function e(t){var i=t.root;i.ref.loadProgressIndicator.spin=true;i.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function e(t){var i=t.root;i.ref.processProgressIndicator.spin=true;i.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function e(t){var i=t.root,n=t.action;i.ref.loadProgressIndicator.spin=false;i.ref.loadProgressIndicator.progress=n.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function e(t){var i=t.root,n=t.action;i.ref.processProgressIndicator.spin=false;i.ref.processProgressIndicator.progress=n.progress}});var un=q({create:sn,write:ln,didCreateView:function e(t){Ke("CREATE_VIEW",Object.assign({},t,{view:t}))},name:"file"});var dn=function e(t){var i=t.root,n=t.props;i.ref.fileName=bi("legend");i.appendChild(i.ref.fileName);i.ref.file=i.appendChildView(i.createChildView(un,{id:n.id}));i.ref.data=false};var pn=function e(t){var i=t.root,n=t.props;yi(i.ref.fileName,_i(i.query("GET_ITEM_NAME",n.id)))};var hn=q({create:dn,ignoreRect:true,write:U({DID_LOAD_ITEM:pn}),didCreateView:function e(t){Ke("CREATE_VIEW",Object.assign({},t,{view:t}))},tag:"fieldset",name:"file-wrapper"});var fn={type:"spring",damping:.6,mass:7};var gn=function e(t){var i=t.root,n=t.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:fn},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:fn},styles:["translateY"]}}].forEach((function(e){mn(i,e,n.name)}));i.element.classList.add("filepond--"+n.name);i.ref.scalable=null};var mn=function e(t,i,n){var a=q({name:"panel-"+i.name+" filepond--"+n,mixins:i.mixins,ignoreRectUpdate:true});var r=t.createChildView(a,i.props);t.ref[i.name]=t.appendChildView(r)};var vn=function e(t){var i=t.root,n=t.props;if(i.ref.scalable===null||n.scalable!==i.ref.scalable){i.ref.scalable=Q(n.scalable)?n.scalable:true;i.element.dataset.scalable=i.ref.scalable}if(!n.height)return;var a=i.ref.top.rect.element;var r=i.ref.bottom.rect.element;var o=Math.max(a.height+r.height,n.height);i.ref.center.translateY=a.height;i.ref.center.scaleY=(o-a.height-r.height)/100;i.ref.bottom.translateY=o-r.height};var _n=q({name:"panel",read:function e(t){var i=t.root,n=t.props;return n.heightCurrent=i.ref.bottom.translateY},write:vn,create:gn,ignoreRect:true,mixins:{apis:["height","heightCurrent","scalable"]}});var bn=function e(t){var i=t.map((function(e){return e.id}));var n=undefined;return{setIndex:function e(t){n=t},getIndex:function e(){return n},getItemIndex:function e(t){return i.indexOf(t.id)}}};var yn={type:"spring",stiffness:.75,damping:.45,mass:10};var wn="spring";var xn={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"};var En=function e(t){var i=t.root,n=t.props;i.ref.handleClick=function(e){return i.dispatch("DID_ACTIVATE_ITEM",{id:n.id})};i.element.id="filepond--item-"+n.id;i.element.addEventListener("click",i.ref.handleClick);i.ref.container=i.appendChildView(i.createChildView(hn,{id:n.id}));i.ref.panel=i.appendChildView(i.createChildView(_n,{name:"item-panel"}));i.ref.panel.height=null;n.markedForRemoval=false;if(!i.query("GET_ALLOW_REORDER"))return;i.element.dataset.dragState="idle";var a=function e(t){if(!t.isPrimary)return;var a=false;var r={x:t.pageX,y:t.pageY};n.dragOrigin={x:i.translateX,y:i.translateY};n.dragCenter={x:t.offsetX,y:t.offsetY};var o=bn(i.query("GET_ACTIVE_ITEMS"));i.dispatch("DID_GRAB_ITEM",{id:n.id,dragState:o});var s=function e(t){if(!t.isPrimary)return;t.stopPropagation();t.preventDefault();n.dragOffset={x:t.pageX-r.x,y:t.pageY-r.y};var s=n.dragOffset.x*n.dragOffset.x+n.dragOffset.y*n.dragOffset.y;if(s>16&&!a){a=true;i.element.removeEventListener("click",i.ref.handleClick)}i.dispatch("DID_DRAG_ITEM",{id:n.id,dragState:o})};var l=function e(t){if(!t.isPrimary)return;document.removeEventListener("pointermove",s);document.removeEventListener("pointerup",e);n.dragOffset={x:t.pageX-r.x,y:t.pageY-r.y};i.dispatch("DID_DROP_ITEM",{id:n.id,dragState:o});if(a){setTimeout((function(){return i.element.addEventListener("click",i.ref.handleClick)}),0)}};document.addEventListener("pointermove",s);document.addEventListener("pointerup",l)};i.element.addEventListener("pointerdown",a)};var kn=U({DID_UPDATE_PANEL_HEIGHT:function e(t){var i=t.root,n=t.action;i.height=n.height}});var In=U({DID_GRAB_ITEM:function e(t){var i=t.root,n=t.props;n.dragOrigin={x:i.translateX,y:i.translateY}},DID_DRAG_ITEM:function e(t){var i=t.root;i.element.dataset.dragState="drag"},DID_DROP_ITEM:function e(t){var i=t.root,n=t.props;n.dragOffset=null;n.dragOrigin=null;i.element.dataset.dragState="drop"}},(function(e){var t=e.root,i=e.actions,n=e.props,a=e.shouldOptimize;if(t.element.dataset.dragState==="drop"){if(t.scaleX<=1){t.element.dataset.dragState="idle"}}var r=i.concat().filter((function(e){return/^DID_/.test(e.type)})).reverse().find((function(e){return xn[e.type]}));if(r&&r.type!==n.currentState){n.currentState=r.type;t.element.dataset.filepondItemState=xn[n.currentState]||""}var o=t.query("GET_ITEM_PANEL_ASPECT_RATIO")||t.query("GET_PANEL_ASPECT_RATIO");if(!o){kn({root:t,actions:i,props:n});if(!t.height&&t.ref.container.rect.element.height>0){t.height=t.ref.container.rect.element.height}}else if(!a){t.height=t.rect.element.width*o}if(a){t.ref.panel.height=null}t.ref.panel.height=t.height}));var Tn=q({create:En,write:In,destroy:function e(t){var i=t.root,n=t.props;i.element.removeEventListener("click",i.ref.handleClick);i.dispatch("RELEASE_ITEM",{query:n.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:wn,scaleY:wn,translateX:yn,translateY:yn,opacity:{type:"tween",duration:150}}}});var Sn=function(e,t){return Math.max(1,Math.floor((e+1)/t))};var An=function e(t,i,n){if(!n)return;var a=t.rect.element.width;var r=i.length;var o=null;if(r===0||n.top<i[0].rect.element.top)return-1;var s=i[0];var l=s.rect.element;var c=l.marginLeft+l.marginRight;var u=l.width+c;var d=Sn(a,u);if(d===1){for(var p=0;p<r;p++){var h=i[p];var f=h.rect.outer.top+h.rect.element.height*.5;if(n.top<f){return p}}return r}var g=l.marginTop+l.marginBottom;var m=l.height+g;for(var v=0;v<r;v++){var _=v%d;var b=Math.floor(v/d);var y=_*u;var w=b*m;var x=w-l.marginTop;var E=y+u;var k=w+m+l.marginBottom;if(n.top<k&&n.top>x){if(n.left<E){return v}else if(v!==r-1){o=v}else{o=null}}}if(o!==null){return o}return r};var Cn={height:0,width:0,get getHeight(){return this.height},set setHeight(e){if(this.height===0||e===0)this.height=e},get getWidth(){return this.width},set setWidth(e){if(this.width===0||e===0)this.width=e},setDimensions:function e(t,i){if(this.height===0||t===0)this.height=t;if(this.width===0||i===0)this.width=i}};var Mn=function e(t){var i=t.root;o(i.element,"role","list");i.ref.lastItemSpanwDate=Date.now()};var Dn=function e(t){var i=t.root,n=t.action;var a=n.id,r=n.index,o=n.interactionMethod;i.ref.addIndex=r;var s=Date.now();var l=s;var c=1;if(o!==Te.NONE){c=0;var u=i.query("GET_ITEM_INSERT_INTERVAL");var d=s-i.ref.lastItemSpanwDate;l=d<u?s+(u-d):s}i.ref.lastItemSpanwDate=l;i.appendChildView(i.createChildView(Tn,{spawnDate:l,id:a,opacity:c,interactionMethod:o}),r)};var Ln=function e(t,i,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;if(t.dragOffset){t.translateX=null;t.translateY=null;t.translateX=t.dragOrigin.x+t.dragOffset.x;t.translateY=t.dragOrigin.y+t.dragOffset.y;t.scaleX=1.025;t.scaleY=1.025}else{t.translateX=i;t.translateY=n;if(Date.now()>t.spawnDate){if(t.opacity===0){On(t,i,n,a,r)}t.scaleX=1;t.scaleY=1;t.opacity=1}}};var On=function e(t,i,n,a,r){if(t.interactionMethod===Te.NONE){t.translateX=null;t.translateX=i;t.translateY=null;t.translateY=n}else if(t.interactionMethod===Te.DROP){t.translateX=null;t.translateX=i-a*20;t.translateY=null;t.translateY=n-r*10;t.scaleX=.8;t.scaleY=.8}else if(t.interactionMethod===Te.BROWSE){t.translateY=null;t.translateY=n-30}else if(t.interactionMethod===Te.API){t.translateX=null;t.translateX=i-30;t.translateY=null}};var Pn=function e(t){var i=t.root,n=t.action;var a=n.id;var r=i.childViews.find((function(e){return e.id===a}));if(!r){return}r.scaleX=.9;r.scaleY=.9;r.opacity=0;r.markedForRemoval=true};var Rn=function e(t){return t.rect.element.height+t.rect.element.marginBottom*.5+t.rect.element.marginTop*.5};var Nn=function e(t){return t.rect.element.width+t.rect.element.marginLeft*.5+t.rect.element.marginRight*.5};var Fn=function e(t){var i=t.root,n=t.action;var a=n.id,r=n.dragState;var o=i.query("GET_ITEM",{id:a});var s=i.childViews.find((function(e){return e.id===a}));var l=i.childViews.length;var c=r.getItemIndex(o);if(!s)return;var u={x:s.dragOrigin.x+s.dragOffset.x+s.dragCenter.x,y:s.dragOrigin.y+s.dragOffset.y+s.dragCenter.y};var d=Rn(s);var p=Nn(s);var h=Math.floor(i.rect.outer.width/p);if(h>l)h=l;var f=Math.floor(l/h+1);Cn.setHeight=d*f;Cn.setWidth=p*h;var g={y:Math.floor(u.y/d),x:Math.floor(u.x/p),getGridIndex:function e(){if(u.y>Cn.getHeight||u.y<0||u.x>Cn.getWidth||u.x<0)return c;return this.y*h+this.x},getColIndex:function e(){var t=i.query("GET_ACTIVE_ITEMS");var n=i.childViews.filter((function(e){return e.rect.element.height}));var a=t.map((function(e){return n.find((function(t){return t.id===e.id}))}));var r=a.findIndex((function(e){return e===s}));var o=Rn(s);var l=a.length;var c=l;var d=0;var p=0;var h=0;for(var f=0;f<l;f++){d=Rn(a[f]);h=p;p=h+d;if(u.y<p){if(r>f){if(u.y<h+o){c=f;break}continue}c=f;break}}return c}};var m=h>1?g.getGridIndex():g.getColIndex();i.dispatch("MOVE_ITEM",{query:s,index:m});var v=r.getIndex();if(v===undefined||v!==m){r.setIndex(m);if(v===undefined)return;i.dispatch("DID_REORDER_ITEMS",{items:i.query("GET_ACTIVE_ITEMS"),origin:c,target:m})}};var Gn=U({DID_ADD_ITEM:Dn,DID_REMOVE_ITEM:Pn,DID_DRAG_ITEM:Fn});var zn=function e(t){var i=t.root,n=t.props,a=t.actions,r=t.shouldOptimize;Gn({root:i,props:n,actions:a});var o=n.dragCoordinates;var s=i.rect.element.width;var l=i.childViews.filter((function(e){return e.rect.element.height}));var c=i.query("GET_ACTIVE_ITEMS").map((function(e){return l.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));var u=o?An(i,c,o):null;var d=i.ref.addIndex||null;i.ref.addIndex=null;var p=0;var h=0;var f=0;if(c.length===0)return;var g=c[0].rect.element;var m=g.marginTop+g.marginBottom;var v=g.marginLeft+g.marginRight;var _=g.width+v;var b=g.height+m;var y=Sn(s,_);if(y===1){var w=0;var x=0;c.forEach((function(e,t){if(u){var i=t-u;if(i===-2){x=-m*.25}else if(i===-1){x=-m*.75}else if(i===0){x=m*.75}else if(i===1){x=m*.25}else{x=0}}if(r){e.translateX=null;e.translateY=null}if(!e.markedForRemoval){Ln(e,0,w+x)}var n=e.rect.element.height+m;var a=n*(e.markedForRemoval?e.opacity:1);w+=a}))}else{var E=0;var k=0;c.forEach((function(e,t){if(t===u){p=1}if(t===d){f+=1}if(e.markedForRemoval&&e.opacity<.5){h-=1}var i=t+f+p+h;var n=i%y;var a=Math.floor(i/y);var o=n*_;var s=a*b;var l=Math.sign(o-E);var c=Math.sign(s-k);E=o;k=s;if(e.markedForRemoval)return;if(r){e.translateX=null;e.translateY=null}Ln(e,o,s,l,c)}))}};var Bn=function e(t,i){return i.filter((function(e){if(e.data&&e.data.id){return t.id===e.data.id}return true}))};var qn=q({create:Mn,write:zn,tag:"ul",name:"list",didWriteView:function e(t){var i=t.root;i.childViews.filter((function(e){return e.markedForRemoval&&e.opacity===0&&e.resting})).forEach((function(e){e._destroy();i.removeChildView(e)}))},filterFrameActionsForChild:Bn,mixins:{apis:["dragCoordinates"]}});var Hn=function e(t){var i=t.root,n=t.props;i.ref.list=i.appendChildView(i.createChildView(qn));n.dragCoordinates=null;n.overflowing=false};var Un=function e(t){var i=t.root,n=t.props,a=t.action;if(!i.query("GET_ITEM_INSERT_LOCATION_FREEDOM"))return;n.dragCoordinates={left:a.position.scopeLeft-i.ref.list.rect.element.left,top:a.position.scopeTop-(i.rect.outer.top+i.rect.element.marginTop+i.rect.element.scrollTop)}};var Vn=function e(t){var i=t.props;i.dragCoordinates=null};var jn=U({DID_DRAG:Un,DID_END_DRAG:Vn});var Yn=function e(t){var i=t.root,n=t.props,a=t.actions;jn({root:i,props:n,actions:a});i.ref.list.dragCoordinates=n.dragCoordinates;if(n.overflowing&&!n.overflow){n.overflowing=false;i.element.dataset.state="";i.height=null}if(n.overflow){var r=Math.round(n.overflow);if(r!==i.height){n.overflowing=true;i.element.dataset.state="overflow";i.height=r}}};var Wn=q({create:Hn,write:Yn,name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}});var Xn=function e(t,i,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"";if(n){o(t,i,a)}else{t.removeAttribute(i)}};var Kn=function e(t){if(!t||t.value===""){return}try{t.value=""}catch(e){}if(t.value){var i=bi("form");var n=t.parentNode;var a=t.nextSibling;i.appendChild(t);i.reset();if(a){n.insertBefore(t,a)}else{n.appendChild(t)}}};var Zn=function e(t){var i=t.root,n=t.props;i.element.id="filepond--browser-"+n.id;o(i.element,"name",i.query("GET_NAME"));o(i.element,"aria-controls","filepond--assistant-"+n.id);o(i.element,"aria-labelledby","filepond--drop-label-"+n.id);Qn({root:i,action:{value:i.query("GET_ACCEPTED_FILE_TYPES")}});$n({root:i,action:{value:i.query("GET_ALLOW_MULTIPLE")}});Jn({root:i,action:{value:i.query("GET_ALLOW_DIRECTORIES_ONLY")}});ea({root:i});ta({root:i,action:{value:i.query("GET_REQUIRED")}});ia({root:i,action:{value:i.query("GET_CAPTURE_METHOD")}});i.ref.handleChange=function(e){if(!i.element.value){return}var t=Array.from(i.element.files).map((function(e){e._relativePath=e.webkitRelativePath;return e}));setTimeout((function(){n.onload(t);Kn(i.element)}),250)};i.element.addEventListener("change",i.ref.handleChange)};var Qn=function e(t){var i=t.root,n=t.action;if(!i.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE"))return;Xn(i.element,"accept",!!n.value,n.value?n.value.join(","):"")};var $n=function e(t){var i=t.root,n=t.action;Xn(i.element,"multiple",n.value)};var Jn=function e(t){var i=t.root,n=t.action;Xn(i.element,"webkitdirectory",n.value)};var ea=function e(t){var i=t.root;var n=i.query("GET_DISABLED");var a=i.query("GET_ALLOW_BROWSE");var r=n||!a;Xn(i.element,"disabled",r)};var ta=function e(t){var i=t.root,n=t.action;if(!n.value){Xn(i.element,"required",false)}else if(i.query("GET_TOTAL_ITEMS")===0){Xn(i.element,"required",true)}};var ia=function e(t){var i=t.root,n=t.action;Xn(i.element,"capture",!!n.value,n.value===true?"":n.value)};var na=function e(t){var i=t.root;var n=i.element;if(i.query("GET_TOTAL_ITEMS")>0){Xn(n,"required",false);Xn(n,"name",false)}else{Xn(n,"name",true,i.query("GET_NAME"));var a=i.query("GET_CHECK_VALIDITY");if(a){n.setCustomValidity("")}if(i.query("GET_REQUIRED")){Xn(n,"required",true)}}};var aa=function e(t){var i=t.root;var n=i.query("GET_CHECK_VALIDITY");if(!n)return;i.element.setCustomValidity(i.query("GET_LABEL_INVALID_FIELD"))};var ra=q({tag:"input",name:"browser",ignoreRect:true,ignoreRectUpdate:true,attributes:{type:"file"},create:Zn,destroy:function e(t){var i=t.root;i.element.removeEventListener("change",i.ref.handleChange)},write:U({DID_LOAD_ITEM:na,DID_REMOVE_ITEM:na,DID_THROW_ITEM_INVALID:aa,DID_SET_DISABLED:ea,DID_SET_ALLOW_BROWSE:ea,DID_SET_ALLOW_DIRECTORIES_ONLY:Jn,DID_SET_ALLOW_MULTIPLE:$n,DID_SET_ACCEPTED_FILE_TYPES:Qn,DID_SET_CAPTURE_METHOD:ia,DID_SET_REQUIRED:ta})});var oa={ENTER:13,SPACE:32};var sa=function e(t){var i=t.root,n=t.props;var a=bi("label");o(a,"for","filepond--browser-"+n.id);o(a,"id","filepond--drop-label-"+n.id);o(a,"aria-hidden","true");i.ref.handleKeyDown=function(e){var t=e.keyCode===oa.ENTER||e.keyCode===oa.SPACE;if(!t)return;e.preventDefault();i.ref.label.click()};i.ref.handleClick=function(e){var t=e.target===a||a.contains(e.target);if(t)return;i.ref.label.click()};a.addEventListener("keydown",i.ref.handleKeyDown);i.element.addEventListener("click",i.ref.handleClick);la(a,n.caption);i.appendChild(a);i.ref.label=a};var la=function e(t,i){t.innerHTML=i;var n=t.querySelector(".filepond--label-action");if(n){o(n,"tabindex","0")}return i};var ca=q({name:"drop-label",ignoreRect:true,create:sa,destroy:function e(t){var i=t.root;i.ref.label.addEventListener("keydown",i.ref.handleKeyDown);i.element.removeEventListener("click",i.ref.handleClick)},write:U({DID_SET_LABEL_IDLE:function e(t){var i=t.root,n=t.action;la(i.ref.label,n.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}});var ua=q({name:"drip-blob",ignoreRect:true,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}});var da=function e(t){var i=t.root;var n=i.rect.element.width*.5;var a=i.rect.element.height*.5;i.ref.blob=i.appendChildView(i.createChildView(ua,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:n,translateY:a}))};var pa=function e(t){var i=t.root,n=t.action;if(!i.ref.blob){da({root:i});return}i.ref.blob.translateX=n.position.scopeLeft;i.ref.blob.translateY=n.position.scopeTop;i.ref.blob.scaleX=1;i.ref.blob.scaleY=1;i.ref.blob.opacity=1};var ha=function e(t){var i=t.root;if(!i.ref.blob){return}i.ref.blob.opacity=0};var fa=function e(t){var i=t.root;if(!i.ref.blob){return}i.ref.blob.scaleX=2.5;i.ref.blob.scaleY=2.5;i.ref.blob.opacity=0};var ga=function e(t){var i=t.root,n=t.props,a=t.actions;ma({root:i,props:n,actions:a});var r=i.ref.blob;if(a.length===0&&r&&r.opacity===0){i.removeChildView(r);i.ref.blob=null}};var ma=U({DID_DRAG:pa,DID_DROP:fa,DID_END_DRAG:ha});var va=q({ignoreRect:true,ignoreRectUpdate:true,name:"drip",write:ga});var _a=function e(t,i){try{var n=new DataTransfer;i.forEach((function(e){if(e instanceof File){n.items.add(e)}else{n.items.add(new File([e],e.name,{type:e.type}))}}));t.files=n.files}catch(e){return false}return true};var ba=function e(t){var i=t.root;return i.ref.fields={}};var ya=function e(t,i){return t.ref.fields[i]};var wa=function e(t){t.query("GET_ACTIVE_ITEMS").forEach((function(e){if(!t.ref.fields[e.id])return;t.element.appendChild(t.ref.fields[e.id])}))};var xa=function e(t){var i=t.root;return wa(i)};var Ea=function e(t){var i=t.root,n=t.action;var a=i.query("GET_ITEM",n.id);var r=a.origin===He.LOCAL;var o=!r&&i.query("SHOULD_UPDATE_FILE_INPUT");var s=bi("input");s.type=o?"file":"hidden";s.name=i.query("GET_NAME");s.disabled=i.query("GET_DISABLED");i.ref.fields[n.id]=s;wa(i)};var ka=function e(t){var i=t.root,n=t.action;var a=ya(i,n.id);if(!a)return;if(n.serverFileReference!==null)a.value=n.serverFileReference;if(!i.query("SHOULD_UPDATE_FILE_INPUT"))return;var r=i.query("GET_ITEM",n.id);_a(a,[r.file])};var Ia=function e(t){var i=t.root,n=t.action;if(!i.query("SHOULD_UPDATE_FILE_INPUT"))return;setTimeout((function(){var e=ya(i,n.id);if(!e)return;_a(e,[n.file])}),0)};var Ta=function e(t){var i=t.root;i.element.disabled=i.query("GET_DISABLED")};var Sa=function e(t){var i=t.root,n=t.action;var a=ya(i,n.id);if(!a)return;if(a.parentNode)a.parentNode.removeChild(a);delete i.ref.fields[n.id]};var Aa=function e(t){var i=t.root,n=t.action;var a=ya(i,n.id);if(!a)return;if(n.value===null){a.removeAttribute("value")}else{a.value=n.value}wa(i)};var Ca=U({DID_SET_DISABLED:Ta,DID_ADD_ITEM:Ea,DID_LOAD_ITEM:ka,DID_REMOVE_ITEM:Sa,DID_DEFINE_VALUE:Aa,DID_PREPARE_OUTPUT:Ia,DID_REORDER_ITEMS:xa,DID_SORT_ITEMS:xa});var Ma=q({tag:"fieldset",name:"data",create:ba,write:Ca,ignoreRect:true});var Da=function e(t){return"getRootNode"in t?t.getRootNode():document};var La=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"];var Oa=["css","csv","html","txt"];var Pa={zip:"zip|compressed",epub:"application/epub+zip"};var Ra=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";t=t.toLowerCase();if(La.includes(t)){return"image/"+(t==="jpg"?"jpeg":t==="svg"?"svg+xml":t)}if(Oa.includes(t)){return"text/"+t}return Pa[t]||""};var Na=function e(t){return new Promise((function(e,i){var n=Ya(t);if(n.length&&!Fa(t)){return e(n)}Ga(t).then(e)}))};var Fa=function e(t){if(t.files)return t.files.length>0;return false};var Ga=function e(t){return new Promise((function(e,i){var n=(t.items?Array.from(t.items):[]).filter((function(e){return za(e)})).map((function(e){return Ba(e)}));if(!n.length){e(t.files?Array.from(t.files):[]);return}Promise.all(n).then((function(t){var i=[];t.forEach((function(e){i.push.apply(i,e)}));e(i.filter((function(e){return e})).map((function(e){if(!e._relativePath)e._relativePath=e.webkitRelativePath;return e})))})).catch(console.error)}))};var za=function e(t){if(Va(t)){var i=ja(t);if(i){return i.isFile||i.isDirectory}}return t.kind==="file"};var Ba=function e(t){return new Promise((function(e,i){if(Ua(t)){qa(ja(t)).then(e).catch(i);return}e([t.getAsFile()])}))};var qa=function e(t){return new Promise((function(e,i){var n=[];var a=0;var r=0;var o=function t(){if(r===0&&a===0){e(n)}};var s=function e(t){a++;var s=t.createReader();var l=function t(){s.readEntries((function(i){if(i.length===0){a--;o();return}i.forEach((function(t){if(t.isDirectory){e(t)}else{r++;t.file((function(e){var i=Ha(e);if(t.fullPath)i._relativePath=t.fullPath;n.push(i);r--;o()}))}}));t()}),i)};l()};s(t)}))};var Ha=function e(t){if(t.type.length)return t;var i=t.lastModifiedDate;var n=t.name;var a=Ra(wt(t.name));if(!a.length)return t;t=t.slice(0,t.size,a);t.name=n;t.lastModifiedDate=i;return t};var Ua=function e(t){return Va(t)&&(ja(t)||{}).isDirectory};var Va=function e(t){return"webkitGetAsEntry"in t};var ja=function e(t){return t.webkitGetAsEntry()};var Ya=function e(t){var i=[];try{i=Xa(t);if(i.length){return i}i=Wa(t)}catch(e){}return i};var Wa=function e(t){var i=t.getData("url");if(typeof i==="string"&&i.length){return[i]}return[]};var Xa=function e(t){var i=t.getData("text/html");if(typeof i==="string"&&i.length){var n=i.match(/src\s*=\s*"(.+?)"/);if(n){return[n[1]]}}return[]};var Ka=[];var Za=function e(t){return{pageLeft:t.pageX,pageTop:t.pageY,scopeLeft:t.offsetX||t.layerX,scopeTop:t.offsetY||t.layerY}};var Qa=function e(t,i,n){var a=$a(i);var r={element:t,filterElement:n,state:null,ondrop:function e(){},onenter:function e(){},ondrag:function e(){},onexit:function e(){},onload:function e(){},allowdrop:function e(){}};r.destroy=a.addListener(r);return r};var $a=function e(t){var i=Ka.find((function(e){return e.element===t}));if(i){return i}var n=Ja(t);Ka.push(n);return n};var Ja=function e(t){var i=[];var n={dragenter:ar,dragover:rr,dragleave:sr,drop:or};var r={};a(n,(function(e,n){r[e]=n(t,i);t.addEventListener(e,r[e],false)}));var o={element:t,addListener:function e(s){i.push(s);return function(){i.splice(i.indexOf(s),1);if(i.length===0){Ka.splice(Ka.indexOf(o),1);a(n,(function(e){t.removeEventListener(e,r[e],false)}))}}}};return o};var er=function e(t,i){if(!("elementFromPoint"in t)){t=document}return t.elementFromPoint(i.x,i.y)};var tr=function e(t,i){var n=Da(i);var a=er(n,{x:t.pageX-window.pageXOffset,y:t.pageY-window.pageYOffset});return a===i||i.contains(a)};var ir=null;var nr=function e(t,i){try{t.dropEffect=i}catch(e){}};var ar=function e(t,i){return function(e){e.preventDefault();ir=e.target;i.forEach((function(t){var i=t.element,n=t.onenter;if(tr(e,i)){t.state="enter";n(Za(e))}}))}};var rr=function e(t,i){return function(e){e.preventDefault();var t=e.dataTransfer;Na(t).then((function(n){var a=false;i.some((function(i){var r=i.filterElement,o=i.element,s=i.onenter,l=i.onexit,c=i.ondrag,u=i.allowdrop;nr(t,"copy");var d=u(n);if(!d){nr(t,"none");return}if(tr(e,o)){a=true;if(i.state===null){i.state="enter";s(Za(e));return}i.state="over";if(r&&!d){nr(t,"none");return}c(Za(e))}else{if(r&&!a){nr(t,"none")}if(i.state){i.state=null;l(Za(e))}}}))}))}};var or=function e(t,i){return function(e){e.preventDefault();var t=e.dataTransfer;Na(t).then((function(t){i.forEach((function(i){var n=i.filterElement,a=i.element,r=i.ondrop,o=i.onexit,s=i.allowdrop;i.state=null;if(n&&!tr(e,a))return;if(!s(t))return o(Za(e));r(Za(e),t)}))}))}};var sr=function e(t,i){return function(e){if(ir!==e.target){return}i.forEach((function(t){var i=t.onexit;t.state=null;i(Za(e))}))}};var lr=function e(t,i,n){t.classList.add("filepond--hopper");var a=n.catchesDropsOnPage,r=n.requiresDropOnElement,o=n.filterItems,s=o===void 0?function(e){return e}:o;var l=Qa(t,a?document.documentElement:t,r);var c="";var u="";l.allowdrop=function(e){return i(s(e))};l.ondrop=function(e,t){var n=s(t);if(!i(n)){d.ondragend(e);return}u="drag-drop";d.onload(n,e)};l.ondrag=function(e){d.ondrag(e)};l.onenter=function(e){u="drag-over";d.ondragstart(e)};l.onexit=function(e){u="drag-exit";d.ondragend(e)};var d={updateHopperState:function e(){if(c!==u){t.dataset.hopperState=u;c=u}},onload:function e(){},ondragstart:function e(){},ondrag:function e(){},ondragend:function e(){},destroy:function e(){l.destroy()}};return d};var cr=false;var ur=[];var dr=function e(t){var i=document.activeElement;if(i&&/textarea|input/i.test(i.nodeName)){var n=false;var a=i;while(a!==document.body){if(a.classList.contains("filepond--root")){n=true;break}a=a.parentNode}if(!n)return}Na(t.clipboardData).then((function(e){if(!e.length){return}ur.forEach((function(t){return t(e)}))}))};var pr=function e(t){if(ur.includes(t)){return}ur.push(t);if(cr){return}cr=true;document.addEventListener("paste",dr)};var hr=function e(t){Pe(ur,ur.indexOf(t));if(ur.length===0){document.removeEventListener("paste",dr);cr=false}};var fr=function e(){var t=function e(t){i.onload(t)};var i={destroy:function e(){hr(t)},onload:function e(){}};pr(t);return i};var gr=function e(t){var i=t.root,n=t.props;i.element.id="filepond--assistant-"+n.id;o(i.element,"role","status");o(i.element,"aria-live","polite");o(i.element,"aria-relevant","additions")};var mr=null;var vr=null;var _r=[];var br=function e(t,i){t.element.textContent=i};var yr=function e(t){t.element.textContent=""};var wr=function e(t,i,n){var a=t.query("GET_TOTAL_ITEMS");br(t,n+" "+i+", "+a+" "+(a===1?t.query("GET_LABEL_FILE_COUNT_SINGULAR"):t.query("GET_LABEL_FILE_COUNT_PLURAL")));clearTimeout(vr);vr=setTimeout((function(){yr(t)}),1500)};var xr=function e(t){return t.element.parentNode.contains(document.activeElement)};var Er=function e(t){var i=t.root,n=t.action;if(!xr(i)){return}i.element.textContent="";var a=i.query("GET_ITEM",n.id);_r.push(a.filename);clearTimeout(mr);mr=setTimeout((function(){wr(i,_r.join(", "),i.query("GET_LABEL_FILE_ADDED"));_r.length=0}),750)};var kr=function e(t){var i=t.root,n=t.action;if(!xr(i)){return}var a=n.item;wr(i,a.filename,i.query("GET_LABEL_FILE_REMOVED"))};var Ir=function e(t){var i=t.root,n=t.action;var a=i.query("GET_ITEM",n.id);var r=a.filename;var o=i.query("GET_LABEL_FILE_PROCESSING_COMPLETE");br(i,r+" "+o)};var Tr=function e(t){var i=t.root,n=t.action;var a=i.query("GET_ITEM",n.id);var r=a.filename;var o=i.query("GET_LABEL_FILE_PROCESSING_ABORTED");br(i,r+" "+o)};var Sr=function e(t){var i=t.root,n=t.action;var a=i.query("GET_ITEM",n.id);var r=a.filename;br(i,n.status.main+" "+r+" "+n.status.sub)};var Ar=q({create:gr,ignoreRect:true,ignoreRectUpdate:true,write:U({DID_LOAD_ITEM:Er,DID_REMOVE_ITEM:kr,DID_COMPLETE_ITEM_PROCESSING:Ir,DID_ABORT_ITEM_PROCESSING:Tr,DID_REVERT_ITEM_PROCESSING:Tr,DID_THROW_ITEM_REMOVE_ERROR:Sr,DID_THROW_ITEM_LOAD_ERROR:Sr,DID_THROW_ITEM_INVALID:Sr,DID_THROW_ITEM_PROCESSING_ERROR:Sr}),tag:"span",name:"assistant"});var Cr=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"-";return t.replace(new RegExp(i+".","g"),(function(e){return e.charAt(1).toUpperCase()}))};var Mr=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:16;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var a=Date.now();var r=null;return function(){for(var e=arguments.length,o=new Array(e),s=0;s<e;s++){o[s]=arguments[s]}clearTimeout(r);var l=Date.now()-a;var c=function e(){a=Date.now();t.apply(void 0,o)};if(l<i){if(!n){r=setTimeout(c,i-l)}}else{c()}}};var Dr=1e6;var Lr=function e(t){return t.preventDefault()};var Or=function e(t){var i=t.root,n=t.props;var a=i.query("GET_ID");if(a){i.element.id=a}var r=i.query("GET_CLASS_NAME");if(r){r.split(" ").filter((function(e){return e.length})).forEach((function(e){i.element.classList.add(e)}))}i.ref.label=i.appendChildView(i.createChildView(ca,Object.assign({},n,{translateY:null,caption:i.query("GET_LABEL_IDLE")})));i.ref.list=i.appendChildView(i.createChildView(Wn,{translateY:null}));i.ref.panel=i.appendChildView(i.createChildView(_n,{name:"panel-root"}));i.ref.assistant=i.appendChildView(i.createChildView(Ar,Object.assign({},n)));i.ref.data=i.appendChildView(i.createChildView(Ma,Object.assign({},n)));i.ref.measure=bi("div");i.ref.measure.style.height="100%";i.element.appendChild(i.ref.measure);i.ref.bounds=null;i.query("GET_STYLES").filter((function(e){return!W(e.value)})).map((function(e){var t=e.name,n=e.value;i.element.dataset[t]=n}));i.ref.widthPrevious=null;i.ref.widthUpdated=Mr((function(){i.ref.updateHistory=[];i.dispatch("DID_RESIZE_ROOT")}),250);i.ref.previousAspectRatio=null;i.ref.updateHistory=[];var o=window.matchMedia("(pointer: fine) and (hover: hover)").matches;var s="PointerEvent"in window;if(i.query("GET_ALLOW_REORDER")&&s&&!o){i.element.addEventListener("touchmove",Lr,{passive:false});i.element.addEventListener("gesturestart",Lr)}var l=i.query("GET_CREDITS");var c=l.length===2;if(c){var u=document.createElement("a");u.className="filepond--credits";u.setAttribute("aria-hidden","true");u.href=l[0];u.tabindex=-1;u.target="_blank";u.rel="noopener noreferrer";u.textContent=l[1];i.element.appendChild(u);i.ref.credits=u}};var Pr=function e(t){var i=t.root,n=t.props,a=t.actions;Ur({root:i,props:n,actions:a});a.filter((function(e){return/^DID_SET_STYLE_/.test(e.type)})).filter((function(e){return!W(e.data.value)})).map((function(e){var t=e.type,n=e.data;var a=Cr(t.substring(8).toLowerCase(),"_");i.element.dataset[a]=n.value;i.invalidateLayout()}));if(i.rect.element.hidden)return;if(i.rect.element.width!==i.ref.widthPrevious){i.ref.widthPrevious=i.rect.element.width;i.ref.widthUpdated()}var r=i.ref.bounds;if(!r){r=i.ref.bounds=Fr(i);i.element.removeChild(i.ref.measure);i.ref.measure=null}var o=i.ref,s=o.hopper,l=o.label,c=o.list,u=o.panel;if(s){s.updateHopperState()}var d=i.query("GET_PANEL_ASPECT_RATIO");var p=i.query("GET_ALLOW_MULTIPLE");var h=i.query("GET_TOTAL_ITEMS");var f=p?i.query("GET_MAX_FILES")||Dr:1;var g=h===f;var m=a.find((function(e){return e.type==="DID_ADD_ITEM"}));if(g&&m){var v=m.data.interactionMethod;l.opacity=0;if(p){l.translateY=-40}else{if(v===Te.API){l.translateX=40}else if(v===Te.BROWSE){l.translateY=40}else{l.translateY=30}}}else if(!g){l.opacity=1;l.translateX=0;l.translateY=0}var _=Rr(i);var b=Nr(i);var y=l.rect.element.height;var w=!p||g?0:y;var x=g?c.rect.element.marginTop:0;var E=h===0?0:c.rect.element.marginBottom;var k=w+x+b.visual+E;var I=w+x+b.bounds+E;c.translateY=Math.max(0,w-c.rect.element.marginTop)-_.top;if(d){var T=i.rect.element.width;var S=T*d;if(d!==i.ref.previousAspectRatio){i.ref.previousAspectRatio=d;i.ref.updateHistory=[]}var A=i.ref.updateHistory;A.push(T);var C=2;if(A.length>C*2){var M=A.length;var D=M-10;var L=0;for(var O=M;O>=D;O--){if(A[O]===A[O-2]){L++}if(L>=C){return}}}u.scalable=false;u.height=S;var P=S-w-(E-_.bottom)-(g?x:0);if(b.visual>P){c.overflow=P}else{c.overflow=null}i.height=S}else if(r.fixedHeight){u.scalable=false;var R=r.fixedHeight-w-(E-_.bottom)-(g?x:0);if(b.visual>R){c.overflow=R}else{c.overflow=null}}else if(r.cappedHeight){var N=k>=r.cappedHeight;var F=Math.min(r.cappedHeight,k);u.scalable=true;u.height=N?F:F-_.top-_.bottom;var G=F-w-(E-_.bottom)-(g?x:0);if(k>r.cappedHeight&&b.visual>G){c.overflow=G}else{c.overflow=null}i.height=Math.min(r.cappedHeight,I-_.top-_.bottom)}else{var z=h>0?_.top+_.bottom:0;u.scalable=true;u.height=Math.max(y,k-z);i.height=Math.max(y,I-z)}if(i.ref.credits&&u.heightCurrent)i.ref.credits.style.transform="translateY("+u.heightCurrent+"px)"};var Rr=function e(t){var i=t.ref.list.childViews[0].childViews[0];return i?{top:i.rect.element.marginTop,bottom:i.rect.element.marginBottom}:{top:0,bottom:0}};var Nr=function e(t){var i=0;var n=0;var a=t.ref.list;var r=a.childViews[0];var o=r.childViews.filter((function(e){return e.rect.element.height}));var s=t.query("GET_ACTIVE_ITEMS").map((function(e){return o.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));if(s.length===0)return{visual:i,bounds:n};var l=r.rect.element.width;var c=An(r,s,a.dragCoordinates);var u=s[0].rect.element;var d=u.marginTop+u.marginBottom;var p=u.marginLeft+u.marginRight;var h=u.width+p;var f=u.height+d;var g=typeof c!=="undefined"&&c>=0?1:0;var m=s.find((function(e){return e.markedForRemoval&&e.opacity<.45}))?-1:0;var v=s.length+g+m;var _=Sn(l,h);if(_===1){s.forEach((function(e){var t=e.rect.element.height+d;n+=t;i+=t*e.opacity}))}else{n=Math.ceil(v/_)*f;i=n}return{visual:i,bounds:n}};var Fr=function e(t){var i=t.ref.measureHeight||null;var n=parseInt(t.style.maxHeight,10)||null;var a=i===0?null:i;return{cappedHeight:n,fixedHeight:a}};var Gr=function e(t,i){var n=t.query("GET_ALLOW_REPLACE");var a=t.query("GET_ALLOW_MULTIPLE");var r=t.query("GET_TOTAL_ITEMS");var o=t.query("GET_MAX_FILES");var s=i.length;if(!a&&s>1){t.dispatch("DID_THROW_MAX_FILES",{source:i,error:qt("warning",0,"Max files")});return true}o=a?o:1;if(!a&&n){return false}var l=ne(o);if(l&&r+s>o){t.dispatch("DID_THROW_MAX_FILES",{source:i,error:qt("warning",0,"Max files")});return true}return false};var zr=function e(t,i,n){var a=t.childViews[0];return An(a,i,{left:n.scopeLeft-a.rect.element.left,top:n.scopeTop-(t.rect.outer.top+t.rect.element.marginTop+t.rect.element.scrollTop)})};var Br=function e(t){var i=t.query("GET_ALLOW_DROP");var n=t.query("GET_DISABLED");var a=i&&!n;if(a&&!t.ref.hopper){var r=lr(t.element,(function(e){var i=t.query("GET_BEFORE_DROP_FILE")||function(){return true};var n=t.query("GET_DROP_VALIDATION");return n?e.every((function(e){return Ke("ALLOW_HOPPER_ITEM",e,{query:t.query}).every((function(e){return e===true}))&&i(e)})):true}),{filterItems:function e(i){var n=t.query("GET_IGNORED_FILES");return i.filter((function(e){if(ii(e)){return!n.includes(e.name.toLowerCase())}return true}))},catchesDropsOnPage:t.query("GET_DROP_ON_PAGE"),requiresDropOnElement:t.query("GET_DROP_ON_ELEMENT")});r.onload=function(e,i){var n=t.ref.list.childViews[0];var a=n.childViews.filter((function(e){return e.rect.element.height}));var r=t.query("GET_ACTIVE_ITEMS").map((function(e){return a.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));Xe("ADD_ITEMS",e,{dispatch:t.dispatch}).then((function(e){if(Gr(t,e))return false;t.dispatch("ADD_ITEMS",{items:e,index:zr(t.ref.list,r,i),interactionMethod:Te.DROP})}));t.dispatch("DID_DROP",{position:i});t.dispatch("DID_END_DRAG",{position:i})};r.ondragstart=function(e){t.dispatch("DID_START_DRAG",{position:e})};r.ondrag=Mr((function(e){t.dispatch("DID_DRAG",{position:e})}));r.ondragend=function(e){t.dispatch("DID_END_DRAG",{position:e})};t.ref.hopper=r;t.ref.drip=t.appendChildView(t.createChildView(va))}else if(!a&&t.ref.hopper){t.ref.hopper.destroy();t.ref.hopper=null;t.removeChildView(t.ref.drip)}};var qr=function e(t,i){var n=t.query("GET_ALLOW_BROWSE");var a=t.query("GET_DISABLED");var r=n&&!a;if(r&&!t.ref.browser){t.ref.browser=t.appendChildView(t.createChildView(ra,Object.assign({},i,{onload:function e(i){Xe("ADD_ITEMS",i,{dispatch:t.dispatch}).then((function(e){if(Gr(t,e))return false;t.dispatch("ADD_ITEMS",{items:e,index:-1,interactionMethod:Te.BROWSE})}))}})),0)}else if(!r&&t.ref.browser){t.removeChildView(t.ref.browser);t.ref.browser=null}};var Hr=function e(t){var i=t.query("GET_ALLOW_PASTE");var n=t.query("GET_DISABLED");var a=i&&!n;if(a&&!t.ref.paster){t.ref.paster=fr();t.ref.paster.onload=function(e){Xe("ADD_ITEMS",e,{dispatch:t.dispatch}).then((function(e){if(Gr(t,e))return false;t.dispatch("ADD_ITEMS",{items:e,index:-1,interactionMethod:Te.PASTE})}))}}else if(!a&&t.ref.paster){t.ref.paster.destroy();t.ref.paster=null}};var Ur=U({DID_SET_ALLOW_BROWSE:function e(t){var i=t.root,n=t.props;qr(i,n)},DID_SET_ALLOW_DROP:function e(t){var i=t.root;Br(i)},DID_SET_ALLOW_PASTE:function e(t){var i=t.root;Hr(i)},DID_SET_DISABLED:function e(t){var i=t.root,n=t.props;Br(i);Hr(i);qr(i,n);var a=i.query("GET_DISABLED");if(a){i.element.dataset.disabled="disabled"}else{i.element.removeAttribute("data-disabled")}}});var Vr=q({name:"root",read:function e(t){var i=t.root;if(i.ref.measure){i.ref.measureHeight=i.ref.measure.offsetHeight}},create:Or,write:Pr,destroy:function e(t){var i=t.root;if(i.ref.paster){i.ref.paster.destroy()}if(i.ref.hopper){i.ref.hopper.destroy()}i.element.removeEventListener("touchmove",Lr);i.element.removeEventListener("gesturestart",Lr)},mixins:{styles:["height"]}});var jr=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=null;var a=$e();var o=i(we(a),[ft,Ie(a)],[mi,ke(a)]);o.dispatch("SET_OPTIONS",{options:t});var s=function e(){if(document.hidden)return;o.dispatch("KICK")};document.addEventListener("visibilitychange",s);var l=null;var c=false;var u=false;var d=null;var p=null;var h=function e(){if(!c){c=true}clearTimeout(l);l=setTimeout((function(){c=false;d=null;p=null;if(u){u=false;o.dispatch("DID_STOP_RESIZE")}}),500)};window.addEventListener("resize",h);var f=Vr(o,{id:Se()});var g=false;var m=false;var v={_read:function e(){if(c){p=window.innerWidth;if(!d){d=p}if(!u&&p!==d){o.dispatch("DID_START_RESIZE");u=true}}if(m&&g){g=f.element.offsetParent===null}if(g)return;f._read();m=f.rect.element.hidden},_write:function e(t){var i=o.processActionQueue().filter((function(e){return!/^SET_/.test(e.type)}));if(g&&!i.length)return;x(i);g=f._write(t,i,u);Be(o.query("GET_ITEMS"));if(g){o.processDispatchQueue()}}};var _=function e(t){return function(e){var i={type:t};if(!e){return i}if(e.hasOwnProperty("error")){i.error=e.error?Object.assign({},e.error):null}if(e.status){i.status=Object.assign({},e.status)}if(e.file){i.output=e.file}if(e.source){i.file=e.source}else if(e.item||e.id){var n=e.item?e.item:o.query("GET_ITEM",e.id);i.file=n?ze(n):null}if(e.items){i.items=e.items.map(ze)}if(/progress/.test(t)){i.progress=e.progress}if(e.hasOwnProperty("origin")&&e.hasOwnProperty("target")){i.origin=e.origin;i.target=e.target}return i}};var b={DID_DESTROY:_("destroy"),DID_INIT:_("init"),DID_THROW_MAX_FILES:_("warning"),DID_INIT_ITEM:_("initfile"),DID_START_ITEM_LOAD:_("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:_("addfileprogress"),DID_LOAD_ITEM:_("addfile"),DID_THROW_ITEM_INVALID:[_("error"),_("addfile")],DID_THROW_ITEM_LOAD_ERROR:[_("error"),_("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[_("error"),_("removefile")],DID_PREPARE_OUTPUT:_("preparefile"),DID_START_ITEM_PROCESSING:_("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:_("processfileprogress"),DID_ABORT_ITEM_PROCESSING:_("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:_("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:_("processfiles"),DID_REVERT_ITEM_PROCESSING:_("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[_("error"),_("processfile")],DID_REMOVE_ITEM:_("removefile"),DID_UPDATE_ITEMS:_("updatefiles"),DID_ACTIVATE_ITEM:_("activatefile"),DID_REORDER_ITEMS:_("reorderfiles")};var y=function e(t){var i=Object.assign({pond:R},t);delete i.type;f.element.dispatchEvent(new CustomEvent("FilePond:"+t.type,{detail:i,bubbles:true,cancelable:true,composed:true}));var n=[];if(t.hasOwnProperty("error")){n.push(t.error)}if(t.hasOwnProperty("file")){n.push(t.file)}var a=["type","error","file"];Object.keys(t).filter((function(e){return!a.includes(e)})).forEach((function(e){return n.push(t[e])}));R.fire.apply(R,[t.type].concat(n));var r=o.query("GET_ON"+t.type.toUpperCase());if(r){r.apply(void 0,n)}};var x=function e(t){if(!t.length)return;t.filter((function(e){return b[e.type]})).forEach((function(e){var t=b[e.type];(Array.isArray(t)?t:[t]).forEach((function(t){if(e.type==="DID_INIT_ITEM"){y(t(e.data))}else{setTimeout((function(){y(t(e.data))}),0)}}))}))};var E=function e(t){return o.dispatch("SET_OPTIONS",{options:t})};var k=function e(t){return o.query("GET_ACTIVE_ITEM",t)};var I=function e(t){return new Promise((function(e,i){o.dispatch("REQUEST_ITEM_PREPARE",{query:t,success:function t(i){e(i)},failure:function e(t){i(t)}})}))};var T=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise((function(e,n){C([{source:t,options:i}],{index:i.index}).then((function(t){return e(t&&t[0])})).catch(n)}))};var S=function e(t){return t.file&&t.id};var A=function e(t,i){if(typeof t==="object"&&!S(t)&&!i){i=t;t=undefined}o.dispatch("REMOVE_ITEM",Object.assign({},i,{query:t}));return o.query("GET_ACTIVE_ITEM",t)===null};var C=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}return new Promise((function(e,t){var n=[];var a={};if(Y(i[0])){n.push.apply(n,i[0]);Object.assign(a,i[1]||{})}else{var r=i[i.length-1];if(typeof r==="object"&&!(r instanceof Blob)){Object.assign(a,i.pop())}n.push.apply(n,i)}o.dispatch("ADD_ITEMS",{items:n,index:a.index,interactionMethod:Te.API,success:e,failure:t})}))};var M=function e(){return o.query("GET_ACTIVE_ITEMS")};var D=function e(t){return new Promise((function(e,i){o.dispatch("REQUEST_ITEM_PROCESSING",{query:t,success:function t(i){e(i)},failure:function e(t){i(t)}})}))};var L=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}var a=Array.isArray(i[0])?i[0]:i;var r=a.length?a:M();return Promise.all(r.map(I))};var O=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}var a=Array.isArray(i[0])?i[0]:i;if(!a.length){var r=M().filter((function(e){return!(e.status===qe.IDLE&&e.origin===He.LOCAL)&&e.status!==qe.PROCESSING&&e.status!==qe.PROCESSING_COMPLETE&&e.status!==qe.PROCESSING_REVERT_ERROR}));return Promise.all(r.map(D))}return Promise.all(a.map(D))};var P=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}var a=Array.isArray(i[0])?i[0]:i;var r;if(typeof a[a.length-1]==="object"){r=a.pop()}else if(Array.isArray(i[0])){r=i[1]}var o=M();if(!a.length)return Promise.all(o.map((function(e){return A(e,r)})));var s=a.map((function(e){return w(e)?o[e]?o[e].id:null:e})).filter((function(e){return e}));return s.map((function(e){return A(e,r)}))};var R=Object.assign({},Ne(),{},v,{},Ee(o,a),{setOptions:E,addFile:T,addFiles:C,getFile:k,processFile:D,prepareFile:I,removeFile:A,moveFile:function e(t,i){return o.dispatch("MOVE_ITEM",{query:t,index:i})},getFiles:M,processFiles:O,removeFiles:P,prepareFiles:L,sort:function e(t){return o.dispatch("SORT",{compare:t})},browse:function e(){var t=f.element.querySelector("input[type=file]");if(t){t.click()}},destroy:function e(){R.fire("destroy",f.element);o.dispatch("ABORT_ALL");f._destroy();window.removeEventListener("resize",h);document.removeEventListener("visibilitychange",s);o.dispatch("DID_DESTROY")},insertBefore:function e(t){return V(f.element,t)},insertAfter:function e(t){return j(f.element,t)},appendTo:function e(t){return t.appendChild(f.element)},replaceElement:function e(t){V(f.element,t);t.parentNode.removeChild(t);n=t},restoreElement:function e(){if(!n){return}j(n,f.element);f.element.parentNode.removeChild(f.element);n=null},isAttachedTo:function e(t){return f.element===t||n===t},element:{get:function e(){return f.element}},status:{get:function e(){return o.query("GET_STATUS")}}});o.dispatch("DID_INIT");return r(R)};var Yr=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var i={};a($e(),(function(e,t){i[e]=t[0]}));var n=jr(Object.assign({},i,{},t));return n};var Wr=function e(t){return t.charAt(0).toLowerCase()+t.slice(1)};var Xr=function e(t){return Cr(t.replace(/^data-/,""))};var Kr=function e(t,i){a(i,(function(i,n){a(t,(function(e,a){var r=new RegExp(i);var o=r.test(e);if(!o){return}delete t[e];if(n===false){return}if(J(n)){t[n]=a;return}var s=n.group;if(pe(n)&&!t[s]){t[s]={}}t[s][Wr(e.replace(r,""))]=a}));if(n.mapping){e(t[n.group],n.mapping)}}))};var Zr=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=[];a(t.attributes,(function(e){n.push(t.attributes[e])}));var r=n.filter((function(e){return e.name})).reduce((function(e,i){var n=o(t,i.name);e[Xr(i.name)]=n===i.name?true:n;return e}),{});Kr(r,i);return r};var Qr=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n={"^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$":false,"^files$":false};Ke("SET_ATTRIBUTE_TO_OPTION_MAP",n);var a=Object.assign({},i);var r=Zr(t.nodeName==="FIELDSET"?t.querySelector("input[type=file]"):t,n);Object.keys(r).forEach((function(e){if(pe(r[e])){if(!pe(a[e])){a[e]={}}Object.assign(a[e],r[e])}else{a[e]=r[e]}}));a.files=(i.files||[]).concat(Array.from(t.querySelectorAll("input:not([type=file])")).map((function(e){return{source:e.value,options:{type:e.dataset.type}}})));var o=Yr(a);if(t.files){Array.from(t.files).forEach((function(e){o.addFile(e)}))}o.replaceElement(t);return o};var $r=function e(){return t(arguments.length<=0?undefined:arguments[0])?Qr.apply(void 0,arguments):Yr.apply(void 0,arguments)};var Jr=["fire","_read","_write"];var eo=function e(t){var i={};Fe(t,i,Jr);return i};var to=function e(t,i){return t.replace(/(?:{([a-zA-Z]+)})/g,(function(e,t){return i[t]}))};var io=function e(t){var i=new Blob(["(",t.toString(),")()"],{type:"application/javascript"});var n=URL.createObjectURL(i);var a=new Worker(n);return{transfer:function e(t,i){},post:function e(t,i,n){var r=Se();a.onmessage=function(e){if(e.data.id===r){i(e.data.message)}};a.postMessage({id:r,message:t},n)},terminate:function e(){a.terminate();URL.revokeObjectURL(n)}}};var no=function e(t){return new Promise((function(e,i){var n=new Image;n.onload=function(){e(n)};n.onerror=function(e){i(e)};n.src=t}))};var ao=function e(t,i){var n=t.slice(0,t.size,t.type);n.lastModifiedDate=t.lastModifiedDate;n.name=i;return n};var ro=function e(t){return ao(t,t.name)};var oo=[];var so=function e(t){if(oo.includes(t)){return}oo.push(t);var i=t({addFilter:Ze,utils:{Type:Ye,forin:a,isString:J,isFile:ii,toNaturalFileSize:Mi,replaceInString:to,getExtensionFromFilename:wt,getFilenameWithoutExtension:ei,guesstimateMimeType:Ra,getFileFromBlob:It,getFilenameFromURL:yt,createRoute:U,createWorker:io,createView:q,createItemAPI:ze,loadImage:no,copyFile:ro,renameFile:ao,createBlob:St,applyFilterChain:Xe,text:yi,getNumericAspectRatioFromString:it},views:{fileActionButton:Ci}});Qe(i.options)};var lo=function e(){return Object.prototype.toString.call(window.operamini)==="[object OperaMini]"};var co=function e(){return"Promise"in window};var uo=function e(){return"slice"in Blob.prototype};var po=function e(){return"URL"in window&&"createObjectURL"in window.URL};var ho=function e(){return"visibilityState"in document};var fo=function e(){return"performance"in window};var go=function e(){return"supports"in(window.CSS||{})};var mo=function e(){return/MSIE|Trident/.test(window.navigator.userAgent)};var vo=function(){var e=g()&&!lo()&&ho()&&co()&&uo()&&po()&&fo()&&(go()||mo());return function(){return e}}();var _o={apps:[]};var bo="filepond";var yo=function e(){};e.Status={};e.FileStatus={};e.FileOrigin={};e.OptionTypes={};e.create=yo;e.destroy=yo;e.parse=yo;e.find=yo;e.registerPlugin=yo;e.getOptions=yo;e.setOptions=yo;if(vo()){H((function(){_o.apps.forEach((function(e){return e._read()}))}),(function(e){_o.apps.forEach((function(t){return t._write(e)}))}));var wo=function t(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:vo,create:e.create,destroy:e.destroy,parse:e.parse,find:e.find,registerPlugin:e.registerPlugin,setOptions:e.setOptions}}));document.removeEventListener("DOMContentLoaded",t)};if(document.readyState!=="loading"){setTimeout((function(){return wo()}),0)}else{document.addEventListener("DOMContentLoaded",wo)}var xo=function t(){return a($e(),(function(t,i){e.OptionTypes[t]=i[1]}))};e.Status=Object.assign({},at);e.FileOrigin=Object.assign({},He);e.FileStatus=Object.assign({},qe);e.OptionTypes={};xo();e.create=function t(){var i=$r.apply(void 0,arguments);i.on("destroy",e.destroy);_o.apps.push(i);return eo(i)};e.destroy=function e(t){var i=_o.apps.findIndex((function(e){return e.isAttachedTo(t)}));if(i>=0){var n=_o.apps.splice(i,1)[0];n.restoreElement();return true}return false};e.parse=function t(i){var n=Array.from(i.querySelectorAll("."+bo));var a=n.filter((function(e){return!_o.apps.find((function(t){return t.isAttachedTo(e)}))}));return a.map((function(t){return e.create(t)}))};e.find=function e(t){var i=_o.apps.find((function(e){return e.isAttachedTo(t)}));if(!i){return null}return eo(i)};e.registerPlugin=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}i.forEach(so);xo()};e.getOptions=function e(){var t={};a($e(),(function(e,i){t[e]=i[0]}));return t};e.setOptions=function t(i){if(pe(i)){_o.apps.forEach((function(e){e.setOptions(i)}));Je(i)}return e.getOptions()}}e.supported=vo;Object.defineProperty(e,"__esModule",{value:true})}))}));var filepondPluginFileValidateSize=createCommonjsModule((function(e,t){
|
|
18
18
|
/*!
|
|
19
19
|
* FilePondPluginFileValidateSize 2.2.7
|
|
20
20
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
@@ -32,7 +32,7 @@ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function a(e){return e ins
|
|
|
32
32
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
33
33
|
* Please visit https://pqina.nl/filepond/ for details.
|
|
34
34
|
*/
|
|
35
|
-
(function(t,i){e.exports=i()})(commonjsGlobal,(function(){var e=function e(t){return/^image/.test(t.type)};function t(e,t){return i(e)||n(e,t)||a()}function i(e){if(Array.isArray(e))return e}function n(e,t){var i=[];var n=true;var a=false;var r=undefined;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done);n=true){i.push(s.value);if(t&&i.length===t)break}}catch(e){a=true;r=e}finally{try{if(!n&&o["return"]!=null)o["return"]()}finally{if(a)throw r}}return i}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var r=function e(t,i){return c(t.x*i,t.y*i)};var o=function e(t,i){return c(t.x+i.x,t.y+i.y)};var s=function e(t){var i=Math.sqrt(t.x*t.x+t.y*t.y);if(i===0){return{x:0,y:0}}return c(t.x/i,t.y/i)};var l=function e(t,i,n){var a=Math.cos(i);var r=Math.sin(i);var o=c(t.x-n.x,t.y-n.y);return c(n.x+a*o.x-r*o.y,n.y+r*o.x+a*o.y)};var c=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return{x:t,y:i}};var u=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=arguments.length>3?arguments[3]:undefined;if(typeof t==="string"){return parseFloat(t)*n}if(typeof t==="number"){return t*(a?i[a]:Math.min(i.width,i.height))}return};var d=function e(t,i,n){var a=t.borderStyle||t.lineStyle||"solid";var r=t.backgroundColor||t.fontColor||"transparent";var o=t.borderColor||t.lineColor||"transparent";var s=u(t.borderWidth||t.lineWidth,i,n);var l=t.lineCap||"round";var c=t.lineJoin||"round";var d=typeof a==="string"?"":a.map((function(e){return u(e,i,n)})).join(",");var p=t.opacity||1;return{"stroke-linecap":l,"stroke-linejoin":c,"stroke-width":s||0,"stroke-dasharray":d,stroke:o,fill:r,opacity:p}};var p=function e(t){return t!=null};var h=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=u(t.x,i,n,"width")||u(t.left,i,n,"width");var r=u(t.y,i,n,"height")||u(t.top,i,n,"height");var o=u(t.width,i,n,"width");var s=u(t.height,i,n,"height");var l=u(t.right,i,n,"width");var c=u(t.bottom,i,n,"height");if(!p(r)){if(p(s)&&p(c)){r=i.height-s-c}else{r=c}}if(!p(a)){if(p(o)&&p(l)){a=i.width-o-l}else{a=l}}if(!p(o)){if(p(a)&&p(l)){o=i.width-a-l}else{o=0}}if(!p(s)){if(p(r)&&p(c)){s=i.height-r-c}else{s=0}}return{x:a||0,y:r||0,width:o||0,height:s||0}};var f=function e(t){return t.map((function(e,t){return"".concat(t===0?"M":"L"," ").concat(e.x," ").concat(e.y)})).join(" ")};var g=function e(t,i){return Object.keys(i).forEach((function(e){return t.setAttribute(e,i[e])}))};var m="http://www.w3.org/2000/svg";var v=function e(t,i){var n=document.createElementNS(m,t);if(i){g(n,i)}return n};var _=function e(t){return g(t,Object.assign({},t.rect,t.styles))};var b=function e(t){var i=t.rect.x+t.rect.width*.5;var n=t.rect.y+t.rect.height*.5;var a=t.rect.width*.5;var r=t.rect.height*.5;return g(t,Object.assign({cx:i,cy:n,rx:a,ry:r},t.styles))};var y={contain:"xMidYMid meet",cover:"xMidYMid slice"};var w=function e(t,i){g(t,Object.assign({},t.rect,t.styles,{preserveAspectRatio:y[i.fit]||"none"}))};var x={left:"start",center:"middle",right:"end"};var E=function e(t,i,n,a){var r=u(i.fontSize,n,a);var o=i.fontFamily||"sans-serif";var s=i.fontWeight||"normal";var l=x[i.textAlign]||"start";g(t,Object.assign({},t.rect,t.styles,{"stroke-width":0,"font-weight":s,"font-size":r,"font-family":o,"text-anchor":l}));if(t.text!==i.text){t.text=i.text;t.textContent=i.text.length?i.text:" "}};var k=function e(t,i,n,a){g(t,Object.assign({},t.rect,t.styles,{fill:"none"}));var c=t.childNodes[0];var d=t.childNodes[1];var p=t.childNodes[2];var h=t.rect;var f={x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height};g(c,{x1:h.x,y1:h.y,x2:f.x,y2:f.y});if(!i.lineDecoration)return;d.style.display="none";p.style.display="none";var m=s({x:f.x-h.x,y:f.y-h.y});var v=u(.05,n,a);if(i.lineDecoration.indexOf("arrow-begin")!==-1){var _=r(m,v);var b=o(h,_);var y=l(h,2,b);var w=l(h,-2,b);g(d,{style:"display:block;",d:"M".concat(y.x,",").concat(y.y," L").concat(h.x,",").concat(h.y," L").concat(w.x,",").concat(w.y)})}if(i.lineDecoration.indexOf("arrow-end")!==-1){var x=r(m,-v);var E=o(f,x);var k=l(f,2,E);var I=l(f,-2,E);g(p,{style:"display:block;",d:"M".concat(k.x,",").concat(k.y," L").concat(f.x,",").concat(f.y," L").concat(I.x,",").concat(I.y)})}};var I=function e(t,i,n,a){g(t,Object.assign({},t.styles,{fill:"none",d:f(i.points.map((function(e){return{x:u(e.x,n,a,"width"),y:u(e.y,n,a,"height")}})))}))};var T=function e(t){return function(e){return v(t,{id:e.id})}};var S=function e(t){var i=v("image",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});i.onload=function(){i.setAttribute("opacity",t.opacity||1)};i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.src);return i};var A=function e(t){var i=v("g",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round"});var n=v("line");i.appendChild(n);var a=v("path");i.appendChild(a);var r=v("path");i.appendChild(r);return i};var C={image:S,rect:T("rect"),ellipse:T("ellipse"),text:T("text"),path:T("path"),line:A};var M={rect:_,ellipse:b,image:w,text:E,path:I,line:k};var D=function e(t,i){return C[t](i)};var L=function e(t,i,n,a,r){if(i!=="path"){t.rect=h(n,a,r)}t.styles=d(n,a,r);M[i](t,n,a,r)};var O=["x","y","left","top","right","bottom","width","height"];var P=function e(t){return typeof t==="string"&&/%/.test(t)?parseFloat(t)/100:t};var R=function e(i){var n=t(i,2),a=n[0],r=n[1];var o=r.points?{}:O.reduce((function(e,t){e[t]=P(r[t]);return e}),{});return[a,Object.assign({zIndex:0},r,o)]};var N=function e(t,i){if(t[1].zIndex>i[1].zIndex){return 1}if(t[1].zIndex<i[1].zIndex){return-1}return 0};var F=function e(i){return i.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:true,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function e(i){var n=i.root,a=i.props;if(!a.dirty)return;var r=a.crop,o=a.resize,s=a.markup;var l=a.width;var c=a.height;var u=r.width;var d=r.height;if(o){var p=o.size;var h=p&&p.width;var f=p&&p.height;var g=o.mode;var m=o.upscale;if(h&&!f)f=h;if(f&&!h)h=f;var v=u<h&&d<f;if(!v||v&&m){var _=h/u;var b=f/d;if(g==="force"){u=h;d=f}else{var y;if(g==="cover"){y=Math.max(_,b)}else if(g==="contain"){y=Math.min(_,b)}u=u*y;d=d*y}}}var w={width:l,height:c};n.element.setAttribute("width",w.width);n.element.setAttribute("height",w.height);var x=Math.min(l/u,c/d);n.element.innerHTML="";var E=n.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");s.filter(E).map(R).sort(N).forEach((function(e){var i=t(e,2),a=i[0],r=i[1];var o=D(a,r);L(o,a,r,w,x);n.element.appendChild(o)}))}})};var G=function e(t,i){return{x:t,y:i}};var z=function e(t,i){return t.x*i.x+t.y*i.y};var B=function e(t,i){return G(t.x-i.x,t.y-i.y)};var q=function e(t,i){return z(B(t,i),B(t,i))};var U=function e(t,i){return Math.sqrt(q(t,i))};var H=function e(t,i){var n=t;var a=1.5707963267948966;var r=i;var o=1.5707963267948966-i;var s=Math.sin(a);var l=Math.sin(r);var c=Math.sin(o);var u=Math.cos(o);var d=n/s;var p=d*l;var h=d*c;return G(u*p,u*h)};var V=function e(t,i){var n=t.width;var a=t.height;var r=H(n,i);var o=H(a,i);var s=G(t.x+Math.abs(r.x),t.y-Math.abs(r.y));var l=G(t.x+t.width+Math.abs(o.y),t.y+Math.abs(o.x));var c=G(t.x-Math.abs(o.y),t.y+t.height-Math.abs(o.x));return{width:U(s,l),height:U(s,c)}};var j=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=t.height/t.width;var r=1;var o=i;var s=1;var l=a;if(l>o){l=o;s=l/a}var c=Math.max(r/s,o/l);var u=t.width/(n*c*s);var d=u*i;return{width:u,height:d}};var Y=function e(t,i,n,a){var r=a.x>.5?1-a.x:a.x;var o=a.y>.5?1-a.y:a.y;var s=r*2*t.width;var l=o*2*t.height;var c=V(i,n);return Math.max(c.width/s,c.height/l)};var W=function e(t,i){var n=t.width;var a=n*i;if(a>t.height){a=t.height;n=a/i}var r=(t.width-n)*.5;var o=(t.height-a)*.5;return{x:r,y:o,width:n,height:a}};var X=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=i.zoom,a=i.rotation,r=i.center,o=i.aspectRatio;if(!o)o=t.height/t.width;var s=j(t,o,n);var l={x:s.width*.5,y:s.height*.5};var c={x:0,y:0,width:s.width,height:s.height,center:l};var u=typeof i.scaleToFit==="undefined"||i.scaleToFit;var d=Y(t,W(c,o),a,u?r:{x:.5,y:.5});var p=n*d;return{widthFloat:s.width/p,heightFloat:s.height/p,width:Math.round(s.width/p),height:Math.round(s.height/p)}};var K={type:"spring",stiffness:.5,damping:.45,mass:10};var Z=function e(t){return t.utils.createView({name:"image-bitmap",ignoreRect:true,mixins:{styles:["scaleX","scaleY"]},create:function e(t){var i=t.root,n=t.props;i.appendChild(n.image)}})};var Q=function e(t){return t.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:true,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:K,originY:K,scaleX:K,scaleY:K,translateX:K,translateY:K,rotateZ:K}},create:function e(i){var n=i.root,a=i.props;a.width=a.image.width;a.height=a.image.height;n.ref.bitmap=n.appendChildView(n.createChildView(Z(t),{image:a.image}))},write:function e(t){var i=t.root,n=t.props;var a=n.crop.flip;var r=i.ref.bitmap;r.scaleX=a.horizontal?-1:1;r.scaleY=a.vertical?-1:1}})};var $=function e(t){return t.utils.createView({name:"image-clip",tag:"div",ignoreRect:true,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function e(t){var i=t.root,n=t.props;if(!n.background)return;i.element.style.backgroundColor=n.background},create:function e(i){var n=i.root,a=i.props;n.ref.image=n.appendChildView(n.createChildView(Q(t),Object.assign({},a)));n.ref.createMarkup=function(){if(n.ref.markup)return;n.ref.markup=n.appendChildView(n.createChildView(F(t),Object.assign({},a)))};n.ref.destroyMarkup=function(){if(!n.ref.markup)return;n.removeChildView(n.ref.markup);n.ref.markup=null};var r=n.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");if(r===null)return;if(r==="grid"){n.element.dataset.transparencyIndicator=r}else{n.element.dataset.transparencyIndicator="color"}},write:function e(t){var i=t.root,n=t.props,a=t.shouldOptimize;var r=n.crop,o=n.markup,s=n.resize,l=n.dirty,c=n.width,u=n.height;i.ref.image.crop=r;var d={x:0,y:0,width:c,height:u,center:{x:c*.5,y:u*.5}};var p={width:i.ref.image.width,height:i.ref.image.height};var h={x:r.center.x*p.width,y:r.center.y*p.height};var f={x:d.center.x-p.width*r.center.x,y:d.center.y-p.height*r.center.y};var g=Math.PI*2+r.rotation%(Math.PI*2);var m=r.aspectRatio||p.height/p.width;var v=typeof r.scaleToFit==="undefined"||r.scaleToFit;var _=Y(p,W(d,m),g,v?r.center:{x:.5,y:.5});var b=r.zoom*_;if(o&&o.length){i.ref.createMarkup();i.ref.markup.width=c;i.ref.markup.height=u;i.ref.markup.resize=s;i.ref.markup.dirty=l;i.ref.markup.markup=o;i.ref.markup.crop=X(p,r)}else if(i.ref.markup){i.ref.destroyMarkup()}var y=i.ref.image;if(a){y.originX=null;y.originY=null;y.translateX=null;y.translateY=null;y.rotateZ=null;y.scaleX=null;y.scaleY=null;return}y.originX=h.x;y.originY=h.y;y.translateX=f.x;y.translateY=f.y;y.rotateZ=g;y.scaleX=b;y.scaleY=b}})};var J=function e(t){return t.utils.createView({name:"image-preview",tag:"div",ignoreRect:true,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:K,scaleY:K,translateY:K,opacity:{type:"tween",duration:400}}},create:function e(i){var n=i.root,a=i.props;n.ref.clip=n.appendChildView(n.createChildView($(t),{id:a.id,image:a.image,crop:a.crop,markup:a.markup,resize:a.resize,dirty:a.dirty,background:a.background}))},write:function e(t){var i=t.root,n=t.props,a=t.shouldOptimize;var r=i.ref.clip;var o=n.image,s=n.crop,l=n.markup,c=n.resize,u=n.dirty;r.crop=s;r.markup=l;r.resize=c;r.dirty=u;r.opacity=a?0:1;if(a||i.rect.element.hidden)return;var d=o.height/o.width;var p=s.aspectRatio||d;var h=i.rect.inner.width;var f=i.rect.inner.height;var g=i.query("GET_IMAGE_PREVIEW_HEIGHT");var m=i.query("GET_IMAGE_PREVIEW_MIN_HEIGHT");var v=i.query("GET_IMAGE_PREVIEW_MAX_HEIGHT");var _=i.query("GET_PANEL_ASPECT_RATIO");var b=i.query("GET_ALLOW_MULTIPLE");if(_&&!b){g=h*_;p=_}var y=g!==null?g:Math.max(m,Math.min(h*p,v));var w=y/p;if(w>h){w=h;y=w*p}if(y>f){y=f;w=f/p}r.width=w;r.height=y}})};var ee='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';var te=0;var ie=function e(t){return t.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:true,create:function e(t){var i=t.root,n=t.props;var a=ee;if(document.querySelector("base")){var r=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+r+"#")}te++;i.element.classList.add("filepond--image-preview-overlay-".concat(n.status));i.element.innerHTML=a.replace(/__UID__/g,te)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}})};var ne=function e(){self.onmessage=function(e){createImageBitmap(e.data.message.file).then((function(t){self.postMessage({id:e.data.id,message:t},[t])}))}};var ae=function e(){self.onmessage=function(e){var t=e.data.message.imageData;var i=e.data.message.colorMatrix;var n=t.data;var a=n.length;var r=i[0];var o=i[1];var s=i[2];var l=i[3];var c=i[4];var u=i[5];var d=i[6];var p=i[7];var h=i[8];var f=i[9];var g=i[10];var m=i[11];var v=i[12];var _=i[13];var b=i[14];var y=i[15];var w=i[16];var x=i[17];var E=i[18];var k=i[19];var I=0,T=0,S=0,A=0,C=0;for(;I<a;I+=4){T=n[I]/255;S=n[I+1]/255;A=n[I+2]/255;C=n[I+3]/255;n[I]=Math.max(0,Math.min((T*r+S*o+A*s+C*l+c)*255,255));n[I+1]=Math.max(0,Math.min((T*u+S*d+A*p+C*h+f)*255,255));n[I+2]=Math.max(0,Math.min((T*g+S*m+A*v+C*_+b)*255,255));n[I+3]=Math.max(0,Math.min((T*y+S*w+A*x+C*E+k)*255,255))}self.postMessage({id:e.data.id,message:t},[t.data.buffer])}};var re=function e(t,i){var n=new Image;n.onload=function(){var e=n.naturalWidth;var t=n.naturalHeight;n=null;i(e,t)};n.src=t};var oe={1:function e(){return[1,0,0,1,0,0]},2:function e(t){return[-1,0,0,1,t,0]},3:function e(t,i){return[-1,0,0,-1,t,i]},4:function e(t,i){return[1,0,0,-1,0,i]},5:function e(){return[0,1,1,0,0,0]},6:function e(t,i){return[0,1,-1,0,i,0]},7:function e(t,i){return[0,-1,-1,0,i,t]},8:function e(t){return[0,-1,1,0,0,t]}};var se=function e(t,i,n,a){if(a===-1){return}t.transform.apply(t,oe[a](i,n))};var le=function e(t,i,n,a){i=Math.round(i);n=Math.round(n);var r=document.createElement("canvas");r.width=i;r.height=n;var o=r.getContext("2d");if(a>=5&&a<=8){var s=[n,i];i=s[0];n=s[1]}se(o,i,n,a);o.drawImage(t,0,0,i,n);return r};var ce=function e(t){return/^image/.test(t.type)&&!/svg/.test(t.type)};var ue=10;var de=10;var pe=function e(t){var i=Math.min(ue/t.width,de/t.height);var n=document.createElement("canvas");var a=n.getContext("2d");var r=n.width=Math.ceil(t.width*i);var o=n.height=Math.ceil(t.height*i);a.drawImage(t,0,0,r,o);var s=null;try{s=a.getImageData(0,0,r,o).data}catch(e){return null}var l=s.length;var c=0;var u=0;var d=0;var p=0;for(;p<l;p+=4){c+=s[p]*s[p];u+=s[p+1]*s[p+1];d+=s[p+2]*s[p+2]}c=he(c,l);u=he(u,l);d=he(d,l);return{r:c,g:u,b:d}};var he=function e(t,i){return Math.floor(Math.sqrt(t/(i/4)))};var fe=function e(t,i){i=i||document.createElement("canvas");i.width=t.width;i.height=t.height;var n=i.getContext("2d");n.drawImage(t,0,0);return i};var ge=function e(t){var i;try{i=new ImageData(t.width,t.height)}catch(e){var n=document.createElement("canvas");var a=n.getContext("2d");i=a.createImageData(t.width,t.height)}i.data.set(new Uint8ClampedArray(t.data));return i};var me=function e(t){return new Promise((function(e,i){var n=new Image;n.crossOrigin="Anonymous";n.onload=function(){e(n)};n.onerror=function(e){i(e)};n.src=t}))};var ve=function e(t){var i=ie(t);var n=J(t);var a=t.utils.createWorker;var r=function e(t,i,n){return new Promise((function(e){if(!t.ref.imageData){t.ref.imageData=n.getContext("2d").getImageData(0,0,n.width,n.height)}var r=ge(t.ref.imageData);if(!i||i.length!==20){n.getContext("2d").putImageData(r,0,0);return e()}var o=a(ae);o.post({imageData:r,colorMatrix:i},(function(t){n.getContext("2d").putImageData(t,0,0);o.terminate();e()}),[r.data.buffer])}))};var o=function e(t,i){t.removeChildView(i);i.image.width=1;i.image.height=1;i._destroy()};var s=function e(t){var i=t.root;var n=i.ref.images.shift();n.opacity=0;n.translateY=-15;i.ref.imageViewBin.push(n);return n};var l=function e(t){var i=t.root,a=t.props,r=t.image;var o=a.id;var s=i.query("GET_ITEM",{id:o});if(!s)return;var l=s.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:false,vertical:false},zoom:1,rotation:0,aspectRatio:null};var c=i.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR");var u;var d;var p=false;if(i.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")){u=s.getMetadata("markup")||[];d=s.getMetadata("resize");p=true}var h=i.appendChildView(i.createChildView(n,{id:o,image:r,crop:l,resize:d,markup:u,dirty:p,background:c,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),i.childViews.length);i.ref.images.push(h);h.opacity=1;h.scaleX=1;h.scaleY=1;h.translateY=0;setTimeout((function(){i.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:o})}),250)};var c=function e(t){var i=t.root,n=t.props;var a=i.query("GET_ITEM",{id:n.id});if(!a)return;var r=i.ref.images[i.ref.images.length-1];r.crop=a.getMetadata("crop");r.background=i.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR");if(i.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")){r.dirty=true;r.resize=a.getMetadata("resize");r.markup=a.getMetadata("markup")}};var u=function e(t){var i=t.root,n=t.props,a=t.action;if(!/crop|filter|markup|resize/.test(a.change.key))return;if(!i.ref.images.length)return;var o=i.query("GET_ITEM",{id:n.id});if(!o)return;if(/filter/.test(a.change.key)){var u=i.ref.images[i.ref.images.length-1];r(i,a.change.value,u.image);return}if(/crop|markup|resize/.test(a.change.key)){var d=o.getMetadata("crop");var p=i.ref.images[i.ref.images.length-1];if(d&&d.aspectRatio&&p.crop&&p.crop.aspectRatio&&Math.abs(d.aspectRatio-p.crop.aspectRatio)>1e-5){var h=s({root:i});l({root:i,props:n,image:fe(h.image)})}else{c({root:i,props:n})}}};var d=function e(t){var i=window.navigator.userAgent;var n=i.match(/Firefox\/([0-9]+)\./);var a=n?parseInt(n[1]):null;if(a<=58)return false;return"createImageBitmap"in window&&ce(t)};var p=function e(t){var i=t.root,n=t.props;var a=n.id;var r=i.query("GET_ITEM",a);if(!r)return;var o=URL.createObjectURL(r.file);re(o,(function(e,t){i.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:a,width:e,height:t})}))};var h=function e(t){var i=t.root,n=t.props;var o=n.id;var s=i.query("GET_ITEM",o);if(!s)return;var c=URL.createObjectURL(s.file);var u=function e(){me(c).then(p)};var p=function e(t){URL.revokeObjectURL(c);var a=s.getMetadata("exif")||{};var o=a.orientation||-1;var u=t.width,d=t.height;if(!u||!d)return;if(o>=5&&o<=8){var p=[d,u];u=p[0];d=p[1]}var h=Math.max(1,window.devicePixelRatio*.75);var f=i.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR");var g=f*h;var m=d/u;var v=i.rect.element.width;var _=i.rect.element.height;var b=v;var y=b*m;if(m>1){b=Math.min(u,v*g);y=b*m}else{y=Math.min(d,_*g);b=y/m}var w=le(t,b,y,o);var x=function e(){var a=i.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?pe(data):null;s.setMetadata("color",a,true);if("close"in t){t.close()}i.ref.overlayShadow.opacity=1;l({root:i,props:n,image:w})};var E=s.getMetadata("filter");if(E){r(i,E,w).then(x)}else{x()}};if(d(s.file)){var h=a(ne);h.post({file:s.file},(function(e){h.terminate();if(!e){u();return}p(e)}))}else{u()}};var f=function e(t){var i=t.root;var n=i.ref.images[i.ref.images.length-1];n.translateY=0;n.scaleX=1;n.scaleY=1;n.opacity=1};var g=function e(t){var i=t.root;i.ref.overlayShadow.opacity=1;i.ref.overlayError.opacity=0;i.ref.overlaySuccess.opacity=0};var m=function e(t){var i=t.root;i.ref.overlayShadow.opacity=.25;i.ref.overlayError.opacity=1};var v=function e(t){var i=t.root;i.ref.overlayShadow.opacity=.25;i.ref.overlaySuccess.opacity=1};var _=function e(t){var n=t.root;n.ref.images=[];n.ref.imageData=null;n.ref.imageViewBin=[];n.ref.overlayShadow=n.appendChildView(n.createChildView(i,{opacity:0,status:"idle"}));n.ref.overlaySuccess=n.appendChildView(n.createChildView(i,{opacity:0,status:"success"}));n.ref.overlayError=n.appendChildView(n.createChildView(i,{opacity:0,status:"failure"}))};return t.utils.createView({name:"image-preview-wrapper",create:_,styles:["height"],apis:["height"],destroy:function e(t){var i=t.root;i.ref.images.forEach((function(e){e.image.width=1;e.image.height=1}))},didWriteView:function e(t){var i=t.root;i.ref.images.forEach((function(e){e.dirty=false}))},write:t.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:f,DID_IMAGE_PREVIEW_CONTAINER_CREATE:p,DID_FINISH_CALCULATE_PREVIEWSIZE:h,DID_UPDATE_ITEM_METADATA:u,DID_THROW_ITEM_LOAD_ERROR:m,DID_THROW_ITEM_PROCESSING_ERROR:m,DID_THROW_ITEM_INVALID:m,DID_COMPLETE_ITEM_PROCESSING:v,DID_START_ITEM_PROCESSING:g,DID_REVERT_ITEM_PROCESSING:g},(function(e){var t=e.root;var i=t.ref.imageViewBin.filter((function(e){return e.opacity===0}));t.ref.imageViewBin=t.ref.imageViewBin.filter((function(e){return e.opacity>0}));i.forEach((function(e){return o(t,e)}));i.length=0}))})};var _e=function t(i){var n=i.addFilter,a=i.utils;var r=a.Type,o=a.createRoute,s=a.isFile;var l=ve(i);n("CREATE_VIEW",(function(t){var i=t.is,n=t.view,a=t.query;if(!i("file")||!a("GET_ALLOW_IMAGE_PREVIEW"))return;var r=function t(i){var r=i.root,o=i.props;var c=o.id;var u=a("GET_ITEM",c);if(!u||!s(u.file)||u.archived)return;var d=u.file;if(!e(d))return;if(!a("GET_IMAGE_PREVIEW_FILTER_ITEM")(u))return;var p="createImageBitmap"in(window||{});var h=a("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!p&&h&&d.size>h)return;r.ref.imagePreview=n.appendChildView(n.createChildView(l,{id:c}));var f=r.query("GET_IMAGE_PREVIEW_HEIGHT");if(f){r.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:u.id,height:f})}var g=!p&&d.size>a("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");r.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:c},g)};var c=function e(t,i){if(!t.ref.imagePreview)return;var n=i.id;var a=t.query("GET_ITEM",{id:n});if(!a)return;var r=t.query("GET_PANEL_ASPECT_RATIO");var o=t.query("GET_ITEM_PANEL_ASPECT_RATIO");var s=t.query("GET_IMAGE_PREVIEW_HEIGHT");if(r||o||s)return;var l=t.ref,c=l.imageWidth,u=l.imageHeight;if(!c||!u)return;var d=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT");var p=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT");var h=a.getMetadata("exif")||{};var f=h.orientation||-1;if(f>=5&&f<=8){var g=[u,c];c=g[0];u=g[1]}if(!ce(a.file)||t.query("GET_IMAGE_PREVIEW_UPSCALE")){var m=2048/c;c*=m;u*=m}var v=u/c;var _=(a.getMetadata("crop")||{}).aspectRatio||v;var b=Math.max(d,Math.min(u,p));var y=t.rect.element.width;var w=Math.min(y*_,b);t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:a.id,height:w})};var u=function e(t){var i=t.root;i.ref.shouldRescale=true};var d=function e(t){var i=t.root,n=t.action;if(n.change.key!=="crop")return;i.ref.shouldRescale=true};var p=function e(t){var i=t.root,n=t.action;i.ref.imageWidth=n.width;i.ref.imageHeight=n.height;i.ref.shouldRescale=true;i.ref.shouldDrawPreview=true;i.dispatch("KICK")};n.registerWriter(o({DID_RESIZE_ROOT:u,DID_STOP_RESIZE:u,DID_LOAD_ITEM:r,DID_IMAGE_PREVIEW_CALCULATE_SIZE:p,DID_UPDATE_ITEM_METADATA:d},(function(e){var t=e.root,i=e.props;if(!t.ref.imagePreview)return;if(t.rect.element.hidden)return;if(t.ref.shouldRescale){c(t,i);t.ref.shouldRescale=false}if(t.ref.shouldDrawPreview){requestAnimationFrame((function(){requestAnimationFrame((function(){t.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:i.id})}))}));t.ref.shouldDrawPreview=false}})))}));return{options:{allowImagePreview:[true,r.BOOLEAN],imagePreviewFilterItem:[function(){return true},r.FUNCTION],imagePreviewHeight:[null,r.INT],imagePreviewMinHeight:[44,r.INT],imagePreviewMaxHeight:[256,r.INT],imagePreviewMaxFileSize:[null,r.INT],imagePreviewZoomFactor:[2,r.INT],imagePreviewUpscale:[false,r.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,r.INT],imagePreviewTransparencyIndicator:[null,r.STRING],imagePreviewCalculateAverageImageColor:[false,r.BOOLEAN],imagePreviewMarkupShow:[true,r.BOOLEAN],imagePreviewMarkupFilter:[function(){return true},r.FUNCTION]}}};var be=typeof window!=="undefined"&&typeof window.document!=="undefined";if(be){document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:_e}))}return _e}))}));var FilePondPluginImagePreview=getDefaultExportFromCjs(filepondPluginImagePreview);var filepondPluginImageEdit=createCommonjsModule((function(e,t){
|
|
35
|
+
(function(t,i){e.exports=i()})(commonjsGlobal,(function(){var e=function e(t){return/^image/.test(t.type)};function t(e,t){return i(e)||n(e,t)||a()}function i(e){if(Array.isArray(e))return e}function n(e,t){var i=[];var n=true;var a=false;var r=undefined;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done);n=true){i.push(s.value);if(t&&i.length===t)break}}catch(e){a=true;r=e}finally{try{if(!n&&o["return"]!=null)o["return"]()}finally{if(a)throw r}}return i}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var r=function e(t,i){return c(t.x*i,t.y*i)};var o=function e(t,i){return c(t.x+i.x,t.y+i.y)};var s=function e(t){var i=Math.sqrt(t.x*t.x+t.y*t.y);if(i===0){return{x:0,y:0}}return c(t.x/i,t.y/i)};var l=function e(t,i,n){var a=Math.cos(i);var r=Math.sin(i);var o=c(t.x-n.x,t.y-n.y);return c(n.x+a*o.x-r*o.y,n.y+r*o.x+a*o.y)};var c=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return{x:t,y:i}};var u=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=arguments.length>3?arguments[3]:undefined;if(typeof t==="string"){return parseFloat(t)*n}if(typeof t==="number"){return t*(a?i[a]:Math.min(i.width,i.height))}return};var d=function e(t,i,n){var a=t.borderStyle||t.lineStyle||"solid";var r=t.backgroundColor||t.fontColor||"transparent";var o=t.borderColor||t.lineColor||"transparent";var s=u(t.borderWidth||t.lineWidth,i,n);var l=t.lineCap||"round";var c=t.lineJoin||"round";var d=typeof a==="string"?"":a.map((function(e){return u(e,i,n)})).join(",");var p=t.opacity||1;return{"stroke-linecap":l,"stroke-linejoin":c,"stroke-width":s||0,"stroke-dasharray":d,stroke:o,fill:r,opacity:p}};var p=function e(t){return t!=null};var h=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=u(t.x,i,n,"width")||u(t.left,i,n,"width");var r=u(t.y,i,n,"height")||u(t.top,i,n,"height");var o=u(t.width,i,n,"width");var s=u(t.height,i,n,"height");var l=u(t.right,i,n,"width");var c=u(t.bottom,i,n,"height");if(!p(r)){if(p(s)&&p(c)){r=i.height-s-c}else{r=c}}if(!p(a)){if(p(o)&&p(l)){a=i.width-o-l}else{a=l}}if(!p(o)){if(p(a)&&p(l)){o=i.width-a-l}else{o=0}}if(!p(s)){if(p(r)&&p(c)){s=i.height-r-c}else{s=0}}return{x:a||0,y:r||0,width:o||0,height:s||0}};var f=function e(t){return t.map((function(e,t){return"".concat(t===0?"M":"L"," ").concat(e.x," ").concat(e.y)})).join(" ")};var g=function e(t,i){return Object.keys(i).forEach((function(e){return t.setAttribute(e,i[e])}))};var m="http://www.w3.org/2000/svg";var v=function e(t,i){var n=document.createElementNS(m,t);if(i){g(n,i)}return n};var _=function e(t){return g(t,Object.assign({},t.rect,t.styles))};var b=function e(t){var i=t.rect.x+t.rect.width*.5;var n=t.rect.y+t.rect.height*.5;var a=t.rect.width*.5;var r=t.rect.height*.5;return g(t,Object.assign({cx:i,cy:n,rx:a,ry:r},t.styles))};var y={contain:"xMidYMid meet",cover:"xMidYMid slice"};var w=function e(t,i){g(t,Object.assign({},t.rect,t.styles,{preserveAspectRatio:y[i.fit]||"none"}))};var x={left:"start",center:"middle",right:"end"};var E=function e(t,i,n,a){var r=u(i.fontSize,n,a);var o=i.fontFamily||"sans-serif";var s=i.fontWeight||"normal";var l=x[i.textAlign]||"start";g(t,Object.assign({},t.rect,t.styles,{"stroke-width":0,"font-weight":s,"font-size":r,"font-family":o,"text-anchor":l}));if(t.text!==i.text){t.text=i.text;t.textContent=i.text.length?i.text:" "}};var k=function e(t,i,n,a){g(t,Object.assign({},t.rect,t.styles,{fill:"none"}));var c=t.childNodes[0];var d=t.childNodes[1];var p=t.childNodes[2];var h=t.rect;var f={x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height};g(c,{x1:h.x,y1:h.y,x2:f.x,y2:f.y});if(!i.lineDecoration)return;d.style.display="none";p.style.display="none";var m=s({x:f.x-h.x,y:f.y-h.y});var v=u(.05,n,a);if(i.lineDecoration.indexOf("arrow-begin")!==-1){var _=r(m,v);var b=o(h,_);var y=l(h,2,b);var w=l(h,-2,b);g(d,{style:"display:block;",d:"M".concat(y.x,",").concat(y.y," L").concat(h.x,",").concat(h.y," L").concat(w.x,",").concat(w.y)})}if(i.lineDecoration.indexOf("arrow-end")!==-1){var x=r(m,-v);var E=o(f,x);var k=l(f,2,E);var I=l(f,-2,E);g(p,{style:"display:block;",d:"M".concat(k.x,",").concat(k.y," L").concat(f.x,",").concat(f.y," L").concat(I.x,",").concat(I.y)})}};var I=function e(t,i,n,a){g(t,Object.assign({},t.styles,{fill:"none",d:f(i.points.map((function(e){return{x:u(e.x,n,a,"width"),y:u(e.y,n,a,"height")}})))}))};var T=function e(t){return function(e){return v(t,{id:e.id})}};var S=function e(t){var i=v("image",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});i.onload=function(){i.setAttribute("opacity",t.opacity||1)};i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.src);return i};var A=function e(t){var i=v("g",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round"});var n=v("line");i.appendChild(n);var a=v("path");i.appendChild(a);var r=v("path");i.appendChild(r);return i};var C={image:S,rect:T("rect"),ellipse:T("ellipse"),text:T("text"),path:T("path"),line:A};var M={rect:_,ellipse:b,image:w,text:E,path:I,line:k};var D=function e(t,i){return C[t](i)};var L=function e(t,i,n,a,r){if(i!=="path"){t.rect=h(n,a,r)}t.styles=d(n,a,r);M[i](t,n,a,r)};var O=["x","y","left","top","right","bottom","width","height"];var P=function e(t){return typeof t==="string"&&/%/.test(t)?parseFloat(t)/100:t};var R=function e(i){var n=t(i,2),a=n[0],r=n[1];var o=r.points?{}:O.reduce((function(e,t){e[t]=P(r[t]);return e}),{});return[a,Object.assign({zIndex:0},r,o)]};var N=function e(t,i){if(t[1].zIndex>i[1].zIndex){return 1}if(t[1].zIndex<i[1].zIndex){return-1}return 0};var F=function e(i){return i.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:true,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function e(i){var n=i.root,a=i.props;if(!a.dirty)return;var r=a.crop,o=a.resize,s=a.markup;var l=a.width;var c=a.height;var u=r.width;var d=r.height;if(o){var p=o.size;var h=p&&p.width;var f=p&&p.height;var g=o.mode;var m=o.upscale;if(h&&!f)f=h;if(f&&!h)h=f;var v=u<h&&d<f;if(!v||v&&m){var _=h/u;var b=f/d;if(g==="force"){u=h;d=f}else{var y;if(g==="cover"){y=Math.max(_,b)}else if(g==="contain"){y=Math.min(_,b)}u=u*y;d=d*y}}}var w={width:l,height:c};n.element.setAttribute("width",w.width);n.element.setAttribute("height",w.height);var x=Math.min(l/u,c/d);n.element.innerHTML="";var E=n.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");s.filter(E).map(R).sort(N).forEach((function(e){var i=t(e,2),a=i[0],r=i[1];var o=D(a,r);L(o,a,r,w,x);n.element.appendChild(o)}))}})};var G=function e(t,i){return{x:t,y:i}};var z=function e(t,i){return t.x*i.x+t.y*i.y};var B=function e(t,i){return G(t.x-i.x,t.y-i.y)};var q=function e(t,i){return z(B(t,i),B(t,i))};var H=function e(t,i){return Math.sqrt(q(t,i))};var U=function e(t,i){var n=t;var a=1.5707963267948966;var r=i;var o=1.5707963267948966-i;var s=Math.sin(a);var l=Math.sin(r);var c=Math.sin(o);var u=Math.cos(o);var d=n/s;var p=d*l;var h=d*c;return G(u*p,u*h)};var V=function e(t,i){var n=t.width;var a=t.height;var r=U(n,i);var o=U(a,i);var s=G(t.x+Math.abs(r.x),t.y-Math.abs(r.y));var l=G(t.x+t.width+Math.abs(o.y),t.y+Math.abs(o.x));var c=G(t.x-Math.abs(o.y),t.y+t.height-Math.abs(o.x));return{width:H(s,l),height:H(s,c)}};var j=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=t.height/t.width;var r=1;var o=i;var s=1;var l=a;if(l>o){l=o;s=l/a}var c=Math.max(r/s,o/l);var u=t.width/(n*c*s);var d=u*i;return{width:u,height:d}};var Y=function e(t,i,n,a){var r=a.x>.5?1-a.x:a.x;var o=a.y>.5?1-a.y:a.y;var s=r*2*t.width;var l=o*2*t.height;var c=V(i,n);return Math.max(c.width/s,c.height/l)};var W=function e(t,i){var n=t.width;var a=n*i;if(a>t.height){a=t.height;n=a/i}var r=(t.width-n)*.5;var o=(t.height-a)*.5;return{x:r,y:o,width:n,height:a}};var X=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=i.zoom,a=i.rotation,r=i.center,o=i.aspectRatio;if(!o)o=t.height/t.width;var s=j(t,o,n);var l={x:s.width*.5,y:s.height*.5};var c={x:0,y:0,width:s.width,height:s.height,center:l};var u=typeof i.scaleToFit==="undefined"||i.scaleToFit;var d=Y(t,W(c,o),a,u?r:{x:.5,y:.5});var p=n*d;return{widthFloat:s.width/p,heightFloat:s.height/p,width:Math.round(s.width/p),height:Math.round(s.height/p)}};var K={type:"spring",stiffness:.5,damping:.45,mass:10};var Z=function e(t){return t.utils.createView({name:"image-bitmap",ignoreRect:true,mixins:{styles:["scaleX","scaleY"]},create:function e(t){var i=t.root,n=t.props;i.appendChild(n.image)}})};var Q=function e(t){return t.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:true,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:K,originY:K,scaleX:K,scaleY:K,translateX:K,translateY:K,rotateZ:K}},create:function e(i){var n=i.root,a=i.props;a.width=a.image.width;a.height=a.image.height;n.ref.bitmap=n.appendChildView(n.createChildView(Z(t),{image:a.image}))},write:function e(t){var i=t.root,n=t.props;var a=n.crop.flip;var r=i.ref.bitmap;r.scaleX=a.horizontal?-1:1;r.scaleY=a.vertical?-1:1}})};var $=function e(t){return t.utils.createView({name:"image-clip",tag:"div",ignoreRect:true,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function e(t){var i=t.root,n=t.props;if(!n.background)return;i.element.style.backgroundColor=n.background},create:function e(i){var n=i.root,a=i.props;n.ref.image=n.appendChildView(n.createChildView(Q(t),Object.assign({},a)));n.ref.createMarkup=function(){if(n.ref.markup)return;n.ref.markup=n.appendChildView(n.createChildView(F(t),Object.assign({},a)))};n.ref.destroyMarkup=function(){if(!n.ref.markup)return;n.removeChildView(n.ref.markup);n.ref.markup=null};var r=n.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");if(r===null)return;if(r==="grid"){n.element.dataset.transparencyIndicator=r}else{n.element.dataset.transparencyIndicator="color"}},write:function e(t){var i=t.root,n=t.props,a=t.shouldOptimize;var r=n.crop,o=n.markup,s=n.resize,l=n.dirty,c=n.width,u=n.height;i.ref.image.crop=r;var d={x:0,y:0,width:c,height:u,center:{x:c*.5,y:u*.5}};var p={width:i.ref.image.width,height:i.ref.image.height};var h={x:r.center.x*p.width,y:r.center.y*p.height};var f={x:d.center.x-p.width*r.center.x,y:d.center.y-p.height*r.center.y};var g=Math.PI*2+r.rotation%(Math.PI*2);var m=r.aspectRatio||p.height/p.width;var v=typeof r.scaleToFit==="undefined"||r.scaleToFit;var _=Y(p,W(d,m),g,v?r.center:{x:.5,y:.5});var b=r.zoom*_;if(o&&o.length){i.ref.createMarkup();i.ref.markup.width=c;i.ref.markup.height=u;i.ref.markup.resize=s;i.ref.markup.dirty=l;i.ref.markup.markup=o;i.ref.markup.crop=X(p,r)}else if(i.ref.markup){i.ref.destroyMarkup()}var y=i.ref.image;if(a){y.originX=null;y.originY=null;y.translateX=null;y.translateY=null;y.rotateZ=null;y.scaleX=null;y.scaleY=null;return}y.originX=h.x;y.originY=h.y;y.translateX=f.x;y.translateY=f.y;y.rotateZ=g;y.scaleX=b;y.scaleY=b}})};var J=function e(t){return t.utils.createView({name:"image-preview",tag:"div",ignoreRect:true,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:K,scaleY:K,translateY:K,opacity:{type:"tween",duration:400}}},create:function e(i){var n=i.root,a=i.props;n.ref.clip=n.appendChildView(n.createChildView($(t),{id:a.id,image:a.image,crop:a.crop,markup:a.markup,resize:a.resize,dirty:a.dirty,background:a.background}))},write:function e(t){var i=t.root,n=t.props,a=t.shouldOptimize;var r=i.ref.clip;var o=n.image,s=n.crop,l=n.markup,c=n.resize,u=n.dirty;r.crop=s;r.markup=l;r.resize=c;r.dirty=u;r.opacity=a?0:1;if(a||i.rect.element.hidden)return;var d=o.height/o.width;var p=s.aspectRatio||d;var h=i.rect.inner.width;var f=i.rect.inner.height;var g=i.query("GET_IMAGE_PREVIEW_HEIGHT");var m=i.query("GET_IMAGE_PREVIEW_MIN_HEIGHT");var v=i.query("GET_IMAGE_PREVIEW_MAX_HEIGHT");var _=i.query("GET_PANEL_ASPECT_RATIO");var b=i.query("GET_ALLOW_MULTIPLE");if(_&&!b){g=h*_;p=_}var y=g!==null?g:Math.max(m,Math.min(h*p,v));var w=y/p;if(w>h){w=h;y=w*p}if(y>f){y=f;w=f/p}r.width=w;r.height=y}})};var ee='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';var te=0;var ie=function e(t){return t.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:true,create:function e(t){var i=t.root,n=t.props;var a=ee;if(document.querySelector("base")){var r=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+r+"#")}te++;i.element.classList.add("filepond--image-preview-overlay-".concat(n.status));i.element.innerHTML=a.replace(/__UID__/g,te)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}})};var ne=function e(){self.onmessage=function(e){createImageBitmap(e.data.message.file).then((function(t){self.postMessage({id:e.data.id,message:t},[t])}))}};var ae=function e(){self.onmessage=function(e){var t=e.data.message.imageData;var i=e.data.message.colorMatrix;var n=t.data;var a=n.length;var r=i[0];var o=i[1];var s=i[2];var l=i[3];var c=i[4];var u=i[5];var d=i[6];var p=i[7];var h=i[8];var f=i[9];var g=i[10];var m=i[11];var v=i[12];var _=i[13];var b=i[14];var y=i[15];var w=i[16];var x=i[17];var E=i[18];var k=i[19];var I=0,T=0,S=0,A=0,C=0;for(;I<a;I+=4){T=n[I]/255;S=n[I+1]/255;A=n[I+2]/255;C=n[I+3]/255;n[I]=Math.max(0,Math.min((T*r+S*o+A*s+C*l+c)*255,255));n[I+1]=Math.max(0,Math.min((T*u+S*d+A*p+C*h+f)*255,255));n[I+2]=Math.max(0,Math.min((T*g+S*m+A*v+C*_+b)*255,255));n[I+3]=Math.max(0,Math.min((T*y+S*w+A*x+C*E+k)*255,255))}self.postMessage({id:e.data.id,message:t},[t.data.buffer])}};var re=function e(t,i){var n=new Image;n.onload=function(){var e=n.naturalWidth;var t=n.naturalHeight;n=null;i(e,t)};n.src=t};var oe={1:function e(){return[1,0,0,1,0,0]},2:function e(t){return[-1,0,0,1,t,0]},3:function e(t,i){return[-1,0,0,-1,t,i]},4:function e(t,i){return[1,0,0,-1,0,i]},5:function e(){return[0,1,1,0,0,0]},6:function e(t,i){return[0,1,-1,0,i,0]},7:function e(t,i){return[0,-1,-1,0,i,t]},8:function e(t){return[0,-1,1,0,0,t]}};var se=function e(t,i,n,a){if(a===-1){return}t.transform.apply(t,oe[a](i,n))};var le=function e(t,i,n,a){i=Math.round(i);n=Math.round(n);var r=document.createElement("canvas");r.width=i;r.height=n;var o=r.getContext("2d");if(a>=5&&a<=8){var s=[n,i];i=s[0];n=s[1]}se(o,i,n,a);o.drawImage(t,0,0,i,n);return r};var ce=function e(t){return/^image/.test(t.type)&&!/svg/.test(t.type)};var ue=10;var de=10;var pe=function e(t){var i=Math.min(ue/t.width,de/t.height);var n=document.createElement("canvas");var a=n.getContext("2d");var r=n.width=Math.ceil(t.width*i);var o=n.height=Math.ceil(t.height*i);a.drawImage(t,0,0,r,o);var s=null;try{s=a.getImageData(0,0,r,o).data}catch(e){return null}var l=s.length;var c=0;var u=0;var d=0;var p=0;for(;p<l;p+=4){c+=s[p]*s[p];u+=s[p+1]*s[p+1];d+=s[p+2]*s[p+2]}c=he(c,l);u=he(u,l);d=he(d,l);return{r:c,g:u,b:d}};var he=function e(t,i){return Math.floor(Math.sqrt(t/(i/4)))};var fe=function e(t,i){i=i||document.createElement("canvas");i.width=t.width;i.height=t.height;var n=i.getContext("2d");n.drawImage(t,0,0);return i};var ge=function e(t){var i;try{i=new ImageData(t.width,t.height)}catch(e){var n=document.createElement("canvas");var a=n.getContext("2d");i=a.createImageData(t.width,t.height)}i.data.set(new Uint8ClampedArray(t.data));return i};var me=function e(t){return new Promise((function(e,i){var n=new Image;n.crossOrigin="Anonymous";n.onload=function(){e(n)};n.onerror=function(e){i(e)};n.src=t}))};var ve=function e(t){var i=ie(t);var n=J(t);var a=t.utils.createWorker;var r=function e(t,i,n){return new Promise((function(e){if(!t.ref.imageData){t.ref.imageData=n.getContext("2d").getImageData(0,0,n.width,n.height)}var r=ge(t.ref.imageData);if(!i||i.length!==20){n.getContext("2d").putImageData(r,0,0);return e()}var o=a(ae);o.post({imageData:r,colorMatrix:i},(function(t){n.getContext("2d").putImageData(t,0,0);o.terminate();e()}),[r.data.buffer])}))};var o=function e(t,i){t.removeChildView(i);i.image.width=1;i.image.height=1;i._destroy()};var s=function e(t){var i=t.root;var n=i.ref.images.shift();n.opacity=0;n.translateY=-15;i.ref.imageViewBin.push(n);return n};var l=function e(t){var i=t.root,a=t.props,r=t.image;var o=a.id;var s=i.query("GET_ITEM",{id:o});if(!s)return;var l=s.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:false,vertical:false},zoom:1,rotation:0,aspectRatio:null};var c=i.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR");var u;var d;var p=false;if(i.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")){u=s.getMetadata("markup")||[];d=s.getMetadata("resize");p=true}var h=i.appendChildView(i.createChildView(n,{id:o,image:r,crop:l,resize:d,markup:u,dirty:p,background:c,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),i.childViews.length);i.ref.images.push(h);h.opacity=1;h.scaleX=1;h.scaleY=1;h.translateY=0;setTimeout((function(){i.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:o})}),250)};var c=function e(t){var i=t.root,n=t.props;var a=i.query("GET_ITEM",{id:n.id});if(!a)return;var r=i.ref.images[i.ref.images.length-1];r.crop=a.getMetadata("crop");r.background=i.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR");if(i.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")){r.dirty=true;r.resize=a.getMetadata("resize");r.markup=a.getMetadata("markup")}};var u=function e(t){var i=t.root,n=t.props,a=t.action;if(!/crop|filter|markup|resize/.test(a.change.key))return;if(!i.ref.images.length)return;var o=i.query("GET_ITEM",{id:n.id});if(!o)return;if(/filter/.test(a.change.key)){var u=i.ref.images[i.ref.images.length-1];r(i,a.change.value,u.image);return}if(/crop|markup|resize/.test(a.change.key)){var d=o.getMetadata("crop");var p=i.ref.images[i.ref.images.length-1];if(d&&d.aspectRatio&&p.crop&&p.crop.aspectRatio&&Math.abs(d.aspectRatio-p.crop.aspectRatio)>1e-5){var h=s({root:i});l({root:i,props:n,image:fe(h.image)})}else{c({root:i,props:n})}}};var d=function e(t){var i=window.navigator.userAgent;var n=i.match(/Firefox\/([0-9]+)\./);var a=n?parseInt(n[1]):null;if(a<=58)return false;return"createImageBitmap"in window&&ce(t)};var p=function e(t){var i=t.root,n=t.props;var a=n.id;var r=i.query("GET_ITEM",a);if(!r)return;var o=URL.createObjectURL(r.file);re(o,(function(e,t){i.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:a,width:e,height:t})}))};var h=function e(t){var i=t.root,n=t.props;var o=n.id;var s=i.query("GET_ITEM",o);if(!s)return;var c=URL.createObjectURL(s.file);var u=function e(){me(c).then(p)};var p=function e(t){URL.revokeObjectURL(c);var a=s.getMetadata("exif")||{};var o=a.orientation||-1;var u=t.width,d=t.height;if(!u||!d)return;if(o>=5&&o<=8){var p=[d,u];u=p[0];d=p[1]}var h=Math.max(1,window.devicePixelRatio*.75);var f=i.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR");var g=f*h;var m=d/u;var v=i.rect.element.width;var _=i.rect.element.height;var b=v;var y=b*m;if(m>1){b=Math.min(u,v*g);y=b*m}else{y=Math.min(d,_*g);b=y/m}var w=le(t,b,y,o);var x=function e(){var a=i.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?pe(data):null;s.setMetadata("color",a,true);if("close"in t){t.close()}i.ref.overlayShadow.opacity=1;l({root:i,props:n,image:w})};var E=s.getMetadata("filter");if(E){r(i,E,w).then(x)}else{x()}};if(d(s.file)){var h=a(ne);h.post({file:s.file},(function(e){h.terminate();if(!e){u();return}p(e)}))}else{u()}};var f=function e(t){var i=t.root;var n=i.ref.images[i.ref.images.length-1];n.translateY=0;n.scaleX=1;n.scaleY=1;n.opacity=1};var g=function e(t){var i=t.root;i.ref.overlayShadow.opacity=1;i.ref.overlayError.opacity=0;i.ref.overlaySuccess.opacity=0};var m=function e(t){var i=t.root;i.ref.overlayShadow.opacity=.25;i.ref.overlayError.opacity=1};var v=function e(t){var i=t.root;i.ref.overlayShadow.opacity=.25;i.ref.overlaySuccess.opacity=1};var _=function e(t){var n=t.root;n.ref.images=[];n.ref.imageData=null;n.ref.imageViewBin=[];n.ref.overlayShadow=n.appendChildView(n.createChildView(i,{opacity:0,status:"idle"}));n.ref.overlaySuccess=n.appendChildView(n.createChildView(i,{opacity:0,status:"success"}));n.ref.overlayError=n.appendChildView(n.createChildView(i,{opacity:0,status:"failure"}))};return t.utils.createView({name:"image-preview-wrapper",create:_,styles:["height"],apis:["height"],destroy:function e(t){var i=t.root;i.ref.images.forEach((function(e){e.image.width=1;e.image.height=1}))},didWriteView:function e(t){var i=t.root;i.ref.images.forEach((function(e){e.dirty=false}))},write:t.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:f,DID_IMAGE_PREVIEW_CONTAINER_CREATE:p,DID_FINISH_CALCULATE_PREVIEWSIZE:h,DID_UPDATE_ITEM_METADATA:u,DID_THROW_ITEM_LOAD_ERROR:m,DID_THROW_ITEM_PROCESSING_ERROR:m,DID_THROW_ITEM_INVALID:m,DID_COMPLETE_ITEM_PROCESSING:v,DID_START_ITEM_PROCESSING:g,DID_REVERT_ITEM_PROCESSING:g},(function(e){var t=e.root;var i=t.ref.imageViewBin.filter((function(e){return e.opacity===0}));t.ref.imageViewBin=t.ref.imageViewBin.filter((function(e){return e.opacity>0}));i.forEach((function(e){return o(t,e)}));i.length=0}))})};var _e=function t(i){var n=i.addFilter,a=i.utils;var r=a.Type,o=a.createRoute,s=a.isFile;var l=ve(i);n("CREATE_VIEW",(function(t){var i=t.is,n=t.view,a=t.query;if(!i("file")||!a("GET_ALLOW_IMAGE_PREVIEW"))return;var r=function t(i){var r=i.root,o=i.props;var c=o.id;var u=a("GET_ITEM",c);if(!u||!s(u.file)||u.archived)return;var d=u.file;if(!e(d))return;if(!a("GET_IMAGE_PREVIEW_FILTER_ITEM")(u))return;var p="createImageBitmap"in(window||{});var h=a("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!p&&h&&d.size>h)return;r.ref.imagePreview=n.appendChildView(n.createChildView(l,{id:c}));var f=r.query("GET_IMAGE_PREVIEW_HEIGHT");if(f){r.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:u.id,height:f})}var g=!p&&d.size>a("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");r.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:c},g)};var c=function e(t,i){if(!t.ref.imagePreview)return;var n=i.id;var a=t.query("GET_ITEM",{id:n});if(!a)return;var r=t.query("GET_PANEL_ASPECT_RATIO");var o=t.query("GET_ITEM_PANEL_ASPECT_RATIO");var s=t.query("GET_IMAGE_PREVIEW_HEIGHT");if(r||o||s)return;var l=t.ref,c=l.imageWidth,u=l.imageHeight;if(!c||!u)return;var d=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT");var p=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT");var h=a.getMetadata("exif")||{};var f=h.orientation||-1;if(f>=5&&f<=8){var g=[u,c];c=g[0];u=g[1]}if(!ce(a.file)||t.query("GET_IMAGE_PREVIEW_UPSCALE")){var m=2048/c;c*=m;u*=m}var v=u/c;var _=(a.getMetadata("crop")||{}).aspectRatio||v;var b=Math.max(d,Math.min(u,p));var y=t.rect.element.width;var w=Math.min(y*_,b);t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:a.id,height:w})};var u=function e(t){var i=t.root;i.ref.shouldRescale=true};var d=function e(t){var i=t.root,n=t.action;if(n.change.key!=="crop")return;i.ref.shouldRescale=true};var p=function e(t){var i=t.root,n=t.action;i.ref.imageWidth=n.width;i.ref.imageHeight=n.height;i.ref.shouldRescale=true;i.ref.shouldDrawPreview=true;i.dispatch("KICK")};n.registerWriter(o({DID_RESIZE_ROOT:u,DID_STOP_RESIZE:u,DID_LOAD_ITEM:r,DID_IMAGE_PREVIEW_CALCULATE_SIZE:p,DID_UPDATE_ITEM_METADATA:d},(function(e){var t=e.root,i=e.props;if(!t.ref.imagePreview)return;if(t.rect.element.hidden)return;if(t.ref.shouldRescale){c(t,i);t.ref.shouldRescale=false}if(t.ref.shouldDrawPreview){requestAnimationFrame((function(){requestAnimationFrame((function(){t.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:i.id})}))}));t.ref.shouldDrawPreview=false}})))}));return{options:{allowImagePreview:[true,r.BOOLEAN],imagePreviewFilterItem:[function(){return true},r.FUNCTION],imagePreviewHeight:[null,r.INT],imagePreviewMinHeight:[44,r.INT],imagePreviewMaxHeight:[256,r.INT],imagePreviewMaxFileSize:[null,r.INT],imagePreviewZoomFactor:[2,r.INT],imagePreviewUpscale:[false,r.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,r.INT],imagePreviewTransparencyIndicator:[null,r.STRING],imagePreviewCalculateAverageImageColor:[false,r.BOOLEAN],imagePreviewMarkupShow:[true,r.BOOLEAN],imagePreviewMarkupFilter:[function(){return true},r.FUNCTION]}}};var be=typeof window!=="undefined"&&typeof window.document!=="undefined";if(be){document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:_e}))}return _e}))}));var FilePondPluginImagePreview=getDefaultExportFromCjs(filepondPluginImagePreview);var filepondPluginImageEdit=createCommonjsModule((function(e,t){
|
|
36
36
|
/*!
|
|
37
37
|
* FilePondPluginImageEdit 1.6.3
|
|
38
38
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|