var FileUploadWithPreview=function(){"use strict";var A,e=(function(A){var e=function(A){var e,t=Object.prototype,g=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",B=n.asyncIterator||"@@asyncIterator",E=n.toStringTag||"@@toStringTag";function r(A,e,t,g){var n=e&&e.prototype instanceof c?e:c,i=Object.create(n.prototype),B=new k(g||[]);return i._invoke=function(A,e,t){var g=o;return function(n,i){if(g===Q)throw new Error("Generator is already running");if(g===a){if("throw"===n)throw i;return R()}for(t.method=n,t.arg=i;;){var B=t.delegate;if(B){var E=S(B,t);if(E){if(E===s)continue;return E}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(g===o)throw g=a,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);g=Q;var r=C(A,e,t);if("normal"===r.type){if(g=t.done?a:I,r.arg===s)continue;return{value:r.arg,done:t.done}}"throw"===r.type&&(g=a,t.method="throw",t.arg=r.arg)}}}(A,t,B),i}function C(A,e,t){try{return{type:"normal",arg:A.call(e,t)}}catch(A){return{type:"throw",arg:A}}}A.wrap=r;var o="suspendedStart",I="suspendedYield",Q="executing",a="completed",s={};function c(){}function u(){}function l(){}var h={};h[i]=function(){return this};var m=Object.getPrototypeOf,f=m&&m(m(J([])));f&&f!==t&&g.call(f,i)&&(h=f);var d=l.prototype=c.prototype=Object.create(h);function p(A){["next","throw","return"].forEach(function(e){A[e]=function(A){return this._invoke(e,A)}})}function v(A){var e;this._invoke=function(t,n){function i(){return new Promise(function(e,i){!function e(t,n,i,B){var E=C(A[t],A,n);if("throw"!==E.type){var r=E.arg,o=r.value;return o&&"object"==typeof o&&g.call(o,"__await")?Promise.resolve(o.__await).then(function(A){e("next",A,i,B)},function(A){e("throw",A,i,B)}):Promise.resolve(o).then(function(A){r.value=A,i(r)},function(A){return e("throw",A,i,B)})}B(E.arg)}(t,n,e,i)})}return e=e?e.then(i,i):i()}}function S(A,t){var g=A.iterator[t.method];if(g===e){if(t.delegate=null,"throw"===t.method){if(A.iterator.return&&(t.method="return",t.arg=e,S(A,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=C(g,A.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,s;var i=n.arg;return i?i.done?(t[A.resultName]=i.value,t.next=A.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,s):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function y(A){var e={tryLoc:A[0]};1 in A&&(e.catchLoc=A[1]),2 in A&&(e.finallyLoc=A[2],e.afterLoc=A[3]),this.tryEntries.push(e)}function w(A){var e=A.completion||{};e.type="normal",delete e.arg,A.completion=e}function k(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(y,this),this.reset(!0)}function J(A){if(A){var t=A[i];if(t)return t.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var n=-1,B=function t(){for(;++n=0;--i){var B=this.tryEntries[i],E=B.completion;if("root"===B.tryLoc)return n("end");if(B.tryLoc<=this.prev){var r=g.call(B,"catchLoc"),C=g.call(B,"finallyLoc");if(r&&C){if(this.prev=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&g.call(n,"finallyLoc")&&this.prev=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),w(t),s}},catch:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===A){var g=t.completion;if("throw"===g.type){var n=g.arg;w(t)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(A,t,g){return this.delegate={iterator:J(A),resultName:t,nextLoc:g},"next"===this.method&&(this.arg=e),s}},A}(A.exports);try{regeneratorRuntime=e}catch(A){Function("r","regeneratorRuntime = r")(e)}}(A={exports:{}},A.exports),A.exports);function t(A,e,t,g,n,i,B){try{var E=A[i](B),r=E.value}catch(A){return void t(A)}E.done?e(r):Promise.resolve(r).then(g,n)}var g=function(A){return function(){var e=this,g=arguments;return new Promise(function(n,i){var B=A.apply(e,g);function E(A){t(B,n,i,E,r,"next",A)}function r(A){t(B,n,i,E,r,"throw",A)}E(void 0)})}};var n=function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")};function i(A,e){for(var t=0;t=0&&e.item(t)!==this;);return t>-1}),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(A){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),t=e.length>>>0;if("function"!=typeof A)throw new TypeError("predicate must be a function");for(var g=arguments[1],n=0;n\n \n ×\n \n \n '):e.imagePreview.innerHTML+='\n \n "):A.type.match("application/pdf")?e.options.showDeleteButtonOnImages?e.imagePreview.innerHTML+='\n \n \n ×\n \n \n '):e.imagePreview.innerHTML+='\n \n "):A.type.match("video/*")?e.options.showDeleteButtonOnImages?e.imagePreview.innerHTML+='\n \n \n ×\n \n \n '):e.imagePreview.innerHTML+='\n \n '):e.options.showDeleteButtonOnImages?e.imagePreview.innerHTML+='\n \n \n ×\n \n \n '):e.imagePreview.innerHTML+='\n \n '))}}},{key:"addImagesFromPath",value:function(A){var t=this;return new Promise(function(){var n=g(e.mark(function g(n,i){var B,E,r,C,o;return e.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:B=[],E=0;case 2:if(!(E")}},{key:"emulateInputSelection",value:function(){this.input.click()}},{key:"clearPreviewPanel",value:function(){this.input.value="",this.inputLabel.innerHTML=this.options.text.chooseFile,this.addBrowseButton(this.options.text.browse),this.imagePreview.style.backgroundImage='url("'.concat(this.baseImage,'")'),this.imagePreview.classList.remove("custom-file-container__image-preview--active"),this.cachedFileArray=[],this.imagePreview.innerHTML="",this.currentFileCount=0}}]),A}()}();