@arcblock/payment-service 1.29.9 → 1.29.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cf.js +51 -51
- package/dist/index.js +195 -43
- package/package.json +3 -3
- package/web/assets/{account-Clbqiiw3.js → account-DrsnH5wP.js} +1 -1
- package/web/assets/{action-DENqSeOa.js → action-C2c0yWuW.js} +1 -1
- package/web/assets/{actions-CDsj5j8l.js → actions--FNKSNIs.js} +1 -1
- package/web/assets/{actions-BJDN6Op2.js → actions-BEUwbsq1.js} +1 -1
- package/web/assets/{actions-CSpJGOX7.js → actions-C9AfME83.js} +1 -1
- package/web/assets/{actions-BD9BAp3M.js → actions-D2-s31n3.js} +1 -1
- package/web/assets/{actions-BSNy5bOd.js → actions-DXMceTgd.js} +1 -1
- package/web/assets/{actions-0iWP2mcx.js → actions-DeCPtfTK.js} +1 -1
- package/web/assets/{actions-DGQs8fFF.js → actions-DtNZGZWf.js} +1 -1
- package/web/assets/{actions-D3tJgrUn.js → actions-JHsqbHpB.js} +1 -1
- package/web/assets/{actions-CZL47E9r.js → actions-izdZ2Mn4.js} +1 -1
- package/web/assets/{add-price-BpnICuHO.js → add-price-TdXAR3NW.js} +1 -1
- package/web/assets/{admin-CD8ViZ7D.js → admin-BpFv3eF5.js} +1 -1
- package/web/assets/{assign-0vMUDW_C.js → assign-DKRfmN7W.js} +1 -1
- package/web/assets/{attempts-CKlxkJuE.js → attempts-BfbYfiJa.js} +1 -1
- package/web/assets/browser-DF2vfpBa.js +1 -0
- package/web/assets/{change-payment-gAlRmJpv.js → change-payment-j5UC8_h0.js} +1 -1
- package/web/assets/{change-plan-C47wfWH8.js → change-plan-CtXvsIDw.js} +1 -1
- package/web/assets/{click-boundary-CafubiPp.js → click-boundary-Bi28Y0Fq.js} +1 -1
- package/web/assets/{connect-BHHzrwLA.js → connect-CXek4LAE.js} +1 -1
- package/web/assets/{copyable-QrCyyiou.js → copyable-CprMHdhV.js} +1 -1
- package/web/assets/{create-ke4FrPx1.js → create-B-Ubepl_.js} +1 -1
- package/web/assets/{create-DNar5UQD.js → create-BVt_sQ_7.js} +1 -1
- package/web/assets/{create-0PUtkJZY.js → create-BWviSWbC.js} +1 -1
- package/web/assets/{create-BJ1asdcy.js → create-C6jihslA.js} +1 -1
- package/web/assets/{create-C7GOgZZM.js → create-IaalYGmm.js} +1 -1
- package/web/assets/{create-Bgv5ux17.js → create-jzl1m8ZK.js} +1 -1
- package/web/assets/{credit-grant-item-list-CeDAM3qV.js → credit-grant-item-list-DQcvdSRs.js} +1 -1
- package/web/assets/{credit-overview-4zh0H02x.js → credit-overview-CPId2vzk.js} +1 -1
- package/web/assets/{currency-restrictions-BcEm8W45.js → currency-restrictions-Dsupz2ce.js} +1 -1
- package/web/assets/{currency-select-B4ieQBvv.js → currency-select-C8j7QQMP.js} +1 -1
- package/web/assets/{dayjs-DUTDpcNU.js → dayjs-DUNWtvju.js} +1 -1
- package/web/assets/{description-SnR5WxWT.js → description-BHxdy5I3.js} +1 -1
- package/web/assets/{detail-DNcp_u5S.js → detail-B17BN6kU.js} +1 -1
- package/web/assets/detail-BJ-hl5PK.js +10 -0
- package/web/assets/{detail-46aLUdJj.js → detail-BJEqTXDS.js} +1 -1
- package/web/assets/{detail-BQpDGZJQ.js → detail-BdC9VIc6.js} +1 -1
- package/web/assets/{detail-DbU3p040.js → detail-BkRkrKyw.js} +1 -1
- package/web/assets/{detail-DACnmls3.js → detail-BvcI9cB_.js} +1 -1
- package/web/assets/detail-C--ATvwm.js +24 -0
- package/web/assets/{detail-Cg505nKX.js → detail-CHJqYZ0W.js} +1 -1
- package/web/assets/{detail-B0IHl4MI.js → detail-CfvKZ7IV.js} +1 -1
- package/web/assets/{detail-Ct5QNBqu.js → detail-CmIweOLE.js} +1 -1
- package/web/assets/{detail-BXTsnQny.js → detail-D729Bgs6.js} +1 -1
- package/web/assets/{detail-C_Zdfa0y.js → detail-DD1YBtex.js} +1 -1
- package/web/assets/detail-DOcm4Kqg.js +15 -0
- package/web/assets/{detail-Bfnkg0A1.js → detail-DQj1mbhA.js} +1 -1
- package/web/assets/detail-DTXDMIR9.js +15 -0
- package/web/assets/{detail-CsGZMimg.js → detail-DUAJzKsu.js} +1 -1
- package/web/assets/{detail-BwH0DwAi.js → detail-De8PyTyx.js} +1 -1
- package/web/assets/{detail-B_lpOomD.js → detail-DqfxOHky.js} +1 -1
- package/web/assets/{detail-CMBRd4Ct.js → detail-Dzt5tfyZ.js} +1 -1
- package/web/assets/{detail-Tn2R5C8i.js → detail-H0dkKVyS.js} +1 -1
- package/web/assets/{detail-CyMhK5K_.js → detail-MgdgGj5J.js} +1 -1
- package/web/assets/{detail-DCTb8R7F.js → detail-WAmPM6yq.js} +1 -1
- package/web/assets/{detail-B-ceWfZr.js → detail-g6el9Fxj.js} +1 -1
- package/web/assets/did-Bqcz-NjH.js +1 -0
- package/web/assets/{drawer-form-DspWWj3x.js → drawer-form-CQjNFFWk.js} +1 -1
- package/web/assets/{edit-Bkj-OTJh.js → edit-DAU8AWzT.js} +1 -1
- package/web/assets/{editor-AmthipP2.js → editor-vZvxDUTl.js} +1 -1
- package/web/assets/{embed-rRKjDoHi.js → embed-ClYNqZbf.js} +1 -1
- package/web/assets/{filter-toolbar-DXGSTq57.js → filter-toolbar-VvmMATj0.js} +1 -1
- package/web/assets/{form-BmQlJZ84.js → form-4_MzglPj.js} +1 -1
- package/web/assets/{form-cX026J4G.js → form-AFzUvoFE.js} +1 -1
- package/web/assets/{form-B5WW-lS5.js → form-Bro99BjK.js} +1 -1
- package/web/assets/{form-CAPjlw7l.js → form-CnrBCyTJ.js} +1 -1
- package/web/assets/form-Cuvruf4H.js +16 -0
- package/web/assets/{gas-nyR96dB0.js → gas-kw2KMH1u.js} +1 -1
- package/web/assets/{generateCategoricalChart-BadryV3H.js → generateCategoricalChart-BCpuUeC_.js} +1 -1
- package/web/assets/{home-_eX1aim8.js → home-ZNJREzbw.js} +1 -1
- package/web/assets/{index-CbSXdD6E.js → index-ASk8vU2H.js} +1 -1
- package/web/assets/{index-ajD9Iotk.js → index-B4n6PvPu.js} +1 -1
- package/web/assets/{index-BarN7DfU.js → index-B4yaPb7B.js} +5 -5
- package/web/assets/{index-DSe7Dot_.js → index-BHwID_s4.js} +1 -1
- package/web/assets/index-BMcnd_jZ.js +1 -0
- package/web/assets/{index-BTfJ08JU.js → index-BRmN8ViQ.js} +1 -1
- package/web/assets/index-BdbLl6St.js +1 -0
- package/web/assets/{index-CCVDDX0c.js → index-BjKRyxNQ.js} +1 -1
- package/web/assets/index-BjLJQRKY.js +1 -0
- package/web/assets/index-BkNCPnTn.js +1 -0
- package/web/assets/index-BlAwTTmu.js +1 -0
- package/web/assets/{index-C136x0O2.js → index-BtWfmATr.js} +1 -1
- package/web/assets/{index-DNGmCIRP.js → index-C-5n472s.js} +1 -1
- package/web/assets/{index-CW8VfoJO.js → index-C3AP4jq0.js} +1 -1
- package/web/assets/{index-C-RT84yb.js → index-C3Rh1SaB.js} +1 -1
- package/web/assets/index-CDyxbCzc.js +1 -0
- package/web/assets/{index-SOzRg0yJ.js → index-CH_k9MVv.js} +1 -1
- package/web/assets/{index-XaFn2ySq.js → index-CKPfOW6M.js} +1 -1
- package/web/assets/{index-BQjlhCSt.js → index-CPFlZhA2.js} +1 -1
- package/web/assets/{index-Du0Ieh1F.js → index-CPyGjEd3.js} +2 -2
- package/web/assets/index-ChC-jsE2.js +1 -0
- package/web/assets/{index-D-bx9Kam.js → index-CiWvs3j9.js} +1 -1
- package/web/assets/{index-mn5Zdrtn.js → index-D6gv9jHh.js} +1 -1
- package/web/assets/{index-Cd_BD9TM.js → index-D7pWd60Z.js} +1 -1
- package/web/assets/{index-YG5oc8O3.js → index-DAen2-cr.js} +1 -1
- package/web/assets/{index-BRENdB5m.js → index-DNobX-Tr.js} +1 -1
- package/web/assets/{index-Kd_qCyRG.js → index-DY-g0BPU.js} +1 -1
- package/web/assets/{index-D0mynT6_.js → index-DZkpxY-C.js} +1 -1
- package/web/assets/{index-DcddP3R9.js → index-Dh9agU9O.js} +1 -1
- package/web/assets/{index-BBHMsIxJ.js → index-Dju8k6mq.js} +1 -1
- package/web/assets/{index-DeK5Pqjv.js → index-DwDNPqjF.js} +1 -1
- package/web/assets/{index-DEiuhiEo.js → index-Dze0CpfQ.js} +1 -1
- package/web/assets/{index-UYeD8rTJ.js → index-eDERHpkr.js} +1 -1
- package/web/assets/{index-BzABukCz.js → index-mgPU1lyd.js} +1 -1
- package/web/assets/{index-W2uZUlFs.js → index-olGOY5KB.js} +1 -1
- package/web/assets/{index-DoX0A-rP.js → index-oy7LrXGT.js} +1 -1
- package/web/assets/{index-qulrJQ4J.js → index-x7sBb6oM.js} +1 -1
- package/web/assets/{index.es-C8dcCHdW.js → index.es-C2Q6Owow.js} +1 -1
- package/web/assets/{info-card-BvIMFQo5.js → info-card-C9dRgztS.js} +1 -1
- package/web/assets/{info-metric-Dl4ZDm0Z.js → info-metric-ukWq8INi.js} +1 -1
- package/web/assets/{info-row-jI0h_hv4.js → info-row-CaPaNF4L.js} +1 -1
- package/web/assets/{info-row-group-CFuMWJf1.js → info-row-group-Cxo-4Gk5.js} +1 -1
- package/web/assets/{libphonenumber-Qs8PCdM-.js → libphonenumber-CTvobi0D.js} +1 -1
- package/web/assets/{link-CmPoIweR.js → link-DsltSF2Q.js} +1 -1
- package/web/assets/{list-CkHExntK.js → list-B2b-s8wM.js} +1 -1
- package/web/assets/{list-DLB_hd0Q.js → list-BzgF4i3i.js} +1 -1
- package/web/assets/{list-BdSkPjIa.js → list-Cd1O-aDi.js} +1 -1
- package/web/assets/{list-DaK9287Y.js → list-CvM46TsP.js} +1 -1
- package/web/assets/{list-CWMEf-_C.js → list-DtEjqlED.js} +1 -1
- package/web/assets/{list-DVFJwd_I.js → list-O_uCSLFq.js} +1 -1
- package/web/assets/{list-DghnUOc4.js → list-YNWVqjwW.js} +1 -1
- package/web/assets/{list-eFkvVlp5.js → list-ZaBapEXW.js} +1 -1
- package/web/assets/{metadata-BmQTVFku.js → metadata-_hV0ZaVh.js} +1 -1
- package/web/assets/{meter-event-B1JIhVpb.js → meter-event-CPVBpekF.js} +1 -1
- package/web/assets/{metrics-UvxyQbUF.js → metrics-DVPdwpyf.js} +1 -1
- package/web/assets/{overview-Cxc6WKba.js → overview-CGdVIJrJ.js} +1 -1
- package/web/assets/{overview-DrMaIptb.js → overview-CN59I5Sc.js} +1 -1
- package/web/assets/{past-due-CUXkxns0.js → past-due-C3PtU8uo.js} +1 -1
- package/web/assets/pay-XVdSNq__.js +4 -0
- package/web/assets/{payment-method-info-Bsf89VxV.js → payment-method-info-D_qR04xC.js} +1 -1
- package/web/assets/{preview-C-H8pGVw.js → preview-Bdtbh-xk.js} +1 -1
- package/web/assets/{preview-BifsgUGT.js → preview-F3lma170.js} +1 -1
- package/web/assets/{pricing-table-BUJdtkMq.js → pricing-table-Bt2WljzE.js} +1 -1
- package/web/assets/{pricing-table-B3QOaAB5.js → pricing-table-D9FGYBVa.js} +1 -1
- package/web/assets/{product-select-ChEyoJqJ.js → product-select-_72p-5lF.js} +1 -1
- package/web/assets/{recharge-BVT4USAO.js → recharge-CSlKshbU.js} +1 -1
- package/web/assets/{related-credit-grants-JV2ICsR5.js → related-credit-grants-DnKdAit6.js} +3 -3
- package/web/assets/{safe-did-address-CiG_V6Gy.js → safe-did-address-CRTPYo34.js} +1 -1
- package/web/assets/{source-data-viewer-i1q9wNIG.js → source-data-viewer-D1GShrs5.js} +1 -1
- package/web/assets/{status-CUVYrUIG.js → status-3Swm2gK5.js} +1 -1
- package/web/assets/subscription-BX00k6FU.js +1 -0
- package/web/assets/{subscription-DrnSPIfs.js → subscription-Bzeblscr.js} +1 -1
- package/web/assets/table-BN3WBnr3.js +1 -0
- package/web/assets/{tax-code-select-TS07I0rB.js → tax-code-select-j2arPbaE.js} +1 -1
- package/web/assets/{tax-utils-bPjALcVG.js → tax-utils-B8J0Kfnz.js} +1 -1
- package/web/assets/{uploader-CsQNHG4I.js → uploader-BLdAbLR6.js} +1 -1
- package/web/assets/{usage-records-DAUQMJAW.js → usage-records-BAwNs1y8.js} +1 -1
- package/web/assets/{util-DxXTXkeY.js → util-B8B3fsMa.js} +1 -1
- package/web/assets/{vendor-arcblock-BTCAQSUK.js → vendor-arcblock-D1drrE7q.js} +1 -1
- package/web/assets/{vendor-blocklet-DcLR2Cyf.js → vendor-blocklet-B67R14so.js} +2 -2
- package/web/index.html +1 -1
- package/web/assets/browser-DDv4_sgY.js +0 -1
- package/web/assets/detail-B8eOBVSQ.js +0 -15
- package/web/assets/detail-BO3zglCn.js +0 -15
- package/web/assets/detail-C1FupF1D.js +0 -24
- package/web/assets/detail-wU4wNf4s.js +0 -10
- package/web/assets/form-DD-EiA7W.js +0 -16
- package/web/assets/index-BhcoukR2.js +0 -1
- package/web/assets/index-BturOfxo.js +0 -1
- package/web/assets/index-CDVogp6E.js +0 -1
- package/web/assets/index-DcrGSDby.js +0 -1
- package/web/assets/index-Dybqd298.js +0 -1
- package/web/assets/index-EXZPddtw.js +0 -1
- package/web/assets/index-brUCsnBA.js +0 -1
- package/web/assets/pay-omLYkqRA.js +0 -4
- package/web/assets/subscription-BYz_k9dq.js +0 -1
- package/web/assets/table-BrtHemkA.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cl as Pp,ce as Fp,cg as Cp,cn as _p,cs as Lc,cA as Nc,cB as al,cC as Ee,cD as Tp,a1 as $s,M as zc,ca as $c,f as Ep,cE as oi,aH as Dp,aI as vn,P as xp,bp as bn,cF as Ap,S as Gr,cG as Ip,cH as Op,A as kp}from"./vendor-blocklet-DcLR2Cyf.js";import{g as Ve,P as R,r as ee,u as Rp,p as Up,j as _e,b5 as Mp,G as Bp,B as To,I as Lp,cC as Np,w as zp,q as $p,f as jp}from"./vendor-mui-BXZut9Pz.js";import{bi as Xr,bj as Hp}from"./index-BarN7DfU.js";import{d as wn,u as qp}from"./browser-Bb9g-cvG.js";var Sn,ll;function Vp(){if(ll)return Sn;ll=1;function i(e,t,r,s){for(var n=-1,o=e==null?0:e.length;++n<o;){var a=e[n];t(s,a,r(a),e)}return s}return Sn=i,Sn}var Pn,ul;function Wp(){if(ul)return Pn;ul=1;var i=Pp();function e(t,r,s,n){return i(t,function(o,a,l){r(n,o,s(o),l)}),n}return Pn=e,Pn}var Fn,cl;function Gp(){if(cl)return Fn;cl=1;var i=Vp(),e=Wp(),t=Fp(),r=Cp();function s(n,o){return function(a,l){var u=r(a)?i:e,d=o?o():{};return u(a,n,t(l,2),d)}}return Fn=s,Fn}var Cn,dl;function Xp(){if(dl)return Cn;dl=1;var i=_p(),e=Gp(),t=e(function(r,s,n){i(r,n,s)});return Cn=t,Cn}var Kp=Xp();const jc=Ve(Kp);function Kr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Yp=0;function Hc(i){return"__private_"+Yp+++"_"+i}function Qp(i,e,t){const r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,o,a)=>{n!==""&&r.push(n),o<a.length-1&&r.push(t)})),r}function hl(i,e){const t=/\$/g,r="$$$$";let s=[i];if(e==null)return s;for(const n of Object.keys(e))if(n!=="_"){let o=e[n];typeof o=="string"&&(o=t[Symbol.replace](o,r)),s=Qp(s,new RegExp(`%\\{${n}\\}`,"g"),o)}return s}const Jp=i=>{throw new Error(`missing string: ${i}`)};var Ai=Hc("onMissingKey"),Ii=Hc("apply");class qc{constructor(e,t){let{onMissingKey:r=Jp}=t===void 0?{}:t;Object.defineProperty(this,Ii,{value:Zp}),Object.defineProperty(this,Ai,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(Kr(this,Ii)[Ii],this):Kr(this,Ii)[Ii](e),Kr(this,Ai)[Ai]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(Kr(this,Ai)[Ai](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){const n=this.locale.pluralize(t.smart_count);return hl(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return hl(r,t)}}function Zp(i){if(!(i!=null&&i.strings))return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var _n,pl;function ef(){return pl||(pl=1,_n=function(){var e={},t=e._fns={};e.emit=function(o,a,l,u,d,c,m){var w=r(o);w.length&&s(o,w,[a,l,u,d,c,m])},e.on=function(o,a){t[o]||(t[o]=[]),t[o].push(a)},e.once=function(o,a){function l(){a.apply(this,arguments),e.off(o,l)}this.on(o,l)},e.off=function(o,a){var l=[];if(o&&a){var u=this._fns[o],d=0,c=u?u.length:0;for(d;d<c;d++)u[d]!==a&&l.push(u[d])}l.length?this._fns[o]=l:delete this._fns[o]};function r(n){var o=t[n]?t[n]:[],a=n.indexOf(":"),l=a===-1?[n]:[n.substring(0,a),n.substring(a+1)],u=Object.keys(t),d=0,c=u.length;for(d;d<c;d++){var m=u[d];if(m==="*"&&(o=o.concat(t[m])),l.length===2&&l[0]===m){o=o.concat(t[m]);break}}return o}function s(n,o,a){var l=0,u=o.length;for(l;l<u&&o[l];l++)o[l].event=n,o[l].apply(o[l],a)}return e}),_n}var tf=ef();const rf=Ve(tf);let sf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",zr=(i=21)=>{let e="",t=i;for(;t--;)e+=sf[Math.random()*64|0];return e};function Ss(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var nf=0;function Vc(i){return"__private_"+nf+++"_"+i}const of={version:"3.2.2"};var qt=Vc("callbacks"),Tn=Vc("publish");class Wc{constructor(){Object.defineProperty(this,Tn,{value:af}),this.state={},Object.defineProperty(this,qt,{writable:!0,value:new Set})}getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,Ss(this,Tn)[Tn](t,r,e)}subscribe(e){return Ss(this,qt)[qt].add(e),()=>{Ss(this,qt)[qt].delete(e)}}}function af(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ss(this,qt)[qt].forEach(r=>{r(...e)})}Wc.VERSION=of.version;function Fa(i){const e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}const js={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Gc(i){var e;if(i.type)return i.type;const t=i.name?(e=Fa(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in js?js[t]:"application/octet-stream"}function lf(i){return i.charCodeAt(0).toString(32)}function fl(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${lf(t)}`,"/"))+e}function uf(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${fl(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${fl(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function cf(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Xc(i,e){if(cf(i))return i.id;const t=Gc(i);return uf({...i,type:t},e)}function df(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;const e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;const r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}function hf(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function En(i){return i<10?`0${i}`:i.toString()}function Ps(){const i=new Date,e=En(i.getHours()),t=En(i.getMinutes()),r=En(i.getSeconds());return`${e}:${t}:${r}`}const pf={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}},ff={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ps()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Ps()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}};var Dn,gl;function gf(){return gl||(gl=1,Dn=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let r=Math.abs(e);if(t&&(r=-r),r===0)return"0 B";const s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(r)/Math.log(1024)),s.length-1),o=Number(r/1024**n),a=s[n];return`${o>=10||o%1===0?Math.round(o):o.toFixed(1)} ${a}`}),Dn}var mf=gf();const Kt=Ve(mf);var xn,ml;function yf(){if(ml)return xn;ml=1;function i(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return i.prototype.match=function(e){var t=!0,r=this.parts,s,n=r.length,o;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(o=(e||"").split(this.separator),s=0;t&&s<n;s++)r[s]!=="*"&&(s<o.length?t=r[s]===o[s]:t=!1);t=t&&o}else if(typeof e.splice=="function")for(t=[],s=e.length;s--;)this.match(e[s])&&(t[t.length]=e[s]);else if(typeof e=="object"){t={};for(var a in e)this.match(a)&&(t[a]=e[a])}return t},xn=function(e,t,r){var s=new i(e,r||/[\/\.]/);return typeof t<"u"?s.match(t):s},xn}var An,yl;function vf(){if(yl)return An;yl=1;var i=yf(),e=/[\/\+\.]/;return An=function(t,r){function s(n){var o=i(n,t,e);return o&&o.length>=2}return r?s(r.split(";")[0]):s},An}var bf=vf();const wf=Ve(bf),Sf={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class Ye extends Error{constructor(e,t){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=t?.isUserFacing)!=null?r:!0,t!=null&&t.file&&(this.file=t.file)}}class Pf{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var r;const s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(o=>!o.isGhost).length+t.length>s)throw new Ye(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){const n=[...e,...t].reduce((o,a)=>{var l;return o+((l=a.size)!=null?l:0)},0);if(n>r)throw new Ye(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Kt(r),size:Kt(n)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(o=>o.includes("/")?e.type?wf(e.type.replace(/;.*?$/,""),o):!1:o[0]==="."&&e.extension?e.extension.toLowerCase()===o.slice(1).toLowerCase():!1)){const o=s.join(", ");throw new Ye(this.getI18n()("youCanOnlyUploadFileTypes",{types:o}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new Ye(this.getI18n()("exceedsSize",{size:Kt(t),file:e.name}),{file:e});if(r&&e.size!=null&&e.size<r)throw new Ye(this.getI18n()("inferiorSize",{size:Kt(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Ye(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new Ye(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:r}=this.getOpts().restrictions,s=[];for(const n of r)(!Object.hasOwn(e.meta,n)||e.meta[n]==="")&&s.push(n);return{missingFields:s,error:t}}}const Ff={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed"}};let Kc,Yc;function U(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Cf=0;function le(i){return"__private_"+Cf+++"_"+i}const _f={version:"3.13.1"},Yr={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var ye=le("plugins"),Ne=le("restricter"),Oi=le("storeUnsubscribe"),lt=le("emitter"),Vt=le("preProcessors"),Wt=le("uploaders"),St=le("postProcessors"),ze=le("informAndEmit"),Pr=le("checkRequiredMetaFieldsOnFile"),In=le("checkRequiredMetaFields"),ki=le("assertNewUploadAllowed"),Eo=le("transformFile"),Ri=le("startIfAutoProceed"),Ui=le("checkAndUpdateFileState"),On=le("addListeners"),Ze=le("updateOnlineStatus"),Mi=le("requestClientById"),ut=le("createUpload"),kn=le("getUpload"),Yt=le("removeUpload"),ct=le("runUpload");Kc=Symbol.for("uppy test: getPlugins");Yc=Symbol.for("uppy test: createUpload");let Ca=class Qc{constructor(e){Object.defineProperty(this,ct,{value:Bf}),Object.defineProperty(this,Yt,{value:Mf}),Object.defineProperty(this,kn,{value:Uf}),Object.defineProperty(this,ut,{value:Rf}),Object.defineProperty(this,On,{value:kf}),Object.defineProperty(this,Ui,{value:Of}),Object.defineProperty(this,Ri,{value:If}),Object.defineProperty(this,Eo,{value:Af}),Object.defineProperty(this,ki,{value:xf}),Object.defineProperty(this,In,{value:Df}),Object.defineProperty(this,Pr,{value:Ef}),Object.defineProperty(this,ze,{value:Tf}),Object.defineProperty(this,ye,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,lt,{writable:!0,value:rf()}),Object.defineProperty(this,Vt,{writable:!0,value:new Set}),Object.defineProperty(this,Wt,{writable:!0,value:new Set}),Object.defineProperty(this,St,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=Lc((s,n)=>{const o=this.getFile(s?.id);if(s==null||!o){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(o.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}const a=Number.isFinite(n.bytesTotal)&&n.bytesTotal>0;this.setFileState(s.id,{progress:{...o.progress,bytesUploaded:n.bytesUploaded,bytesTotal:n.bytesTotal,percentage:a?Math.round(n.bytesUploaded/n.bytesTotal*100):0}}),this.calculateTotalProgress()},500,{leading:!0,trailing:!0}),Object.defineProperty(this,Ze,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Mi,{writable:!0,value:new Map}),this.defaultLocale=Ff;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Sf,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Wc,logger:pf,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=ff),this.log(`Using Core v${Qc.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Yr,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:df(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),U(this,Ne)[Ne]=new Pf(()=>this.opts,()=>this.i18n),U(this,Oi)[Oi]=this.store.subscribe((s,n,o)=>{this.emit("state-update",s,n,o),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),U(this,On)[On]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];U(this,lt)[lt].emit(e,...r)}on(e,t){return U(this,lt)[lt].on(e,t),this}once(e,t){return U(this,lt)[lt].once(e,t),this}off(e,t){return U(this,lt)[lt].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=r=>this.log(`Missing i18n string: ${r}`,"error"),t=new qc([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r={};Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e}}}),this.setState({files:r,...Yr}),this.emit("reset-progress")}clearUploadedFiles(){const{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Yr,files:{}})}addPreProcessor(e){U(this,Vt)[Vt].add(e)}removePreProcessor(e){return U(this,Vt)[Vt].delete(e)}addPostProcessor(e){U(this,St)[St].add(e)}removePostProcessor(e){return U(this,St)[St].delete(e)}addUploader(e){U(this,Wt)[Wt].add(e)}removeUploader(e){return U(this,Wt)[Wt].delete(e)}setMeta(e){const t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){const r={...this.getState().files};if(!r[e]){this.log("Was trying to set metadata for a file that has been removed: ",e);return}const s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],o=[],a=[],l=[],u=[],d=[],c=[],m=[],w=[];for(const F of s){const{progress:T}=F;!T.uploadComplete&&T.uploadStarted&&(n.push(F),F.isPaused||m.push(F)),T.uploadStarted||o.push(F),(T.uploadStarted||T.preprocess||T.postprocess)&&a.push(F),T.uploadStarted&&l.push(F),F.isPaused&&u.push(F),T.uploadComplete&&d.push(F),F.error&&c.push(F),(T.preprocess||T.postprocess)&&w.push(F)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:u,completeFiles:d,erroredFiles:c,inProgressFiles:n,inProgressNotPausedFiles:m,processingFiles:w,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===s.length&&w.length===0,isAllErrored:!!r&&c.length===s.length,isAllPaused:n.length!==0&&u.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(F=>F.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{U(this,Ne)[Ne].validate(t,[e])}catch(r){return r}return null}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){U(this,ki)[ki](e);const{nextFilesState:t,validFilesToAdd:r,errors:s}=U(this,Ui)[Ui]([e]),n=s.filter(a=>a.isRestriction);if(U(this,ze)[ze](n),s.length>0)throw s[0];this.setState({files:t});const[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),U(this,Ri)[Ri](),o.id}addFiles(e){U(this,ki)[ki]();const{nextFilesState:t,validFilesToAdd:r,errors:s}=U(this,Ui)[Ui](e),n=s.filter(a=>a.isRestriction);U(this,ze)[ze](n);const o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
|
|
1
|
+
import{cl as Pp,ce as Fp,cg as Cp,cn as _p,cs as Lc,cA as Nc,cB as al,cC as Ee,cD as Tp,a1 as $s,M as zc,ca as $c,f as Ep,cE as oi,aH as Dp,aI as vn,P as xp,bp as bn,cF as Ap,S as Gr,cG as Ip,cH as Op,A as kp}from"./vendor-blocklet-B67R14so.js";import{g as Ve,P as R,r as ee,u as Rp,p as Up,j as _e,b5 as Mp,G as Bp,B as To,I as Lp,cC as Np,w as zp,q as $p,f as jp}from"./vendor-mui-BXZut9Pz.js";import{bi as Xr,bj as Hp}from"./index-B4yaPb7B.js";import{d as wn,u as qp}from"./browser-Bb9g-cvG.js";var Sn,ll;function Vp(){if(ll)return Sn;ll=1;function i(e,t,r,s){for(var n=-1,o=e==null?0:e.length;++n<o;){var a=e[n];t(s,a,r(a),e)}return s}return Sn=i,Sn}var Pn,ul;function Wp(){if(ul)return Pn;ul=1;var i=Pp();function e(t,r,s,n){return i(t,function(o,a,l){r(n,o,s(o),l)}),n}return Pn=e,Pn}var Fn,cl;function Gp(){if(cl)return Fn;cl=1;var i=Vp(),e=Wp(),t=Fp(),r=Cp();function s(n,o){return function(a,l){var u=r(a)?i:e,d=o?o():{};return u(a,n,t(l,2),d)}}return Fn=s,Fn}var Cn,dl;function Xp(){if(dl)return Cn;dl=1;var i=_p(),e=Gp(),t=e(function(r,s,n){i(r,n,s)});return Cn=t,Cn}var Kp=Xp();const jc=Ve(Kp);function Kr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Yp=0;function Hc(i){return"__private_"+Yp+++"_"+i}function Qp(i,e,t){const r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,o,a)=>{n!==""&&r.push(n),o<a.length-1&&r.push(t)})),r}function hl(i,e){const t=/\$/g,r="$$$$";let s=[i];if(e==null)return s;for(const n of Object.keys(e))if(n!=="_"){let o=e[n];typeof o=="string"&&(o=t[Symbol.replace](o,r)),s=Qp(s,new RegExp(`%\\{${n}\\}`,"g"),o)}return s}const Jp=i=>{throw new Error(`missing string: ${i}`)};var Ai=Hc("onMissingKey"),Ii=Hc("apply");class qc{constructor(e,t){let{onMissingKey:r=Jp}=t===void 0?{}:t;Object.defineProperty(this,Ii,{value:Zp}),Object.defineProperty(this,Ai,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(Kr(this,Ii)[Ii],this):Kr(this,Ii)[Ii](e),Kr(this,Ai)[Ai]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(Kr(this,Ai)[Ai](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){const n=this.locale.pluralize(t.smart_count);return hl(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return hl(r,t)}}function Zp(i){if(!(i!=null&&i.strings))return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var _n,pl;function ef(){return pl||(pl=1,_n=function(){var e={},t=e._fns={};e.emit=function(o,a,l,u,d,c,m){var w=r(o);w.length&&s(o,w,[a,l,u,d,c,m])},e.on=function(o,a){t[o]||(t[o]=[]),t[o].push(a)},e.once=function(o,a){function l(){a.apply(this,arguments),e.off(o,l)}this.on(o,l)},e.off=function(o,a){var l=[];if(o&&a){var u=this._fns[o],d=0,c=u?u.length:0;for(d;d<c;d++)u[d]!==a&&l.push(u[d])}l.length?this._fns[o]=l:delete this._fns[o]};function r(n){var o=t[n]?t[n]:[],a=n.indexOf(":"),l=a===-1?[n]:[n.substring(0,a),n.substring(a+1)],u=Object.keys(t),d=0,c=u.length;for(d;d<c;d++){var m=u[d];if(m==="*"&&(o=o.concat(t[m])),l.length===2&&l[0]===m){o=o.concat(t[m]);break}}return o}function s(n,o,a){var l=0,u=o.length;for(l;l<u&&o[l];l++)o[l].event=n,o[l].apply(o[l],a)}return e}),_n}var tf=ef();const rf=Ve(tf);let sf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",zr=(i=21)=>{let e="",t=i;for(;t--;)e+=sf[Math.random()*64|0];return e};function Ss(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var nf=0;function Vc(i){return"__private_"+nf+++"_"+i}const of={version:"3.2.2"};var qt=Vc("callbacks"),Tn=Vc("publish");class Wc{constructor(){Object.defineProperty(this,Tn,{value:af}),this.state={},Object.defineProperty(this,qt,{writable:!0,value:new Set})}getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,Ss(this,Tn)[Tn](t,r,e)}subscribe(e){return Ss(this,qt)[qt].add(e),()=>{Ss(this,qt)[qt].delete(e)}}}function af(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ss(this,qt)[qt].forEach(r=>{r(...e)})}Wc.VERSION=of.version;function Fa(i){const e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}const js={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Gc(i){var e;if(i.type)return i.type;const t=i.name?(e=Fa(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in js?js[t]:"application/octet-stream"}function lf(i){return i.charCodeAt(0).toString(32)}function fl(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${lf(t)}`,"/"))+e}function uf(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${fl(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${fl(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function cf(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Xc(i,e){if(cf(i))return i.id;const t=Gc(i);return uf({...i,type:t},e)}function df(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;const e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;const r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}function hf(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function En(i){return i<10?`0${i}`:i.toString()}function Ps(){const i=new Date,e=En(i.getHours()),t=En(i.getMinutes()),r=En(i.getSeconds());return`${e}:${t}:${r}`}const pf={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}},ff={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ps()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Ps()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}};var Dn,gl;function gf(){return gl||(gl=1,Dn=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let r=Math.abs(e);if(t&&(r=-r),r===0)return"0 B";const s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(r)/Math.log(1024)),s.length-1),o=Number(r/1024**n),a=s[n];return`${o>=10||o%1===0?Math.round(o):o.toFixed(1)} ${a}`}),Dn}var mf=gf();const Kt=Ve(mf);var xn,ml;function yf(){if(ml)return xn;ml=1;function i(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return i.prototype.match=function(e){var t=!0,r=this.parts,s,n=r.length,o;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(o=(e||"").split(this.separator),s=0;t&&s<n;s++)r[s]!=="*"&&(s<o.length?t=r[s]===o[s]:t=!1);t=t&&o}else if(typeof e.splice=="function")for(t=[],s=e.length;s--;)this.match(e[s])&&(t[t.length]=e[s]);else if(typeof e=="object"){t={};for(var a in e)this.match(a)&&(t[a]=e[a])}return t},xn=function(e,t,r){var s=new i(e,r||/[\/\.]/);return typeof t<"u"?s.match(t):s},xn}var An,yl;function vf(){if(yl)return An;yl=1;var i=yf(),e=/[\/\+\.]/;return An=function(t,r){function s(n){var o=i(n,t,e);return o&&o.length>=2}return r?s(r.split(";")[0]):s},An}var bf=vf();const wf=Ve(bf),Sf={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class Ye extends Error{constructor(e,t){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=t?.isUserFacing)!=null?r:!0,t!=null&&t.file&&(this.file=t.file)}}class Pf{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var r;const s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(o=>!o.isGhost).length+t.length>s)throw new Ye(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){const n=[...e,...t].reduce((o,a)=>{var l;return o+((l=a.size)!=null?l:0)},0);if(n>r)throw new Ye(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Kt(r),size:Kt(n)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(o=>o.includes("/")?e.type?wf(e.type.replace(/;.*?$/,""),o):!1:o[0]==="."&&e.extension?e.extension.toLowerCase()===o.slice(1).toLowerCase():!1)){const o=s.join(", ");throw new Ye(this.getI18n()("youCanOnlyUploadFileTypes",{types:o}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new Ye(this.getI18n()("exceedsSize",{size:Kt(t),file:e.name}),{file:e});if(r&&e.size!=null&&e.size<r)throw new Ye(this.getI18n()("inferiorSize",{size:Kt(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Ye(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new Ye(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:r}=this.getOpts().restrictions,s=[];for(const n of r)(!Object.hasOwn(e.meta,n)||e.meta[n]==="")&&s.push(n);return{missingFields:s,error:t}}}const Ff={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed"}};let Kc,Yc;function U(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Cf=0;function le(i){return"__private_"+Cf+++"_"+i}const _f={version:"3.13.1"},Yr={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var ye=le("plugins"),Ne=le("restricter"),Oi=le("storeUnsubscribe"),lt=le("emitter"),Vt=le("preProcessors"),Wt=le("uploaders"),St=le("postProcessors"),ze=le("informAndEmit"),Pr=le("checkRequiredMetaFieldsOnFile"),In=le("checkRequiredMetaFields"),ki=le("assertNewUploadAllowed"),Eo=le("transformFile"),Ri=le("startIfAutoProceed"),Ui=le("checkAndUpdateFileState"),On=le("addListeners"),Ze=le("updateOnlineStatus"),Mi=le("requestClientById"),ut=le("createUpload"),kn=le("getUpload"),Yt=le("removeUpload"),ct=le("runUpload");Kc=Symbol.for("uppy test: getPlugins");Yc=Symbol.for("uppy test: createUpload");let Ca=class Qc{constructor(e){Object.defineProperty(this,ct,{value:Bf}),Object.defineProperty(this,Yt,{value:Mf}),Object.defineProperty(this,kn,{value:Uf}),Object.defineProperty(this,ut,{value:Rf}),Object.defineProperty(this,On,{value:kf}),Object.defineProperty(this,Ui,{value:Of}),Object.defineProperty(this,Ri,{value:If}),Object.defineProperty(this,Eo,{value:Af}),Object.defineProperty(this,ki,{value:xf}),Object.defineProperty(this,In,{value:Df}),Object.defineProperty(this,Pr,{value:Ef}),Object.defineProperty(this,ze,{value:Tf}),Object.defineProperty(this,ye,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,lt,{writable:!0,value:rf()}),Object.defineProperty(this,Vt,{writable:!0,value:new Set}),Object.defineProperty(this,Wt,{writable:!0,value:new Set}),Object.defineProperty(this,St,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=Lc((s,n)=>{const o=this.getFile(s?.id);if(s==null||!o){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(o.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}const a=Number.isFinite(n.bytesTotal)&&n.bytesTotal>0;this.setFileState(s.id,{progress:{...o.progress,bytesUploaded:n.bytesUploaded,bytesTotal:n.bytesTotal,percentage:a?Math.round(n.bytesUploaded/n.bytesTotal*100):0}}),this.calculateTotalProgress()},500,{leading:!0,trailing:!0}),Object.defineProperty(this,Ze,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Mi,{writable:!0,value:new Map}),this.defaultLocale=Ff;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Sf,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Wc,logger:pf,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=ff),this.log(`Using Core v${Qc.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Yr,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:df(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),U(this,Ne)[Ne]=new Pf(()=>this.opts,()=>this.i18n),U(this,Oi)[Oi]=this.store.subscribe((s,n,o)=>{this.emit("state-update",s,n,o),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),U(this,On)[On]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];U(this,lt)[lt].emit(e,...r)}on(e,t){return U(this,lt)[lt].on(e,t),this}once(e,t){return U(this,lt)[lt].once(e,t),this}off(e,t){return U(this,lt)[lt].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=r=>this.log(`Missing i18n string: ${r}`,"error"),t=new qc([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r={};Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e}}}),this.setState({files:r,...Yr}),this.emit("reset-progress")}clearUploadedFiles(){const{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Yr,files:{}})}addPreProcessor(e){U(this,Vt)[Vt].add(e)}removePreProcessor(e){return U(this,Vt)[Vt].delete(e)}addPostProcessor(e){U(this,St)[St].add(e)}removePostProcessor(e){return U(this,St)[St].delete(e)}addUploader(e){U(this,Wt)[Wt].add(e)}removeUploader(e){return U(this,Wt)[Wt].delete(e)}setMeta(e){const t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){const r={...this.getState().files};if(!r[e]){this.log("Was trying to set metadata for a file that has been removed: ",e);return}const s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],o=[],a=[],l=[],u=[],d=[],c=[],m=[],w=[];for(const F of s){const{progress:T}=F;!T.uploadComplete&&T.uploadStarted&&(n.push(F),F.isPaused||m.push(F)),T.uploadStarted||o.push(F),(T.uploadStarted||T.preprocess||T.postprocess)&&a.push(F),T.uploadStarted&&l.push(F),F.isPaused&&u.push(F),T.uploadComplete&&d.push(F),F.error&&c.push(F),(T.preprocess||T.postprocess)&&w.push(F)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:u,completeFiles:d,erroredFiles:c,inProgressFiles:n,inProgressNotPausedFiles:m,processingFiles:w,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===s.length&&w.length===0,isAllErrored:!!r&&c.length===s.length,isAllPaused:n.length!==0&&u.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(F=>F.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{U(this,Ne)[Ne].validate(t,[e])}catch(r){return r}return null}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){U(this,ki)[ki](e);const{nextFilesState:t,validFilesToAdd:r,errors:s}=U(this,Ui)[Ui]([e]),n=s.filter(a=>a.isRestriction);if(U(this,ze)[ze](n),s.length>0)throw s[0];this.setState({files:t});const[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),U(this,Ri)[Ri](),o.id}addFiles(e){U(this,ki)[ki]();const{nextFilesState:t,validFilesToAdd:r,errors:s}=U(this,Ui)[Ui](e),n=s.filter(a=>a.isRestriction);U(this,ze)[ze](n);const o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
|
|
2
2
|
`;if(o.forEach(l=>{a+=`
|
|
3
3
|
* ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,a);{const l=new Error(a);throw l.errors=o,l}}this.setState({files:t}),r.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(a=>{this.log(`Added file: ${a.name}
|
|
4
4
|
id: ${a.id}
|
|
@@ -45,5 +45,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
45
45
|
</div>
|
|
46
46
|
`,t.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),e.insertBefore(t,e.firstChild),this.addUploadItemFlag=!1}}},{wait:200});convertImgToObject=$s(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(t=>{if(!t?.src)return;const{src:r}=t,s=this.uploadedAPIData.files?.find(a=>a.previewUrl===r),n=document.createElement("div");n.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const o=document.createElement("div");if(o.className="uppy-ProviderBrowserItem-name",o.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",o.innerHTML=op(s.originalname),[".mp4",".webm"].find(a=>t.src?.endsWith(a))){const a=document.createElement("video");a.src=t.src,a.width=t.width,a.height=t.height,a.autoplay=!0,a.setAttribute("playsinline","playsinline"),a.muted=!0,a.loop=!0,a.style="pointer-events: none;",n.appendChild(a)}else if([".pdf"].find(a=>t.src?.endsWith(a))){const a=document.createElement("div");a.className="pdf-icon",a.innerHTML=l3,n.appendChild(a)}else{const a=document.createElement("object");a.data=r,a.type=s.mimetype||"image/png",a.alt=s.originalname,a.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",a.loading="lazy",n.appendChild(a)}n.appendChild(o),t.parentNode.replaceChild(n,t)}),this.canConvertImgToObject=!1)},{wait:200});update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}resetState=()=>{this.uploadedAPIData={...dc},this.uploaded.setPluginState({...hc}),this.addUploadItemFlag=!0};install(){this.view=new xa(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...hc}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(t,r)=>{const{currentSelection:s}=this.uploaded.getPluginState(),n=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,o=n?s.length<n:!0;s.find(a=>a._id===r._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(a=>a._id!==r._id)]}):(o||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,r]}))},this.view.donePicking=()=>{const{currentSelection:t}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",t),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=t=>{const{scrollHeight:r,scrollTop:s,offsetHeight:n}=t.target;r-(s+n)<30&&this.queryUploadedFromMediaKit()};const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}var yo,pc;function c3(){if(pc)return yo;pc=1;var i=Ep();function e(t){return i(t).toUpperCase()}return yo=e,yo}var d3=c3();const h3=Ve(d3),fc={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,componentDid:"",components:[]},gc={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},p3={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"};class f3 extends he{constructor(e,t){super(e,t),this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=e,this.componentDid="",this.apiData={...fc},this.icon=()=>se("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[se("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),se("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),se("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(e){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),se("div",{id:"resources",className:"uploaded",children:[se("div",{style:{padding:this.apiData.components.length?"12px":"0",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(t=>se("button",{className:this.apiData.componentDid===t.did?"button-color-style button-color-style-active":"button-color-style",style:p3,id:t.componentDid,onClick:()=>{this.apiData.componentDid!==t.did&&(this.apiData.componentDid=t.did,this.queryResources())},children:h3(t.name)}))}),this.view.render(e)]})}queryResources=async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:e}=await Di.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=e.components||[],this.apiData.componentDid=e.componentDid||"",this.apiData.files=$c([...e.resources.map(t=>{let r="file";const{filename:s}=t,n=Lr(s,0,0,at);return r=Lr(s,400,0,at),{filename:s,_id:s,id:s,name:s,icon:r,previewUrl:r,fileUrl:n}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}};update(){}onFirstRender(){}resetState=()=>{this.apiData={...fc},this.resources.setPluginState({...gc})};install(){this.view=new xa(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({...gc}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(t,r)=>{const{currentSelection:s}=this.resources.getPluginState(),n=this.resources.uppy.opts.restrictions.maxNumberOfFiles,o=n?s.length<n:!0;s.find(a=>a.id===r.id)?this.resources.setPluginState({currentSelection:[...s.filter(a=>a.id!==r.id)]}):(o||s.pop(),this.resources.setPluginState({currentSelection:[...s,r]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:t}=this.resources.getPluginState();this.uppy.emit("resources:selected",t),this.resources.parent.hideAllPanels()};const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}var vo={exports:{}},mc;function g3(){return mc||(mc=1,(function(i,e){(function(t){i.exports=t()})(function(t){var r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function s(b,y){var f=b[0],p=b[1],v=b[2],g=b[3];f+=(p&v|~p&g)+y[0]-680876936|0,f=(f<<7|f>>>25)+p|0,g+=(f&p|~f&v)+y[1]-389564586|0,g=(g<<12|g>>>20)+f|0,v+=(g&f|~g&p)+y[2]+606105819|0,v=(v<<17|v>>>15)+g|0,p+=(v&g|~v&f)+y[3]-1044525330|0,p=(p<<22|p>>>10)+v|0,f+=(p&v|~p&g)+y[4]-176418897|0,f=(f<<7|f>>>25)+p|0,g+=(f&p|~f&v)+y[5]+1200080426|0,g=(g<<12|g>>>20)+f|0,v+=(g&f|~g&p)+y[6]-1473231341|0,v=(v<<17|v>>>15)+g|0,p+=(v&g|~v&f)+y[7]-45705983|0,p=(p<<22|p>>>10)+v|0,f+=(p&v|~p&g)+y[8]+1770035416|0,f=(f<<7|f>>>25)+p|0,g+=(f&p|~f&v)+y[9]-1958414417|0,g=(g<<12|g>>>20)+f|0,v+=(g&f|~g&p)+y[10]-42063|0,v=(v<<17|v>>>15)+g|0,p+=(v&g|~v&f)+y[11]-1990404162|0,p=(p<<22|p>>>10)+v|0,f+=(p&v|~p&g)+y[12]+1804603682|0,f=(f<<7|f>>>25)+p|0,g+=(f&p|~f&v)+y[13]-40341101|0,g=(g<<12|g>>>20)+f|0,v+=(g&f|~g&p)+y[14]-1502002290|0,v=(v<<17|v>>>15)+g|0,p+=(v&g|~v&f)+y[15]+1236535329|0,p=(p<<22|p>>>10)+v|0,f+=(p&g|v&~g)+y[1]-165796510|0,f=(f<<5|f>>>27)+p|0,g+=(f&v|p&~v)+y[6]-1069501632|0,g=(g<<9|g>>>23)+f|0,v+=(g&p|f&~p)+y[11]+643717713|0,v=(v<<14|v>>>18)+g|0,p+=(v&f|g&~f)+y[0]-373897302|0,p=(p<<20|p>>>12)+v|0,f+=(p&g|v&~g)+y[5]-701558691|0,f=(f<<5|f>>>27)+p|0,g+=(f&v|p&~v)+y[10]+38016083|0,g=(g<<9|g>>>23)+f|0,v+=(g&p|f&~p)+y[15]-660478335|0,v=(v<<14|v>>>18)+g|0,p+=(v&f|g&~f)+y[4]-405537848|0,p=(p<<20|p>>>12)+v|0,f+=(p&g|v&~g)+y[9]+568446438|0,f=(f<<5|f>>>27)+p|0,g+=(f&v|p&~v)+y[14]-1019803690|0,g=(g<<9|g>>>23)+f|0,v+=(g&p|f&~p)+y[3]-187363961|0,v=(v<<14|v>>>18)+g|0,p+=(v&f|g&~f)+y[8]+1163531501|0,p=(p<<20|p>>>12)+v|0,f+=(p&g|v&~g)+y[13]-1444681467|0,f=(f<<5|f>>>27)+p|0,g+=(f&v|p&~v)+y[2]-51403784|0,g=(g<<9|g>>>23)+f|0,v+=(g&p|f&~p)+y[7]+1735328473|0,v=(v<<14|v>>>18)+g|0,p+=(v&f|g&~f)+y[12]-1926607734|0,p=(p<<20|p>>>12)+v|0,f+=(p^v^g)+y[5]-378558|0,f=(f<<4|f>>>28)+p|0,g+=(f^p^v)+y[8]-2022574463|0,g=(g<<11|g>>>21)+f|0,v+=(g^f^p)+y[11]+1839030562|0,v=(v<<16|v>>>16)+g|0,p+=(v^g^f)+y[14]-35309556|0,p=(p<<23|p>>>9)+v|0,f+=(p^v^g)+y[1]-1530992060|0,f=(f<<4|f>>>28)+p|0,g+=(f^p^v)+y[4]+1272893353|0,g=(g<<11|g>>>21)+f|0,v+=(g^f^p)+y[7]-155497632|0,v=(v<<16|v>>>16)+g|0,p+=(v^g^f)+y[10]-1094730640|0,p=(p<<23|p>>>9)+v|0,f+=(p^v^g)+y[13]+681279174|0,f=(f<<4|f>>>28)+p|0,g+=(f^p^v)+y[0]-358537222|0,g=(g<<11|g>>>21)+f|0,v+=(g^f^p)+y[3]-722521979|0,v=(v<<16|v>>>16)+g|0,p+=(v^g^f)+y[6]+76029189|0,p=(p<<23|p>>>9)+v|0,f+=(p^v^g)+y[9]-640364487|0,f=(f<<4|f>>>28)+p|0,g+=(f^p^v)+y[12]-421815835|0,g=(g<<11|g>>>21)+f|0,v+=(g^f^p)+y[15]+530742520|0,v=(v<<16|v>>>16)+g|0,p+=(v^g^f)+y[2]-995338651|0,p=(p<<23|p>>>9)+v|0,f+=(v^(p|~g))+y[0]-198630844|0,f=(f<<6|f>>>26)+p|0,g+=(p^(f|~v))+y[7]+1126891415|0,g=(g<<10|g>>>22)+f|0,v+=(f^(g|~p))+y[14]-1416354905|0,v=(v<<15|v>>>17)+g|0,p+=(g^(v|~f))+y[5]-57434055|0,p=(p<<21|p>>>11)+v|0,f+=(v^(p|~g))+y[12]+1700485571|0,f=(f<<6|f>>>26)+p|0,g+=(p^(f|~v))+y[3]-1894986606|0,g=(g<<10|g>>>22)+f|0,v+=(f^(g|~p))+y[10]-1051523|0,v=(v<<15|v>>>17)+g|0,p+=(g^(v|~f))+y[1]-2054922799|0,p=(p<<21|p>>>11)+v|0,f+=(v^(p|~g))+y[8]+1873313359|0,f=(f<<6|f>>>26)+p|0,g+=(p^(f|~v))+y[15]-30611744|0,g=(g<<10|g>>>22)+f|0,v+=(f^(g|~p))+y[6]-1560198380|0,v=(v<<15|v>>>17)+g|0,p+=(g^(v|~f))+y[13]+1309151649|0,p=(p<<21|p>>>11)+v|0,f+=(v^(p|~g))+y[4]-145523070|0,f=(f<<6|f>>>26)+p|0,g+=(p^(f|~v))+y[11]-1120210379|0,g=(g<<10|g>>>22)+f|0,v+=(f^(g|~p))+y[2]+718787259|0,v=(v<<15|v>>>17)+g|0,p+=(g^(v|~f))+y[9]-343485551|0,p=(p<<21|p>>>11)+v|0,b[0]=f+b[0]|0,b[1]=p+b[1]|0,b[2]=v+b[2]|0,b[3]=g+b[3]|0}function n(b){var y=[],f;for(f=0;f<64;f+=4)y[f>>2]=b.charCodeAt(f)+(b.charCodeAt(f+1)<<8)+(b.charCodeAt(f+2)<<16)+(b.charCodeAt(f+3)<<24);return y}function o(b){var y=[],f;for(f=0;f<64;f+=4)y[f>>2]=b[f]+(b[f+1]<<8)+(b[f+2]<<16)+(b[f+3]<<24);return y}function a(b){var y=b.length,f=[1732584193,-271733879,-1732584194,271733878],p,v,g,_,A,I;for(p=64;p<=y;p+=64)s(f,n(b.substring(p-64,p)));for(b=b.substring(p-64),v=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=0;p<v;p+=1)g[p>>2]|=b.charCodeAt(p)<<(p%4<<3);if(g[p>>2]|=128<<(p%4<<3),p>55)for(s(f,g),p=0;p<16;p+=1)g[p]=0;return _=y*8,_=_.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(_[2],16),I=parseInt(_[1],16)||0,g[14]=A,g[15]=I,s(f,g),f}function l(b){var y=b.length,f=[1732584193,-271733879,-1732584194,271733878],p,v,g,_,A,I;for(p=64;p<=y;p+=64)s(f,o(b.subarray(p-64,p)));for(b=p-64<y?b.subarray(p-64):new Uint8Array(0),v=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=0;p<v;p+=1)g[p>>2]|=b[p]<<(p%4<<3);if(g[p>>2]|=128<<(p%4<<3),p>55)for(s(f,g),p=0;p<16;p+=1)g[p]=0;return _=y*8,_=_.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(_[2],16),I=parseInt(_[1],16)||0,g[14]=A,g[15]=I,s(f,g),f}function u(b){var y="",f;for(f=0;f<4;f+=1)y+=r[b>>f*8+4&15]+r[b>>f*8&15];return y}function d(b){var y;for(y=0;y<b.length;y+=1)b[y]=u(b[y]);return b.join("")}d(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function b(y,f){return y=y|0||0,y<0?Math.max(y+f,0):Math.min(y,f)}ArrayBuffer.prototype.slice=function(y,f){var p=this.byteLength,v=b(y,p),g=p,_,A,I,N;return f!==t&&(g=b(f,p)),v>g?new ArrayBuffer(0):(_=g-v,A=new ArrayBuffer(_),I=new Uint8Array(A),N=new Uint8Array(this,v,_),I.set(N),A)}})();function c(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function m(b,y){var f=b.length,p=new ArrayBuffer(f),v=new Uint8Array(p),g;for(g=0;g<f;g+=1)v[g]=b.charCodeAt(g);return y?v:p}function w(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function F(b,y,f){var p=new Uint8Array(b.byteLength+y.byteLength);return p.set(new Uint8Array(b)),p.set(new Uint8Array(y),b.byteLength),p}function T(b){var y=[],f=b.length,p;for(p=0;p<f-1;p+=2)y.push(parseInt(b.substr(p,2),16));return String.fromCharCode.apply(String,y)}function P(){this.reset()}return P.prototype.append=function(b){return this.appendBinary(c(b)),this},P.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var y=this._buff.length,f;for(f=64;f<=y;f+=64)s(this._hash,n(this._buff.substring(f-64,f)));return this._buff=this._buff.substring(f-64),this},P.prototype.end=function(b){var y=this._buff,f=y.length,p,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g;for(p=0;p<f;p+=1)v[p>>2]|=y.charCodeAt(p)<<(p%4<<3);return this._finish(v,f),g=d(this._hash),b&&(g=T(g)),this.reset(),g},P.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},P.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},P.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},P.prototype._finish=function(b,y){var f=y,p,v,g;if(b[f>>2]|=128<<(f%4<<3),f>55)for(s(this._hash,b),f=0;f<16;f+=1)b[f]=0;p=this._length*8,p=p.toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(p[2],16),g=parseInt(p[1],16)||0,b[14]=v,b[15]=g,s(this._hash,b)},P.hash=function(b,y){return P.hashBinary(c(b),y)},P.hashBinary=function(b,y){var f=a(b),p=d(f);return y?T(p):p},P.ArrayBuffer=function(){this.reset()},P.ArrayBuffer.prototype.append=function(b){var y=F(this._buff.buffer,b),f=y.length,p;for(this._length+=b.byteLength,p=64;p<=f;p+=64)s(this._hash,o(y.subarray(p-64,p)));return this._buff=p-64<f?new Uint8Array(y.buffer.slice(p-64)):new Uint8Array(0),this},P.ArrayBuffer.prototype.end=function(b){var y=this._buff,f=y.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v,g;for(v=0;v<f;v+=1)p[v>>2]|=y[v]<<(v%4<<3);return this._finish(p,f),g=d(this._hash),b&&(g=T(g)),this.reset(),g},P.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.ArrayBuffer.prototype.getState=function(){var b=P.prototype.getState.call(this);return b.buff=w(b.buff),b},P.ArrayBuffer.prototype.setState=function(b){return b.buff=m(b.buff,!0),P.prototype.setState.call(this,b)},P.ArrayBuffer.prototype.destroy=P.prototype.destroy,P.ArrayBuffer.prototype._finish=P.prototype._finish,P.ArrayBuffer.hash=function(b,y){var f=l(new Uint8Array(b)),p=d(f);return y?T(p):p},P})})(vo)),vo.exports}var m3=g3();const y3=Ve(m3);var fn=typeof self<"u"?self:globalThis;const Nr=typeof navigator<"u",v3=Nr&&typeof HTMLImageElement>"u",rn=!(typeof globalThis>"u"||typeof process>"u"||!process.versions||!process.versions.node),el=fn.Buffer,ps=fn.BigInt,tl=!!el,b3=i=>i;function sn(i,e=b3){if(rn)try{return typeof require=="function"?Promise.resolve(e(require(i))):import(i).then(e)}catch{console.warn(`Couldn't load ${i}`)}}let il=fn.fetch;const w3=i=>il=i;if(!fn.fetch){const i=sn("http",(r=>r)),e=sn("https",(r=>r)),t=(r,{headers:s}={})=>new Promise((async(n,o)=>{let{port:a,hostname:l,pathname:u,protocol:d,search:c}=new URL(r);const m={method:"GET",hostname:l,path:encodeURI(u)+c,headers:s};a!==""&&(m.port=Number(a));const w=(d==="https:"?await e:await i).request(m,(F=>{if(F.statusCode===301||F.statusCode===302){let T=new URL(F.headers.location,r).toString();return t(T,{headers:s}).then(n).catch(o)}n({status:F.statusCode,arrayBuffer:()=>new Promise((T=>{let P=[];F.on("data",(b=>P.push(b))),F.on("end",(()=>T(Buffer.concat(P))))}))})}));w.on("error",o),w.end()}));w3(t)}function j(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}const nn=i=>up(i)?void 0:i,S3=i=>i!==void 0;function up(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(S3).length===0)}function de(i){let e=new Error(i);throw delete e.stack,e}function Jt(i){return(i=(function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e})(i).trim())===""?void 0:i}function ha(i){let e=(function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+2048})(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}const pa=i=>String.fromCharCode.apply(null,i),yc=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;function cp(i){return yc?yc.decode(i):tl?Buffer.from(i).toString("utf8"):decodeURIComponent(escape(pa(i)))}class Ie{static from(e,t){return e instanceof this&&e.le===t?e:new Ie(e,void 0,void 0,t)}constructor(e,t=0,r,s){if(typeof s=="boolean"&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){r===void 0&&(r=e.byteLength-t);let n=new DataView(e,t,r);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof Ie){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&de("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,r);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else de("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,r=Ie){return e instanceof DataView||e instanceof Ie?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||de("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new Ie(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return cp(this.getUint8Array(e,t))}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return pa(r)}getUnicodeString(e=0,t=this.byteLength){const r=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)r.push(this.getUint16(e+s));return pa(r)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function fa(i,e){de(`${i} '${e}' was not loaded, try using full build of exifr.`)}class rl extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||fa(this.kind,e),t&&(e in t||(function(r,s){de(`Unknown ${r} '${s}'.`)})(this.kind,e),t[e].enabled||fa(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var Ci=new rl("file parser"),we=new rl("segment parser"),xi=new rl("file reader");function P3(i,e){return typeof i=="string"?vc(i,e):Nr&&!v3&&i instanceof HTMLImageElement?vc(i.src,e):i instanceof Uint8Array||i instanceof ArrayBuffer||i instanceof DataView?new Ie(i):Nr&&i instanceof Blob?ga(i,e,"blob",va):void de("Invalid input argument")}function vc(i,e){return(t=i).startsWith("data:")||t.length>1e4?ma(i,e,"base64"):rn&&i.includes("://")?ga(i,e,"url",ya):rn?ma(i,e,"fs"):Nr?ga(i,e,"url",ya):void de("Invalid input argument");var t}async function ga(i,e,t,r){return xi.has(t)?ma(i,e,t):r?(async function(s,n){let o=await n(s);return new Ie(o)})(i,r):void de(`Parser ${t} is not loaded`)}async function ma(i,e,t){let r=new(xi.get(t))(i,e);return await r.read(),r}const ya=i=>il(i).then((e=>e.arrayBuffer())),va=i=>new Promise(((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)}));class F3 extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function be(i,e,t){let r=new F3;for(let[s,n]of t)r.set(s,n);if(Array.isArray(e))for(let s of e)i.set(s,r);else i.set(e,r);return r}function ba(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}const Oe=new Map,si=new Map,Ns=new Map,fs=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],dp=["jfif","xmp","icc","iptc","ihdr"],wa=["tiff",...dp],fe=["ifd0","ifd1","exif","gps","interop"],gs=[...wa,...fe],ms=["makerNote","userComment"],hp=["translateKeys","translateValues","reviveValues","multiSegment"],ys=[...hp,"sanitize","mergeOutput","silentErrors"];class pp{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class tr extends pp{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,s){if(super(),j(this,"enabled",!1),j(this,"skip",new Set),j(this,"pick",new Set),j(this,"deps",new Set),j(this,"translateKeys",!1),j(this,"translateValues",!1),j(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=fe.includes(e),this.canBeFiltered&&(this.dict=Oe.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:n,skip:o}=r;n&&n.length>0&&this.translateTagSet(n,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:de(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of hp)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,s,{tagKeys:n,tagValues:o}=this.dict;for(r of e)typeof r=="string"?(s=o.indexOf(r),s===-1&&(s=n.indexOf(Number(r))),s!==-1&&t.add(Number(n[s]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,on(this.pick,this.deps)):this.enabled&&this.pick.size>0&&on(this.pick,this.deps)}}var Ce={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},bc=new Map;class sl extends pp{static useCached(e){let t=bc.get(e);return t!==void 0||(t=new this(e),bc.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):de(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Nr?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of fs)this[e]=Ce[e];for(e of ys)this[e]=Ce[e];for(e of ms)this[e]=Ce[e];for(e of gs)this[e]=new tr(e,Ce[e],void 0,this)}setupFromTrue(){let e;for(e of fs)this[e]=Ce[e];for(e of ys)this[e]=Ce[e];for(e of ms)this[e]=!0;for(e of gs)this[e]=new tr(e,!0,void 0,this)}setupFromArray(e){let t;for(t of fs)this[t]=Ce[t];for(t of ys)this[t]=Ce[t];for(t of ms)this[t]=Ce[t];for(t of gs)this[t]=new tr(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,fe)}setupFromObject(e){let t;for(t of(fe.ifd0=fe.ifd0||fe.image,fe.ifd1=fe.ifd1||fe.thumbnail,Object.assign(this,e),fs))this[t]=bo(e[t],Ce[t]);for(t of ys)this[t]=bo(e[t],Ce[t]);for(t of ms)this[t]=bo(e[t],Ce[t]);for(t of wa)this[t]=new tr(t,Ce[t],e[t],this);for(t of fe)this[t]=new tr(t,Ce[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,fe,gs),e.tiff===!0?this.batchEnableWithBool(fe,!0):e.tiff===!1?this.batchEnableWithUserValue(fe,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,fe):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,fe)}batchEnableWithBool(e,t){for(let r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let s=t[r];this[r].enabled=s!==!1&&s!==void 0}}setupGlobalFilters(e,t,r,s=r){if(e&&e.length){for(let o of s)this[o].enabled=!1;let n=wc(e,r);for(let[o,a]of n)on(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let n=wc(t,r);for(let[o,a]of n)on(this[o].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=fe.some((n=>this[n].enabled===!0))||this.makerNote||this.userComment;for(let n of fe)this[n].finalizeFilters()}get onlyTiff(){return!dp.map((e=>this[e].enabled)).some((e=>e===!0))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of wa)this[e].enabled&&!we.has(e)&&fa("segment parser",e)}}function wc(i,e){let t,r,s,n,o=[];for(s of e){for(n of(t=Oe.get(s),r=[],t))(i.includes(n[0])||i.includes(n[1]))&&r.push(n[0]);r.length&&o.push([s,r])}return o}function bo(i,e){return i!==void 0?i:e!==void 0?e:void 0}function on(i,e){for(let t of e)i.add(t)}j(sl,"default",Ce);class C3{constructor(e){j(this,"parsers",{}),j(this,"output",{}),j(this,"errors",[]),j(this,"pushToErrors",(t=>this.errors.push(t))),this.options=sl.useCached(e)}async read(e){this.file=await P3(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,s]of Ci)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[r]=!0;this.file.close&&this.file.close(),de("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),nn(e)}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async r=>{let s=await r.parse();r.assignToOutput(e,s)}));this.options.silentErrors&&(t=t.map((r=>r.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,r=we.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),s===void 0)return;let n=await this.fileParser.ensureSegmentChunk(s),o=this.parsers.tiff=new r(n,e,t),a=await o.extractThumbnail();return t.close&&t.close(),a}}class gn{constructor(e,t,r){j(this,"errors",[]),j(this,"ensureSegmentChunk",(async s=>{let n=s.start,o=s.size||65536;if(this.file.chunked)if(this.file.available(n,o))s.chunk=this.file.subarray(n,o);else try{s.chunk=await this.file.readChunk(n,o)}catch(a){de(`Couldn't read segment: ${JSON.stringify(s)}. ${a.message}`)}else this.file.byteLength>n+o?s.chunk=this.file.subarray(n,o):s.size===void 0?s.chunk=this.file.subarray(n):de("Segment unreachable: "+JSON.stringify(s));return s.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(we.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:s}=t,n=this.options[r];if(n&&n.enabled){let o=this.parsers[r];o&&o.append||o||this.createParser(r,s)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}class et{static findPosition(e,t){let r=e.getUint16(t+2)+2,s=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,n=t+s,o=r-s;return{offset:t,length:r,headerLength:s,start:n,size:o,end:n+o}}static parse(e,t={}){return new this(e,new sl({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Ie?e:new Ie(e)}constructor(e,t={},r){j(this,"errors",[]),j(this,"raw",new Map),j(this,"handleError",(s=>{if(!this.options.silentErrors)throw s;this.errors.push(s.message)})),this.chunk=this.normalizeInput(e),this.file=r,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let r=Ns.get(t),s=si.get(t),n=Oe.get(t),o=this.options[t],a=o.reviveValues&&!!r,l=o.translateValues&&!!s,u=o.translateKeys&&!!n,d={};for(let[c,m]of e)a&&r.has(c)?m=r.get(c)(m):l&&s.has(c)&&(m=this.translateValue(m,s.get(c))),u&&n.has(c)&&(c=n.get(c)||c),d[c]=m;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}}j(et,"headerLength",4),j(et,"type",void 0),j(et,"multiSegment",!1),j(et,"canHandle",(()=>!1));function _3(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function T3(i){return i>=224&&i<=239}function E3(i,e,t){for(let[r,s]of we)if(s.canHandle(i,e,t))return r}class Sc extends gn{constructor(...e){super(...e),j(this,"appSegments",[]),j(this,"jpegSegments",[]),j(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(we.keyList())):(e=e===void 0?we.keyList().filter((t=>this.options[t].enabled)):e.filter((t=>this.options[t].enabled&&we.has(t))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:r,findAll:s,wanted:n,remaining:o}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some((a=>{let l=we.get(a),u=this.options[a];return l.multiSegment&&u.multiSegment})),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let a=!1;for(;o.size>0&&!a&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,u=this.appSegments.some((d=>!this.file.available(d.offset||d.start,d.length||d.size)));if(a=e>l&&!u?!await r.readNextChunk(e):!await r.readNextChunk(l),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,s,n,o,a,l,{file:u,findAll:d,wanted:c,remaining:m,options:w}=this;for(;e<t;e++)if(u.getUint8(e)===255){if(r=u.getUint8(e+1),T3(r)){if(s=u.getUint16(e+2),n=E3(u,e,s),n&&c.has(n)&&(o=we.get(n),a=o.findPosition(u,e),l=w[n],a.type=n,this.appSegments.push(a),!d&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||m.delete(n)):m.delete(n),m.size===0)))break;w.recordUnknownSegments&&(a=et.findPosition(u,e),a.marker=r,this.unknownSegments.push(a)),e+=s+1}else if(_3(r)){if(s=u.getUint16(e+2),r===218&&w.stopAfterSos!==!1)return;w.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:r}),e+=s+1}}return e}mergeMultiSegments(){if(!this.appSegments.some((t=>t.multiSegment)))return;let e=(function(t,r){let s,n,o,a=new Map;for(let l=0;l<t.length;l++)s=t[l],n=s[r],a.has(n)?o=a.get(n):a.set(n,o=[]),o.push(s);return Array.from(a)})(this.appSegments,"type");this.mergedAppSegments=e.map((([t,r])=>{let s=we.get(t,this.options);return s.handleMultiSegments?{type:t,chunk:s.handleMultiSegments(r)}:r[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}j(Sc,"type","jpeg"),Ci.set("jpeg",Sc);const D3=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class x3 extends et{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,r=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let o=s.size>0,a=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let u=0;u<l;u++){let d=this.chunk.getUint16(e);if(o){if(s.has(d)&&(r.set(d,this.parseTag(e,d,t)),s.delete(d),s.size===0))break}else!a&&n.has(d)||r.set(d,this.parseTag(e,d,t));e+=12}return r}parseTag(e,t,r){let{chunk:s}=this,n=s.getUint16(e+2),o=s.getUint32(e+4),a=D3[n];if(a*o<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&de(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&de(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),n===1)return s.getUint8Array(e,o);if(n===2)return Jt(s.getString(e,o));if(n===7)return s.getUint8Array(e,o);if(o===1)return this.parseTagValue(n,e);{let l=new((function(d){switch(d){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}})(n))(o),u=a;for(let d=0;d<o;d++)l[d]=this.parseTagValue(n,e),e+=u;return l}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:de(`Invalid tiff type ${e}`)}}}class wo extends x3{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let r=new Map;return this[t]=r,this.parseTags(e,t,r),r}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&de("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&de(`IFD0 offset points to outside of file.
|
|
47
47
|
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,ha(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,ha(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let r=e.get(t);r&&r.length===1&&e.set(t,r[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Pc(...e.get(2),e.get(1))),e.set("longitude",Pc(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,r,s={};for(t of fe)if(e=this[t],!up(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,r)}else s[t]=r;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,s]of Object.entries(t))this.assignObjectToOutput(e,r,s)}}function Pc(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}j(wo,"type","tiff"),j(wo,"headerLength",10),we.set("tiff",wo);const nl={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},nl,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},nl,{tiff:!1,ifd1:!0,mergeOutput:!1});const A3=Object.assign({},nl,{firstChunkSize:4e4,ifd0:[274]});async function I3(i){let e=new C3(A3);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const O3=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});let ur=!0,cr=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,r]=e;ur=Number(t)+.1*Number(r)<13.4,cr=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);ur=cr=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);ur=cr=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);ur=cr=Number(e)<77}}async function k3(i){let e=await I3(i);return Object.assign({canvas:ur,css:cr},O3[e])}class R3 extends Ie{constructor(...e){super(...e),j(this,"ranges",new U3),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let s=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(s)}else{let s=e+t;if(s>this.byteLength){let{dataView:n}=this._extend(s);this._swapDataView(n)}}}_extend(e){let t;t=tl?el.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class U3{constructor(){j(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter((o=>Fc(e,o.offset,s)||Fc(e,o.end,s)));if(n.length>0){e=Math.min(e,...n.map((a=>a.offset))),s=Math.max(s,...n.map((a=>a.end))),t=s-e;let o=n.shift();o.offset=e,o.length=t,o.end=s,this.list=this.list.filter((a=>!n.includes(a)))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let r=e+t;return this.list.some((s=>s.offset<=e&&r<=s.end))}}function Fc(i,e,t){return i<=e&&e<=t}class mn extends R3{constructor(e,t){super(0),j(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,r=await this.readChunk(e,t);return!!r&&r.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}xi.set("blob",class extends mn{async readWhole(){this.chunked=!1;let i=await va(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,r=this.input.slice(i,t),s=await va(r);return this.set(s,i,!0)}});xi.set("url",class extends mn{async readWhole(){this.chunked=!1;let i=await ya(this.input);i instanceof ArrayBuffer?this._swapArrayBuffer(i):i instanceof Uint8Array&&this._swapBuffer(i)}async _readChunk(i,e){let t=e?i+e-1:void 0,r=this.options.httpHeaders||{};(i||t)&&(r.range=`bytes=${[i,t].join("-")}`);let s=await il(this.input,{headers:r}),n=await s.arrayBuffer(),o=n.byteLength;if(s.status!==416)return o!==e&&(this.size=i+o),this.set(n,i,!0)}});Ie.prototype.getUint64=function(i){let e=this.getUint32(i),t=this.getUint32(i+4);return e<1048575?e<<32|t:typeof ps!==void 0?(console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."),ps(e)<<ps(32)|ps(t)):void de("Trying to read 64b value but JS can only handle 53b numbers.")};class M3 extends gn{parseBoxes(e=0){let t=[];for(;e<this.file.byteLength-4;){let r=this.parseBoxHead(e);if(t.push(r),r.length===0)break;e+=r.length}return t}parseSubBoxes(e){e.boxes=this.parseBoxes(e.start)}findBox(e,t){return e.boxes===void 0&&this.parseSubBoxes(e),e.boxes.find((r=>r.kind===t))}parseBoxHead(e){let t=this.file.getUint32(e),r=this.file.getString(e+4,4),s=e+8;return t===1&&(t=this.file.getUint64(e+8),s+=8),{offset:e,length:t,kind:r,start:s}}parseBoxFullHead(e){if(e.version!==void 0)return;let t=this.file.getUint32(e.start);e.version=t>>24,e.start+=4}}class fp extends M3{static canHandle(e,t){if(t!==0)return!1;let r=e.getUint16(2);if(r>50)return!1;let s=16,n=[];for(;s<r;)n.push(e.getString(s,4)),s+=4;return n.includes(this.type)}async parse(){let e=this.file.getUint32(0),t=this.parseBoxHead(e);for(;t.kind!=="meta";)e+=t.length,await this.file.ensureChunk(e,16),t=this.parseBoxHead(e);await this.file.ensureChunk(t.offset,t.length),this.parseBoxFullHead(t),this.parseSubBoxes(t),this.options.icc.enabled&&await this.findIcc(t),this.options.tiff.enabled&&await this.findExif(t)}async registerSegment(e,t,r){await this.file.ensureChunk(t,r);let s=this.file.subarray(t,r);this.createParser(e,s)}async findIcc(e){let t=this.findBox(e,"iprp");if(t===void 0)return;let r=this.findBox(t,"ipco");if(r===void 0)return;let s=this.findBox(r,"colr");s!==void 0&&await this.registerSegment("icc",s.offset+12,s.length)}async findExif(e){let t=this.findBox(e,"iinf");if(t===void 0)return;let r=this.findBox(e,"iloc");if(r===void 0)return;let s=this.findExifLocIdInIinf(t),n=this.findExtentInIloc(r,s);if(n===void 0)return;let[o,a]=n;await this.file.ensureChunk(o,a);let l=4+this.file.getUint32(o);o+=l,a-=l,await this.registerSegment("tiff",o,a)}findExifLocIdInIinf(e){this.parseBoxFullHead(e);let t,r,s,n,o=e.start,a=this.file.getUint16(o);for(o+=2;a--;){if(t=this.parseBoxHead(o),this.parseBoxFullHead(t),r=t.start,t.version>=2&&(s=t.version===3?4:2,n=this.file.getString(r+s+2,4),n==="Exif"))return this.file.getUintBytes(r,s);o+=t.length}}get8bits(e){let t=this.file.getUint8(e);return[t>>4,15&t]}findExtentInIloc(e,t){this.parseBoxFullHead(e);let r=e.start,[s,n]=this.get8bits(r++),[o,a]=this.get8bits(r++),l=e.version===2?4:2,u=e.version===1||e.version===2?2:0,d=a+s+n,c=e.version===2?4:2,m=this.file.getUintBytes(r,c);for(r+=c;m--;){let w=this.file.getUintBytes(r,l);r+=l+u+2+o;let F=this.file.getUint16(r);if(r+=2,w===t)return F>1&&console.warn(`ILOC box has more than one extent but we're only processing one
|
|
48
|
-
Please create an issue at https://github.com/MikeKovarik/exifr with this file`),[this.file.getUintBytes(r+a,s),this.file.getUintBytes(r+a+s,n)];r+=F*d}}}class gp extends fp{}j(gp,"type","heic");class Cc extends fp{}j(Cc,"type","avif"),Ci.set("heic",gp),Ci.set("avif",Cc),be(Oe,["ifd0","ifd1"],[[256,"ImageWidth"],[257,"ImageHeight"],[258,"BitsPerSample"],[259,"Compression"],[262,"PhotometricInterpretation"],[270,"ImageDescription"],[271,"Make"],[272,"Model"],[273,"StripOffsets"],[274,"Orientation"],[277,"SamplesPerPixel"],[278,"RowsPerStrip"],[279,"StripByteCounts"],[282,"XResolution"],[283,"YResolution"],[284,"PlanarConfiguration"],[296,"ResolutionUnit"],[301,"TransferFunction"],[305,"Software"],[306,"ModifyDate"],[315,"Artist"],[316,"HostComputer"],[317,"Predictor"],[318,"WhitePoint"],[319,"PrimaryChromaticities"],[513,"ThumbnailOffset"],[514,"ThumbnailLength"],[529,"YCbCrCoefficients"],[530,"YCbCrSubSampling"],[531,"YCbCrPositioning"],[532,"ReferenceBlackWhite"],[700,"ApplicationNotes"],[33432,"Copyright"],[33723,"IPTC"],[34665,"ExifIFD"],[34675,"ICC"],[34853,"GpsIFD"],[330,"SubIFD"],[40965,"InteropIFD"],[40091,"XPTitle"],[40092,"XPComment"],[40093,"XPAuthor"],[40094,"XPKeywords"],[40095,"XPSubject"]]),be(Oe,"exif",[[33434,"ExposureTime"],[33437,"FNumber"],[34850,"ExposureProgram"],[34852,"SpectralSensitivity"],[34855,"ISO"],[34858,"TimeZoneOffset"],[34859,"SelfTimerMode"],[34864,"SensitivityType"],[34865,"StandardOutputSensitivity"],[34866,"RecommendedExposureIndex"],[34867,"ISOSpeed"],[34868,"ISOSpeedLatitudeyyy"],[34869,"ISOSpeedLatitudezzz"],[36864,"ExifVersion"],[36867,"DateTimeOriginal"],[36868,"CreateDate"],[36873,"GooglePlusUploadCode"],[36880,"OffsetTime"],[36881,"OffsetTimeOriginal"],[36882,"OffsetTimeDigitized"],[37121,"ComponentsConfiguration"],[37122,"CompressedBitsPerPixel"],[37377,"ShutterSpeedValue"],[37378,"ApertureValue"],[37379,"BrightnessValue"],[37380,"ExposureCompensation"],[37381,"MaxApertureValue"],[37382,"SubjectDistance"],[37383,"MeteringMode"],[37384,"LightSource"],[37385,"Flash"],[37386,"FocalLength"],[37393,"ImageNumber"],[37394,"SecurityClassification"],[37395,"ImageHistory"],[37396,"SubjectArea"],[37500,"MakerNote"],[37510,"UserComment"],[37520,"SubSecTime"],[37521,"SubSecTimeOriginal"],[37522,"SubSecTimeDigitized"],[37888,"AmbientTemperature"],[37889,"Humidity"],[37890,"Pressure"],[37891,"WaterDepth"],[37892,"Acceleration"],[37893,"CameraElevationAngle"],[40960,"FlashpixVersion"],[40961,"ColorSpace"],[40962,"ExifImageWidth"],[40963,"ExifImageHeight"],[40964,"RelatedSoundFile"],[41483,"FlashEnergy"],[41486,"FocalPlaneXResolution"],[41487,"FocalPlaneYResolution"],[41488,"FocalPlaneResolutionUnit"],[41492,"SubjectLocation"],[41493,"ExposureIndex"],[41495,"SensingMethod"],[41728,"FileSource"],[41729,"SceneType"],[41730,"CFAPattern"],[41985,"CustomRendered"],[41986,"ExposureMode"],[41987,"WhiteBalance"],[41988,"DigitalZoomRatio"],[41989,"FocalLengthIn35mmFormat"],[41990,"SceneCaptureType"],[41991,"GainControl"],[41992,"Contrast"],[41993,"Saturation"],[41994,"Sharpness"],[41996,"SubjectDistanceRange"],[42016,"ImageUniqueID"],[42032,"OwnerName"],[42033,"SerialNumber"],[42034,"LensInfo"],[42035,"LensMake"],[42036,"LensModel"],[42037,"LensSerialNumber"],[42080,"CompositeImage"],[42081,"CompositeImageCount"],[42082,"CompositeImageExposureTimes"],[42240,"Gamma"],[59932,"Padding"],[59933,"OffsetSchema"],[65e3,"OwnerName"],[65001,"SerialNumber"],[65002,"Lens"],[65100,"RawFile"],[65101,"Converter"],[65102,"WhiteBalance"],[65105,"Exposure"],[65106,"Shadows"],[65107,"Brightness"],[65108,"Contrast"],[65109,"Saturation"],[65110,"Sharpness"],[65111,"Smoothness"],[65112,"MoireFilter"],[40965,"InteropIFD"]]),be(Oe,"gps",[[0,"GPSVersionID"],[1,"GPSLatitudeRef"],[2,"GPSLatitude"],[3,"GPSLongitudeRef"],[4,"GPSLongitude"],[5,"GPSAltitudeRef"],[6,"GPSAltitude"],[7,"GPSTimeStamp"],[8,"GPSSatellites"],[9,"GPSStatus"],[10,"GPSMeasureMode"],[11,"GPSDOP"],[12,"GPSSpeedRef"],[13,"GPSSpeed"],[14,"GPSTrackRef"],[15,"GPSTrack"],[16,"GPSImgDirectionRef"],[17,"GPSImgDirection"],[18,"GPSMapDatum"],[19,"GPSDestLatitudeRef"],[20,"GPSDestLatitude"],[21,"GPSDestLongitudeRef"],[22,"GPSDestLongitude"],[23,"GPSDestBearingRef"],[24,"GPSDestBearing"],[25,"GPSDestDistanceRef"],[26,"GPSDestDistance"],[27,"GPSProcessingMethod"],[28,"GPSAreaInformation"],[29,"GPSDateStamp"],[30,"GPSDifferential"],[31,"GPSHPositioningError"]]),be(si,["ifd0","ifd1"],[[274,{1:"Horizontal (normal)",2:"Mirror horizontal",3:"Rotate 180",4:"Mirror vertical",5:"Mirror horizontal and rotate 270 CW",6:"Rotate 90 CW",7:"Mirror horizontal and rotate 90 CW",8:"Rotate 270 CW"}],[296,{1:"None",2:"inches",3:"cm"}]]);let Sr=be(si,"exif",[[34850,{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"}],[37121,{0:"-",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}],[37383,{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"}],[37384,{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"}],[37385,{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"}],[41495,{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"}],[41728,{1:"Film Scanner",2:"Reflection Print Scanner",3:"Digital Camera"}],[41729,{1:"Directly photographed"}],[41985,{0:"Normal",1:"Custom",2:"HDR (no original saved)",3:"HDR (original saved)",4:"Original (for HDR)",6:"Panorama",7:"Portrait HDR",8:"Portrait"}],[41986,{0:"Auto",1:"Manual",2:"Auto bracket"}],[41987,{0:"Auto",1:"Manual"}],[41990,{0:"Standard",1:"Landscape",2:"Portrait",3:"Night",4:"Other"}],[41991,{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"}],[41996,{0:"Unknown",1:"Macro",2:"Close",3:"Distant"}],[42080,{0:"Unknown",1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}]]);const _c={1:"No absolute unit of measurement",2:"Inch",3:"Centimeter"};Sr.set(37392,_c),Sr.set(41488,_c);const So={0:"Normal",1:"Low",2:"High"};function Tc(i){return typeof i=="object"&&i.length!==void 0?i[0]:i}function Ec(i){let e=Array.from(i).slice(1);return e[1]>15&&(e=e.map((t=>String.fromCharCode(t)))),e[2]!=="0"&&e[2]!==0||e.pop(),e.join(".")}function Po(i){if(typeof i=="string"){var[e,t,r,s,n,o]=i.trim().split(/[-: ]/g).map(Number),a=new Date(e,t-1,r);return Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(o)||(a.setHours(s),a.setMinutes(n),a.setSeconds(o)),Number.isNaN(+a)?i:a}}function ir(i){if(typeof i=="string")return i;let e=[];if(i[1]===0&&i[i.length-1]===0)for(let t=0;t<i.length;t+=2)e.push(Dc(i[t+1],i[t]));else for(let t=0;t<i.length;t+=2)e.push(Dc(i[t],i[t+1]));return Jt(String.fromCodePoint(...e))}function Dc(i,e){return i<<8|e}Sr.set(41992,So),Sr.set(41993,So),Sr.set(41994,So),be(Ns,["ifd0","ifd1"],[[50827,function(i){return typeof i!="string"?cp(i):i}],[306,Po],[40091,ir],[40092,ir],[40093,ir],[40094,ir],[40095,ir]]),be(Ns,"exif",[[40960,Ec],[36864,Ec],[36867,Po],[36868,Po],[40962,Tc],[40963,Tc]]),be(Ns,"gps",[[0,i=>Array.from(i).join(".")],[7,i=>Array.from(i).join(":")]]);class Fo extends et{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1752462448&&e.getString(t+4,20)==="http://ns.adobe.com/"}static headerLength(e,t){return e.getString(t+4,34)==="http://ns.adobe.com/xmp/extension/"?79:33}static findPosition(e,t){let r=super.findPosition(e,t);return r.multiSegment=r.extended=r.headerLength===79,r.multiSegment?(r.chunkCount=e.getUint8(t+72),r.chunkNumber=e.getUint8(t+76),e.getUint8(t+77)!==0&&r.chunkNumber++):(r.chunkCount=1/0,r.chunkNumber=-1),r}static handleMultiSegments(e){return e.map((t=>t.chunk.getString())).join("")}normalizeInput(e){return typeof e=="string"?e:Ie.from(e).getString()}parse(e=this.chunk){if(!this.localOptions.parse)return e;e=(function(n){let o={},a={};for(let l of bp)o[l]=[],a[l]=0;return n.replace(z3,((l,u,d)=>{if(u==="<"){let c=++a[d];return o[d].push(c),`${l}#${c}`}return`${l}#${o[d].pop()}`}))})(e);let t=wi.findAll(e,"rdf","Description");t.length===0&&t.push(new wi("rdf","Description",void 0,e));let r,s={};for(let n of t)for(let o of n.properties)r=N3(o.ns,s),mp(o,r);return(function(n){let o;for(let a in n)o=n[a]=nn(n[a]),o===void 0&&delete n[a];return nn(n)})(s)}assignToOutput(e,t){if(this.localOptions.parse)for(let[r,s]of Object.entries(t))switch(r){case"tiff":this.assignObjectToOutput(e,"ifd0",s);break;case"exif":this.assignObjectToOutput(e,"exif",s);break;case"xmlns":break;default:this.assignObjectToOutput(e,r,s)}else e.xmp=t}}j(Fo,"type","xmp"),j(Fo,"multiSegment",!0),we.set("xmp",Fo);class an{static findAll(e){return yp(e,/([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(an.unpackMatch)}static unpackMatch(e){let t=e[1],r=e[2],s=e[3].slice(1,-1);return s=vp(s),new an(t,r,s)}constructor(e,t,r){this.ns=e,this.name=t,this.value=r}serialize(){return this.value}}class wi{static findAll(e,t,r){if(t!==void 0||r!==void 0){t=t||"[\\w\\d-]+",r=r||"[\\w\\d-]+";var s=new RegExp(`<(${t}):(${r})(#\\d+)?((\\s+?[\\w\\d-:]+=("[^"]*"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)`,"gm")}else s=/<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;return yp(e,s).map(wi.unpackMatch)}static unpackMatch(e){let t=e[1],r=e[2],s=e[4],n=e[8];return new wi(t,r,s,n)}constructor(e,t,r,s){this.ns=e,this.name=t,this.attrString=r,this.innerXml=s,this.attrs=an.findAll(r),this.children=wi.findAll(s),this.value=this.children.length===0?vp(s):void 0,this.properties=[...this.attrs,...this.children]}get isPrimitive(){return this.value!==void 0&&this.attrs.length===0&&this.children.length===0}get isListContainer(){return this.children.length===1&&this.children[0].isList}get isList(){let{ns:e,name:t}=this;return e==="rdf"&&(t==="Seq"||t==="Bag"||t==="Alt")}get isListItem(){return this.ns==="rdf"&&this.name==="li"}serialize(){if(this.properties.length===0&&this.value===void 0)return;if(this.isPrimitive)return this.value;if(this.isListContainer)return this.children[0].serialize();if(this.isList)return L3(this.children.map(B3));if(this.isListItem&&this.children.length===1&&this.attrs.length===0)return this.children[0].serialize();let e={};for(let t of this.properties)mp(t,e);return this.value!==void 0&&(e.value=this.value),nn(e)}}function mp(i,e){let t=i.serialize();t!==void 0&&(e[i.name]=t)}var B3=i=>i.serialize(),L3=i=>i.length===1?i[0]:i,N3=(i,e)=>e[i]?e[i]:e[i]={};function yp(i,e){let t,r=[];if(!i)return r;for(;(t=e.exec(i))!==null;)r.push(t);return r}function vp(i){if((function(r){return r==null||r==="null"||r==="undefined"||r===""||r.trim()===""})(i))return;let e=Number(i);if(!Number.isNaN(e))return e;let t=i.toLowerCase();return t==="true"||t!=="false"&&i.trim()}const bp=["rdf:li","rdf:Seq","rdf:Bag","rdf:Alt","rdf:Description"],z3=new RegExp(`(<|\\/)(${bp.join("|")})`,"g");let xc=sn("fs",(i=>i.promises));xi.set("fs",class extends mn{async readWhole(){this.chunked=!1,this.fs=await xc;let i=await this.fs.readFile(this.input);this._swapBuffer(i)}async readChunked(){this.chunked=!0,this.fs=await xc,await this.open(),await this.readChunk(0,this.options.firstChunkSize)}async open(){this.fh===void 0&&(this.fh=await this.fs.open(this.input,"r"),this.size=(await this.fh.stat(this.input)).size)}async _readChunk(i,e){this.fh===void 0&&await this.open(),i+e>this.size&&(e=this.size-i);var t=this.subarray(i,e,!0);return await this.fh.read(t.dataView,0,e,i),t}async close(){if(this.fh){let i=this.fh;this.fh=void 0,await i.close()}}});xi.set("base64",class extends mn{constructor(...i){super(...i),this.input=this.input.replace(/^data:([^;]+);base64,/gim,""),this.size=this.input.length/4*3,this.input.endsWith("==")?this.size-=2:this.input.endsWith("=")&&(this.size-=1)}async _readChunk(i,e){let t,r,s=this.input;i===void 0?(i=0,t=0,r=0):(t=4*Math.floor(i/3),r=i-t/4*3),e===void 0&&(e=this.size);let n=i+e,o=t+4*Math.ceil(n/3);s=s.slice(t,o);let a=Math.min(e,this.size-i);if(tl){let l=el.from(s,"base64").slice(r,r+a);return this.set(l,i,!0)}{let l=this.subarray(i,a,!0),u=atob(s),d=l.toUint8();for(let c=0;c<a;c++)d[c]=u.charCodeAt(r+c);return l}}});class Ac extends gn{static canHandle(e,t){return t===18761||t===19789}extendOptions(e){let{ifd0:t,xmp:r,iptc:s,icc:n}=e;r.enabled&&t.deps.add(700),s.enabled&&t.deps.add(33723),n.enabled&&t.deps.add(34675),t.finalizeFilters()}async parse(){let{tiff:e,xmp:t,iptc:r,icc:s}=this.options;if(e.enabled||t.enabled||r.enabled||s.enabled){let n=Math.max(ha(this.options),this.options.chunkSize);await this.file.ensureChunk(0,n),this.createParser("tiff",this.file),this.parsers.tiff.parseHeader(),await this.parsers.tiff.parseIfd0Block(),this.adaptTiffPropAsSegment("xmp"),this.adaptTiffPropAsSegment("iptc"),this.adaptTiffPropAsSegment("icc")}}adaptTiffPropAsSegment(e){if(this.parsers.tiff[e]){let t=this.parsers.tiff[e];this.injectSegment(e,t)}}}j(Ac,"type","tiff"),Ci.set("tiff",Ac);let $3=sn("zlib");const j3=["ihdr","iccp","text","itxt","exif"];class Ic extends gn{constructor(...e){super(...e),j(this,"catchError",(t=>this.errors.push(t))),j(this,"metaChunks",[]),j(this,"unknownChunks",[])}static canHandle(e,t){return t===35152&&e.getUint32(0)===2303741511&&e.getUint32(4)===218765834}async parse(){let{file:e}=this;await this.findPngChunksInRange(8,e.byteLength),await this.readSegments(this.metaChunks),this.findIhdr(),this.parseTextChunks(),await this.findExif().catch(this.catchError),await this.findXmp().catch(this.catchError),await this.findIcc().catch(this.catchError)}async findPngChunksInRange(e,t){let{file:r}=this;for(;e<t;){let s=r.getUint32(e),n=r.getUint32(e+4),o=r.getString(e+4,4).toLowerCase(),a=s+4+4+4,l={type:o,offset:e,length:a,start:e+4+4,size:s,marker:n};j3.includes(o)?this.metaChunks.push(l):this.unknownChunks.push(l),e+=a}}parseTextChunks(){let e=this.metaChunks.filter((t=>t.type==="text"));for(let t of e){let[r,s]=this.file.getString(t.start,t.size).split("\0");this.injectKeyValToIhdr(r,s)}}injectKeyValToIhdr(e,t){let r=this.parsers.ihdr;r&&r.raw.set(e,t)}findIhdr(){let e=this.metaChunks.find((t=>t.type==="ihdr"));e&&this.options.ihdr.enabled!==!1&&this.createParser("ihdr",e.chunk)}async findExif(){let e=this.metaChunks.find((t=>t.type==="exif"));e&&this.injectSegment("tiff",e.chunk)}async findXmp(){let e=this.metaChunks.filter((t=>t.type==="itxt"));for(let t of e)t.chunk.getString(0,17)==="XML:com.adobe.xmp"&&this.injectSegment("xmp",t.chunk)}async findIcc(){let e=this.metaChunks.find((a=>a.type==="iccp"));if(!e)return;let{chunk:t}=e,r=t.getUint8Array(0,81),s=0;for(;s<80&&r[s]!==0;)s++;let n=s+2,o=t.getString(0,s);if(this.injectKeyValToIhdr("ProfileName",o),rn){let a=await $3,l=t.getUint8Array(n);l=a.inflateSync(l),this.injectSegment("icc",l)}}}j(Ic,"type","png"),Ci.set("png",Ic),be(Oe,"interop",[[1,"InteropIndex"],[2,"InteropVersion"],[4096,"RelatedImageFileFormat"],[4097,"RelatedImageWidth"],[4098,"RelatedImageHeight"]]),ba(Oe,"ifd0",[[11,"ProcessingSoftware"],[254,"SubfileType"],[255,"OldSubfileType"],[263,"Thresholding"],[264,"CellWidth"],[265,"CellLength"],[266,"FillOrder"],[269,"DocumentName"],[280,"MinSampleValue"],[281,"MaxSampleValue"],[285,"PageName"],[286,"XPosition"],[287,"YPosition"],[290,"GrayResponseUnit"],[297,"PageNumber"],[321,"HalftoneHints"],[322,"TileWidth"],[323,"TileLength"],[332,"InkSet"],[337,"TargetPrinter"],[18246,"Rating"],[18249,"RatingPercent"],[33550,"PixelScale"],[34264,"ModelTransform"],[34377,"PhotoshopSettings"],[50706,"DNGVersion"],[50707,"DNGBackwardVersion"],[50708,"UniqueCameraModel"],[50709,"LocalizedCameraModel"],[50736,"DNGLensInfo"],[50739,"ShadowScale"],[50740,"DNGPrivateData"],[33920,"IntergraphMatrix"],[33922,"ModelTiePoint"],[34118,"SEMInfo"],[34735,"GeoTiffDirectory"],[34736,"GeoTiffDoubleParams"],[34737,"GeoTiffAsciiParams"],[50341,"PrintIM"],[50721,"ColorMatrix1"],[50722,"ColorMatrix2"],[50723,"CameraCalibration1"],[50724,"CameraCalibration2"],[50725,"ReductionMatrix1"],[50726,"ReductionMatrix2"],[50727,"AnalogBalance"],[50728,"AsShotNeutral"],[50729,"AsShotWhiteXY"],[50730,"BaselineExposure"],[50731,"BaselineNoise"],[50732,"BaselineSharpness"],[50734,"LinearResponseLimit"],[50735,"CameraSerialNumber"],[50741,"MakerNoteSafety"],[50778,"CalibrationIlluminant1"],[50779,"CalibrationIlluminant2"],[50781,"RawDataUniqueID"],[50827,"OriginalRawFileName"],[50828,"OriginalRawFileData"],[50831,"AsShotICCProfile"],[50832,"AsShotPreProfileMatrix"],[50833,"CurrentICCProfile"],[50834,"CurrentPreProfileMatrix"],[50879,"ColorimetricReference"],[50885,"SRawType"],[50898,"PanasonicTitle"],[50899,"PanasonicTitle2"],[50931,"CameraCalibrationSig"],[50932,"ProfileCalibrationSig"],[50933,"ProfileIFD"],[50934,"AsShotProfileName"],[50936,"ProfileName"],[50937,"ProfileHueSatMapDims"],[50938,"ProfileHueSatMapData1"],[50939,"ProfileHueSatMapData2"],[50940,"ProfileToneCurve"],[50941,"ProfileEmbedPolicy"],[50942,"ProfileCopyright"],[50964,"ForwardMatrix1"],[50965,"ForwardMatrix2"],[50966,"PreviewApplicationName"],[50967,"PreviewApplicationVersion"],[50968,"PreviewSettingsName"],[50969,"PreviewSettingsDigest"],[50970,"PreviewColorSpace"],[50971,"PreviewDateTime"],[50972,"RawImageDigest"],[50973,"OriginalRawFileDigest"],[50981,"ProfileLookTableDims"],[50982,"ProfileLookTableData"],[51043,"TimeCodes"],[51044,"FrameRate"],[51058,"TStop"],[51081,"ReelName"],[51089,"OriginalDefaultFinalSize"],[51090,"OriginalBestQualitySize"],[51091,"OriginalDefaultCropSize"],[51105,"CameraLabel"],[51107,"ProfileHueSatMapEncoding"],[51108,"ProfileLookTableEncoding"],[51109,"BaselineExposureOffset"],[51110,"DefaultBlackRender"],[51111,"NewRawImageDigest"],[51112,"RawToPreviewGain"]]);let Oc=[[273,"StripOffsets"],[279,"StripByteCounts"],[288,"FreeOffsets"],[289,"FreeByteCounts"],[291,"GrayResponseCurve"],[292,"T4Options"],[293,"T6Options"],[300,"ColorResponseUnit"],[320,"ColorMap"],[324,"TileOffsets"],[325,"TileByteCounts"],[326,"BadFaxLines"],[327,"CleanFaxData"],[328,"ConsecutiveBadFaxLines"],[330,"SubIFD"],[333,"InkNames"],[334,"NumberofInks"],[336,"DotRange"],[338,"ExtraSamples"],[339,"SampleFormat"],[340,"SMinSampleValue"],[341,"SMaxSampleValue"],[342,"TransferRange"],[343,"ClipPath"],[344,"XClipPathUnits"],[345,"YClipPathUnits"],[346,"Indexed"],[347,"JPEGTables"],[351,"OPIProxy"],[400,"GlobalParametersIFD"],[401,"ProfileType"],[402,"FaxProfile"],[403,"CodingMethods"],[404,"VersionYear"],[405,"ModeNumber"],[433,"Decode"],[434,"DefaultImageColor"],[435,"T82Options"],[437,"JPEGTables"],[512,"JPEGProc"],[515,"JPEGRestartInterval"],[517,"JPEGLosslessPredictors"],[518,"JPEGPointTransforms"],[519,"JPEGQTables"],[520,"JPEGDCTables"],[521,"JPEGACTables"],[559,"StripRowCounts"],[999,"USPTOMiscellaneous"],[18247,"XP_DIP_XML"],[18248,"StitchInfo"],[28672,"SonyRawFileType"],[28688,"SonyToneCurve"],[28721,"VignettingCorrection"],[28722,"VignettingCorrParams"],[28724,"ChromaticAberrationCorrection"],[28725,"ChromaticAberrationCorrParams"],[28726,"DistortionCorrection"],[28727,"DistortionCorrParams"],[29895,"SonyCropTopLeft"],[29896,"SonyCropSize"],[32781,"ImageID"],[32931,"WangTag1"],[32932,"WangAnnotation"],[32933,"WangTag3"],[32934,"WangTag4"],[32953,"ImageReferencePoints"],[32954,"RegionXformTackPoint"],[32955,"WarpQuadrilateral"],[32956,"AffineTransformMat"],[32995,"Matteing"],[32996,"DataType"],[32997,"ImageDepth"],[32998,"TileDepth"],[33300,"ImageFullWidth"],[33301,"ImageFullHeight"],[33302,"TextureFormat"],[33303,"WrapModes"],[33304,"FovCot"],[33305,"MatrixWorldToScreen"],[33306,"MatrixWorldToCamera"],[33405,"Model2"],[33421,"CFARepeatPatternDim"],[33422,"CFAPattern2"],[33423,"BatteryLevel"],[33424,"KodakIFD"],[33445,"MDFileTag"],[33446,"MDScalePixel"],[33447,"MDColorTable"],[33448,"MDLabName"],[33449,"MDSampleInfo"],[33450,"MDPrepDate"],[33451,"MDPrepTime"],[33452,"MDFileUnits"],[33589,"AdventScale"],[33590,"AdventRevision"],[33628,"UIC1Tag"],[33629,"UIC2Tag"],[33630,"UIC3Tag"],[33631,"UIC4Tag"],[33918,"IntergraphPacketData"],[33919,"IntergraphFlagRegisters"],[33921,"INGRReserved"],[34016,"Site"],[34017,"ColorSequence"],[34018,"IT8Header"],[34019,"RasterPadding"],[34020,"BitsPerRunLength"],[34021,"BitsPerExtendedRunLength"],[34022,"ColorTable"],[34023,"ImageColorIndicator"],[34024,"BackgroundColorIndicator"],[34025,"ImageColorValue"],[34026,"BackgroundColorValue"],[34027,"PixelIntensityRange"],[34028,"TransparencyIndicator"],[34029,"ColorCharacterization"],[34030,"HCUsage"],[34031,"TrapIndicator"],[34032,"CMYKEquivalent"],[34152,"AFCP_IPTC"],[34232,"PixelMagicJBIGOptions"],[34263,"JPLCartoIFD"],[34306,"WB_GRGBLevels"],[34310,"LeafData"],[34687,"TIFF_FXExtensions"],[34688,"MultiProfiles"],[34689,"SharedData"],[34690,"T88Options"],[34732,"ImageLayer"],[34750,"JBIGOptions"],[34856,"Opto-ElectricConvFactor"],[34857,"Interlace"],[34908,"FaxRecvParams"],[34909,"FaxSubAddress"],[34910,"FaxRecvTime"],[34929,"FedexEDR"],[34954,"LeafSubIFD"],[37387,"FlashEnergy"],[37388,"SpatialFrequencyResponse"],[37389,"Noise"],[37390,"FocalPlaneXResolution"],[37391,"FocalPlaneYResolution"],[37392,"FocalPlaneResolutionUnit"],[37397,"ExposureIndex"],[37398,"TIFF-EPStandardID"],[37399,"SensingMethod"],[37434,"CIP3DataFile"],[37435,"CIP3Sheet"],[37436,"CIP3Side"],[37439,"StoNits"],[37679,"MSDocumentText"],[37680,"MSPropertySetStorage"],[37681,"MSDocumentTextPosition"],[37724,"ImageSourceData"],[40965,"InteropIFD"],[40976,"SamsungRawPointersOffset"],[40977,"SamsungRawPointersLength"],[41217,"SamsungRawByteOrder"],[41218,"SamsungRawUnknown"],[41484,"SpatialFrequencyResponse"],[41485,"Noise"],[41489,"ImageNumber"],[41490,"SecurityClassification"],[41491,"ImageHistory"],[41494,"TIFF-EPStandardID"],[41995,"DeviceSettingDescription"],[42112,"GDALMetadata"],[42113,"GDALNoData"],[44992,"ExpandSoftware"],[44993,"ExpandLens"],[44994,"ExpandFilm"],[44995,"ExpandFilterLens"],[44996,"ExpandScanner"],[44997,"ExpandFlashLamp"],[46275,"HasselbladRawImage"],[48129,"PixelFormat"],[48130,"Transformation"],[48131,"Uncompressed"],[48132,"ImageType"],[48256,"ImageWidth"],[48257,"ImageHeight"],[48258,"WidthResolution"],[48259,"HeightResolution"],[48320,"ImageOffset"],[48321,"ImageByteCount"],[48322,"AlphaOffset"],[48323,"AlphaByteCount"],[48324,"ImageDataDiscard"],[48325,"AlphaDataDiscard"],[50215,"OceScanjobDesc"],[50216,"OceApplicationSelector"],[50217,"OceIDNumber"],[50218,"OceImageLogic"],[50255,"Annotations"],[50459,"HasselbladExif"],[50547,"OriginalFileName"],[50560,"USPTOOriginalContentType"],[50656,"CR2CFAPattern"],[50710,"CFAPlaneColor"],[50711,"CFALayout"],[50712,"LinearizationTable"],[50713,"BlackLevelRepeatDim"],[50714,"BlackLevel"],[50715,"BlackLevelDeltaH"],[50716,"BlackLevelDeltaV"],[50717,"WhiteLevel"],[50718,"DefaultScale"],[50719,"DefaultCropOrigin"],[50720,"DefaultCropSize"],[50733,"BayerGreenSplit"],[50737,"ChromaBlurRadius"],[50738,"AntiAliasStrength"],[50752,"RawImageSegmentation"],[50780,"BestQualityScale"],[50784,"AliasLayerMetadata"],[50829,"ActiveArea"],[50830,"MaskedAreas"],[50935,"NoiseReductionApplied"],[50974,"SubTileBlockSize"],[50975,"RowInterleaveFactor"],[51008,"OpcodeList1"],[51009,"OpcodeList2"],[51022,"OpcodeList3"],[51041,"NoiseProfile"],[51114,"CacheVersion"],[51125,"DefaultUserCrop"],[51157,"NikonNEFInfo"],[65024,"KdcIFD"]];ba(Oe,"ifd0",Oc),ba(Oe,"exif",Oc),be(si,"gps",[[23,{M:"Magnetic North",T:"True North"}],[25,{K:"Kilometers",M:"Miles",N:"Nautical Miles"}]]);class Co extends et{static canHandle(e,t){return e.getUint8(t+1)===224&&e.getUint32(t+4)===1246120262&&e.getUint8(t+8)===0}parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint16(0)],[2,this.chunk.getUint8(2)],[3,this.chunk.getUint16(3)],[5,this.chunk.getUint16(5)],[7,this.chunk.getUint8(7)],[8,this.chunk.getUint8(8)]])}}j(Co,"type","jfif"),j(Co,"headerLength",9),we.set("jfif",Co),be(Oe,"jfif",[[0,"JFIFVersion"],[2,"ResolutionUnit"],[3,"XResolution"],[5,"YResolution"],[7,"ThumbnailWidth"],[8,"ThumbnailHeight"]]);class kc extends et{parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint32(0)],[4,this.chunk.getUint32(4)],[8,this.chunk.getUint8(8)],[9,this.chunk.getUint8(9)],[10,this.chunk.getUint8(10)],[11,this.chunk.getUint8(11)],[12,this.chunk.getUint8(12)],...Array.from(this.raw)])}}j(kc,"type","ihdr"),we.set("ihdr",kc),be(Oe,"ihdr",[[0,"ImageWidth"],[4,"ImageHeight"],[8,"BitDepth"],[9,"ColorType"],[10,"Compression"],[11,"Filter"],[12,"Interlace"]]),be(si,"ihdr",[[9,{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha",DEFAULT:"Unknown"}],[10,{0:"Deflate/Inflate",DEFAULT:"Unknown"}],[11,{0:"Adaptive",DEFAULT:"Unknown"}],[12,{0:"Noninterlaced",1:"Adam7 Interlace",DEFAULT:"Unknown"}]]);class zs extends et{static canHandle(e,t){return e.getUint8(t+1)===226&&e.getUint32(t+4)===1229144927}static findPosition(e,t){let r=super.findPosition(e,t);return r.chunkNumber=e.getUint8(t+16),r.chunkCount=e.getUint8(t+17),r.multiSegment=r.chunkCount>1,r}static handleMultiSegments(e){return(function(t){let r=(function(s){let n=s[0].constructor,o=0;for(let u of s)o+=u.length;let a=new n(o),l=0;for(let u of s)a.set(u,l),l+=u.length;return a})(t.map((s=>s.chunk.toUint8())));return new Ie(r)})(e)}parse(){return this.raw=new Map,this.parseHeader(),this.parseTags(),this.translate(),this.output}parseHeader(){let{raw:e}=this;this.chunk.byteLength<84&&de("ICC header is too short");for(let[t,r]of Object.entries(H3)){t=parseInt(t,10);let s=r(this.chunk,t);s!=="\0\0\0\0"&&e.set(t,s)}}parseTags(){let e,t,r,s,n,{raw:o}=this,a=this.chunk.getUint32(128),l=132,u=this.chunk.byteLength;for(;a--;){if(e=this.chunk.getString(l,4),t=this.chunk.getUint32(l+4),r=this.chunk.getUint32(l+8),s=this.chunk.getString(t,4),t+r>u)return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");n=this.parseTag(s,t,r),n!==void 0&&n!=="\0\0\0\0"&&o.set(e,n),l+=12}}parseTag(e,t,r){switch(e){case"desc":return this.parseDesc(t);case"mluc":return this.parseMluc(t);case"text":return this.parseText(t,r);case"sig ":return this.parseSig(t)}if(!(t+r>this.chunk.byteLength))return this.chunk.getUint8Array(t,r)}parseDesc(e){let t=this.chunk.getUint32(e+8)-1;return Jt(this.chunk.getString(e+12,t))}parseText(e,t){return Jt(this.chunk.getString(e+8,t-8))}parseSig(e){return Jt(this.chunk.getString(e+8,4))}parseMluc(e){let{chunk:t}=this,r=t.getUint32(e+8),s=t.getUint32(e+12),n=e+16,o=[];for(let a=0;a<r;a++){let l=t.getString(n+0,2),u=t.getString(n+2,2),d=t.getUint32(n+4),c=t.getUint32(n+8)+e,m=Jt(t.getUnicodeString(c,d));o.push({lang:l,country:u,text:m}),n+=s}return r===1?o[0].text:o}translateValue(e,t){return typeof e=="string"?t[e]||t[e.toLowerCase()]||e:t[e]||e}}j(zs,"type","icc"),j(zs,"multiSegment",!0),j(zs,"headerLength",18);const H3={4:yt,8:function(i,e){return[i.getUint8(e),i.getUint8(e+1)>>4,i.getUint8(e+1)%16].map((t=>t.toString(10))).join(".")},12:yt,16:yt,20:yt,24:function(i,e){const t=i.getUint16(e),r=i.getUint16(e+2)-1,s=i.getUint16(e+4),n=i.getUint16(e+6),o=i.getUint16(e+8),a=i.getUint16(e+10);return new Date(Date.UTC(t,r,s,n,o,a))},36:yt,40:yt,48:yt,52:yt,64:(i,e)=>i.getUint32(e),80:yt};function yt(i,e){return Jt(i.getString(e,4))}we.set("icc",zs),be(Oe,"icc",[[4,"ProfileCMMType"],[8,"ProfileVersion"],[12,"ProfileClass"],[16,"ColorSpaceData"],[20,"ProfileConnectionSpace"],[24,"ProfileDateTime"],[36,"ProfileFileSignature"],[40,"PrimaryPlatform"],[44,"CMMFlags"],[48,"DeviceManufacturer"],[52,"DeviceModel"],[56,"DeviceAttributes"],[64,"RenderingIntent"],[68,"ConnectionSpaceIlluminant"],[80,"ProfileCreator"],[84,"ProfileID"],["Header","ProfileHeader"],["MS00","WCSProfiles"],["bTRC","BlueTRC"],["bXYZ","BlueMatrixColumn"],["bfd","UCRBG"],["bkpt","MediaBlackPoint"],["calt","CalibrationDateTime"],["chad","ChromaticAdaptation"],["chrm","Chromaticity"],["ciis","ColorimetricIntentImageState"],["clot","ColorantTableOut"],["clro","ColorantOrder"],["clrt","ColorantTable"],["cprt","ProfileCopyright"],["crdi","CRDInfo"],["desc","ProfileDescription"],["devs","DeviceSettings"],["dmdd","DeviceModelDesc"],["dmnd","DeviceMfgDesc"],["dscm","ProfileDescriptionML"],["fpce","FocalPlaneColorimetryEstimates"],["gTRC","GreenTRC"],["gXYZ","GreenMatrixColumn"],["gamt","Gamut"],["kTRC","GrayTRC"],["lumi","Luminance"],["meas","Measurement"],["meta","Metadata"],["mmod","MakeAndModel"],["ncl2","NamedColor2"],["ncol","NamedColor"],["ndin","NativeDisplayInfo"],["pre0","Preview0"],["pre1","Preview1"],["pre2","Preview2"],["ps2i","PS2RenderingIntent"],["ps2s","PostScript2CSA"],["psd0","PostScript2CRD0"],["psd1","PostScript2CRD1"],["psd2","PostScript2CRD2"],["psd3","PostScript2CRD3"],["pseq","ProfileSequenceDesc"],["psid","ProfileSequenceIdentifier"],["psvm","PS2CRDVMSize"],["rTRC","RedTRC"],["rXYZ","RedMatrixColumn"],["resp","OutputResponse"],["rhoc","ReflectionHardcopyOrigColorimetry"],["rig0","PerceptualRenderingIntentGamut"],["rig2","SaturationRenderingIntentGamut"],["rpoc","ReflectionPrintOutputColorimetry"],["sape","SceneAppearanceEstimates"],["scoe","SceneColorimetryEstimates"],["scrd","ScreeningDesc"],["scrn","Screening"],["targ","CharTarget"],["tech","Technology"],["vcgt","VideoCardGamma"],["view","ViewingConditions"],["vued","ViewingCondDesc"],["wtpt","MediaWhitePoint"]]);const vs={"4d2p":"Erdt Systems",AAMA:"Aamazing Technologies",ACER:"Acer",ACLT:"Acolyte Color Research",ACTI:"Actix Sytems",ADAR:"Adara Technology",ADBE:"Adobe",ADI:"ADI Systems",AGFA:"Agfa Graphics",ALMD:"Alps Electric",ALPS:"Alps Electric",ALWN:"Alwan Color Expertise",AMTI:"Amiable Technologies",AOC:"AOC International",APAG:"Apago",APPL:"Apple Computer",AST:"AST","AT&T":"AT&T",BAEL:"BARBIERI electronic",BRCO:"Barco NV",BRKP:"Breakpoint",BROT:"Brother",BULL:"Bull",BUS:"Bus Computer Systems","C-IT":"C-Itoh",CAMR:"Intel",CANO:"Canon",CARR:"Carroll Touch",CASI:"Casio",CBUS:"Colorbus PL",CEL:"Crossfield",CELx:"Crossfield",CGS:"CGS Publishing Technologies International",CHM:"Rochester Robotics",CIGL:"Colour Imaging Group, London",CITI:"Citizen",CL00:"Candela",CLIQ:"Color IQ",CMCO:"Chromaco",CMiX:"CHROMiX",COLO:"Colorgraphic Communications",COMP:"Compaq",COMp:"Compeq/Focus Technology",CONR:"Conrac Display Products",CORD:"Cordata Technologies",CPQ:"Compaq",CPRO:"ColorPro",CRN:"Cornerstone",CTX:"CTX International",CVIS:"ColorVision",CWC:"Fujitsu Laboratories",DARI:"Darius Technology",DATA:"Dataproducts",DCP:"Dry Creek Photo",DCRC:"Digital Contents Resource Center, Chung-Ang University",DELL:"Dell Computer",DIC:"Dainippon Ink and Chemicals",DICO:"Diconix",DIGI:"Digital","DL&C":"Digital Light & Color",DPLG:"Doppelganger",DS:"Dainippon Screen",DSOL:"DOOSOL",DUPN:"DuPont",EPSO:"Epson",ESKO:"Esko-Graphics",ETRI:"Electronics and Telecommunications Research Institute",EVER:"Everex Systems",EXAC:"ExactCODE",Eizo:"Eizo",FALC:"Falco Data Products",FF:"Fuji Photo Film",FFEI:"FujiFilm Electronic Imaging",FNRD:"Fnord Software",FORA:"Fora",FORE:"Forefront Technology",FP:"Fujitsu",FPA:"WayTech Development",FUJI:"Fujitsu",FX:"Fuji Xerox",GCC:"GCC Technologies",GGSL:"Global Graphics Software",GMB:"Gretagmacbeth",GMG:"GMG",GOLD:"GoldStar Technology",GOOG:"Google",GPRT:"Giantprint",GTMB:"Gretagmacbeth",GVC:"WayTech Development",GW2K:"Sony",HCI:"HCI",HDM:"Heidelberger Druckmaschinen",HERM:"Hermes",HITA:"Hitachi America",HP:"Hewlett-Packard",HTC:"Hitachi",HiTi:"HiTi Digital",IBM:"IBM",IDNT:"Scitex",IEC:"Hewlett-Packard",IIYA:"Iiyama North America",IKEG:"Ikegami Electronics",IMAG:"Image Systems",IMI:"Ingram Micro",INTC:"Intel",INTL:"N/A (INTL)",INTR:"Intra Electronics",IOCO:"Iocomm International Technology",IPS:"InfoPrint Solutions Company",IRIS:"Scitex",ISL:"Ichikawa Soft Laboratory",ITNL:"N/A (ITNL)",IVM:"IVM",IWAT:"Iwatsu Electric",Idnt:"Scitex",Inca:"Inca Digital Printers",Iris:"Scitex",JPEG:"Joint Photographic Experts Group",JSFT:"Jetsoft Development",JVC:"JVC Information Products",KART:"Scitex",KFC:"KFC Computek Components",KLH:"KLH Computers",KMHD:"Konica Minolta",KNCA:"Konica",KODA:"Kodak",KYOC:"Kyocera",Kart:"Scitex",LCAG:"Leica",LCCD:"Leeds Colour",LDAK:"Left Dakota",LEAD:"Leading Technology",LEXM:"Lexmark International",LINK:"Link Computer",LINO:"Linotronic",LITE:"Lite-On",Leaf:"Leaf",Lino:"Linotronic",MAGC:"Mag Computronic",MAGI:"MAG Innovision",MANN:"Mannesmann",MICN:"Micron Technology",MICR:"Microtek",MICV:"Microvitec",MINO:"Minolta",MITS:"Mitsubishi Electronics America",MITs:"Mitsuba",MNLT:"Minolta",MODG:"Modgraph",MONI:"Monitronix",MONS:"Monaco Systems",MORS:"Morse Technology",MOTI:"Motive Systems",MSFT:"Microsoft",MUTO:"MUTOH INDUSTRIES",Mits:"Mitsubishi Electric",NANA:"NANAO",NEC:"NEC",NEXP:"NexPress Solutions",NISS:"Nissei Sangyo America",NKON:"Nikon",NONE:"none",OCE:"Oce Technologies",OCEC:"OceColor",OKI:"Oki",OKID:"Okidata",OKIP:"Okidata",OLIV:"Olivetti",OLYM:"Olympus",ONYX:"Onyx Graphics",OPTI:"Optiquest",PACK:"Packard Bell",PANA:"Matsushita Electric Industrial",PANT:"Pantone",PBN:"Packard Bell",PFU:"PFU",PHIL:"Philips Consumer Electronics",PNTX:"HOYA",POne:"Phase One A/S",PREM:"Premier Computer Innovations",PRIN:"Princeton Graphic Systems",PRIP:"Princeton Publishing Labs",QLUX:"Hong Kong",QMS:"QMS",QPCD:"QPcard AB",QUAD:"QuadLaser",QUME:"Qume",RADI:"Radius",RDDx:"Integrated Color Solutions",RDG:"Roland DG",REDM:"REDMS Group",RELI:"Relisys",RGMS:"Rolf Gierling Multitools",RICO:"Ricoh",RNLD:"Edmund Ronald",ROYA:"Royal",RPC:"Ricoh Printing Systems",RTL:"Royal Information Electronics",SAMP:"Sampo",SAMS:"Samsung",SANT:"Jaime Santana Pomares",SCIT:"Scitex",SCRN:"Dainippon Screen",SDP:"Scitex",SEC:"Samsung",SEIK:"Seiko Instruments",SEIk:"Seikosha",SGUY:"ScanGuy.com",SHAR:"Sharp Laboratories",SICC:"International Color Consortium",SONY:"Sony",SPCL:"SpectraCal",STAR:"Star",STC:"Sampo Technology",Scit:"Scitex",Sdp:"Scitex",Sony:"Sony",TALO:"Talon Technology",TAND:"Tandy",TATU:"Tatung",TAXA:"TAXAN America",TDS:"Tokyo Denshi Sekei",TECO:"TECO Information Systems",TEGR:"Tegra",TEKT:"Tektronix",TI:"Texas Instruments",TMKR:"TypeMaker",TOSB:"Toshiba",TOSH:"Toshiba",TOTK:"TOTOKU ELECTRIC",TRIU:"Triumph",TSBT:"Toshiba",TTX:"TTX Computer Products",TVM:"TVM Professional Monitor",TW:"TW Casper",ULSX:"Ulead Systems",UNIS:"Unisys",UTZF:"Utz Fehlau & Sohn",VARI:"Varityper",VIEW:"Viewsonic",VISL:"Visual communication",VIVO:"Vivo Mobile Communication",WANG:"Wang",WLBR:"Wilbur Imaging",WTG2:"Ware To Go",WYSE:"WYSE Technology",XERX:"Xerox",XRIT:"X-Rite",ZRAN:"Zoran",Zebr:"Zebra Technologies",appl:"Apple Computer",bICC:"basICColor",berg:"bergdesign",ceyd:"Integrated Color Solutions",clsp:"MacDermid ColorSpan",ds:"Dainippon Screen",dupn:"DuPont",ffei:"FujiFilm Electronic Imaging",flux:"FluxData",iris:"Scitex",kart:"Scitex",lcms:"Little CMS",lino:"Linotronic",none:"none",ob4d:"Erdt Systems",obic:"Medigraph",quby:"Qubyx Sarl",scit:"Scitex",scrn:"Dainippon Screen",sdp:"Scitex",siwi:"SIWI GRAFIKA",yxym:"YxyMaster"},Rc={scnr:"Scanner",mntr:"Monitor",prtr:"Printer",link:"Device Link",abst:"Abstract",spac:"Color Space Conversion Profile",nmcl:"Named Color",cenc:"ColorEncodingSpace profile",mid:"MultiplexIdentification profile",mlnk:"MultiplexLink profile",mvis:"MultiplexVisualization profile",nkpf:"Nikon Input Device Profile (NON-STANDARD!)"};be(si,"icc",[[4,vs],[12,Rc],[40,Object.assign({},vs,Rc)],[48,vs],[80,vs],[64,{0:"Perceptual",1:"Relative Colorimetric",2:"Saturation",3:"Absolute Colorimetric"}],["tech",{amd:"Active Matrix Display",crt:"Cathode Ray Tube Display",kpcd:"Photo CD",pmd:"Passive Matrix Display",dcam:"Digital Camera",dcpj:"Digital Cinema Projector",dmpc:"Digital Motion Picture Camera",dsub:"Dye Sublimation Printer",epho:"Electrophotographic Printer",esta:"Electrostatic Printer",flex:"Flexography",fprn:"Film Writer",fscn:"Film Scanner",grav:"Gravure",ijet:"Ink Jet Printer",imgs:"Photo Image Setter",mpfr:"Motion Picture Film Recorder",mpfs:"Motion Picture Film Scanner",offs:"Offset Lithography",pjtv:"Projection Television",rpho:"Photographic Paper Printer",rscn:"Reflective Scanner",silk:"Silkscreen",twax:"Thermal Wax Printer",vidc:"Video Camera",vidm:"Video Monitor"}]]);class bs extends et{static canHandle(e,t,r){return e.getUint8(t+1)===237&&e.getString(t+4,9)==="Photoshop"&&this.containsIptc8bim(e,t,r)!==void 0}static headerLength(e,t,r){let s,n=this.containsIptc8bim(e,t,r);if(n!==void 0)return s=e.getUint8(t+n+7),s%2!=0&&(s+=1),s===0&&(s=4),n+8+s}static containsIptc8bim(e,t,r){for(let s=0;s<r;s++)if(this.isIptcSegmentHead(e,t+s))return s}static isIptcSegmentHead(e,t){return e.getUint8(t)===56&&e.getUint32(t)===943868237&&e.getUint16(t+4)===1028}parse(){let{raw:e}=this,t=this.chunk.byteLength-1,r=!1;for(let s=0;s<t;s++)if(this.chunk.getUint8(s)===28&&this.chunk.getUint8(s+1)===2){r=!0;let n=this.chunk.getUint16(s+3),o=this.chunk.getUint8(s+2),a=this.chunk.getLatin1String(s+5,n);e.set(o,this.pluralizeValue(e.get(o),a)),s+=4+n}else if(r)break;return this.translate(),this.output}pluralizeValue(e,t){return e!==void 0?e instanceof Array?(e.push(t),e):[e,t]:t}}j(bs,"type","iptc"),j(bs,"translateValues",!1),j(bs,"reviveValues",!1),we.set("iptc",bs),be(Oe,"iptc",[[0,"ApplicationRecordVersion"],[3,"ObjectTypeReference"],[4,"ObjectAttributeReference"],[5,"ObjectName"],[7,"EditStatus"],[8,"EditorialUpdate"],[10,"Urgency"],[12,"SubjectReference"],[15,"Category"],[20,"SupplementalCategories"],[22,"FixtureIdentifier"],[25,"Keywords"],[26,"ContentLocationCode"],[27,"ContentLocationName"],[30,"ReleaseDate"],[35,"ReleaseTime"],[37,"ExpirationDate"],[38,"ExpirationTime"],[40,"SpecialInstructions"],[42,"ActionAdvised"],[45,"ReferenceService"],[47,"ReferenceDate"],[50,"ReferenceNumber"],[55,"DateCreated"],[60,"TimeCreated"],[62,"DigitalCreationDate"],[63,"DigitalCreationTime"],[65,"OriginatingProgram"],[70,"ProgramVersion"],[75,"ObjectCycle"],[80,"Byline"],[85,"BylineTitle"],[90,"City"],[92,"Sublocation"],[95,"State"],[100,"CountryCode"],[101,"Country"],[103,"OriginalTransmissionReference"],[105,"Headline"],[110,"Credit"],[115,"Source"],[116,"CopyrightNotice"],[118,"Contact"],[120,"Caption"],[121,"LocalCaption"],[122,"Writer"],[125,"RasterizedCaption"],[130,"ImageType"],[131,"ImageOrientation"],[135,"LanguageIdentifier"],[150,"AudioType"],[151,"AudioSamplingRate"],[152,"AudioSamplingResolution"],[153,"AudioDuration"],[154,"AudioOutcue"],[184,"JobID"],[185,"MasterDocumentID"],[186,"ShortDocumentID"],[187,"UniqueDocumentID"],[188,"OwnerID"],[200,"ObjectPreviewFileFormat"],[201,"ObjectPreviewFileVersion"],[202,"ObjectPreviewData"],[221,"Prefs"],[225,"ClassifyState"],[228,"SimilarityIndex"],[230,"DocumentNotes"],[231,"DocumentHistory"],[232,"ExifCameraInfo"],[255,"CatalogSets"]]),be(si,"iptc",[[10,{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"}],[75,{a:"Morning",b:"Both Morning and Evening",p:"Evening"}],[131,{L:"Landscape",P:"Portrait",S:"Square"}]]);const ws={zip:qp,gz:wn,tgz:wn,deflate:wn};class q3 extends he{constructor(e,t){const r={};super(e,{...r,...t}),this.id=this.opts.id||"PrepareUpload",this.type="progressindicator",this.i18nInit()}setHashFileName=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{data:s}=r,n=1024*1024*5,a=await s.slice(0,n).text(),l=new y3;l.append(a);const u=l.end(),d=Zt(r),c=`${u}${d?`.${d}`:""}`;this.uppy.setFileState(t,{hashFileName:c})}};setMetaData=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{data:{webkitRelativePath:s,relativePath:n,name:o},hashFileName:a,size:l}=r,u=n||s||o||a;this.uppy.setFileMeta(t,{relativePath:u,name:u})}};preventXssAttack=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{name:s,meta:n}=this.uppy.getFile(t),o=oi.sanitize(s);if(s!==o){const l=Zt(r),u=o.endsWith(`.${l}`)?o:`${o}.${l}`;this.uppy.setFileState(t,{name:u,meta:{...n,name:u,filename:u}})}if(await ap(r)){const{data:l,name:u,type:d}=this.uppy.getFile(t),c=await l.text(),m=new Set;new DOMParser().parseFromString(c,"image/svg+xml").querySelectorAll("[id]").forEach(P=>m.add(P.id)),oi.addHook("uponSanitizeElement",(P,b)=>{if(b.tagName==="use"){const y=P.getAttribute("xlink:href")||P.getAttribute("href");if(y&&y.startsWith("#")){const f=y.substring(1);m.has(f)&&(b.allowedTags.use=!0,b.forceKeepNode=!0)}}}),oi.addHook("uponSanitizeAttribute",(P,b)=>{if(b.attrName==="xlink:href"&&b.attrValue){if(b.attrValue.startsWith("#")){const y=b.attrValue.substring(1);if(m.has(y)){b.forceKeepAttr=!0;return}}b.keepAttr=!1}["width","height"].includes(b.attrName)&&b.attrValue==="100%"&&(b.forceKeepAttr=!0),b.attrName==="style"&&b.attrValue==="overflow:visible"&&(b.forceKeepAttr=!0)});const T=oi.sanitize(c,{USE_PROFILES:{svg:!0,svgFilters:!0},ALLOWED_TAGS:["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","use","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop"],ALLOWED_ATTR:["d","points","x","y","width","height","r","cx","cy","rx","ry","x1","y1","x2","y2","transform","fill","stroke","stroke-width","viewBox","xmlns","xmlns:xlink","xml:space","style","id","class","offset","stop-color","stop-opacity","clip-path","mask","fill-opacity","stroke-opacity","gradientTransform","gradientUnits","xlink:href"],FORBID_TAGS:["a","script","iframe","image","foreignObject"],FORBID_ATTR:["href","onclick","onload","onerror"]});if(oi.removeHook("uponSanitizeElement"),oi.removeHook("uponSanitizeAttribute"),c!==T){const P=new Blob([T],{type:d}),b=Ms(P,u);this.uppy.setFileState(t,{...this.uppy.getFile(t),data:b,preview:ar(b)}),console.info("clean svg file xss attack",{name:u,originalFile:r.data.text(),cleanFile:T})}}}};preventZipBombAttack=async e=>{const{id:t}=e,r=this.uppy.getFile(t);try{if(r&&ws[r.extension]){const{data:s}=r,n=ws[r.extension](new Uint8Array(await s.arrayBuffer())),o=(l,u,d=0)=>Object.entries(l instanceof Uint8Array?{[u||r.name]:l}:l).reduce((c,[m,w])=>{if(!w||w.byteLength===0)return console.warn("Invalid or empty item in unzipped content",{name:m,item:w}),c;const F=c+w.byteLength;if(d>=5||F>r.size*100)throw console.error("Zip bomb detected, please check your file",{depth:d,baseAcc:F,fileSize:r.size}),new Error("Zip bomb detected, please check your file");const T=Fi(Ct(m));if(ws[T]){const P=ws[T](w);return F+o(P,m,d+1)}return F},0);if(o(n)>r.size*100)throw new Error("Zip bomb detected, please check your file")}}catch(s){if(s.message.includes("Zip bomb detected"))throw s}};validateImagesRespectCropperOptions=async()=>this.uppy.getFiles().reduce(async(e,t)=>{await e;const{id:r}=t;let s=this.uppy.getFile(r);if(s.isRemote&&(await this.tryDownloadRemoteFile(s),s=this.uppy.getFile(r)),!this.opts.cropperOptions?.aspectRatio||!s?.type?.includes("image")||s.type?.includes("image/svg"))return Promise.resolve();const{aspectRatio:n}=this.opts.cropperOptions,o=this.uppy.getPlugin("ImageEditor"),a=document.querySelector(`[src="${s.preview}"]`)||document.getElementById("uppy_"+r).querySelector("img"),l=a?.naturalWidth,u=a?.naturalHeight,d=Number(l/u).toFixed(2),c=Number(n).toFixed(2);if(d===c)return Promise.resolve();this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("editorLoading")}),o.parent.openFileEditor(s);const w=this.i18n("aspectRatioMessage",{imageAspectRatio:d,aspectRatio:c});return this.uppy.info({message:w,details:w}),new Promise((F,T)=>{this.uppy.once("file-editor:complete",()=>{setTimeout(()=>{F()},200)}),this.uppy.once("file-editor:cancel",()=>{})})},Promise.resolve());checkImageOrientation=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r?.type?.startsWith("image/"))try{if(!(await k3(r.data).catch(()=>({deg:0}))).deg)return;const n=r.data.size*.98,o=await new Promise((T,P)=>{const b=new Image;let y=URL.createObjectURL(r.data);b.src=y,b.onload=()=>{URL.revokeObjectURL(y),y=null,T(b)},b.onerror=f=>{y&&(URL.revokeObjectURL(y),y=null),P(new Error(`Image load failed: ${f.message}`))}}),a=o.width/o.height;let l=Math.sqrt(n*a),u=l/a;const d=8096;if(l>d||u>d){const T=d/Math.max(l,u);l*=T,u*=T}const c=document.createElement("canvas");c.width=l,c.height=u;const m=c.getContext("2d",{willReadFrequently:!0,alpha:r.type==="image/png"});m.imageSmoothingEnabled=!0,m.imageSmoothingQuality="high",m.translate(c.width/2,c.height/2),m.drawImage(o,-l/2,-u/2,l,u);const w=1,F=await new Promise(T=>{c.toBlob(T,r.type,w)});this.uppy.setFileState(t,{data:F,size:F.size})}catch(s){console.error("Image rotation processing failed:",s);return}};prepareUploadWrapper=async e=>{await this.tryDownloadRemoteFile(e),await this.checkImageOrientation(e),await this.getPreviewFromData(e),await this.setHashFileName(e),this.opts.disableXssAttack||await this.preventXssAttack(e),await this.preventZipBombAttack(e),await this.setMetaData(e)};tryDownloadRemoteFile=async e=>{const{type:t,name:r,preview:s,source:n,isRemote:o,isDownloading:a,id:l,isLoading:u,remote:d,meta:c,errorCount:m=0}=e,w=!u&&o,F=`uploader:${l}:downloaded`,T=Zt(e),P=r?.split("?")?.[0],y=(()=>{const f=["jpg","jpeg"];return f.includes(T)&&f.some(p=>P?.endsWith(p))?!0:P?.endsWith(T)})()?P:`${P}${T?`.${T}`:""}`;if(w){const f=tp(s||d?.body?.url);if(m>=3)throw this.uppy.setFileState(l,{error:this.i18n("downloadRemoteFileFailure"),meta:{...c,name:this.i18n("downloadRemoteFileFailure")}}),new Error("Download remote file failure");this.uppy.setFileState(l,{isLoading:!0,isDownloading:!0,size:null,meta:{...c,name:this.i18n("loading")}}),await fetch(f).then(async p=>await p.blob()).then(async p=>{const v=Ms(p,y);this.uppy.setFileState(l,{name:y,extension:T,type:t,data:v,preview:s||ar(v),source:n,size:v.size,isDownloading:!1,isRemote:!1,meta:{...c,name:y,filename:y}}),this.uppy.getFile(l),this.uppy.emit(F,l)}).catch(async p=>{if(console.error("Axios download remote file error: ",p),t.startsWith("image/")){const v=t.includes("svg")?"image/png":t,g=y.endsWith(".svg")?y.replace(".svg",".png"):y;try{const _=await new Promise((N,H)=>{const z=new Image;z.crossOrigin="anonymous",z.onload=()=>{const k=document.createElement("canvas");k.width=z.width,k.height=z.height;const L=k.getContext("2d");L.translate(k.width/2,k.height/2),L.drawImage(z,-z.width/2,-z.height/2,z.width,z.height),k.toBlob(N,v)},z.onerror=H,z.src=f});let A=Ms(_,g);this.uppy.setFileState(l,{name:g,extension:T,type:v,data:A,preview:s||ar(A),source:n,size:A.size,isDownloading:!1,isRemote:!1,meta:{...c,name:g,filename:g}});const I=this.uppy.getFile(l);this.uppy.emit(F,l);return}catch{}}this.uppy.setFileState(l,{isRemote:!0,isLoading:!1,errorCount:m+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(l))})}else a&&await(async()=>new Promise(p=>{this.uppy.once(F,async()=>{p()})}))()};getPreviewFromData=e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{data:s,type:n,preview:o}=r;(n.indexOf("gif")>-1||!o)&&s&&n.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(t,{preview:ar(s)})},n.indexOf("gif")>-1?1e3:0)}};prepareUpload=async e=>{await this.validateImagesRespectCropperOptions();const t=e.map(async s=>{const n=this.uppy.getFile(s);n.isDownloading&&this.uppy.emit("preprocess-progress",n,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(n)}),r=()=>{e.forEach(s=>{const n=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",n)})};return Promise.all(t).then(r)};install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async e=>{setTimeout(()=>{this.prepareUploadWrapper(e)},200)}),this.uppy.on("file-editor:complete",e=>{this.getPreviewFromData(e)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}render(){return se($e,{})}}class V3 extends he{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>se("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:se("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[se("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),se("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return se("div",{id:"ai-image",className:"ai-image",children:se("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}class W3 extends he{constructor(e,t){super(e,t),this.id=t.id,this.title=t.title,this.type="acquirer",this.uppy=e,this.i18nInit(),this.autoHide=t.autoHide??!0,typeof t.icon=="string"&&(this.icon=()=>se("div",{dangerouslySetInnerHTML:{__html:t.icon},style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}}))}getDashboard(){return this.uppy.getPlugin(this.id)?.parent}render(){return this.autoHide&&this.getDashboard()?.hideAllPanels&&this.getDashboard().hideAllPanels(),se("div",{id:this.id,className:"uppy-VirtualPlugin"})}update(){}onFirstRender(){}uninstall(){this.unmount()}}const Uc=()=>navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome");class G3 extends he{constructor(e,t){super(e,t),this.id=t?.id||"safari-paste",this.type="modifier"}onMount(){Uc()&&this.parent?.handlePaste&&document.addEventListener("paste",this.parent.handlePaste)}onUnmount(){Uc()&&this.parent?.handlePaste&&document.removeEventListener("paste",this.parent.handlePaste)}}const X3="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",K3=ee.lazy(()=>kp(()=>import("./index-DcddP3R9.js"),[])),Mc="uploader-container",_o="uploader-dashboard",Y3='div[tabindex="-1"]',Bc=50,Q3=10,Sa=localStorage.getItem("uppy_debug"),J3=()=>en.get("x-csrf-token")?{"x-csrf-token":en.get("x-csrf-token")}:{},Z3=i=>{const{apiPathProps:e,availablePluginMap:t={},uploadedProps:r,resourcesProps:s,imageEditorProps:n={},theme:o,plugins:a,disableXssAttack:l}=i,{companionUrl:u}=Ka(e),d=J3(),c=async w=>(await Di.post("/api/image/generations",w)).data,m={...i?.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:xh,options:{quality:1,...n},alwayUse:!0},(Sa||bi()&&t.Uploaded&&!ca())&&{id:"Uploaded",plugin:u3,options:{params:r?.params}},(Sa||bi()&&t.Resources&&!ca())&&{id:"Resources",plugin:f3,options:{params:s?.params}},bi()&&(window.blocklet?.preferences?.useAiImage||t.AIImage)&&{id:"AIImage",plugin:V3,options:{companionUrl:u,companionHeaders:d},onShowPanel:w=>{function F(){setTimeout(()=>{const T=document.getElementById("ai-image");T?Hp.createRoot(T).render(_e.jsx(K3,{theme:o,api:c,restrictions:m,i18n:w.current?.getUploader()?.i18n,onSelect:P=>{const b=w.current.getUploader();b?.emit("ai-image:selected",P),P.forEach(({src:y,alt:f},p)=>{const g=`${(_=>_?.length>16?`${_?.slice(0,8)}...${_?.slice(-4)}`:_)(f)||"ai-image"}.png`;if(y&&!y.startsWith("data:"))fetch(y).then(_=>_.blob()).then(_=>{const A=new File([_],g,{type:"image/png"});b?.addFile({name:g,type:"image/png",data:A,source:"AIImage",isRemote:!1})}).catch(_=>{b?.log(`[AIImage] Failed to fetch image: ${_.message}`,"error")});else{const _={name:g,type:"image/png",data:ep(y,g),source:"AIImage",isRemote:!1};b?.addFile(_)}})}})):F()},100)}F()}},{id:"Url",plugin:Ot,options:{companionUrl:u,companionHeaders:d}},{id:"Webcam",plugin:cd,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!window?.blocklet?.UNSPLASH_KEY&&t.Unsplash&&{id:"Unsplash",plugin:xd,options:{companionUrl:u,companionHeaders:d,companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:q3,options:{companionUrl:u,companionHeaders:d,cropperOptions:n?.cropperOptions||null,disableXssAttack:l},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:Ma,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0},...(a||[]).filter(w=>w?.id).map(w=>{const{id:F,options:T,onShowPanel:P}=w;return{id:F,plugin:W3,options:T,onShowPanel:P}}),{id:"safari-paste",plugin:G3,alwayUse:!0}].filter(Boolean)};function wp(i){const{id:e,plugins:t,locale:r="en",onAfterResponse:s,onUploadFinish:n,coreProps:o,apiPathProps:a,tusProps:l,dropTargetProps:u,pluginList:d,restrictions:c,onChange:m,initialFiles:w,uploadMode:F="tus"}=i,T=jc(d,"id"),{uploaderUrl:P}=Ka(a);let b=new Ca({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Sa||""),locale:lr[r],onBeforeFileAdded:(p,v)=>{if(Object.hasOwn(v,p.id))return!1;const g=!!Fi(p.type),_=Ct(p.name)||"";if(!g&&_&&_!==p.type){const A=Zt(p);A&&(p.extension=A),p.type=_}return p},...o,restrictions:c});if(F==="presigned"){const p=P.replace(/\/uploads\/?$/,"");b.use(o3,{apiBase:p}),b.on("upload-success",async(v,g)=>{if(!g.body)return;const _={data:g.body,method:"POST",url:g.uploadURL||"",status:200,headers:{},file:v,uploadURL:g.uploadURL||""};await n?.(_),b.emitUploadSuccess(v,_)})}else b.use(Qh,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:P,async onBeforeRequest(p,v){const{hashFileName:g,id:_,meta:A}=v,I=b.getFile(_)?.mockResponse||null;p.getMethod()==="PATCH"&&I&&(p.send=()=>I);const N=Zt(v);p.setHeader("x-uploader-file-name",`${g}`),p.setHeader("x-uploader-file-id",`${_}`),p.setHeader("x-uploader-file-ext",`${N}`),p.setHeader("x-uploader-base-url",new URL(p.getURL()).pathname),p.setHeader("x-uploader-endpoint-url",P),p.setHeader("x-uploader-metadata",JSON.stringify(A,(k,L)=>typeof L=="string"?encodeURIComponent(L):L));const H=en.get("x-csrf-token");H&&p.setHeader("x-csrf-token",H);const z=window?.uploaderComponentId||window?.blocklet?.componentId;z&&p.setHeader("x-component-did",(z||"").split("/").pop())},onAfterResponse:async(p,v)=>{const g={},_=p.getUnderlyingObject();try{_.response&&(g.data=JSON.parse(_.response))}catch{g.data={}}g.method=p.getMethod().toUpperCase(),g.url=p.getURL(),g.status=_.status,g.headers={...p._headers};const A=_.getAllResponseHeaders();A&&A.split(`\r
|
|
48
|
+
Please create an issue at https://github.com/MikeKovarik/exifr with this file`),[this.file.getUintBytes(r+a,s),this.file.getUintBytes(r+a+s,n)];r+=F*d}}}class gp extends fp{}j(gp,"type","heic");class Cc extends fp{}j(Cc,"type","avif"),Ci.set("heic",gp),Ci.set("avif",Cc),be(Oe,["ifd0","ifd1"],[[256,"ImageWidth"],[257,"ImageHeight"],[258,"BitsPerSample"],[259,"Compression"],[262,"PhotometricInterpretation"],[270,"ImageDescription"],[271,"Make"],[272,"Model"],[273,"StripOffsets"],[274,"Orientation"],[277,"SamplesPerPixel"],[278,"RowsPerStrip"],[279,"StripByteCounts"],[282,"XResolution"],[283,"YResolution"],[284,"PlanarConfiguration"],[296,"ResolutionUnit"],[301,"TransferFunction"],[305,"Software"],[306,"ModifyDate"],[315,"Artist"],[316,"HostComputer"],[317,"Predictor"],[318,"WhitePoint"],[319,"PrimaryChromaticities"],[513,"ThumbnailOffset"],[514,"ThumbnailLength"],[529,"YCbCrCoefficients"],[530,"YCbCrSubSampling"],[531,"YCbCrPositioning"],[532,"ReferenceBlackWhite"],[700,"ApplicationNotes"],[33432,"Copyright"],[33723,"IPTC"],[34665,"ExifIFD"],[34675,"ICC"],[34853,"GpsIFD"],[330,"SubIFD"],[40965,"InteropIFD"],[40091,"XPTitle"],[40092,"XPComment"],[40093,"XPAuthor"],[40094,"XPKeywords"],[40095,"XPSubject"]]),be(Oe,"exif",[[33434,"ExposureTime"],[33437,"FNumber"],[34850,"ExposureProgram"],[34852,"SpectralSensitivity"],[34855,"ISO"],[34858,"TimeZoneOffset"],[34859,"SelfTimerMode"],[34864,"SensitivityType"],[34865,"StandardOutputSensitivity"],[34866,"RecommendedExposureIndex"],[34867,"ISOSpeed"],[34868,"ISOSpeedLatitudeyyy"],[34869,"ISOSpeedLatitudezzz"],[36864,"ExifVersion"],[36867,"DateTimeOriginal"],[36868,"CreateDate"],[36873,"GooglePlusUploadCode"],[36880,"OffsetTime"],[36881,"OffsetTimeOriginal"],[36882,"OffsetTimeDigitized"],[37121,"ComponentsConfiguration"],[37122,"CompressedBitsPerPixel"],[37377,"ShutterSpeedValue"],[37378,"ApertureValue"],[37379,"BrightnessValue"],[37380,"ExposureCompensation"],[37381,"MaxApertureValue"],[37382,"SubjectDistance"],[37383,"MeteringMode"],[37384,"LightSource"],[37385,"Flash"],[37386,"FocalLength"],[37393,"ImageNumber"],[37394,"SecurityClassification"],[37395,"ImageHistory"],[37396,"SubjectArea"],[37500,"MakerNote"],[37510,"UserComment"],[37520,"SubSecTime"],[37521,"SubSecTimeOriginal"],[37522,"SubSecTimeDigitized"],[37888,"AmbientTemperature"],[37889,"Humidity"],[37890,"Pressure"],[37891,"WaterDepth"],[37892,"Acceleration"],[37893,"CameraElevationAngle"],[40960,"FlashpixVersion"],[40961,"ColorSpace"],[40962,"ExifImageWidth"],[40963,"ExifImageHeight"],[40964,"RelatedSoundFile"],[41483,"FlashEnergy"],[41486,"FocalPlaneXResolution"],[41487,"FocalPlaneYResolution"],[41488,"FocalPlaneResolutionUnit"],[41492,"SubjectLocation"],[41493,"ExposureIndex"],[41495,"SensingMethod"],[41728,"FileSource"],[41729,"SceneType"],[41730,"CFAPattern"],[41985,"CustomRendered"],[41986,"ExposureMode"],[41987,"WhiteBalance"],[41988,"DigitalZoomRatio"],[41989,"FocalLengthIn35mmFormat"],[41990,"SceneCaptureType"],[41991,"GainControl"],[41992,"Contrast"],[41993,"Saturation"],[41994,"Sharpness"],[41996,"SubjectDistanceRange"],[42016,"ImageUniqueID"],[42032,"OwnerName"],[42033,"SerialNumber"],[42034,"LensInfo"],[42035,"LensMake"],[42036,"LensModel"],[42037,"LensSerialNumber"],[42080,"CompositeImage"],[42081,"CompositeImageCount"],[42082,"CompositeImageExposureTimes"],[42240,"Gamma"],[59932,"Padding"],[59933,"OffsetSchema"],[65e3,"OwnerName"],[65001,"SerialNumber"],[65002,"Lens"],[65100,"RawFile"],[65101,"Converter"],[65102,"WhiteBalance"],[65105,"Exposure"],[65106,"Shadows"],[65107,"Brightness"],[65108,"Contrast"],[65109,"Saturation"],[65110,"Sharpness"],[65111,"Smoothness"],[65112,"MoireFilter"],[40965,"InteropIFD"]]),be(Oe,"gps",[[0,"GPSVersionID"],[1,"GPSLatitudeRef"],[2,"GPSLatitude"],[3,"GPSLongitudeRef"],[4,"GPSLongitude"],[5,"GPSAltitudeRef"],[6,"GPSAltitude"],[7,"GPSTimeStamp"],[8,"GPSSatellites"],[9,"GPSStatus"],[10,"GPSMeasureMode"],[11,"GPSDOP"],[12,"GPSSpeedRef"],[13,"GPSSpeed"],[14,"GPSTrackRef"],[15,"GPSTrack"],[16,"GPSImgDirectionRef"],[17,"GPSImgDirection"],[18,"GPSMapDatum"],[19,"GPSDestLatitudeRef"],[20,"GPSDestLatitude"],[21,"GPSDestLongitudeRef"],[22,"GPSDestLongitude"],[23,"GPSDestBearingRef"],[24,"GPSDestBearing"],[25,"GPSDestDistanceRef"],[26,"GPSDestDistance"],[27,"GPSProcessingMethod"],[28,"GPSAreaInformation"],[29,"GPSDateStamp"],[30,"GPSDifferential"],[31,"GPSHPositioningError"]]),be(si,["ifd0","ifd1"],[[274,{1:"Horizontal (normal)",2:"Mirror horizontal",3:"Rotate 180",4:"Mirror vertical",5:"Mirror horizontal and rotate 270 CW",6:"Rotate 90 CW",7:"Mirror horizontal and rotate 90 CW",8:"Rotate 270 CW"}],[296,{1:"None",2:"inches",3:"cm"}]]);let Sr=be(si,"exif",[[34850,{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"}],[37121,{0:"-",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}],[37383,{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"}],[37384,{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"}],[37385,{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"}],[41495,{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"}],[41728,{1:"Film Scanner",2:"Reflection Print Scanner",3:"Digital Camera"}],[41729,{1:"Directly photographed"}],[41985,{0:"Normal",1:"Custom",2:"HDR (no original saved)",3:"HDR (original saved)",4:"Original (for HDR)",6:"Panorama",7:"Portrait HDR",8:"Portrait"}],[41986,{0:"Auto",1:"Manual",2:"Auto bracket"}],[41987,{0:"Auto",1:"Manual"}],[41990,{0:"Standard",1:"Landscape",2:"Portrait",3:"Night",4:"Other"}],[41991,{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"}],[41996,{0:"Unknown",1:"Macro",2:"Close",3:"Distant"}],[42080,{0:"Unknown",1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}]]);const _c={1:"No absolute unit of measurement",2:"Inch",3:"Centimeter"};Sr.set(37392,_c),Sr.set(41488,_c);const So={0:"Normal",1:"Low",2:"High"};function Tc(i){return typeof i=="object"&&i.length!==void 0?i[0]:i}function Ec(i){let e=Array.from(i).slice(1);return e[1]>15&&(e=e.map((t=>String.fromCharCode(t)))),e[2]!=="0"&&e[2]!==0||e.pop(),e.join(".")}function Po(i){if(typeof i=="string"){var[e,t,r,s,n,o]=i.trim().split(/[-: ]/g).map(Number),a=new Date(e,t-1,r);return Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(o)||(a.setHours(s),a.setMinutes(n),a.setSeconds(o)),Number.isNaN(+a)?i:a}}function ir(i){if(typeof i=="string")return i;let e=[];if(i[1]===0&&i[i.length-1]===0)for(let t=0;t<i.length;t+=2)e.push(Dc(i[t+1],i[t]));else for(let t=0;t<i.length;t+=2)e.push(Dc(i[t],i[t+1]));return Jt(String.fromCodePoint(...e))}function Dc(i,e){return i<<8|e}Sr.set(41992,So),Sr.set(41993,So),Sr.set(41994,So),be(Ns,["ifd0","ifd1"],[[50827,function(i){return typeof i!="string"?cp(i):i}],[306,Po],[40091,ir],[40092,ir],[40093,ir],[40094,ir],[40095,ir]]),be(Ns,"exif",[[40960,Ec],[36864,Ec],[36867,Po],[36868,Po],[40962,Tc],[40963,Tc]]),be(Ns,"gps",[[0,i=>Array.from(i).join(".")],[7,i=>Array.from(i).join(":")]]);class Fo extends et{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1752462448&&e.getString(t+4,20)==="http://ns.adobe.com/"}static headerLength(e,t){return e.getString(t+4,34)==="http://ns.adobe.com/xmp/extension/"?79:33}static findPosition(e,t){let r=super.findPosition(e,t);return r.multiSegment=r.extended=r.headerLength===79,r.multiSegment?(r.chunkCount=e.getUint8(t+72),r.chunkNumber=e.getUint8(t+76),e.getUint8(t+77)!==0&&r.chunkNumber++):(r.chunkCount=1/0,r.chunkNumber=-1),r}static handleMultiSegments(e){return e.map((t=>t.chunk.getString())).join("")}normalizeInput(e){return typeof e=="string"?e:Ie.from(e).getString()}parse(e=this.chunk){if(!this.localOptions.parse)return e;e=(function(n){let o={},a={};for(let l of bp)o[l]=[],a[l]=0;return n.replace(z3,((l,u,d)=>{if(u==="<"){let c=++a[d];return o[d].push(c),`${l}#${c}`}return`${l}#${o[d].pop()}`}))})(e);let t=wi.findAll(e,"rdf","Description");t.length===0&&t.push(new wi("rdf","Description",void 0,e));let r,s={};for(let n of t)for(let o of n.properties)r=N3(o.ns,s),mp(o,r);return(function(n){let o;for(let a in n)o=n[a]=nn(n[a]),o===void 0&&delete n[a];return nn(n)})(s)}assignToOutput(e,t){if(this.localOptions.parse)for(let[r,s]of Object.entries(t))switch(r){case"tiff":this.assignObjectToOutput(e,"ifd0",s);break;case"exif":this.assignObjectToOutput(e,"exif",s);break;case"xmlns":break;default:this.assignObjectToOutput(e,r,s)}else e.xmp=t}}j(Fo,"type","xmp"),j(Fo,"multiSegment",!0),we.set("xmp",Fo);class an{static findAll(e){return yp(e,/([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(an.unpackMatch)}static unpackMatch(e){let t=e[1],r=e[2],s=e[3].slice(1,-1);return s=vp(s),new an(t,r,s)}constructor(e,t,r){this.ns=e,this.name=t,this.value=r}serialize(){return this.value}}class wi{static findAll(e,t,r){if(t!==void 0||r!==void 0){t=t||"[\\w\\d-]+",r=r||"[\\w\\d-]+";var s=new RegExp(`<(${t}):(${r})(#\\d+)?((\\s+?[\\w\\d-:]+=("[^"]*"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)`,"gm")}else s=/<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;return yp(e,s).map(wi.unpackMatch)}static unpackMatch(e){let t=e[1],r=e[2],s=e[4],n=e[8];return new wi(t,r,s,n)}constructor(e,t,r,s){this.ns=e,this.name=t,this.attrString=r,this.innerXml=s,this.attrs=an.findAll(r),this.children=wi.findAll(s),this.value=this.children.length===0?vp(s):void 0,this.properties=[...this.attrs,...this.children]}get isPrimitive(){return this.value!==void 0&&this.attrs.length===0&&this.children.length===0}get isListContainer(){return this.children.length===1&&this.children[0].isList}get isList(){let{ns:e,name:t}=this;return e==="rdf"&&(t==="Seq"||t==="Bag"||t==="Alt")}get isListItem(){return this.ns==="rdf"&&this.name==="li"}serialize(){if(this.properties.length===0&&this.value===void 0)return;if(this.isPrimitive)return this.value;if(this.isListContainer)return this.children[0].serialize();if(this.isList)return L3(this.children.map(B3));if(this.isListItem&&this.children.length===1&&this.attrs.length===0)return this.children[0].serialize();let e={};for(let t of this.properties)mp(t,e);return this.value!==void 0&&(e.value=this.value),nn(e)}}function mp(i,e){let t=i.serialize();t!==void 0&&(e[i.name]=t)}var B3=i=>i.serialize(),L3=i=>i.length===1?i[0]:i,N3=(i,e)=>e[i]?e[i]:e[i]={};function yp(i,e){let t,r=[];if(!i)return r;for(;(t=e.exec(i))!==null;)r.push(t);return r}function vp(i){if((function(r){return r==null||r==="null"||r==="undefined"||r===""||r.trim()===""})(i))return;let e=Number(i);if(!Number.isNaN(e))return e;let t=i.toLowerCase();return t==="true"||t!=="false"&&i.trim()}const bp=["rdf:li","rdf:Seq","rdf:Bag","rdf:Alt","rdf:Description"],z3=new RegExp(`(<|\\/)(${bp.join("|")})`,"g");let xc=sn("fs",(i=>i.promises));xi.set("fs",class extends mn{async readWhole(){this.chunked=!1,this.fs=await xc;let i=await this.fs.readFile(this.input);this._swapBuffer(i)}async readChunked(){this.chunked=!0,this.fs=await xc,await this.open(),await this.readChunk(0,this.options.firstChunkSize)}async open(){this.fh===void 0&&(this.fh=await this.fs.open(this.input,"r"),this.size=(await this.fh.stat(this.input)).size)}async _readChunk(i,e){this.fh===void 0&&await this.open(),i+e>this.size&&(e=this.size-i);var t=this.subarray(i,e,!0);return await this.fh.read(t.dataView,0,e,i),t}async close(){if(this.fh){let i=this.fh;this.fh=void 0,await i.close()}}});xi.set("base64",class extends mn{constructor(...i){super(...i),this.input=this.input.replace(/^data:([^;]+);base64,/gim,""),this.size=this.input.length/4*3,this.input.endsWith("==")?this.size-=2:this.input.endsWith("=")&&(this.size-=1)}async _readChunk(i,e){let t,r,s=this.input;i===void 0?(i=0,t=0,r=0):(t=4*Math.floor(i/3),r=i-t/4*3),e===void 0&&(e=this.size);let n=i+e,o=t+4*Math.ceil(n/3);s=s.slice(t,o);let a=Math.min(e,this.size-i);if(tl){let l=el.from(s,"base64").slice(r,r+a);return this.set(l,i,!0)}{let l=this.subarray(i,a,!0),u=atob(s),d=l.toUint8();for(let c=0;c<a;c++)d[c]=u.charCodeAt(r+c);return l}}});class Ac extends gn{static canHandle(e,t){return t===18761||t===19789}extendOptions(e){let{ifd0:t,xmp:r,iptc:s,icc:n}=e;r.enabled&&t.deps.add(700),s.enabled&&t.deps.add(33723),n.enabled&&t.deps.add(34675),t.finalizeFilters()}async parse(){let{tiff:e,xmp:t,iptc:r,icc:s}=this.options;if(e.enabled||t.enabled||r.enabled||s.enabled){let n=Math.max(ha(this.options),this.options.chunkSize);await this.file.ensureChunk(0,n),this.createParser("tiff",this.file),this.parsers.tiff.parseHeader(),await this.parsers.tiff.parseIfd0Block(),this.adaptTiffPropAsSegment("xmp"),this.adaptTiffPropAsSegment("iptc"),this.adaptTiffPropAsSegment("icc")}}adaptTiffPropAsSegment(e){if(this.parsers.tiff[e]){let t=this.parsers.tiff[e];this.injectSegment(e,t)}}}j(Ac,"type","tiff"),Ci.set("tiff",Ac);let $3=sn("zlib");const j3=["ihdr","iccp","text","itxt","exif"];class Ic extends gn{constructor(...e){super(...e),j(this,"catchError",(t=>this.errors.push(t))),j(this,"metaChunks",[]),j(this,"unknownChunks",[])}static canHandle(e,t){return t===35152&&e.getUint32(0)===2303741511&&e.getUint32(4)===218765834}async parse(){let{file:e}=this;await this.findPngChunksInRange(8,e.byteLength),await this.readSegments(this.metaChunks),this.findIhdr(),this.parseTextChunks(),await this.findExif().catch(this.catchError),await this.findXmp().catch(this.catchError),await this.findIcc().catch(this.catchError)}async findPngChunksInRange(e,t){let{file:r}=this;for(;e<t;){let s=r.getUint32(e),n=r.getUint32(e+4),o=r.getString(e+4,4).toLowerCase(),a=s+4+4+4,l={type:o,offset:e,length:a,start:e+4+4,size:s,marker:n};j3.includes(o)?this.metaChunks.push(l):this.unknownChunks.push(l),e+=a}}parseTextChunks(){let e=this.metaChunks.filter((t=>t.type==="text"));for(let t of e){let[r,s]=this.file.getString(t.start,t.size).split("\0");this.injectKeyValToIhdr(r,s)}}injectKeyValToIhdr(e,t){let r=this.parsers.ihdr;r&&r.raw.set(e,t)}findIhdr(){let e=this.metaChunks.find((t=>t.type==="ihdr"));e&&this.options.ihdr.enabled!==!1&&this.createParser("ihdr",e.chunk)}async findExif(){let e=this.metaChunks.find((t=>t.type==="exif"));e&&this.injectSegment("tiff",e.chunk)}async findXmp(){let e=this.metaChunks.filter((t=>t.type==="itxt"));for(let t of e)t.chunk.getString(0,17)==="XML:com.adobe.xmp"&&this.injectSegment("xmp",t.chunk)}async findIcc(){let e=this.metaChunks.find((a=>a.type==="iccp"));if(!e)return;let{chunk:t}=e,r=t.getUint8Array(0,81),s=0;for(;s<80&&r[s]!==0;)s++;let n=s+2,o=t.getString(0,s);if(this.injectKeyValToIhdr("ProfileName",o),rn){let a=await $3,l=t.getUint8Array(n);l=a.inflateSync(l),this.injectSegment("icc",l)}}}j(Ic,"type","png"),Ci.set("png",Ic),be(Oe,"interop",[[1,"InteropIndex"],[2,"InteropVersion"],[4096,"RelatedImageFileFormat"],[4097,"RelatedImageWidth"],[4098,"RelatedImageHeight"]]),ba(Oe,"ifd0",[[11,"ProcessingSoftware"],[254,"SubfileType"],[255,"OldSubfileType"],[263,"Thresholding"],[264,"CellWidth"],[265,"CellLength"],[266,"FillOrder"],[269,"DocumentName"],[280,"MinSampleValue"],[281,"MaxSampleValue"],[285,"PageName"],[286,"XPosition"],[287,"YPosition"],[290,"GrayResponseUnit"],[297,"PageNumber"],[321,"HalftoneHints"],[322,"TileWidth"],[323,"TileLength"],[332,"InkSet"],[337,"TargetPrinter"],[18246,"Rating"],[18249,"RatingPercent"],[33550,"PixelScale"],[34264,"ModelTransform"],[34377,"PhotoshopSettings"],[50706,"DNGVersion"],[50707,"DNGBackwardVersion"],[50708,"UniqueCameraModel"],[50709,"LocalizedCameraModel"],[50736,"DNGLensInfo"],[50739,"ShadowScale"],[50740,"DNGPrivateData"],[33920,"IntergraphMatrix"],[33922,"ModelTiePoint"],[34118,"SEMInfo"],[34735,"GeoTiffDirectory"],[34736,"GeoTiffDoubleParams"],[34737,"GeoTiffAsciiParams"],[50341,"PrintIM"],[50721,"ColorMatrix1"],[50722,"ColorMatrix2"],[50723,"CameraCalibration1"],[50724,"CameraCalibration2"],[50725,"ReductionMatrix1"],[50726,"ReductionMatrix2"],[50727,"AnalogBalance"],[50728,"AsShotNeutral"],[50729,"AsShotWhiteXY"],[50730,"BaselineExposure"],[50731,"BaselineNoise"],[50732,"BaselineSharpness"],[50734,"LinearResponseLimit"],[50735,"CameraSerialNumber"],[50741,"MakerNoteSafety"],[50778,"CalibrationIlluminant1"],[50779,"CalibrationIlluminant2"],[50781,"RawDataUniqueID"],[50827,"OriginalRawFileName"],[50828,"OriginalRawFileData"],[50831,"AsShotICCProfile"],[50832,"AsShotPreProfileMatrix"],[50833,"CurrentICCProfile"],[50834,"CurrentPreProfileMatrix"],[50879,"ColorimetricReference"],[50885,"SRawType"],[50898,"PanasonicTitle"],[50899,"PanasonicTitle2"],[50931,"CameraCalibrationSig"],[50932,"ProfileCalibrationSig"],[50933,"ProfileIFD"],[50934,"AsShotProfileName"],[50936,"ProfileName"],[50937,"ProfileHueSatMapDims"],[50938,"ProfileHueSatMapData1"],[50939,"ProfileHueSatMapData2"],[50940,"ProfileToneCurve"],[50941,"ProfileEmbedPolicy"],[50942,"ProfileCopyright"],[50964,"ForwardMatrix1"],[50965,"ForwardMatrix2"],[50966,"PreviewApplicationName"],[50967,"PreviewApplicationVersion"],[50968,"PreviewSettingsName"],[50969,"PreviewSettingsDigest"],[50970,"PreviewColorSpace"],[50971,"PreviewDateTime"],[50972,"RawImageDigest"],[50973,"OriginalRawFileDigest"],[50981,"ProfileLookTableDims"],[50982,"ProfileLookTableData"],[51043,"TimeCodes"],[51044,"FrameRate"],[51058,"TStop"],[51081,"ReelName"],[51089,"OriginalDefaultFinalSize"],[51090,"OriginalBestQualitySize"],[51091,"OriginalDefaultCropSize"],[51105,"CameraLabel"],[51107,"ProfileHueSatMapEncoding"],[51108,"ProfileLookTableEncoding"],[51109,"BaselineExposureOffset"],[51110,"DefaultBlackRender"],[51111,"NewRawImageDigest"],[51112,"RawToPreviewGain"]]);let Oc=[[273,"StripOffsets"],[279,"StripByteCounts"],[288,"FreeOffsets"],[289,"FreeByteCounts"],[291,"GrayResponseCurve"],[292,"T4Options"],[293,"T6Options"],[300,"ColorResponseUnit"],[320,"ColorMap"],[324,"TileOffsets"],[325,"TileByteCounts"],[326,"BadFaxLines"],[327,"CleanFaxData"],[328,"ConsecutiveBadFaxLines"],[330,"SubIFD"],[333,"InkNames"],[334,"NumberofInks"],[336,"DotRange"],[338,"ExtraSamples"],[339,"SampleFormat"],[340,"SMinSampleValue"],[341,"SMaxSampleValue"],[342,"TransferRange"],[343,"ClipPath"],[344,"XClipPathUnits"],[345,"YClipPathUnits"],[346,"Indexed"],[347,"JPEGTables"],[351,"OPIProxy"],[400,"GlobalParametersIFD"],[401,"ProfileType"],[402,"FaxProfile"],[403,"CodingMethods"],[404,"VersionYear"],[405,"ModeNumber"],[433,"Decode"],[434,"DefaultImageColor"],[435,"T82Options"],[437,"JPEGTables"],[512,"JPEGProc"],[515,"JPEGRestartInterval"],[517,"JPEGLosslessPredictors"],[518,"JPEGPointTransforms"],[519,"JPEGQTables"],[520,"JPEGDCTables"],[521,"JPEGACTables"],[559,"StripRowCounts"],[999,"USPTOMiscellaneous"],[18247,"XP_DIP_XML"],[18248,"StitchInfo"],[28672,"SonyRawFileType"],[28688,"SonyToneCurve"],[28721,"VignettingCorrection"],[28722,"VignettingCorrParams"],[28724,"ChromaticAberrationCorrection"],[28725,"ChromaticAberrationCorrParams"],[28726,"DistortionCorrection"],[28727,"DistortionCorrParams"],[29895,"SonyCropTopLeft"],[29896,"SonyCropSize"],[32781,"ImageID"],[32931,"WangTag1"],[32932,"WangAnnotation"],[32933,"WangTag3"],[32934,"WangTag4"],[32953,"ImageReferencePoints"],[32954,"RegionXformTackPoint"],[32955,"WarpQuadrilateral"],[32956,"AffineTransformMat"],[32995,"Matteing"],[32996,"DataType"],[32997,"ImageDepth"],[32998,"TileDepth"],[33300,"ImageFullWidth"],[33301,"ImageFullHeight"],[33302,"TextureFormat"],[33303,"WrapModes"],[33304,"FovCot"],[33305,"MatrixWorldToScreen"],[33306,"MatrixWorldToCamera"],[33405,"Model2"],[33421,"CFARepeatPatternDim"],[33422,"CFAPattern2"],[33423,"BatteryLevel"],[33424,"KodakIFD"],[33445,"MDFileTag"],[33446,"MDScalePixel"],[33447,"MDColorTable"],[33448,"MDLabName"],[33449,"MDSampleInfo"],[33450,"MDPrepDate"],[33451,"MDPrepTime"],[33452,"MDFileUnits"],[33589,"AdventScale"],[33590,"AdventRevision"],[33628,"UIC1Tag"],[33629,"UIC2Tag"],[33630,"UIC3Tag"],[33631,"UIC4Tag"],[33918,"IntergraphPacketData"],[33919,"IntergraphFlagRegisters"],[33921,"INGRReserved"],[34016,"Site"],[34017,"ColorSequence"],[34018,"IT8Header"],[34019,"RasterPadding"],[34020,"BitsPerRunLength"],[34021,"BitsPerExtendedRunLength"],[34022,"ColorTable"],[34023,"ImageColorIndicator"],[34024,"BackgroundColorIndicator"],[34025,"ImageColorValue"],[34026,"BackgroundColorValue"],[34027,"PixelIntensityRange"],[34028,"TransparencyIndicator"],[34029,"ColorCharacterization"],[34030,"HCUsage"],[34031,"TrapIndicator"],[34032,"CMYKEquivalent"],[34152,"AFCP_IPTC"],[34232,"PixelMagicJBIGOptions"],[34263,"JPLCartoIFD"],[34306,"WB_GRGBLevels"],[34310,"LeafData"],[34687,"TIFF_FXExtensions"],[34688,"MultiProfiles"],[34689,"SharedData"],[34690,"T88Options"],[34732,"ImageLayer"],[34750,"JBIGOptions"],[34856,"Opto-ElectricConvFactor"],[34857,"Interlace"],[34908,"FaxRecvParams"],[34909,"FaxSubAddress"],[34910,"FaxRecvTime"],[34929,"FedexEDR"],[34954,"LeafSubIFD"],[37387,"FlashEnergy"],[37388,"SpatialFrequencyResponse"],[37389,"Noise"],[37390,"FocalPlaneXResolution"],[37391,"FocalPlaneYResolution"],[37392,"FocalPlaneResolutionUnit"],[37397,"ExposureIndex"],[37398,"TIFF-EPStandardID"],[37399,"SensingMethod"],[37434,"CIP3DataFile"],[37435,"CIP3Sheet"],[37436,"CIP3Side"],[37439,"StoNits"],[37679,"MSDocumentText"],[37680,"MSPropertySetStorage"],[37681,"MSDocumentTextPosition"],[37724,"ImageSourceData"],[40965,"InteropIFD"],[40976,"SamsungRawPointersOffset"],[40977,"SamsungRawPointersLength"],[41217,"SamsungRawByteOrder"],[41218,"SamsungRawUnknown"],[41484,"SpatialFrequencyResponse"],[41485,"Noise"],[41489,"ImageNumber"],[41490,"SecurityClassification"],[41491,"ImageHistory"],[41494,"TIFF-EPStandardID"],[41995,"DeviceSettingDescription"],[42112,"GDALMetadata"],[42113,"GDALNoData"],[44992,"ExpandSoftware"],[44993,"ExpandLens"],[44994,"ExpandFilm"],[44995,"ExpandFilterLens"],[44996,"ExpandScanner"],[44997,"ExpandFlashLamp"],[46275,"HasselbladRawImage"],[48129,"PixelFormat"],[48130,"Transformation"],[48131,"Uncompressed"],[48132,"ImageType"],[48256,"ImageWidth"],[48257,"ImageHeight"],[48258,"WidthResolution"],[48259,"HeightResolution"],[48320,"ImageOffset"],[48321,"ImageByteCount"],[48322,"AlphaOffset"],[48323,"AlphaByteCount"],[48324,"ImageDataDiscard"],[48325,"AlphaDataDiscard"],[50215,"OceScanjobDesc"],[50216,"OceApplicationSelector"],[50217,"OceIDNumber"],[50218,"OceImageLogic"],[50255,"Annotations"],[50459,"HasselbladExif"],[50547,"OriginalFileName"],[50560,"USPTOOriginalContentType"],[50656,"CR2CFAPattern"],[50710,"CFAPlaneColor"],[50711,"CFALayout"],[50712,"LinearizationTable"],[50713,"BlackLevelRepeatDim"],[50714,"BlackLevel"],[50715,"BlackLevelDeltaH"],[50716,"BlackLevelDeltaV"],[50717,"WhiteLevel"],[50718,"DefaultScale"],[50719,"DefaultCropOrigin"],[50720,"DefaultCropSize"],[50733,"BayerGreenSplit"],[50737,"ChromaBlurRadius"],[50738,"AntiAliasStrength"],[50752,"RawImageSegmentation"],[50780,"BestQualityScale"],[50784,"AliasLayerMetadata"],[50829,"ActiveArea"],[50830,"MaskedAreas"],[50935,"NoiseReductionApplied"],[50974,"SubTileBlockSize"],[50975,"RowInterleaveFactor"],[51008,"OpcodeList1"],[51009,"OpcodeList2"],[51022,"OpcodeList3"],[51041,"NoiseProfile"],[51114,"CacheVersion"],[51125,"DefaultUserCrop"],[51157,"NikonNEFInfo"],[65024,"KdcIFD"]];ba(Oe,"ifd0",Oc),ba(Oe,"exif",Oc),be(si,"gps",[[23,{M:"Magnetic North",T:"True North"}],[25,{K:"Kilometers",M:"Miles",N:"Nautical Miles"}]]);class Co extends et{static canHandle(e,t){return e.getUint8(t+1)===224&&e.getUint32(t+4)===1246120262&&e.getUint8(t+8)===0}parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint16(0)],[2,this.chunk.getUint8(2)],[3,this.chunk.getUint16(3)],[5,this.chunk.getUint16(5)],[7,this.chunk.getUint8(7)],[8,this.chunk.getUint8(8)]])}}j(Co,"type","jfif"),j(Co,"headerLength",9),we.set("jfif",Co),be(Oe,"jfif",[[0,"JFIFVersion"],[2,"ResolutionUnit"],[3,"XResolution"],[5,"YResolution"],[7,"ThumbnailWidth"],[8,"ThumbnailHeight"]]);class kc extends et{parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint32(0)],[4,this.chunk.getUint32(4)],[8,this.chunk.getUint8(8)],[9,this.chunk.getUint8(9)],[10,this.chunk.getUint8(10)],[11,this.chunk.getUint8(11)],[12,this.chunk.getUint8(12)],...Array.from(this.raw)])}}j(kc,"type","ihdr"),we.set("ihdr",kc),be(Oe,"ihdr",[[0,"ImageWidth"],[4,"ImageHeight"],[8,"BitDepth"],[9,"ColorType"],[10,"Compression"],[11,"Filter"],[12,"Interlace"]]),be(si,"ihdr",[[9,{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha",DEFAULT:"Unknown"}],[10,{0:"Deflate/Inflate",DEFAULT:"Unknown"}],[11,{0:"Adaptive",DEFAULT:"Unknown"}],[12,{0:"Noninterlaced",1:"Adam7 Interlace",DEFAULT:"Unknown"}]]);class zs extends et{static canHandle(e,t){return e.getUint8(t+1)===226&&e.getUint32(t+4)===1229144927}static findPosition(e,t){let r=super.findPosition(e,t);return r.chunkNumber=e.getUint8(t+16),r.chunkCount=e.getUint8(t+17),r.multiSegment=r.chunkCount>1,r}static handleMultiSegments(e){return(function(t){let r=(function(s){let n=s[0].constructor,o=0;for(let u of s)o+=u.length;let a=new n(o),l=0;for(let u of s)a.set(u,l),l+=u.length;return a})(t.map((s=>s.chunk.toUint8())));return new Ie(r)})(e)}parse(){return this.raw=new Map,this.parseHeader(),this.parseTags(),this.translate(),this.output}parseHeader(){let{raw:e}=this;this.chunk.byteLength<84&&de("ICC header is too short");for(let[t,r]of Object.entries(H3)){t=parseInt(t,10);let s=r(this.chunk,t);s!=="\0\0\0\0"&&e.set(t,s)}}parseTags(){let e,t,r,s,n,{raw:o}=this,a=this.chunk.getUint32(128),l=132,u=this.chunk.byteLength;for(;a--;){if(e=this.chunk.getString(l,4),t=this.chunk.getUint32(l+4),r=this.chunk.getUint32(l+8),s=this.chunk.getString(t,4),t+r>u)return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");n=this.parseTag(s,t,r),n!==void 0&&n!=="\0\0\0\0"&&o.set(e,n),l+=12}}parseTag(e,t,r){switch(e){case"desc":return this.parseDesc(t);case"mluc":return this.parseMluc(t);case"text":return this.parseText(t,r);case"sig ":return this.parseSig(t)}if(!(t+r>this.chunk.byteLength))return this.chunk.getUint8Array(t,r)}parseDesc(e){let t=this.chunk.getUint32(e+8)-1;return Jt(this.chunk.getString(e+12,t))}parseText(e,t){return Jt(this.chunk.getString(e+8,t-8))}parseSig(e){return Jt(this.chunk.getString(e+8,4))}parseMluc(e){let{chunk:t}=this,r=t.getUint32(e+8),s=t.getUint32(e+12),n=e+16,o=[];for(let a=0;a<r;a++){let l=t.getString(n+0,2),u=t.getString(n+2,2),d=t.getUint32(n+4),c=t.getUint32(n+8)+e,m=Jt(t.getUnicodeString(c,d));o.push({lang:l,country:u,text:m}),n+=s}return r===1?o[0].text:o}translateValue(e,t){return typeof e=="string"?t[e]||t[e.toLowerCase()]||e:t[e]||e}}j(zs,"type","icc"),j(zs,"multiSegment",!0),j(zs,"headerLength",18);const H3={4:yt,8:function(i,e){return[i.getUint8(e),i.getUint8(e+1)>>4,i.getUint8(e+1)%16].map((t=>t.toString(10))).join(".")},12:yt,16:yt,20:yt,24:function(i,e){const t=i.getUint16(e),r=i.getUint16(e+2)-1,s=i.getUint16(e+4),n=i.getUint16(e+6),o=i.getUint16(e+8),a=i.getUint16(e+10);return new Date(Date.UTC(t,r,s,n,o,a))},36:yt,40:yt,48:yt,52:yt,64:(i,e)=>i.getUint32(e),80:yt};function yt(i,e){return Jt(i.getString(e,4))}we.set("icc",zs),be(Oe,"icc",[[4,"ProfileCMMType"],[8,"ProfileVersion"],[12,"ProfileClass"],[16,"ColorSpaceData"],[20,"ProfileConnectionSpace"],[24,"ProfileDateTime"],[36,"ProfileFileSignature"],[40,"PrimaryPlatform"],[44,"CMMFlags"],[48,"DeviceManufacturer"],[52,"DeviceModel"],[56,"DeviceAttributes"],[64,"RenderingIntent"],[68,"ConnectionSpaceIlluminant"],[80,"ProfileCreator"],[84,"ProfileID"],["Header","ProfileHeader"],["MS00","WCSProfiles"],["bTRC","BlueTRC"],["bXYZ","BlueMatrixColumn"],["bfd","UCRBG"],["bkpt","MediaBlackPoint"],["calt","CalibrationDateTime"],["chad","ChromaticAdaptation"],["chrm","Chromaticity"],["ciis","ColorimetricIntentImageState"],["clot","ColorantTableOut"],["clro","ColorantOrder"],["clrt","ColorantTable"],["cprt","ProfileCopyright"],["crdi","CRDInfo"],["desc","ProfileDescription"],["devs","DeviceSettings"],["dmdd","DeviceModelDesc"],["dmnd","DeviceMfgDesc"],["dscm","ProfileDescriptionML"],["fpce","FocalPlaneColorimetryEstimates"],["gTRC","GreenTRC"],["gXYZ","GreenMatrixColumn"],["gamt","Gamut"],["kTRC","GrayTRC"],["lumi","Luminance"],["meas","Measurement"],["meta","Metadata"],["mmod","MakeAndModel"],["ncl2","NamedColor2"],["ncol","NamedColor"],["ndin","NativeDisplayInfo"],["pre0","Preview0"],["pre1","Preview1"],["pre2","Preview2"],["ps2i","PS2RenderingIntent"],["ps2s","PostScript2CSA"],["psd0","PostScript2CRD0"],["psd1","PostScript2CRD1"],["psd2","PostScript2CRD2"],["psd3","PostScript2CRD3"],["pseq","ProfileSequenceDesc"],["psid","ProfileSequenceIdentifier"],["psvm","PS2CRDVMSize"],["rTRC","RedTRC"],["rXYZ","RedMatrixColumn"],["resp","OutputResponse"],["rhoc","ReflectionHardcopyOrigColorimetry"],["rig0","PerceptualRenderingIntentGamut"],["rig2","SaturationRenderingIntentGamut"],["rpoc","ReflectionPrintOutputColorimetry"],["sape","SceneAppearanceEstimates"],["scoe","SceneColorimetryEstimates"],["scrd","ScreeningDesc"],["scrn","Screening"],["targ","CharTarget"],["tech","Technology"],["vcgt","VideoCardGamma"],["view","ViewingConditions"],["vued","ViewingCondDesc"],["wtpt","MediaWhitePoint"]]);const vs={"4d2p":"Erdt Systems",AAMA:"Aamazing Technologies",ACER:"Acer",ACLT:"Acolyte Color Research",ACTI:"Actix Sytems",ADAR:"Adara Technology",ADBE:"Adobe",ADI:"ADI Systems",AGFA:"Agfa Graphics",ALMD:"Alps Electric",ALPS:"Alps Electric",ALWN:"Alwan Color Expertise",AMTI:"Amiable Technologies",AOC:"AOC International",APAG:"Apago",APPL:"Apple Computer",AST:"AST","AT&T":"AT&T",BAEL:"BARBIERI electronic",BRCO:"Barco NV",BRKP:"Breakpoint",BROT:"Brother",BULL:"Bull",BUS:"Bus Computer Systems","C-IT":"C-Itoh",CAMR:"Intel",CANO:"Canon",CARR:"Carroll Touch",CASI:"Casio",CBUS:"Colorbus PL",CEL:"Crossfield",CELx:"Crossfield",CGS:"CGS Publishing Technologies International",CHM:"Rochester Robotics",CIGL:"Colour Imaging Group, London",CITI:"Citizen",CL00:"Candela",CLIQ:"Color IQ",CMCO:"Chromaco",CMiX:"CHROMiX",COLO:"Colorgraphic Communications",COMP:"Compaq",COMp:"Compeq/Focus Technology",CONR:"Conrac Display Products",CORD:"Cordata Technologies",CPQ:"Compaq",CPRO:"ColorPro",CRN:"Cornerstone",CTX:"CTX International",CVIS:"ColorVision",CWC:"Fujitsu Laboratories",DARI:"Darius Technology",DATA:"Dataproducts",DCP:"Dry Creek Photo",DCRC:"Digital Contents Resource Center, Chung-Ang University",DELL:"Dell Computer",DIC:"Dainippon Ink and Chemicals",DICO:"Diconix",DIGI:"Digital","DL&C":"Digital Light & Color",DPLG:"Doppelganger",DS:"Dainippon Screen",DSOL:"DOOSOL",DUPN:"DuPont",EPSO:"Epson",ESKO:"Esko-Graphics",ETRI:"Electronics and Telecommunications Research Institute",EVER:"Everex Systems",EXAC:"ExactCODE",Eizo:"Eizo",FALC:"Falco Data Products",FF:"Fuji Photo Film",FFEI:"FujiFilm Electronic Imaging",FNRD:"Fnord Software",FORA:"Fora",FORE:"Forefront Technology",FP:"Fujitsu",FPA:"WayTech Development",FUJI:"Fujitsu",FX:"Fuji Xerox",GCC:"GCC Technologies",GGSL:"Global Graphics Software",GMB:"Gretagmacbeth",GMG:"GMG",GOLD:"GoldStar Technology",GOOG:"Google",GPRT:"Giantprint",GTMB:"Gretagmacbeth",GVC:"WayTech Development",GW2K:"Sony",HCI:"HCI",HDM:"Heidelberger Druckmaschinen",HERM:"Hermes",HITA:"Hitachi America",HP:"Hewlett-Packard",HTC:"Hitachi",HiTi:"HiTi Digital",IBM:"IBM",IDNT:"Scitex",IEC:"Hewlett-Packard",IIYA:"Iiyama North America",IKEG:"Ikegami Electronics",IMAG:"Image Systems",IMI:"Ingram Micro",INTC:"Intel",INTL:"N/A (INTL)",INTR:"Intra Electronics",IOCO:"Iocomm International Technology",IPS:"InfoPrint Solutions Company",IRIS:"Scitex",ISL:"Ichikawa Soft Laboratory",ITNL:"N/A (ITNL)",IVM:"IVM",IWAT:"Iwatsu Electric",Idnt:"Scitex",Inca:"Inca Digital Printers",Iris:"Scitex",JPEG:"Joint Photographic Experts Group",JSFT:"Jetsoft Development",JVC:"JVC Information Products",KART:"Scitex",KFC:"KFC Computek Components",KLH:"KLH Computers",KMHD:"Konica Minolta",KNCA:"Konica",KODA:"Kodak",KYOC:"Kyocera",Kart:"Scitex",LCAG:"Leica",LCCD:"Leeds Colour",LDAK:"Left Dakota",LEAD:"Leading Technology",LEXM:"Lexmark International",LINK:"Link Computer",LINO:"Linotronic",LITE:"Lite-On",Leaf:"Leaf",Lino:"Linotronic",MAGC:"Mag Computronic",MAGI:"MAG Innovision",MANN:"Mannesmann",MICN:"Micron Technology",MICR:"Microtek",MICV:"Microvitec",MINO:"Minolta",MITS:"Mitsubishi Electronics America",MITs:"Mitsuba",MNLT:"Minolta",MODG:"Modgraph",MONI:"Monitronix",MONS:"Monaco Systems",MORS:"Morse Technology",MOTI:"Motive Systems",MSFT:"Microsoft",MUTO:"MUTOH INDUSTRIES",Mits:"Mitsubishi Electric",NANA:"NANAO",NEC:"NEC",NEXP:"NexPress Solutions",NISS:"Nissei Sangyo America",NKON:"Nikon",NONE:"none",OCE:"Oce Technologies",OCEC:"OceColor",OKI:"Oki",OKID:"Okidata",OKIP:"Okidata",OLIV:"Olivetti",OLYM:"Olympus",ONYX:"Onyx Graphics",OPTI:"Optiquest",PACK:"Packard Bell",PANA:"Matsushita Electric Industrial",PANT:"Pantone",PBN:"Packard Bell",PFU:"PFU",PHIL:"Philips Consumer Electronics",PNTX:"HOYA",POne:"Phase One A/S",PREM:"Premier Computer Innovations",PRIN:"Princeton Graphic Systems",PRIP:"Princeton Publishing Labs",QLUX:"Hong Kong",QMS:"QMS",QPCD:"QPcard AB",QUAD:"QuadLaser",QUME:"Qume",RADI:"Radius",RDDx:"Integrated Color Solutions",RDG:"Roland DG",REDM:"REDMS Group",RELI:"Relisys",RGMS:"Rolf Gierling Multitools",RICO:"Ricoh",RNLD:"Edmund Ronald",ROYA:"Royal",RPC:"Ricoh Printing Systems",RTL:"Royal Information Electronics",SAMP:"Sampo",SAMS:"Samsung",SANT:"Jaime Santana Pomares",SCIT:"Scitex",SCRN:"Dainippon Screen",SDP:"Scitex",SEC:"Samsung",SEIK:"Seiko Instruments",SEIk:"Seikosha",SGUY:"ScanGuy.com",SHAR:"Sharp Laboratories",SICC:"International Color Consortium",SONY:"Sony",SPCL:"SpectraCal",STAR:"Star",STC:"Sampo Technology",Scit:"Scitex",Sdp:"Scitex",Sony:"Sony",TALO:"Talon Technology",TAND:"Tandy",TATU:"Tatung",TAXA:"TAXAN America",TDS:"Tokyo Denshi Sekei",TECO:"TECO Information Systems",TEGR:"Tegra",TEKT:"Tektronix",TI:"Texas Instruments",TMKR:"TypeMaker",TOSB:"Toshiba",TOSH:"Toshiba",TOTK:"TOTOKU ELECTRIC",TRIU:"Triumph",TSBT:"Toshiba",TTX:"TTX Computer Products",TVM:"TVM Professional Monitor",TW:"TW Casper",ULSX:"Ulead Systems",UNIS:"Unisys",UTZF:"Utz Fehlau & Sohn",VARI:"Varityper",VIEW:"Viewsonic",VISL:"Visual communication",VIVO:"Vivo Mobile Communication",WANG:"Wang",WLBR:"Wilbur Imaging",WTG2:"Ware To Go",WYSE:"WYSE Technology",XERX:"Xerox",XRIT:"X-Rite",ZRAN:"Zoran",Zebr:"Zebra Technologies",appl:"Apple Computer",bICC:"basICColor",berg:"bergdesign",ceyd:"Integrated Color Solutions",clsp:"MacDermid ColorSpan",ds:"Dainippon Screen",dupn:"DuPont",ffei:"FujiFilm Electronic Imaging",flux:"FluxData",iris:"Scitex",kart:"Scitex",lcms:"Little CMS",lino:"Linotronic",none:"none",ob4d:"Erdt Systems",obic:"Medigraph",quby:"Qubyx Sarl",scit:"Scitex",scrn:"Dainippon Screen",sdp:"Scitex",siwi:"SIWI GRAFIKA",yxym:"YxyMaster"},Rc={scnr:"Scanner",mntr:"Monitor",prtr:"Printer",link:"Device Link",abst:"Abstract",spac:"Color Space Conversion Profile",nmcl:"Named Color",cenc:"ColorEncodingSpace profile",mid:"MultiplexIdentification profile",mlnk:"MultiplexLink profile",mvis:"MultiplexVisualization profile",nkpf:"Nikon Input Device Profile (NON-STANDARD!)"};be(si,"icc",[[4,vs],[12,Rc],[40,Object.assign({},vs,Rc)],[48,vs],[80,vs],[64,{0:"Perceptual",1:"Relative Colorimetric",2:"Saturation",3:"Absolute Colorimetric"}],["tech",{amd:"Active Matrix Display",crt:"Cathode Ray Tube Display",kpcd:"Photo CD",pmd:"Passive Matrix Display",dcam:"Digital Camera",dcpj:"Digital Cinema Projector",dmpc:"Digital Motion Picture Camera",dsub:"Dye Sublimation Printer",epho:"Electrophotographic Printer",esta:"Electrostatic Printer",flex:"Flexography",fprn:"Film Writer",fscn:"Film Scanner",grav:"Gravure",ijet:"Ink Jet Printer",imgs:"Photo Image Setter",mpfr:"Motion Picture Film Recorder",mpfs:"Motion Picture Film Scanner",offs:"Offset Lithography",pjtv:"Projection Television",rpho:"Photographic Paper Printer",rscn:"Reflective Scanner",silk:"Silkscreen",twax:"Thermal Wax Printer",vidc:"Video Camera",vidm:"Video Monitor"}]]);class bs extends et{static canHandle(e,t,r){return e.getUint8(t+1)===237&&e.getString(t+4,9)==="Photoshop"&&this.containsIptc8bim(e,t,r)!==void 0}static headerLength(e,t,r){let s,n=this.containsIptc8bim(e,t,r);if(n!==void 0)return s=e.getUint8(t+n+7),s%2!=0&&(s+=1),s===0&&(s=4),n+8+s}static containsIptc8bim(e,t,r){for(let s=0;s<r;s++)if(this.isIptcSegmentHead(e,t+s))return s}static isIptcSegmentHead(e,t){return e.getUint8(t)===56&&e.getUint32(t)===943868237&&e.getUint16(t+4)===1028}parse(){let{raw:e}=this,t=this.chunk.byteLength-1,r=!1;for(let s=0;s<t;s++)if(this.chunk.getUint8(s)===28&&this.chunk.getUint8(s+1)===2){r=!0;let n=this.chunk.getUint16(s+3),o=this.chunk.getUint8(s+2),a=this.chunk.getLatin1String(s+5,n);e.set(o,this.pluralizeValue(e.get(o),a)),s+=4+n}else if(r)break;return this.translate(),this.output}pluralizeValue(e,t){return e!==void 0?e instanceof Array?(e.push(t),e):[e,t]:t}}j(bs,"type","iptc"),j(bs,"translateValues",!1),j(bs,"reviveValues",!1),we.set("iptc",bs),be(Oe,"iptc",[[0,"ApplicationRecordVersion"],[3,"ObjectTypeReference"],[4,"ObjectAttributeReference"],[5,"ObjectName"],[7,"EditStatus"],[8,"EditorialUpdate"],[10,"Urgency"],[12,"SubjectReference"],[15,"Category"],[20,"SupplementalCategories"],[22,"FixtureIdentifier"],[25,"Keywords"],[26,"ContentLocationCode"],[27,"ContentLocationName"],[30,"ReleaseDate"],[35,"ReleaseTime"],[37,"ExpirationDate"],[38,"ExpirationTime"],[40,"SpecialInstructions"],[42,"ActionAdvised"],[45,"ReferenceService"],[47,"ReferenceDate"],[50,"ReferenceNumber"],[55,"DateCreated"],[60,"TimeCreated"],[62,"DigitalCreationDate"],[63,"DigitalCreationTime"],[65,"OriginatingProgram"],[70,"ProgramVersion"],[75,"ObjectCycle"],[80,"Byline"],[85,"BylineTitle"],[90,"City"],[92,"Sublocation"],[95,"State"],[100,"CountryCode"],[101,"Country"],[103,"OriginalTransmissionReference"],[105,"Headline"],[110,"Credit"],[115,"Source"],[116,"CopyrightNotice"],[118,"Contact"],[120,"Caption"],[121,"LocalCaption"],[122,"Writer"],[125,"RasterizedCaption"],[130,"ImageType"],[131,"ImageOrientation"],[135,"LanguageIdentifier"],[150,"AudioType"],[151,"AudioSamplingRate"],[152,"AudioSamplingResolution"],[153,"AudioDuration"],[154,"AudioOutcue"],[184,"JobID"],[185,"MasterDocumentID"],[186,"ShortDocumentID"],[187,"UniqueDocumentID"],[188,"OwnerID"],[200,"ObjectPreviewFileFormat"],[201,"ObjectPreviewFileVersion"],[202,"ObjectPreviewData"],[221,"Prefs"],[225,"ClassifyState"],[228,"SimilarityIndex"],[230,"DocumentNotes"],[231,"DocumentHistory"],[232,"ExifCameraInfo"],[255,"CatalogSets"]]),be(si,"iptc",[[10,{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"}],[75,{a:"Morning",b:"Both Morning and Evening",p:"Evening"}],[131,{L:"Landscape",P:"Portrait",S:"Square"}]]);const ws={zip:qp,gz:wn,tgz:wn,deflate:wn};class q3 extends he{constructor(e,t){const r={};super(e,{...r,...t}),this.id=this.opts.id||"PrepareUpload",this.type="progressindicator",this.i18nInit()}setHashFileName=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{data:s}=r,n=1024*1024*5,a=await s.slice(0,n).text(),l=new y3;l.append(a);const u=l.end(),d=Zt(r),c=`${u}${d?`.${d}`:""}`;this.uppy.setFileState(t,{hashFileName:c})}};setMetaData=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{data:{webkitRelativePath:s,relativePath:n,name:o},hashFileName:a,size:l}=r,u=n||s||o||a;this.uppy.setFileMeta(t,{relativePath:u,name:u})}};preventXssAttack=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{name:s,meta:n}=this.uppy.getFile(t),o=oi.sanitize(s);if(s!==o){const l=Zt(r),u=o.endsWith(`.${l}`)?o:`${o}.${l}`;this.uppy.setFileState(t,{name:u,meta:{...n,name:u,filename:u}})}if(await ap(r)){const{data:l,name:u,type:d}=this.uppy.getFile(t),c=await l.text(),m=new Set;new DOMParser().parseFromString(c,"image/svg+xml").querySelectorAll("[id]").forEach(P=>m.add(P.id)),oi.addHook("uponSanitizeElement",(P,b)=>{if(b.tagName==="use"){const y=P.getAttribute("xlink:href")||P.getAttribute("href");if(y&&y.startsWith("#")){const f=y.substring(1);m.has(f)&&(b.allowedTags.use=!0,b.forceKeepNode=!0)}}}),oi.addHook("uponSanitizeAttribute",(P,b)=>{if(b.attrName==="xlink:href"&&b.attrValue){if(b.attrValue.startsWith("#")){const y=b.attrValue.substring(1);if(m.has(y)){b.forceKeepAttr=!0;return}}b.keepAttr=!1}["width","height"].includes(b.attrName)&&b.attrValue==="100%"&&(b.forceKeepAttr=!0),b.attrName==="style"&&b.attrValue==="overflow:visible"&&(b.forceKeepAttr=!0)});const T=oi.sanitize(c,{USE_PROFILES:{svg:!0,svgFilters:!0},ALLOWED_TAGS:["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","use","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop"],ALLOWED_ATTR:["d","points","x","y","width","height","r","cx","cy","rx","ry","x1","y1","x2","y2","transform","fill","stroke","stroke-width","viewBox","xmlns","xmlns:xlink","xml:space","style","id","class","offset","stop-color","stop-opacity","clip-path","mask","fill-opacity","stroke-opacity","gradientTransform","gradientUnits","xlink:href"],FORBID_TAGS:["a","script","iframe","image","foreignObject"],FORBID_ATTR:["href","onclick","onload","onerror"]});if(oi.removeHook("uponSanitizeElement"),oi.removeHook("uponSanitizeAttribute"),c!==T){const P=new Blob([T],{type:d}),b=Ms(P,u);this.uppy.setFileState(t,{...this.uppy.getFile(t),data:b,preview:ar(b)}),console.info("clean svg file xss attack",{name:u,originalFile:r.data.text(),cleanFile:T})}}}};preventZipBombAttack=async e=>{const{id:t}=e,r=this.uppy.getFile(t);try{if(r&&ws[r.extension]){const{data:s}=r,n=ws[r.extension](new Uint8Array(await s.arrayBuffer())),o=(l,u,d=0)=>Object.entries(l instanceof Uint8Array?{[u||r.name]:l}:l).reduce((c,[m,w])=>{if(!w||w.byteLength===0)return console.warn("Invalid or empty item in unzipped content",{name:m,item:w}),c;const F=c+w.byteLength;if(d>=5||F>r.size*100)throw console.error("Zip bomb detected, please check your file",{depth:d,baseAcc:F,fileSize:r.size}),new Error("Zip bomb detected, please check your file");const T=Fi(Ct(m));if(ws[T]){const P=ws[T](w);return F+o(P,m,d+1)}return F},0);if(o(n)>r.size*100)throw new Error("Zip bomb detected, please check your file")}}catch(s){if(s.message.includes("Zip bomb detected"))throw s}};validateImagesRespectCropperOptions=async()=>this.uppy.getFiles().reduce(async(e,t)=>{await e;const{id:r}=t;let s=this.uppy.getFile(r);if(s.isRemote&&(await this.tryDownloadRemoteFile(s),s=this.uppy.getFile(r)),!this.opts.cropperOptions?.aspectRatio||!s?.type?.includes("image")||s.type?.includes("image/svg"))return Promise.resolve();const{aspectRatio:n}=this.opts.cropperOptions,o=this.uppy.getPlugin("ImageEditor"),a=document.querySelector(`[src="${s.preview}"]`)||document.getElementById("uppy_"+r).querySelector("img"),l=a?.naturalWidth,u=a?.naturalHeight,d=Number(l/u).toFixed(2),c=Number(n).toFixed(2);if(d===c)return Promise.resolve();this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("editorLoading")}),o.parent.openFileEditor(s);const w=this.i18n("aspectRatioMessage",{imageAspectRatio:d,aspectRatio:c});return this.uppy.info({message:w,details:w}),new Promise((F,T)=>{this.uppy.once("file-editor:complete",()=>{setTimeout(()=>{F()},200)}),this.uppy.once("file-editor:cancel",()=>{})})},Promise.resolve());checkImageOrientation=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r?.type?.startsWith("image/"))try{if(!(await k3(r.data).catch(()=>({deg:0}))).deg)return;const n=r.data.size*.98,o=await new Promise((T,P)=>{const b=new Image;let y=URL.createObjectURL(r.data);b.src=y,b.onload=()=>{URL.revokeObjectURL(y),y=null,T(b)},b.onerror=f=>{y&&(URL.revokeObjectURL(y),y=null),P(new Error(`Image load failed: ${f.message}`))}}),a=o.width/o.height;let l=Math.sqrt(n*a),u=l/a;const d=8096;if(l>d||u>d){const T=d/Math.max(l,u);l*=T,u*=T}const c=document.createElement("canvas");c.width=l,c.height=u;const m=c.getContext("2d",{willReadFrequently:!0,alpha:r.type==="image/png"});m.imageSmoothingEnabled=!0,m.imageSmoothingQuality="high",m.translate(c.width/2,c.height/2),m.drawImage(o,-l/2,-u/2,l,u);const w=1,F=await new Promise(T=>{c.toBlob(T,r.type,w)});this.uppy.setFileState(t,{data:F,size:F.size})}catch(s){console.error("Image rotation processing failed:",s);return}};prepareUploadWrapper=async e=>{await this.tryDownloadRemoteFile(e),await this.checkImageOrientation(e),await this.getPreviewFromData(e),await this.setHashFileName(e),this.opts.disableXssAttack||await this.preventXssAttack(e),await this.preventZipBombAttack(e),await this.setMetaData(e)};tryDownloadRemoteFile=async e=>{const{type:t,name:r,preview:s,source:n,isRemote:o,isDownloading:a,id:l,isLoading:u,remote:d,meta:c,errorCount:m=0}=e,w=!u&&o,F=`uploader:${l}:downloaded`,T=Zt(e),P=r?.split("?")?.[0],y=(()=>{const f=["jpg","jpeg"];return f.includes(T)&&f.some(p=>P?.endsWith(p))?!0:P?.endsWith(T)})()?P:`${P}${T?`.${T}`:""}`;if(w){const f=tp(s||d?.body?.url);if(m>=3)throw this.uppy.setFileState(l,{error:this.i18n("downloadRemoteFileFailure"),meta:{...c,name:this.i18n("downloadRemoteFileFailure")}}),new Error("Download remote file failure");this.uppy.setFileState(l,{isLoading:!0,isDownloading:!0,size:null,meta:{...c,name:this.i18n("loading")}}),await fetch(f).then(async p=>await p.blob()).then(async p=>{const v=Ms(p,y);this.uppy.setFileState(l,{name:y,extension:T,type:t,data:v,preview:s||ar(v),source:n,size:v.size,isDownloading:!1,isRemote:!1,meta:{...c,name:y,filename:y}}),this.uppy.getFile(l),this.uppy.emit(F,l)}).catch(async p=>{if(console.error("Axios download remote file error: ",p),t.startsWith("image/")){const v=t.includes("svg")?"image/png":t,g=y.endsWith(".svg")?y.replace(".svg",".png"):y;try{const _=await new Promise((N,H)=>{const z=new Image;z.crossOrigin="anonymous",z.onload=()=>{const k=document.createElement("canvas");k.width=z.width,k.height=z.height;const L=k.getContext("2d");L.translate(k.width/2,k.height/2),L.drawImage(z,-z.width/2,-z.height/2,z.width,z.height),k.toBlob(N,v)},z.onerror=H,z.src=f});let A=Ms(_,g);this.uppy.setFileState(l,{name:g,extension:T,type:v,data:A,preview:s||ar(A),source:n,size:A.size,isDownloading:!1,isRemote:!1,meta:{...c,name:g,filename:g}});const I=this.uppy.getFile(l);this.uppy.emit(F,l);return}catch{}}this.uppy.setFileState(l,{isRemote:!0,isLoading:!1,errorCount:m+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(l))})}else a&&await(async()=>new Promise(p=>{this.uppy.once(F,async()=>{p()})}))()};getPreviewFromData=e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{data:s,type:n,preview:o}=r;(n.indexOf("gif")>-1||!o)&&s&&n.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(t,{preview:ar(s)})},n.indexOf("gif")>-1?1e3:0)}};prepareUpload=async e=>{await this.validateImagesRespectCropperOptions();const t=e.map(async s=>{const n=this.uppy.getFile(s);n.isDownloading&&this.uppy.emit("preprocess-progress",n,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(n)}),r=()=>{e.forEach(s=>{const n=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",n)})};return Promise.all(t).then(r)};install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async e=>{setTimeout(()=>{this.prepareUploadWrapper(e)},200)}),this.uppy.on("file-editor:complete",e=>{this.getPreviewFromData(e)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}render(){return se($e,{})}}class V3 extends he{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>se("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:se("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[se("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),se("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return se("div",{id:"ai-image",className:"ai-image",children:se("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}class W3 extends he{constructor(e,t){super(e,t),this.id=t.id,this.title=t.title,this.type="acquirer",this.uppy=e,this.i18nInit(),this.autoHide=t.autoHide??!0,typeof t.icon=="string"&&(this.icon=()=>se("div",{dangerouslySetInnerHTML:{__html:t.icon},style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}}))}getDashboard(){return this.uppy.getPlugin(this.id)?.parent}render(){return this.autoHide&&this.getDashboard()?.hideAllPanels&&this.getDashboard().hideAllPanels(),se("div",{id:this.id,className:"uppy-VirtualPlugin"})}update(){}onFirstRender(){}uninstall(){this.unmount()}}const Uc=()=>navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome");class G3 extends he{constructor(e,t){super(e,t),this.id=t?.id||"safari-paste",this.type="modifier"}onMount(){Uc()&&this.parent?.handlePaste&&document.addEventListener("paste",this.parent.handlePaste)}onUnmount(){Uc()&&this.parent?.handlePaste&&document.removeEventListener("paste",this.parent.handlePaste)}}const X3="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",K3=ee.lazy(()=>kp(()=>import("./index-Dh9agU9O.js"),[])),Mc="uploader-container",_o="uploader-dashboard",Y3='div[tabindex="-1"]',Bc=50,Q3=10,Sa=localStorage.getItem("uppy_debug"),J3=()=>en.get("x-csrf-token")?{"x-csrf-token":en.get("x-csrf-token")}:{},Z3=i=>{const{apiPathProps:e,availablePluginMap:t={},uploadedProps:r,resourcesProps:s,imageEditorProps:n={},theme:o,plugins:a,disableXssAttack:l}=i,{companionUrl:u}=Ka(e),d=J3(),c=async w=>(await Di.post("/api/image/generations",w)).data,m={...i?.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:xh,options:{quality:1,...n},alwayUse:!0},(Sa||bi()&&t.Uploaded&&!ca())&&{id:"Uploaded",plugin:u3,options:{params:r?.params}},(Sa||bi()&&t.Resources&&!ca())&&{id:"Resources",plugin:f3,options:{params:s?.params}},bi()&&(window.blocklet?.preferences?.useAiImage||t.AIImage)&&{id:"AIImage",plugin:V3,options:{companionUrl:u,companionHeaders:d},onShowPanel:w=>{function F(){setTimeout(()=>{const T=document.getElementById("ai-image");T?Hp.createRoot(T).render(_e.jsx(K3,{theme:o,api:c,restrictions:m,i18n:w.current?.getUploader()?.i18n,onSelect:P=>{const b=w.current.getUploader();b?.emit("ai-image:selected",P),P.forEach(({src:y,alt:f},p)=>{const g=`${(_=>_?.length>16?`${_?.slice(0,8)}...${_?.slice(-4)}`:_)(f)||"ai-image"}.png`;if(y&&!y.startsWith("data:"))fetch(y).then(_=>_.blob()).then(_=>{const A=new File([_],g,{type:"image/png"});b?.addFile({name:g,type:"image/png",data:A,source:"AIImage",isRemote:!1})}).catch(_=>{b?.log(`[AIImage] Failed to fetch image: ${_.message}`,"error")});else{const _={name:g,type:"image/png",data:ep(y,g),source:"AIImage",isRemote:!1};b?.addFile(_)}})}})):F()},100)}F()}},{id:"Url",plugin:Ot,options:{companionUrl:u,companionHeaders:d}},{id:"Webcam",plugin:cd,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!window?.blocklet?.UNSPLASH_KEY&&t.Unsplash&&{id:"Unsplash",plugin:xd,options:{companionUrl:u,companionHeaders:d,companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:q3,options:{companionUrl:u,companionHeaders:d,cropperOptions:n?.cropperOptions||null,disableXssAttack:l},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:Ma,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0},...(a||[]).filter(w=>w?.id).map(w=>{const{id:F,options:T,onShowPanel:P}=w;return{id:F,plugin:W3,options:T,onShowPanel:P}}),{id:"safari-paste",plugin:G3,alwayUse:!0}].filter(Boolean)};function wp(i){const{id:e,plugins:t,locale:r="en",onAfterResponse:s,onUploadFinish:n,coreProps:o,apiPathProps:a,tusProps:l,dropTargetProps:u,pluginList:d,restrictions:c,onChange:m,initialFiles:w,uploadMode:F="tus"}=i,T=jc(d,"id"),{uploaderUrl:P}=Ka(a);let b=new Ca({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Sa||""),locale:lr[r],onBeforeFileAdded:(p,v)=>{if(Object.hasOwn(v,p.id))return!1;const g=!!Fi(p.type),_=Ct(p.name)||"";if(!g&&_&&_!==p.type){const A=Zt(p);A&&(p.extension=A),p.type=_}return p},...o,restrictions:c});if(F==="presigned"){const p=P.replace(/\/uploads\/?$/,"");b.use(o3,{apiBase:p}),b.on("upload-success",async(v,g)=>{if(!g.body)return;const _={data:g.body,method:"POST",url:g.uploadURL||"",status:200,headers:{},file:v,uploadURL:g.uploadURL||""};await n?.(_),b.emitUploadSuccess(v,_)})}else b.use(Qh,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:P,async onBeforeRequest(p,v){const{hashFileName:g,id:_,meta:A}=v,I=b.getFile(_)?.mockResponse||null;p.getMethod()==="PATCH"&&I&&(p.send=()=>I);const N=Zt(v);p.setHeader("x-uploader-file-name",`${g}`),p.setHeader("x-uploader-file-id",`${_}`),p.setHeader("x-uploader-file-ext",`${N}`),p.setHeader("x-uploader-base-url",new URL(p.getURL()).pathname),p.setHeader("x-uploader-endpoint-url",P),p.setHeader("x-uploader-metadata",JSON.stringify(A,(k,L)=>typeof L=="string"?encodeURIComponent(L):L));const H=en.get("x-csrf-token");H&&p.setHeader("x-csrf-token",H);const z=window?.uploaderComponentId||window?.blocklet?.componentId;z&&p.setHeader("x-component-did",(z||"").split("/").pop())},onAfterResponse:async(p,v)=>{const g={},_=p.getUnderlyingObject();try{_.response&&(g.data=JSON.parse(_.response))}catch{g.data={}}g.method=p.getMethod().toUpperCase(),g.url=p.getURL(),g.status=_.status,g.headers={...p._headers};const A=_.getAllResponseHeaders();A&&A.split(`\r
|
|
49
49
|
`).forEach(k=>{const[L,V]=k.split(": ");L&&V&&(g.headers[L]=V)});const I=b.getFile(g.headers["x-uploader-file-id"]);if(p.getMethod()==="PATCH"&&I.mockResponse)return;if(["PATCH","POST"].includes(g.method)&&[200,500].includes(g.status)){const z=[!0,"true"].includes(g.headers["x-uploader-file-exist"]),k=sp(g.url,g.headers["x-uploader-file-name"]);g.file=I,g.uploadURL=k;const L={uploadURL:k,...g};b.setFileState(I.id,{responseResult:L}),z&&I&&(g.method==="POST"&&b.setFileState(I.id,{mockResponse:v}),b.emit("upload-success",b.getFile(I.id),{...L,body:g.data}),b.emit("postprocess-complete",b.getFile(I.id)),b.calculateTotalProgress()),g.status===200&&(await n?.(g),b.emitUploadSuccess(I,g))}s&&await s?.(_);const N=b.getState().totalProgress===100,H=b.getFiles().every(z=>z.source==="DropTarget");N&&H&&b.close()},...l});const y=({fileIDs:p,id:v})=>{p.forEach(g=>{b.setFileState(g,{uploadID:v})})};b.off("upload",y),b.on("upload",y);const f=p=>{typeof m=="function"&&m(p,b.getFiles())};return b.off("file-added",f),b.on("file-added",f),b.off("file-removed-success",f),b.on("file-removed-success",f),u&&b.use(ph,{target:document.body,onDrop:p=>{b?.open?.()},...u}),t?.forEach(p=>{if(p?.id||p){const{plugin:v,options:g}=T[p?.id||p]||{};v&&b.use(v,g)}}),np(b),w&&w?.length>0&&b.addFiles(w),b}function Pa({ref:i=void 0,...e}){const t={uploader:"/api/uploads",companion:"/api/companion",disableMediaKitPrefix:!1,disableMediaKitStatus:!1,...e?.apiPathProps},r=ee.useRef(null),s=ee.useRef(null),n=ee.useRef(0),o=Dp({open:!1,uppy:null,availablePluginMap:{},restrictions:vn(e?.coreProps?.restrictions)||{},isError:!1,uploadMode:"tus"}),a=Rp(),l=a?.palette?.mode,u=Z3({...e,apiPathProps:t,availablePluginMap:o.availablePluginMap,restrictions:o.restrictions,theme:a}),{plugins:d=u.map(S=>S.id),id:c="Uploader",popup:m=!1,onUploadFinish:w,onOpen:F,onClose:T,locale:P="en",installerProps:b}=e,y=jc(u,"id"),f=Up(S=>S?.breakpoints?.down("md")),p=jn([...d,...u.filter(S=>S.alwayUse).map(S=>S.id)]),{loading:v}=xp(async()=>{let S=bn(e?.coreProps?.restrictions)?{}:vn(e?.coreProps?.restrictions);if(!t.disableMediaKitStatus&&bi())try{await Di.get("/api/uploader/status").then(({data:D})=>{o.availablePluginMap=D.availablePluginMap,o.uploadMode=D.uploadMode||"tus",!t.disableMediaKitPrefix&&bn(e?.coreProps?.restrictions)&&(S=D.restrictions||{})}),o.isError=!1}catch{o.isError=!0}!S?.allowedFileTypes?.length&&S?.allowedFileExts&&(S.allowedFileTypes=jn(((typeof S?.allowedFileExts=="string"?S?.allowedFileExts.split(","):S?.allowedFileExts)||[])?.map(D=>Ct(D?.replaceAll(" ","")||""))?.filter(D=>D)),delete S.allowedFileExts),S.maxFileSize&&typeof S.maxFileSize=="string"&&(S.maxFileSize=Ap.parseSize(S.maxFileSize,{iec:!1})||void 0),o.restrictions=vn(S)},{refreshDeps:[JSON.stringify({apiPathProps:t,restrictionsProps:e?.coreProps?.restrictions})]}),g=typeof o.restrictions?.allowedFileTypes=="object"&&o.restrictions?.allowedFileTypes?.length===0,_=ee.useMemo(()=>jn(o.restrictions?.allowedFileTypes?.flatMap(S=>{if(S.endsWith("/*")){const D=S.split("/")?.[0];switch(D){case"image":return["jpg","jpeg","png","gif","svg","webp","bmp","tiff","avif","heic","ico","apng"];case"video":return["mp4","webm","mov","avi","wmv","flv","mkv","mpg","mpeg","3gp","m4v","ts","m2ts"];case"audio":return["mp3","wav","ogg","aac","flac","m4a","wma","opus","mid","midi","amr"];case"text":return["txt","html","htm","css","csv","md","rtf","xml","json","js","ts","jsx","tsx"];case"application":return["pdf","doc","docx","xls","xlsx","ppt","pptx","zip","rar","7z","tar","gz","exe","msi","apk","dmg","iso"];case"font":return["ttf","otf","woff","woff2","eot"];case"chemical":return["mol","pdb","cml","xyz"];case"model":return["obj","stl","gltf","glb","fbx","3ds","dae"];case"message":return["eml","msg","vcf","ics"];default:return D}}return Fi(S)})||[])?.filter(Boolean)?.join(", ")||"",[o.restrictions?.allowedFileTypes]);let A="";g?A=Gr(lr,`${P}.strings.noAllowedFileTypes`,"No allowed file types"):o.restrictions?.allowedFileTypes?.length&&_&&(A=Gr(lr,`${P}.strings.allowedFileTypes`,"Allowed file types: ")+_),(bn(A)||["undefined","null",void 0,null].includes(A))&&(A=""),Ip("esc",S=>{o.open&&(S.stopPropagation(),S.preventDefault(),H())},{useCapture:!0}),ee.useEffect(()=>{ip(t),o.uppy=wp({...e,id:c,plugins:p,apiPathProps:t,pluginList:u,restrictions:o.restrictions,uploadMode:o.uploadMode}),o.uppy.open=N,o.uppy.close=H,o.uppy.openPlugin=I;const S=x=>{const{onShowPanel:M}=y[x];M?.(i)};o.uppy.off("dashboard:show-panel",S),o.uppy.on("dashboard:show-panel",S);const D=(x,M,q,W)=>{const ne=`${W.toLowerCase()}Props`,re=q[ne]?.onSelectedFiles;if(typeof re=="function"){const Y=x.map(_t=>{const Wr={name:_t.id||_t.fileUrl?.split("/")?.slice(-1)?.[0],type:_t.mimetype||Ct(_t.fileUrl)||"",data:"",preview:_t.fileUrl,source:W,isRemote:!0},yn=M.uppy.addFile(Wr);return{..._t,uppyFile:M.uppy.getFile(yn)}});re?.(Y)}else{const Y=[],_t=[],Wr=`Mock-${Math.random().toString(36).substring(2,15)}`;Promise.all(x.map(async yn=>{const ni=lp(yn);ni&&(ni.uploadID=Wr,Y.push(ni)),await w?.(ni),M.uppy.emitUploadSuccess(ni.file,ni)})).then(()=>{M.uppy.close()}).finally(()=>{M.uppy.emit("complete",{failed:_t,successful:Y,uploadID:Wr})})}};[{name:"Uploaded",event:"uploaded:selected"},{name:"Resources",event:"resources:selected"}].forEach(({name:x,event:M})=>{p.includes(x)&&(o.uppy.off(M),o.uppy.on(M,q=>D(q,o,e,x)))})},[JSON.stringify({id:c,plugins:p,apiPathProps:t,locale:P,restrictions:o.restrictions,theme:a,uploadMode:o.uploadMode})]);function I(S){if(S=S.replace(/\s/g,""),["MyDevice",...p.map(O=>O.id||O)].map(O=>O.toLowerCase()).includes(S.toLowerCase())){let O=`div[data-uppy-acquirer-id="${S}"] > button`;document?.getElementById(_o)?.querySelector(O)?.click?.()}}function N(S){o.open=!0,S&&setTimeout(()=>{I(S)},200),o.uppy.emitOpen(),F?.(),s.current&&(clearInterval(s.current),s.current=null),n.current=0,s.current=setInterval(()=>{const D=r.current?.querySelector(Y3);n.current+=1,(n.current>Bc||D&&D!==document.activeElement)&&(D&&D!==document.activeElement?(D.focus?.(),console.info("[Uploader] Trigger auto focus overlay success")):n.current>Bc&&console.info("[Uploader] Auto focus overlay failed after maximum attempts"),clearInterval(s.current),s.current=null)},Q3)}function H(){s.current&&(clearInterval(s.current),s.current=null),o.uppy.getPlugin(_o)?.hideAllPanels(),o.open=!1,o.uppy.emitClose(),T?.(),setTimeout(()=>{o.uppy.getState().totalProgress===100&&(o.uppy.setState({files:{},currentUploads:{}}),o.uppy.calculateTotalProgress())},500)}const z=(S,D,O)=>{S.forEach(x=>{o.uppy.addFile({name:x.name,type:x.type,data:x,source:D})}),O&&o.uppy.upload()},k=S=>{const D=document.createElement("input");D.type="file",D.style.display="none",D.accept=S?.accept??o.restrictions?.allowedFileTypes?.join(",")??"",D.multiple=S?.multiple??o.restrictions?.maxNumberOfFiles!==1,D.onchange=O=>{const x=O.target,M=Array.from(x.files||[]);z(M,"local",S?.autoUpload!==!1),document.body.removeChild(D)},document.body.appendChild(D),D.click()},L=S=>{const D=S?.autoUpload!==!1;let O=0;return{onDragEnter:x=>{x.preventDefault(),x.stopPropagation(),O++,x.dataTransfer?.items?.length&&x.currentTarget.setAttribute("data-dragging","true")},onDragLeave:x=>{x.preventDefault(),x.stopPropagation(),O--,O===0&&x.currentTarget.removeAttribute("data-dragging")},onDragOver:x=>{x.preventDefault(),x.stopPropagation()},onDrop:x=>{x.preventDefault(),x.stopPropagation(),x.currentTarget.removeAttribute("data-dragging"),O=0;const M=Array.from(x.dataTransfer?.files||[]);M.length&&z(M,"drop",D)},onClick:S?.noClick?void 0:()=>{k({autoUpload:D})}}};ee.useImperativeHandle(i,()=>({getUploader:()=>o.uppy,open:N,close:H,triggerFileInput:k,getDropzoneProps:L,addFilesToUppy:z}));const V=m?Mp:ee.Fragment,E=m?{sx:{zIndex:99999999999,"& > *":{display:o.open?"block":"none"},display:"flex",justifyContent:"center",alignItems:"center",...e?.wrapperProps?.sx},invisible:!0,open:o.open,onClick:S=>{document.activeElement===document.body&&(S.stopPropagation(),H())},...e.wrapperProps}:{...e.wrapperProps},C=f?"42px":"40px";return _e.jsx(V,{...E,children:_e.jsxs(Op,{onClose:H,did:X3,disabled:!o.open,...b,children:[_e.jsx(Bp,{styles:()=>({".uppy-is-drag-over":{"&::after":{transition:"all 0.3s ease-in-out",border:"2px dashed #bbb !important",borderRadius:4,background:"rgba(234, 234, 234, 0.5)"}}})}),_e.jsxs(To,{className:"uploader-container",ref:r,id:Mc,onClick:S=>S.stopPropagation(),sx:{position:"relative",width:f?"90vw":720,animation:o.open?"uppy-Dashboard-fadeIn 150ms ease-in-out":"none","@keyframes uppy-Dashboard-fadeIn":{from:{opacity:0},to:{opacity:1}},".uppy-Dashboard-inner":{borderColor:"divider"},".uppy-ProviderBrowserItem > *":{transition:"all 0.3s ease-in-out"},".uppy-ProviderBrowserItem-inner":{flex:1,color:"transparent","img, object":{objectFit:"contain !important"}},".uppy-ProviderBrowserItem-checkbox":{backgroundColor:`${a?.palette?.primary?.main} !important`},".uppy-Dashboard-Item-previewInnerWrap, .uppy-ProviderBrowserItem-inner":{boxShadow:"none !important",background:"repeating-conic-gradient(#e0e0e0 0 25%,#fff 0 50%) 50%/18px 18px !important"},".uppy-ProviderBrowserItem--selected .uppy-ProviderBrowserItem-inner":{boxShadow:S=>`0 0 0 3px ${S.palette.primary.main} !important`},".uploaded-add-item":{background:a.palette.mode==="dark"?"rgba(255,255,255,0.1) !important":"rgba(0,0,0,0.1) !important",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out","&:hover":{background:a.palette.mode==="dark"?"rgba(255,255,255,0.13) !important":"rgba(0,0,0,0.13) !important"}},".uppy-StatusBar-actions, .uppy-ProviderBrowser-footer":{justifyContent:"flex-end"},".uppy-ProviderBrowser-footer":{button:{marginRight:"0 !important","&:last-child":{display:"none"}}},".uppy-DashboardContent-panelBody":{height:0},".uppy-Dashboard-AddFiles-title":{whiteSpace:"normal"},".uppy-ProviderBrowser-body":{height:"100%"},".uppy-ProviderBrowser-list":{height:"fit-content",maxHeight:"100%",bgcolor:"background.paper"},".uploaded, .ai-image":{width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column","& > div":{width:"100%",bgcolor:"background.paper"},"& .uppy-ProviderBrowser-header":{display:"none"}},"& .uppy-Url":{width:"100% !important",display:"flex",justifyContent:"center","& input":{width:"70%"}},"& .uppy-Dashboard-browse, & .uppy-DashboardContent-addMore, & .uppy-DashboardContent-back, & .uppy-StatusBar-actionBtn--done, & .uppy-DashboardContent-save, & .uppy-StatusBar-actionBtn--upload":{color:`${a?.palette?.primary?.main}`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{color:`${a?.palette?.primary?.main}`,filter:"brightness(1.2)"}},"& .uppy-Dashboard-browse":{textDecoration:"underline !important"},"& .uppy-c-btn-primary":{backgroundColor:`${a?.palette?.primary?.main} !important`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{backgroundColor:`${a?.palette?.primary?.main} !important`,filter:"brightness(1.2)"}},"& .button-color-style":{border:"1px solid",borderColor:"primary.main",color:"primary.main",backgroundColor:"transparent",transition:"all 0.3s ease-in-out","&:hover":{filter:"brightness(1.2)"}},"& .button-color-style-active":{backgroundColor:"primary.main",color:"white"}},children:[m&&_e.jsx(Lp,{"aria-label":"close",onClick:H,sx:{color:l==="dark"?"#ddd":"#fafafa",position:"absolute",...f?{bottom:`calc(0px - ${C} - 16px)`,left:`calc(50vw - ${C} - 8px)`}:{right:`calc(0px - ${C} - 16px)`,top:-12}},children:_e.jsx(Np,{sx:{fontSize:C}})}),v&&_e.jsxs(To,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",zIndex:99999999999,flexDirection:"column",background:"rgba(256, 256, 256, 0.2)",backdropFilter:"blur(4px)",borderRadius:1,pointerEvents:"none"},children:[_e.jsx(zp,{size:32}),_e.jsx($p,{variant:"body2",color:"primary",sx:{mt:1.5,fontWeight:"bold"},children:Gr(lr,`${P}.strings.loadingStatus`,"Loading...")})]}),o.uppy&&_e.jsx(rh,{inline:!0,target:`#${Mc}`,id:_o,disabled:g||o.isError,uppy:o.uppy,plugins:p,fileManagerSelectionType:o.restrictions?.maxNumberOfFiles===1?"files":"both",proudlyDisplayPoweredByUppy:!1,showProgressDetails:!0,disableThumbnailGenerator:!0,theme:l==="dark"?"dark":"light",note:o.isError?Gr(lr,`${P}.strings.error`,"Error"):A,doneButtonHandler:H,...e.dashboardProps})]},"uploader-container")]})},"uploader-wrapper")}const ol=ee.createContext(null);function Sp(){const i=ee.useContext(ol);if(!i)throw new Error("useUploaderContext must be used within an UploaderProvider");return i}function ew({onChange:i,children:e,...t}){const r=Sp(),s=()=>{const n=r?.current?.getUploader();n?.open(),i&&n.onceUploadSuccess((...o)=>{i(...o)})};return _e.jsx(To,{onClick:s,...t,children:e})}function tw({children:i,popup:e,...t}){const r=ee.useRef(null),s=ee.useMemo(()=>e?jp.createPortal(_e.jsx(Pa,{ref:r,popup:!0,...t},"uploader"),document.body):_e.jsx(Pa,{ref:r,popup:!1,...t},"uploader"),[r,e,t]);return _e.jsxs(ol.Provider,{value:r,children:[i,s]})}const Sw=Object.freeze(Object.defineProperty({__proto__:null,CLOSE:Ls,OPEN:Bs,UPLOADER_UPLOAD_SUCCESS:da,Uploader:Pa,UploaderContext:ol,UploaderProvider:tw,UploaderTrigger:ew,api:rp,base64ToFile:ep,blobToFile:Ms,createImageUrl:Lr,getDownloadUrl:tp,getExt:Zt,getMediaKitComponent:bi,getMimeExtension:Fi,getObjectURL:ar,getUploaderEndpoint:Ka,getUrl:sp,initUploader:wp,initUppy:np,isBlob:Zh,isMediaKit:ca,isSvgFile:ap,lookupMimeType:Ct,mediaKitApi:Di,mediaKitMountPoint:at,mockUploaderFileResponse:lp,parseStringToDot:op,get prefixPath(){return kt},setPrefixPath:ip,useUploaderContext:Sp},Symbol.toStringTag,{value:"Module"}));export{Sw as i,jc as k,Di as m};
|