1/*! For license information please see form-fns.js.LICENSE.txt */ 2"use strict";(self.webpackChunkempori_base=self.webpackChunkempori_base||[]).push([[528],{8985:(e,n,t)=>{let i;function l(e){document.getElementById(e.spamProtectionDetails.captchaImgId).src=e.spamProtectionDetails.fetchUrlEmporiCaptcha+"?"+(new Date).getTime()}function r(e){i&&(l(e),clearInterval(i),i=setInterval((()=>{l(e)}),3e5))}t.r(n),t.d(n,{default:()=>u,formTexts:()=>c});var o=t(5285);function a(e,n,t){var i,l,r,o;const a=null===(i=n.closest("div.node-file"))||void 0===i?void 0:i.querySelector("p.input-desc");null!=a&&(a.hidden=e);const s=null===(l=n.closest("div.node-file"))||void 0===l?void 0:l.querySelector("p.error-desc");null!=s&&(null!=t&&(s.innerHTML=t),s.hidden=!e),e?null===(r=n.closest("div.file-input-container"))||void 0===r||r.classList.add("error-file"):null===(o=n.closest("div.file-input-container"))||void 0===o||o.classList.remove("error-file")}var s=function(e,n,t,i){return new(t||(t=Promise))((function(l,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?l(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(o,a)}s((i=i.apply(e,n||[])).next())}))};const c={noFiles:"No files",clearTitle:"Clear the files in this input",fileRequiredError:"Please select a file as it is required",validationError:"Could not send form. Check validation errors!"};function u(e){return s(this,void 0,void 0,(function*(){const n=document.getElementById(e.formId);n&&(e.spamProtectionDetails.isEmporiCaptchaEnabled&&function(e){l(e),i=setInterval((()=>{l(e)}),3e5);const n=document.getElementById(e.spamProtectionDetails.captchaImgId).nextElementSibling;null==n||n.addEventListener("click",(()=>{r(e)}))}(e),function(e,n){const t=n.querySelectorAll("input[type=file]"),i=e.form.settings.maxUploadFileSize,l=e.globalMaxUploadFileSize,r=i&&i>0?i*o.PA.MiB:l&&l>0?l*o.PA.MiB:0;t&&t.length>0&&t.forEach((n=>{n.addEventListener("change",(t=>{var o,s;const u=t.currentTarget;if(null==u||null==u.value||""===u.value)return;const d=u.files;if(!d)return;const f=null===(o=n.parentElement)||void 0===o?void 0:o.nextElementSibling,p=(m=f)?(setTimeout((()=>{m.innerHTML='<i class="fa-regular fa-spinner-third fa-spin"></i>'})),()=>{m.innerHTML='<i class="fa-regular fa-xmark"></i>'}):()=>{};var m;const v=null===(s=u.nextElementSibling)||void 0===s?void 0:s.querySelector(".upload-status"),h=d[0].name.split("."),g="."+h[h.length-1],y=d?Array.from(d).reduce(((e,n)=>e+n.size),0):0,T=(()=>{var t,i;return null!==(i=null===(t=e.form.inputs.find((e=>e.uniqueName===n.id)))||void 0===t?void 0:t.allowedFiles)&&void 0!==i?i:[]})(),E=()=>{u.files=null,u.value="",setTimeout((()=>{f.innerHTML=""})),v&&(v.innerHTML=c.noFiles)},x=0===r||y<=r,L=(()=>{if(T&&!T.length)return!0;const e=d[0].type;return T.filter((n=>n&&n.type===e||n.type===g)).length>0})();if(v&&d&&!x)E(),a(!0,u,`File size exceeded maximum allowed upload file size of ${i&&i>0?i:l&&l>0?l:0} MB. Please upload less or smaller files.`);else{if(v&&d&&!L){E();const e=`Only supports ${T.map((e=>e.type)).join(", ")} file ${T.length>1?"formats":"format"}.`;a(!0,u,e)}v&&f&&L&&x&&setTimeout((()=>{a(!1,u,null);let e=d.length>1?`${d.length} files`:d[0].name;v.innerHTML=e,function(e,n,t){e.innerHTML='<i class="fa-regular fa-xmark"></i>',e.title=c.clearTitle,e.onclick=()=>{n.value="",e.innerHTML="",t.innerHTML=c.noFiles}}(f,u,v),p()}),400)}}))}))}(e,n),n.addEventListener("submit",(t=>s(this,void 0,void 0,(function*(){t.preventDefault();const i=t.submitter;if(!i||i&&"INPUT"!==i.nodeName)return;const l=document.getElementById(e.statusKey);l&&(l.style.display="block",l.innerHTML=`<i class="fa-regular fa-spinner fa-spin"></i><span>
2\n ${e.translations.formDataSending}</span>`);const o=document.getElementById(e.messageKey);try{yield fetch(e.fetchUrl,{method:"POST",body:new FormData(n),redirect:"follow"}).then((t=>{t.redirected?window.location.href=t.url:t.ok?(n.style.display="none",o&&(o.style.display="block"),l&&(l.style.display="none")):l&&t.text().then((n=>{l.innerHTML=`<i class="fa-regular fa-times"></i><span>${n}</span>`,l.classList.add("not-autorized"),r(e)}))})).catch((e=>{l&&(l.innerHTML=`<pre>${e}</pre>`)}))}catch(e){l&&(l.innerHTML=`<pre>${e}</pre>`)}})))))}))}},5285:(e,n,t)=>{t.d(n,{Nm:()=>o,PA:()=>i,ic:()=>r,lm:()=>l,sm:()=>a}),t(7294);const i={KiB:1024,MiB:1048576,GiB:1073741824,TiB:1099511627776,PiB:0x4000000000000,EiB:0x1000000000000000},l={PDF:".pdf",MP4:".mp4",OGG:".ogg",SVG:".svg",GIF:".gif"};function r(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g," ")}var o,a;!function(e){e[e.prev=0]="prev",e[e.next=1]="next"}(o||(o={})),function(e){e.raw="Raw",e.exclusive="Exclusive"}(a||(a={}))}}]); 3//# sourceMappingURL=form-fns.js.map?v=9.1.8
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.