1"use strict";(self.rspackChunk=self.rspackChunk||[]).push([[5003],{28922:function(t,e,r){r.d(e,{bL:function(){return P},F$:function(){return F}});var n,o,a,i=r(96540),c=r(71974),s=r(8567),u=r.n(s),l=r(27520),f=r.n(l),h=r(30737),p=r.n(h);r(48619);var d=r(24798);function v(){v=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(e,r,n,a){var i,c,s,u,l=Object.create((r&&r.prototype instanceof g?r:g).prototype);return o(l,"_invoke",{value:(i=e,c=n,s=new P(a||[]),u=h,function(e,r){if(u===p)throw Error("Generator is already running");if(u===d){if("throw"===e)throw r;return{value:t,done:!0}}for(s.method=e,s.arg=r;;){var n=s.delegate;if(n){var o=function e(r,n){var o=n.method,a=r.iterator[o];if(a===t)return n.delegate=null,"throw"===o&&r.iterator.return&&(n.method="return",n.arg=t,e(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var i=f(a,r.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var c=i.arg;return c?c.done?(n[r.resultName]=c.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):c:(n.method="throw",n.arg=TypeError("iterator result is not an object"),n.delegate=null,y)}(n,s);if(o){if(o===y)continue;return o}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(u===h)throw u=d,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);u=p;var a=f(i,c,s);if("normal"===a.type){if(u=s.done?d:"suspendedYield",a.arg===y)continue;return{value:a.arg,done:s.done}}"throw"===a.type&&(u=d,s.method="throw",s.arg=a.arg)}})}),l}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",y={};function g(){}function m(){}function w(){}var x={};u(x,i,function(){return this});var b=Object.getPrototypeOf,E=b&&b(b(U([])));E&&E!==r&&n.call(E,i)&&(x=E);var L=w.prototype=g.prototype=Object.create(x);function O(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function j(t,e){var r;o(this,"_invoke",{value:function(o,a){function i(){return new e(function(r,i){!function r(o,a,i,c){var s=f(t[o],t,a);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then(function(t){r("next",t,i,c)},function(t){r("throw",t,i,c)}):e.resolve(l).then(function(t){u.value=t,i(u)},function(t){return r("throw",t,i,c)})}c(s.arg)}(o,a,r,i)})}return r=r?r.then(i,i):i()}})}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function U(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw TypeError(typeof e+" is not iterable")}return m.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=u(w,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,s,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,c,function(){return this}),e.AsyncIterator=j,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new j(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},O(L),u(L,s,"Generator"),u(L,i,function(){return this}),u(L,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=U,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEac
1h(_),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:U(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function y(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(t){r(t);return}c.done?e(s):Promise.resolve(s).then(n,o)}var g=(n=(v()).mark(function t(e,r){var n,o,a,i,c,s,u,l;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=e,t.next=3,m(e);case 3:if(c=(i=t.sent).naturalWidth,s=i.naturalHeight,u=!1,(r.maxWidth||r.maxHeight)&&((l=c/s)<=(null!=(n=r.maxWidth)?n:1/0)/(null!=(o=r.maxHeight)?o:1/0)?s>r.maxHeight&&(c=(s=r.maxHeight)*l,u=!0):c>r.maxWidth&&(s=(c=r.maxWidth)/l,u=!0)),!("png"!==r.format||u)){t.next=12;break}return t.next=11,w(i,c,s,r.format,r.quality);case 11:a=t.sent;case 12:if("png"!==r.format){t.next=30;break}return t.prev=13,t.t0=d.crushPng,t.t1=Uint8Array,t.next=18,a.arrayBuffer();case 18:return t.t2=t.sent,t.t3=new t.t1(t.t2),t.t4={args:["-reduce"],timeout:5e3},t.next=23,(0,t.t0)(t.t3,t.t4);case 23:a=t.sent,t.next=29;break;case 26:t.prev=26,t.t5=t.catch(13),console.error(t.t5);case 29:a.size>=e.size&&(a=e,c=i.naturalWidth,s=i.naturalHeight);case 30:return t.abrupt("return",{data:a,width:c,height:s});case 31:case"end":return t.stop()}},t,null,[[13,26]])}),o=function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function i(t){y(a,r,o,i,c,"next",t)}function c(t){y(a,r,o,i,c,"throw",t)}i(void 0)})},function(t,e){return o.apply(this,arguments)}),m=t=>new Promise((e,r)=>{var n=URL.createObjectURL(t),o=new Image;o.src=n,o.crossOrigin="anonymous",o.onload=()=>{URL.revokeObjectURL(n),e(o)},o.onerror=t=>r(t)}),w=(t,e,r,n,o)=>new Promise((a,i)=>{var c=document.createElement("canvas"),s=c.getContext("2d");c.width=e,c.height=r,s.drawImage(t,0,0,c.width,c.height),c.toBlob(t=>{t?a(t):i(Error("Conversion error"))},"image/".concat(n),o)}),x=r(76370),b=["key"];function E(){E=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(e,r,n,a){var i,c,s,u,l=Object.create((r&&r.prototype instanceof y?r:y).prototype);return o(l,"_invoke",{value:(i=e,c=n,s=new P(a||[]),u=h,function(e,r){if(u===p)throw Error("Generator is already running");if(u===d){if("throw"===e)throw r;return{value:t,done:!0}}for(s.method=e,s.arg=r;;){var n=s.delegate;if(n){var o=function e(r,n){var o=n.method,a=r.iterator[o];if(a===t)return n.delegate=null,"throw"===o&&r.iterator.return&&
vendor: 5,831 bytes, line 1
1(n.method="return",n.arg=t,e(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=TypeError("The iterator does not provide a '"+o+"' method")),v;var i=f(a,r.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var c=i.arg;return c?c.done?(n[r.resultName]=c.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):c:(n.method="throw",n.arg=TypeError("iterator result is not an object"),n.delegate=null,v)}(n,s);if(o){if(o===v)continue;return o}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(u===h)throw u=d,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);u=p;var a=f(i,c,s);if("normal"===a.type){if(u=s.done?d:"suspendedYield",a.arg===v)continue;return{value:a.arg,done:s.done}}"throw"===a.type&&(u=d,s.method="throw",s.arg=a.arg)}})}),l}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",v={};function y(){}function g(){}function m(){}var w={};u(w,i,function(){return this});var x=Object.getPrototypeOf,b=x&&x(x(U([])));b&&b!==r&&n.call(b,i)&&(w=b);var L=m.prototype=y.prototype=Object.create(w);function O(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function j(t,e){var r;o(this,"_invoke",{value:function(o,a){function i(){return new e(function(r,i){!function r(o,a,i,c){var s=f(t[o],t,a);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then(function(t){r("next",t,i,c)},function(t){r("throw",t,i,c)}):e.resolve(l).then(function(t){u.value=t,i(u)},function(t){return r("throw",t,i,c)})}c(s.arg)}(o,a,r,i)})}return r=r?r.then(i,i):i()}})}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function U(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw TypeError(typeof e+" is not iterable")}return g.prototype=m,o(L,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,s,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,c,function(){return this}),e.AsyncIterator=j,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new j(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},O(L),u(L,s,"Generator"),u(L,i,function(){return this}),u(L,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=U,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:U(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;
1!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);s=!0);}catch(t){u=!0,o=t}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return O(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function j(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(t){r(t);return}c.done?e(s):Promise.resolve(s).then(n,o)}function k(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){j(a,n,o,i,c,"next",t)}function c(t){j(a,n,o,i,c,"throw",t)}i(void 0)})}}var _=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class P extends Error{constructor(t){var e;super(t.message),this.userMessage=null!=(e=t.userMessage)?e:t.message,this.context=t.context}}class U{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.createRef();this.inputRef=t,this.events=new EventTarget}listenForInput(t){var e=this.inputRef.current,r=e.onchange;e.setAttribute("avo-tag",t),"AddContactsModal"===t&&e.setAttribute("accept","text/plain, application/vnd.ms-excel, text/x-csv, application/csv, application/x-csv, text/csv, text/comma-separated-values, text/x-comma-separated-values, text/tab-separated-values"),"DataSource"===t&&e.setAttribute("accept","application/pdf, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/csv, text/html, text/plain, text/markdown"),e.onchange=t=>{t.stopImmediatePropagation(),Object.assign(e,{onchange:r}),this.onInputChange(t)},e.click()}triggerUpload(t,e){this.inputRef.current?e?e.length<=0||(this.reportUploadStarted(e),this.uploadFiles(e).then(e=>this.reportUploadCompleted(e,t)).catch(r=>this.reportUploadError(e,r,t)).finally(()=>{this.inputRef.current&&(this.inputRef.current.value="")}
1)):this.listenForInput(t):console.warn("FileUploader: cannot start an upload, input field was not rendered")}addUploadStartListener(t){this.events.addEventListener("upload-start",t)}removeUploadStartListener(t){this.events.removeEventListener("upload-start",t)}addUploadProgressListener(t){this.events.addEventListener("upload-progress",t)}removeUploadProgressListener(t){this.events.removeEventListener("upload-progress",t)}defaultCompleteListener(t){}addUploadCompleteListener(t,e){this.events.addEventListener("upload-complete:".concat(t),e)}removeUploadCompleteListener(t,e){this.events.removeEventListener("upload-complete:".concat(t),e)}defaultErrorListener(t){}addUploadErrorListener(t,e){this.events.addEventListener("upload-error:".concat(t),e)}removeUploadErrorListener(t,e){this.events.removeEventListener("upload-error:".concat(t),e)}onInputChange(t){var e=t.currentTarget,r=e.files;this.triggerUpload(e.getAttribute("avo-tag"),Array.from(r))}reportUploadStarted(t){var e=new CustomEvent("upload-start",{detail:{files:t}});this.events.dispatchEvent(e)}reportUploadCompleted(t,e){var r=new CustomEvent("upload-complete:".concat(e),{detail:t});this.events.dispatchEvent(r)}reportUploadError(t,e,r){null!=e.userMessage||(e.userMessage="Error");var n=new CustomEvent("upload-error:".concat(r),{detail:{files:t,error:e}});this.events.dispatchEvent(n)}reportUploadProgress(t,e){var r=new CustomEvent("upload-progress",{detail:{file:t,uploadedRatio:e}});this.events.dispatchEvent(r)}}!function(t,e,r,n){var o,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(i=(a<3?o(i):a>3?o(e,r,i):o(e,r))||i);a>3&&i&&Object.defineProperty(e,r,i)}([c.Ay,_("design:type",Function),_("design:paramtypes",["function"==typeof(a="u">typeof Event&&Event)?a:Object]),_("design:returntype",void 0)],U.prototype,"onInputChange",null);class F extends U{constructor(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;super(r),this.s3Url=t,this.s3FormData=e,this.inputRef=r}uploadFiles(t){var e=this;return k((E()).mark(function r(){var n,o;return E().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return o=(n=t.map(t=>({file:t}))).reduce((r,n)=>r.then(()=>new Promise(function(){var r=k((E()).mark(function r(o,a){var i,c,s,l,h,d,v,y,m,w,O,j,k,_,U,F,S,R,A,C,I,T,N,G,M,D,H,W,z;return E().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(n.file.slice){r.next=3;break}return x.jI.notify(Error("Argument is not an instance of File"),{context:{files:t,constructors:t.map(t=>{var e;return null==(e=t.constructor)?void 0:e.name})}}),r.abrupt("return");case 3:if(s=e.s3FormData["x-amz-meta-default_file_type"]||"text/csv",h=void 0===(l=n.file.type)?s:l,(null==(i=n.file.name)?void 0:i.endsWith(".vcf"))&&(h="text/vcard"),!((v=(d=e.s3FormData["x-amz-meta-allowed_file_types"])&&JSON.parse(d))&&!v.includes(h))){r.next=11;break}return a(new P({message:"Invalid File Type! Please use one of the following: ".concat(v),context:{"File Type":h,"Allowed File Types":v}})),r.abrupt("return");case 11:if(!((w=(m=e.s3FormData["x-amz-meta-required_headers"])&&JSON.parse(m))&&w.length>0&&h.includes("csv"))){r.next=20;break}return r.next=16,new Promise((t,e)=>{var r=new FileReader;r.onload=()=>{var n=L(r.result.toString().split("\n"),1)[0],o=w.reduce((t,e)=>(RegExp(e,"i").test(n)||t.push(e),t),[]);if(o.length<1)t(null);else{var a=o.join(", ");e(new P({message:"CSV header is missing the following column(s): ".concat(a),context:{"Missing Headers":a}}))}},y=n.file,r.readAsText(y)}).catch(t=>t);case 16:if(!(O=r.sent)){r.next=20;break}return a(O),r.abrupt("return");case 20:if(j=null==(c=n.file.name)?void 0:c.split(".").pop(),k=u()(y||n.file),"image"!==h.substring(0,5)){r.next=49;break}return r.next=26,new Promise(t=>k.pipe(f()(t)));case 26:if(_=r.sent,"gif"!==j&&"image/gif"!==h){r.next=36;break}return U=new Blob([_]),F=new Image,S=URL.createObjectURL(U),r.next=33,new Promise(t=>{F.onload=()=>{n.dimensions={width:F.width,height:F.height},URL.revokeObjectURL(S),t()},F.src=S});case 33:k=u()(n.file),r.next=49;break;case 36:return R="image/jpeg"===h?"jpeg":"png",r.next=39,g(new Blob([_]),{format:R,quality:.75,maxWidth:1920,maxHeight:1080});case 39:C=(A=r.sent).data,n.dimensions={width:A.width,height:A.height},h="image/".concat(R),j=R,n.file=I=new File([C],"image.".concat(R),{type:h}),k=u()(I);case 49:n.type=h,T=new(p()),G=(N=e.s3FormData).key,M=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(N,b),D=Date.now().toString(),H=G.replace("${filename}
1",j?"".concat(D,".").concat(j):D),Object.entries(M).forEach(t=>{var e=L(t,2),r=e[0],n=e[1];return T.append(r,n)}),T.append("key",H),T.append("Content-Type",h),T.append("file",null!=k?k:n.file),W=Number.MAX_SAFE_INTEGER,z=0,T.getLength((t,e)=>{t&&a(t),W=e}),T.on("data",t=>{z+=t.length,e.reportUploadProgress(n.file,z/W)}),T.submit(e.s3Url,(t,r)=>{t?a(t):(201!==r.statusCode&&400!==r.statusCode&&a(new P({message:r.statusMessage,userMessage:"Error",context:{response:r}})),n.url="".concat(e.s3Url,"/").concat(H),n.key=H,o())});case 63:case"end":return r.stop()}},r)}));return function(t,e){return r.apply(this,arguments)}}())).catch(t=>{if(t instanceof P)throw t;throw new P({message:t.message,userMessage:"Error",context:{"File Type":n.file.type}})}),Promise.resolve()),r.next=4,o;case 4:return r.abrupt("return",n);case 5:case"end":return r.stop()}},r)}))()}}},28442:function(){},17943:function(){},42349:function(){},57047:function(){},82285:function(){},75150:function(){},4158:function(){},21298:function(){},17523:function(){}}]); 2//# sourceMappingURL=5003-1c0c8deb8283c66c.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.