!function(e){var t={};function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=69)}({29:function(e,t,r){
/*!
 * FilePondPluginFileRename 1.1.8
 * Licensed under MIT, https://opensource.org/licenses/MIT/
 * Please visit https://pqina.nl/filepond/ for details.
 */
e.exports=function(){"use strict";var e=function plugin(e){var t=e.addFilter,r=e.utils,n=r.Type,i=r.renameFile,o=r.isFile,a=r.getExtensionFromFilename,s=r.getFilenameWithoutExtension;return t("LOAD_FILE",(function(e,t){var r=t.query;return new Promise((function(t,n){var u=r("GET_ALLOW_FILE_RENAME"),l=r("GET_FILE_RENAME_FUNCTION");if(o(e)&&u&&l){var c=l({name:e.name,basename:s(e.name),extension:".".concat(a(e.name))}),f=function rename(r){t(i(e,r))};"string"!=typeof c?c.then(f):f(c)}else t(e)}))})),{options:{allowFileRename:[!0,n.BOOLEAN],fileRenameFunction:[null,n.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e}()},30:function(e,t,r){
/*!
 * FilePondPluginFileValidateSize 2.2.5
 * Licensed under MIT, https://opensource.org/licenses/MIT/
 * Please visit https://pqina.nl/filepond/ for details.
 */
e.exports=function(){"use strict";var e=function plugin(e){var t=e.addFilter,r=e.utils,n=r.Type,i=r.replaceInString,o=r.toNaturalFileSize;return t("ALLOW_HOPPER_ITEM",(function(e,t){var r=t.query;if(!r("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;var n=r("GET_MAX_FILE_SIZE");if(null!==n&&e.size>=n)return!1;var i=r("GET_MIN_FILE_SIZE");return!(null!==i&&e.size<=i)})),t("LOAD_FILE",(function(e,t){var r=t.query;return new Promise((function(t,n){if(!r("GET_ALLOW_FILE_SIZE_VALIDATION"))return t(e);var a=r("GET_FILE_VALIDATE_SIZE_FILTER");if(a&&!a(e))return t(e);var s=r("GET_MAX_FILE_SIZE");if(null!==s&&e.size>=s)n({status:{main:r("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:i(r("GET_LABEL_MAX_FILE_SIZE"),{filesize:o(s,".",r("GET_FILE_SIZE_BASE"),r("GET_FILE_SIZE_LABELS",r))})}});else{var u=r("GET_MIN_FILE_SIZE");if(null!==u&&e.size<=u)n({status:{main:r("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:i(r("GET_LABEL_MIN_FILE_SIZE"),{filesize:o(u,".",r("GET_FILE_SIZE_BASE"),r("GET_FILE_SIZE_LABELS",r))})}});else{var l=r("GET_MAX_TOTAL_FILE_SIZE");if(null!==l&&r("GET_ACTIVE_ITEMS").reduce((function(e,t){return e+t.fileSize}),0)>l)return void n({status:{main:r("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:i(r("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:o(l,".",r("GET_FILE_SIZE_BASE"),r("GET_FILE_SIZE_LABELS",r))})}});t(e)}}}))})),{options:{allowFileSizeValidation:[!0,n.BOOLEAN],maxFileSize:[null,n.INT],minFileSize:[null,n.INT],maxTotalFileSize:[null,n.INT],fileValidateSizeFilter:[null,n.FUNCTION],labelMinFileSizeExceeded:["File is too small",n.STRING],labelMinFileSize:["Minimum file size is {filesize}",n.STRING],labelMaxFileSizeExceeded:["File is too large",n.STRING],labelMaxFileSize:["Maximum file size is {filesize}",n.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",n.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",n.STRING]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e}()},31:function(e,t,r){
/*!
 * FilePondPluginImagePreview 4.6.11
 * Licensed under MIT, https://opensource.org/licenses/MIT/
 * Please visit https://pqina.nl/filepond/ for details.
 */
e.exports=function(){"use strict";function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),i=n.value,o=i instanceof _AwaitValue;Promise.resolve(o?i.wrapped:i).then((function(e){o?resume("next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function send(e,n){return new Promise((function(i,o){var a={key:e,arg:n,resolve:i,reject:o,next:null};r?r=r.next=a:(t=r=a,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function _slicedToArray(e,t){return _arrayWithHoles(e)||function _iterableToArrayLimit(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};var e=function vectorMultiply(e,t){return n(e.x*t,e.y*t)},t=function vectorAdd(e,t){return n(e.x+t.x,e.y+t.y)},r=function vectorRotate(e,t,r){var i=Math.cos(t),o=Math.sin(t),a=n(e.x-r.x,e.y-r.y);return n(r.x+i*a.x-o*a.y,r.y+o*a.x+i*a.y)},n=function createVector(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{x:e,y:t}},i=function getMarkupValue(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3?arguments[3]:void 0;return"string"==typeof e?parseFloat(e)*r:"number"==typeof e?e*(n?t[n]:Math.min(t.width,t.height)):void 0},o=function isDefined(e){return null!=e},a=function pointsToPathShape(e){return e.map((function(e,t){return"".concat(0===t?"M":"L"," ").concat(e.x," ").concat(e.y)})).join(" ")},s=function setAttributes(e,t){return Object.keys(t).forEach((function(r){return e.setAttribute(r,t[r])}))},u=function svg(e,t){var r=document.createElementNS("http://www.w3.org/2000/svg",e);return t&&s(r,t),r},l={contain:"xMidYMid meet",cover:"xMidYMid slice"},c={left:"start",center:"middle",right:"end"},f=function createShape(e){return function(t){return u(e,{id:t.id})}},d={image:function createImage(e){var t=u("image",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return t.onload=function(){t.setAttribute("opacity",e.opacity||1)},t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.src),t},rect:f("rect"),ellipse:f("ellipse"),text:f("text"),path:f("path"),line:function createLine(e){var t=u("g",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round"}),r=u("line");t.appendChild(r);var n=u("path");t.appendChild(n);var i=u("path");return t.appendChild(i),t}},p={rect:function updateRect(e){return s(e,Object.assign({},e.rect,e.styles))},ellipse:function updateEllipse(e){var t=e.rect.x+.5*e.rect.width,r=e.rect.y+.5*e.rect.height,n=.5*e.rect.width,i=.5*e.rect.height;return s(e,Object.assign({cx:t,cy:r,rx:n,ry:i},e.styles))},image:function updateImage(e,t){s(e,Object.assign({},e.rect,e.styles,{preserveAspectRatio:l[t.fit]||"none"}))},text:function updateText(e,t,r,n){var o=i(t.fontSize,r,n),a=t.fontFamily||"sans-serif",u=t.fontWeight||"normal",l=c[t.textAlign]||"start";s(e,Object.assign({},e.rect,e.styles,{"stroke-width":0,"font-weight":u,"font-size":o,"font-family":a,"text-anchor":l})),e.text!==t.text&&(e.text=t.text,e.textContent=t.text.length?t.text:" ")},path:function updatePath(e,t,r,n){s(e,Object.assign({},e.styles,{fill:"none",d:a(t.points.map((function(e){return{x:i(e.x,r,n,"width"),y:i(e.y,r,n,"height")}})))}))},line:function updateLine(o,a,u,l){s(o,Object.assign({},o.rect,o.styles,{fill:"none"}));var c=o.childNodes[0],f=o.childNodes[1],d=o.childNodes[2],p=o.rect,E={x:o.rect.x+o.rect.width,y:o.rect.y+o.rect.height};if(s(c,{x1:p.x,y1:p.y,x2:E.x,y2:E.y}),a.lineDecoration){f.style.display="none",d.style.display="none";var m=function vectorNormalize(e){var t=Math.sqrt(e.x*e.x+e.y*e.y);return 0===t?{x:0,y:0}:n(e.x/t,e.y/t)}({x:E.x-p.x,y:E.y-p.y}),g=i(.05,u,l);if(-1!==a.lineDecoration.indexOf("arrow-begin")){var I=e(m,g),h=t(p,I),T=r(p,2,h),v=r(p,-2,h);s(f,{style:"display:block;",d:"M".concat(T.x,",").concat(T.y," L").concat(p.x,",").concat(p.y," L").concat(v.x,",").concat(v.y)})}if(-1!==a.lineDecoration.indexOf("arrow-end")){var y=e(m,-g),R=t(E,y),O=r(E,2,R),D=r(E,-2,R);s(d,{style:"display:block;",d:"M".concat(O.x,",").concat(O.y," L").concat(E.x,",").concat(E.y," L").concat(D.x,",").concat(D.y)})}}}},E=function updateMarkupByType(e,t,r,n,a){"path"!==t&&(e.rect=function getMarkupRect(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=i(e.x,t,r,"width")||i(e.left,t,r,"width"),a=i(e.y,t,r,"height")||i(e.top,t,r,"height"),s=i(e.width,t,r,"width"),u=i(e.height,t,r,"height"),l=i(e.right,t,r,"width"),c=i(e.bottom,t,r,"height");return o(a)||(a=o(u)&&o(c)?t.height-u-c:c),o(n)||(n=o(s)&&o(l)?t.width-s-l:l),o(s)||(s=o(n)&&o(l)?t.width-n-l:0),o(u)||(u=o(a)&&o(c)?t.height-a-c:0),{x:n||0,y:a||0,width:s||0,height:u||0}}(r,n,a)),e.styles=function getMarkupStyles(e,t,r){var n=e.borderStyle||e.lineStyle||"solid",o=e.backgroundColor||e.fontColor||"transparent",a=e.borderColor||e.lineColor||"transparent",s=i(e.borderWidth||e.lineWidth,t,r);return{"stroke-linecap":e.lineCap||"round","stroke-linejoin":e.lineJoin||"round","stroke-width":s||0,"stroke-dasharray":"string"==typeof n?"":n.map((function(e){return i(e,t,r)})).join(","),stroke:a,fill:o,opacity:e.opacity||1}}(r,n,a),p[t](e,r,n,a)},m=["x","y","left","top","right","bottom","width","height"],g=function prepareMarkup(e){var t=_slicedToArray(e,2),r=t[0],n=t[1],i=n.points?{}:m.reduce((function(e,t){return e[t]=function toOptionalFraction(e){return"string"==typeof e&&/%/.test(e)?parseFloat(e)/100:e}(n[t]),e}),{});return[r,Object.assign({zIndex:0},n,i)]},I=function sortMarkupByZIndex(e,t){return e[1].zIndex>t[1].zIndex?1:e[1].zIndex<t[1].zIndex?-1:0},h=function createMarkupView(e){return e.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function write(e){var t=e.root,r=e.props;if(r.dirty){var n=r.crop,i=r.resize,o=r.markup,a=r.width,s=r.height,u=n.width,l=n.height;if(i){var c=i.size,f=c&&c.width,p=c&&c.height,m=i.mode,h=i.upscale;f&&!p&&(p=f),p&&!f&&(f=p);var T=u<f&&l<p;if(!T||T&&h){var v,y=f/u,R=p/l;"force"===m?(u=f,l=p):("cover"===m?v=Math.max(y,R):"contain"===m&&(v=Math.min(y,R)),u*=v,l*=v)}}var O={width:a,height:s};t.element.setAttribute("width",O.width),t.element.setAttribute("height",O.height);var D=Math.min(a/u,s/l);t.element.innerHTML="";var S=t.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");o.filter(S).map(g).sort(I).forEach((function(e){var r=_slicedToArray(e,2),n=r[0],i=r[1],o=function createMarkupByType(e,t){return d[e](t)}(n,i);E(o,n,i,O,D),t.element.appendChild(o)}))}}})},T=function createVector(e,t){return{x:e,y:t}},v=function vectorSubtract(e,t){return T(e.x-t.x,e.y-t.y)},y=function vectorDistance(e,t){return Math.sqrt(function vectorDistanceSquared(e,t){return function vectorDot(e,t){return e.x*t.x+e.y*t.y}(v(e,t),v(e,t))}(e,t))},R=function getOffsetPointOnEdge(e,t){var r=e,n=t,i=1.5707963267948966-t,o=Math.sin(1.5707963267948966),a=Math.sin(n),s=Math.sin(i),u=Math.cos(i),l=r/o;return T(u*(l*a),u*(l*s))},O=function calculateCanvasSize(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=e.height/e.width,i=1,o=t,a=1,s=n;s>o&&(a=(s=o)/n);var u=Math.max(i/a,o/s),l=e.width/(r*u*a),c=l*t;return{width:l,height:c}},D=function getImageRectZoomFactor(e,t,r,n){var i=n.x>.5?1-n.x:n.x,o=n.y>.5?1-n.y:n.y,a=2*i*e.width,s=2*o*e.height,u=function getRotatedRectSize(e,t){var r=e.width,n=e.height,i=R(r,t),o=R(n,t),a=T(e.x+Math.abs(i.x),e.y-Math.abs(i.y)),s=T(e.x+e.width+Math.abs(o.y),e.y+Math.abs(o.x)),u=T(e.x-Math.abs(o.y),e.y+e.height-Math.abs(o.x));return{width:y(a,s),height:y(a,u)}}(t,r);return Math.max(u.width/a,u.height/s)},S=function getCenteredCropRect(e,t){var r=e.width,n=r*t;return n>e.height&&(r=(n=e.height)/t),{x:.5*(e.width-r),y:.5*(e.height-n),width:r,height:n}},A={type:"spring",stiffness:.5,damping:.45,mass:10},w=function createClipView(e){return e.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function didWriteView(e){var t=e.root,r=e.props;r.background&&(t.element.style.backgroundColor=r.background)},create:function create(t){var r=t.root,n=t.props;r.ref.image=r.appendChildView(r.createChildView(function createImageCanvasWrapper(e){return e.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:A,originY:A,scaleX:A,scaleY:A,translateX:A,translateY:A,rotateZ:A}},create:function create(t){var r=t.root,n=t.props;n.width=n.image.width,n.height=n.image.height,r.ref.bitmap=r.appendChildView(r.createChildView(function createBitmapView(e){return e.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:function create(e){var t=e.root,r=e.props;t.appendChild(r.image)}})}(e),{image:n.image}))},write:function write(e){var t=e.root,r=e.props.crop.flip,n=t.ref.bitmap;n.scaleX=r.horizontal?-1:1,n.scaleY=r.vertical?-1:1}})}(e),Object.assign({},n))),r.ref.createMarkup=function(){r.ref.markup||(r.ref.markup=r.appendChildView(r.createChildView(h(e),Object.assign({},n))))},r.ref.destroyMarkup=function(){r.ref.markup&&(r.removeChildView(r.ref.markup),r.ref.markup=null)};var i=r.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");null!==i&&(r.element.dataset.transparencyIndicator="grid"===i?i:"color")},write:function write(e){var t=e.root,r=e.props,n=e.shouldOptimize,i=r.crop,o=r.markup,a=r.resize,s=r.dirty,u=r.width,l=r.height;t.ref.image.crop=i;var c={x:0,y:0,width:u,height:l,center:{x:.5*u,y:.5*l}},f={width:t.ref.image.width,height:t.ref.image.height},d={x:i.center.x*f.width,y:i.center.y*f.height},p={x:c.center.x-f.width*i.center.x,y:c.center.y-f.height*i.center.y},E=2*Math.PI+i.rotation%(2*Math.PI),m=i.aspectRatio||f.height/f.width,g=void 0===i.scaleToFit||i.scaleToFit,I=D(f,S(c,m),E,g?i.center:{x:.5,y:.5}),h=i.zoom*I;o&&o.length?(t.ref.createMarkup(),t.ref.markup.width=u,t.ref.markup.height=l,t.ref.markup.resize=a,t.ref.markup.dirty=s,t.ref.markup.markup=o,t.ref.markup.crop=function getCurrentCropSize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.zoom,n=t.rotation,i=t.center,o=t.aspectRatio;o||(o=e.height/e.width);var a=O(e,o,r),s={x:.5*a.width,y:.5*a.height},u={x:0,y:0,width:a.width,height:a.height,center:s},l=void 0===t.scaleToFit||t.scaleToFit,c=D(e,S(u,o),n,l?i:{x:.5,y:.5}),f=r*c;return{widthFloat:a.width/f,heightFloat:a.height/f,width:Math.round(a.width/f),height:Math.round(a.height/f)}}(f,i)):t.ref.markup&&t.ref.destroyMarkup();var T=t.ref.image;if(n)return T.originX=null,T.originY=null,T.translateX=null,T.translateY=null,T.rotateZ=null,T.scaleX=null,void(T.scaleY=null);T.originX=d.x,T.originY=d.y,T.translateX=p.x,T.translateY=p.y,T.rotateZ=E,T.scaleX=h,T.scaleY=h}})},b=0,L=function BitmapWorker(){self.onmessage=function(e){createImageBitmap(e.data.message.file).then((function(t){self.postMessage({id:e.data.id,message:t},[t])}))}},P=function ColorMatrixWorker(){self.onmessage=function(e){for(var t=e.data.message.imageData,r=e.data.message.colorMatrix,n=t.data,i=n.length,o=r[0],a=r[1],s=r[2],u=r[3],l=r[4],c=r[5],f=r[6],d=r[7],p=r[8],E=r[9],m=r[10],g=r[11],I=r[12],h=r[13],T=r[14],v=r[15],y=r[16],R=r[17],O=r[18],D=r[19],S=0,A=0,w=0,b=0,L=0;S<i;S+=4)A=n[S]/255,w=n[S+1]/255,b=n[S+2]/255,L=n[S+3]/255,n[S]=Math.max(0,Math.min(255*(A*o+w*a+b*s+L*u+l),255)),n[S+1]=Math.max(0,Math.min(255*(A*c+w*f+b*d+L*p+E),255)),n[S+2]=Math.max(0,Math.min(255*(A*m+w*g+b*I+L*h+T),255)),n[S+3]=Math.max(0,Math.min(255*(A*v+w*y+b*R+L*O+D),255));self.postMessage({id:e.data.id,message:t},[t.data.buffer])}},M={1:function _(){return[1,0,0,1,0,0]},2:function _(e){return[-1,0,0,1,e,0]},3:function _(e,t){return[-1,0,0,-1,e,t]},4:function _(e,t){return[1,0,0,-1,0,t]},5:function _(){return[0,1,1,0,0,0]},6:function _(e,t){return[0,1,-1,0,t,0]},7:function _(e,t){return[0,-1,-1,0,t,e]},8:function _(e){return[0,-1,1,0,0,e]}},C=function createPreviewImage(e,t,r,n){t=Math.round(t),r=Math.round(r);var i=document.createElement("canvas");i.width=t,i.height=r;var o=i.getContext("2d");if(n>=5&&n<=8){var a=[r,t];t=a[0],r=a[1]}return function fixImageOrientation(e,t,r,n){-1!==n&&e.transform.apply(e,M[n](t,r))}(o,t,r,n),o.drawImage(e,0,0,t,r),i},N=function isBitmap(e){return/^image/.test(e.type)&&!/svg/.test(e.type)},G=function calculateAverageColor(e){var t=Math.min(10/e.width,10/e.height),r=document.createElement("canvas"),n=r.getContext("2d"),i=r.width=Math.ceil(e.width*t),o=r.height=Math.ceil(e.height*t);n.drawImage(e,0,0,i,o);var a=null;try{a=n.getImageData(0,0,i,o).data}catch(e){return null}for(var s=a.length,u=0,l=0,c=0,f=0;f<s;f+=4)u+=a[f]*a[f],l+=a[f+1]*a[f+1],c+=a[f+2]*a[f+2];return{r:u=F(u,s),g:l=F(l,s),b:c=F(c,s)}},F=function averageColor(e,t){return Math.floor(Math.sqrt(e/(t/4)))},x=function cloneCanvas(e,t){return(t=t||document.createElement("canvas")).width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t},B=function createImageWrapperView(e){var t=function createImageOverlayView(e){return e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:function create(e){var t=e.root,r=e.props,n='<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>';if(document.querySelector("base")){var i=new URL(window.location.href.replace(window.location.hash,"")).href;n=n.replace(/url\(\#/g,"url("+i+"#")}b++,t.element.classList.add("filepond--image-preview-overlay-".concat(r.status)),t.element.innerHTML=n.replace(/__UID__/g,b)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}})}(e),r=function createImageView(e){return e.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:A,scaleY:A,translateY:A,opacity:{type:"tween",duration:400}}},create:function create(t){var r=t.root,n=t.props;r.ref.clip=r.appendChildView(r.createChildView(w(e),{id:n.id,image:n.image,crop:n.crop,markup:n.markup,resize:n.resize,dirty:n.dirty,background:n.background}))},write:function write(e){var t=e.root,r=e.props,n=e.shouldOptimize,i=t.ref.clip,o=r.image,a=r.crop,s=r.markup,u=r.resize,l=r.dirty;if(i.crop=a,i.markup=s,i.resize=u,i.dirty=l,i.opacity=n?0:1,!n&&!t.rect.element.hidden){var c=o.height/o.width,f=a.aspectRatio||c,d=t.rect.inner.width,p=t.rect.inner.height,E=t.query("GET_IMAGE_PREVIEW_HEIGHT"),m=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),g=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),I=t.query("GET_PANEL_ASPECT_RATIO"),h=t.query("GET_ALLOW_MULTIPLE");I&&!h&&(E=d*I,f=I);var T=null!==E?E:Math.max(m,Math.min(d*f,g)),v=T/f;v>d&&(T=(v=d)*f),T>p&&(T=p,v=p/f),i.width=v,i.height=T}}})}(e),n=e.utils.createWorker,i=function applyFilter(e,t,r){return new Promise((function(i){e.ref.imageData||(e.ref.imageData=r.getContext("2d").getImageData(0,0,r.width,r.height));var o=function cloneImageData(e){var t;try{t=new ImageData(e.width,e.height)}catch(r){t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t}(e.ref.imageData);if(!t||20!==t.length)return r.getContext("2d").putImageData(o,0,0),i();var a=n(P);a.post({imageData:o,colorMatrix:t},(function(e){r.getContext("2d").putImageData(e,0,0),a.terminate(),i()}),[o.data.buffer])}))},o=function pushImage(e){var t=e.root,n=e.props,i=e.image,o=n.id,a=t.query("GET_ITEM",{id:o});if(a){var s,u,l=a.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},c=t.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),f=!1;t.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(s=a.getMetadata("markup")||[],u=a.getMetadata("resize"),f=!0);var d=t.appendChildView(t.createChildView(r,{id:o,image:i,crop:l,resize:u,markup:s,dirty:f,background:c,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),t.childViews.length);t.ref.images.push(d),d.opacity=1,d.scaleX=1,d.scaleY=1,d.translateY=0,setTimeout((function(){t.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:o})}),250)}},a=function restoreOverlay(e){var t=e.root;t.ref.overlayShadow.opacity=1,t.ref.overlayError.opacity=0,t.ref.overlaySuccess.opacity=0},s=function didThrowError(e){var t=e.root;t.ref.overlayShadow.opacity=.25,t.ref.overlayError.opacity=1};return e.utils.createView({name:"image-preview-wrapper",create:function create(e){var r=e.root;r.ref.images=[],r.ref.imageData=null,r.ref.imageViewBin=[],r.ref.overlayShadow=r.appendChildView(r.createChildView(t,{opacity:0,status:"idle"})),r.ref.overlaySuccess=r.appendChildView(r.createChildView(t,{opacity:0,status:"success"})),r.ref.overlayError=r.appendChildView(r.createChildView(t,{opacity:0,status:"failure"}))},styles:["height"],apis:["height"],destroy:function destroy(e){e.root.ref.images.forEach((function(e){e.image.width=1,e.image.height=1}))},didWriteView:function didWriteView(e){e.root.ref.images.forEach((function(e){e.dirty=!1}))},write:e.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:function didDrawPreview(e){var t=e.root,r=t.ref.images[t.ref.images.length-1];r.translateY=0,r.scaleX=1,r.scaleY=1,r.opacity=1},DID_IMAGE_PREVIEW_CONTAINER_CREATE:function didCreatePreviewContainer(e){var t=e.root,r=e.props.id,n=t.query("GET_ITEM",r);n&&function getImageSize(e,t){var r=new Image;r.onload=function(){var e=r.naturalWidth,n=r.naturalHeight;r=null,t(e,n)},r.src=e}(URL.createObjectURL(n.file),(function(e,n){t.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:r,width:e,height:n})}))},DID_FINISH_CALCULATE_PREVIEWSIZE:function drawPreview(e){var t=e.root,r=e.props,a=r.id,s=t.query("GET_ITEM",a);if(s){var u=URL.createObjectURL(s.file),l=function loadPreviewFallback(){(function loadImage(e){return new Promise((function(t,r){var n=new Image;n.crossOrigin="Anonymous",n.onload=function(){t(n)},n.onerror=function(e){r(e)},n.src=e}))})(u).then(c)},c=function previewImageLoaded(e){URL.revokeObjectURL(u);var n=(s.getMetadata("exif")||{}).orientation||-1,a=e.width,l=e.height;if(a&&l){if(n>=5&&n<=8){var c=[l,a];a=c[0],l=c[1]}var f=Math.max(1,.75*window.devicePixelRatio),d=t.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*f,p=l/a,E=t.rect.element.width,m=t.rect.element.height,g=E,I=g*p;p>1?I=(g=Math.min(a,E*d))*p:g=(I=Math.min(l,m*d))/p;var h=C(e,g,I,n),T=function done(){var n=t.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?G(data):null;s.setMetadata("color",n,!0),"close"in e&&e.close(),t.ref.overlayShadow.opacity=1,o({root:t,props:r,image:h})},v=s.getMetadata("filter");v?i(t,v,h).then(T):T()}};if(function canCreateImageBitmap(e){var t=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./);return!((t?parseInt(t[1]):null)<=58)&&"createImageBitmap"in window&&N(e)}(s.file)){var f=n(L);f.post({file:s.file},(function(e){f.terminate(),e?c(e):l()}))}else l()}},DID_UPDATE_ITEM_METADATA:function didUpdateItemMetadata(e){var t=e.root,r=e.props,n=e.action;if(/crop|filter|markup|resize/.test(n.change.key)&&t.ref.images.length){var a=t.query("GET_ITEM",{id:r.id});if(a)if(/filter/.test(n.change.key)){var s=t.ref.images[t.ref.images.length-1];i(t,n.change.value,s.image)}else if(/crop|markup|resize/.test(n.change.key)){var u=a.getMetadata("crop"),l=t.ref.images[t.ref.images.length-1];if(u&&u.aspectRatio&&l.crop&&l.crop.aspectRatio&&Math.abs(u.aspectRatio-l.crop.aspectRatio)>1e-5){var c=function shiftImage(e){var t=e.root,r=t.ref.images.shift();return r.opacity=0,r.translateY=-15,t.ref.imageViewBin.push(r),r}({root:t});o({root:t,props:r,image:x(c.image)})}else!function updateImage(e){var t=e.root,r=e.props,n=t.query("GET_ITEM",{id:r.id});if(n){var i=t.ref.images[t.ref.images.length-1];i.crop=n.getMetadata("crop"),i.background=t.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),t.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(i.dirty=!0,i.resize=n.getMetadata("resize"),i.markup=n.getMetadata("markup"))}}({root:t,props:r})}}},DID_THROW_ITEM_LOAD_ERROR:s,DID_THROW_ITEM_PROCESSING_ERROR:s,DID_THROW_ITEM_INVALID:s,DID_COMPLETE_ITEM_PROCESSING:function didCompleteProcessing(e){var t=e.root;t.ref.overlayShadow.opacity=.25,t.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:a,DID_REVERT_ITEM_PROCESSING:a},(function(e){var t=e.root,r=t.ref.imageViewBin.filter((function(e){return 0===e.opacity}));t.ref.imageViewBin=t.ref.imageViewBin.filter((function(e){return e.opacity>0})),r.forEach((function(e){return function removeImageView(e,t){e.removeChildView(t),t.image.width=1,t.image.height=1,t._destroy()}(t,e)})),r.length=0}))})},U=function plugin(e){var t=e.addFilter,r=e.utils,n=r.Type,i=r.createRoute,o=r.isFile,a=B(e);return t("CREATE_VIEW",(function(e){var t=e.is,r=e.view,n=e.query;if(t("file")&&n("GET_ALLOW_IMAGE_PREVIEW")){var s=function didResizeView(e){e.root.ref.shouldRescale=!0};r.registerWriter(i({DID_RESIZE_ROOT:s,DID_STOP_RESIZE:s,DID_LOAD_ITEM:function didLoadItem(e){var t=e.root,i=e.props.id,s=n("GET_ITEM",i);if(s&&o(s.file)&&!s.archived){var u=s.file;if(function isPreviewableImage(e){return/^image/.test(e.type)}(u)&&n("GET_IMAGE_PREVIEW_FILTER_ITEM")(s)){var l="createImageBitmap"in(window||{}),c=n("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!(!l&&c&&u.size>c)){t.ref.imagePreview=r.appendChildView(r.createChildView(a,{id:i}));var f=t.query("GET_IMAGE_PREVIEW_HEIGHT");f&&t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:s.id,height:f});var d=!l&&u.size>n("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");t.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:i},d)}}}},DID_IMAGE_PREVIEW_CALCULATE_SIZE:function didCalculatePreviewSize(e){var t=e.root,r=e.action;t.ref.imageWidth=r.width,t.ref.imageHeight=r.height,t.ref.shouldRescale=!0,t.ref.shouldDrawPreview=!0,t.dispatch("KICK")},DID_UPDATE_ITEM_METADATA:function didUpdateItemMetadata(e){var t=e.root;"crop"===e.action.change.key&&(t.ref.shouldRescale=!0)}},(function(e){var t=e.root,r=e.props;t.ref.imagePreview&&(t.rect.element.hidden||(t.ref.shouldRescale&&(function rescaleItem(e,t){if(e.ref.imagePreview){var r=t.id,n=e.query("GET_ITEM",{id:r});if(n){var i=e.query("GET_PANEL_ASPECT_RATIO"),o=e.query("GET_ITEM_PANEL_ASPECT_RATIO"),a=e.query("GET_IMAGE_PREVIEW_HEIGHT");if(!(i||o||a)){var s=e.ref,u=s.imageWidth,l=s.imageHeight;if(u&&l){var c=e.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),f=e.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),d=(n.getMetadata("exif")||{}).orientation||-1;if(d>=5&&d<=8){var p=[l,u];u=p[0],l=p[1]}if(!N(n.file)||e.query("GET_IMAGE_PREVIEW_UPSCALE")){var E=2048/u;u*=E,l*=E}var m=l/u,g=(n.getMetadata("crop")||{}).aspectRatio||m,I=Math.max(c,Math.min(l,f)),h=e.rect.element.width,T=Math.min(h*g,I);e.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:n.id,height:T})}}}}}(t,r),t.ref.shouldRescale=!1),t.ref.shouldDrawPreview&&(requestAnimationFrame((function(){requestAnimationFrame((function(){t.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:r.id})}))})),t.ref.shouldDrawPreview=!1)))})))}})),{options:{allowImagePreview:[!0,n.BOOLEAN],imagePreviewFilterItem:[function(){return!0},n.FUNCTION],imagePreviewHeight:[null,n.INT],imagePreviewMinHeight:[44,n.INT],imagePreviewMaxHeight:[256,n.INT],imagePreviewMaxFileSize:[null,n.INT],imagePreviewZoomFactor:[2,n.INT],imagePreviewUpscale:[!1,n.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,n.INT],imagePreviewTransparencyIndicator:[null,n.STRING],imagePreviewCalculateAverageImageColor:[!1,n.BOOLEAN],imagePreviewMarkupShow:[!0,n.BOOLEAN],imagePreviewMarkupFilter:[function(){return!0},n.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:U})),U}()},32:function(e,t,r){
/*!
 * FilePondPluginFileValidateType 1.2.6
 * Licensed under MIT, https://opensource.org/licenses/MIT/
 * Please visit https://pqina.nl/filepond/ for details.
 */
e.exports=function(){"use strict";var e=function plugin(e){var t=e.addFilter,r=e.utils,n=r.Type,i=r.isString,o=r.replaceInString,a=r.guesstimateMimeType,s=r.getExtensionFromFilename,u=r.getFilenameFromURL,l=function isValidMimeType(e,t){return e.some((function(e){return/\*$/.test(e)?function mimeTypeMatchesWildCard(e,t){return(/^[^/]+/.exec(e)||[]).pop()===t.slice(0,-2)}(t,e):e===t}))},c=function validateFile(e,t,r){if(0===t.length)return!0;var n=function getItemType(e){var t="";if(i(e)){var r=u(e),n=s(r);n&&(t=a(n))}else t=e.type;return t}(e);return r?new Promise((function(i,o){r(e,n).then((function(e){l(t,e)?i():o()})).catch(o)})):l(t,n)};return t("SET_ATTRIBUTE_TO_OPTION_MAP",(function(e){return Object.assign(e,{accept:"acceptedFileTypes"})})),t("ALLOW_HOPPER_ITEM",(function(e,t){var r=t.query;return!r("GET_ALLOW_FILE_TYPE_VALIDATION")||c(e,r("GET_ACCEPTED_FILE_TYPES"))})),t("LOAD_FILE",(function(e,t){var r=t.query;return new Promise((function(t,n){if(r("GET_ALLOW_FILE_TYPE_VALIDATION")){var i=r("GET_ACCEPTED_FILE_TYPES"),a=r("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),s=c(e,i,a),u=function handleRejection(){var e=i.map(function applyMimeTypeMap(e){return function(t){return null!==e[t]&&(e[t]||t)}}(r("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"))).filter((function(e){return!1!==e}));n({status:{main:r("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:o(r("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:e.join(", "),allButLastType:e.slice(0,-1).join(", "),lastType:e[e.length-1]})}})};if("boolean"==typeof s)return s?t(e):u();s.then((function(){t(e)})).catch(u)}else t(e)}))})),{options:{allowFileTypeValidation:[!0,n.BOOLEAN],acceptedFileTypes:[[],n.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",n.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",n.STRING],fileValidateTypeLabelExpectedTypesMap:[{},n.OBJECT],fileValidateTypeDetectType:[null,n.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e}()},5:function(e,t){e.exports=function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},6:function(e,t){e.exports=function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},69:function(e,t,r){"use strict";r.r(t);var n=r(8),i=r(29),o=r.n(i),a=r(30),s=r.n(a),u=r(31),l=r.n(u),c=r(32),f=r.n(c),d=r(5),p=r.n(d),E=r(6),m=r.n(E),g=r(7),I=r.n(g);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var h=wp.i18n,T=h.__,sprintf=h.sprintf,v=function(){function FilePondSettings(){m()(this,FilePondSettings),this._timeout=7e3,this._url=KaliFormsFilePondObject.ajaxurl,this._labels=this.filePondLabels}return I()(FilePondSettings,[{key:"url",get:function get(){return this._url},set:function set(e){this._url=e}},{key:"timeout",get:function get(){return this._timeout},set:function set(e){this._timeout=parseInt(e)}},{key:"process",get:function get(){var e=this,t=this;return function(r,n,i,o,a,s,u){var l=new FormData;l.append("action","kaliforms_form_upload_file"),l.append(r,n,n.name),l.append("nonce",KaliFormsObject.ajax_nonce);var c=new XMLHttpRequest;return c.open("POST",e.url),c.upload.onprogress=function(e){s(e.lengthComputable,e.loaded,e.total)},c.onload=function(){if(c.status>=200&&c.status<300){if(t.isJson(c.response))if(JSON.parse(c.response).hasOwnProperty("errors"))return a("something went wrong");o(c.responseText)}else a("oh no")},c.send(l),{abort:function abort(){c.abort(),u()}}}}},{key:"revert",get:function get(){var e=this;return function(t,r,n){var i=new FormData;i.append("action","kaliforms_form_delete_uploaded_file"),i.append("id",parseFloat(t)),i.append("nonce",KaliFormsObject.ajax_nonce);var o=new XMLHttpRequest;o.open("POST",e.url),o.send(i),r()}}},{key:"settings",get:function get(){return function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({server:{url:this.url,timeout:this.timeout,process:this.process,revert:this.revert}},this._labels)}},{key:"filePondLabels",get:function get(){return{labelIdle:sprintf(T("Drag & Drop your files or %sBrowse%s","kali-forms"),'<span class="filepond--label-action">',"</span>"),labelInvalidField:T("Field contains invalid files","kali-forms"),labelFileWaitingForSize:T("Waiting for size","kali-forms"),labelFileSizeNotAvailable:T("Size not available","kali-forms"),labelFileLoading:T("Loading","kali-forms"),labelFileLoadError:T("Error during load","kali-forms"),labelFileProcessing:T("Uploading","kali-forms"),labelFileProcessingComplete:T("Upload complete","kali-forms"),labelFileProcessingAborted:T("Upload cancelled","kali-forms"),labelFileProcessingError:T("Error during upload","kali-forms"),labelFileProcessingRevertError:T("Error during revert","kali-forms"),labelFileRemoveError:T("Error during remove","kali-forms"),labelTapToCancel:T("tap to cancel","kali-forms"),labelTapToRetry:T("tap to retry","kali-forms"),labelTapToUndo:T("tap to undo","kali-forms"),labelButtonRemoveItem:T("Remove","kali-forms"),labelButtonAbortItemLoad:T("Abort","kali-forms"),labelButtonRetryItemLoad:T("Retry","kali-forms"),labelButtonAbortItemProcessing:T("Cancel","kali-forms"),labelButtonUndoItemProcessing:T("Undo","kali-forms"),labelButtonRetryItemProcessing:T("Retry","kali-forms"),labelButtonProcessItem:T("Upload","kali-forms")}}},{key:"isJson",value:function isJson(e){try{JSON.parse(e)}catch(e){return!1}return!0}}]),FilePondSettings}();n.registerPlugin(o.a),n.registerPlugin(s.a),n.registerPlugin(l.a),n.registerPlugin(f.a),document.addEventListener("DOMContentLoaded",(function(__){var e=new v;window.FilePond=n,window.generalFilePondSettings=e}))},7:function(e,t){function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},8:function(e,t,r){
/*!
 * FilePond 4.30.3
 * Licensed under MIT, https://opensource.org/licenses/MIT/
 * Please visit https://pqina.nl/filepond/ for details.
 */
!function(e){"use strict";var t=function isNode(e){return e instanceof HTMLElement},r=function createStore(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=Object.assign({},e),i=[],o=[],a=function getState(){return Object.assign({},n)},s=function processActionQueue(){var e=[].concat(i);return i.length=0,e},u=function processDispatchQueue(){var e=[].concat(o);o.length=0,e.forEach((function(e){var t=e.type,r=e.data;l(t,r)}))},l=function dispatch(e,t,r){!r||document.hidden?(p[e]&&p[e](t),i.push({type:e,data:t})):o.push({type:e,data:t})},c=function query(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return d[e]?(t=d)[e].apply(t,n):null},f={getState:a,processActionQueue:s,processDispatchQueue:u,dispatch:l,query:c},d={};t.forEach((function(e){d=Object.assign({},e(n),{},d)}));var p={};return r.forEach((function(e){p=Object.assign({},e(l,c,n),{},p)})),f},n=function forin(e,t){for(var r in e)e.hasOwnProperty(r)&&t(r,e[r])},i=function createObject(e){var t={};return n(e,(function(r){!function defineProperty(e,t,r){"function"!=typeof r?Object.defineProperty(e,t,Object.assign({},r)):e[t]=r}(t,r,e[r])})),t},o=function attr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null===r)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,r)},a="http://www.w3.org/2000/svg",s=["svg","path"],u=function isSVGElement(e){return s.includes(e)},l=function createElement(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"==typeof t&&(r=t,t=null);var i=u(e)?document.createElementNS(a,e):document.createElement(e);return t&&(u(e)?o(i,"class",t):i.className=t),n(r,(function(e,t){o(i,e,t)})),i},c=function appendChild(e){return function(t,r){void 0!==r&&e.children[r]?e.insertBefore(t,e.children[r]):e.appendChild(t)}},f=function appendChildView(e,t){return function(e,r){return void 0!==r?t.splice(r,0,e):t.push(e),e}},d=function removeChildView(e,t){return function(r){return t.splice(t.indexOf(r),1),r.element.parentNode&&e.removeChild(r.element),r}},p="undefined"!=typeof window&&void 0!==window.document,E=function isBrowser(){return p},m="children"in(E()?l("svg"):{})?function(e){return e.children.length}:function(e){return e.childNodes.length},g=function getViewRect(e,t,r,n){var i=r[0]||e.left,o=r[1]||e.top,a=i+e.width,s=o+e.height*(n[1]||1),u={element:Object.assign({},e),inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:i,top:o,right:a,bottom:s}};return t.filter((function(e){return!e.isRectIgnored()})).map((function(e){return e.rect})).forEach((function(e){I(u.inner,Object.assign({},e.inner)),I(u.outer,Object.assign({},e.outer))})),h(u.inner),u.outer.bottom+=u.element.marginBottom,u.outer.right+=u.element.marginRight,h(u.outer),u},I=function expandRect(e,t){t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},h=function calculateRectSize(e){e.width=e.right-e.left,e.height=e.bottom-e.top},T=function isNumber(e){return"number"==typeof e},v=function thereYet(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001;return Math.abs(e-t)<n&&Math.abs(r)<n},y=function easeInOutQuad(e){return e<.5?2*e*e:(4-2*e)*e-1},R={spring:function spring(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiffness,r=void 0===t?.5:t,n=e.damping,o=void 0===n?.75:n,a=e.mass,s=void 0===a?10:a,u=null,l=null,c=0,f=!1,d=function interpolate(e,t){if(!f){if(!T(u)||!T(l))return f=!0,void(c=0);v(l+=c+=-(l-u)*r/s,u,c*=o)||t?(l=u,c=0,f=!0,E.onupdate(l),E.oncomplete(l)):E.onupdate(l)}},p=function setTarget(e){if(T(e)&&!T(l)&&(l=e),null===u&&(u=e,l=e),l===(u=e)||void 0===u)return f=!0,c=0,E.onupdate(l),void E.oncomplete(l);f=!1},E=i({interpolate:d,target:{set:p,get:function get(){return u}},resting:{get:function get(){return f}},onupdate:function onupdate(e){},oncomplete:function oncomplete(e){}});return E},tween:function tween(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.duration,o=void 0===n?500:n,a=r.easing,s=void 0===a?y:a,u=r.delay,l=void 0===u?0:u,c=null,f=!0,d=!1,p=null,E=function interpolate(r,n){f||null===p||(null===c&&(c=r),r-c<l||((e=r-c-l)>=o||n?(e=1,t=d?0:1,m.onupdate(t*p),m.oncomplete(t*p),f=!0):(t=e/o,m.onupdate((e>=0?s(d?1-t:t):0)*p))))},m=i({interpolate:E,target:{get:function get(){return d?0:p},set:function set(e){if(null===p)return p=e,m.onupdate(e),void m.oncomplete(e);e<p?(p=1,d=!0):(d=!1,p=e),f=!1,c=null}},resting:{get:function get(){return f}},onupdate:function onupdate(e){},oncomplete:function oncomplete(e){}});return m}},O=function createAnimator(e,t,r){var n=e[t]&&"object"==typeof e[t][r]?e[t][r]:e[t]||e,i="string"==typeof n?n:n.type,o="object"==typeof n?Object.assign({},n):{};return R[i]?R[i](o):null},D=function addGetSet(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(t=Array.isArray(t)?t:[t]).forEach((function(t){e.forEach((function(e){var i=e,o=function getter(){return r[e]},a=function setter(t){return r[e]=t};"object"==typeof e&&(i=e.key,o=e.getter||o,a=e.setter||a),t[i]&&!n||(t[i]={get:o,set:a})}))}))},S=function isDefined(e){return null!=e},A={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},w=function propsHaveChanged(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!0;for(var r in t)if(t[r]!==e[r])return!0;return!1},b=function applyStyles(e,t){var r=t.opacity,n=t.perspective,i=t.translateX,o=t.translateY,a=t.scaleX,s=t.scaleY,u=t.rotateX,l=t.rotateY,c=t.rotateZ,f=t.originX,d=t.originY,p=t.width,E=t.height,m="",g="";(S(f)||S(d))&&(g+="transform-origin: "+(f||0)+"px "+(d||0)+"px;"),S(n)&&(m+="perspective("+n+"px) "),(S(i)||S(o))&&(m+="translate3d("+(i||0)+"px, "+(o||0)+"px, 0) "),(S(a)||S(s))&&(m+="scale3d("+(S(a)?a:1)+", "+(S(s)?s:1)+", 1) "),S(c)&&(m+="rotateZ("+c+"rad) "),S(u)&&(m+="rotateX("+u+"rad) "),S(l)&&(m+="rotateY("+l+"rad) "),m.length&&(g+="transform:"+m+";"),S(r)&&(g+="opacity:"+r+";",0===r&&(g+="visibility:hidden;"),r<1&&(g+="pointer-events:none;")),S(E)&&(g+="height:"+E+"px;"),S(p)&&(g+="width:"+p+"px;");var I=e.elementCurrentStyle||"";g.length===I.length&&g===I||(e.style.cssText=g,e.elementCurrentStyle=g)},L={styles:function styles(e){var t=e.mixinConfig,r=e.viewProps,n=e.viewInternalAPI,i=e.viewExternalAPI,o=e.view,a=Object.assign({},r),s={};D(t,[n,i],r);var u=function getRect(){return o.rect?g(o.rect,o.childViews,function getOffset(){return[r.translateX||0,r.translateY||0]}(),function getScale(){return[r.scaleX||0,r.scaleY||0]}()):null};return n.rect={get:u},i.rect={get:u},t.forEach((function(e){r[e]=void 0===a[e]?A[e]:a[e]})),{write:function write(){if(w(s,r))return b(o.element,r),Object.assign(s,Object.assign({},r)),!0},destroy:function destroy(){}}},listeners:function listeners(e){e.mixinConfig,e.viewProps,e.viewInternalAPI;var t=e.viewExternalAPI,r=(e.viewState,e.view),n=[],i=function addEvent(e){return function(t,r){e.addEventListener(t,r)}}(r.element),o=function removeEvent(e){return function(t,r){e.removeEventListener(t,r)}}(r.element);return t.on=function(e,t){n.push({type:e,fn:t}),i(e,t)},t.off=function(e,t){n.splice(n.findIndex((function(r){return r.type===e&&r.fn===t})),1),o(e,t)},{write:function write(){return!0},destroy:function destroy(){n.forEach((function(e){o(e.type,e.fn)}))}}},animations:function animations(e){var t=e.mixinConfig,r=e.viewProps,i=e.viewInternalAPI,o=e.viewExternalAPI,a=Object.assign({},r),animations=[];return n(t,(function(e,t){var n=O(t);n&&(n.onupdate=function(t){r[e]=t},n.target=a[e],D([{key:e,setter:function setter(e){n.target!==e&&(n.target=e)},getter:function getter(){return r[e]}}],[i,o],r,!0),animations.push(n))})),{write:function write(e){var t=document.hidden,r=!0;return animations.forEach((function(n){n.resting||(r=!1),n.interpolate(e,t)})),r},destroy:function destroy(){}}},apis:function apis(e){var t=e.mixinConfig,r=e.viewProps,n=e.viewExternalAPI;D(t,n,r)}},P=function updateRect(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.layoutCalculated||(e.paddingTop=parseInt(r.paddingTop,10)||0,e.marginTop=parseInt(r.marginTop,10)||0,e.marginRight=parseInt(r.marginRight,10)||0,e.marginBottom=parseInt(r.marginBottom,10)||0,e.marginLeft=parseInt(r.marginLeft,10)||0,t.layoutCalculated=!0),e.left=t.offsetLeft||0,e.top=t.offsetTop||0,e.width=t.offsetWidth||0,e.height=t.offsetHeight||0,e.right=e.left+e.width,e.bottom=e.top+e.height,e.scrollTop=t.scrollTop,e.hidden=null===t.offsetParent,e},M=function createView(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.tag,r=void 0===t?"div":t,n=e.name,o=void 0===n?null:n,a=e.attributes,s=void 0===a?{}:a,u=e.read,p=void 0===u?function(){}:u,E=e.write,I=void 0===E?function(){}:E,h=e.create,T=void 0===h?function(){}:h,v=e.destroy,y=void 0===v?function(){}:v,R=e.filterFrameActionsForChild,O=void 0===R?function(e,t){return t}:R,D=e.didCreateView,S=void 0===D?function(){}:D,A=e.didWriteView,w=void 0===A?function(){}:A,b=e.ignoreRect,M=void 0!==b&&b,C=e.ignoreRectUpdate,N=void 0!==C&&C,G=e.mixins,F=void 0===G?[]:G;return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l(r,"filepond--"+o,s),a=window.getComputedStyle(n,null),u=P(),E=null,h=!1,v=[],R=[],D={},A={},b=[I],C=[p],G=[y],x=function getElement(){return n},B=function getChildViews(){return v.concat()},U=function getReference(){return D},V=function createChildView(e){return function(t,r){return t(e,r)}},q=function getRect(){return E||(E=g(u,v,[0,0],[1,1]))},k=function getStyle(){return a},Y=function _read(){E=null,v.forEach((function(e){return e._read()})),!(N&&u.width&&u.height)&&P(u,n,a);var e={root:Q,props:t,rect:u};C.forEach((function(t){return t(e)}))},j=function _write(e,r,n){var i=0===r.length;return b.forEach((function(o){!1===o({props:t,root:Q,actions:r,timestamp:e,shouldOptimize:n})&&(i=!1)})),R.forEach((function(t){!1===t.write(e)&&(i=!1)})),v.filter((function(e){return!!e.element.parentNode})).forEach((function(t){t._write(e,O(t,r),n)||(i=!1)})),v.forEach((function(t,o){t.element.parentNode||(Q.appendChild(t.element,o),t._read(),t._write(e,O(t,r),n),i=!1)})),h=i,w({props:t,root:Q,actions:r,timestamp:e}),i},W=function _destroy(){R.forEach((function(e){return e.destroy()})),G.forEach((function(e){e({root:Q,props:t})})),v.forEach((function(e){return e._destroy()}))},z={element:{get:x},style:{get:k},childViews:{get:B}},H=Object.assign({},z,{rect:{get:q},ref:{get:U},is:function is(e){return o===e},appendChild:c(n),createChildView:V(e),linkView:function linkView(e){return v.push(e),e},unlinkView:function unlinkView(e){v.splice(v.indexOf(e),1)},appendChildView:f(0,v),removeChildView:d(n,v),registerWriter:function registerWriter(e){return b.push(e)},registerReader:function registerReader(e){return C.push(e)},registerDestroyer:function registerDestroyer(e){return G.push(e)},invalidateLayout:function invalidateLayout(){return n.layoutCalculated=!1},dispatch:e.dispatch,query:e.query}),X={element:{get:x},childViews:{get:B},rect:{get:q},resting:{get:function get(){return h}},isRectIgnored:function isRectIgnored(){return M},_read:Y,_write:j,_destroy:W},Z=Object.assign({},z,{rect:{get:function get(){return u}}});Object.keys(F).sort((function(e,t){return"styles"===e?1:"styles"===t?-1:0})).forEach((function(e){var r=L[e]({mixinConfig:F[e],viewProps:t,viewState:A,viewInternalAPI:H,viewExternalAPI:X,view:i(Z)});r&&R.push(r)}));var Q=i(H);T({root:Q,props:t});var K=m(n);return v.forEach((function(e,t){Q.appendChild(e.element,K+t)})),S(Q),i(X)}},C=function createRoute(e,t){return function(r){var n=r.root,i=r.props,o=r.actions,a=void 0===o?[]:o,s=r.timestamp,u=r.shouldOptimize;a.filter((function(t){return e[t.type]})).forEach((function(t){return e[t.type]({root:n,props:i,action:t.data,timestamp:s,shouldOptimize:u})})),t&&t({root:n,props:i,actions:a,timestamp:s,shouldOptimize:u})}},N=function insertBefore(e,t){return t.parentNode.insertBefore(e,t)},G=function insertAfter(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},F=function isArray(e){return Array.isArray(e)},x=function isEmpty(e){return null==e},B=function trim(e){return e.trim()},U=function toString(e){return""+e},V=function isBoolean(e){return"boolean"==typeof e},q=function toBoolean(e){return V(e)?e:"true"===e},k=function isString(e){return"string"==typeof e},Y=function toNumber(e){return T(e)?e:k(e)?U(e).replace(/[a-z]+/gi,""):0},j=function toInt(e){return parseInt(Y(e),10)},W=function toFloat(e){return parseFloat(Y(e))},z=function isInt(e){return T(e)&&isFinite(e)&&Math.floor(e)===e},H=function toBytes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(z(e))return e;var r=U(e).trim();return/MB$/i.test(r)?(r=r.replace(/MB$i/,"").trim(),j(r)*t*t):/KB/i.test(r)?(r=r.replace(/KB$i/,"").trim(),j(r)*t):j(r)},X=function isFunction(e){return"function"==typeof e},Z={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},Q=function createAction(e,t,r,n,i){if(null===t)return null;if("function"==typeof t)return t;var o={url:"GET"===r||"PATCH"===r?"?"+e+"=":"",method:r,headers:i,withCredentials:!1,timeout:n,onload:null,ondata:null,onerror:null};if(k(t))return o.url=t,o;if(Object.assign(o,t),k(o.headers)){var a=o.headers.split(/:(.+)/);o.headers={header:a[0],value:a[1]}}return o.withCredentials=q(o.withCredentials),o},K=function isObject(e){return"object"==typeof e&&null!==e},$=function getType(e){return F(e)?"array":function isNull(e){return null===e}(e)?"null":z(e)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(e)?"bytes":function isAPI(e){return K(e)&&k(e.url)&&K(e.process)&&K(e.revert)&&K(e.restore)&&K(e.fetch)}(e)?"api":typeof e},J={array:function toArray(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return x(e)?[]:F(e)?e:U(e).split(t).map(B).filter((function(e){return e.length}))},boolean:q,int:function int(e){return"bytes"===$(e)?H(e):j(e)},number:W,float:W,bytes:H,string:function string(e){return X(e)?e:U(e)},function:function _function(e){return function toFunctionReference(e){for(var t=self,r=e.split("."),n=null;n=r.shift();)if(!(t=t[n]))return null;return t}(e)},serverapi:function toServerAPI(e){return function createServerAPI(e){var t={};return t.url=k(e)?e:e.url||"",t.timeout=e.timeout?parseInt(e.timeout,10):0,t.headers=e.headers?e.headers:{},n(Z,(function(r){t[r]=Q(r,e[r],Z[r],t.timeout,t.headers)})),t.process=e.process||k(e)||e.url?t.process:null,t.remove=e.remove||null,delete t.headers,t}(e)},object:function object(e){try{return JSON.parse(function replaceSingleQuotes(e){return e.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",')}(e))}catch(e){return null}}},ee=function getValueByType(e,t,r){if(e===t)return e;var n=$(e);if(n!==r){var i=function convertTo(e,t){return J[t](e)}(e,r);if(n=$(i),null===i)throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+r+'"';e=i}return e},te=function createOptions(e){var t={};return n(e,(function(r){var n=e[r];t[r]=function createOption(e,t){var r=e;return{enumerable:!0,get:function get(){return r},set:function set(n){r=ee(n,e,t)}}}(n[0],n[1])})),i(t)},re=function createInitialState(e){return{items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:te(e)}},ne=function fromCamels(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.split(/(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join(t)},ie=function createOptionAPI(e,t){var r={};return n(t,(function(t){r[t]={get:function get(){return e.getState().options[t]},set:function set(r){e.dispatch("SET_"+ne(t,"_").toUpperCase(),{value:r})}}})),r},oe=function createOptionActions(e){return function(t,r,i){var o={};return n(e,(function(e){var r=ne(e,"_").toUpperCase();o["SET_"+r]=function(n){try{i.options[e]=n.value}catch(e){}t("DID_SET_"+r,{value:i.options[e]})}})),o}},ae=function createOptionQueries(e){return function(t){var r={};return n(e,(function(e){r["GET_"+ne(e,"_").toUpperCase()]=function(r){return t.options[e]}})),r}},se=1,ue=2,le=3,ce=4,fe=5,de=function getUniqueId(){return Math.random().toString(36).substr(2,9)};function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),i=n.value,o=i instanceof _AwaitValue;Promise.resolve(o?i.wrapped:i).then((function(e){o?resume("next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function send(e,n){return new Promise((function(i,o){var a={key:e,arg:n,resolve:i,reject:o,next:null};r?r=r.next=a:(t=r=a,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,i=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||_iterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};var pe=function arrayRemove(e,t){return e.splice(t,1)},Ee=function on(){var e=[],t=function off(t,r){pe(e,e.findIndex((function(e){return e.event===t&&(e.cb===r||!r)})))},r=function fire(t,r,n){e.filter((function(e){return e.event===t})).map((function(e){return e.cb})).forEach((function(e){return function run(e,t){t?e():document.hidden?Promise.resolve(1).then(e):setTimeout(e,0)}((function(){return e.apply(void 0,_toConsumableArray(r))}),n)}))};return{fireSync:function fireSync(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(e,n,!0)},fire:function fire(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(e,n,!1)},on:function on(t,r){e.push({event:t,cb:r})},onOnce:function onOnce(r,n){e.push({event:r,cb:function cb(){t(r,n),n.apply(void 0,arguments)}})},off:t}},_e=function copyObjectPropertiesToObject(e,t,r){Object.getOwnPropertyNames(e).filter((function(e){return!r.includes(e)})).forEach((function(r){return Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))},me=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],ge=function createItemAPI(e){var t={};return _e(e,t,me),t},Ie=function removeReleasedItems(e){e.forEach((function(t,r){t.released&&pe(e,r)}))},he={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},Te={INPUT:1,LIMBO:2,LOCAL:3},ve=function getNonNumeric(e){return/[^0-9]+/.exec(e)},ye=function getDecimalSeparator(){return ve(1.1.toLocaleString())[0]},Re={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},Oe=[],De=function applyFilterChain(e,t,r){return new Promise((function(n,i){var o=Oe.filter((function(t){return t.key===e})).map((function(e){return e.cb}));if(0!==o.length){var a=o.shift();o.reduce((function(e,t){return e.then((function(e){return t(e,r)}))}),a(t,r)).then((function(e){return n(e)})).catch((function(e){return i(e)}))}else n(t)}))},Se=function applyFilters(e,t,r){return Oe.filter((function(t){return t.key===e})).map((function(e){return e.cb(t,r)}))},Ae=function addFilter(e,t){return Oe.push({key:e,cb:t})},we=function getOptions(){return Object.assign({},be)},be={id:[null,Re.STRING],name:["filepond",Re.STRING],disabled:[!1,Re.BOOLEAN],className:[null,Re.STRING],required:[!1,Re.BOOLEAN],captureMethod:[null,Re.STRING],allowSyncAcceptAttribute:[!0,Re.BOOLEAN],allowDrop:[!0,Re.BOOLEAN],allowBrowse:[!0,Re.BOOLEAN],allowPaste:[!0,Re.BOOLEAN],allowMultiple:[!1,Re.BOOLEAN],allowReplace:[!0,Re.BOOLEAN],allowRevert:[!0,Re.BOOLEAN],allowRemove:[!0,Re.BOOLEAN],allowProcess:[!0,Re.BOOLEAN],allowReorder:[!1,Re.BOOLEAN],allowDirectoriesOnly:[!1,Re.BOOLEAN],storeAsFile:[!1,Re.BOOLEAN],forceRevert:[!1,Re.BOOLEAN],maxFiles:[null,Re.INT],checkValidity:[!1,Re.BOOLEAN],itemInsertLocationFreedom:[!0,Re.BOOLEAN],itemInsertLocation:["before",Re.STRING],itemInsertInterval:[75,Re.INT],dropOnPage:[!1,Re.BOOLEAN],dropOnElement:[!0,Re.BOOLEAN],dropValidation:[!1,Re.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],Re.ARRAY],instantUpload:[!0,Re.BOOLEAN],maxParallelUploads:[2,Re.INT],allowMinimumUploadDuration:[!0,Re.BOOLEAN],chunkUploads:[!1,Re.BOOLEAN],chunkForce:[!1,Re.BOOLEAN],chunkSize:[5e6,Re.INT],chunkRetryDelays:[[500,1e3,3e3],Re.ARRAY],server:[null,Re.SERVER_API],fileSizeBase:[1e3,Re.INT],labelFileSizeBytes:["bytes",Re.STRING],labelFileSizeKilobytes:["KB",Re.STRING],labelFileSizeMegabytes:["MB",Re.STRING],labelFileSizeGigabytes:["GB",Re.STRING],labelDecimalSeparator:[ye(),Re.STRING],labelThousandsSeparator:[function getThousandsSeparator(){var e=ye(),t=1e3.toLocaleString();return t!==1e3.toString()?ve(t)[0]:"."===e?",":"."}(),Re.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',Re.STRING],labelInvalidField:["Field contains invalid files",Re.STRING],labelFileWaitingForSize:["Waiting for size",Re.STRING],labelFileSizeNotAvailable:["Size not available",Re.STRING],labelFileCountSingular:["file in list",Re.STRING],labelFileCountPlural:["files in list",Re.STRING],labelFileLoading:["Loading",Re.STRING],labelFileAdded:["Added",Re.STRING],labelFileLoadError:["Error during load",Re.STRING],labelFileRemoved:["Removed",Re.STRING],labelFileRemoveError:["Error during remove",Re.STRING],labelFileProcessing:["Uploading",Re.STRING],labelFileProcessingComplete:["Upload complete",Re.STRING],labelFileProcessingAborted:["Upload cancelled",Re.STRING],labelFileProcessingError:["Error during upload",Re.STRING],labelFileProcessingRevertError:["Error during revert",Re.STRING],labelTapToCancel:["tap to cancel",Re.STRING],labelTapToRetry:["tap to retry",Re.STRING],labelTapToUndo:["tap to undo",Re.STRING],labelButtonRemoveItem:["Remove",Re.STRING],labelButtonAbortItemLoad:["Abort",Re.STRING],labelButtonRetryItemLoad:["Retry",Re.STRING],labelButtonAbortItemProcessing:["Cancel",Re.STRING],labelButtonUndoItemProcessing:["Undo",Re.STRING],labelButtonRetryItemProcessing:["Retry",Re.STRING],labelButtonProcessItem:["Upload",Re.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>',Re.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>',Re.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>',Re.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>',Re.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>',Re.STRING],oninit:[null,Re.FUNCTION],onwarning:[null,Re.FUNCTION],onerror:[null,Re.FUNCTION],onactivatefile:[null,Re.FUNCTION],oninitfile:[null,Re.FUNCTION],onaddfilestart:[null,Re.FUNCTION],onaddfileprogress:[null,Re.FUNCTION],onaddfile:[null,Re.FUNCTION],onprocessfilestart:[null,Re.FUNCTION],onprocessfileprogress:[null,Re.FUNCTION],onprocessfileabort:[null,Re.FUNCTION],onprocessfilerevert:[null,Re.FUNCTION],onprocessfile:[null,Re.FUNCTION],onprocessfiles:[null,Re.FUNCTION],onremovefile:[null,Re.FUNCTION],onpreparefile:[null,Re.FUNCTION],onupdatefiles:[null,Re.FUNCTION],onreorderfiles:[null,Re.FUNCTION],beforeDropFile:[null,Re.FUNCTION],beforeAddFile:[null,Re.FUNCTION],beforeRemoveFile:[null,Re.FUNCTION],beforePrepareFile:[null,Re.FUNCTION],stylePanelLayout:[null,Re.STRING],stylePanelAspectRatio:[null,Re.STRING],styleItemPanelAspectRatio:[null,Re.STRING],styleButtonRemoveItemPosition:["left",Re.STRING],styleButtonProcessItemPosition:["right",Re.STRING],styleLoadIndicatorPosition:["right",Re.STRING],styleProgressIndicatorPosition:["right",Re.STRING],styleButtonRemoveItemAlign:[!1,Re.BOOLEAN],files:[[],Re.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],Re.ARRAY]},Le=function getItemByQuery(e,t){return x(t)?e[0]||null:z(t)?e[t]||null:("object"==typeof t&&(t=t.id),e.find((function(e){return e.id===t}))||null)},Pe=function getNumericAspectRatioFromString(e){if(x(e))return e;if(/:/.test(e)){var t=e.split(":");return t[1]/t[0]}return parseFloat(e)},Me=function getActiveItems(e){return e.filter((function(e){return!e.archived}))},Ce={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4},Ne=null,Ge=[he.LOAD_ERROR,he.PROCESSING_ERROR,he.PROCESSING_REVERT_ERROR],Fe=[he.LOADING,he.PROCESSING,he.PROCESSING_QUEUED,he.INIT],xe=[he.PROCESSING_COMPLETE],Be=function isItemInErrorState(e){return Ge.includes(e.status)},Ue=function isItemInBusyState(e){return Fe.includes(e.status)},Ve=function isItemInReadyState(e){return xe.includes(e.status)},qe=function isAsync(e){return K(e.options.server)&&(K(e.options.server.process)||X(e.options.server.process))},ke=function queries(e){return{GET_STATUS:function GET_STATUS(){var t=Me(e.items),r=Ce.EMPTY,n=Ce.ERROR,i=Ce.BUSY,o=Ce.IDLE,a=Ce.READY;return 0===t.length?r:t.some(Be)?n:t.some(Ue)?i:t.some(Ve)?a:o},GET_ITEM:function GET_ITEM(t){return Le(e.items,t)},GET_ACTIVE_ITEM:function GET_ACTIVE_ITEM(t){return Le(Me(e.items),t)},GET_ACTIVE_ITEMS:function GET_ACTIVE_ITEMS(){return Me(e.items)},GET_ITEMS:function GET_ITEMS(){return e.items},GET_ITEM_NAME:function GET_ITEM_NAME(t){var r=Le(e.items,t);return r?r.filename:null},GET_ITEM_SIZE:function GET_ITEM_SIZE(t){var r=Le(e.items,t);return r?r.fileSize:null},GET_STYLES:function GET_STYLES(){return Object.keys(e.options).filter((function(e){return/^style/.test(e)})).map((function(t){return{name:t,value:e.options[t]}}))},GET_PANEL_ASPECT_RATIO:function GET_PANEL_ASPECT_RATIO(){return/circle/.test(e.options.stylePanelLayout)?1:Pe(e.options.stylePanelAspectRatio)},GET_ITEM_PANEL_ASPECT_RATIO:function GET_ITEM_PANEL_ASPECT_RATIO(){return e.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function GET_ITEMS_BY_STATUS(t){return Me(e.items).filter((function(e){return e.status===t}))},GET_TOTAL_ITEMS:function GET_TOTAL_ITEMS(){return Me(e.items).length},SHOULD_UPDATE_FILE_INPUT:function SHOULD_UPDATE_FILE_INPUT(){return e.options.storeAsFile&&function canUpdateFileInput(){if(null===Ne)try{var e=new DataTransfer;e.items.add(new File(["hello world"],"This_Works.txt"));var t=document.createElement("input");t.setAttribute("type","file"),t.files=e.files,Ne=1===t.files.length}catch(e){Ne=!1}return Ne}()&&!qe(e)},IS_ASYNC:function IS_ASYNC(){return qe(e)},GET_FILE_SIZE_LABELS:function GET_FILE_SIZE_LABELS(e){return{labelBytes:e("GET_LABEL_FILE_SIZE_BYTES")||void 0,labelKilobytes:e("GET_LABEL_FILE_SIZE_KILOBYTES")||void 0,labelMegabytes:e("GET_LABEL_FILE_SIZE_MEGABYTES")||void 0,labelGigabytes:e("GET_LABEL_FILE_SIZE_GIGABYTES")||void 0}}}},Ye=function limit(e,t,r){return Math.max(Math.min(r,e),t)},je=function isBase64DataURI(e){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(e)},We=function getFilenameFromURL(e){return e.split("/").pop().split("?").shift()},ze=function getExtensionFromFilename(e){return e.split(".").pop()},He=function guesstimateExtension(e){if("string"!=typeof e)return"";var t=e.split("/").pop();return/svg/.test(t)?"svg":/zip|compressed/.test(t)?"zip":/plain/.test(t)?"txt":/msword/.test(t)?"doc":/[a-z]+/.test(t)?"jpeg"===t?"jpg":t:""},Xe=function leftPad(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(t+e).slice(-t.length)},Ze=function getDateString(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return e.getFullYear()+"-"+Xe(e.getMonth()+1,"00")+"-"+Xe(e.getDate(),"00")+"_"+Xe(e.getHours(),"00")+"-"+Xe(e.getMinutes(),"00")+"-"+Xe(e.getSeconds(),"00")},Qe=function getFileFromBlob(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i="string"==typeof r?e.slice(0,e.size,r):e.slice(0,e.size,e.type);return i.lastModifiedDate=new Date,e._relativePath&&(i._relativePath=e._relativePath),k(t)||(t=Ze()),t&&null===n&&ze(t)?i.name=t:(n=n||He(i.type),i.name=t+(n?"."+n:"")),i},Ke=function createBlob(e,t){var r=function getBlobBuilder(){return window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder}();if(r){var n=new r;return n.append(e),n.getBlob(t)}return new Blob([e],{type:t})},$e=function getMimeTypeFromBase64DataURI(e){return(/^data:(.+);/.exec(e)||[])[1]||null},Je=function getBlobFromBase64DataURI(e){var t=$e(e);return function getBlobFromByteStringWithMimeType(e,t){for(var r=new ArrayBuffer(e.length),n=new Uint8Array(r),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return Ke(r,t)}(function getByteStringFromBase64DataURI(e){return atob(function getBase64DataFromBase64DataURI(e){return e.split(",")[1].replace(/\s/g,"")}(e))}(e),t)},et=function getFileNameFromHeader(e){if(!/^content-disposition:/i.test(e))return null;var t=e.split(/filename=|filename\*=.+''/).splice(1).map((function(e){return e.trim().replace(/^["']|[;"']{0,2}$/g,"")})).filter((function(e){return e.length}));return t.length?decodeURI(t[t.length-1]):null},tt=function getFileSizeFromHeader(e){if(/content-length:/i.test(e)){var t=e.match(/[0-9]+/)[0];return t?parseInt(t,10):null}return null},rt=function getTranfserIdFromHeader(e){return/x-content-transfer-id:/i.test(e)&&(e.split(":")[1]||"").trim()||null},nt=function getFileInfoFromHeaders(e){var t={source:null,name:null,size:null},r=e.split("\n"),n=!0,i=!1,o=void 0;try{for(var a,s=r[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,l=et(u);if(l)t.name=l;else{var c=tt(u);if(c)t.size=c;else{var f=rt(u);f&&(t.source=f)}}}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return t},it=function createFileLoader(e){var t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},r=function loadURL(r){e?(t.timestamp=Date.now(),t.request=e(r,(function(e){t.duration=Date.now()-t.timestamp,t.complete=!0,e instanceof Blob&&(e=Qe(e,e.name||We(r))),n.fire("load",e instanceof Blob?e:e?e.body:null)}),(function(e){n.fire("error","string"==typeof e?{type:"error",code:0,body:e}:e)}),(function(e,r,i){i&&(t.size=i),t.duration=Date.now()-t.timestamp,e?(t.progress=r/i,n.fire("progress",t.progress)):t.progress=null}),(function(){n.fire("abort")}),(function(e){var r=nt("string"==typeof e?e:e.headers);n.fire("meta",{size:t.size||r.size,filename:r.name,source:r.source})}))):n.fire("error",{type:"error",body:"Can't load URL",code:400})},n=Object.assign({},Ee(),{setSource:function setSource(e){return t.source=e},getProgress:function getProgress(){return t.progress},abort:function abort(){t.request&&t.request.abort&&t.request.abort()},load:function load(){var e=t.source;n.fire("init",e),e instanceof File?n.fire("load",e):e instanceof Blob?n.fire("load",Qe(e,e.name)):je(e)?n.fire("load",function getFileFromBase64DataURI(e,t,r){return Qe(Je(e),t,null,r)}(e)):r(e)}});return n},ot=function isGet(e){return/GET|HEAD/.test(e)},at=function sendRequest(e,t,r){var n={onheaders:function onheaders(){},onprogress:function onprogress(){},onload:function onload(){},ontimeout:function ontimeout(){},onerror:function onerror(){},onabort:function onabort(){},abort:function abort(){i=!0,a.abort()}},i=!1,o=!1;r=Object.assign({method:"POST",headers:{},withCredentials:!1},r),t=encodeURI(t),ot(r.method)&&e&&(t=""+t+encodeURIComponent("string"==typeof e?e:JSON.stringify(e)));var a=new XMLHttpRequest;return(ot(r.method)?a:a.upload).onprogress=function(e){i||n.onprogress(e.lengthComputable,e.loaded,e.total)},a.onreadystatechange=function(){a.readyState<2||4===a.readyState&&0===a.status||o||(o=!0,n.onheaders(a))},a.onload=function(){a.status>=200&&a.status<300?n.onload(a):n.onerror(a)},a.onerror=function(){return n.onerror(a)},a.onabort=function(){i=!0,n.onabort()},a.ontimeout=function(){return n.ontimeout(a)},a.open(r.method,t,!0),z(r.timeout)&&(a.timeout=r.timeout),Object.keys(r.headers).forEach((function(e){var t=unescape(encodeURIComponent(r.headers[e]));a.setRequestHeader(e,t)})),r.responseType&&(a.responseType=r.responseType),r.withCredentials&&(a.withCredentials=!0),a.send(e),n},st=function createResponse(e,t,r,n){return{type:e,code:t,body:r,headers:n}},ut=function createTimeoutResponse(e){return function(t){e(st("error",0,"Timeout",t.getAllResponseHeaders()))}},lt=function hasQS(e){return/\?/.test(e)},ct=function buildURL(){for(var e="",t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){e+=lt(e)&&lt(t)?t.replace(/\?/,"&"):t})),e},ft=function createFetchFunction(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if("function"==typeof t)return t;if(!t||!k(t.url))return null;var r=t.onload||function(e){return e},n=t.onerror||function(e){return null};return function(i,o,a,s,u,l){var c=at(i,ct(e,t.url),Object.assign({},t,{responseType:"blob"}));return c.onload=function(e){var n=e.getAllResponseHeaders(),a=nt(n).name||We(i);o(st("load",e.status,"HEAD"===t.method?null:Qe(r(e.response),a),n))},c.onerror=function(e){a(st("error",e.status,n(e.response)||e.statusText,e.getAllResponseHeaders()))},c.onheaders=function(e){l(st("headers",e.status,null,e.getAllResponseHeaders()))},c.ontimeout=ut(a),c.onprogress=s,c.onabort=u,c}},dt=0,pt=1,Et=2,_t=3,mt=4,gt=function processFileChunked(e,t,r,n,i,o,a,s,u,l,c){for(var f=[],d=c.chunkTransferId,p=c.chunkServer,E=c.chunkSize,m=c.chunkRetryDelays,g={serverId:d,aborted:!1},I=t.ondata||function(e){return e},h=t.onload||function(e,t){return"HEAD"===t?e.getResponseHeader("Upload-Offset"):e.response},T=t.onerror||function(e){return null},v=Math.floor(n.size/E),y=0;y<=v;y++){var R=y*E,O=n.slice(R,R+E,"application/offset+octet-stream");f[y]={index:y,size:O.size,offset:R,data:O,file:n,progress:0,retries:_toConsumableArray(m),status:dt,error:null,request:null,timeout:null}}var D=function canProcessChunk(e){return e.status===dt||e.status===_t},S=function processChunk(t){if(!g.aborted)if(t=t||f.find(D)){t.status=Et,t.progress=null;var r=p.ondata||function(e){return e},i=p.onerror||function(e){return null},s=ct(e,p.url,g.serverId),l="function"==typeof p.headers?p.headers(t):Object.assign({},p.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":t.offset,"Upload-Length":n.size,"Upload-Name":n.name}),c=t.request=at(r(t.data),s,Object.assign({},p,{headers:l}));c.onload=function(){t.status=pt,t.request=null,b()},c.onprogress=function(e,r,n){t.progress=e?r:null,w()},c.onerror=function(e){t.status=_t,t.request=null,t.error=i(e.response)||e.statusText,A(t)||a(st("error",e.status,i(e.response)||e.statusText,e.getAllResponseHeaders()))},c.ontimeout=function(e){t.status=_t,t.request=null,A(t)||ut(a)(e)},c.onabort=function(){t.status=dt,t.request=null,u()}}else f.every((function(e){return e.status===pt}))&&function completeProcessingChunks(){o(g.serverId)}()},A=function retryProcessChunk(e){return 0!==e.retries.length&&(e.status=mt,clearTimeout(e.timeout),e.timeout=setTimeout((function(){S(e)}),e.retries.shift()),!0)},w=function updateTotalProgress(){var e=f.reduce((function(e,t){return null===e||null===t.progress?null:e+t.progress}),0);if(null===e)return s(!1,0,0);var t=f.reduce((function(e,t){return e+t.size}),0);s(!0,e,t)},b=function processChunks(){f.filter((function(e){return e.status===Et})).length>=1||S()};return g.serverId?function requestTransferOffset(r){var n=ct(e,p.url,g.serverId),i={headers:"function"==typeof t.headers?t.headers(g.serverId):Object.assign({},t.headers),method:"HEAD"},o=at(null,n,i);o.onload=function(e){return r(h(e,i.method))},o.onerror=function(e){return a(st("error",e.status,T(e.response)||e.statusText,e.getAllResponseHeaders()))},o.ontimeout=ut(a)}((function(e){g.aborted||(f.filter((function(t){return t.offset<e})).forEach((function(e){e.status=pt,e.progress=e.size})),b())})):function requestTransferId(o){var s=new FormData;K(i)&&s.append(r,JSON.stringify(i));var u="function"==typeof t.headers?t.headers(n,i):Object.assign({},t.headers,{"Upload-Length":n.size}),l=Object.assign({},t,{headers:u}),c=at(I(s),ct(e,t.url),l);c.onload=function(e){return o(h(e,l.method))},c.onerror=function(e){return a(st("error",e.status,T(e.response)||e.statusText,e.getAllResponseHeaders()))},c.ontimeout=ut(a)}((function(e){g.aborted||(l(e),g.serverId=e,b())})),{abort:function abort(){g.aborted=!0,function abortChunks(){f.forEach((function(e){clearTimeout(e.timeout),e.request&&e.request.abort()}))}()}}},It=function createFileProcessorFunction(e,t,r,n){return function(i,o,a,s,u,l,c){if(i){var f=n.chunkUploads,d=f&&i.size>n.chunkSize,p=f&&(d||n.chunkForce);if(i instanceof Blob&&p)return gt(e,t,r,i,o,a,s,u,l,c,n);var E=t.ondata||function(e){return e},m=t.onload||function(e){return e},g=t.onerror||function(e){return null},I="function"==typeof t.headers?t.headers(i,o)||{}:Object.assign({},t.headers),h=Object.assign({},t,{headers:I}),T=new FormData;K(o)&&T.append(r,JSON.stringify(o)),(i instanceof Blob?[{name:null,file:i}]:i).forEach((function(e){T.append(r,e.file,null===e.name?e.file.name:""+e.name+e.file.name)}));var v=at(E(T),ct(e,t.url),h);return v.onload=function(e){a(st("load",e.status,m(e.response),e.getAllResponseHeaders()))},v.onerror=function(e){s(st("error",e.status,g(e.response)||e.statusText,e.getAllResponseHeaders()))},v.ontimeout=ut(s),v.onprogress=u,v.onabort=l,v}}},ht=function createRevertFunction(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if("function"==typeof t)return t;if(!t||!k(t.url))return function(e,t){return t()};var r=t.onload||function(e){return e},n=t.onerror||function(e){return null};return function(i,o,a){var s=at(i,e+t.url,t);return s.onload=function(e){o(st("load",e.status,r(e.response),e.getAllResponseHeaders()))},s.onerror=function(e){a(st("error",e.status,n(e.response)||e.statusText,e.getAllResponseHeaders()))},s.ontimeout=ut(a),s}},Tt=function getRandomNumber(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e+Math.random()*(t-e)},vt=function createFileProcessor(e,t){var r={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},n=t.allowMinimumUploadDuration,i=function abort(){r.request&&(r.perceivedPerformanceUpdater.clear(),r.request.abort&&r.request.abort(),r.complete=!0)},o=n?function(){return r.progress?Math.min(r.progress,r.perceivedProgress):null}:function(){return r.progress||null},a=n?function(){return Math.min(r.duration,r.perceivedDuration)}:function(){return r.duration},s=Object.assign({},Ee(),{process:function process(t,i){var o=function progressFn(){0!==r.duration&&null!==r.progress&&s.fire("progress",s.getProgress())},a=function completeFn(){r.complete=!0,s.fire("load-perceived",r.response.body)};s.fire("start"),r.timestamp=Date.now(),r.perceivedPerformanceUpdater=function createPerceivedPerformanceUpdater(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:25,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,i=null,o=Date.now(),a=function tick(){var a=Date.now()-o,s=Tt(r,n);a+s>t&&(s=a+s-t);var u=a/t;u>=1||document.hidden?e(1):(e(u),i=setTimeout(tick,s))};return t>0&&a(),{clear:function clear(){clearTimeout(i)}}}((function(e){r.perceivedProgress=e,r.perceivedDuration=Date.now()-r.timestamp,o(),r.response&&1===r.perceivedProgress&&!r.complete&&a()}),n?Tt(750,1500):0),r.request=e(t,i,(function(e){r.response=K(e)?e:{type:"load",code:200,body:""+e,headers:{}},r.duration=Date.now()-r.timestamp,r.progress=1,s.fire("load",r.response.body),(!n||n&&1===r.perceivedProgress)&&a()}),(function(e){r.perceivedPerformanceUpdater.clear(),s.fire("error",K(e)?e:{type:"error",code:0,body:""+e})}),(function(e,t,n){r.duration=Date.now()-r.timestamp,r.progress=e?t/n:null,o()}),(function(){r.perceivedPerformanceUpdater.clear(),s.fire("abort",r.response?r.response.body:null)}),(function(e){s.fire("transfer",e)}))},abort:i,getProgress:o,getDuration:a,reset:function reset(){i(),r.complete=!1,r.perceivedProgress=0,r.progress=0,r.timestamp=null,r.perceivedDuration=0,r.duration=0,r.request=null,r.response=null}});return s},yt=function getFilenameWithoutExtension(e){return e.substr(0,e.lastIndexOf("."))||e},Rt=function createFileStub(e){var t=[e.name,e.size,e.type];return e instanceof Blob||je(e)?t[0]=e.name||Ze():je(e)?(t[1]=e.length,t[2]=$e(e)):k(e)&&(t[0]=We(e),t[1]=0,t[2]="application/octet-stream"),{name:t[0],size:t[1],type:t[2]}},Ot=function isFile(e){return!!(e instanceof File||e instanceof Blob&&e.name)},Dt=function deepCloneObject(e){if(!K(e))return e;var t=F(e)?[]:{};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];t[r]=n&&K(n)?deepCloneObject(n):n}return t},St=function getItemById(e,t){var r=function getItemIndexByQuery(e,t){return x(t)?0:k(t)?e.findIndex((function(e){return e.id===t})):-1}(e,t);if(!(r<0))return e[r]||null},At=function fetchBlob(e,t,r,n,i,o){var a=at(null,e,{method:"GET",responseType:"blob"});return a.onload=function(r){var n=r.getAllResponseHeaders(),i=nt(n).name||We(e);t(st("load",r.status,Qe(r.response,i),n))},a.onerror=function(e){r(st("error",e.status,e.statusText,e.getAllResponseHeaders()))},a.onheaders=function(e){o(st("headers",e.status,null,e.getAllResponseHeaders()))},a.ontimeout=ut(r),a.onprogress=n,a.onabort=i,a},wt=function getDomainFromURL(e){return 0===e.indexOf("//")&&(e=location.protocol+e),e.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]},bt=function dynamicLabel(e){return function(){return X(e)?e.apply(void 0,arguments):e}},Lt=function listUpdated(e,t){clearTimeout(t.listUpdateTimeout),t.listUpdateTimeout=setTimeout((function(){e("DID_UPDATE_ITEMS",{items:Me(t.items)})}),0)},Pt=function optionalPromise(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new Promise((function(t){if(!e)return t(!0);var n=e.apply(void 0,r);return null==n?t(!0):"boolean"==typeof n?t(n):void("function"==typeof n.then&&n.then(t))}))},Mt=function sortItems(e,t){e.items.sort((function(e,r){return t(ge(e),ge(r))}))},Ct=function getItemByQueryFromState(e,t){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.query,i=r.success,o=void 0===i?function(){}:i,a=r.failure,s=void 0===a?function(){}:a,u=_objectWithoutProperties(r,["query","success","failure"]),l=Le(e.items,n);l?t(l,o,s,u||{}):s({error:st("error",0,"Item not found"),file:null})}},Nt=function actions(e,t,r){return{ABORT_ALL:function ABORT_ALL(){Me(r.items).forEach((function(e){e.freeze(),e.abortLoad(),e.abortProcessing()}))},DID_SET_FILES:function DID_SET_FILES(t){var n=t.value,i=(void 0===n?[]:n).map((function(e){return{source:e.source?e.source:e,options:e.options}})),o=Me(r.items);o.forEach((function(t){i.find((function(e){return e.source===t.source||e.source===t.file}))||e("REMOVE_ITEM",{query:t,remove:!1})})),o=Me(r.items),i.forEach((function(t,r){o.find((function(e){return e.source===t.source||e.file===t.source}))||e("ADD_ITEM",Object.assign({},t,{interactionMethod:fe,index:r}))}))},DID_UPDATE_ITEM_METADATA:function DID_UPDATE_ITEM_METADATA(n){var i=n.id,o=n.action,a=n.change;a.silent||(clearTimeout(r.itemUpdateTimeout),r.itemUpdateTimeout=setTimeout((function(){var n=St(r.items,i);if(t("IS_ASYNC")){n.origin===Te.LOCAL&&e("DID_LOAD_ITEM",{id:n.id,error:null,serverFileReference:n.source});var s=function upload(){setTimeout((function(){e("REQUEST_ITEM_PROCESSING",{query:i})}),32)};return n.status===he.PROCESSING_COMPLETE?function revert(e){n.revert(ht(r.options.server.url,r.options.server.revert),t("GET_FORCE_REVERT")).then(e?s:function(){}).catch((function(){}))}(r.options.instantUpload):n.status===he.PROCESSING?function abort(e){n.abortProcessing().then(e?s:function(){})}(r.options.instantUpload):void(r.options.instantUpload&&s())}De("SHOULD_PREPARE_OUTPUT",!1,{item:n,query:t,action:o,change:a}).then((function(r){var o=t("GET_BEFORE_PREPARE_FILE");o&&(r=o(n,r)),r&&e("REQUEST_PREPARE_OUTPUT",{query:i,item:n,success:function success(t){e("DID_PREPARE_OUTPUT",{id:i,file:t})}},!0)}))}),0))},MOVE_ITEM:function MOVE_ITEM(e){var t=e.query,n=e.index,i=Le(r.items,t);if(i){var o=r.items.indexOf(i);o!==(n=Ye(n,0,r.items.length-1))&&r.items.splice(n,0,r.items.splice(o,1)[0])}},SORT:function SORT(n){var i=n.compare;Mt(r,i),e("DID_SORT_ITEMS",{items:t("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function ADD_ITEMS(r){var n=r.items,i=r.index,o=r.interactionMethod,a=r.success,s=void 0===a?function(){}:a,u=r.failure,l=void 0===u?function(){}:u,c=i;if(-1===i||void 0===i){var f=t("GET_ITEM_INSERT_LOCATION"),d=t("GET_TOTAL_ITEMS");c="before"===f?0:d}var p=t("GET_IGNORED_FILES"),E=n.filter((function isValidFile(e){return Ot(e)?!p.includes(e.name.toLowerCase()):!x(e)})).map((function(t){return new Promise((function(r,n){e("ADD_ITEM",{interactionMethod:o,source:t.source||t,success:r,failure:n,index:c++,options:t.options||{}})}))}));Promise.all(E).then(s).catch(l)},ADD_ITEM:function ADD_ITEM(n){var o=n.source,a=n.index,s=void 0===a?-1:a,u=n.interactionMethod,l=n.success,c=void 0===l?function(){}:l,f=n.failure,d=void 0===f?function(){}:f,p=n.options,E=void 0===p?{}:p;if(x(o))d({error:st("error",0,"No source"),file:null});else if(!Ot(o)||!r.options.ignoredFiles.includes(o.name.toLowerCase())){if(!function hasRoomForItem(e){var t=Me(e.items).length;if(!e.options.allowMultiple)return 0===t;var r=e.options.maxFiles;return null===r||t<r}(r)){if(r.options.allowMultiple||!r.options.allowMultiple&&!r.options.allowReplace){var m=st("warning",0,"Max files");return e("DID_THROW_MAX_FILES",{source:o,error:m}),void d({error:m,file:null})}var g=Me(r.items)[0];if(g.status===he.PROCESSING_COMPLETE||g.status===he.PROCESSING_REVERT_ERROR){var I=t("GET_FORCE_REVERT");if(g.revert(ht(r.options.server.url,r.options.server.revert),I).then((function(){I&&e("ADD_ITEM",{source:o,index:s,interactionMethod:u,success:c,failure:d,options:E})})).catch((function(){})),I)return}e("REMOVE_ITEM",{query:g.id})}var h="local"===E.type?Te.LOCAL:"limbo"===E.type?Te.LIMBO:Te.INPUT,T=function createItem(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=de(),o={archived:!1,frozen:!1,released:!1,source:null,file:r,serverFileReference:t,transferId:null,processingAborted:!1,status:t?he.PROCESSING_COMPLETE:he.INIT,activeLoader:null,activeProcessor:null},a=null,s={},u=function setStatus(e){return o.status=e},l=function fire(e){if(!o.released&&!o.frozen){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];O.fire.apply(O,[e].concat(r))}},c=function getFileExtension(){return ze(o.file.name)},f=function getFileType(){return o.file.type},d=function getFileSize(){return o.file.size},p=function getFile(){return o.file},E=function load(t,r,n){o.source=t,O.fireSync("init"),o.file?O.fireSync("load-skip"):(o.file=Rt(t),r.on("init",(function(){l("load-init")})),r.on("meta",(function(t){o.file.size=t.size,o.file.filename=t.filename,t.source&&(e=Te.LIMBO,o.serverFileReference=t.source,o.status=he.PROCESSING_COMPLETE),l("load-meta")})),r.on("progress",(function(e){u(he.LOADING),l("load-progress",e)})),r.on("error",(function(e){u(he.LOAD_ERROR),l("load-request-error",e)})),r.on("abort",(function(){u(he.INIT),l("load-abort")})),r.on("load",(function(t){o.activeLoader=null;var r=function success(t){o.file=Ot(t)?t:o.file,e===Te.LIMBO&&o.serverFileReference?u(he.PROCESSING_COMPLETE):u(he.IDLE),l("load")};o.serverFileReference?r(t):n(t,r,(function error(e){o.file=t,l("load-meta"),u(he.LOAD_ERROR),l("load-file-error",e)}))})),r.setSource(t),o.activeLoader=r,r.load())},m=function retryLoad(){o.activeLoader&&o.activeLoader.load()},g=function abortLoad(){o.activeLoader?o.activeLoader.abort():(u(he.INIT),l("load-abort"))},I=function process(e,t){if(o.processingAborted)o.processingAborted=!1;else if(u(he.PROCESSING),a=null,o.file instanceof Blob){e.on("load",(function(e){o.transferId=null,o.serverFileReference=e})),e.on("transfer",(function(e){o.transferId=e})),e.on("load-perceived",(function(e){o.activeProcessor=null,o.transferId=null,o.serverFileReference=e,u(he.PROCESSING_COMPLETE),l("process-complete",e)})),e.on("start",(function(){l("process-start")})),e.on("error",(function(e){o.activeProcessor=null,u(he.PROCESSING_ERROR),l("process-error",e)})),e.on("abort",(function(e){o.activeProcessor=null,o.serverFileReference=e,u(he.IDLE),l("process-abort"),a&&a()})),e.on("progress",(function(e){l("process-progress",e)}));var r=console.error;t(o.file,(function success(t){o.archived||e.process(t,Object.assign({},s))}),r),o.activeProcessor=e}else O.on("load",(function(){process(e,t)}))},h=function requestProcessing(){o.processingAborted=!1,u(he.PROCESSING_QUEUED)},T=function abortProcessing(){return new Promise((function(e){if(!o.activeProcessor)return o.processingAborted=!0,u(he.IDLE),l("process-abort"),void e();a=function abortProcessingRequestComplete(){e()},o.activeProcessor.abort()}))},v=function revert(e,t){return new Promise((function(r,n){var i=null!==o.serverFileReference?o.serverFileReference:o.transferId;null!==i?(e(i,(function(){o.serverFileReference=null,o.transferId=null,r()}),(function(e){t?(u(he.PROCESSING_REVERT_ERROR),l("process-revert-error"),n(e)):r()})),u(he.IDLE),l("process-revert")):r()}))},y=function setMetadata(e,t,r){var n=e.split("."),i=n[0],o=n.pop(),a=s;n.forEach((function(e){return a=a[e]})),JSON.stringify(a[o])!==JSON.stringify(t)&&(a[o]=t,l("metadata-update",{key:i,value:s[i],silent:r}))},R=function getMetadata(e){return Dt(e?s[e]:s)},O=Object.assign({id:{get:function get(){return n}},origin:{get:function get(){return e},set:function set(t){return e=t}},serverId:{get:function get(){return o.serverFileReference}},transferId:{get:function get(){return o.transferId}},status:{get:function get(){return o.status}},filename:{get:function get(){return o.file.name}},filenameWithoutExtension:{get:function get(){return yt(o.file.name)}},fileExtension:{get:c},fileType:{get:f},fileSize:{get:d},file:{get:p},relativePath:{get:function get(){return o.file._relativePath}},source:{get:function get(){return o.source}},getMetadata:R,setMetadata:function setMetadata(e,t,r){if(K(e)){var n=e;return Object.keys(n).forEach((function(e){y(e,n[e],t)})),e}return y(e,t,r),t},extend:function extend(e,t){return D[e]=t},abortLoad:g,retryLoad:m,requestProcessing:h,abortProcessing:T,load:E,process:I,revert:v},Ee(),{freeze:function freeze(){return o.frozen=!0},release:function release(){return o.released=!0},released:{get:function get(){return o.released}},archive:function archive(){return o.archived=!0},archived:{get:function get(){return o.archived}}}),D=i(O);return D}(h,h===Te.INPUT?null:o,E.file);Object.keys(E.metadata||{}).forEach((function(e){T.setMetadata(e,E.metadata[e])})),Se("DID_CREATE_ITEM",T,{query:t,dispatch:e});var v=t("GET_ITEM_INSERT_LOCATION");r.options.itemInsertLocationFreedom||(s="before"===v?-1:r.items.length),function insertItem(e,t,r){x(t)||(void 0===r?e.push(t):function arrayInsert(e,t,r){e.splice(t,0,r)}(e,r=Ye(r,0,e.length),t))}(r.items,T,s),X(v)&&o&&Mt(r,v);var y=T.id;T.on("init",(function(){e("DID_INIT_ITEM",{id:y})})),T.on("load-init",(function(){e("DID_START_ITEM_LOAD",{id:y})})),T.on("load-meta",(function(){e("DID_UPDATE_ITEM_META",{id:y})})),T.on("load-progress",(function(t){e("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:y,progress:t})})),T.on("load-request-error",(function(t){var n=bt(r.options.labelFileLoadError)(t);if(t.code>=400&&t.code<500)return e("DID_THROW_ITEM_INVALID",{id:y,error:t,status:{main:n,sub:t.code+" ("+t.body+")"}}),void d({error:t,file:ge(T)});e("DID_THROW_ITEM_LOAD_ERROR",{id:y,error:t,status:{main:n,sub:r.options.labelTapToRetry}})})),T.on("load-file-error",(function(t){e("DID_THROW_ITEM_INVALID",{id:y,error:t.status,status:t.status}),d({error:t.status,file:ge(T)})})),T.on("load-abort",(function(){e("REMOVE_ITEM",{query:y})})),T.on("load-skip",(function(){e("COMPLETE_LOAD_ITEM",{query:y,item:T,data:{source:o,success:c}})})),T.on("load",(function(){var n=function handleAdd(n){n?(T.on("metadata-update",(function(t){e("DID_UPDATE_ITEM_METADATA",{id:y,change:t})})),De("SHOULD_PREPARE_OUTPUT",!1,{item:T,query:t}).then((function(n){var i=t("GET_BEFORE_PREPARE_FILE");i&&(n=i(T,n));var a=function loadComplete(){e("COMPLETE_LOAD_ITEM",{query:y,item:T,data:{source:o,success:c}}),Lt(e,r)};n?e("REQUEST_PREPARE_OUTPUT",{query:y,item:T,success:function success(t){e("DID_PREPARE_OUTPUT",{id:y,file:t}),a()}},!0):a()}))):e("REMOVE_ITEM",{query:y})};De("DID_LOAD_ITEM",T,{query:t,dispatch:e}).then((function(){Pt(t("GET_BEFORE_ADD_FILE"),ge(T)).then(n)})).catch((function(t){if(!t||!t.error||!t.status)return n(!1);e("DID_THROW_ITEM_INVALID",{id:y,error:t.error,status:t.status})}))})),T.on("process-start",(function(){e("DID_START_ITEM_PROCESSING",{id:y})})),T.on("process-progress",(function(t){e("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:y,progress:t})})),T.on("process-error",(function(t){e("DID_THROW_ITEM_PROCESSING_ERROR",{id:y,error:t,status:{main:bt(r.options.labelFileProcessingError)(t),sub:r.options.labelTapToRetry}})})),T.on("process-revert-error",(function(t){e("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:y,error:t,status:{main:bt(r.options.labelFileProcessingRevertError)(t),sub:r.options.labelTapToRetry}})})),T.on("process-complete",(function(t){e("DID_COMPLETE_ITEM_PROCESSING",{id:y,error:null,serverFileReference:t}),e("DID_DEFINE_VALUE",{id:y,value:t})})),T.on("process-abort",(function(){e("DID_ABORT_ITEM_PROCESSING",{id:y})})),T.on("process-revert",(function(){e("DID_REVERT_ITEM_PROCESSING",{id:y}),e("DID_DEFINE_VALUE",{id:y,value:null})})),e("DID_ADD_ITEM",{id:y,index:s,interactionMethod:u}),Lt(e,r);var R=r.options.server||{},O=R.url,D=R.load,S=R.restore,A=R.fetch;T.load(o,it(h===Te.INPUT?k(o)&&function isExternalURL(e){return(e.indexOf(":")>-1||e.indexOf("//")>-1)&&wt(location.href)!==wt(e)}(o)&&A?ft(O,A):At:ft(O,h===Te.LIMBO?S:D)),(function(e,r,n){De("LOAD_FILE",e,{query:t}).then(r).catch(n)}))}},REQUEST_PREPARE_OUTPUT:function REQUEST_PREPARE_OUTPUT(e){var r=e.item,n=e.success,i=e.failure,o=void 0===i?function(){}:i,a={error:st("error",0,"Item not found"),file:null};if(r.archived)return o(a);De("PREPARE_OUTPUT",r.file,{query:t,item:r}).then((function(e){De("COMPLETE_PREPARE_OUTPUT",e,{query:t,item:r}).then((function(e){if(r.archived)return o(a);n(e)}))}))},COMPLETE_LOAD_ITEM:function COMPLETE_LOAD_ITEM(n){var i=n.item,o=n.data,a=o.success,s=o.source,u=t("GET_ITEM_INSERT_LOCATION");if(X(u)&&s&&Mt(r,u),e("DID_LOAD_ITEM",{id:i.id,error:null,serverFileReference:i.origin===Te.INPUT?null:s}),a(ge(i)),i.origin!==Te.LOCAL)return i.origin===Te.LIMBO?(e("DID_COMPLETE_ITEM_PROCESSING",{id:i.id,error:null,serverFileReference:s}),void e("DID_DEFINE_VALUE",{id:i.id,value:i.serverId||s})):void(t("IS_ASYNC")&&r.options.instantUpload&&e("REQUEST_ITEM_PROCESSING",{query:i.id}));e("DID_LOAD_LOCAL_ITEM",{id:i.id})},RETRY_ITEM_LOAD:Ct(r,(function(e){e.retryLoad()})),REQUEST_ITEM_PREPARE:Ct(r,(function(t,r,n){e("REQUEST_PREPARE_OUTPUT",{query:t.id,item:t,success:function success(n){e("DID_PREPARE_OUTPUT",{id:t.id,file:n}),r({file:t,output:n})},failure:n},!0)})),REQUEST_ITEM_PROCESSING:Ct(r,(function(n,i,o){if(n.status===he.IDLE||n.status===he.PROCESSING_ERROR)n.status!==he.PROCESSING_QUEUED&&(n.requestProcessing(),e("DID_REQUEST_ITEM_PROCESSING",{id:n.id}),e("PROCESS_ITEM",{query:n,success:i,failure:o},!0));else{var a=function processNow(){return e("REQUEST_ITEM_PROCESSING",{query:n,success:i,failure:o})},s=function process(){return document.hidden?a():setTimeout(a,32)};n.status===he.PROCESSING_COMPLETE||n.status===he.PROCESSING_REVERT_ERROR?n.revert(ht(r.options.server.url,r.options.server.revert),t("GET_FORCE_REVERT")).then(s).catch((function(){})):n.status===he.PROCESSING&&n.abortProcessing().then(s)}})),PROCESS_ITEM:Ct(r,(function(n,i,o){var a=t("GET_MAX_PARALLEL_UPLOADS");if(t("GET_ITEMS_BY_STATUS",he.PROCESSING).length!==a){if(n.status!==he.PROCESSING){var s=function processNext(){var t=r.processingQueue.shift();if(t){var n=t.id,i=t.success,o=t.failure,a=Le(r.items,n);a&&!a.archived?e("PROCESS_ITEM",{query:n,success:i,failure:o},!0):processNext()}};n.onOnce("process-complete",(function(){i(ge(n)),s();var o=r.options.server;if(r.options.instantUpload&&n.origin===Te.LOCAL&&X(o.remove)){var a=function noop(){};n.origin=Te.LIMBO,r.options.server.remove(n.source,a,a)}t("GET_ITEMS_BY_STATUS",he.PROCESSING_COMPLETE).length===r.items.length&&e("DID_COMPLETE_ITEM_PROCESSING_ALL")})),n.onOnce("process-error",(function(e){o({error:e,file:ge(n)}),s()}));var u=r.options;n.process(vt(function createProcessorFunction(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;return"function"==typeof t?function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return t.apply(void 0,[r].concat(i,[n]))}:t&&k(t.url)?It(e,t,r,n):null}(u.server.url,u.server.process,u.name,{chunkTransferId:n.transferId,chunkServer:u.server.patch,chunkUploads:u.chunkUploads,chunkForce:u.chunkForce,chunkSize:u.chunkSize,chunkRetryDelays:u.chunkRetryDelays}),{allowMinimumUploadDuration:t("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(function(r,i,o){De("PREPARE_OUTPUT",r,{query:t,item:n}).then((function(t){e("DID_PREPARE_OUTPUT",{id:n.id,file:t}),i(t)})).catch(o)}))}}else r.processingQueue.push({id:n.id,success:i,failure:o})})),RETRY_ITEM_PROCESSING:Ct(r,(function(t){e("REQUEST_ITEM_PROCESSING",{query:t})})),REQUEST_REMOVE_ITEM:Ct(r,(function(r){Pt(t("GET_BEFORE_REMOVE_FILE"),ge(r)).then((function(t){t&&e("REMOVE_ITEM",{query:r})}))})),RELEASE_ITEM:Ct(r,(function(e){e.release()})),REMOVE_ITEM:Ct(r,(function(n,i,o,a){var s=function removeFromView(){var t=n.id;St(r.items,t).archive(),e("DID_REMOVE_ITEM",{error:null,id:t,item:n}),Lt(e,r),i(ge(n))},u=r.options.server;n.origin===Te.LOCAL&&u&&X(u.remove)&&!1!==a.remove?(e("DID_START_ITEM_REMOVE",{id:n.id}),u.remove(n.source,(function(){return s()}),(function(t){e("DID_THROW_ITEM_REMOVE_ERROR",{id:n.id,error:st("error",0,t,null),status:{main:bt(r.options.labelFileRemoveError)(t),sub:r.options.labelTapToRetry}})}))):((a.revert&&n.origin!==Te.LOCAL&&null!==n.serverId||r.options.chunkUploads&&n.file.size>r.options.chunkSize||r.options.chunkUploads&&r.options.chunkForce)&&n.revert(ht(r.options.server.url,r.options.server.revert),t("GET_FORCE_REVERT")),s())})),ABORT_ITEM_LOAD:Ct(r,(function(e){e.abortLoad()})),ABORT_ITEM_PROCESSING:Ct(r,(function(t){t.serverId?e("REVERT_ITEM_PROCESSING",{id:t.id}):t.abortProcessing().then((function(){r.options.instantUpload&&e("REMOVE_ITEM",{query:t.id})}))})),REQUEST_REVERT_ITEM_PROCESSING:Ct(r,(function(n){if(r.options.instantUpload){var i=function handleRevert(t){t&&e("REVERT_ITEM_PROCESSING",{query:n})},o=t("GET_BEFORE_REMOVE_FILE");if(!o)return i(!0);var a=o(ge(n));return null==a?i(!0):"boolean"==typeof a?i(a):void("function"==typeof a.then&&a.then(i))}e("REVERT_ITEM_PROCESSING",{query:n})})),REVERT_ITEM_PROCESSING:Ct(r,(function(n){n.revert(ht(r.options.server.url,r.options.server.revert),t("GET_FORCE_REVERT")).then((function(){(r.options.instantUpload||function isMockItem(e){return!Ot(e.file)}(n))&&e("REMOVE_ITEM",{query:n.id})})).catch((function(){}))})),SET_OPTIONS:function SET_OPTIONS(t){var r=t.options,n=Object.keys(r),i=Gt.filter((function(e){return n.includes(e)}));[].concat(_toConsumableArray(i),_toConsumableArray(Object.keys(r).filter((function(e){return!i.includes(e)})))).forEach((function(t){e("SET_"+ne(t,"_").toUpperCase(),{value:r[t]})}))}}},Gt=["server"],Ft=function createElement(e){return document.createElement(e)},xt=function text(e,t){var r=e.childNodes[0];r?t!==r.nodeValue&&(r.nodeValue=t):(r=document.createTextNode(t),e.appendChild(r))},Bt=function polarToCartesian(e,t,r,n){var i=(n%360-90)*Math.PI/180;return{x:e+r*Math.cos(i),y:t+r*Math.sin(i)}},Ut=function percentageArc(e,t,r,n,i){var o=1;return i>n&&i-n<=.5&&(o=0),n>i&&n-i>=.5&&(o=0),function describeArc(e,t,r,n,i,o){var a=Bt(e,t,r,i),s=Bt(e,t,r,n);return["M",a.x,a.y,"A",r,r,0,o,0,s.x,s.y].join(" ")}(e,t,r,360*Math.min(.9999,n),360*Math.min(.9999,i),o)},Vt=M({tag:"div",name:"progress-indicator",ignoreRectUpdate:!0,ignoreRect:!0,create:function create(e){var t=e.root,r=e.props;r.spin=!1,r.progress=0,r.opacity=0;var n=l("svg");t.ref.path=l("path",{"stroke-width":2,"stroke-linecap":"round"}),n.appendChild(t.ref.path),t.ref.svg=n,t.appendChild(n)},write:function write(e){var t=e.root,r=e.props;if(0!==r.opacity){r.align&&(t.element.dataset.align=r.align);var n=parseInt(o(t.ref.path,"stroke-width"),10),i=.5*t.rect.element.width,a=0,s=0;r.spin?(a=0,s=.5):(a=0,s=r.progress);var u=Ut(i,i,i-n,a,s);o(t.ref.path,"d",u),o(t.ref.path,"stroke-opacity",r.spin||r.progress>0?1:0)}},mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),qt=M({tag:"button",attributes:{type:"button"},ignoreRect:!0,ignoreRectUpdate:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:function create(e){var t=e.root,r=e.props;t.element.innerHTML=(r.icon||"")+"<span>"+r.label+"</span>",r.isDisabled=!1},write:function write(e){var t=e.root,r=e.props,n=r.isDisabled,i=t.query("GET_DISABLED")||0===r.opacity;i&&!n?(r.isDisabled=!0,o(t.element,"disabled","disabled")):!i&&n&&(r.isDisabled=!1,t.element.removeAttribute("disabled"))}}),kt=function toNaturalFileSize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.labelBytes,o=void 0===i?"bytes":i,a=n.labelKilobytes,s=void 0===a?"KB":a,u=n.labelMegabytes,l=void 0===u?"MB":u,c=n.labelGigabytes,f=void 0===c?"GB":c,d=r,p=r*r,E=r*r*r;return(e=Math.round(Math.abs(e)))<d?e+" "+o:e<p?Math.floor(e/d)+" "+s:e<E?Yt(e/p,1,t)+" "+l:Yt(e/E,2,t)+" "+f},Yt=function removeDecimalsWhenZero(e,t,r){return e.toFixed(t).split(".").filter((function(e){return"0"!==e})).join(r)},jt=function updateFile(e){var t=e.root,r=e.props;xt(t.ref.fileSize,kt(t.query("GET_ITEM_SIZE",r.id),".",t.query("GET_FILE_SIZE_BASE"),t.query("GET_FILE_SIZE_LABELS",t.query))),xt(t.ref.fileName,t.query("GET_ITEM_NAME",r.id))},Wt=function updateFileSizeOnError(e){var t=e.root,r=e.props;z(t.query("GET_ITEM_SIZE",r.id))?jt({root:t,props:r}):xt(t.ref.fileSize,t.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))},zt=M({name:"file-info",ignoreRect:!0,ignoreRectUpdate:!0,write:C({DID_LOAD_ITEM:jt,DID_UPDATE_ITEM_META:jt,DID_THROW_ITEM_LOAD_ERROR:Wt,DID_THROW_ITEM_INVALID:Wt}),didCreateView:function didCreateView(e){Se("CREATE_VIEW",Object.assign({},e,{view:e}))},create:function create(e){var t=e.root,r=e.props,n=Ft("span");n.className="filepond--file-info-main",o(n,"aria-hidden","true"),t.appendChild(n),t.ref.fileName=n;var i=Ft("span");i.className="filepond--file-info-sub",t.appendChild(i),t.ref.fileSize=i,xt(i,t.query("GET_LABEL_FILE_WAITING_FOR_SIZE")),xt(n,t.query("GET_ITEM_NAME",r.id))},mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}}),Ht=function toPercentage(e){return Math.round(100*e)},Xt=function didSetItemLoadProgress(e){var t=e.root,r=e.action,n=null===r.progress?t.query("GET_LABEL_FILE_LOADING"):t.query("GET_LABEL_FILE_LOADING")+" "+Ht(r.progress)+"%";xt(t.ref.main,n),xt(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},Zt=function clear(e){var t=e.root;xt(t.ref.main,""),xt(t.ref.sub,"")},Qt=function error(e){var t=e.root,r=e.action;xt(t.ref.main,r.status.main),xt(t.ref.sub,r.status.sub)},Kt=M({name:"file-status",ignoreRect:!0,ignoreRectUpdate:!0,write:C({DID_LOAD_ITEM:Zt,DID_REVERT_ITEM_PROCESSING:Zt,DID_REQUEST_ITEM_PROCESSING:function didRequestItemProcessing(e){var t=e.root;xt(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING")),xt(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},DID_ABORT_ITEM_PROCESSING:function didAbortItemProcessing(e){var t=e.root;xt(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING_ABORTED")),xt(t.ref.sub,t.query("GET_LABEL_TAP_TO_RETRY"))},DID_COMPLETE_ITEM_PROCESSING:function didCompleteItemProcessing(e){var t=e.root;xt(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING_COMPLETE")),xt(t.ref.sub,t.query("GET_LABEL_TAP_TO_UNDO"))},DID_UPDATE_ITEM_PROCESS_PROGRESS:function didSetItemProcessProgress(e){var t=e.root,r=e.action,n=null===r.progress?t.query("GET_LABEL_FILE_PROCESSING"):t.query("GET_LABEL_FILE_PROCESSING")+" "+Ht(r.progress)+"%";xt(t.ref.main,n),xt(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},DID_UPDATE_ITEM_LOAD_PROGRESS:Xt,DID_THROW_ITEM_LOAD_ERROR:Qt,DID_THROW_ITEM_INVALID:Qt,DID_THROW_ITEM_PROCESSING_ERROR:Qt,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Qt,DID_THROW_ITEM_REMOVE_ERROR:Qt}),didCreateView:function didCreateView(e){Se("CREATE_VIEW",Object.assign({},e,{view:e}))},create:function create(e){var t=e.root,r=Ft("span");r.className="filepond--file-status-main",t.appendChild(r),t.ref.main=r;var n=Ft("span");n.className="filepond--file-status-sub",t.appendChild(n),t.ref.sub=n,Xt({root:t,action:{progress:null}})},mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}}),$t={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"}},Jt=[];n($t,(function(e){Jt.push(e)}));var er,tr=function calculateFileInfoOffset(e){if("right"===or(e))return 0;var t=e.ref.buttonRemoveItem.rect.element;return t.hidden?null:t.width+t.left},rr=function calculateButtonWidth(e){return e.ref.buttonAbortItemLoad.rect.element.width},nr=function calculateFileVerticalCenterOffset(e){return Math.floor(e.ref.buttonRemoveItem.rect.element.height/4)},ir=function calculateFileHorizontalCenterOffset(e){return Math.floor(e.ref.buttonRemoveItem.rect.element.left/2)},or=function getRemoveIndicatorAligment(e){return e.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")},ar={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:function getLoadIndicatorAlignment(e){return e.query("GET_STYLE_LOAD_INDICATOR_POSITION")}},processProgressIndicator:{opacity:0,align:function getProcessIndicatorAlignment(e){return e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}},sr={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:tr},status:{translateX:tr}},ur={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}},lr={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:tr},status:{translateX:tr,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:tr},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:or},info:{translateX:tr},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:or},buttonRemoveItem:{opacity:1},info:{translateX:tr},status:{opacity:1,translateX:tr}},DID_LOAD_ITEM:sr,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:tr},status:{translateX:tr}},DID_START_ITEM_PROCESSING:ur,DID_REQUEST_ITEM_PROCESSING:ur,DID_UPDATE_ITEM_PROCESS_PROGRESS:ur,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:tr}},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:tr},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:sr},cr=M({create:function create(e){var t=e.root;t.element.innerHTML=t.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:!0,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}}),fr=C({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING(e){var t=e.root,r=e.action;t.ref.buttonAbortItemProcessing.label=r.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD(e){var t=e.root,r=e.action;t.ref.buttonAbortItemLoad.label=r.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL(e){var t=e.root,r=e.action;t.ref.buttonAbortItemRemoval.label=r.value},DID_REQUEST_ITEM_PROCESSING:function DID_REQUEST_ITEM_PROCESSING(e){var t=e.root;t.ref.processProgressIndicator.spin=!0,t.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function DID_START_ITEM_LOAD(e){var t=e.root;t.ref.loadProgressIndicator.spin=!0,t.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function DID_START_ITEM_REMOVE(e){var t=e.root;t.ref.processProgressIndicator.spin=!0,t.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function DID_UPDATE_ITEM_LOAD_PROGRESS(e){var t=e.root,r=e.action;t.ref.loadProgressIndicator.spin=!1,t.ref.loadProgressIndicator.progress=r.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function DID_UPDATE_ITEM_PROCESS_PROGRESS(e){var t=e.root,r=e.action;t.ref.processProgressIndicator.spin=!1,t.ref.processProgressIndicator.progress=r.progress}}),dr=M({create:function create(e){var t,r=e.root,i=e.props,o=Object.keys($t).reduce((function(e,t){return e[t]=Object.assign({},$t[t]),e}),{}),a=i.id,s=r.query("GET_ALLOW_REVERT"),u=r.query("GET_ALLOW_REMOVE"),l=r.query("GET_ALLOW_PROCESS"),c=r.query("GET_INSTANT_UPLOAD"),f=r.query("IS_ASYNC"),d=r.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");f?l&&!s?t=function buttonFilter(e){return!/RevertItemProcessing/.test(e)}:!l&&s?t=function buttonFilter(e){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(e)}:l||s||(t=function buttonFilter(e){return!/Process/.test(e)}):t=function buttonFilter(e){return!/Process/.test(e)};var p=t?Jt.filter(t):Jt.concat();if(c&&s&&(o.RevertItemProcessing.label="GET_LABEL_BUTTON_REMOVE_ITEM",o.RevertItemProcessing.icon="GET_ICON_REMOVE"),f&&!s){var E=lr.DID_COMPLETE_ITEM_PROCESSING;E.info.translateX=ir,E.info.translateY=nr,E.status.translateY=nr,E.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(f&&!l&&(["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach((function(e){lr[e].status.translateY=nr})),lr.DID_THROW_ITEM_PROCESSING_ERROR.status.translateX=rr),d&&s){o.RevertItemProcessing.align="BUTTON_REMOVE_ITEM_POSITION";var m=lr.DID_COMPLETE_ITEM_PROCESSING;m.info.translateX=tr,m.status.translateY=nr,m.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}u||(o.RemoveItem.disabled=!0),n(o,(function(e,t){var n=r.createChildView(qt,{label:r.query(t.label),icon:r.query(t.icon),opacity:0});p.includes(e)&&r.appendChildView(n),t.disabled&&(n.element.setAttribute("disabled","disabled"),n.element.setAttribute("hidden","hidden")),n.element.dataset.align=r.query("GET_STYLE_"+t.align),n.element.classList.add(t.className),n.on("click",(function(e){e.stopPropagation(),t.disabled||r.dispatch(t.action,{query:a})})),r.ref["button"+e]=n})),r.ref.processingCompleteIndicator=r.appendChildView(r.createChildView(cr)),r.ref.processingCompleteIndicator.element.dataset.align=r.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION"),r.ref.info=r.appendChildView(r.createChildView(zt,{id:a})),r.ref.status=r.appendChildView(r.createChildView(Kt,{id:a}));var g=r.appendChildView(r.createChildView(Vt,{opacity:0,align:r.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));g.element.classList.add("filepond--load-indicator"),r.ref.loadProgressIndicator=g;var I=r.appendChildView(r.createChildView(Vt,{opacity:0,align:r.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));I.element.classList.add("filepond--process-indicator"),r.ref.processProgressIndicator=I,r.ref.activeStyles=[]},write:function write(e){var t=e.root,r=e.actions,i=e.props;fr({root:t,actions:r,props:i});var o=r.concat().filter((function(e){return/^DID_/.test(e.type)})).reverse().find((function(e){return lr[e.type]}));if(o){t.ref.activeStyles=[];var a=lr[o.type];n(ar,(function(e,r){var i=t.ref[e];n(r,(function(r,n){var o=a[e]&&void 0!==a[e][r]?a[e][r]:n;t.ref.activeStyles.push({control:i,key:r,value:o})}))}))}t.ref.activeStyles.forEach((function(e){var r=e.control,n=e.key,i=e.value;r[n]="function"==typeof i?i(t):i}))},didCreateView:function didCreateView(e){Se("CREATE_VIEW",Object.assign({},e,{view:e}))},name:"file"}),pr=M({create:function create(e){var t=e.root,r=e.props;t.ref.fileName=Ft("legend"),t.appendChild(t.ref.fileName),t.ref.file=t.appendChildView(t.createChildView(dr,{id:r.id})),t.ref.data=!1},ignoreRect:!0,write:C({DID_LOAD_ITEM:function didLoadItem(e){var t=e.root,r=e.props;xt(t.ref.fileName,t.query("GET_ITEM_NAME",r.id))}}),didCreateView:function didCreateView(e){Se("CREATE_VIEW",Object.assign({},e,{view:e}))},tag:"fieldset",name:"file-wrapper"}),Er={type:"spring",damping:.6,mass:7},_r=function createSection(e,t,r){var n=M({name:"panel-"+t.name+" filepond--"+r,mixins:t.mixins,ignoreRectUpdate:!0}),i=e.createChildView(n,t.props);e.ref[t.name]=e.appendChildView(i)},mr=M({name:"panel",read:function read(e){var t=e.root;return e.props.heightCurrent=t.ref.bottom.translateY},write:function write(e){var t=e.root,r=e.props;if(null!==t.ref.scalable&&r.scalable===t.ref.scalable||(t.ref.scalable=!V(r.scalable)||r.scalable,t.element.dataset.scalable=t.ref.scalable),r.height){var n=t.ref.top.rect.element,i=t.ref.bottom.rect.element,o=Math.max(n.height+i.height,r.height);t.ref.center.translateY=n.height,t.ref.center.scaleY=(o-n.height-i.height)/100,t.ref.bottom.translateY=o-i.height}},create:function create(e){var t=e.root,r=e.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:Er},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:Er},styles:["translateY"]}}].forEach((function(e){_r(t,e,r.name)})),t.element.classList.add("filepond--"+r.name),t.ref.scalable=null},ignoreRect:!0,mixins:{apis:["height","heightCurrent","scalable"]}}),gr={type:"spring",stiffness:.75,damping:.45,mass:10},Ir={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"},hr=C({DID_UPDATE_PANEL_HEIGHT:function DID_UPDATE_PANEL_HEIGHT(e){var t=e.root,r=e.action;t.height=r.height}}),Tr=C({DID_GRAB_ITEM:function DID_GRAB_ITEM(e){var t=e.root;e.props.dragOrigin={x:t.translateX,y:t.translateY}},DID_DRAG_ITEM:function DID_DRAG_ITEM(e){e.root.element.dataset.dragState="drag"},DID_DROP_ITEM:function DID_DROP_ITEM(e){var t=e.root,r=e.props;r.dragOffset=null,r.dragOrigin=null,t.element.dataset.dragState="drop"}},(function(e){var t=e.root,r=e.actions,n=e.props,i=e.shouldOptimize;"drop"===t.element.dataset.dragState&&t.scaleX<=1&&(t.element.dataset.dragState="idle");var o=r.concat().filter((function(e){return/^DID_/.test(e.type)})).reverse().find((function(e){return Ir[e.type]}));o&&o.type!==n.currentState&&(n.currentState=o.type,t.element.dataset.filepondItemState=Ir[n.currentState]||"");var a=t.query("GET_ITEM_PANEL_ASPECT_RATIO")||t.query("GET_PANEL_ASPECT_RATIO");a?i||(t.height=t.rect.element.width*a):(hr({root:t,actions:r,props:n}),!t.height&&t.ref.container.rect.element.height>0&&(t.height=t.ref.container.rect.element.height)),i&&(t.ref.panel.height=null),t.ref.panel.height=t.height})),vr=M({create:function create(e){var t=e.root,r=e.props;t.ref.handleClick=function(e){return t.dispatch("DID_ACTIVATE_ITEM",{id:r.id})},t.element.id="filepond--item-"+r.id,t.element.addEventListener("click",t.ref.handleClick),t.ref.container=t.appendChildView(t.createChildView(pr,{id:r.id})),t.ref.panel=t.appendChildView(t.createChildView(mr,{name:"item-panel"})),t.ref.panel.height=null,r.markedForRemoval=!1,t.query("GET_ALLOW_REORDER")&&(t.element.dataset.dragState="idle",t.element.addEventListener("pointerdown",(function grab(e){if(e.isPrimary){var n=!1,i=e.pageX,o=e.pageY;r.dragOrigin={x:t.translateX,y:t.translateY},r.dragCenter={x:e.offsetX,y:e.offsetY};var a=function createDragHelper(e){var t=e.map((function(e){return e.id})),r=void 0;return{setIndex:function setIndex(e){r=e},getIndex:function getIndex(){return r},getItemIndex:function getItemIndex(e){return t.indexOf(e.id)}}}(t.query("GET_ACTIVE_ITEMS"));t.dispatch("DID_GRAB_ITEM",{id:r.id,dragState:a});var s=function drag(e){e.isPrimary&&(e.stopPropagation(),e.preventDefault(),r.dragOffset={x:e.pageX-i,y:e.pageY-o},r.dragOffset.x*r.dragOffset.x+r.dragOffset.y*r.dragOffset.y>16&&!n&&(n=!0,t.element.removeEventListener("click",t.ref.handleClick)),t.dispatch("DID_DRAG_ITEM",{id:r.id,dragState:a}))};document.addEventListener("pointermove",s),document.addEventListener("pointerup",(function drop(e){e.isPrimary&&(document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",drop),r.dragOffset={x:e.pageX-i,y:e.pageY-o},t.dispatch("DID_DROP_ITEM",{id:r.id,dragState:a}),n&&setTimeout((function(){return t.element.addEventListener("click",t.ref.handleClick)}),0))}))}})))},write:Tr,destroy:function destroy(e){var t=e.root,r=e.props;t.element.removeEventListener("click",t.ref.handleClick),t.dispatch("RELEASE_ITEM",{query:r.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:"spring",scaleY:"spring",translateX:gr,translateY:gr,opacity:{type:"tween",duration:150}}}}),getItemsPerRow=function(e,t){return Math.max(1,Math.floor((e+1)/t))},yr=function getItemIndexByPosition(e,t,r){if(r){var n=e.rect.element.width,i=t.length,o=null;if(0===i||r.top<t[0].rect.element.top)return-1;var a=t[0].rect.element,s=a.marginLeft+a.marginRight,u=a.width+s,l=getItemsPerRow(n,u);if(1===l){for(var c=0;c<i;c++){var f=t[c],d=f.rect.outer.top+.5*f.rect.element.height;if(r.top<d)return c}return i}for(var p=a.marginTop+a.marginBottom,E=a.height+p,m=0;m<i;m++){var g=m%l*u,I=Math.floor(m/l)*E,h=I-a.marginTop,T=g+u,v=I+E+a.marginBottom;if(r.top<v&&r.top>h){if(r.left<T)return m;o=m!==i-1?m:null}}return null!==o?o:i}},Rr={height:0,width:0,get getHeight(){return this.height},set setHeight(e){0!==this.height&&0!==e||(this.height=e)},get getWidth(){return this.width},set setWidth(e){0!==this.width&&0!==e||(this.width=e)},setDimensions:function setDimensions(e,t){0!==this.height&&0!==e||(this.height=e),0!==this.width&&0!==t||(this.width=t)}},Or=function moveItem(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;e.dragOffset?(e.translateX=null,e.translateY=null,e.translateX=e.dragOrigin.x+e.dragOffset.x,e.translateY=e.dragOrigin.y+e.dragOffset.y,e.scaleX=1.025,e.scaleY=1.025):(e.translateX=t,e.translateY=r,Date.now()>e.spawnDate&&(0===e.opacity&&Dr(e,t,r,n,i),e.scaleX=1,e.scaleY=1,e.opacity=1))},Dr=function introItemView(e,t,r,n,i){e.interactionMethod===fe?(e.translateX=null,e.translateX=t,e.translateY=null,e.translateY=r):e.interactionMethod===ue?(e.translateX=null,e.translateX=t-20*n,e.translateY=null,e.translateY=r-10*i,e.scaleX=.8,e.scaleY=.8):e.interactionMethod===le?(e.translateY=null,e.translateY=r-30):e.interactionMethod===se&&(e.translateX=null,e.translateX=t-30,e.translateY=null)},Sr=function getItemHeight(e){return e.rect.element.height+.5*e.rect.element.marginBottom+.5*e.rect.element.marginTop},Ar=C({DID_ADD_ITEM:function addItemView(e){var t=e.root,r=e.action,n=r.id,i=r.index,o=r.interactionMethod;t.ref.addIndex=i;var a=Date.now(),s=a,u=1;if(o!==fe){u=0;var l=t.query("GET_ITEM_INSERT_INTERVAL"),c=a-t.ref.lastItemSpanwDate;s=c<l?a+(l-c):a}t.ref.lastItemSpanwDate=s,t.appendChildView(t.createChildView(vr,{spawnDate:s,id:n,opacity:u,interactionMethod:o}),i)},DID_REMOVE_ITEM:function removeItemView(e){var t=e.root,r=e.action.id,n=t.childViews.find((function(e){return e.id===r}));n&&(n.scaleX=.9,n.scaleY=.9,n.opacity=0,n.markedForRemoval=!0)},DID_DRAG_ITEM:function dragItem(e){var t=e.root,r=e.action,n=r.id,i=r.dragState,o=t.query("GET_ITEM",{id:n}),a=t.childViews.find((function(e){return e.id===n})),s=t.childViews.length,u=i.getItemIndex(o);if(a){var l=a.dragOrigin.x+a.dragOffset.x+a.dragCenter.x,c=a.dragOrigin.y+a.dragOffset.y+a.dragCenter.y,f=Sr(a),d=function getItemWidth(e){return e.rect.element.width+.5*e.rect.element.marginLeft+.5*e.rect.element.marginRight}(a),p=Math.floor(t.rect.outer.width/d);p>s&&(p=s);var E=Math.floor(s/p+1);Rr.setHeight=f*E,Rr.setWidth=d*p;var m={y:Math.floor(c/f),x:Math.floor(l/d),getGridIndex:function getGridIndex(){return c>Rr.getHeight||c<0||l>Rr.getWidth||l<0?u:this.y*p+this.x},getColIndex:function getColIndex(){for(var e=t.query("GET_ACTIVE_ITEMS"),r=t.childViews.filter((function(e){return e.rect.element.height})),n=e.map((function(e){return r.find((function(t){return t.id===e.id}))})),i=n.findIndex((function(e){return e===a})),o=Sr(a),s=n.length,u=s,l=0,f=0,d=0,p=0;p<s;p++)if(l=Sr(n[p]),c<(f=(d=f)+l)){if(i>p){if(c<d+o){u=p;break}continue}u=p;break}return u}},g=p>1?m.getGridIndex():m.getColIndex();t.dispatch("MOVE_ITEM",{query:a,index:g});var I=i.getIndex();if(void 0===I||I!==g){if(i.setIndex(g),void 0===I)return;t.dispatch("DID_REORDER_ITEMS",{items:t.query("GET_ACTIVE_ITEMS"),origin:u,target:g})}}}}),wr=M({create:function create(e){var t=e.root;o(t.element,"role","list"),t.ref.lastItemSpanwDate=Date.now()},write:function write(e){var t=e.root,r=e.props,n=e.actions,i=e.shouldOptimize;Ar({root:t,props:r,actions:n});var o=r.dragCoordinates,a=t.rect.element.width,s=t.childViews.filter((function(e){return e.rect.element.height})),u=t.query("GET_ACTIVE_ITEMS").map((function(e){return s.find((function(t){return t.id===e.id}))})).filter((function(e){return e})),l=o?yr(t,u,o):null,c=t.ref.addIndex||null;t.ref.addIndex=null;var f=0,d=0,p=0;if(0!==u.length){var E=u[0].rect.element,m=E.marginTop+E.marginBottom,g=E.marginLeft+E.marginRight,I=E.width+g,h=E.height+m,T=getItemsPerRow(a,I);if(1===T){var v=0,y=0;u.forEach((function(e,t){if(l){var r=t-l;y=-2===r?.25*-m:-1===r?.75*-m:0===r?.75*m:1===r?.25*m:0}i&&(e.translateX=null,e.translateY=null),e.markedForRemoval||Or(e,0,v+y);var n=(e.rect.element.height+m)*(e.markedForRemoval?e.opacity:1);v+=n}))}else{var R=0,O=0;u.forEach((function(e,t){t===l&&(f=1),t===c&&(p+=1),e.markedForRemoval&&e.opacity<.5&&(d-=1);var r=t+p+f+d,n=r%T,o=Math.floor(r/T),a=n*I,s=o*h,u=Math.sign(a-R),E=Math.sign(s-O);R=a,O=s,e.markedForRemoval||(i&&(e.translateX=null,e.translateY=null),Or(e,a,s,u,E))}))}}},tag:"ul",name:"list",didWriteView:function didWriteView(e){var t=e.root;t.childViews.filter((function(e){return e.markedForRemoval&&0===e.opacity&&e.resting})).forEach((function(e){e._destroy(),t.removeChildView(e)}))},filterFrameActionsForChild:function filterSetItemActions(e,t){return t.filter((function(t){return!t.data||!t.data.id||e.id===t.data.id}))},mixins:{apis:["dragCoordinates"]}}),br=C({DID_DRAG:function storeDragCoordinates(e){var t=e.root,r=e.props,n=e.action;t.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(r.dragCoordinates={left:n.position.scopeLeft-t.ref.list.rect.element.left,top:n.position.scopeTop-(t.rect.outer.top+t.rect.element.marginTop+t.rect.element.scrollTop)})},DID_END_DRAG:function clearDragCoordinates(e){e.props.dragCoordinates=null}}),Lr=M({create:function create(e){var t=e.root,r=e.props;t.ref.list=t.appendChildView(t.createChildView(wr)),r.dragCoordinates=null,r.overflowing=!1},write:function write(e){var t=e.root,r=e.props,n=e.actions;if(br({root:t,props:r,actions:n}),t.ref.list.dragCoordinates=r.dragCoordinates,r.overflowing&&!r.overflow&&(r.overflowing=!1,t.element.dataset.state="",t.height=null),r.overflow){var i=Math.round(r.overflow);i!==t.height&&(r.overflowing=!0,t.element.dataset.state="overflow",t.height=i)}},name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),Pr=function attrToggle(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";r?o(e,t,n):e.removeAttribute(t)},Mr=function setAcceptedFileTypes(e){var t=e.root,r=e.action;t.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&Pr(t.element,"accept",!!r.value,r.value?r.value.join(","):"")},Cr=function toggleAllowMultiple(e){var t=e.root,r=e.action;Pr(t.element,"multiple",r.value)},Nr=function toggleDirectoryFilter(e){var t=e.root,r=e.action;Pr(t.element,"webkitdirectory",r.value)},Gr=function toggleDisabled(e){var t=e.root,r=t.query("GET_DISABLED"),n=t.query("GET_ALLOW_BROWSE"),i=r||!n;Pr(t.element,"disabled",i)},Fr=function toggleRequired(e){var t=e.root;e.action.value?0===t.query("GET_TOTAL_ITEMS")&&Pr(t.element,"required",!0):Pr(t.element,"required",!1)},xr=function setCaptureMethod(e){var t=e.root,r=e.action;Pr(t.element,"capture",!!r.value,!0===r.value?"":r.value)},Br=function updateRequiredStatus(e){var t=e.root,r=t.element;t.query("GET_TOTAL_ITEMS")>0?(Pr(r,"required",!1),Pr(r,"name",!1)):(Pr(r,"name",!0,t.query("GET_NAME")),t.query("GET_CHECK_VALIDITY")&&r.setCustomValidity(""),t.query("GET_REQUIRED")&&Pr(r,"required",!0))},Ur=M({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:function create(e){var t=e.root,r=e.props;t.element.id="filepond--browser-"+r.id,o(t.element,"name",t.query("GET_NAME")),o(t.element,"aria-controls","filepond--assistant-"+r.id),o(t.element,"aria-labelledby","filepond--drop-label-"+r.id),Mr({root:t,action:{value:t.query("GET_ACCEPTED_FILE_TYPES")}}),Cr({root:t,action:{value:t.query("GET_ALLOW_MULTIPLE")}}),Nr({root:t,action:{value:t.query("GET_ALLOW_DIRECTORIES_ONLY")}}),Gr({root:t}),Fr({root:t,action:{value:t.query("GET_REQUIRED")}}),xr({root:t,action:{value:t.query("GET_CAPTURE_METHOD")}}),t.ref.handleChange=function(e){if(t.element.value){var n=Array.from(t.element.files).map((function(e){return e._relativePath=e.webkitRelativePath,e}));setTimeout((function(){r.onload(n),function resetFileInput(e){if(e&&""!==e.value){try{e.value=""}catch(e){}if(e.value){var t=Ft("form"),r=e.parentNode,n=e.nextSibling;t.appendChild(e),t.reset(),n?r.insertBefore(e,n):r.appendChild(e)}}}(t.element)}),250)}},t.element.addEventListener("change",t.ref.handleChange)},destroy:function destroy(e){var t=e.root;t.element.removeEventListener("change",t.ref.handleChange)},write:C({DID_LOAD_ITEM:Br,DID_REMOVE_ITEM:Br,DID_THROW_ITEM_INVALID:function updateFieldValidityStatus(e){var t=e.root;t.query("GET_CHECK_VALIDITY")&&t.element.setCustomValidity(t.query("GET_LABEL_INVALID_FIELD"))},DID_SET_DISABLED:Gr,DID_SET_ALLOW_BROWSE:Gr,DID_SET_ALLOW_DIRECTORIES_ONLY:Nr,DID_SET_ALLOW_MULTIPLE:Cr,DID_SET_ACCEPTED_FILE_TYPES:Mr,DID_SET_CAPTURE_METHOD:xr,DID_SET_REQUIRED:Fr})}),Vr=13,qr=32,kr=function updateLabelValue(e,t){e.innerHTML=t;var r=e.querySelector(".filepond--label-action");return r&&o(r,"tabindex","0"),t},Yr=M({name:"drop-label",ignoreRect:!0,create:function create(e){var t=e.root,r=e.props,n=Ft("label");o(n,"for","filepond--browser-"+r.id),o(n,"id","filepond--drop-label-"+r.id),o(n,"aria-hidden","true"),t.ref.handleKeyDown=function(e){(e.keyCode===Vr||e.keyCode===qr)&&(e.preventDefault(),t.ref.label.click())},t.ref.handleClick=function(e){e.target===n||n.contains(e.target)||t.ref.label.click()},n.addEventListener("keydown",t.ref.handleKeyDown),t.element.addEventListener("click",t.ref.handleClick),kr(n,r.caption),t.appendChild(n),t.ref.label=n},destroy:function destroy(e){var t=e.root;t.ref.label.addEventListener("keydown",t.ref.handleKeyDown),t.element.removeEventListener("click",t.ref.handleClick)},write:C({DID_SET_LABEL_IDLE:function DID_SET_LABEL_IDLE(e){var t=e.root,r=e.action;kr(t.ref.label,r.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),jr=M({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),Wr=C({DID_DRAG:function moveBlob(e){var t=e.root,r=e.action;t.ref.blob?(t.ref.blob.translateX=r.position.scopeLeft,t.ref.blob.translateY=r.position.scopeTop,t.ref.blob.scaleX=1,t.ref.blob.scaleY=1,t.ref.blob.opacity=1):function addBlob(e){var t=e.root,r=.5*t.rect.element.width,n=.5*t.rect.element.height;t.ref.blob=t.appendChildView(t.createChildView(jr,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:r,translateY:n}))}({root:t})},DID_DROP:function explodeBlob(e){var t=e.root;t.ref.blob&&(t.ref.blob.scaleX=2.5,t.ref.blob.scaleY=2.5,t.ref.blob.opacity=0)},DID_END_DRAG:function hideBlob(e){var t=e.root;t.ref.blob&&(t.ref.blob.opacity=0)}}),zr=M({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:function write(e){var t=e.root,r=e.props,n=e.actions;Wr({root:t,props:r,actions:n});var i=t.ref.blob;0===n.length&&i&&0===i.opacity&&(t.removeChildView(i),t.ref.blob=null)}}),Hr=function setInputFiles(e,t){try{var r=new DataTransfer;t.forEach((function(e){e instanceof File?r.items.add(e):r.items.add(new File([e],e.name,{type:e.type}))})),e.files=r.files}catch(e){return!1}return!0},Xr=function getField(e,t){return e.ref.fields[t]},Zr=function syncFieldPositionsWithItems(e){e.query("GET_ACTIVE_ITEMS").forEach((function(t){e.ref.fields[t.id]&&e.element.appendChild(e.ref.fields[t.id])}))},Qr=function didReorderItems(e){var t=e.root;return Zr(t)},Kr=C({DID_SET_DISABLED:function didSetDisabled(e){var t=e.root;t.element.disabled=t.query("GET_DISABLED")},DID_ADD_ITEM:function didAddItem(e){var t=e.root,r=e.action,n=!(t.query("GET_ITEM",r.id).origin===Te.LOCAL)&&t.query("SHOULD_UPDATE_FILE_INPUT"),i=Ft("input");i.type=n?"file":"hidden",i.name=t.query("GET_NAME"),i.disabled=t.query("GET_DISABLED"),t.ref.fields[r.id]=i,Zr(t)},DID_LOAD_ITEM:function didLoadItem(e){var t=e.root,r=e.action,n=Xr(t,r.id);if(n&&(null!==r.serverFileReference&&(n.value=r.serverFileReference),t.query("SHOULD_UPDATE_FILE_INPUT"))){var i=t.query("GET_ITEM",r.id);Hr(n,[i.file])}},DID_REMOVE_ITEM:function didRemoveItem(e){var t=e.root,r=e.action,n=Xr(t,r.id);n&&(n.parentNode&&n.parentNode.removeChild(n),delete t.ref.fields[r.id])},DID_DEFINE_VALUE:function didDefineValue(e){var t=e.root,r=e.action,n=Xr(t,r.id);n&&(null===r.value?n.removeAttribute("value"):n.value=r.value,Zr(t))},DID_PREPARE_OUTPUT:function didPrepareOutput(e){var t=e.root,r=e.action;t.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout((function(){var e=Xr(t,r.id);e&&Hr(e,[r.file])}),0)},DID_REORDER_ITEMS:Qr,DID_SORT_ITEMS:Qr}),$r=M({tag:"fieldset",name:"data",create:function create(e){return e.root.ref.fields={}},write:Kr,ignoreRect:!0}),Jr=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],en=["css","csv","html","txt"],tn={zip:"zip|compressed",epub:"application/epub+zip"},rn=function guesstimateMimeType(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=e.toLowerCase(),Jr.includes(e)?"image/"+("jpg"===e?"jpeg":"svg"===e?"svg+xml":e):en.includes(e)?"text/"+e:tn[e]||""},nn=function requestDataTransferItems(e){return new Promise((function(t,r){var n=mn(e);if(n.length&&!an(e))return t(n);sn(e).then(t)}))},an=function hasFiles(e){return!!e.files&&e.files.length>0},sn=function getFiles(e){return new Promise((function(t,r){var n=(e.items?Array.from(e.items):[]).filter((function(e){return un(e)})).map((function(e){return ln(e)}));n.length?Promise.all(n).then((function(e){var r=[];e.forEach((function(e){r.push.apply(r,e)})),t(r.filter((function(e){return e})).map((function(e){return e._relativePath||(e._relativePath=e.webkitRelativePath),e})))})).catch(console.error):t(e.files?Array.from(e.files):[])}))},un=function isFileSystemItem(e){if(En(e)){var t=_n(e);if(t)return t.isFile||t.isDirectory}return"file"===e.kind},ln=function getFilesFromItem(e){return new Promise((function(t,r){pn(e)?cn(_n(e)).then(t).catch(r):t([e.getAsFile()])}))},cn=function getFilesInDirectory(e){return new Promise((function(t,r){var n=[],i=0,o=0,a=function resolveIfDone(){0===o&&0===i&&t(n)};!function readEntries(e){i++;var t=e.createReader();!function readBatch(){t.readEntries((function(e){if(0===e.length)return i--,void a();e.forEach((function(e){e.isDirectory?readEntries(e):(o++,e.file((function(t){var r=dn(t);e.fullPath&&(r._relativePath=e.fullPath),n.push(r),o--,a()})))})),readBatch()}),r)}()}(e)}))},dn=function correctMissingFileType(e){if(e.type.length)return e;var t=e.lastModifiedDate,r=e.name,n=rn(ze(e.name));return n.length?((e=e.slice(0,e.size,n)).name=r,e.lastModifiedDate=t,e):e},pn=function isDirectoryEntry(e){return En(e)&&(_n(e)||{}).isDirectory},En=function isEntry(e){return"webkitGetAsEntry"in e},_n=function getAsEntry(e){return e.webkitGetAsEntry()},mn=function getLinks(e){var t=[];try{if((t=In(e)).length)return t;t=gn(e)}catch(e){}return t},gn=function getLinksFromTransferURLData(e){var t=e.getData("url");return"string"==typeof t&&t.length?[t]:[]},In=function getLinksFromTransferMetaData(e){var t=e.getData("text/html");if("string"==typeof t&&t.length){var r=t.match(/src\s*=\s*"(.+?)"/);if(r)return[r[1]]}return[]},hn=[],Tn=function eventPosition(e){return{pageLeft:e.pageX,pageTop:e.pageY,scopeLeft:e.offsetX||e.layerX,scopeTop:e.offsetY||e.layerY}},vn=function getDragNDropObserver(e){var t=hn.find((function(t){return t.element===e}));if(t)return t;var r=yn(e);return hn.push(r),r},yn=function createDragNDropObserver(e){var t=[],r={dragenter:Sn,dragover:An,dragleave:bn,drop:wn},i={};n(r,(function(r,n){i[r]=n(e,t),e.addEventListener(r,i[r],!1)}));var o={element:e,addListener:function addListener(a){return t.push(a),function(){t.splice(t.indexOf(a),1),0===t.length&&(hn.splice(hn.indexOf(o),1),n(r,(function(t){e.removeEventListener(t,i[t],!1)})))}}};return o},Rn=function isEventTarget(e,t){var r=function elementFromPoint(e,t){return"elementFromPoint"in e||(e=document),e.elementFromPoint(t.x,t.y)}(function getRootNode(e){return"getRootNode"in e?e.getRootNode():document}(t),{x:e.pageX-window.pageXOffset,y:e.pageY-window.pageYOffset});return r===t||t.contains(r)},On=null,Dn=function setDropEffect(e,t){try{e.dropEffect=t}catch(e){}},Sn=function dragenter(e,t){return function(e){e.preventDefault(),On=e.target,t.forEach((function(t){var r=t.element,n=t.onenter;Rn(e,r)&&(t.state="enter",n(Tn(e)))}))}},An=function dragover(e,t){return function(e){e.preventDefault();var r=e.dataTransfer;nn(r).then((function(n){var i=!1;t.some((function(t){var o=t.filterElement,a=t.element,s=t.onenter,u=t.onexit,l=t.ondrag,c=t.allowdrop;Dn(r,"copy");var f=c(n);if(f)if(Rn(e,a)){if(i=!0,null===t.state)return t.state="enter",void s(Tn(e));if(t.state="over",o&&!f)return void Dn(r,"none");l(Tn(e))}else o&&!i&&Dn(r,"none"),t.state&&(t.state=null,u(Tn(e)));else Dn(r,"none")}))}))}},wn=function drop(e,t){return function(e){e.preventDefault();var r=e.dataTransfer;nn(r).then((function(r){t.forEach((function(t){var n=t.filterElement,i=t.element,o=t.ondrop,a=t.onexit,s=t.allowdrop;if(t.state=null,!n||Rn(e,i))return s(r)?void o(Tn(e),r):a(Tn(e))}))}))}},bn=function dragleave(e,t){return function(e){On===e.target&&t.forEach((function(t){var r=t.onexit;t.state=null,r(Tn(e))}))}},Ln=function createHopper(e,t,r){e.classList.add("filepond--hopper");var n=r.catchesDropsOnPage,i=r.requiresDropOnElement,o=r.filterItems,a=void 0===o?function(e){return e}:o,s=function createDragNDropClient(e,t,r){var n=vn(t),i={element:e,filterElement:r,state:null,ondrop:function ondrop(){},onenter:function onenter(){},ondrag:function ondrag(){},onexit:function onexit(){},onload:function onload(){},allowdrop:function allowdrop(){}};return i.destroy=n.addListener(i),i}(e,n?document.documentElement:e,i),u="",l="";s.allowdrop=function(e){return t(a(e))},s.ondrop=function(e,r){var n=a(r);t(n)?(l="drag-drop",c.onload(n,e)):c.ondragend(e)},s.ondrag=function(e){c.ondrag(e)},s.onenter=function(e){l="drag-over",c.ondragstart(e)},s.onexit=function(e){l="drag-exit",c.ondragend(e)};var c={updateHopperState:function updateHopperState(){u!==l&&(e.dataset.hopperState=l,u=l)},onload:function onload(){},ondragstart:function ondragstart(){},ondrag:function ondrag(){},ondragend:function ondragend(){},destroy:function destroy(){s.destroy()}};return c},Pn=!1,Mn=[],Cn=function handlePaste(e){var t=document.activeElement;if(t&&/textarea|input/i.test(t.nodeName)){for(var r=!1,n=t;n!==document.body;){if(n.classList.contains("filepond--root")){r=!0;break}n=n.parentNode}if(!r)return}nn(e.clipboardData).then((function(e){e.length&&Mn.forEach((function(t){return t(e)}))}))},Nn=function createPaster(){var e=function cb(e){t.onload(e)},t={destroy:function destroy(){!function unlisten(e){pe(Mn,Mn.indexOf(e)),0===Mn.length&&(document.removeEventListener("paste",Cn),Pn=!1)}(e)},onload:function onload(){}};return function listen(e){Mn.includes(e)||(Mn.push(e),Pn||(Pn=!0,document.addEventListener("paste",Cn)))}(e),t},Gn=null,Fn=null,xn=[],Bn=function assist(e,t){e.element.textContent=t},Un=function listModified(e,t,r){var n=e.query("GET_TOTAL_ITEMS");Bn(e,r+" "+t+", "+n+" "+(1===n?e.query("GET_LABEL_FILE_COUNT_SINGULAR"):e.query("GET_LABEL_FILE_COUNT_PLURAL"))),clearTimeout(Fn),Fn=setTimeout((function(){!function clear(e){e.element.textContent=""}(e)}),1500)},Vn=function isUsingFilePond(e){return e.element.parentNode.contains(document.activeElement)},qn=function itemProcessedUndo(e){var t=e.root,r=e.action,n=t.query("GET_ITEM",r.id).filename,i=t.query("GET_LABEL_FILE_PROCESSING_ABORTED");Bn(t,n+" "+i)},kn=function itemError(e){var t=e.root,r=e.action,n=t.query("GET_ITEM",r.id).filename;Bn(t,r.status.main+" "+n+" "+r.status.sub)},Yn=M({create:function create(e){var t=e.root,r=e.props;t.element.id="filepond--assistant-"+r.id,o(t.element,"role","status"),o(t.element,"aria-live","polite"),o(t.element,"aria-relevant","additions")},ignoreRect:!0,ignoreRectUpdate:!0,write:C({DID_LOAD_ITEM:function itemAdded(e){var t=e.root,r=e.action;if(Vn(t)){t.element.textContent="";var n=t.query("GET_ITEM",r.id);xn.push(n.filename),clearTimeout(Gn),Gn=setTimeout((function(){Un(t,xn.join(", "),t.query("GET_LABEL_FILE_ADDED")),xn.length=0}),750)}},DID_REMOVE_ITEM:function itemRemoved(e){var t=e.root,r=e.action;if(Vn(t)){var n=r.item;Un(t,n.filename,t.query("GET_LABEL_FILE_REMOVED"))}},DID_COMPLETE_ITEM_PROCESSING:function itemProcessed(e){var t=e.root,r=e.action,n=t.query("GET_ITEM",r.id).filename,i=t.query("GET_LABEL_FILE_PROCESSING_COMPLETE");Bn(t,n+" "+i)},DID_ABORT_ITEM_PROCESSING:qn,DID_REVERT_ITEM_PROCESSING:qn,DID_THROW_ITEM_REMOVE_ERROR:kn,DID_THROW_ITEM_LOAD_ERROR:kn,DID_THROW_ITEM_INVALID:kn,DID_THROW_ITEM_PROCESSING_ERROR:kn}),tag:"span",name:"assistant"}),jn=function toCamels(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(new RegExp(t+".","g"),(function(e){return e.charAt(1).toUpperCase()}))},Wn=function debounce(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Date.now(),i=null;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];clearTimeout(i);var u=Date.now()-n,l=function fn(){n=Date.now(),e.apply(void 0,a)};u<t?r||(i=setTimeout(l,t-u)):l()}},zn=function prevent(e){return e.preventDefault()},Hn=function calculateListItemMargin(e){var t=e.ref.list.childViews[0].childViews[0];return t?{top:t.rect.element.marginTop,bottom:t.rect.element.marginBottom}:{top:0,bottom:0}},Xn=function calculateListHeight(e){var t=0,r=0,n=e.ref.list,i=n.childViews[0],o=i.childViews.filter((function(e){return e.rect.element.height})),a=e.query("GET_ACTIVE_ITEMS").map((function(e){return o.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));if(0===a.length)return{visual:t,bounds:r};var s=i.rect.element.width,u=yr(i,a,n.dragCoordinates),l=a[0].rect.element,c=l.marginTop+l.marginBottom,f=l.marginLeft+l.marginRight,d=l.width+f,p=l.height+c,E=void 0!==u&&u>=0?1:0,m=a.find((function(e){return e.markedForRemoval&&e.opacity<.45}))?-1:0,g=a.length+E+m,I=getItemsPerRow(s,d);return 1===I?a.forEach((function(e){var n=e.rect.element.height+c;r+=n,t+=n*e.opacity})):(r=Math.ceil(g/I)*p,t=r),{visual:t,bounds:r}},Zn=function calculateRootBoundingBoxHeight(e){var t=e.ref.measureHeight||null;return{cappedHeight:parseInt(e.style.maxHeight,10)||null,fixedHeight:0===t?null:t}},Qn=function exceedsMaxFiles(e,t){var r=e.query("GET_ALLOW_REPLACE"),n=e.query("GET_ALLOW_MULTIPLE"),i=e.query("GET_TOTAL_ITEMS"),o=e.query("GET_MAX_FILES"),a=t.length;return!n&&a>1||!!(z(o=n||r?o:1)&&i+a>o)&&(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:st("warning",0,"Max files")}),!0)},Kn=function getDragIndex(e,t,r){var n=e.childViews[0];return yr(n,t,{left:r.scopeLeft-n.rect.element.left,top:r.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},$n=function toggleDrop(e){var t=e.query("GET_ALLOW_DROP"),r=e.query("GET_DISABLED"),n=t&&!r;if(n&&!e.ref.hopper){var i=Ln(e.element,(function(t){var r=e.query("GET_BEFORE_DROP_FILE")||function(){return!0};return!e.query("GET_DROP_VALIDATION")||t.every((function(t){return Se("ALLOW_HOPPER_ITEM",t,{query:e.query}).every((function(e){return!0===e}))&&r(t)}))}),{filterItems:function filterItems(t){var r=e.query("GET_IGNORED_FILES");return t.filter((function(e){return!Ot(e)||!r.includes(e.name.toLowerCase())}))},catchesDropsOnPage:e.query("GET_DROP_ON_PAGE"),requiresDropOnElement:e.query("GET_DROP_ON_ELEMENT")});i.onload=function(t,r){var n=e.ref.list.childViews[0].childViews.filter((function(e){return e.rect.element.height})),i=e.query("GET_ACTIVE_ITEMS").map((function(e){return n.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));De("ADD_ITEMS",t,{dispatch:e.dispatch}).then((function(t){if(Qn(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:Kn(e.ref.list,i,r),interactionMethod:ue})})),e.dispatch("DID_DROP",{position:r}),e.dispatch("DID_END_DRAG",{position:r})},i.ondragstart=function(t){e.dispatch("DID_START_DRAG",{position:t})},i.ondrag=Wn((function(t){e.dispatch("DID_DRAG",{position:t})})),i.ondragend=function(t){e.dispatch("DID_END_DRAG",{position:t})},e.ref.hopper=i,e.ref.drip=e.appendChildView(e.createChildView(zr))}else!n&&e.ref.hopper&&(e.ref.hopper.destroy(),e.ref.hopper=null,e.removeChildView(e.ref.drip))},Jn=function toggleBrowse(e,t){var r=e.query("GET_ALLOW_BROWSE"),n=e.query("GET_DISABLED"),i=r&&!n;i&&!e.ref.browser?e.ref.browser=e.appendChildView(e.createChildView(Ur,Object.assign({},t,{onload:function onload(t){De("ADD_ITEMS",t,{dispatch:e.dispatch}).then((function(t){if(Qn(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:le})}))}})),0):!i&&e.ref.browser&&(e.removeChildView(e.ref.browser),e.ref.browser=null)},ei=function togglePaste(e){var t=e.query("GET_ALLOW_PASTE"),r=e.query("GET_DISABLED"),n=t&&!r;n&&!e.ref.paster?(e.ref.paster=Nn(),e.ref.paster.onload=function(t){De("ADD_ITEMS",t,{dispatch:e.dispatch}).then((function(t){if(Qn(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:ce})}))}):!n&&e.ref.paster&&(e.ref.paster.destroy(),e.ref.paster=null)},ti=C({DID_SET_ALLOW_BROWSE:function DID_SET_ALLOW_BROWSE(e){var t=e.root,r=e.props;Jn(t,r)},DID_SET_ALLOW_DROP:function DID_SET_ALLOW_DROP(e){var t=e.root;$n(t)},DID_SET_ALLOW_PASTE:function DID_SET_ALLOW_PASTE(e){var t=e.root;ei(t)},DID_SET_DISABLED:function DID_SET_DISABLED(e){var t=e.root,r=e.props;$n(t),ei(t),Jn(t,r),t.query("GET_DISABLED")?t.element.dataset.disabled="disabled":t.element.removeAttribute("data-disabled")}}),ri=M({name:"root",read:function read(e){var t=e.root;t.ref.measure&&(t.ref.measureHeight=t.ref.measure.offsetHeight)},create:function create(e){var t=e.root,r=e.props,n=t.query("GET_ID");n&&(t.element.id=n);var i=t.query("GET_CLASS_NAME");i&&i.split(" ").filter((function(e){return e.length})).forEach((function(e){t.element.classList.add(e)})),t.ref.label=t.appendChildView(t.createChildView(Yr,Object.assign({},r,{translateY:null,caption:t.query("GET_LABEL_IDLE")}))),t.ref.list=t.appendChildView(t.createChildView(Lr,{translateY:null})),t.ref.panel=t.appendChildView(t.createChildView(mr,{name:"panel-root"})),t.ref.assistant=t.appendChildView(t.createChildView(Yn,Object.assign({},r))),t.ref.data=t.appendChildView(t.createChildView($r,Object.assign({},r))),t.ref.measure=Ft("div"),t.ref.measure.style.height="100%",t.element.appendChild(t.ref.measure),t.ref.bounds=null,t.query("GET_STYLES").filter((function(e){return!x(e.value)})).map((function(e){var r=e.name,n=e.value;t.element.dataset[r]=n})),t.ref.widthPrevious=null,t.ref.widthUpdated=Wn((function(){t.ref.updateHistory=[],t.dispatch("DID_RESIZE_ROOT")}),250),t.ref.previousAspectRatio=null,t.ref.updateHistory=[];var o=window.matchMedia("(pointer: fine) and (hover: hover)").matches,a="PointerEvent"in window;t.query("GET_ALLOW_REORDER")&&a&&!o&&(t.element.addEventListener("touchmove",zn,{passive:!1}),t.element.addEventListener("gesturestart",zn));var s=t.query("GET_CREDITS");if(2===s.length){var u=document.createElement("a");u.className="filepond--credits",u.setAttribute("aria-hidden","true"),u.href=s[0],u.tabindex=-1,u.target="_blank",u.rel="noopener noreferrer",u.textContent=s[1],t.element.appendChild(u),t.ref.credits=u}},write:function write(e){var t=e.root,r=e.props,n=e.actions;if(ti({root:t,props:r,actions:n}),n.filter((function(e){return/^DID_SET_STYLE_/.test(e.type)})).filter((function(e){return!x(e.data.value)})).map((function(e){var r=e.type,n=e.data,i=jn(r.substr(8).toLowerCase(),"_");t.element.dataset[i]=n.value,t.invalidateLayout()})),!t.rect.element.hidden){t.rect.element.width!==t.ref.widthPrevious&&(t.ref.widthPrevious=t.rect.element.width,t.ref.widthUpdated());var i=t.ref.bounds;i||(i=t.ref.bounds=Zn(t),t.element.removeChild(t.ref.measure),t.ref.measure=null);var o=t.ref,a=o.hopper,s=o.label,u=o.list,l=o.panel;a&&a.updateHopperState();var c=t.query("GET_PANEL_ASPECT_RATIO"),f=t.query("GET_ALLOW_MULTIPLE"),d=t.query("GET_TOTAL_ITEMS"),p=d===(f?t.query("GET_MAX_FILES")||1e6:1),E=n.find((function(e){return"DID_ADD_ITEM"===e.type}));if(p&&E){var m=E.data.interactionMethod;s.opacity=0,f?s.translateY=-40:m===se?s.translateX=40:s.translateY=m===le?40:30}else p||(s.opacity=1,s.translateX=0,s.translateY=0);var g=Hn(t),I=Xn(t),h=s.rect.element.height,T=!f||p?0:h,v=p?u.rect.element.marginTop:0,y=0===d?0:u.rect.element.marginBottom,R=T+v+I.visual+y,O=T+v+I.bounds+y;if(u.translateY=Math.max(0,T-u.rect.element.marginTop)-g.top,c){var D=t.rect.element.width,S=D*c;c!==t.ref.previousAspectRatio&&(t.ref.previousAspectRatio=c,t.ref.updateHistory=[]);var A=t.ref.updateHistory;if(A.push(D),A.length>4)for(var w=A.length,b=w-10,L=0,P=w;P>=b;P--)if(A[P]===A[P-2]&&L++,L>=2)return;l.scalable=!1,l.height=S;var M=S-T-(y-g.bottom)-(p?v:0);I.visual>M?u.overflow=M:u.overflow=null,t.height=S}else if(i.fixedHeight){l.scalable=!1;var C=i.fixedHeight-T-(y-g.bottom)-(p?v:0);I.visual>C?u.overflow=C:u.overflow=null}else if(i.cappedHeight){var N=R>=i.cappedHeight,G=Math.min(i.cappedHeight,R);l.scalable=!0,l.height=N?G:G-g.top-g.bottom;var F=G-T-(y-g.bottom)-(p?v:0);R>i.cappedHeight&&I.visual>F?u.overflow=F:u.overflow=null,t.height=Math.min(i.cappedHeight,O-g.top-g.bottom)}else{var B=d>0?g.top+g.bottom:0;l.scalable=!0,l.height=Math.max(h,R-B),t.height=Math.max(h,O-B)}t.ref.credits&&l.heightCurrent&&(t.ref.credits.style.transform="translateY("+l.heightCurrent+"px)")}},destroy:function destroy(e){var t=e.root;t.ref.paster&&t.ref.paster.destroy(),t.ref.hopper&&t.ref.hopper.destroy(),t.element.removeEventListener("touchmove",zn),t.element.removeEventListener("gesturestart",zn)},mixins:{styles:["height"]}}),ni=function createApp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null,n=we(),o=r(re(n),[ke,ae(n)],[Nt,oe(n)]);o.dispatch("SET_OPTIONS",{options:e});var a=function visibilityHandler(){document.hidden||o.dispatch("KICK")};document.addEventListener("visibilitychange",a);var s=null,u=!1,l=!1,c=null,f=null,d=function resizeHandler(){u||(u=!0),clearTimeout(s),s=setTimeout((function(){u=!1,c=null,f=null,l&&(l=!1,o.dispatch("DID_STOP_RESIZE"))}),500)};window.addEventListener("resize",d);var p=ri(o,{id:de()}),E=!1,m=!1,g={_read:function _read(){u&&(f=window.innerWidth,c||(c=f),l||f===c||(o.dispatch("DID_START_RESIZE"),l=!0)),m&&E&&(E=null===p.element.offsetParent),E||(p._read(),m=p.rect.element.hidden)},_write:function _write(e){var t=o.processActionQueue().filter((function(e){return!/^SET_/.test(e.type)}));E&&!t.length||(y(t),E=p._write(e,t,l),Ie(o.query("GET_ITEMS")),E&&o.processDispatchQueue())}},I=function createEvent(e){return function(t){var r={type:e};if(!t)return r;if(t.hasOwnProperty("error")&&(r.error=t.error?Object.assign({},t.error):null),t.status&&(r.status=Object.assign({},t.status)),t.file&&(r.output=t.file),t.source)r.file=t.source;else if(t.item||t.id){var n=t.item?t.item:o.query("GET_ITEM",t.id);r.file=n?ge(n):null}return t.items&&(r.items=t.items.map(ge)),/progress/.test(e)&&(r.progress=t.progress),t.hasOwnProperty("origin")&&t.hasOwnProperty("target")&&(r.origin=t.origin,r.target=t.target),r}},h={DID_DESTROY:I("destroy"),DID_INIT:I("init"),DID_THROW_MAX_FILES:I("warning"),DID_INIT_ITEM:I("initfile"),DID_START_ITEM_LOAD:I("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:I("addfileprogress"),DID_LOAD_ITEM:I("addfile"),DID_THROW_ITEM_INVALID:[I("error"),I("addfile")],DID_THROW_ITEM_LOAD_ERROR:[I("error"),I("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[I("error"),I("removefile")],DID_PREPARE_OUTPUT:I("preparefile"),DID_START_ITEM_PROCESSING:I("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:I("processfileprogress"),DID_ABORT_ITEM_PROCESSING:I("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:I("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:I("processfiles"),DID_REVERT_ITEM_PROCESSING:I("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[I("error"),I("processfile")],DID_REMOVE_ITEM:I("removefile"),DID_UPDATE_ITEMS:I("updatefiles"),DID_ACTIVATE_ITEM:I("activatefile"),DID_REORDER_ITEMS:I("reorderfiles")},v=function exposeEvent(e){var t=Object.assign({pond:B},e);delete t.type,p.element.dispatchEvent(new CustomEvent("FilePond:"+e.type,{detail:t,bubbles:!0,cancelable:!0,composed:!0}));var r=[];e.hasOwnProperty("error")&&r.push(e.error),e.hasOwnProperty("file")&&r.push(e.file);var n=["type","error","file"];Object.keys(e).filter((function(e){return!n.includes(e)})).forEach((function(t){return r.push(e[t])})),B.fire.apply(B,[e.type].concat(r));var i=o.query("GET_ON"+e.type.toUpperCase());i&&i.apply(void 0,r)},y=function routeActionsToEvents(e){e.length&&e.filter((function(e){return h[e.type]})).forEach((function(e){var t=h[e.type];(Array.isArray(t)?t:[t]).forEach((function(t){"DID_INIT_ITEM"===e.type?v(t(e.data)):setTimeout((function(){v(t(e.data))}),0)}))}))},R=function setOptions(e){return o.dispatch("SET_OPTIONS",{options:e})},O=function getFile(e){return o.query("GET_ACTIVE_ITEM",e)},D=function prepareFile(e){return new Promise((function(t,r){o.dispatch("REQUEST_ITEM_PREPARE",{query:e,success:function success(e){t(e)},failure:function failure(e){r(e)}})}))},S=function addFile(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){b([{source:e,options:t}],{index:t.index}).then((function(e){return r(e&&e[0])})).catch(n)}))},A=function isFilePondFile(e){return e.file&&e.id},w=function removeFile(e,t){return"object"!=typeof e||A(e)||t||(t=e,e=void 0),o.dispatch("REMOVE_ITEM",Object.assign({},t,{query:e})),null===o.query("GET_ACTIVE_ITEM",e)},b=function addFiles(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new Promise((function(e,r){var n=[],i={};if(F(t[0]))n.push.apply(n,t[0]),Object.assign(i,t[1]||{});else{var a=t[t.length-1];"object"!=typeof a||a instanceof Blob||Object.assign(i,t.pop()),n.push.apply(n,t)}o.dispatch("ADD_ITEMS",{items:n,index:i.index,interactionMethod:se,success:e,failure:r})}))},L=function getFiles(){return o.query("GET_ACTIVE_ITEMS")},P=function processFile(e){return new Promise((function(t,r){o.dispatch("REQUEST_ITEM_PROCESSING",{query:e,success:function success(e){t(e)},failure:function failure(e){r(e)}})}))},M=function prepareFiles(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Array.isArray(t[0])?t[0]:t,i=n.length?n:L();return Promise.all(i.map(D))},C=function processFiles(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Array.isArray(t[0])?t[0]:t;if(!n.length){var i=L().filter((function(e){return!(e.status===he.IDLE&&e.origin===Te.LOCAL)&&e.status!==he.PROCESSING&&e.status!==he.PROCESSING_COMPLETE&&e.status!==he.PROCESSING_REVERT_ERROR}));return Promise.all(i.map(P))}return Promise.all(n.map(P))},x=function removeFiles(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=Array.isArray(t[0])?t[0]:t;"object"==typeof i[i.length-1]?n=i.pop():Array.isArray(t[0])&&(n=t[1]);var o=L();if(!i.length)return Promise.all(o.map((function(e){return w(e,n)})));var a=i.map((function(e){return T(e)?o[e]?o[e].id:null:e})).filter((function(e){return e}));return a.map((function(e){return w(e,n)}))},B=Object.assign({},Ee(),{},g,{},ie(o,n),{setOptions:R,addFile:S,addFiles:b,getFile:O,processFile:P,prepareFile:D,removeFile:w,moveFile:function moveFile(e,t){return o.dispatch("MOVE_ITEM",{query:e,index:t})},getFiles:L,processFiles:C,removeFiles:x,prepareFiles:M,sort:function sort(e){return o.dispatch("SORT",{compare:e})},browse:function browse(){var e=p.element.querySelector("input[type=file]");e&&e.click()},destroy:function destroy(){B.fire("destroy",p.element),o.dispatch("ABORT_ALL"),p._destroy(),window.removeEventListener("resize",d),document.removeEventListener("visibilitychange",a),o.dispatch("DID_DESTROY")},insertBefore:function insertBefore$1(e){return N(p.element,e)},insertAfter:function insertAfter$1(e){return G(p.element,e)},appendTo:function appendTo(e){return e.appendChild(p.element)},replaceElement:function replaceElement(e){N(p.element,e),e.parentNode.removeChild(e),t=e},restoreElement:function restoreElement(){t&&(G(t,p.element),p.element.parentNode.removeChild(p.element),t=null)},isAttachedTo:function isAttachedTo(e){return p.element===e||t===e},element:{get:function get(){return p.element}},status:{get:function get(){return o.query("GET_STATUS")}}});return o.dispatch("DID_INIT"),i(B)},ii=function createAppObject(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};n(we(),(function(e,r){t[e]=r[0]}));var r=ni(Object.assign({},t,{},e));return r},oi=function attributeNameToPropertyName(e){return jn(e.replace(/^data-/,""))},ai=function mapObject(e,t){n(t,(function(t,r){n(e,(function(n,i){var o=new RegExp(t);if(o.test(n)&&(delete e[n],!1!==r))if(k(r))e[r]=i;else{var a=r.group;K(r)&&!e[a]&&(e[a]={}),e[a][function lowerCaseFirstLetter(e){return e.charAt(0).toLowerCase()+e.slice(1)}(n.replace(o,""))]=i}})),r.mapping&&mapObject(e[r.group],r.mapping)}))},si=function getAttributesAsObject(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];n(e.attributes,(function(t){r.push(e.attributes[t])}));var i=r.filter((function(e){return e.name})).reduce((function(t,r){var n=o(e,r.name);return t[oi(r.name)]=n===r.name||n,t}),{});return ai(i,t),i},ui=function createAppAtElement(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};Se("SET_ATTRIBUTE_TO_OPTION_MAP",r);var n=Object.assign({},t),i=si("FIELDSET"===e.nodeName?e.querySelector("input[type=file]"):e,r);Object.keys(i).forEach((function(e){K(i[e])?(K(n[e])||(n[e]={}),Object.assign(n[e],i[e])):n[e]=i[e]})),n.files=(t.files||[]).concat(Array.from(e.querySelectorAll("input:not([type=file])")).map((function(e){return{source:e.value,options:{type:e.dataset.type}}})));var o=ii(n);return e.files&&Array.from(e.files).forEach((function(e){o.addFile(e)})),o.replaceElement(e),o},li=function createApp(){return t(arguments.length<=0?void 0:arguments[0])?ui.apply(void 0,arguments):ii.apply(void 0,arguments)},ci=["fire","_read","_write"],fi=function createAppAPI(e){var t={};return _e(e,t,ci),t},di=function replaceInString(e,t){return e.replace(/(?:{([a-zA-Z]+)})/g,(function(e,r){return t[r]}))},pi=function createWorker(e){var t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r);return{transfer:function transfer(e,t){},post:function post(e,t,r){var i=de();n.onmessage=function(e){e.data.id===i&&t(e.data.message)},n.postMessage({id:i,message:e},r)},terminate:function terminate(){n.terminate(),URL.revokeObjectURL(r)}}},Ei=function loadImage(e){return new Promise((function(t,r){var n=new Image;n.onload=function(){t(n)},n.onerror=function(e){r(e)},n.src=e}))},_i=function renameFile(e,t){var r=e.slice(0,e.size,e.type);return r.lastModifiedDate=e.lastModifiedDate,r.name=t,r},mi=function copyFile(e){return _i(e,e.name)},gi=[],Ii=function createAppPlugin(e){gi.includes(e)||(gi.push(e),function extendDefaultOptions(e){Object.assign(be,e)}(e({addFilter:Ae,utils:{Type:Re,forin:n,isString:k,isFile:Ot,toNaturalFileSize:kt,replaceInString:di,getExtensionFromFilename:ze,getFilenameWithoutExtension:yt,guesstimateMimeType:rn,getFileFromBlob:Qe,getFilenameFromURL:We,createRoute:C,createWorker:pi,createView:M,createItemAPI:ge,loadImage:Ei,copyFile:mi,renameFile:_i,createBlob:Ke,applyFilterChain:De,text:xt,getNumericAspectRatioFromString:Pe},views:{fileActionButton:qt}}).options))},hi=(er=E()&&!function isOperaMini(){return"[object OperaMini]"===Object.prototype.toString.call(window.operamini)}()&&function hasVisibility(){return"visibilityState"in document}()&&function hasPromises(){return"Promise"in window}()&&function hasBlobSlice(){return"slice"in Blob.prototype}()&&function hasCreateObjectURL(){return"URL"in window&&"createObjectURL"in window.URL}()&&function hasTiming(){return"performance"in window}()&&(function hasCSSSupports(){return"supports"in(window.CSS||{})}()||function isIE11(){return/MSIE|Trident/.test(window.navigator.userAgent)}()),function(){return er}),Ti={apps:[]},vi=function fn(){};if(e.Status={},e.FileStatus={},e.FileOrigin={},e.OptionTypes={},e.create=vi,e.destroy=vi,e.parse=vi,e.find=vi,e.registerPlugin=vi,e.getOptions=vi,e.setOptions=vi,hi()){!function createPainter(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,n="__framePainter";if(window[n])return window[n].readers.push(e),void window[n].writers.push(t);window[n]={readers:[e],writers:[t]};var i=window[n],o=1e3/r,a=null,s=null,u=null,l=null,c=function setTimerType(){document.hidden?(u=function requestTick(){return window.setTimeout((function(){return f(performance.now())}),o)},l=function cancelTick(){return window.clearTimeout(s)}):(u=function requestTick(){return window.requestAnimationFrame(f)},l=function cancelTick(){return window.cancelAnimationFrame(s)})};document.addEventListener("visibilitychange",(function(){l&&l(),c(),f(performance.now())}));var f=function tick(e){s=u(tick),a||(a=e);var t=e-a;t<=o||(a=e-t%o,i.readers.forEach((function(e){return e()})),i.writers.forEach((function(t){return t(e)})))};c(),f(performance.now())}((function(){Ti.apps.forEach((function(e){return e._read()}))}),(function(e){Ti.apps.forEach((function(t){return t._write(e)}))}));var yi=function dispatch(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:hi,create:e.create,destroy:e.destroy,parse:e.parse,find:e.find,registerPlugin:e.registerPlugin,setOptions:e.setOptions}})),document.removeEventListener("DOMContentLoaded",dispatch)};"loading"!==document.readyState?setTimeout((function(){return yi()}),0):document.addEventListener("DOMContentLoaded",yi);var Ri=function updateOptionTypes(){return n(we(),(function(t,r){e.OptionTypes[t]=r[1]}))};e.Status=Object.assign({},Ce),e.FileOrigin=Object.assign({},Te),e.FileStatus=Object.assign({},he),e.OptionTypes={},Ri(),e.create=function create(){var t=li.apply(void 0,arguments);return t.on("destroy",e.destroy),Ti.apps.push(t),fi(t)},e.destroy=function destroy(e){var t=Ti.apps.findIndex((function(t){return t.isAttachedTo(e)}));return t>=0&&(Ti.apps.splice(t,1)[0].restoreElement(),!0)},e.parse=function parse(t){return Array.from(t.querySelectorAll(".filepond")).filter((function(e){return!Ti.apps.find((function(t){return t.isAttachedTo(e)}))})).map((function(t){return e.create(t)}))},e.find=function find(e){var t=Ti.apps.find((function(t){return t.isAttachedTo(e)}));return t?fi(t):null},e.registerPlugin=function registerPlugin(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach(Ii),Ri()},e.getOptions=function getOptions$1(){var e={};return n(we(),(function(t,r){e[t]=r[0]})),e},e.setOptions=function setOptions$1(t){return K(t)&&(Ti.apps.forEach((function(e){e.setOptions(t)})),function setOptions(e){n(e,(function(e,t){be[e]&&(be[e][0]=ee(t,be[e][0],be[e][1]))}))}(t)),e.getOptions()}}e.supported=hi,Object.defineProperty(e,"__esModule",{value:!0})}(t)}});